:root {
  color-scheme: light;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --accent-soft: #ecfdf5;
  --ink: #202326;
  --muted: #667085;
  --line: #dfe3e6;
  --surface: #f8faf9;
  --danger: #b42318;
  --radius: 14px;
  font-family: Inter, "Nirmala UI", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #fff; }
body { margin: 0; color: var(--ink); background: #fff; line-height: 1.55; }
a { color: inherit; }
button, textarea, input { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid rgb(15 118 110 / 24%);
  outline-offset: 3px;
}

.site-header {
  width: min(1120px, calc(100% - 40px));
  min-height: 70px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid #eef0f2;
}

.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 1.08rem; font-weight: 750; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; color: #fff; background: var(--accent); border-radius: 9px; font-size: 1.15rem; }
nav { display: flex; gap: 24px; }
nav a { color: #4a5057; font-size: .91rem; text-decoration: none; }
nav a:hover, nav a:focus-visible { color: var(--accent); }

main { width: min(1050px, calc(100% - 40px)); margin: 0 auto; }
.hero { max-width: 760px; margin: 92px auto 52px; text-align: center; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: .78rem; font-weight: 760; letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: 0; color: #17191b; font-size: clamp(2.05rem, 5vw, 3.8rem); line-height: 1.08; letter-spacing: -.045em; }
.hero > p:last-child, .page-heading > p:last-child { color: var(--muted); font-size: 1.08rem; }

.tool-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; max-width: 900px; margin: auto; }
.tool-card { min-height: 138px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 26px; color: inherit; text-decoration: none; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.tool-card:hover, .tool-card:focus-visible { border-color: #96c8c2; transform: translateY(-2px); box-shadow: 0 12px 34px rgb(16 24 40 / 7%); outline: none; }
.tool-card-wide { grid-column: 1 / -1; }
.tool-icon { display: grid; place-items: center; width: 54px; height: 54px; color: var(--accent); background: var(--accent-soft); border-radius: 12px; font-size: 1.25rem; font-weight: 700; }
.document-icon { font-family: system-ui, sans-serif; }
.tool-card strong, .tool-card small { display: block; }
.tool-card strong { margin-bottom: 3px; font-size: 1.12rem; }
.tool-card small { color: var(--muted); font-size: .9rem; }
.arrow { color: #99a1aa; font-size: 1.2rem; }
.trust-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 28px; margin: 42px auto 84px; color: var(--muted); font-size: .84rem; }
.trust-row span::before { content: "✓"; margin-right: 7px; color: var(--accent); font-weight: 700; }

.converter-shell { max-width: 1120px; margin-top: 58px; margin-bottom: 76px; }
.page-heading { max-width: 760px; margin-bottom: 30px; }
.page-heading h1 { font-size: clamp(2rem, 4vw, 3.1rem); }
.text-converter, .document-form { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.text-converter { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "input output" "actions actions"; gap: 16px; }
.text-panel { min-width: 0; display: flex; flex-direction: column; gap: 9px; color: #30343a; font-weight: 680; }
.input-panel { grid-area: input; }
.output-panel { grid-area: output; }
.text-panel > span { display: flex; justify-content: space-between; align-items: center; min-height: 25px; }
.text-panel small { color: var(--muted); font-size: .76rem; font-weight: 500; }
textarea, .result-area { width: 100%; min-height: 350px; padding: 18px; color: var(--ink); border: 1px solid #cfd5d9; border-radius: 11px; outline: none; background: #fff; resize: vertical; }
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(15 118 110 / 10%); }
.result-area { overflow: auto; font-weight: 400; }
.empty-state { margin: 0; color: #9299a2; }
.actions { grid-area: actions; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; text-decoration: none; font-weight: 720; }
.button.primary { color: #fff; background: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { color: #34383d; border-color: #ccd2d6; background: #fff; }
.button.text-button { color: var(--accent); background: transparent; }
.button.large { min-height: 52px; padding-inline: 26px; }
.working { color: var(--muted); font-size: .88rem; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }
.note, .privacy-note { margin: 14px 4px 0; color: var(--muted); font-size: .85rem; }
.result-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--accent); font-weight: 700; }
.copy-button { min-height: 44px; padding: 6px 11px; color: var(--accent); border: 1px solid #b9d8d4; border-radius: 7px; background: #fff; cursor: pointer; }
.converted-output { min-height: 290px; font-weight: 400; }
.error-message { padding: 13px 15px; color: var(--danger); border: 1px solid #f3c6c2; border-radius: 9px; background: #fff5f4; font-weight: 580; }

.document-shell { max-width: 900px; }
.direction-choice { display: flex; gap: 12px 28px; margin: 0 0 18px; padding: 0; border: 0; }
.direction-choice legend { margin-bottom: 8px; color: #3a3e43; font-weight: 720; }
.direction-choice label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.direction-choice input { accent-color: var(--accent); }
.drop-zone { min-height: 330px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 34px; text-align: center; border: 2px dashed #b8c4c6; border-radius: 15px; background: #fff; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.drop-zone.dragging, .drop-zone:hover { border-color: var(--accent); background: #f3fffc; }
.drop-zone input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.upload-symbol { display: grid; place-items: center; width: 62px; height: 62px; margin-bottom: 5px; color: var(--accent); background: var(--accent-soft); border-radius: 50%; font-size: 1.8rem; }
.drop-zone strong { font-size: 1.22rem; }
.drop-zone > span:not(.upload-symbol), .drop-zone small { color: var(--muted); }
.select-link { color: var(--accent); font-weight: 700; }
.selected-file { margin: 14px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.document-actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.document-result { margin-top: 16px; }
.download-card { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 18px; color: #105d55; border: 1px solid #a9d9d2; border-radius: 11px; background: var(--accent-soft); }
.privacy-note { display: grid; gap: 2px; margin: 20px 0 0; }
.simple-message { padding-block: 100px; text-align: center; }

.content-sections { max-width: 900px; margin: 72px auto 10px; }
.content-sections > section { padding: 34px 0; border-top: 1px solid var(--line); }
.content-sections h2, .info-page h2 { margin: 0 0 14px; color: #202326; font-size: clamp(1.35rem, 3vw, 1.8rem); letter-spacing: -.025em; }
.content-sections h3 { margin: 0 0 7px; font-size: 1.04rem; }
.content-sections p, .content-sections li, .info-page p { color: #555d65; line-height: 1.72; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 22px 0 0; padding: 0; list-style: none; counter-reset: steps; }
.steps li { position: relative; padding: 20px 18px 18px 54px; border: 1px solid var(--line); border-radius: 12px; background: #fff; counter-increment: steps; }
.steps li::before { content: counter(steps); position: absolute; top: 18px; left: 17px; display: grid; place-items: center; width: 26px; height: 26px; color: #fff; border-radius: 50%; background: var(--accent); font-weight: 750; }
.steps strong, .steps span { display: block; }
.steps strong { color: #2a2e32; }
.steps span { margin-top: 4px; font-size: .9rem; }
.comparison-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.comparison-grid article { padding: 21px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.comparison-grid p { margin-bottom: 0; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: #2a2e32; cursor: pointer; font-weight: 700; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.35rem; font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: -2px 0 18px; }

.info-page { max-width: 760px; padding: 72px 0 90px; }
.info-page article > p:first-of-type { color: #3f464d; font-size: 1.08rem; }
.info-page h1 { margin-bottom: 20px; font-size: clamp(2rem, 5vw, 3.1rem); }
.info-page h2 { margin-top: 38px; }

.site-footer { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 34px; display: flex; justify-content: space-between; gap: 18px; color: var(--muted); border-top: 1px solid #eef0f2; font-size: .82rem; }
.site-footer a { color: var(--muted); }
.footer-links { display: flex; gap: 18px; }

@media (max-width: 760px) {
  .site-header { min-height: 62px; }
  .site-header nav { display: none; }
  .hero { margin-top: 58px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card-wide { grid-column: auto; }
  .converter-shell { margin-top: 38px; }
  .text-converter { grid-template-columns: 1fr; grid-template-areas: "input" "actions" "output"; }
  textarea, .result-area { min-height: 255px; }
  .steps { grid-template-columns: 1fr; }
  .comparison-grid { grid-template-columns: 1fr; }
  .direction-choice { flex-direction: column; gap: 9px; }
  .drop-zone { min-height: 270px; padding: 24px; }
  .site-footer { flex-direction: column; }
}

@media (max-width: 430px) {
  .site-header, main, .site-footer { width: min(100% - 24px, 1120px); }
  .brand { font-size: .92rem; }
  .text-converter, .document-form { padding: 13px; border-radius: 13px; }
  .actions .button { flex: 1 1 auto; }
  .button.text-button { flex-basis: 100%; }
  .content-sections { margin-top: 52px; }
  .content-sections > section { padding: 28px 0; }
  .tool-card { padding: 20px; grid-template-columns: auto 1fr; }
  .tool-card .arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
