/* Open Letter: an editorial look (warm paper, serif headlines, mono labels) with big, readable
   text and big buttons for stressed readers on small phones. */

:root {
  color-scheme: light;
  --bg: #ece9e4;
  --bg-2: #f4f2ee;
  --surface: #ffffff;
  --ink: #1c1c1c;
  --ink-2: #55524d;
  --line: #d9d5ce;
  --line-strong: #b8b3aa;
  --dark: #232323;

  --lavender: #cdc3f0;
  --lavender-soft: #e9e4fa;
  --violet: #8b6cf6;
  --violet-ink: #4f35c2;
  --peach: #f2b99a;
  --focus: #8b6cf6;

  --high: #b42318;
  --high-soft: #f9e2df;
  --medium: #8a5300;
  --medium-soft: #fbefd4;
  --medium-line: #e3a72f;
  --low: #1f5fa8;
  --low-soft: #e5eef9;
  --none: #1e6b3a;
  --none-soft: #e3f1e7;

  --radius: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans Arabic", "Segoe UI Arabic", sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; outline: none; }
[hidden] { display: none !important; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.25rem, 6vw, 3.5rem); letter-spacing: -0.025em; line-height: 1.05; }
h2 { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: 1.125rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--ink); }
button { font: inherit; color: inherit; }

/* Serif display type doesn't suit Chinese or Arabic at these sizes; use the bold sans there. */
:lang(zh) h1, :lang(ar) h1, :lang(zh) .display, :lang(ar) .display, :lang(zh) .display-md, :lang(ar) .display-md {
  font-family: var(--font); font-weight: 700; letter-spacing: 0;
}

/* Monospace caps labels are a Latin style. Arabic letters must stay joined, so drop the spacing there. */
:lang(ar) :is(.label, .back-btn, .ask-btn, .node-label, .footer-head, .page-head h2, .urgency-label, .quote-label, .pane h2, .todo-count),
:lang(zh) :is(.label, .back-btn, .ask-btn, .node-label, .footer-head, .page-head h2, .urgency-label, .quote-label, .pane h2, .todo-count) {
  font-family: var(--font); letter-spacing: 0;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Headings get focus when the screen changes (for screen readers); no ring needed there. */
h1[tabindex="-1"]:focus { outline: none; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-inline: 16px; }
.narrow { max-width: 760px; }
.muted { color: var(--ink-2); }
.lead { font-size: 1.1875rem; color: var(--ink-2); max-width: 36em; }

.display { font-family: var(--serif); font-weight: 400; font-size: clamp(2.75rem, 8.5vw, 6.25rem); line-height: .98; letter-spacing: -0.035em; }
.display-md { font-family: var(--serif); font-weight: 400; font-size: clamp(2.125rem, 5.2vw, 3.75rem); line-height: 1.04; letter-spacing: -0.03em; }

.label {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px;
  font-family: var(--mono); font-size: .8125rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); flex: none; }
.label-light { color: #a9a6a0; }

.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 18px; height: 18px; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

.skip-link { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius); z-index: 30; }
.skip-link:focus { top: 8px; }

/* ---------- Header ---------- */

.strip {
  margin: 0; padding: 9px 16px; text-align: center;
  background: var(--lavender); color: #2b2440; font-size: .875rem; font-weight: 500;
}

.site-header { position: sticky; top: 0; z-index: 20; padding: 14px 16px 0; pointer-events: none; }
.nav {
  pointer-events: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 760px; margin: 0 auto; padding-block: 8px; padding-inline: 18px 8px; min-height: 60px;
  background: var(--ink); color: #fff; border-radius: 10px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 12%);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; min-height: 44px; }
.brand-icon { width: 24px; height: 24px; }
.lang-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 0; border-radius: 6px; background: #fff; color: var(--ink);
  font-weight: 600; font-size: .9375rem; cursor: pointer;
}
.lang-pill:hover { background: var(--lavender-soft); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 24px;
  border: 1.5px solid transparent; border-radius: 999px;
  font-size: 1.0625rem; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none;
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-lg { min-height: 62px; font-size: 1.125rem; padding: 0 28px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--lavender-soft); }
.btn-dark-outline { background: transparent; color: #fff; border-color: #5a5a5a; }
.btn-dark-outline:hover { border-color: #fff; }
.btn[disabled] { cursor: not-allowed; opacity: .6; }

.btn .spinner { display: none; }
.btn.is-busy .spinner { display: inline-block; }
.btn.is-busy .icon { display: none; }

.icon-btn {
  display: grid; place-items: center; width: 48px; height: 48px;
  border: 1px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }

.back-btn {
  display: inline-flex; align-items: center; gap: 8px; margin: 28px 0 14px;
  min-height: 48px; padding: 0 8px; margin-inline-start: -8px;
  border: 0; background: none; color: var(--ink); cursor: pointer;
  font-family: var(--mono); font-size: .875rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
}

.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid currentColor; border-right-color: transparent;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Home: hero ---------- */

.hero { padding-block: 56px 72px; }
.hero-center { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-center .display { max-width: 13em; margin-bottom: 24px; }
.hero-center .lead { color: var(--ink); max-width: 33em; margin-inline: auto; }
.hero-actions { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 420px; margin: 28px auto 48px; }

.lines-panel {
  position: relative; height: 300px; border-radius: 12px; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line);
}
.lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.lines line {
  --c: var(--ink);
  stroke: var(--c); stroke-width: calc(var(--w) * 1px); vector-effect: non-scaling-stroke;
  animation: sweep 8s ease-in-out infinite; animation-delay: calc(var(--i) * 40ms);
}
.lines line.violet { --c: var(--violet); }
.lines line.peach { --c: var(--peach); }
/* A scan moving left to right: each line briefly turns violet and thickens, like a redaction bar. */
@keyframes sweep {
  0%, 7%, 100% { stroke: var(--c); stroke-width: calc(var(--w) * 1px); }
  2.5% { stroke: var(--violet); stroke-width: calc(var(--w) * 1px + 5px); }
}
[dir="rtl"] .lines { transform: scaleX(-1); }

.ask {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px;
  width: min(640px, calc(100% - 32px)); padding: 8px; padding-inline-start: 24px;
  background: #fff; border-radius: 999px;
  box-shadow: 0 0 0 10px rgb(255 255 255 / 55%), 0 20px 50px rgb(0 0 0 / 12%);
}
.ask-text { flex: 1; margin: 0; min-width: 0; font-size: 1.1875rem; text-align: start; white-space: nowrap; overflow: hidden; }
.caret { display: inline-block; width: 2px; height: 1.15em; margin-inline-start: 2px; vertical-align: text-bottom; background: var(--ink); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ask-btn {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  min-height: 52px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--ink); color: #fff; cursor: pointer;
  font-family: var(--mono); font-size: .875rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
}
.ask-btn:hover { background: #000; }

/* ---------- Home: sections ---------- */

.split { padding-block: 72px; }
.split-grid { display: grid; gap: 28px; align-items: start; }
.split-body { font-size: 1.125rem; color: var(--ink); max-width: 30em; margin: 0; }

.constellation { padding-block: 40px 72px; }
.constellation-inner { position: relative; }
.curves { display: none; }
.curves path { fill: none; stroke: #bdb8ae; stroke-width: 1.2; stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.constellation-center { text-align: center; max-width: 30em; margin: 0 auto 28px; }
.constellation-center p { color: var(--ink-2); margin: 0; }
.nodes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.node {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 4%);
}
.node-label { display: block; font-family: var(--mono); font-size: .8125rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.node-bars { display: none; }

.how { padding-block: 24px 72px; }
.how-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.how-card { position: relative; border-radius: 10px; padding: 28px 24px 26px; border: 1px solid var(--line); min-height: 240px; display: flex; flex-direction: column; }
.how-card .icon { width: 30px; height: 30px; margin-bottom: auto; }
.how-card h3 { margin-top: 36px; font-size: 1.3125rem; }
.how-card p { margin: 0; color: var(--ink-2); font-size: 1.0625rem; }
.how-num { position: absolute; top: 26px; inset-inline-end: 24px; font-family: var(--mono); font-size: .875rem; color: var(--ink-2); }
.tone-sand { background: #e3dfd8; }
.tone-lavender { background: var(--lavender); border-color: transparent; }
.tone-lavender p, .tone-lavender .how-num { color: #3a3352; }
.tone-white { background: #fff; }

.trust { padding-block: 24px 88px; }
.spec { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.spec li { display: grid; grid-template-columns: 56px 1fr; gap: 8px; padding: 22px 0; border-bottom: 1px solid var(--line-strong); }
.spec-num { font-family: var(--mono); font-size: .875rem; color: var(--ink-2); padding-top: 3px; }
.spec h3 { margin-bottom: 4px; }
.spec p { margin: 0; color: var(--ink-2); font-size: 1.0625rem; }

.dark-cta { background: var(--dark); color: #fff; padding-block: 96px 88px; text-align: center; }
.dark-cta-inner { display: flex; flex-direction: column; align-items: center; }
.dark-cta .display { max-width: 12em; margin-bottom: 18px; }
.dark-sub { color: #bdbab4; margin: 0; }
.dark-cta .hero-actions { margin-bottom: 0; }

/* ---------- Footer ---------- */

.site-footer { background: var(--dark); padding: 40px 0 48px; margin-top: 64px; }
body:has(#view-home:not([hidden])) .site-footer { margin-top: 0; padding-top: 8px; }
.footer-card { background: #e0ddd8; color: var(--ink); border-radius: 12px; padding: 32px 28px; }
.footer-top { display: grid; gap: 32px; align-items: start; }
.footer-brand { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 1.875rem; font-weight: 600; letter-spacing: -0.02em; }
.footer-brand .icon { width: 34px; height: 34px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px; }
.footer-head { margin: 0 0 10px; font-family: var(--mono); font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: #6f6b64; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols a, .footer-cols button {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0; border: 0; background: none;
  color: var(--ink); font-size: 1rem; text-decoration: none; cursor: pointer; text-align: start;
}
.footer-cols a:hover, .footer-cols button:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-note { margin: 32px 0 0; padding-top: 20px; border-top: 1px solid #c9c5be; font-size: .9375rem; color: #55524d; max-width: 56em; }

/* ---------- Notices ---------- */

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); border: 1px solid; margin: 0 0 16px; font-size: 1rem; }
.notice .icon { margin-top: 1px; }
.notice-info { background: var(--lavender-soft); border-color: var(--lavender); color: #2f2557; }
.notice-warn { background: var(--medium-soft); border-color: var(--medium-line); color: #5c3800; }
.notice-danger { background: var(--high-soft); border-color: #eeb0a9; color: #7a1a12; }
.notice p { margin: 0; }
.notice strong { display: block; margin-bottom: 2px; }
.example-only { display: none; }
body.is-example .example-only { display: flex; }

/* ---------- Review ---------- */

.pages { display: grid; gap: 20px; margin: 28px 0 16px; }
.page-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.page-head h2 { margin: 0; font-family: var(--mono); font-size: .875rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.canvas-wrap { position: relative; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #ddd; }
.canvas-wrap canvas { display: block; width: 100%; height: auto; touch-action: pan-y; }
.canvas-wrap.is-drawing { outline: 3px solid var(--violet); outline-offset: -3px; }
.canvas-wrap.is-drawing canvas { cursor: crosshair; touch-action: none; }
.scan-overlay { position: absolute; inset: 0; background: rgb(255 255 255 / 45%); }
.scan-line { position: absolute; inset-inline: 0; height: 3px; background: var(--violet); box-shadow: 0 0 14px 2px rgb(139 108 246 / 70%); animation: scan 2s ease-in-out infinite alternate; }
@keyframes scan { from { top: 4%; } to { top: 96%; } }

.page-status { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0; font-weight: 600; font-size: 1rem; }
.page-status.ok { color: var(--none); }
.page-status.warn { color: var(--medium); }
.page-status.busy { color: var(--ink-2); }
.page-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-tool { min-height: 48px; padding: 0 18px; font-size: 1rem; background: var(--surface); border: 1.5px solid var(--line-strong); color: var(--ink); }
.btn-tool:hover { border-color: var(--ink); }
.btn-tool.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.hint { font-size: 1rem; color: var(--ink-2); margin: 10px 0 0; }

.sticky-cta {
  position: sticky; bottom: 0; margin-top: 16px; padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgb(236 233 228 / 0%), var(--bg) 30%);
}

/* ---------- Loading ---------- */

.loading { text-align: center; padding-block: 56px; }
.loading-letter { position: relative; width: 170px; margin: 0 auto 32px; border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 18px 40px rgb(0 0 0 / 14%); transform: rotate(-2deg); }
.loading-letter canvas { display: block; width: 100%; height: auto; }
.progress { list-style: none; padding: 0; margin: 28px auto; display: grid; gap: 14px; max-width: 380px; text-align: start; }
.progress li { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-weight: 500; }
.progress-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; display: grid; place-items: center; }
.progress li.active { color: var(--ink); }
.progress li.active .progress-dot { border-color: var(--violet); border-right-color: transparent; animation: spin .8s linear infinite; }
.progress li.done { color: var(--none); }
.progress li.done .progress-dot { background: var(--none); border-color: var(--none); }
.progress li.done .progress-dot::after { content: ""; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 3px 3px; transform: translateY(-1px) rotate(-45deg); }

/* ---------- Result ---------- */

.urgency {
  display: flex; gap: 16px; align-items: flex-start;
  border-radius: 12px; padding: 20px; margin: 4px 0 28px;
  border: 1px solid; border-inline-start-width: 8px;
}
.urgency-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; flex: none; color: #fff; }
.urgency-icon .icon { width: 26px; height: 26px; }
.urgency-label { margin: 0 0 4px; font-family: var(--mono); font-size: .875rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.urgency-date { margin: 0; font-family: var(--serif); font-size: clamp(1.75rem, 5vw, 2.375rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.02em; }
:lang(zh) .urgency-date, :lang(ar) .urgency-date { font-family: var(--font); font-weight: 700; }
.urgency-detail { margin: 8px 0 0; font-weight: 600; }
.urgency.high { background: var(--high-soft); border-color: var(--high); color: #6e170f; }
.urgency.high .urgency-icon { background: var(--high); }
.urgency.medium { background: var(--medium-soft); border-color: var(--medium-line); color: #5c3800; }
.urgency.medium .urgency-icon { background: var(--medium); }
.urgency.low { background: var(--low-soft); border-color: var(--low); color: #173f6e; }
.urgency.low .urgency-icon { background: var(--low); }
.urgency.none { background: var(--none-soft); border-color: var(--none); color: #134425; }
.urgency.none .urgency-icon { background: var(--none); }

.doc-title { margin-bottom: 8px; }
.doc-sender { color: var(--ink-2); margin-bottom: 28px; }

.section { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 22px; margin-bottom: 16px; }
.section h2 { display: flex; align-items: center; gap: 10px; }
.section h2 .icon { color: var(--violet-ink); }
.summary { font-size: 1.1875rem; margin: 0; }

.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.todo-item { border-bottom: 1px solid var(--line); padding: 12px 0; }
.todo-item:last-child { border-bottom: 0; padding-bottom: 0; }
.todo-row { display: flex; gap: 14px; align-items: flex-start; }
.check {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none; margin-top: -2px;
  border: 2px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer; color: #fff;
}
.check .icon { width: 22px; height: 22px; stroke-width: 3; visibility: hidden; }
.check[aria-checked="true"] { background: var(--none); border-color: var(--none); }
.check[aria-checked="true"] .icon { visibility: visible; }
.todo-text { flex: 1; font-weight: 600; }
.todo-item.is-done .todo-text { text-decoration: line-through; color: var(--ink-2); font-weight: 500; }
.tip-tag { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: .875rem; font-weight: 600; color: var(--ink-2); }

.todo-progress { display: flex; align-items: center; gap: 12px; margin: -4px 0 8px; }
.todo-bar { flex: 1; height: 8px; border-radius: 999px; background: #dedad3; overflow: hidden; }
.todo-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--none); transition: width .3s ease; }
.todo-count { margin: 0; font-family: var(--mono); font-size: .8125rem; color: var(--ink-2); white-space: nowrap; }
.all-done { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; padding: 12px 14px; border-radius: var(--radius); background: var(--none-soft); color: #134425; font-weight: 700; }

details.source { margin-top: 8px; }
details.source > summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  font-size: .9375rem; font-weight: 600; color: var(--violet-ink); min-height: 40px;
}
details.source > summary::-webkit-details-marker { display: none; }
details.source > summary .icon { transition: transform .15s; }
details.source[open] > summary .icon { transform: rotate(90deg); }
[dir="rtl"] details.source[open] > summary .icon { transform: scaleX(-1) rotate(90deg); }
.quote { margin: 6px 0 0; padding: 12px 14px; background: #fff; border-inline-start: 3px solid var(--violet); border-radius: 4px; font-size: 1rem; }
.quote-label { margin: 0 0 2px; font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.quote-text { font-family: var(--serif); font-size: 1.0625rem; margin: 0 0 8px; }
.quote-text:last-child { margin-bottom: 0; }
.verify { display: inline-flex; align-items: center; gap: 6px; font-size: .875rem; font-weight: 700; margin: 4px 0 0; }
.verify .icon { width: 16px; height: 16px; }
.verify.ok { color: var(--none); }
.verify.bad { color: var(--medium); }

.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.facts li { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.facts li:last-child { border-bottom: 0; padding-bottom: 0; }
.fact-text { font-weight: 600; margin: 0; }

.contact { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.contact + .contact { margin-top: 12px; }
.contact-name { font-weight: 700; margin-bottom: 10px; }
.contact-hours { display: flex; gap: 8px; align-items: center; color: var(--ink-2); font-size: 1rem; margin: 10px 0 0; }
.contact .btn { width: 100%; }
.contact .btn + .btn { margin-top: 10px; }

.unsure { list-style: disc; margin: 4px 0 0; padding-inline-start: 22px; }

.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 24px 0 16px; }
.action-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 88px; padding: 12px 8px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2);
  font-weight: 600; font-size: 1rem; cursor: pointer; color: var(--ink); text-align: center; line-height: 1.25;
}
.action-btn:hover { border-color: var(--ink); background: #fff; }
.action-btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.action-btn .icon { width: 28px; height: 28px; }

.disclaimer { font-size: .9375rem; color: var(--ink-2); display: flex; gap: 10px; align-items: flex-start; }
.disclaimer .icon { width: 20px; height: 20px; margin-top: 2px; }

/* ---------- Reply ---------- */

.field-label { display: block; font-weight: 700; margin: 20px 0 8px; }
.textarea {
  width: 100%; min-height: 110px; padding: 14px 16px; resize: vertical;
  border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--surface);
  font: inherit; font-size: 1.0625rem; line-height: 1.5; color: var(--ink);
}
.textarea:focus { border-color: var(--ink); outline: 3px solid var(--focus); outline-offset: 0; }
.chips { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips-buttons { margin: 12px 0 20px; }
.chips-buttons button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg-2); cursor: pointer; font-weight: 500; font-size: 1rem; }
.chips-buttons button:hover { border-color: var(--ink); background: #fff; }

.reply-panes { display: grid; gap: 16px; margin-top: 28px; }
.pane { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.pane h2 { margin-bottom: 10px; font-family: var(--mono); font-size: .8125rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.pane .textarea { min-height: 380px; font-family: var(--serif); font-size: 1.0625rem; }
.pane-en .textarea { direction: ltr; text-align: left; }
.pane-text { white-space: pre-wrap; margin: 0; font-size: 1rem; }
.pane-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.pane-buttons .btn { min-height: 48px; font-size: 1rem; padding: 0 18px; }
.fill-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.fill-list code { font-family: var(--mono); font-size: .9375rem; background: var(--lavender-soft); padding: 2px 6px; border-radius: 4px; direction: ltr; unicode-bidi: embed; }

/* ---------- Error ---------- */

.error-view { text-align: center; padding-block: 56px; }
.error-art { display: inline-grid; place-items: center; width: 80px; height: 80px; border-radius: 50%; background: var(--medium-soft); color: var(--medium); margin-bottom: 16px; }
.error-art .icon { width: 38px; height: 38px; }
.error-view .lead { margin-inline: auto; }
.stack { display: grid; gap: 12px; max-width: 420px; margin: 28px auto 0; }

/* ---------- Language dialog ---------- */

dialog {
  width: min(480px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 14px;
  background: var(--bg-2); color: var(--ink); box-shadow: 0 24px 70px rgb(0 0 0 / 30%);
}
dialog::backdrop { background: rgb(28 28 28 / 55%); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding-block: 16px 8px; padding-inline: 20px 16px; }
.dialog-head h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 1.75rem; letter-spacing: -0.02em; }
:lang(zh) .dialog-head h2, :lang(ar) .dialog-head h2 { font-family: var(--font); font-weight: 700; font-size: 1.375rem; }
.lang-list { list-style: none; margin: 0; padding: 8px 12px 16px; display: grid; gap: 8px; }
.lang-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  min-height: 64px; padding: 8px 16px; text-align: start;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
}
.lang-option:hover { border-color: var(--ink); }
.lang-option[aria-current="true"] { border-color: var(--violet); background: var(--lavender-soft); }
.lang-native { display: block; font-weight: 700; font-size: 1.125rem; }
.lang-english { display: block; font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.lang-check { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--violet); color: #fff; }
.lang-check .icon { width: 18px; height: 18px; stroke-width: 3; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600;
  transition: opacity .2s, transform .2s; z-index: 40; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Larger screens ---------- */

@media (min-width: 640px) {
  .wrap { padding-inline: 24px; }
  .hero { padding-block: 80px 96px; }
  .hero-actions { flex-direction: row; justify-content: center; max-width: none; }
  .lines-panel { height: 380px; }
  .how-grid { grid-template-columns: repeat(3, 1fr); }
  .actions-grid { grid-template-columns: repeat(4, 1fr); }
  .contact .btn { width: auto; }
  .contact .btn + .btn { margin-top: 0; margin-inline-start: 10px; }
  .footer-card { padding: 40px; }
}

@media (min-width: 960px) {
  .split { padding-block: 112px; }
  .split-grid { grid-template-columns: 1.4fr 1fr; gap: 64px; }
  .split-grid > :last-child { padding-top: 12px; }

  /* Letter types float around the heading, joined by dashed lines. */
  .constellation { padding-block: 40px 112px; }
  .constellation-inner { height: 600px; }
  .curves { display: block; position: absolute; inset: 0 24px; width: calc(100% - 48px); height: 100%; }
  .constellation-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(620px, 62%); margin: 0; padding: 40px; background: radial-gradient(closest-side, var(--bg) 75%, rgb(236 233 228 / 0%)); }
  .nodes { display: block; }
  .node { position: absolute; }
  .node-bars {
    display: block; width: 150px; height: 46px; margin-top: 10px; border-radius: 3px; background-color: #fff;
    background-image: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 7px, var(--ink) 7px 8px, transparent 8px 12px, var(--ink) 12px 15px, transparent 15px 19px);
    background-size: 100% 70%; background-position: center; background-repeat: no-repeat;
  }
  .node-1 { top: 4%; inset-inline-start: 6%; }
  .node-2 { top: 0; inset-inline-start: 41%; }
  .node-3 { top: 6%; inset-inline-end: 6%; }
  .node-4 { top: 40%; inset-inline-start: 0; }
  .node-5 { top: 44%; inset-inline-end: 0; }
  .node-6 { bottom: 6%; inset-inline-start: 9%; }
  .node-7 { bottom: 0; inset-inline-start: 43%; }
  .node-8 { bottom: 10%; inset-inline-end: 8%; }

  .trust { padding-block: 24px 120px; }
  .reply-panes { grid-template-columns: 1fr 1fr; }
  .reply-panes.single { grid-template-columns: 1fr; }
  .narrow.wide-on-desktop { max-width: 1080px; }
  .footer-top { grid-template-columns: 1fr 1.4fr; }
}

@media (prefers-reduced-motion: reduce) {
  .lines line, .caret { animation: none !important; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---------- Printing a reply ---------- */

.print-only { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; white-space: pre-wrap; font-family: Georgia, serif; font-size: 12pt; line-height: 1.5; color: #000; }
}
