/* StatementQuick styles. Sizes and colours come from docs/designs/*.dc.html; colours use tokens.css where one exists. */

:root {
  /* Side padding of the public pages: 120px at the 1440px design width, 16px on phones. */
  --page-x: clamp(16px, 8.34vw, 120px);
}

/* Base */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }

button, input { font: inherit; color: inherit; }

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

/* Amounts, dates, file names and counts */
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.muted { color: var(--muted); }

.page { min-height: 100vh; display: flex; flex-direction: column; }
.page > main { flex-grow: 1; }

/* Logo */

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; white-space: nowrap; }
.brand svg { flex-shrink: 0; }
.brand:hover { color: var(--text); }

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary { background: var(--brand); color: #FFFFFF; }
.btn-primary:hover { background: var(--brand-hover); color: #FFFFFF; }
.btn-secondary { background: #FFFFFF; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface); color: var(--text); }
.btn-lg { padding: 14px 23px; font-size: 16px; }
.btn-block { width: 100%; min-height: 48px; gap: 12px; font-size: 16px; }

/* Public header */

.site-header {
  height: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--page-x);
  border-bottom: 1px solid var(--border);
}
.site-header .brand { font-size: 19px; letter-spacing: -0.01em; }
.site-nav { display: flex; align-items: center; gap: 36px; font-size: 15px; }
.site-nav a { color: var(--muted); }
.site-nav a:hover { color: var(--text); }
.site-actions { display: flex; align-items: center; gap: 12px; }
.link-signin { padding: 10px 16px; color: var(--text); font-size: 15px; font-weight: 500; white-space: nowrap; }
.link-signin:hover { color: var(--brand); }

/* Home hero */

.hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 72px;
  align-items: center;
  padding: 88px var(--page-x) 96px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.hero-copy { display: flex; flex-direction: column; gap: 28px; }
.pill-verified {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand-hover);
  font-size: 13px;
  font-weight: 600;
}
.hero-title { font-size: 60px; line-height: 64px; font-weight: 700; letter-spacing: -0.03em; }
.hero-lead { max-width: 540px; font-size: 20px; line-height: 30px; color: var(--muted); }
.checklist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; font-size: 16px; }
.checklist li { display: flex; align-items: center; gap: 10px; }
.checklist svg { flex-shrink: 0; color: var(--brand); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.hero-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(19, 32, 26, 0.04), 0 12px 32px rgba(19, 32, 26, 0.06);
}

/* Upload drop zone */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 240px;
  padding: 16px;
  border: 2px dashed #B9C9BF;
  border-radius: var(--radius-md);
  background: #FBFCFB;
  color: var(--text);
  text-align: center;
}
.dropzone:hover, .dropzone.is-dragover { background: var(--brand-tint); border-color: var(--brand); color: var(--text); }
.dropzone-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--brand-tint);
  color: var(--brand);
}
.dropzone-title { font-size: 18px; font-weight: 600; }
.dropzone-hint { font-size: 14px; color: var(--muted); }
.dropzone-hint strong { color: var(--brand); font-weight: 600; }

/* Output preview (home hero) */

.preview { display: flex; flex-direction: column; gap: 10px; }
.preview-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.preview-table { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.preview-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 96px 96px;
  gap: 12px;
  min-width: 380px;
  padding: 9px 14px;
}
.preview-row + .preview-row { border-top: 1px solid var(--row-divider); }
.preview-row.is-head { background: var(--surface); color: var(--muted); font-weight: 500; }
.preview-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amount { text-align: right; }
.credit { color: var(--brand); }

/* Balance banner, verified state */
.banner-verified {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--brand-tint);
  color: var(--brand-hover);
  font-size: 14px;
  font-weight: 600;
}
.banner-verified svg { flex-shrink: 0; }

/* Public footer */

.site-footer {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 48px var(--page-x);
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 48px; }
.footer-brand { display: flex; flex-direction: column; gap: 10px; max-width: 320px; }
.footer-brand .brand { font-size: 17px; }
.footer-brand p { font-size: 14px; line-height: 22px; color: var(--muted); }
.footer-links { display: flex; gap: 72px; font-size: 14px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col-title { font-weight: 600; }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--text); }
.footer-bottom { padding-top: 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

/* Text pages (privacy, terms, errors) */

.prose { width: 100%; max-width: 720px; margin: 0 auto; padding: 72px 16px 96px; display: flex; flex-direction: column; gap: 16px; }
.prose h1 { font-size: 40px; line-height: 48px; font-weight: 700; letter-spacing: -0.02em; }
.prose p { font-size: 16px; line-height: 25px; color: var(--muted); }
.prose .btn { align-self: flex-start; margin-top: 8px; }

/* Sign in / create account */

.auth { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 100vh; background: #FFFFFF; }
.auth-main { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 48px 80px; }
.auth-main .brand { align-self: flex-start; font-size: 18px; }
.auth-panel { width: 100%; max-width: 400px; align-self: center; display: flex; flex-direction: column; gap: 20px; }
.auth-head { display: flex; flex-direction: column; gap: 8px; }
.lead { font-size: 16px; color: var(--muted); }
/* Two forms (Google, email) laid out as one column. */
.form-contents { display: contents; }
.divider { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }
.divider::before, .divider::after { content: ""; flex-grow: 1; height: 1px; background: var(--border); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; font-weight: 600; }
.field input {
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: var(--text);
  font-size: 16px;
}
.field input:focus-visible { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.auth-switch { font-size: 15px; color: var(--muted); text-align: center; }
.auth-switch a { font-weight: 600; }
.auth-legal { font-size: 13px; color: var(--muted); }
.alert { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--danger-tint); color: var(--danger); font-size: 14px; font-weight: 500; }

.auth-aside { display: flex; flex-direction: column; justify-content: center; gap: 36px; padding: 80px; background: var(--text); color: #FFFFFF; }
.auth-quote { max-width: 520px; font-size: 30px; line-height: 40px; font-weight: 600; letter-spacing: -0.01em; }
.auth-points {
  max-width: 520px;
  margin: 0;
  padding: 24px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #1C2C25;
  border: 1px solid #2E4239;
  border-radius: 14px;
}
.auth-points li { display: flex; align-items: flex-start; gap: 12px; font-size: 16px; line-height: 24px; color: #D7E0DB; }
.auth-points svg { flex-shrink: 0; }

/* App shell (signed in) */

.app-body { background: var(--surface); }
.app-header {
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 40px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
}
.app-header-left { display: flex; align-items: center; gap: 40px; }
.app-header .brand { font-size: 17px; }
.app-nav { display: flex; gap: 4px; font-size: 15px; }
.app-nav a { padding: 8px 14px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; }
.app-nav a:hover { color: var(--text); }
.app-nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 600; }
.app-header-right { display: flex; align-items: center; gap: 16px; }

.pages-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand-hover);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.pages-badge::before { content: ""; width: 8px; height: 8px; border-radius: 99px; background: var(--brand); }

.account-menu { position: relative; }
.account-menu summary {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--text);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  min-width: 240px;
  padding: 8px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(19, 32, 26, 0.04), 0 12px 32px rgba(19, 32, 26, 0.06);
}
.account-menu-email { padding: 8px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
.account-menu-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.account-menu-item:hover { background: var(--surface-2); }

.app-main {
  width: 100%;
  max-width: 1152px; /* 1120px content (Dashboard.dc.html) + 16px padding each side */
  margin: 0 auto;
  padding: 48px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.app-main > * { min-width: 0; }
.app-main.is-narrow { max-width: 912px; } /* 880px content (Convert.dc.html) */
.page-head { display: flex; flex-direction: column; gap: 6px; }
.app-title { font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -0.02em; }

.card { background: #FFFFFF; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 17px; font-weight: 600; }
.card-note { font-size: 14px; color: var(--muted); }
.empty-state { padding: 48px 24px; font-size: 15px; color: var(--muted); text-align: center; }

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.link-button { padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; }
.link-button:hover { color: var(--brand-hover); }
.link-button:disabled { color: var(--muted); cursor: default; }
.back-link { align-self: flex-start; font-size: 14px; font-weight: 500; color: var(--muted); }
.back-link:hover { color: var(--text); }
.table-scroll { overflow-x: auto; }

.notice { display: flex; flex-direction: column; gap: 6px; padding: 28px 32px; }
.notice-title { font-size: 17px; font-weight: 600; }

/* Convert (Convert.dc.html) */

.upload-box {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 32px;
  border: 2px dashed #B9C9BF;
  border-radius: 14px;
  background: #FFFFFF;
  cursor: pointer;
}
.upload-box:hover, .upload-box.is-dragover { background: var(--brand-tint); border-color: var(--brand); }
.upload-box:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.upload-icon { width: 52px; height: 52px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); background: var(--brand-tint); color: var(--brand); }
.upload-text { display: flex; flex-direction: column; gap: 4px; flex-grow: 1; }
.upload-title { font-size: 17px; font-weight: 600; }
.upload-hint { font-size: 14px; color: var(--muted); }

.processing-file { display: flex; align-items: center; gap: 16px; padding: 22px 28px; border-bottom: 1px solid var(--border); }
.file-icon {
  width: 40px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: #C2362B;
  font-size: 10px;
  font-weight: 700;
}
.processing-name { display: flex; flex-direction: column; gap: 3px; flex-grow: 1; min-width: 0; font-size: 16px; font-weight: 500; }
.processing-name .num { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.processing-meta { font-size: 14px; font-weight: 400; color: var(--muted); }
.processing-state { font-size: 14px; font-weight: 600; color: var(--brand-hover); white-space: nowrap; }
.processing-state.is-failed { color: var(--danger); }
.processing-body { display: flex; flex-direction: column; gap: 22px; padding: 28px; }
.progress { height: 6px; overflow: hidden; border-radius: 99px; background: var(--row-divider); }
.progress-bar { width: 10%; height: 100%; border-radius: 99px; background: var(--brand); transition: width 0.4s ease; }
.processing[data-step="reading"] .progress-bar { width: 25%; }
.processing[data-step="extracting"] .progress-bar { width: 55%; }
.processing[data-step="checking"] .progress-bar { width: 80%; }
.processing[data-step="building"] .progress-bar { width: 90%; }
.processing[data-step="done"] .progress-bar { width: 100%; }
.stages { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 18px; font-size: 16px; color: #8A948E; }
.stages li { display: flex; align-items: center; gap: 14px; }
.stages li.is-active, .stages li.is-done { color: var(--text); }
.stages li.is-active .stage-name { font-weight: 600; }
.stage-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #D6DBD5;
  border-radius: 99px;
  color: #FFFFFF;
}
.stage-icon svg { display: none; }
.is-done .stage-icon { border: 0; background: var(--brand); }
.is-done .stage-icon svg { display: block; }
.is-active .stage-icon { border: 3px solid #CFE7DB; border-top-color: var(--brand); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .is-active .stage-icon { animation: none; } }
.stage-name { flex-grow: 1; }
.stage-detail { font-size: 14px; color: var(--muted); }
.processing-foot { padding: 16px 28px; background: var(--surface); border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.processing-failed { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 28px; }
.processing-failed[hidden], .processing-body[hidden], .processing-foot[hidden] { display: none; }
.failed-actions { display: flex; align-items: center; gap: 20px; }

/* Results (Results.dc.html) */

.result-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.result-title { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.result-file { font-size: 26px; line-height: 34px; font-weight: 500; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.result-details { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 15px; color: var(--muted); }
.result-actions { display: flex; gap: 10px; flex-shrink: 0; }
.result-note { font-size: 13px; color: var(--muted); }
.result-note .link-button { font-size: 13px; }

.account { display: flex; flex-direction: column; gap: 24px; }
.account-title { font-size: 20px; line-height: 28px; font-weight: 600; }

.banner { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--neutral-pill); }
.banner-icon { width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 99px; background: var(--muted); color: #FFFFFF; }
.banner-text { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.banner-title { font-size: 17px; font-weight: 600; }
.banner-detail, .banner-count { font-size: 14px; }
.banner-count { white-space: nowrap; }
.banner-ok { background: var(--brand-tint); border-color: #BFE0CF; color: #2D5E4A; }
.banner-ok .banner-icon { background: var(--brand); }
.banner-ok .banner-title { color: #0A4A35; }
.banner-warn { background: var(--warn-tint); border-color: #F5DFA0; color: var(--warn); }
.banner-warn .banner-icon { background: var(--warn); }
.banner-none { color: var(--muted); }
.banner-none .banner-title { color: var(--text); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { display: flex; flex-direction: column; gap: 6px; padding: 20px 22px; background: #FFFFFF; border: 1px solid var(--border); border-radius: var(--radius-md); }
.stat-label { font-size: 14px; color: var(--muted); }
.stat-value { font-size: 24px; font-weight: 500; }

.tx-table, .history { width: 100%; border-collapse: collapse; font-size: 14px; }
.tx-table { min-width: 720px; }
.tx-table th, .history th {
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.tx-table th.amount, .history th.amount { text-align: right; }
.tx-table td { padding: 13px 16px; border-bottom: 1px solid var(--row-divider); }
.tx-table th:first-child, .tx-table td:first-child, .history th:first-child, .history td:first-child { padding-left: 22px; }
.tx-table th:last-child, .tx-table td:last-child, .history th:last-child, .history td:last-child { padding-right: 22px; }
.tx-date { width: 120px; color: var(--muted); white-space: nowrap; }
.tx-description { font-family: var(--font); font-size: 15px; }
.tx-table td.amount { width: 150px; white-space: nowrap; }
.tx-table tr.is-flagged td { background: var(--warn-tint); }
.tx-table tfoot td { border-bottom: 0; background: var(--surface); font-weight: 500; }

.sample { width: 100%; max-width: 1152px; margin: 0 auto; padding: 40px 16px 56px; display: flex; flex-direction: column; gap: 24px; }
.sample-note { font-size: 14px; color: var(--muted); }
.sample-note a { font-weight: 600; }

/* Dashboard (Dashboard.dc.html) */

.dashboard-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.dashboard-stats { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.stat-card { display: flex; flex-direction: column; gap: 6px; padding: 24px 28px; }
.stat-big { font-family: var(--font-mono); font-size: 40px; font-weight: 500; letter-spacing: -0.02em; }
.history td { padding: 15px 16px; border-bottom: 1px solid var(--row-divider); white-space: nowrap; }
.history tbody tr:last-child td { border-bottom: 0; }
.history-file { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.history-file a { color: var(--text); font-weight: 500; }
.history-file a:hover { color: var(--brand); }
.history-downloads a { margin-left: 14px; font-weight: 600; }
.pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill-ok { background: var(--brand-tint); color: var(--brand-hover); }
.pill-warn { background: var(--warn-tint); color: var(--warn); }
.pill-none { background: var(--neutral-pill); color: #4A5550; }
.pill-fail { background: var(--danger-tint); color: var(--danger); }
.pager { display: flex; gap: 16px; padding: 14px 24px; border-top: 1px solid var(--border); font-size: 14px; font-weight: 600; }
.pager-older { margin-left: auto; }

/* Smaller screens: one column, 16px side padding (docs/UI.md). */

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-stats { grid-template-columns: minmax(0, 1fr); }
  .result-head { flex-direction: column; align-items: flex-start; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 48px; padding-top: 56px; padding-bottom: 64px; }
  .footer-top { flex-direction: column; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
  .auth-main { padding: 32px var(--page-x); }
}

@media (max-width: 640px) {
  :root { --page-x: 16px; }
  .site-header { gap: 12px; }
  .site-header .brand { font-size: 17px; }
  .site-nav { display: none; }
  .site-actions { gap: 4px; }
  .link-signin { padding: 10px 8px; }
  .hero-title { font-size: 40px; line-height: 44px; }
  .hero-lead { font-size: 18px; line-height: 28px; }
  .hero-card { padding: 16px; }
  .preview-row { grid-template-columns: 44px minmax(0, 1fr) 84px 84px; gap: 8px; min-width: 340px; padding: 9px 12px; }
  .footer-links { flex-wrap: wrap; gap: 40px; }
  .app-header { padding: 0 16px; }
  .app-header-left { gap: 12px; }
  .app-header .brand-name { display: none; }
  .app-nav a { padding: 8px 10px; }
  .card-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .upload-box { flex-wrap: wrap; padding: 20px; }
  .upload-browse { width: 100%; }
  .processing-file, .processing-body, .processing-failed { padding-left: 16px; padding-right: 16px; }
  .processing-file { flex-wrap: wrap; row-gap: 8px; }
  .processing-name { flex-basis: calc(100% - 56px); }
  .processing-state { flex-basis: 100%; padding-left: 56px; }
  .processing-foot { padding: 14px 16px; }
  .result-file { font-size: 20px; line-height: 28px; }
  .result-actions { width: 100%; flex-direction: column-reverse; }
  .banner { flex-wrap: wrap; align-items: flex-start; padding: 16px; }
  .banner-text { flex: 1 1 180px; }
  .banner-count { flex-basis: 100%; padding-left: 52px; }
  .stats { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .stat { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 12px; padding: 16px 18px; }
  .stat-value { font-size: 20px; }
  .dashboard-stats { gap: 12px; }
  .stat-card { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 12px; padding: 16px 18px; }
  .stat-big { font-size: 28px; }
}

@media (max-width: 520px) {
  .pages-badge { display: none; }
}

@media (max-width: 420px) {
  .site-header .brand-name { display: none; }
}
