/* e-NABLE Web Central — one small stylesheet, no build step. */
:root {
  --brand: #4c1d95;
  --brand-2: #6d28d9;
  --brand-soft: #f1ecfb;
  --accent: #f59e0b;
  --ink: #1f1830;
  --muted: #6b6480;
  --line: #e6e1ef;
  --bg: #faf8fd;
  --card: #ffffff;
  --ok: #047857;
  --ok-soft: #e7f6ef;
  --warn: #b45309;
  --warn-soft: #fff4e0;
  --bad: #b91c1c;
  --bad-soft: #fdecec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 24, 48, .06), 0 4px 16px rgba(31, 24, 48, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 17px; }
img { max-width: 100%; height: auto; }
a { color: var(--brand-2); }
a:hover { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
main { padding: 28px 0 56px; min-height: 60vh; }

/* Header */
.site-header { background: var(--brand); color: #fff; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.brand img { width: 40px; height: 40px; }
.brand:hover { color: #fff; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; flex-wrap: wrap; align-items: center; }
.nav a, .nav button { color: #ede7fb; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: .95rem; background: none; border: 0; cursor: pointer; font: inherit; }
.nav a:hover, .nav button:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav .pill { background: var(--accent); color: #2b1600; font-weight: 600; }
.nav .pill:hover { background: #fbbf24; color: #2b1600; }
.badge-count { background: var(--accent); color: #2b1600; border-radius: 999px; padding: 0 7px; font-size: .78rem; font-weight: 700; margin-inline-start: 4px; }
.nav-toggle { display: none; }
@media (max-width: 760px) {
  .nav-toggle { display: block; margin-inline-start: auto; background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 8px; padding: 6px 10px; font: inherit; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  .nav.open { display: flex; }
  .nav form { display: contents; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: #fff; padding: 28px 0; font-size: .92rem; color: var(--muted); }
.site-footer .cols { display: flex; gap: 32px; flex-wrap: wrap; justify-content: space-between; }
.site-footer a { color: var(--muted); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 4px 0; }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 20px; }
.messages li { padding: 12px 16px; border-radius: 10px; margin-bottom: 8px; background: var(--brand-soft); border-inline-start: 4px solid var(--brand-2); }
.messages .success { background: var(--ok-soft); border-color: var(--ok); }
.messages .warning { background: var(--warn-soft); border-color: var(--warn); }
.messages .error { background: var(--bad-soft); border-color: var(--bad); }

/* Cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card > :last-child { margin-bottom: 0; }
.card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-title h2, .card-title h3 { margin: 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* Buttons */
.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-2); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn:hover { background: var(--brand); color: #fff; }
.btn-lg { padding: 15px 26px; font-size: 1.08rem; border-radius: 12px; }
.btn-ghost { background: #fff; color: var(--brand-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--brand-soft); color: var(--brand); }
.btn-accent { background: var(--accent); color: #2b1600; }
.btn-accent:hover { background: #fbbf24; color: #2b1600; }
.btn-ok { background: var(--ok); }
.btn-ok:hover { background: #065f46; }
.btn-danger { background: #fff; color: var(--bad); border-color: #f3c4c4; }
.btn-danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn-small { padding: 7px 12px; font-size: .9rem; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-2); text-decoration: underline; cursor: pointer; font: inherit; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--brand) 0%, #6d28d9 60%, #8b5cf6 100%); color: #fff; padding: 56px 0 64px; margin: -28px calc(50% - 50vw) 32px; }
.hero > .wrap { padding: 0 16px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); max-width: 18ch; }
.hero p { font-size: 1.15rem; max-width: 46ch; color: #efe9fc; }
.hero .choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 28px; max-width: 760px; }
.choice { display: block; background: #fff; color: var(--ink); border-radius: var(--radius); padding: 22px; text-decoration: none; box-shadow: 0 8px 30px rgba(0,0,0,.18); transition: transform .12s; }
.choice:hover { transform: translateY(-2px); color: var(--ink); }
.choice .icon { font-size: 2rem; }
.choice strong { display: block; font-size: 1.2rem; margin: 6px 0 4px; color: var(--brand); }
.choice span { color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; }
.stat b { display: block; font-size: 2rem; color: var(--brand); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .92rem; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { position: relative; padding-block: 0 18px; padding-inline: 52px 0; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; inset-inline-start: 0; top: -2px; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; }
.steps li strong { display: block; }

/* Status */
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.status-open { background: var(--warn-soft); color: var(--warn); }
.status-matched { background: var(--brand-soft); color: var(--brand); }
.status-delivered, .status-completed { background: var(--ok-soft); color: var(--ok); }
.status-closed { background: #eee; color: #555; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .8rem; background: #f3f1f7; color: var(--muted); margin: 2px 2px 2px 0; }
.tag-local { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.tag-invited { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.flag { background: var(--bad-soft); color: var(--bad); padding: 2px 9px; border-radius: 999px; font-size: .82rem; font-weight: 600; }

.tracker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 8px; }
.tracker div { text-align: center; font-size: .82rem; color: var(--muted); }
.tracker div::before { content: ""; display: block; height: 8px; border-radius: 99px; background: var(--line); margin-bottom: 6px; }
.tracker .done::before { background: var(--brand-2); }
.tracker .current::before { background: linear-gradient(90deg, var(--brand-2), var(--accent)); }
.tracker .current { color: var(--ink); font-weight: 700; }

.callout { padding: 16px 18px; border-radius: 12px; background: var(--brand-soft); border: 1px solid #ddd2f5; margin-bottom: 16px; }
.callout > :last-child { margin-bottom: 0; }
.callout-ok { background: var(--ok-soft); border-color: #bfe5d3; }
.callout-warn { background: var(--warn-soft); border-color: #f5d9a6; }
.callout h3 { margin-bottom: 6px; }

/* Lists of things */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--line); padding: 14px 0; }
.list > li:first-child { border-top: 0; padding-top: 0; }
.item-row { display: flex; gap: 14px; align-items: flex-start; }
.item-row .thumb { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex: none; background: var(--brand-soft); }
.item-row .grow { flex: 1; min-width: 0; }
.item-row h3 { margin: 0 0 2px; font-size: 1.05rem; }
.item-row h3 a { text-decoration: none; color: var(--ink); }
.item-row h3 a:hover { color: var(--brand-2); }

.checklist { list-style: none; padding: 0; margin: 0 0 12px; }
.checklist li { padding-inline-start: 28px; position: relative; margin: 6px 0; }
.checklist li::before { content: "✓"; position: absolute; inset-inline-start: 4px; color: var(--brand-2); font-weight: 700; }
.checklist.tools li::before { content: "•"; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
@media (max-width: 520px) { dl.facts { grid-template-columns: 1fr; } dl.facts dd { margin-bottom: 8px; } }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photos a { display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--brand-soft); }
.photos img { width: 100%; height: 100%; object-fit: cover; }

.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.device { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.device .pic { aspect-ratio: 4/3; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand); font-size: 2rem; }
.device .pic { background: #fff; }
.device .pic img { width: 100%; height: 100%; object-fit: contain; }
.device .body { padding: 12px; font-size: .92rem; flex: 1; }
.device .body strong { display: block; font-size: 1rem; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 14px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .meta { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.timeline .event { color: var(--muted); font-size: .93rem; }
.timeline .note { background: #fffbea; margin: 0 -12px; padding: 12px; border-radius: 10px; }
.timeline .body { white-space: pre-line; }
.timeline .photos { margin-top: 8px; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }

/* Forms */
form .field { margin-bottom: 18px; }
label, .label { display: block; font-weight: 600; margin-bottom: 6px; }
.help { font-size: .88rem; color: var(--muted); margin-top: 4px; }
.errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: var(--bad); font-size: .9rem; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--bad); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=tel], input[type=search], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #cfc8dc; border-radius: 10px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 3px solid #ddd0fb; border-color: var(--brand-2); }
textarea { resize: vertical; }
input[type=file] { font: inherit; max-width: 100%; }
.choices-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.choices-list.inline { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.choices-list label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; padding: 11px 14px; border: 1px solid #ddd6e8; border-radius: 10px; cursor: pointer; background: #fff; margin: 0; }
.choices-list label:hover { border-color: var(--brand-2); }
.choices-list input { margin-top: 4px; accent-color: var(--brand-2); }
.choices-list label:has(input:checked) { border-color: var(--brand-2); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand-2); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--brand-2); flex: none; }
fieldset { border: 0; padding: 0; margin: 0; }
.form-section { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.form-section > h2 { display: flex; align-items: center; gap: 12px; }
.form-section > h2 .num { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-2); color: #fff; display: inline-grid; place-items: center; font-size: 1rem; flex: none; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .two-col { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; }
details { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #fff; margin-bottom: 12px; }
details summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 10px; }

.photo-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.photo-guide div { background: var(--brand-soft); border-radius: 10px; padding: 12px; font-size: .9rem; }
.photo-guide b { display: block; font-size: 1.4rem; }

table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.table-wrap { overflow-x: auto; max-width: 100%; }
details { max-width: 100%; overflow-x: auto; }

/* Docs & changelog */
.prose h2 { margin-top: 1.6em; padding-top: .4em; border-top: 1px solid var(--line); }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-inline-start: 1.3em; }
.prose li { margin: 4px 0; }
.prose code { background: #f3f1f7; padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.prose table { margin: 12px 0; }
.release { border-inline-start: 4px solid var(--brand-soft); padding-inline-start: 18px; margin-bottom: 28px; }
.release h2 { border: 0; margin: 0 0 4px; padding: 0; }
.release h3 { font-size: 1rem; color: var(--brand); margin: 14px 0 4px; }
.docs-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; }
@media (max-width: 760px) { .docs-layout { grid-template-columns: minmax(0, 1fr); } .docs-layout nav { order: 2; } }
.prose blockquote { margin: 0 0 1.2em; padding: 12px 16px; background: var(--brand-soft); border-radius: 10px; color: var(--muted); }
.prose blockquote p { margin: 0; }
.docs-nav { list-style: none; padding: 0; margin: 0; position: sticky; top: 16px; }
.docs-nav a { display: block; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.docs-nav a.active, .docs-nav a:hover { background: var(--brand-soft); color: var(--brand); }

/* Language menu */
.lang-menu { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.lang-menu select { width: auto; padding: 5px 8px; font-size: .9rem; border-radius: 8px; }
.site-header .lang-menu select { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); }
.site-header .lang-menu select option { color: var(--ink); background: #fff; }
.site-footer .lang-menu { color: var(--muted); }

/* Right-to-left languages (Arabic, Urdu, Hebrew) */
[dir="rtl"] .hero { background: linear-gradient(225deg, var(--brand) 0%, #6d28d9 60%, #8b5cf6 100%); }
[dir="rtl"] .docs-nav, [dir="rtl"] .timeline .body { text-align: start; }
[dir="rtl"] input[type=email], [dir="rtl"] input[type=url], [dir="rtl"] input[type=tel] { direction: ltr; text-align: end; }

/* "Which design is right?" guide */
.guide { margin: 8px 0 28px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 14px 0; }
.guide-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border-top: 5px solid var(--brand-2); display: flex; flex-direction: column; }
.guide-card:nth-child(2) { border-top-color: var(--accent); }
.guide-card:nth-child(3) { border-top-color: #9ca3af; }
.guide-card:nth-child(4) { border-top-color: var(--ok); }
.guide-card .btn, .guide-card .row { margin-top: auto; }
.guide-icon { font-size: 2.2rem; line-height: 1; margin-bottom: 8px; }
.guide-card h3 { margin-bottom: 4px; }
.guide-card h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 0 4px; }
.guide-who { font-weight: 600; }
.guide-how { font-size: .93rem; color: var(--muted); }
.device-notes { margin: 8px 0; padding: 6px 10px; font-size: .88rem; }
.device-notes p { margin: 6px 0; }
.device-notes .good { color: var(--ok); }
.device-notes .bad { color: var(--warn); }

/* "What's new in e-NABLE Web Central 2" summary on the What's new page */
.summary-card { border-top: 5px solid var(--brand-2); }
.summary-card > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; font-size: 1.5rem; }
.summary-card h2 { font-size: 1.15rem; }
