:root {
  color-scheme: light;
  --background: #f7f8f4;
  --surface: #ffffff;
  --text: #202124;
  --muted: #5f6872;
  --line: #dde4dc;
  --accent: #126e57;
  --accent-strong: #0c4f3f;
  --warning: #b95018;
  --shadow: 0 12px 32px rgba(30, 42, 36, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

.site-header,
main,
.site-footer {
  width: min(100%, 430px);
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 16px 8px;
}

.brand {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  font-size: 14px;
}

.site-nav a,
.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

main {
  padding: 18px 16px 44px;
}

.hero {
  margin: 14px 0 20px;
}

.eyebrow,
.small-label {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 30px;
  line-height: 1.25;
}

h2 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.35;
}

.hero p,
.section-heading p,
.content-section p,
.content-page p {
  color: var(--muted);
}

.tool-panel,
.list-section,
.content-section,
.content-page {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tool-panel,
.content-section,
.content-page {
  padding: 18px;
}

.converter-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfa;
  color: var(--text);
}

textarea {
  min-height: 132px;
  resize: vertical;
}

.preset-row {
  display: grid;
  gap: 8px;
}

.preset-row button {
  padding: 0 12px;
}

.token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -6px;
}

.token-row button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--accent);
  font-weight: 700;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.item-actions button,
.text-button {
  padding: 0 12px;
}

.notice {
  min-height: 22px;
  margin: 12px 2px 0;
  color: var(--warning);
  font-size: 14px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.text-button {
  min-height: 36px;
  color: var(--muted);
}

.item-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-item {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.history-item:last-child {
  border-bottom: 0;
}

.item-text {
  display: grid;
  gap: 4px;
}

.item-text strong {
  overflow-wrap: anywhere;
}

.item-text span,
.empty {
  color: var(--muted);
  font-size: 13px;
}

.empty {
  margin: 0;
  padding: 16px;
}

.content-page {
  max-width: 430px;
}

.content-page h1 {
  margin-bottom: 16px;
}

.content-page h2 {
  margin-top: 26px;
}

.inline-link {
  font-weight: 700;
}

.site-footer {
  display: grid;
  gap: 10px;
  padding: 24px 16px 36px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.is-hidden {
  display: none;
}

@media (min-width: 620px) {
  .history-item {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .item-actions {
    justify-content: flex-end;
  }
}
