/* SN Documents — design system */
:root {
  --brand: #1f4fd8;
  --brand-dark: #173a9e;
  --brand-soft: #e9efff;
  --accent: #f59e0b;
  --accent-soft: #fff4dc;
  --ink: #111827;
  --ink-soft: #4b5568;
  --muted: #6b7385;
  --line: #e3e7ef;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --success: #0f8a5f;
  --success-soft: #e3f6ee;
  --danger: #c2343b;
  --danger-soft: #fdeaea;
  --warning: #a35c00;
  --warning-soft: #fff3df;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 8px 24px rgba(17, 24, 39, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1120px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.6;
  color: var(--ink); background: var(--bg);
}
body.large-text { font-size: 20px; }
img, svg { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
li { margin-bottom: .35em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; color: #fff; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 20px; }
/* min(…, 100%) keeps columns from overflowing very narrow phones (e.g. 320px wide) */
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; } .mb-0 { margin-bottom: 0; }

/* ---------- header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.header-inner { display: flex; align-items: center; gap: 18px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.15rem; }
.brand img { width: 34px; height: 34px; }
.brand span b { color: var(--brand); }
.nav { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.nav a, .nav button.linklike { color: var(--ink-soft); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: .95rem; }
.nav a:hover, .nav a.active { background: var(--brand-soft); color: var(--brand-dark); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 1.2rem; cursor: pointer; }
.lang-form { display: inline-flex; }
.lang-form select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: .9rem; background: var(--surface); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 66px; left: 0; right: 0; background: var(--surface); flex-direction: column; align-items: stretch; padding: 10px 16px 16px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
}

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; border: 1px solid transparent;
  background: var(--brand); color: #fff; font: inherit; font-weight: 600; font-size: .97rem;
  text-decoration: none; cursor: pointer; transition: background .15s, box-shadow .15s; min-height: 44px;
}
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--bg); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--brand); padding: 8px 12px; min-height: 36px; }
.btn-ghost:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #a3262c; }
.btn-accent { background: var(--accent); color: #1d1300; }
.btn-accent:hover { background: #e08c00; color: #1d1300; }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: .88rem; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.linklike { background: none; border: none; color: var(--brand); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
form.inline { display: inline; }
/* Long unbroken text (web addresses, emails, account numbers, titles) wraps instead of widening the page */
h1, h2, h3, .card, .summary-box, td, .diff-cols > div, .doc-item .meta, .alert, li { overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .card { padding: 18px; }
  .row > input[type=text], .row > input[type=search] { min-width: 0; }
}
.date-warning { color: #8a4b00; font-weight: 600; }
.date-ok { color: #1d6b3a; }
.date-note { color: var(--ink-soft); }
.scam-alert { border-width: 2px; }
.scam-alert h2 { margin: 0 0 .4em; font-size: 1.25rem; }
.scam-alert ul { margin-bottom: 0; }
.badge-same { color: var(--success); }  /* neutral badge with a green check: not a priority level */
.unchanged-list { margin: 0; }

label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.field { margin-bottom: 18px; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid #cfd5e1; border-radius: var(--radius-sm);
  font: inherit; font-size: 1rem; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 3px solid var(--brand-soft); }
textarea { min-height: 120px; resize: vertical; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.checkbox input { margin-top: 5px; width: 18px; height: 18px; }
.errors { color: var(--danger); font-size: .88rem; margin: 6px 0 0; padding: 0; list-style: none; }

/* ---------- cards & surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2, .card-head h3 { margin: 0; }
.section { padding: 56px 0; }
.page { padding: 32px 0 64px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line); white-space: nowrap; }
.badge-high { background: var(--danger-soft); color: var(--danger); border-color: #f5c8ca; }
.badge-medium { background: var(--warning-soft); color: var(--warning); border-color: #f6dcae; }
.badge-low { background: var(--success-soft); color: var(--success); border-color: #bfe8d6; }
.badge-brand { background: var(--brand-soft); color: var(--brand-dark); border-color: #cdd9ff; }

.alert { padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--success-soft); border-color: #bfe8d6; color: #0b5e41; }
.alert-error { background: var(--danger-soft); border-color: #f5c8ca; color: #8e1f25; }
.alert-info { background: var(--brand-soft); border-color: #cdd9ff; color: var(--brand-dark); }
.alert-warning { background: var(--warning-soft); border-color: #f6dcae; color: #7a4500; }
.flashes { margin-top: 18px; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .icon { font-size: 2.4rem; }

/* ---------- landing ---------- */
.hero { background: linear-gradient(160deg, #10225f 0%, #1f4fd8 70%, #3b6cf0 100%); color: #fff; padding: 72px 0 84px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); max-width: 760px; }
.hero .tagline { font-size: clamp(1.1rem, 2.2vw, 1.35rem); opacity: .92; max-width: 640px; margin-bottom: 28px; }
.hero .btn-secondary { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); }
.hero .btn-secondary:hover { background: rgba(255,255,255,.2); }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero-card { background: #fff; color: var(--ink); border-radius: 18px; padding: 22px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.hero-card .doc-line { height: 9px; background: var(--line); border-radius: 6px; margin: 8px 0; }
.hero-card .doc-line.w60 { width: 60%; } .hero-card .doc-line.w80 { width: 80%; } .hero-card .doc-line.w40 { width: 40%; }
.hero-card .bubble { background: var(--brand-soft); border-radius: 12px; padding: 12px 14px; margin-top: 14px; font-size: .95rem; }
.hero-card .bubble strong { color: var(--brand-dark); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero { padding: 48px 0 56px; } }
.feature { padding: 22px; }
.feature .icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); display: grid; place-items: center; font-size: 1.3rem; margin-bottom: 12px; }
.feature h3 { margin-bottom: .35em; }
.feature p { color: var(--ink-soft); margin: 0; font-size: .97rem; }
.steps { counter-reset: step; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.steps li { list-style: none; counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 10px; }
.steps { padding: 0; }
.cta { background: var(--ink); color: #fff; border-radius: 20px; padding: 40px; text-align: center; }
.cta p { opacity: .85; }

/* ---------- pricing ---------- */
.price-card { display: flex; flex-direction: column; }
.price-card.featured { border: 2px solid var(--brand); position: relative; }
.price-card .ribbon { position: absolute; top: -13px; left: 24px; background: var(--brand); color: #fff; font-size: .78rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.price { font-size: 2.3rem; font-weight: 800; margin: 6px 0; }
.price small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.checklist { list-style: none; padding: 0; flex: 1; }
.checklist li { padding-left: 28px; position: relative; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 800; }

/* ---------- dashboard ---------- */
.stat { padding: 18px 20px; }
.stat .num { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.stat .label { color: var(--muted); font-size: .9rem; }
.meter-row { margin-bottom: 12px; }
.meter-row .row { font-size: .9rem; margin-bottom: 4px; }
progress, meter { width: 100%; height: 10px; border-radius: 99px; overflow: hidden; appearance: none; -webkit-appearance: none; border: none; background: var(--line); }
progress::-webkit-progress-bar, meter::-webkit-meter-bar { background: var(--line); border-radius: 99px; border: none; }
progress::-webkit-progress-value { background: var(--brand); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--brand); border-radius: 99px; }
meter::-webkit-meter-optimum-value { background: var(--brand); }
meter::-webkit-meter-suboptimum-value { background: var(--accent); }
meter::-webkit-meter-even-less-good-value { background: var(--danger); }

.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-item { display: flex; gap: 14px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.doc-item:last-child { border-bottom: none; }
.doc-icon { width: 42px; height: 42px; border-radius: 10px; background: var(--brand-soft); display: grid; place-items: center; flex-shrink: 0; font-size: 1.2rem; }
.doc-item .meta { flex: 1; min-width: 0; }
.doc-item .meta a { font-weight: 600; color: var(--ink); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-item .meta a:hover { color: var(--brand); }
.doc-item .meta .small { color: var(--muted); }
.deadline { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.deadline:last-child { border-bottom: none; }
.date-chip { min-width: 64px; text-align: center; background: var(--accent-soft); color: #7a4500; border-radius: 10px; padding: 6px 8px; font-weight: 700; line-height: 1.2; font-size: .85rem; }
.date-chip.soon { background: var(--danger-soft); color: var(--danger); }

/* ---------- upload ---------- */
.dropzone { border: 2px dashed #b9c4dc; border-radius: var(--radius); padding: 38px 20px; text-align: center; background: #fbfcff; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone.dragover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .big { font-size: 2.4rem; }
.dropzone input[type=file] { margin-top: 12px; }
.file-chosen { margin-top: 10px; font-weight: 600; color: var(--brand-dark); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 22px 0; font-size: .9rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- document pages ---------- */
.doc-header { background: var(--surface); border-bottom: 1px solid var(--line); padding: 24px 0 0; }
.doc-header h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 6px; word-break: break-word; }
.doc-tabs { display: flex; gap: 2px; overflow-x: auto; margin-top: 18px; scrollbar-width: thin; }
.doc-tabs a { padding: 11px 15px; text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .93rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.doc-tabs a:hover { color: var(--brand); }
.doc-tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.summary-box { font-size: 1.08rem; background: var(--brand-soft); border-left: 5px solid var(--brand); padding: 18px 20px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.urgency { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); margin-top: 14px; }
.urgency-high { background: var(--danger-soft); } .urgency-medium { background: var(--warning-soft); } .urgency-low { background: var(--success-soft); }
.action-list { list-style: none; padding: 0; counter-reset: act; }
.action-list li { counter-increment: act; display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.action-list li:last-child { border-bottom: none; }
.action-list li::before { content: counter(act); width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.info-table { width: 100%; border-collapse: collapse; font-size: .96rem; }
.info-table th, .info-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.info-table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.table-wrap { overflow-x: auto; }
.contact { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.contact strong { display: block; }
.term { padding: 14px 0; border-bottom: 1px solid var(--line); }
.term:last-child { border-bottom: none; }
.term dt { font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.term dd { margin: 4px 0 0; color: var(--ink-soft); }
.quote { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 8px 12px; border-radius: 0 8px 8px 0; font-size: .92rem; color: #4d3500; margin: 8px 0 0; font-style: italic; }
.quote a { font-style: normal; font-size: .85rem; margin-left: 6px; }
.warning-list li { color: #7a4500; }
.disclaimer { font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 24px; }

/* walkthrough */
.walk { max-width: 760px; margin: 0 auto; }
.walk-step { display: none; }
.walk-step.active { display: block; }
.no-js .walk-step { display: block; margin-bottom: 20px; }
.walk-progress { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-weight: 600; color: var(--muted); }
.walk-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.walk-step h2 { font-size: 1.5rem; }
.walk-step .explain { font-size: 1.12rem; }

/* Q&A */
.qa { padding: 18px 0; border-bottom: 1px solid var(--line); }
.qa:last-child { border-bottom: none; }
.qa .q { font-weight: 700; display: flex; gap: 10px; }
.qa .q::before { content: "Q"; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: .8rem; }
.qa .a { margin: 10px 0 0 36px; white-space: pre-wrap; }
.qa .sources { margin: 10px 0 0 36px; }
.qa .sources summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--brand); }
.not-found { margin-left: 36px; }
.ask-box { position: sticky; bottom: 0; background: var(--surface); padding-top: 12px; }
.ask-box form { display: flex; gap: 10px; }
.ask-box input { flex: 1; }
.suggestions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: .88rem; cursor: pointer; font: inherit; font-size: .88rem; color: var(--ink-soft); }
.chip:hover { background: var(--brand-soft); color: var(--brand-dark); border-color: #cdd9ff; }

/* quiz */
.quiz-q { padding: 18px 0; border-bottom: 1px solid var(--line); }
.quiz-q:last-of-type { border-bottom: none; }
.quiz-q fieldset { border: none; padding: 0; margin: 0; }
.quiz-q legend { font-weight: 700; margin-bottom: 10px; font-size: 1.05rem; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; cursor: pointer; font-weight: 400; }
.option:hover { background: var(--bg); }
.option input { margin-top: 5px; }
.option.correct { background: var(--success-soft); border-color: #93d9bb; }
.option.wrong { background: var(--danger-soft); border-color: #f0a8ac; }
.quiz-feedback { display: none; margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); }
.quiz-feedback.show { display: block; }
.quiz-score { font-size: 1.2rem; font-weight: 700; }

/* reply */
.reply-out { white-space: pre-wrap; background: #fbfcff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; font-size: .98rem; }

/* original text */
.doc-text { white-space: pre-wrap; word-wrap: break-word; font-family: Georgia, "Times New Roman", serif; font-size: 1.02rem; line-height: 1.75; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; max-height: none; }
mark.hl { background: #fff1b8; padding: 1px 2px; border-radius: 3px; color: inherit; scroll-margin-top: 120px; }
mark.hl-cite { background: #d8e4ff; }
.anchor { scroll-margin-top: 120px; }
mark.hl-amount { background: #d9f5e7; }
mark.hl-date { background: #ffe3c2; }
mark.hl:target, mark.hl.flash { outline: 3px solid var(--accent); box-shadow: 0 0 0 6px rgba(245,158,11,.25); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .l-date::before { background: #ffe3c2; } .legend .l-amount::before { background: #d9f5e7; }
.legend .l-step::before { background: #fff1b8; } .legend .l-cite::before { background: #d8e4ff; }

/* compare */
.diff { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 14px; }
.diff-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.diff-cols > div { background: var(--bg); border-radius: 8px; padding: 10px 12px; font-size: .95rem; }
.diff-cols .lbl { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; display: block; }
@media (max-width: 640px) { .diff-cols { grid-template-columns: 1fr; } }

/* speak */
.speak-btn[aria-pressed=true] { background: var(--accent-soft); color: #7a4500; }

/* loading overlay */
.busy-overlay { position: fixed; inset: 0; background: rgba(246, 248, 252, .92); display: none; place-items: center; z-index: 80; text-align: center; padding: 20px; }
.busy-overlay.show { display: grid; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 5px solid var(--brand-soft); border-top-color: var(--brand); animation: spin 1s linear infinite; margin: 0 auto 18px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 32px 0; margin-top: 40px; font-size: .92rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-soft); }

.auth-wrap { max-width: 460px; margin: 40px auto; }
.danger-zone { border-color: #f5c8ca; }
.settings-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }

/* ---------- print ---------- */
.print-only { display: none; }
@media print {
  body { background: #fff; font-size: 12pt; }
  .site-header, .site-footer, .doc-tabs, .toolbar, .no-print, .busy-overlay, .flashes, .ask-box { display: none !important; }
  .print-only { display: block; }
  .card { box-shadow: none; border: none; padding: 0; }
  .card + .card { margin-top: 14pt; }
  a { color: inherit; text-decoration: none; }
  .summary-box { border-left-color: #000; background: #f2f2f2; }
  .page { padding: 0; }
  h2 { break-after: avoid; }
}

/* ---------- layout fixes ---------- */
.grid > .card + .card, .grid > * + .card { margin-top: 0; }
.nav a.btn { color: #fff; background: var(--brand); }
.nav a.btn:hover { color: #fff; background: var(--brand-dark); }
.footer-links { align-items: center; }
.footer-links .linklike { font-size: inherit; color: var(--ink-soft); }
.toolbar select, select.btn-sm { width: auto; padding: 6px 10px; font-size: .88rem; }
.row > input[type=text], .row > input[type=search] { flex: 1; width: auto; min-width: 180px; }
.row > select { width: auto; }
.demo-banner { background: #fff4dc; border-bottom: 1px solid #f6dcae; color: #7a4500; padding: 10px 0; font-size: .92rem; }
@media print { .demo-banner { display: none; } }

/* ---------- multilingual ---------- */
.lang-search { margin-bottom: 6px; }
.row > .lang-search { flex: 1 1 200px; width: auto; margin-bottom: 0; }
.translate-box summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.translate-box { padding: 14px 20px; margin-bottom: 20px; }
.explain-langs a { white-space: nowrap; }
:lang(ar), :lang(fa), :lang(ur), :lang(ps) { font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", sans-serif; line-height: 1.9; }
:lang(he) { font-family: "Segoe UI", Arial, "Noto Sans Hebrew", sans-serif; }

/* Right-to-left content (the page chrome stays left-to-right; only explanation blocks flip). */
[dir=rtl] { text-align: right; }
[dir=rtl] ul, [dir=rtl] ol { padding-left: 0; padding-right: 1.3em; }
[dir=rtl] .summary-box { border-left: none; border-right: 5px solid var(--brand); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
[dir=rtl] .quote { border-left: none; border-right: 3px solid var(--accent); border-radius: 8px 0 0 8px; }
[dir=rtl] .info-table th, [dir=rtl] .info-table td { text-align: right; }
[dir=rtl] .qa .a, [dir=rtl] .qa .sources, [dir=rtl] .not-found { margin-left: 0; margin-right: 36px; }
[dir=rtl] .action-list { padding-right: 0; }
