:root {
  --bg: #eef3f5;
  --surface: #fff;
  --text: #15232c;
  --muted: #4d5d68;
  --line: #d0dbe1;
  --header: #123c45;
  --accent: #0f6a62;
  --accent-hover: #0b524c;
  --accent-soft: #e4f4f1;
  --tax: #9a3b12;
  --tax-hover: #7c2d0c;
  --tax-bg: #fff6ee;
  --tax-line: #efd2b5;
  --tax-head: #8a3410;
  --main-bg: #f3f8f8;
  --main-line: #c5d9d6;
  --error: #9f1239;
  --error-bg: #fde8ee;
  --focus: #0f6a62;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(18, 60, 69, 0.07);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.site-header {
  width: 100%;
  background: var(--header);
  color: #fff;
}

.site-header-inner,
main,
.site-footer,
.ad-slot-leader {
  width: min(1120px, calc(100% - 24px));
  margin-left: auto;
  margin-right: auto;
}

.site-header-inner {
  padding: 14px 0;
}

.logo {
  font-weight: 750;
  text-decoration: none;
  color: #fff;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.logo:hover { color: #d7efe9; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
}

.site-nav a {
  color: #d7efe9;
  text-decoration: none;
  font-size: 0.88rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: #fff;
}

.site-nav a[aria-current="page"] {
  font-weight: 700;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.breadcrumbs a { text-decoration: none; }

.breadcrumbs-sep { opacity: 0.5; }

h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  line-height: 1.2;
}

.lead {
  margin: 16px 0 14px;
  color: var(--muted);
  font-size: 0.98rem;
}

.workspace {
  display: grid;
  gap: 16px;
}

.convert-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.field label,
.field legend {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.field-sep { border: 0; margin: 0; padding: 0; min-width: 0; }

input[type="text"],
input[type="search"],
select,
.result-text {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #9aaeb6;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

input[type="text"]:focus,
select:focus,
.result-text:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 106, 98, 0.16);
  outline: none;
}

#summ {
  font-size: 1.28rem;
  font-weight: 700;
}

.hint, .empty-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.error {
  margin: 8px 0 0;
  padding: 8px 10px;
  background: var(--error-bg);
  color: var(--error);
  border-radius: 8px;
  font-size: 0.9rem;
}

.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  font-weight: 500;
}

.form-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
}

.submit-btn {
  margin-top: 12px;
  min-height: 44px;
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.submit-btn:hover { background: var(--accent-hover); }

.results {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.results-toolbar h2 {
  margin: 0;
  font-size: 1.05rem;
}

.result-group {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.result-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 12px 16px;
}

.result-group-head h3 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.result-group-note {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.85;
}

.result-group .cards {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.result-group-tax {
  background: var(--tax-bg);
  border: 1px solid var(--tax-line);
}

.result-group-tax .result-group-head {
  background: #f3d2b3;
  color: var(--tax-head);
  border-bottom: 1px solid var(--tax-line);
}

.result-group-main {
  background: var(--main-bg);
  border: 1px solid var(--main-line);
}

.result-group-main .result-group-head {
  background: #d7e8e6;
  color: #164a4d;
  border-bottom: 1px solid var(--main-line);
}

.btn, .btn-copy, .btn-pin {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.result-group-tax .btn-copy {
  background: var(--tax);
  border-color: var(--tax);
}

.result-group-tax .btn-copy:hover {
  background: var(--tax-hover);
}

.btn-pin {
  background: #fff;
  color: var(--accent);
}

.result-group-tax .btn-pin {
  color: var(--tax);
  border-color: var(--tax);
}

.btn-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.btn-pin svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform 0.15s ease;
}

.btn-pin[aria-pressed="true"] {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px currentColor;
}

.btn-pin[aria-pressed="true"] svg {
  transform: rotate(-35deg);
}

.btn:hover, .btn-copy:hover { background: var(--accent-hover); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.result-group-tax .card {
  border-color: var(--tax-line);
  background: #fffdf9;
}

.result-group-main .card {
  border-color: var(--main-line);
}

.card.is-pinned {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.result-group-tax .card.is-pinned {
  border-color: var(--tax);
  box-shadow: inset 3px 0 0 var(--tax);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.card-head h3 {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 700;
}

.card-actions { display: flex; gap: 6px; }

.result-text {
  min-height: 56px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #fff;
}

.ad-slot {
  background: #e3eaed;
  border: 1px dashed #b7c5cb;
  border-radius: var(--radius);
  color: #6a7a82;
}

.ad-slot-leader {
  min-height: 90px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.ad-slot-box { min-height: 250px; }

.ad-placeholder {
  min-height: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ad-rail {
  display: grid;
  gap: 16px;
}

.page {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin: 16px 0;
}

.page h2 { font-size: 1.05rem; }

.seo-content,
.seo-faq,
.related {
  margin: 28px 0 8px;
  max-width: 46rem;
}

.seo-content h2,
.seo-faq h2,
.related h2 {
  margin: 20px 0 8px;
  font-size: 1.08rem;
}

.seo-content p,
.seo-faq p {
  margin: 0 0 8px;
  color: var(--muted);
}

.seo-faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
}

.seo-faq summary {
  cursor: pointer;
  font-weight: 650;
}

.related ul {
  margin: 0;
  padding-left: 1.1rem;
}

.related li { margin: 4px 0; }

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.footer-col h2 {
  margin: 0 0 4px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-col a {
  display: block;
  color: var(--muted);
  text-decoration: none;
}

.footer-col a:hover { color: var(--accent); }

.form-row-number {
  grid-template-columns: 1fr;
}

.site-footer {
  margin-top: auto;
  padding: 20px 0 28px;
  color: var(--muted);
}

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

@media (min-width: 768px) {
  h1 { font-size: 1.6rem; }
  .form-row {
    grid-template-columns: 1.4fr 0.9fr 1fr auto;
    align-items: start;
  }
  .form-row-number {
    grid-template-columns: 1.4fr auto;
  }
  .field-sep .choice { min-height: 32px; }
  .footer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
  .ad-rail { position: sticky; top: 12px; }
}

@media (min-width: 1024px) {
  .convert-form { padding: 18px 18px 16px; }
}

@media (max-width: 959px) {
  .ad-rail .ad-slot-box:last-child { display: none; }
}

@media (max-width: 375px) {
  html { font-size: 15px; }
  .lead { display: none; }
  .ad-slot-leader { min-height: 60px; }
  .result-group-note { display: none; }
}
