/* Shared shell for the interactive demos. Same palette and type as the main site. */
:root {
  --yellow: #FFC400;
  --yellow-soft: #FFF3C4;
  --board: #1C1F23;
  --seam: #121417;
  --flap-ink: #F3F0E8;
  --concrete: #E9EBEE;
  --paper: #FFFFFF;
  --ink: #1C1F23;
  --muted: #545B63;
  --line: rgba(28, 31, 35, .14);
  --green: #22B26B;
  --red: #C2412D;
  --blue: #2F6FD6;
  --pink: #D2457F;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(12px, 3vw, 28px);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--concrete); color: var(--ink); font: 400 16px/1.45 var(--body); -webkit-font-smoothing: antialiased; overflow-x: clip; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; margin: 0; line-height: 1; }
p, ul, ol, figure { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Demo bar */
.demo-bar { position: sticky; top: 0; z-index: 50; background: var(--board); color: var(--flap-ink); }
.demo-bar-in { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; padding: 10px var(--gutter); max-width: 1320px; margin: 0 auto; }
.demo-back { display: inline-flex; align-items: center; gap: 6px; font: 600 17px/1 var(--display); letter-spacing: .02em; text-decoration: none; color: var(--flap-ink); min-height: 32px; }
.demo-back:hover { color: var(--yellow); }
.demo-back svg { width: 16px; height: 16px; }
.demo-name { display: inline-flex; align-items: center; gap: 10px; font: 700 21px/1 var(--display); }
.demo-flag { font: 600 13px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--board); background: var(--yellow); padding: 4px 7px 3px; border-radius: 3px; }
.demo-note { flex: 1 1 260px; font-size: 14px; color: rgba(243,240,232,.7); }
.demo-reset { border: 1px solid rgba(243,240,232,.35); background: transparent; color: var(--flap-ink); border-radius: 999px; padding: 6px 14px; font: 600 15px/1 var(--display); letter-spacing: .02em; }
.demo-reset:hover { border-color: var(--yellow); color: var(--yellow); }
.demo-bar :focus-visible { outline-color: var(--yellow); }

.demo-main { max-width: 1320px; margin: 0 auto; padding: clamp(16px, 2.4vw, 28px) var(--gutter) 48px; }
.demo-hint { display: flex; gap: 10px; align-items: flex-start; background: var(--yellow-soft); border: 1px solid rgba(28,31,35,.12); border-radius: 10px; padding: 10px 14px; font-size: 15px; margin-bottom: 18px; }
.demo-hint b { font-family: var(--display); font-size: 17px; letter-spacing: .02em; white-space: nowrap; }

/* Common building blocks */
.panel { background: var(--paper); border-radius: 12px; box-shadow: 0 0 0 1px rgba(28,31,35,.1), 0 14px 30px -24px rgba(28,31,35,.4); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--ink); color: var(--yellow); font: 600 16px/1 var(--body); white-space: nowrap; }
.btn:hover { background: #000; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: 0 0 0 1.5px var(--ink) inset; }
.btn.ghost:hover { background: rgba(28,31,35,.06); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 14px; }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.yellow:hover { background: #F2B800; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--concrete); box-shadow: 0 0 0 1px var(--line) inset; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 6px 14px; font: 600 15px/1 var(--display); letter-spacing: .02em; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--yellow); }
.field { display: grid; gap: 5px; }
.field label, .label { font: 600 15px/1.1 var(--display); letter-spacing: .02em; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 40px; padding: 8px 11px; border: 1.5px solid rgba(28,31,35,.3); border-radius: 8px; background: var(--paper); }
textarea.input { min-height: 120px; resize: vertical; font: 13.5px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 2px var(--yellow); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font: 600 13px/1.2 var(--display); letter-spacing: .03em; background: var(--concrete); color: var(--ink); white-space: nowrap; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.muted { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 80; display: flex; align-items: center; gap: 14px; background: var(--board); color: var(--flap-ink); padding: 10px 12px 10px 18px; border-radius: 999px; box-shadow: 0 12px 30px -12px rgba(0,0,0,.5); transition: opacity .2s, transform .2s; font-size: 15px; max-width: calc(100vw - 24px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { border: 0; background: var(--yellow); color: var(--ink); border-radius: 999px; padding: 5px 12px; font: 600 14px/1 var(--display); letter-spacing: .03em; }

/* Phone frame, for tools that are phone first */
.phone-stage { display: flex; justify-content: center; }
.phone-frame { width: min(100%, 410px); border-radius: 42px; padding: 10px; background: var(--board); box-shadow: 0 30px 60px -30px rgba(28,31,35,.7); }
.phone-screen { position: relative; height: min(820px, calc(100vh - 150px)); min-height: 560px; border-radius: 33px; overflow: hidden; background: #F6F6F3; display: flex; flex-direction: column; }
@media (max-width: 520px) {
  .phone-frame { padding: 0; border-radius: 0; background: none; box-shadow: none; }
  .phone-screen { border-radius: 14px; height: calc(100vh - 140px); box-shadow: 0 0 0 1px var(--line); }
}

@media (max-width: 640px) {
  .demo-note { display: none; }
  .demo-name { font-size: 19px; }
}
@media print {
  .demo-bar, .demo-hint, .no-print { display: none !important; }
  body { background: #fff; }
  .demo-main { padding: 0; max-width: none; }
}
