:root {
  --bg: #f6fbf9;
  --surface: #ffffff;
  --surface-muted: #eef7f4;
  --text: #10201d;
  --muted: #5a6b67;
  --line: #d9e7e3;
  --primary: #0f766e;
  --primary-strong: #115e59;
  --accent: #2563eb;
  --warning: #a16207;
  --danger: #b91c1c;
  --success: #15803d;
  --shadow: 0 18px 50px rgba(15, 118, 110, 0.12);
  --radius: 8px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.convert-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid rgba(217, 231, 227, 0.85);
  background: rgba(246, 251, 249, 0.92);
  backdrop-filter: blur(14px);
}

.convert-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.brand-glyph {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

.convert-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.convert-nav a,
.nav-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}

.convert-nav a:hover,
.nav-button:hover,
.convert-nav a:focus-visible,
.nav-button:focus-visible {
  background: var(--surface-muted);
  color: var(--text);
  outline: 2px solid transparent;
}

main {
  min-height: 70dvh;
}

.alerts,
.hero-shell,
.landing-hero,
.workspace,
.steps-band,
.feature-grid,
.pricing-preview,
.page-head,
.plans-grid,
.account-head,
.account-grid,
.account-panel,
.result-page,
.auth-shell {
  width: min(1160px, calc(100% - 32px));
  margin-inline: auto;
}

.alerts {
  margin-top: 18px;
}

.alert {
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.alert.success {
  border-color: #bbf7d0;
  color: var(--success);
}

.alert.error {
  border-color: #fecaca;
  color: var(--danger);
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(28px, 6vw, 76px);
  align-items: center;
  min-height: min(760px, calc(100dvh - 72px));
  padding: clamp(44px, 7vw, 84px) 0 42px;
}

.hero-copy h1,
.landing-hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(38px, 7vw, 78px);
  line-height: 1.06;
  letter-spacing: 0;
}

.page-head h1,
.account-head h1,
.result-toolbar h1,
.auth-shell h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.1;
  letter-spacing: 0;
}

.hero-lead,
.page-head p,
.account-head p,
.auth-shell p {
  max-width: 660px;
  color: var(--muted);
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.landing-hero {
  display: block;
  padding: clamp(20px, 3.2vw, 40px) 0 16px;
}

.landing-hero-copy {
  min-width: 0;
}

.landing-hero h1 {
  max-width: 920px;
  font-size: clamp(38px, 4.2vw, 58px);
  line-height: 1.06;
}

.landing-hero .hero-lead {
  margin: 16px 0 0;
}

.landing-hero-aside {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.landing-hero-aside .limit-strip {
  width: auto;
  margin-top: 0;
}

.hero-actions,
.inline-actions,
.cookie-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary,
.secondary,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover,
.primary:focus-visible {
  background: var(--primary-strong);
}

.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.secondary:hover,
.secondary:focus-visible {
  border-color: var(--primary);
}

.full {
  width: 100%;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.limit-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding: 12px 14px;
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.limit-strip span {
  color: var(--primary);
  font-weight: 900;
}

.limit-strip p {
  margin: 0;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(320px, 1.02fr);
  gap: 24px;
  align-items: start;
  margin-top: -6px;
}

.workspace-first {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  margin-top: 0;
  padding: 0 0 18px;
}

.upload-panel,
.result-panel,
.account-panel,
.auth-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 32px rgba(15, 32, 29, 0.06);
}

.upload-panel,
.result-panel {
  padding: clamp(18px, 3vw, 28px);
}

.workspace-first .upload-panel,
.workspace-first .result-panel {
  min-height: 560px;
}

.upload-workspace .result-panel {
  display: flex;
  flex-direction: column;
}

.upload-workspace .empty-result,
.upload-workspace .paywall {
  flex: 1;
}

.section-head h2,
.account-panel h2,
.result-toolbar h1,
.auth-shell h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.14;
  letter-spacing: 0;
}

.upload-panel .section-head h2,
.result-panel .section-head h2 {
  font-size: clamp(23px, 2.2vw, 30px);
  line-height: 1.12;
}

.section-head p:not(.eyebrow) {
  color: var(--muted);
}

.compact h2 {
  font-size: 26px;
}

.dropzone {
  display: grid;
  gap: 14px;
}

.title-input,
.auth-card input,
.stack-form input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.file-drop {
  display: grid;
  min-height: 168px;
  place-items: center;
  padding: 24px;
  border: 1.5px dashed #8ac8bf;
  border-radius: 8px;
  background: #f8fffd;
  text-align: center;
  cursor: pointer;
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-drop svg,
.empty-result svg {
  width: 42px;
  height: 42px;
  color: var(--primary);
}

.file-drop small,
.form-note,
.muted {
  color: var(--muted);
}

.file-list {
  display: grid;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
}

.progress-box {
  display: grid;
  gap: 14px;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 240ms ease-out;
}

.page-statuses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
}

.page-pill {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 14px;
}

.page-pill.done {
  color: var(--success);
}

.page-pill.failed {
  color: var(--danger);
}

.result-ready {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
}

.result-ready p {
  margin: 0;
  color: var(--muted);
}

.empty-result,
.paywall {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 24px;
  border-radius: 8px;
  background: var(--surface-muted);
  text-align: center;
}

.steps-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 42px;
}

.steps-band article,
.feature-grid article,
.plan-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.steps-band span {
  color: var(--primary);
  font-weight: 900;
}

.steps-band h2,
.feature-grid h3,
.plan-card h3,
.plan-card h2 {
  margin: 10px 0 8px;
  font-size: 20px;
  letter-spacing: 0;
}

.steps-band p,
.feature-grid p,
.plan-card p,
.plan-card dd,
.plan-card dt {
  color: var(--muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 56px;
}

.feature-grid .section-head {
  grid-column: 1 / -1;
}

.feature-grid svg {
  width: 26px;
  height: 26px;
  color: var(--primary);
}

.pricing-preview {
  margin-top: 56px;
  padding: 34px;
  border-radius: var(--radius);
  background: #e9f8f4;
}

.pricing-preview .plans-row {
  margin-top: 18px;
  margin-bottom: 24px;
}

.plans-row,
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.plans-grid {
  margin-top: 24px;
}

.price {
  margin: 10px 0;
  color: var(--text) !important;
  font-size: 34px;
  font-weight: 900;
}

.plan-card.large {
  display: grid;
  gap: 14px;
}

.plan-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.plan-card dl div {
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-muted);
}

.plan-card dt {
  font-size: 13px;
}

.plan-card dd {
  margin: 2px 0 0;
  color: var(--text);
  font-weight: 800;
}

.page-head,
.account-head,
.result-toolbar,
.auth-shell {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 44px 0 22px;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.account-panel {
  margin-top: 14px;
  padding: 22px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.stack-form,
.auth-card {
  display: grid;
  gap: 14px;
}

.stack-form label,
.auth-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.auth-shell {
  align-items: center;
  min-height: 72dvh;
}

.compact-auth {
  min-height: 52dvh;
}

.auth-card {
  width: min(420px, 100%);
  padding: 24px;
}

.auth-card > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.auth-card .check {
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

.auth-card .check input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 4px;
  accent-color: var(--primary);
}

.auth-card .check span {
  min-width: 0;
}

.auth-card .check a {
  color: var(--text);
  font-weight: 500;
  text-underline-offset: 2px;
}

.mail-hint {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface);
}

.result-page {
  padding-bottom: 56px;
}

.result-toolbar {
  width: 100%;
  margin: 0;
}

.progress-box.live {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.editor-form {
  display: grid;
  gap: 14px;
}

.editor-form textarea {
  width: 100%;
  min-height: 520px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  resize: vertical;
}

.page-breakdown {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.page-breakdown article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.page-breakdown pre {
  white-space: pre-wrap;
  color: var(--muted);
}

.error-text {
  color: var(--danger);
}

.prose {
  max-width: 860px;
}

.prose h2 {
  margin: 26px 0 10px;
  font-size: 20px;
  line-height: 1.3;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p,
.prose li {
  color: var(--muted);
}

.prose ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 20px;
}

.convert-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: min(1160px, calc(100% - 32px));
  margin: 64px auto 0;
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.convert-footer nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.convert-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.footer-brand {
  min-height: 44px;
}

.cookie-consent {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(720px, calc(100% - 36px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cookie-consent p {
  margin: 4px 0 0;
  color: var(--muted);
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .convert-header,
  .landing-hero,
  .page-head,
  .account-head,
  .result-toolbar,
  .auth-shell,
  .convert-footer,
  .cookie-consent {
    align-items: stretch;
    flex-direction: column;
  }

  .convert-nav {
    justify-content: flex-start;
  }

  .hero-shell,
  .account-grid {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-hero {
    align-items: stretch;
    padding-top: 28px;
  }

  .landing-hero-aside {
    justify-items: start;
    flex: none;
  }

  .workspace-first {
    min-height: auto;
    padding-top: 24px;
  }

  .workspace-first .upload-panel,
  .workspace-first .result-panel {
    min-height: auto;
  }

  .hero-shell {
    min-height: auto;
    padding-top: 34px;
  }

  .steps-band,
  .feature-grid,
  .plans-row,
  .plans-grid {
    grid-template-columns: 1fr;
  }

  .convert-footer nav {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .alerts,
  .hero-shell,
  .landing-hero,
  .workspace,
  .steps-band,
  .feature-grid,
  .pricing-preview,
  .page-head,
  .plans-grid,
  .account-head,
  .account-grid,
  .account-panel,
  .result-page,
  .auth-shell,
  .convert-footer {
    width: min(100% - 20px, 1160px);
  }

  .convert-header {
    padding: 12px 10px;
  }

  .convert-nav a,
  .nav-button {
    padding: 0 9px;
  }

  .hero-copy h1,
  .landing-hero h1,
  .page-head h1,
  .account-head h1 {
    font-size: 32px;
    line-height: 1.08;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    padding-top: 18px;
    padding-bottom: 14px;
  }

  .landing-hero .hero-lead {
    margin-top: 10px;
  }

  .landing-hero-aside {
    gap: 8px;
    margin-top: 14px;
  }

  .landing-hero-aside .limit-strip {
    padding: 10px 12px;
  }

  .hero-lead,
  .page-head p,
  .account-head p,
  .auth-shell p {
    font-size: 16px;
  }

  .hero-actions,
  .inline-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .link-button,
  .inline-actions .link-button,
  .inline-actions button {
    width: 100%;
  }

  .pricing-preview {
    padding: 22px;
  }

  .file-drop {
    min-height: 180px;
  }

  .editor-form textarea {
    min-height: 420px;
  }
}

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