:root {
  color-scheme: dark;
  --bg: #1f1f1f;
  --bg-2: #181818;
  --panel: #181818;
  --panel-2: #2a2d2e;
  --panel-3: #37373d;
  --line: #2b2b2b;
  --line-2: #3c3c3c;
  --text: #d7d7d7;
  --text-strong: #eef0f5;
  --text-2: #cccccc;
  --text-3: #9d9d9d;
  --brand-ink: #eef0f5;
  --brand-champagne: #d6b46a;
  --accent: #0078d4;
  --accent-hover: #026ec1;
  --accent-soft: #04395e;
  --accent-text: #4daafc;
  --on-accent: #ffffff;
  --focus: #4daafc;
  --input: #313131;
  --good: #5fd29a;
  --warn: #e5a50a;
  --bad: #f28b82;
  --glow-a: rgb(0 120 212 / 16%);
  --glow-b: rgb(214 180 106 / 7%);
  --grid: rgb(255 255 255 / 3.5%);
  --shadow-window: 0 0 0 1px #3c3c3c, 0 2px 4px rgb(0 0 0 / 40%), 0 24px 48px -12px rgb(0 0 0 / 60%), 0 64px 128px -32px rgb(0 0 0 / 70%);
  --shadow-card: 0 1px 2px rgb(0 0 0 / 30%);
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px; --s6: 48px; --s8: 64px; --s10: 80px; --s12: 96px; --s16: 128px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --mono: ui-monospace, 'JetBrains Mono', 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 120ms;
  --dur: 180ms;
  --wrap: 1200px;
  --gutter: 24px;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-2: #f8f8f8;
  --panel: #f8f8f8;
  --panel-2: #f2f2f2;
  --panel-3: #e8e8e8;
  --line: #e5e5e5;
  --line-2: #cecece;
  --text: #1f1f1f;
  --text-strong: #0b1a33;
  --text-2: #3b3b3b;
  --text-3: #616161;
  --brand-ink: #0b1a33;
  --brand-champagne: #b8924a;
  --accent: #005fb8;
  --accent-hover: #0258a8;
  --accent-soft: #e8e8e8;
  --accent-text: #005fb8;
  --on-accent: #ffffff;
  --focus: #005fb8;
  --input: #ffffff;
  --good: #1f7a4d;
  --warn: #8a5a00;
  --bad: #b3261e;
  --glow-a: rgb(0 95 184 / 9%);
  --glow-b: rgb(184 146 74 / 8%);
  --grid: rgb(0 0 0 / 3.5%);
  --shadow-window: 0 0 0 1px #e5e5e5, 0 2px 4px rgb(0 0 0 / 5%), 0 24px 48px -16px rgb(0 0 0 / 16%), 0 64px 120px -40px rgb(0 0 0 / 20%);
  --shadow-card: 0 1px 2px rgb(0 0 0 / 5%);
}
/* Duscode Cloud (cloud.duscode.com). One design system with duscode.com, the
   docs and the app: the colour, type and spacing tokens come from the shared
   packages/site/src/tokens.mjs, which the server puts in front of this file
   when it serves /assets/cloud.css (app.ts). Dark by default. Pages work
   without scripts; only the sign-in card adds /assets/auth.js as an
   enhancement. */
/* The cloud's own names for shared tokens. */
:root {
  --card: var(--panel);
  --shadow: var(--shadow-card);
  --brand-navy: #0b1a33;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 400 16px/1.6 var(--sans); font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
a { color: var(--text); text-underline-offset: 3px; text-decoration-color: var(--line-2); }
a:hover { text-decoration-color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
p, ul, dl, dd { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 0.9em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--on-accent); }
.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 { position: absolute; left: var(--s2); top: -64px; z-index: 100; padding: var(--s1) var(--s2); border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); text-decoration: none; }
.skip:focus { top: var(--s2); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); font-size: 14px; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.label { display: block; font: 500 13px/1.4 var(--mono); color: var(--text-3); }
/* Spacing utilities: the CSP allows no inline style attributes. */
.mt1 { margin-top: var(--s1); }
.mt2 { margin-top: var(--s2); }
.mt3 { margin-top: var(--s3); }

/* ---------- Header and footer (as on duscode.com) ---------- */
.site-header { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 82%, transparent); }
.header-inner { display: flex; align-items: center; gap: var(--s3); height: 60px; max-width: 1248px; margin: 0 auto; padding: 0 var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 16px; letter-spacing: -0.02em; }
.mark { width: 24px; height: auto; display: block; }
.mark .ink { fill: var(--brand-ink); }
.mark .acc { fill: var(--brand-champagne); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.header-actions form { margin: 0; }
.link-quiet { color: var(--text-2); text-decoration: none; font-size: 14px; background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; }
.link-quiet:hover, .link-quiet[aria-current='page'] { color: var(--text); }
.site-footer { margin-top: auto; border-top: 1px solid var(--line); background: var(--bg-2); }
.footer-inner { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); max-width: 1248px; margin: 0 auto; padding: var(--s3) var(--gutter); color: var(--text-3); font-size: 13px; }
.footer-inner a { color: var(--text-3); text-decoration: none; }
.footer-inner a:hover { color: var(--text); }
.footer-inner .spacer { flex: 1; }

/* ---------- Layout ---------- */
main { width: 100%; max-width: 760px; margin: 0 auto; padding: var(--s8) var(--gutter) var(--s8); }
main.narrow { max-width: 480px; }
h1 { font-size: clamp(32px, 4.4vw, 44px); letter-spacing: -0.045em; line-height: 1.05; color: var(--text-strong); }
h2 { font-size: 20px; letter-spacing: -0.025em; color: var(--text-strong); }
.lead { margin-top: var(--s2); color: var(--text-2); font-size: 17px; }
.stack > * + * { margin-top: var(--s3); }
.card { margin-top: var(--s3); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-card); }
.card > h2 + * { margin-top: var(--s2); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }
@media (max-width: 560px) { .card { padding: var(--s3); } main { padding-top: var(--s5); } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s1);
  height: 44px; padding: 0 20px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text-strong);
  font: 500 15px/1 var(--sans); letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.btn:hover { background: var(--panel-3); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
/* Quiet solid button (navy on light, near-white on dark), for actions that
   aren't the page's one primary call to action, such as Sign in. */
.btn.ink { background: var(--text-strong); border-color: transparent; color: var(--bg); }
.btn.ink:hover { background: var(--text-2); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 14px; border-radius: 6px; }
.btn.block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--s3); align-items: center; }
.actions form { margin: 0; }

/* ---------- Forms ---------- */
/* Flex gaps skip hidden inputs (display: none), which sibling margins would not. */
form.card { display: flex; flex-direction: column; gap: var(--s3); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.field .opt { color: var(--text-3); font-weight: 400; }
input[type='email'], input[type='text'], input[type='number'], textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--input); color: var(--text-strong); font: 400 16px/1.4 var(--sans);
}
textarea { resize: vertical; min-height: 88px; }
input:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
input[aria-invalid='true'] { border-color: var(--bad); }
.hint { color: var(--text-3); font-size: 13px; }
.error { color: var(--bad); font-size: 14px; }
.check { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 4px 10px; align-items: start; font-size: 15px; }
.check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--text); }
.check .error { grid-column: 2; }
.inline-form { display: flex; gap: var(--s1); flex-wrap: wrap; }
.inline-form input { flex: 1 1 220px; width: auto; }
.code-display { font: 600 clamp(28px, 7vw, 40px)/1.1 var(--mono); letter-spacing: 0.08em; margin-top: var(--s2); }

/* ---------- Notices ---------- */
.notice { margin-top: var(--s3); padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--panel); font-size: 15px; }
.notice.ok { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.notice.error { border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.notice.draft { border-color: var(--line-2); border-left: 2px solid var(--accent); background: var(--accent-soft); }

/* ---------- Facts, tables, plans ---------- */
.facts { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 10px var(--s2); margin-top: var(--s2); font-size: 15px; }
.facts dt { color: var(--text-3); }
.facts dd { overflow-wrap: anywhere; }
.rows { list-style: none; padding: 0; margin-top: var(--s2); border-top: 1px solid var(--line); }
.rows li { display: flex; align-items: center; gap: var(--s2); padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.rows li .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rows li form { margin: 0; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s2); margin-top: var(--s2); }
.plan { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.plan.featured { border-color: var(--accent); box-shadow: inset 0 2px 0 var(--accent); }
.plan form { margin-top: auto; display: flex; flex-direction: column; gap: var(--s2); }
.plan ul { padding-left: 1.1em; color: var(--text-2); font-size: 14.5px; }
.price { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; }
.price small { font-size: 14px; font-weight: 400; color: var(--text-2); letter-spacing: 0; }
.seats { max-width: 7em; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 var(--s1); border: 1px solid var(--line-2); border-radius: 999px; font: 500 12px/1 var(--mono); color: var(--text-2); vertical-align: 3px; }

/* ---------- Legal-style prose ---------- */
.prose h2 { margin-top: var(--s4); }
.prose p, .prose ul { margin-top: var(--s2); color: var(--text-2); }

/* ---------- Email preferences ---------- */
fieldset.prefs { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.prefs + fieldset.prefs { margin-top: var(--s3); }
fieldset.prefs legend { padding: 0; font-size: 15px; font-weight: 600; }
.prefs .pref { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 2px 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.prefs .pref:last-child { border-bottom: 0; }
.prefs .pref input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--text); }
.prefs .pref strong { font-weight: 500; font-size: 15px; }
.prefs .pref span { grid-column: 2; color: var(--text-3); font-size: 14px; }
.prefs .legend-note { margin-top: 4px; color: var(--text-3); font-size: 14px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Demo mode (D90): a quiet bar on every page ---------- */
.demo-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px var(--s2); padding: var(--s1) var(--gutter); border-bottom: 1px solid var(--line); background: var(--accent-soft); color: var(--text-2); font-size: 13px; text-align: center; }
.demo-bar strong { color: var(--text); font-weight: 600; }

/* ---------- Sign in / sign up: one card under the logo (D90) ----------
   Tabs top left, "Explore the demo" top right (demo mode only), a home button
   in the body's corner, the panels, and a footer strip. One panel shows at a
   time: /assets/auth.js switches them in place; without it the server shows
   the one the URL names, and #demo opens the picker through :target. */
body.auth { background: radial-gradient(1200px 520px at 50% -160px, var(--panel-2), transparent 70%), var(--bg); }
.auth-page { flex: 1; display: flex; flex-direction: column; align-items: center; gap: var(--s3); width: 100%; padding: var(--s8) 16px; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 24px; font-weight: 600; letter-spacing: -0.03em; border-radius: 8px; }
.auth-brand .mark { width: 28px; }
.auth-card { width: 100%; max-width: 520px; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }

.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 0; }
.auth-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.auth-tab { display: inline-flex; align-items: center; height: 32px; padding: 0 16px; border-radius: 7px; color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.auth-tab:hover { color: var(--text); }
.auth-tab[aria-current='page'] { background: var(--card); color: var(--text); box-shadow: 0 0 0 1px var(--line-2), 0 1px 2px rgb(0 0 0 / 12%); }
.demo-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--text); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.demo-pill:hover { background: var(--panel-2); }
.demo-pill[aria-expanded='true'] { background: var(--panel-2); border-color: var(--text-3); }
.demo-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.demo-pill .short { display: none; }

.auth-body { position: relative; padding: var(--s3) var(--s4) var(--s4); }
.home-btn { position: absolute; top: var(--s3); right: var(--s4); display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-2); transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.home-btn:hover { background: var(--panel-2); color: var(--text); }
.auth-panel:not([hidden]) { animation: auth-in var(--dur) var(--ease); }
@keyframes auth-in { from { opacity: 0; transform: translateY(4px); } }
/* No script: the pill's #demo still opens the picker. */
.auth-card:not(.js):has(#demo:target) .auth-panel { display: none; }
.auth-card:not(.js):has(#demo:target) #demo { display: block; }

.auth-head { display: flex; align-items: center; min-height: 32px; padding-right: 44px; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--panel-2); color: var(--text-2); font: 500 12px/1 var(--mono); letter-spacing: 0.02em; }
.chip-error { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.auth-title { margin-top: var(--s2); font-size: 24px; line-height: 1.25; letter-spacing: -0.025em; font-weight: 600; text-wrap: balance; }
.auth-title:focus { outline: none; }
.auth-lead { margin-top: var(--s1); color: var(--text-2); font-size: 15px; line-height: 1.55; }
.auth-alert { display: flex; flex-direction: column; gap: 2px; margin-top: var(--s2); padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--bg-2); font-size: 14px; line-height: 1.5; color: var(--text); }
.auth-alert strong { font-weight: 600; }
.auth-alert.error { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 7%, var(--card)); }
.auth-alert.ok { border-color: color-mix(in srgb, var(--good) 40%, transparent); }

.auth-form { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s3); }
.auth-card .field label, .invite-form > label { font-size: 13px; font-weight: 500; color: var(--text); }
.auth-card input[type='email'], .auth-card input[type='text'], .auth-card textarea { padding: 10px 14px; font-size: 15px; background: var(--bg); transition: border-color var(--dur-fast) var(--ease); }
.auth-card input::placeholder, .auth-card textarea::placeholder { color: var(--text-3); opacity: 1; }
.auth-card input:hover:not(:focus), .auth-card textarea:hover:not(:focus) { border-color: var(--text-3); }
.auth-card .error { font-size: 13px; }
.auth-card .hint { font-size: 13px; line-height: 1.5; }
.auth-card .btn { transition: background var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }
.auth-card .btn.primary { font-weight: 600; }
.auth-card .btn:disabled, .auth-card .btn[aria-disabled='true'] { opacity: 0.6; cursor: default; }
.auth-card .btn:disabled:hover { background: transparent; }
.auth-card .btn.is-busy { opacity: 0.75; cursor: progress; }
.auth-note { margin-top: calc(var(--s1) * -1); text-align: center; }
.sent-note { margin-top: 12px; text-align: center; }
.checks { display: flex; flex-direction: column; gap: 12px; }
.auth-card .check { font-size: 14px; color: var(--text-2); }
.auth-card .check a { color: var(--text); }

.or { display: flex; align-items: center; gap: 12px; margin: var(--s3) 0 var(--s2); color: var(--text-3); font: 500 12px/1 var(--sans); text-transform: uppercase; letter-spacing: 0.08em; }
.pw-signin { margin-top: var(--s2); }
.pw-signin > summary { cursor: pointer; color: var(--text-2); font-size: 14px; }
.pw-signin > summary:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; }
.pw-signin[open] > summary { margin-bottom: var(--s2); }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.auth-alt { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.invite-form { display: flex; flex-direction: column; gap: 6px; }
.invite-form input { font-family: var(--mono); font-size: 14px; letter-spacing: 0.02em; }
.switch-line { margin-top: var(--s3); color: var(--text-2); font-size: 14px; text-align: center; }
.switch-line a { color: var(--text); font-weight: 500; }

.demo-users { display: flex; flex-direction: column; gap: var(--s1); margin-top: var(--s3); }
.demo-user {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  width: 100%; min-height: 56px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font: inherit; text-align: left; cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.demo-user:hover { border-color: var(--line-2); background: var(--panel-2); }
.demo-user.is-busy { border-color: var(--text-3); cursor: progress; }
.demo-user .avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); color: var(--text); font-size: 13px; font-weight: 600; }
.demo-text { display: flex; flex-direction: column; min-width: 0; }
.demo-name { font-size: 14px; font-weight: 500; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-detail { color: var(--text-3); font-size: 13px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-user .pill { vertical-align: 0; }
.auth-back { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--s2); padding: 6px 10px 6px 6px; border-radius: 8px; color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none; }
.auth-back:hover { color: var(--text); background: var(--panel-2); }

.auth-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px var(--s2); padding: 14px var(--s4); border-top: 1px solid var(--line); background: var(--bg-2); color: var(--text-3); font-size: 13px; }
.auth-foot nav { display: flex; gap: var(--s2); }
.auth-foot a { color: var(--text-2); text-decoration: none; }
.auth-foot a:hover { color: var(--text); text-decoration: underline; }

/* Phones: the card starts on the first screen, fields at 16px (no iOS zoom). */
@media (max-width: 560px) {
  .auth-page { padding: var(--s3) 16px var(--s4); gap: var(--s2); }
  .auth-body { padding: var(--s2) var(--s2) var(--s3); }
  .home-btn { top: var(--s2); right: var(--s2); }
  .auth-top { padding: 8px 8px 0; }
  .auth-title { font-size: 18px; }
  .demo-detail { white-space: normal; }
  .auth-foot { padding: 12px var(--s2); }
  .auth-card input[type='email'], .auth-card input[type='text'], .auth-card textarea { font-size: 16px; }
}
@media (max-width: 360px) {
  .demo-pill .long { display: none; }
  .demo-pill .short { display: inline; }
}
/* Touch: every target at least 44px. */
@media (pointer: coarse) {
  .auth-tab, .demo-pill { height: 44px; }
  .home-btn { width: 44px; height: 44px; }
  .auth-head { padding-right: 56px; min-height: 44px; }
  .auth-back { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-panel:not([hidden]) { animation: none; }
  .auth-tab, .demo-pill, .home-btn, .demo-user, .auth-card .btn, .auth-card input, .auth-card textarea { transition: none; }
}

/* ---------- Admin → Settings (D-CLOUD-ADMIN-SETTINGS) ---------- */
main.wide { max-width: 1120px; }
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s5); align-items: start; }
.settings-nav { position: sticky; top: var(--s3); }
.settings-title { font-size: 32px; margin-top: 4px; }
.settings-nav ul { list-style: none; padding: 0; margin-top: var(--s3); display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-size: 15px; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.settings-nav a:hover { background: var(--panel); color: var(--text); }
.settings-nav a[aria-current='page'] { background: var(--panel-2); color: var(--text); font-weight: 500; box-shadow: inset 2px 0 0 var(--accent); }
.settings-nav a:focus-visible, .link-btn:focus-visible, .btn:focus-visible, select:focus-visible, .bootstrap summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.bootstrap { margin-top: var(--s4); font-size: 13px; color: var(--text-3); }
.bootstrap summary { cursor: pointer; color: var(--text-2); }
.bootstrap p, .bootstrap ul { margin-top: var(--s1); }
.bootstrap ul { padding-left: 1.1em; display: flex; flex-direction: column; gap: 4px; }
.bootstrap code { font: 12px/1.4 var(--mono); color: var(--text-2); overflow-wrap: anywhere; }
.group-title { font-size: clamp(28px, 3.4vw, 36px); letter-spacing: -0.04em; }
.settings-main .card { margin-top: var(--s3); }
.settings-main .notice ul { margin-top: 6px; padding-left: 1.1em; }
.settings-section { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--s3); }
.settings-section + .settings-section { padding-top: var(--s3); border-top: 1px solid var(--line); }
.settings-section legend { padding: 0; margin-bottom: var(--s2); font: 500 13px/1.4 var(--mono); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.setting { display: flex; flex-direction: column; gap: 6px; }
.setting-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s1) var(--s2); flex-wrap: wrap; }
.field-label { font-size: 14px; font-weight: 500; }
.field-label .opt { color: var(--text-3); font-weight: 400; }
.src { font: 500 12px/1.4 var(--mono); color: var(--text-3); }
.src-admin { color: var(--accent-text); }
.setting-secret { display: flex; align-items: center; gap: var(--s2); font-size: 14px; color: var(--text-2); }
.secret-state::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--text-3); vertical-align: 1px; }
.secret-state.is-set::before { background: var(--good); }
.link-btn { align-self: flex-start; background: none; border: 0; padding: 2px 0; font: 500 13px/1.4 var(--sans); color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; border-radius: 4px; }
.link-btn:hover { color: var(--text); }
select, input[type='password'], input[type='url'], input[type='date'] {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--input); color: var(--text-strong); font: 400 16px/1.4 var(--sans);
}
select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
select:focus, input[type='password']:focus, input[type='url']:focus, input[type='date']:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
select[aria-invalid='true'], textarea[aria-invalid='true'] { border-color: var(--bad); }
.affix { display: flex; align-items: stretch; max-width: 320px; }
.affix input { flex: 1; min-width: 0; }
.affix .pre, .affix .post { display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-2); font-size: 14px; white-space: nowrap; }
.affix .pre { border-right: 0; border-radius: 10px 0 0 10px; }
.affix .pre + input { border-radius: 0 10px 10px 0; }
.affix .post { border-left: 0; border-radius: 0 10px 10px 0; }
.affix input:has(+ .post) { border-radius: 10px 0 0 10px; }
.toggle, .check-inline { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; cursor: pointer; }
.toggle input, .check-inline input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.choices { display: flex; flex-wrap: wrap; gap: 0 var(--s3); }
.settings-form .form-actions { padding-top: var(--s3); border-top: 1px solid var(--line); }
.settings-form[aria-busy='true'] { opacity: 0.85; }
.checks li { align-items: flex-start; }
.mark-ok, .mark-bad { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; font-size: 13px; font-weight: 600; color: var(--on-accent); }
.mark-ok { background: var(--good); }
.mark-bad { background: var(--bad); }
.table-wrap { overflow-x: auto; margin-top: var(--s2); }
.margins { width: 100%; border-collapse: collapse; font-size: 15px; }
.margins th, .margins td { padding: 10px 12px 10px 0; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.margins thead th { font: 500 12px/1.4 var(--mono); color: var(--text-3); }
.margins td.good { color: var(--good); }
.margins td.bad { color: var(--bad); }
/* A provider's fields only while that provider is chosen (no script needed; without :has, all show). */
@supports selector(:has(a)) {
  .settings-form [data-when] { display: none; }
  .settings-form:has(#s-email-provider option[value='resend']:checked) [data-when~='resend'],
  .settings-form:has(#s-email-provider option[value='postmark']:checked) [data-when~='postmark'],
  .settings-form:has(#s-email-provider option[value='ses']:checked) [data-when~='ses'],
  .settings-form:has(#s-email-provider option[value='smtp']:checked) [data-when~='smtp'],
  .settings-form:has(#s-email-provider option[value='console']:checked) [data-when~='console'] { display: flex; }
  .setting-note { flex-direction: column; gap: var(--s1); }
}
@media (max-width: 860px) {
  .settings { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  .settings-nav { position: static; }
  .settings-nav ul { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .settings-nav a { border: 1px solid var(--line); }
  .settings-nav a[aria-current='page'] { box-shadow: none; border-color: var(--accent); }
}
@media (prefers-reduced-motion: reduce) {
  .settings-nav a { transition: none; }
}

/* ---------- One design with the site and the app (D-SITE-REDESIGN) ---------- */
/* A calm glow behind the first screen, as on duscode.com. */
body { background: radial-gradient(640px 320px at 85% -40px, var(--glow-a), transparent 70%) no-repeat, var(--bg); }
.theme-form { margin: 0; display: inline; }
.theme-form .link-quiet { font-size: 13px; color: var(--text-3); }
.theme-form .link-quiet:hover { color: var(--text); }
.crumb { color: var(--text-3); font-size: 14px; margin-bottom: var(--s1); }
.crumb a { color: var(--text-2); text-decoration: none; }
.crumb a:hover { color: var(--text-strong); }
/* Groups on a long page: a quiet mono heading, then its cards. */
.group-h { margin-top: var(--s6); font: 500 13px/1.4 var(--mono); letter-spacing: 0; color: var(--text-3); }
.group-h + .card { margin-top: var(--s2); }
.card h2 .pill { margin-left: 8px; }
.pill.on { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
/* The one confirmation per visit (the 15-minute step-up window). */
.card.confirm { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.confirm-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-top: var(--s2); }
.confirm-form .field { margin: 0; }
.confirm-form .btn { margin-bottom: 0; }
.confirmed { display: flex; align-items: center; gap: 10px; margin-top: var(--s3); padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--good) 40%, var(--line)); border-radius: var(--radius); background: var(--panel); color: var(--text-2); font-size: 15px; }
.confirmed .mark-ok { background: var(--good); }
.small { font-size: 13px; }
.card.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
@media (max-width: 560px) {
  .confirm-form { grid-template-columns: minmax(0, 1fr); }
  /* Rows with actions (team members, sessions): the name takes the full width, actions wrap below. */
  .rows li { flex-wrap: wrap; }
  .rows li > :first-child { flex: 1 1 100%; min-width: 0; overflow-wrap: anywhere; }
}

/* Admin → Posts (D-BLOG-CMS) */
input[type='datetime-local'], input[type='file'] { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--input, var(--panel)); color: var(--text); font: inherit; max-width: 100%; }
.post-form textarea.mono { font-size: 14px; line-height: 1.55; min-height: 360px; }
.post-form .affix { max-width: 100%; }
.posts-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.posts-table th, .posts-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.posts-table thead th { font: 500 12px/1.4 var(--mono); color: var(--text-3); }
.posts-table a { color: var(--text); }
.pill.bad, .post-status-unpublished { color: var(--bad); }
.post-status-published { color: var(--good); }
.post-status-in_review, .post-status-scheduled { color: var(--accent-text); }
.post-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px var(--s3); margin-top: var(--s2); }
.post-facts dt { font: 500 12px/1.4 var(--mono); color: var(--text-3); }
.post-facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.schedule-form { margin-top: var(--s3); padding-top: var(--s2); border-top: 1px solid var(--line); }
.schedule-form label { font-size: 14px; font-weight: 500; }
.schedule-form .actions { margin-top: 8px; }
.schedule-form input { flex: 1 1 200px; min-width: 0; width: 100%; }
.upload-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); margin-top: var(--s2); }
.upload-form select, .upload-form input { width: 100%; min-width: 0; }
.media-list img { width: 96px; height: auto; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.media-list code { font-size: 12px; overflow-wrap: anywhere; }
.mark-bad { color: var(--bad); font-weight: 600; }
.mark-ok { color: var(--good); font-weight: 600; }
.post-editor .label a { color: inherit; }
@media (max-width: 760px) {
  .posts-table thead { display: none; }
  .posts-table tr { display: grid; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .posts-table th, .posts-table td { border: 0; padding: 2px 0; }
}
@media (max-width: 480px) {
  .header-actions { gap: 12px; }
  .post-editor input, .post-editor textarea, .post-editor select, .upload-form input { max-width: 100%; min-width: 0; }
  .post-form .affix .pre { padding: 0 8px; }
}
