:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --text: #1d1b16;
  --muted: #6a655a;
  --line: #e4dfd3;
  --accent: #2f5bd3;
  --accent-text: #ffffff;
  --accent-soft: #e8eefc;
  --warm: #9a5416;
  --brand-amber: #b45309;
  --highlight: #cf6a00; /* the plugin's highlight colour, for the toggle and legend */
  --input-line: #857f73; /* form field borders: 3:1 against the background */
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans SC", "PingFang SC",
    "Microsoft YaHei", "Noto Sans Arabic", Tahoma, sans-serif;
  color-scheme: light;
}
/* The site's own theme switch sets data-theme (see the inline script in <head> and demo.js). */
html[data-theme="dark"] {
  --bg: #15171b;
  --surface: #1e2127;
  --text: #ebe8e1;
  --muted: #a19c91;
  --line: #333841;
  --accent: #7ea2ff;
  --accent-text: #0e1320;
  --accent-soft: #232c44;
  --brand-amber: #fbbf24;
  --warm: #fbbf24;
  --input-line: #757d89;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Classes like .btn set display, which would otherwise override the hidden attribute. */
[hidden] { display: none !important; }
/* Hidden until demo.js has rendered the saved language; the inline <head> script adds the class. */
html.loading body { visibility: hidden; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-block-end: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
/* Wordmark: one word, three colours (the amber matches the plugin's highlight colour). */
.brand { display: inline-flex; align-items: baseline; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.brand-k { color: var(--accent); }
.brand-word { color: var(--text); }
.brand-accent { color: var(--brand-amber); }
.nav { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); font-weight: 650; box-shadow: inset 0 -2px 0 var(--accent); }
.controls { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.lang-picker {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 10px; color: var(--muted);
  border: 1px solid var(--input-line); border-radius: 999px; background: var(--surface);
}
.lang-picker select { border: 0; background: transparent; color: var(--text); font: inherit; padding: 7px 6px; }
.theme {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; cursor: pointer;
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  white-space: nowrap;
}
.theme:hover { color: var(--text); }
.toggle {
  display: inline-flex; align-items: center; gap: 10px; font: inherit; font-weight: 600; cursor: pointer;
  padding: 7px 14px 7px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  white-space: nowrap;
}
.toggle .switch { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--line); transition: background .2s; }
.toggle .switch::after {
  content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: inset-inline-start .2s;
}
.toggle[aria-pressed="true"] { border-color: var(--highlight); }
.toggle[aria-pressed="true"] .switch { background: var(--highlight); }
.toggle[aria-pressed="true"] .switch::after { inset-inline-start: 16px; }

/* ---- Hero ---- */
.hero { padding: 64px 0 40px; }
.eyebrow { margin: 0 0 8px; color: var(--warm); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
:lang(zh-Hans) .eyebrow, :lang(ar) .eyebrow { letter-spacing: 0; }
h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.1; margin: 0 0 16px; letter-spacing: -.02em; max-width: 18ch; }
:lang(ar) h1, :lang(zh-Hans) h1 { letter-spacing: 0; line-height: 1.3; }
.lead { font-size: 19px; color: var(--muted); max-width: 62ch; margin: 0 0 24px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding: 0; margin: 0 0 24px; list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px 14px 16px; display: flex; gap: 12px; align-items: flex-start;
}
.steps li::before {
  content: counter(step); flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px;
}
.backend { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 15px; }
.backend-badge {
  font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .04em;
  padding: 5px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent);
}
.reset-done { color: #1a7f37; font-weight: 600; }
.reset-error { color: #cf222e; font-weight: 600; }

/* ---- Examples ---- */
.examples { padding: 24px 0 64px; }
.examples h2 { font-size: 28px; margin: 0 0 20px; letter-spacing: -.01em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
}
.card h3 { margin: 0; font-size: 18px; padding-inline-end: 36px; }
.card p { margin: 0; }
.card > p:first-of-type { color: var(--muted); font-size: 15px; }
.num {
  position: absolute; top: 18px; inset-inline-end: 18px; font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px;
}
.muted { color: var(--muted); }
.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.link { font-weight: 600; }
.ticks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ticks li { display: flex; gap: 8px; align-items: baseline; }
.ticks li::before { content: "✓"; color: var(--warm); font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; cursor: pointer;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.small { padding: 5px 12px; font-size: 14px; }
.icon-btn {
  flex: none; width: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 700; cursor: help;
}
.field { display: flex; flex-direction: column; gap: 6px; width: 100%; font-size: 14px; font-weight: 600; }
.field input, .field select {
  font: inherit; font-weight: 400; font-size: 15px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--input-line); background: var(--bg); color: var(--text); width: 100%;
}
.search-row { display: flex; gap: 8px; }
.photo { width: 100%; height: auto; border-radius: 10px; }
.bubble-text, .boxed { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; width: 100%; }
.legal { background: var(--bg); border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.notices { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.notice {
  border-inline-start: 4px solid var(--warm); background: var(--bg); padding: 8px 12px; border-radius: 8px;
  animation: slide .25s ease-out;
}
@keyframes slide { from { opacity: 0; transform: translateY(-4px); } }
.details { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.details summary { cursor: pointer; font-weight: 600; }
.details p { margin-top: 8px !important; color: var(--muted); }
.quote { margin: 0; width: 100%; }
.quote blockquote {
  margin: 0; font-size: 19px; font-style: italic; line-height: 1.5;
  border-inline-start: 4px solid var(--accent); padding-inline-start: 14px;
}
.quote figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 18px; height: 12px; border-radius: 3px; border: 2px dashed; }
.swatch.ok { border-color: var(--highlight); }
.swatch.missing { border-color: #e11d48; }

.footer { border-block-start: 1px solid var(--line); padding: 24px 0 90px; color: var(--muted); font-size: 14px; }
.footer p { margin: 0; }

/* ---- About / Contact pages ---- */
.page-section { padding: 8px 0 40px; }
.page-section h2 { font-size: 26px; margin: 0 0 16px; letter-spacing: -.01em; }
.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px; align-items: start; }
.prose p { font-size: 17px; max-width: 60ch; margin: 0 0 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat {
  margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; font-size: 18px; font-weight: 600;
}
.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--accent-soft); border-radius: var(--radius); padding: 22px 24px;
}
.cta p { margin: 0; font-size: 17px; font-weight: 500; }
.cta .btn { text-decoration: none; }
.contact-form h2, .side h2 { font-size: 20px; margin: 0; }
.contact-form textarea {
  font: inherit; font-weight: 400; font-size: 15px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--input-line); background: var(--bg); color: var(--text); width: 100%; resize: vertical;
}
.form-result { margin: 0; width: 100%; padding: 10px 14px; border-radius: 10px; font-weight: 500; }
.form-result.ok { background: #dafbe1; color: #116329; }
.form-result.err { background: #ffebe9; color: #a40e26; }
html[data-theme="dark"] .form-result.ok { background: #12361f; color: #7ee2a8; }
html[data-theme="dark"] .form-result.err { background: #3d1418; color: #ffa198; }
.small { font-size: 13px; margin: 0; }
.side { display: flex; flex-direction: column; gap: 16px; }
.hours { width: 100%; border-collapse: collapse; }
.hours th, .hours td { text-align: start; padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 400; }
.hours th { font-weight: 600; }
.hours td { text-align: end; color: var(--muted); }

@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar-inner { gap: 10px 16px; padding-block: 10px; }
  .controls { width: 100%; margin-inline-start: 0; justify-content: space-between; flex-wrap: wrap; }
  .hero { padding-top: 36px; }
  .grid { grid-template-columns: 1fr; }
}
