@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:400;font-display:swap;src:url('fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2') format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:400;font-display:swap;src:url('fonts/ibm-plex-sans-arabic-latin-400-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:500;font-display:swap;src:url('fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2') format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:500;font-display:swap;src:url('fonts/ibm-plex-sans-arabic-latin-500-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:600;font-display:swap;src:url('fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2') format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:'IBM Plex Sans Arabic';font-style:normal;font-weight:600;font-display:swap;src:url('fonts/ibm-plex-sans-arabic-latin-600-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Baloo Bhaijaan 2';font-style:normal;font-weight:700;font-display:swap;src:url('fonts/baloo-bhaijaan-2-arabic-700-normal.woff2') format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:'Baloo Bhaijaan 2';font-style:normal;font-weight:700;font-display:swap;src:url('fonts/baloo-bhaijaan-2-latin-700-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Baloo Bhaijaan 2';font-style:normal;font-weight:800;font-display:swap;src:url('fonts/baloo-bhaijaan-2-arabic-800-normal.woff2') format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:'Baloo Bhaijaan 2';font-style:normal;font-weight:800;font-display:swap;src:url('fonts/baloo-bhaijaan-2-latin-800-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

:root {
  --cream: #FFF9EF;
  --navy: #16213B;
  --red: #FF5A4E;
  --red-deep: #C93B31;
  --red-deep-hover: #B2342B;
  --yellow: #FFD84D;
  --mint: #2DD4A6;
  --ink-muted: #4B5470;
  --line: #EEE6D6;
  --card: #FFFFFF;
  --notch-bg: #111827;
  --notch-ink: #F4F1EA;
  --notch-dim: #7C849B;
  --font-head: 'Baloo Bhaijaan 2', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius-card: 22px;
  --radius-pill: 999px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1080px;
  --bar-h: 52px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--navy);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 8px; }

.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;
}

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .95rem;
  line-height: 1;
  padding: .85rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--red-deep); color: #fff; }
.btn-primary:hover { background: var(--red-deep-hover); }
.btn-secondary { background: transparent; border-color: #D9D2C3; color: var(--navy); }
.btn-secondary:hover { border-color: var(--navy); }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }
.btn-sm { padding: .45rem 1.1rem; font-size: .85rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* One screen, no scrolling on desktop: menu-bar header with the notch hanging from it, hero text,
   then script and settings side by side filling the rest, and a small footer. */
.page { min-height: 100dvh; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }

/* Header: a dark strip like the macOS menu bar; the prompter (notch) hangs from it. */
.menubar { position: relative; height: calc(max(var(--bar-h), var(--notch-h, 170px)) + 14px); }
.menubar-bar {
  position: absolute; inset: 0 0 auto 0; height: var(--bar-h); z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-inline: var(--gutter); background: var(--notch-bg); color: var(--notch-ink);
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-mark { width: 24px; height: 24px; flex: none; }
.menubar .logo-mark path:first-child { fill: var(--red); }
.menubar .logo-mark circle { fill: var(--red-deep); }
.menubar .logo-mark .scribble { stroke: #fff; }
.scribble { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw 1.1s ease-out .2s both; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.brand-ar { font-family: var(--font-head); font-weight: 800; font-size: 1.45rem; line-height: 1; color: var(--red); }
.brand-latin { font-family: var(--font-head); font-weight: 700; font-size: .85rem; color: var(--notch-dim); direction: ltr; align-self: flex-end; padding-bottom: 2px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.menubar .lang-switch, .menubar .gh { font-weight: 500; font-size: .88rem; color: #C9CEDB; text-decoration: none; padding: 4px 8px; border-radius: 8px; }
.menubar .lang-switch:hover, .menubar .gh:hover { color: #fff; background: #1F2A44; }
.lang-switch, .gh { font-weight: 500; font-size: .92rem; color: var(--ink-muted); text-decoration: none; padding: 4px 8px; border-radius: 8px; }
.lang-switch:hover, .gh:hover { color: var(--navy); background: #F3ECDD; }

.hero { padding: 6px var(--gutter) 0; text-align: center; }
.hero-title { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.7rem, 3.6vw, 2.7rem); line-height: 1.3; }
.hero-title .line { display: inline-block; }
.marker { position: relative; display: inline-block; z-index: 0; }
.marker::after {
  content: ''; position: absolute; inset-inline: -.15em; bottom: .1em; height: .42em;
  background: var(--yellow); border-radius: 6px; z-index: -1; transform: rotate(-1.2deg);
}
.hero-sub { margin-top: 2px; font-size: clamp(1rem, 1.7vw, 1.2rem); color: var(--ink-muted); }

.demo { min-height: 0; padding: 14px var(--gutter) 12px; max-width: 1180px; width: 100%; margin-inline: auto; }

.site-footer {
  padding: 8px var(--gutter) 10px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  color: var(--ink-muted); font-size: .85rem; line-height: 1.4;
}
.byline { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink-muted); border-radius: 999px; padding: 2px 4px; }
.byline:hover { color: var(--navy); }
.byline-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: #F3ECDD; border: 1px solid var(--line); }
.byline:hover .byline-avatar { border-color: var(--navy); }

/* Desktop: lock to one screen. Smaller screens scroll normally. */
@media (min-width: 900px) and (min-height: 620px) {
  .page { height: 100dvh; overflow: hidden; }
}
@media (max-width: 899px) {
  /* Sticky header: the menu bar and the prompter stay at the top while the page scrolls under them. */
  .menubar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--cream); border-bottom: 1px solid var(--line); height: calc(var(--bar-h) + min(var(--notch-h, 170px), 24dvh) + 50px); }
  body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--notch-bg); }
  .hero { padding-top: 14px; }
  /* A phone held sideways has no height to spare: the header scrolls away, Start and Restart stay. */
  @media (max-height: 500px) { .menubar { position: relative; } }
  .hero-title { font-size: clamp(1.45rem, 6.4vw, 2rem); }
  .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .brand-latin { display: none; }
  .menubar .gh { display: none; }
}

/* The prompter: a notch hanging from the menu-bar header, like the real thing. */
.stage {
  --bar-clear: 210px; /* keeps a wide notch from covering the brand and the Buy button */
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  direction: ltr; display: flex; justify-content: center; align-items: flex-start; padding-inline: 12px;
}
.stage[data-pos="left"] { justify-content: flex-start; padding-inline-start: clamp(150px, 18vw, 280px); }
.stage[data-pos="right"] { justify-content: flex-end; padding-inline-end: clamp(150px, 18vw, 280px); }

.notch {
  position: relative; width: 100%; height: var(--notch-h, 170px);
  background: var(--notch-bg); color: var(--notch-ink); border-radius: 0 0 28px 28px; overflow: hidden;
  font-family: var(--font-body); font-weight: 500; font-size: var(--text-size, 26px); line-height: 1.7;
  box-shadow: 0 14px 30px -12px rgba(17, 24, 39, .45);
}
.notch-wrap { position: relative; pointer-events: auto; width: min(var(--notch-w, 480px), calc(100% - 2 * var(--bar-clear, 0px))); }
.cam { position: absolute; top: 8px; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: #2A3347; transform: translateX(-50%); z-index: 2; }
.notch-viewport {
  position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
}
.notch-viewport:active { cursor: grabbing; }
.notch-text { position: relative; padding-inline: 1.4rem; text-align: center; will-change: transform; user-select: none; }
.notch-text p { margin: 0 0 .5em; color: var(--notch-dim); transition: color .2s ease; }
.notch-text p.now { color: var(--notch-ink); }
.notch-text .w.here { box-shadow: inset 0 -3px 0 var(--red); }

/* Script and settings, side by side, filling the rest of the screen. */
.demo-grid { height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; }
.editor { min-height: 0; display: flex; flex-direction: column; }
.label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
.label-hint { font-weight: 400; color: var(--ink-muted); margin-inline-start: 8px; }

.panel {
  min-height: 0; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: clamp(7px, calc(8px + (100dvh - 720px) / 6), 24px);
}
.panel .buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.panel .buttons-main { margin-top: auto; }
.panel .buttons .btn { flex: 1 1 auto; padding: .6rem 1rem; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; font-size: .92rem; }
.toggle input { -webkit-appearance: none; appearance: none; flex: none; margin: 0; width: 34px; height: 20px; border-radius: 999px; background: #D9D2C3; position: relative; cursor: pointer; transition: background-color .15s ease; }
.toggle input::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(22, 33, 59, .3); transition: inset-inline-start .15s ease; }
.toggle input:checked { background: var(--red-deep); }
.toggle input:checked::after { inset-inline-start: 16px; }
.toggle input:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
.sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 22px; }
.slider { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: center; }
.slider label { font-weight: 600; font-size: .85rem; }
.slider output { font-variant-numeric: tabular-nums; color: var(--ink-muted); font-size: .85rem; }
/* Small round handle, red fill up to it (the fill is driven by --p, set from the script). */
.slider input { --dir: right; grid-column: 1 / -1; width: 100%; height: 14px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
[dir="rtl"] .slider input { --dir: left; }
.slider input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to var(--dir), var(--red-deep) var(--p, 50%), #E4DCCB var(--p, 50%)); }
.slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; border: 0; background: var(--red-deep); box-shadow: 0 0 0 2px var(--card); }
.slider input::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to var(--dir), var(--red-deep) var(--p, 50%), #E4DCCB var(--p, 50%)); }
.slider input::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; border: 0; background: var(--red-deep); box-shadow: 0 0 0 2px var(--card); }
.slider input:focus-visible { outline: 2px solid var(--navy); outline-offset: 4px; border-radius: 4px; }
.panel .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel .row .label { margin: 0; white-space: nowrap; }
.swatches { display: flex; gap: 8px; align-items: center; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #D9D2C3; padding: 0; cursor: pointer; box-shadow: inset 0 0 0 2px var(--card); }
.swatch[aria-pressed="true"] { outline: 2px solid var(--navy); outline-offset: 2px; }
/* Left / Center / Right: the same size and look as the toolbar buttons above the script. */
.seg { display: inline-flex; gap: 6px; }
.seg button { background: var(--card); color: var(--navy); border: 1px solid var(--line); border-radius: 10px; padding: 5px 11px; font: 600 .82rem var(--font-body); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.seg button:hover { border-color: var(--navy); }
.seg button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status { height: 1.3em; margin-top: -6px; font-size: .8rem; line-height: 1.3; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-top .toggle { justify-content: flex-start; gap: 14px; }
.link-btn { border: 0; background: none; padding: 2px 4px; font: 600 .85rem var(--font-body); color: var(--red-deep); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.link-btn:hover { color: var(--red-deep-hover); }

/* Popped-out window (Document Picture-in-Picture) */
body.pip { margin: 0; background: var(--notch-bg); overflow: hidden; }
body.pip .notch { width: 100vw; height: 100vh; border-radius: 0; box-shadow: none; }

/* Full screen */
.stage:fullscreen { position: fixed; inset: 0; pointer-events: auto; align-items: center; justify-content: center; padding: 0; background: #0B1020; }
.stage:fullscreen .notch-wrap { width: min(980px, 92vw); }
.stage:fullscreen .nbar { display: none; }
.stage:fullscreen .notch { width: 100%; height: 70vh; border-radius: 28px; font-size: calc(var(--text-size, 26px) * 1.6); }
.stage:-webkit-full-screen { position: fixed; inset: 0; pointer-events: auto; align-items: center; justify-content: center; padding: 0; background: #0B1020; }
.stage:-webkit-full-screen .notch-wrap { width: min(980px, 92vw); }
.stage:-webkit-full-screen .nbar { display: none; }
.stage:-webkit-full-screen .notch { width: 100%; height: 70vh; border-radius: 28px; font-size: calc(var(--text-size, 26px) * 1.6); }

/* Settings toggle and the action bar are mobile concepts; on desktop their wrappers vanish so the card lays out as before. */
.settings-toggle { display: none; }
.settings, .actions { display: contents; }
.status-mobile { display: none; }

@media (max-width: 899px) {
  .stage { --bar-clear: 0px; inset: var(--bar-h) 0 0 0; }
  .stage[data-pos="left"], .stage[data-pos="right"] { padding-inline: 12px; }
  .notch { height: min(var(--notch-h, 170px), 24dvh); }
  .demo-grid { grid-template-columns: 1fr; height: auto; gap: 14px; }
  .editor { min-height: 0; }
  .edwrap { flex: none; height: clamp(200px, 34dvh, 320px); }
  .toolbar { gap: 8px; }
  .tbtn { padding: 8px 13px; }

  /* Settings fold away under a toggle; the prompter stays in view above (sticky header), so changes show live. */
  .panel { overflow: visible; padding: 0; gap: 0; background: transparent; border: 0; }
  .settings-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; background: var(--card); color: var(--navy); border: 1px solid var(--line); border-radius: 14px; padding: 13px 16px; font: 700 1rem var(--font-body); cursor: pointer; }
  .settings-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
  .panel[data-open] .settings-toggle svg { transform: rotate(180deg); }
  .settings { display: none; }
  .panel[data-open] .settings { display: grid; gap: 16px; margin-top: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }

  /* Start and Restart stay on screen at the bottom. */
  .actions { display: grid; gap: 6px; position: fixed; z-index: 40; inset-inline: 0; bottom: 0; padding: 10px max(16px, env(safe-area-inset-left, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--cream); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -12px rgba(22, 33, 59, .25); }
  .actions .buttons-main { margin: 0; flex-wrap: nowrap; }
  .actions .buttons-main .btn { padding: .95rem 1rem; font-size: 1rem; }
  .status-mobile { display: block; margin: 0; }
  .status-mobile:empty { display: none; }
  #status { display: none; }
  .demo { padding-bottom: 8px; }
}
@media (max-width: 899px), (max-height: 619px) {
  .page { height: auto; }
}
@media (pointer: coarse) {
  .slider input { height: 28px; }
  .slider input::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; }
  .slider input::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -9px; }
  .slider input::-moz-range-track { height: 6px; border-radius: 3px; }
  .slider input::-moz-range-thumb { width: 24px; height: 24px; }
  .swatch { width: 32px; height: 32px; }
  .seg button { padding: 9px 14px; }
}

/* ---- Prompter content: sections, emphasis, beats ---- */
.notch-text .sec-h { margin: .5em 0 .25em; display: flex; justify-content: center; align-items: center; gap: .6rem; font-size: .5em; font-weight: 700; letter-spacing: .04em; color: var(--notch-dim); line-height: 1.5; }
.notch-text .sec-h::before, .notch-text .sec-h::after { content: ''; height: 1px; width: 2.2em; background: #2A3550; }
.notch-text .sec-h i { font-style: normal; font-family: ui-monospace, 'SF Mono', Menlo, monospace; color: var(--mint); direction: ltr; unicode-bidi: isolate; }
.notch-text .w.em { box-shadow: inset 0 -3px 0 var(--yellow); }
.notch-text .w.here { box-shadow: inset 0 -3px 0 var(--red); }
.notch-text .pill { display: inline-block; border-radius: 999px; padding: 0 .5em; font-size: .5em; font-weight: 600; line-height: 1.9; vertical-align: middle; margin-inline: .2em; }
.pill.c-pace { background: #3A2A2C; color: #FF9C92; }
.pill.c-delivery { background: #3A3420; color: #FFD84D; }
.pill.c-stage { background: #202C52; color: #9DB6FF; }
.pill.c-control { background: #123B33; color: var(--mint); }
.pill.c-unknown { background: #333; color: #AAA; }
.pill.done { opacity: .45; }
.pill.active { outline: 2px solid currentColor; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.notch-status { position: absolute; z-index: 3; bottom: 8px; left: 50%; transform: translateX(-50%); border: 0; border-radius: 999px; background: #0B1B17; color: var(--mint); font: 700 .8rem var(--font-body); padding: 4px 14px; cursor: pointer; white-space: nowrap; }
.notch-status[hidden] { display: none; }
.notch-status:not(button), .notch-status.wait { cursor: default; }

/* ---- Control bar below the notch: shows on hover ---- */
.nbar { position: absolute; z-index: 4; top: calc(100% + 10px); inset-inline: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; opacity: 0; visibility: hidden; transition: opacity .18s ease .35s, visibility 0s linear .53s; }
/* The 10 px gap between the notch and the bar belongs to the bar, so the pointer can travel down to it without the bar disappearing. */
.nbar::before { content: ''; position: absolute; inset-inline: 0; top: -14px; height: 14px; }
.notch-wrap:hover .nbar, .notch-wrap:focus-within .nbar, .nbar:hover, .nbar.open { opacity: 1; visibility: visible; transition-delay: 0s; }
@media (hover: none) { .nbar { opacity: 1; visibility: visible; transition-delay: 0s; } }
.nbar-clock { justify-self: start; font: 500 .75rem ui-monospace, 'SF Mono', Menlo, monospace; color: var(--mint); background: #0B1B17; border-radius: 999px; padding: 2px 10px; box-shadow: 0 4px 12px rgba(0,0,0,.4); direction: ltr; min-width: 0; }
.nbar-clock:empty { visibility: hidden; }
.nbar-mid { grid-column: 2; display: flex; align-items: center; gap: 6px; }
.nb, .nchip { border: 1px solid rgba(255,255,255,.12); background: #1F2A44; color: #D3DAF0; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.45); }
.nb { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.nb svg, .nchip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.nb:disabled { opacity: .35; cursor: default; }
.nb:not(:disabled):hover, .nchip:hover { background: #2A3858; color: #fff; }
.nchip { border-radius: 999px; padding: 4px 14px; font: 600 .8rem var(--font-body); display: inline-flex; align-items: center; gap: 8px; max-width: 230px; }
.nchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[dir="rtl"] .nb-prev svg, [dir="rtl"] .nb-next svg { transform: scaleX(-1); }
.nbar-slide { justify-self: end; font: 600 .75rem var(--font-body); color: #9DB6FF; background: #202C52; border-radius: 999px; padding: 2px 10px; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.nbar-slide[hidden] { display: none; }
.nlist { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: min(300px, 100%); background: #0B1220; border: 1px solid #25304B; border-radius: 14px; padding: 6px; display: grid; gap: 2px; max-height: 220px; overflow-y: auto; box-shadow: 0 14px 34px rgba(0,0,0,.55); }
.nlist[hidden] { display: none; }
.nlist button { display: flex; gap: 10px; align-items: baseline; border: 0; background: transparent; color: var(--notch-ink); font: 500 .9rem var(--font-body); padding: 7px 10px; border-radius: 8px; cursor: pointer; text-align: start; }
.nlist button:hover { background: #1B2640; }
.nlist button.on { background: var(--notch-ink); color: #111827; font-weight: 700; }
.nlist button span { opacity: .55; font-family: ui-monospace, Menlo, monospace; font-size: .75rem; }
.nlist button em { margin-inline-start: auto; font: 500 .72rem ui-monospace, Menlo, monospace; font-style: normal; opacity: .6; }

/* ---- Editor: toolbar and colored text ---- */
.toolbar { position: relative; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tbtn { background: var(--card); color: var(--navy); border: 1px solid var(--line); border-radius: 10px; padding: 5px 11px; font: 600 .82rem var(--font-body); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tbtn:hover { border-color: var(--navy); }
.tbtn-em { background: var(--yellow); border-color: var(--yellow); }
.tbtn .tk { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; }
.tbtn .caret { font-size: .7rem; opacity: .7; }
.beats-menu { position: absolute; z-index: 20; top: calc(100% + 4px); inset-inline-start: 0; width: min(320px, 100%); max-height: 340px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 12px 30px rgba(22,33,59,.22); display: grid; gap: 1px; }
.beats-menu[hidden] { display: none; }
.beats-menu h3 { margin: 8px 0 3px; padding: 6px 10px; display: flex; align-items: center; gap: 8px; background: #F3ECDD; border-radius: 9px; font: 800 .82rem var(--font-body); position: sticky; top: -6px; z-index: 1; }
.beats-menu h3:first-child { margin-top: 0; }
.beats-menu h3::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.beats-menu [data-cat="pace"] { --c: #FF5A4E; --t: #FFE3DE; --tx: #B2342B; }
.beats-menu [data-cat="delivery"] { --c: #E8B400; --t: #FFF0A8; --tx: #7A5D00; }
.beats-menu [data-cat="stage"] { --c: #5B7FE0; --t: #E3EAFF; --tx: #3A5BB0; }
.beats-menu [data-cat="control"] { --c: #2DD4A6; --t: #CFF5EA; --tx: #0B6B53; }
.beats-menu button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 0; background: transparent; padding: 6px 10px; padding-inline-start: 26px; border-radius: 8px; font: 500 .88rem var(--font-body); cursor: pointer; text-align: start; }
.beats-menu button:hover { background: #F3ECDD; }
.beats-menu code { font-family: var(--font-body); font-weight: 500; font-size: .75rem; background: var(--t); color: var(--tx); border-radius: 6px; padding: 1px 7px; white-space: nowrap; unicode-bidi: plaintext; }

.edwrap { position: relative; flex: 1; min-height: 120px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); overflow: hidden; }
.mirror, .editor textarea {
  position: absolute; inset: 0; margin: 0; border: 0; padding: 14px 16px; width: 100%; height: 100%;
  font: 500 1rem/1.9 var(--font-body); letter-spacing: 0; white-space: pre-wrap; overflow-wrap: break-word; overflow-y: scroll;
  unicode-bidi: plaintext; text-align: start; tab-size: 4; background: transparent; box-sizing: border-box;
}
.mirror { color: var(--navy); pointer-events: none; }
.editor textarea { color: transparent; -webkit-text-fill-color: transparent; caret-color: var(--navy); resize: none; outline: none; }
.editor textarea::selection { background: rgba(255, 90, 78, .28); -webkit-text-fill-color: transparent; }
.edwrap:focus-within { border-color: var(--navy); }
/* A quiet scrollbar that stays on screen (macOS would otherwise show a thin one that fades out).
   The colored copy behind the text box gets the same one, so the lines wrap identically. */
.mirror::-webkit-scrollbar, .editor textarea::-webkit-scrollbar { width: 10px; }
.mirror::-webkit-scrollbar-track, .editor textarea::-webkit-scrollbar-track { background: transparent; }
.mirror::-webkit-scrollbar-thumb, .editor textarea::-webkit-scrollbar-thumb { background: #D8CEB8; border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; min-height: 40px; }
.editor textarea::-webkit-scrollbar-thumb:hover { background: #B5A98F; background-clip: padding-box; }
@supports not selector(::-webkit-scrollbar) {
  .mirror, .editor textarea { scrollbar-width: thin; scrollbar-color: #D8CEB8 transparent; }
}
.mk { opacity: .42; }
.hl-h { background: #E1E9FF; border-radius: 6px; font-weight: 700; }
.hl-h .tm { color: #3A5BB0; }
.hl-em { background: #FFEFA0; border-radius: 4px; }
.hl-b { border-radius: 5px; }
.hl-b.c-pace { background: #FFE3DE; color: #B2342B; }
.hl-b.c-delivery { background: #FFF0A8; color: #7A5D00; }
.hl-b.c-stage { background: #E3EAFF; color: #3A5BB0; }
.hl-b.c-control { background: #CFF5EA; color: #0B6B53; }
.hl-b.c-unknown { background: #EEE; color: #777; text-decoration: wavy underline; }

.notch-count { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(17, 24, 39, .9); color: var(--notch-ink); font-family: var(--font-head); font-weight: 800; font-size: calc(var(--notch-h, 170px) * .5); line-height: 1; pointer-events: none; }
.notch-count[hidden] { display: none; }

/* Pre-sale modal. Everything is prefixed pm- so it cannot touch the page styles. */
.pm-scrim { --muted: var(--ink-muted); --track: #F3ECDD; --red-hover: var(--red-deep-hover); --font-mono: ui-monospace, 'SF Mono', Menlo, monospace; --ink: var(--navy); }
.pm-scrim * { box-sizing: border-box; }
.pm-scrim h2, .pm-scrim h3, .pm-scrim p, .pm-scrim ul { margin: 0; }
.pm-btn { font-family: var(--font-body); font-weight: 700; line-height: 1; border: 1.5px solid transparent; border-radius: 999px; cursor: pointer; text-align: center; text-decoration: none; display: block; transition: background-color .15s ease, border-color .15s ease; }
.pm-btn-primary { background: var(--red-deep); color: #fff; }
.pm-btn-primary:hover { background: var(--red-hover); }
.pm-btn-ghost { background: transparent; }
.pm-scrim[hidden] { display: none; }
.pm-scrim { position: fixed; inset: 0; z-index: 100; background: rgba(17, 24, 39, .62); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 12px; }
.pm-scrim[hidden] { display: none; }
.pm-modal { position: relative; width: min(920px, 100%); max-height: calc(100dvh - 24px); background: var(--cream); border-radius: 24px; box-shadow: 0 30px 90px rgba(0, 0, 0, .45); overflow: hidden; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); animation: rise .28s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { .pm-modal { animation: none; } }
.pm-close { position: absolute; inset-block-start: 12px; inset-inline-end: 12px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; }
.pm-close svg { width: 15px; height: 15px; stroke: var(--navy); stroke-width: 2.4; stroke-linecap: round; }
.pm-close:hover { background: var(--track); }

.pm-side { background: var(--navy); color: #F4F1EA; padding: 28px clamp(20px, 3vw, 32px) 20px; display: flex; flex-direction: column; gap: 12px; justify-content: space-between; min-width: 0; }
.pm-hero { display: grid; gap: 8px; justify-items: start; text-align: start; }
.pm-eyebrow { display: inline-flex; align-items: center; gap: 8px; background: rgba(255, 216, 77, .14); color: var(--yellow); border: 1px solid rgba(255, 216, 77, .35); border-radius: 999px; padding: 3px 12px; font-weight: 600; font-size: .78rem; letter-spacing: .04em; }
.pm-eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.pm-hero h2 { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.55rem, 3.4vw, 2.2rem); line-height: 1.25; text-wrap: balance; }
.pm-hero h2 .pm-mark { position: relative; display: inline-block; z-index: 0; color: var(--navy); padding-inline: .15em; }
.pm-hero h2 .pm-mark::before { content: ''; position: absolute; inset: .12em 0 .02em; background: var(--yellow); border-radius: 8px; z-index: -1; transform: rotate(-1.2deg); }
.pm-price { display: flex; align-items: baseline; gap: 12px; direction: ltr; align-self: flex-start; }
.pm-price .pm-now { font-family: var(--font-head); font-weight: 800; font-size: clamp(3rem, 6vw, 4.2rem); line-height: 1; color: #fff; }
.pm-price .pm-now sup { font-size: .4em; vertical-align: top; margin-inline-end: 2px; color: var(--yellow); }
.pm-price .pm-was { font-size: 1.3rem; color: #9aa6c6; text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 3px; }
.pm-price-sub { color: #C9D2EA; font-size: .9rem; line-height: 1.5; }

.pm-cta { display: grid; gap: 8px; }
.pm-cta .pm-btn-primary { font-size: 1.05rem; padding: 1rem 1.5rem; box-shadow: 0 10px 24px -10px rgba(201, 59, 49, .8); width: 100%; }
.pm-cta .pm-btn-ghost { width: 100%; padding: .7rem 1.2rem; font-size: .9rem; color: #F4F1EA; border-color: rgba(244, 241, 234, .35); }
.pm-cta .pm-btn-ghost:hover { border-color: #F4F1EA; }
.pm-fine { color: #C9D2EA; font-size: .8rem; line-height: 1.5; }

.pm-follow { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid rgba(244, 241, 234, .18); padding-top: 12px; }
.pm-follow .pm-who { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .9rem; min-width: 0; }
.pm-follow .pm-who span { color: #C9D2EA; font-weight: 500; font-size: .78rem; display: block; line-height: 1.3; }
.pm-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--cream); object-fit: cover; flex: none; border: 2px solid rgba(244, 241, 234, .5); box-sizing: border-box; }
.pm-socials { display: flex; gap: 8px; }
.pm-socials a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(244, 241, 234, .1); border: 1px solid rgba(244, 241, 234, .25); color: #F4F1EA; transition: background-color .15s ease, color .15s ease; }
.pm-socials a:hover { background: var(--cream); color: var(--navy); }
.pm-socials svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.pm-tabs { display: none; }
.pm-panels { padding: 54px clamp(18px, 3vw, 28px) 20px; display: grid; gap: 14px; align-content: center; min-width: 0; overflow-y: auto; }
.pm-panel { display: grid; gap: 8px; }
.pm-panel h3 { font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; line-height: 1.3; }
.pm-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.pm-checks li { display: grid; grid-template-columns: 20px 1fr; gap: 9px; align-items: start; font-size: .92rem; line-height: 1.5; }
.pm-checks svg { width: 20px; height: 20px; margin-top: 2px; fill: none; stroke: var(--mint); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pm-checks b { font-weight: 700; }
.pm-why { position: relative; margin: 0; background: #FFF1C2; border-radius: 14px; padding: 10px 14px; border-inline-start: 5px solid var(--yellow); display: grid; gap: 2px; }
.pm-why small { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--red-deep); font-weight: 500; }
.pm-why q { quotes: none; font-family: var(--font-head); font-weight: 800; font-size: 1.12rem; line-height: 1.35; color: var(--navy); text-wrap: balance; }
.pm-why span { color: var(--muted); font-size: .82rem; line-height: 1.5; }
.pm-calc { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.pm-calc h3 .pm-free { color: var(--red-deep); }
.pm-calc p.pm-lead { color: var(--muted); font-size: .86rem; line-height: 1.55; }
.pm-calc .pm-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: .88rem; border-bottom: 1px dashed var(--line); padding-block: 4px; }
.pm-calc .pm-row span:last-child { font-family: var(--font-mono); font-weight: 500; font-size: .86rem; direction: ltr; }
.pm-rate { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; background: var(--track); border-radius: 12px; padding: 7px 12px; }
.pm-rate label { font-weight: 600; font-size: .88rem; }
.pm-rate .pm-field { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1.5px solid #D9D2C3; border-radius: 9px; padding: 2px 9px; direction: ltr; }
.pm-rate .pm-field:focus-within { border-color: var(--navy); }
.pm-rate input { width: 4.2ch; border: 0; outline: 0; background: transparent; font: 600 1rem var(--font-mono); text-align: right; color: var(--navy); -moz-appearance: textfield; }
.pm-rate input::-webkit-outer-spin-button, .pm-rate input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pm-total { background: var(--navy); color: #F4F1EA; border-radius: 14px; padding: 10px 14px; display: grid; gap: 1px; }
.pm-total small { color: #C9D2EA; font-size: .78rem; line-height: 1.4; }
.pm-total .pm-big { font-family: var(--font-head); font-weight: 800; font-size: 1.65rem; line-height: 1.15; color: var(--yellow); direction: ltr; text-align: start; }
.pm-total .pm-save { font-weight: 600; font-size: .9rem; }
.pm-total .pm-save b { color: var(--mint); font-family: var(--font-mono); direction: ltr; unicode-bidi: isolate; }

@media (max-height: 700px) and (min-width: 721px) {
  .pm-side { padding-block: 20px 14px; gap: 8px; }
  .pm-panels { padding-block: 46px 14px; gap: 10px; }
  .pm-checks { gap: 4px; }
  .pm-checks li { font-size: .88rem; }
  .pm-price .pm-now { font-size: 3rem; }
}

/* ---- phones: tabs, and the call to action stays at the bottom ---- */
@media (max-width: 720px) {
  .pm-scrim { padding: 8px; }
  .pm-modal { display: flex; flex-direction: column; border-radius: 20px; max-height: calc(100dvh - 16px); }
  .pm-side { display: contents; }
  .pm-hero { order: 1; background: var(--navy); color: #F4F1EA; padding: 16px 16px 12px; gap: 6px; padding-inline-end: 56px; }
  .pm-hero h2 { font-size: 1.35rem; }
  .pm-price { gap: 10px; }
  .pm-price .pm-now { font-size: 2.6rem; }
  .pm-price .pm-was { font-size: 1.05rem; }
  .pm-price-sub { display: none; }
  .pm-tabs { order: 2; display: flex; gap: 4px; background: var(--track); margin: 10px 12px 0; padding: 3px; border-radius: 999px; }
  .pm-tabs button { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 7px 10px; font-weight: 700; font-size: .88rem; color: var(--muted); }
  .pm-tabs button[aria-selected="true"] { background: var(--navy); color: var(--cream); }
  .pm-panels { order: 3; flex: 1 1 auto; min-height: 0; padding: 12px 16px; align-content: start; }
  .pm-panels .pm-panel { display: none; }
  .pm-panels[data-tab="offer"] .pm-p-offer, .pm-panels[data-tab="calc"] .pm-p-calc { display: grid; }
  .pm-why { padding: 8px 12px; }
  .pm-why q { font-size: 1rem; }
  .pm-why span { display: none; }
  .pm-checks { gap: 4px; }
  .pm-checks li { font-size: .86rem; line-height: 1.4; }
  .pm-calc { padding: 12px 14px; }
  .pm-calc p.pm-lead { display: none; }
  .pm-cta { order: 4; background: var(--card); border-top: 1px solid var(--line); padding: 10px 14px 6px; gap: 6px; }
  .pm-cta .pm-btn-primary { padding: .85rem 1rem; font-size: 1rem; }
  .pm-cta .pm-btn-ghost { background: transparent; color: var(--navy); border-color: #D9D2C3; padding: .55rem 1rem; font-size: .85rem; }
  .pm-fine { color: var(--muted); font-size: .74rem; text-align: center; }
  .pm-follow { order: 5; background: var(--card); border-top: 0; padding: 4px 14px 10px; }
  .pm-follow .pm-who { color: var(--navy); }
  .pm-follow .pm-who span { color: var(--muted); }
  .pm-avatar { width: 30px; height: 30px; border-color: var(--line); }
  .pm-socials a { width: 32px; height: 32px; background: #fff; border-color: var(--line); color: var(--navy); }
  .pm-socials a:hover { background: var(--navy); color: var(--cream); }
  .pm-socials svg { width: 16px; height: 16px; }
}
@media (max-width: 720px) and (max-height: 700px) {
  .pm-eyebrow { display: none; }
  .pm-hero { padding-block: 14px 10px; }
  .pm-price .pm-now { font-size: 2.2rem; }
}
@media (max-width: 720px) and (max-height: 700px) {
  .pm-fine { display: none; }
  .pm-calc h3 { display: none; }
  .pm-total .pm-big { font-size: 1.35rem; }
  .pm-panels { padding-block: 8px; }
}
