/* Stagehand's landing page: flat and quiet, after Apple's product pages. White and #f5f5f7 sections
   alternate (black and #1d1d1f in dark mode), one accent blue for links and buttons, the system font.
   The only gradient is the wallpaper behind the hero's menu bar, where the live popover sits. */

:root {
  --bg: #fff;
  --bg-alt: #f5f5f7;
  --card: #f5f5f7;
  --card-on-alt: #fff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --rule: #d2d2d7;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --link: #0071e3;
  --inline-code: rgb(0 0 0 / 0.05);
  --shot-shadow: 0 12px 40px rgb(0 0 0 / 0.12);
  --nav: rgb(251 251 253 / 0.8);
  --nav-rule: #e8e8ed;
  --nav-link: #424245;
  --eyebrow: #bf4800;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --bg-alt: #1d1d1f;
    --card: #1d1d1f;
    --card-on-alt: #000;
    --text: #f5f5f7;
    --muted: #86868b;
    --rule: #424245;
    --link: #2997ff;
    --inline-code: rgb(255 255 255 / 0.1);
    --shot-shadow: 0 12px 40px rgb(0 0 0 / 0.6);
    --nav: rgb(22 22 23 / 0.8);
    --nav-rule: #2d2d2f;
    --nav-link: #d2d2d7;
    --eyebrow: #ff9f0a;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.47 var(--sans);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

h1, h2, h3 { margin: 0 0 0.4em; font-weight: 700; }
h2 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.07; letter-spacing: -0.02em; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.2; letter-spacing: -0.015em; margin-top: 1.6em; }
p { margin: 0 0 1em; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

code { font-family: var(--mono); font-size: 0.88em; }
:not(pre) > code {
  background: var(--inline-code);
  padding: 0.1em 0.35em;
  border-radius: 5px;
  overflow-wrap: anywhere;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 50;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 980px;
  font-weight: 600;
}
.skip:focus { top: 0.6rem; }

/* Buttons: Apple's pill. */

.pill {
  display: inline-block;
  padding: 0.6em 1.4em;
  border-radius: 980px;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.pill:hover { background: var(--accent-hover); text-decoration: none; }
.pill-small { padding: 0.3em 0.85em; font-size: 0.75rem; }
.pill-large { padding: 0.8em 1.8em; font-size: 1.1rem; }

.more::after { content: " ›"; }

/* Local nav, sticky like a product page's. */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--nav);
  -webkit-backdrop-filter: saturate(1.8) blur(20px);
  backdrop-filter: saturate(1.8) blur(20px);
  border-bottom: 1px solid var(--nav-rule);
}
.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  max-width: 1024px;
  height: 48px;
  margin: 0 auto;
  padding: 0 22px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: start;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand img { width: 20px; height: 20px; border-radius: 5px; }
.nav .pill-small { justify-self: end; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--nav-link); font-size: 12px; }
.nav-links a:hover { color: var(--link); opacity: 1; text-decoration: none; }
@media (max-width: 700px) {
  .nav-inner { grid-template-columns: 1fr auto; }
  .nav-links { display: none; }
}

/* Sections. */

.section { padding: clamp(72px, 11vw, 128px) 22px; }
.alt { background: var(--bg-alt); }
.wrap { max-width: 980px; margin: 0 auto; }
.center { text-align: center; }
.eyebrow { margin-bottom: 0.5em; color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.3rem); font-weight: 600; }
.intro {
  max-width: 38em;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.4;
}
.center .intro { margin-inline: auto; }

/* Hero. */

.hero { padding: clamp(48px, 7vw, 72px) 22px clamp(72px, 10vw, 110px); text-align: center; }
.hero-eyebrow { margin: 0 0 6px; color: var(--eyebrow); font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 600; }
.hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 8.2vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.pitch {
  max-width: 720px;
  margin: 14px auto 0;
  font-size: clamp(1.25rem, 2.8vw, 1.75rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.004em;
}
.actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1rem; margin: 26px 0 0; }
.actions .pill { padding: 12px 22px; font-size: 17px; font-weight: 400; }
.actions .more { font-size: 19px; }

.cards-short .card { padding: 30px 28px 34px; border-radius: 18px; }
.cards-short h3 { margin: 14px 0 0; font-size: 21px; font-weight: 600; }
.cards-short p { margin: 8px 0 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
.cards-short .card-icon { margin: 0; color: var(--text); font-size: 30px; line-height: 1.2; }

/* What it shows: copy beside a screenshot. */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
}

.fader-key { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.fader-key li { display: flex; align-items: center; gap: 0.9rem; }

.faders { width: 20px; height: 18px; display: block; color: inherit; overflow: visible; }
.track { stroke: currentColor; }
.track-red { stroke: #ff453a; }
.knob { fill: currentColor; }
.knob-red { fill: #ff453a; }

.faders-key {
  box-sizing: content-box;
  flex: none;
  padding: 7px 10px;
  border-radius: 8px;
  background: #1d1d1f;
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .faders-key { background: #2c2c2e; }
}

.shot { margin: 0; text-align: center; }
.shot img {
  display: block;
  margin: 0 auto;
  border-radius: 14px;
  box-shadow: var(--shot-shadow);
}
.shot figcaption { margin-top: 1rem; color: var(--muted); font-size: 0.9rem; }

/* Feature cards. */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 20px;
  margin-top: clamp(40px, 6vw, 64px);
  text-align: left;
}
.card { padding: 34px 30px 26px; border-radius: 24px; background: var(--card); }
.card h3 { margin: 0 0 0.7em; font-size: 1.6rem; }
.card ul { margin: 0; padding: 0; list-style: none; }
.card li { margin-bottom: 0.9em; font-size: 0.95rem; color: var(--muted); }
.card li::first-line { color: var(--text); }

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 48px 40px;
  align-items: start;
  margin-top: clamp(56px, 8vw, 96px);
}

/* How it works. */

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0 48px;
  margin-top: 2.4rem;
}
.columns h3 { margin-top: 0; }

.code {
  margin: 1.4rem 0 0;
  padding: 24px 26px;
  overflow: auto;
  border-radius: 18px;
  background: var(--card-on-alt);
  font: 0.85rem/1.6 var(--mono);
  letter-spacing: 0;
}

/* Download. */

.download { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; margin: 2rem 0 0; }
.requirements { color: var(--muted); font-size: 0.9rem; }

.first-launch {
  max-width: 640px;
  margin: clamp(48px, 7vw, 72px) auto;
  padding: 34px 32px 18px;
  border-radius: 24px;
  background: var(--card);
  text-align: left;
}
.first-launch h3 { margin-top: 0; }
.steps { list-style: none; margin: 1.4rem 0 0; padding: 0; counter-reset: step; }
.steps li { position: relative; padding-left: 2.6rem; counter-increment: step; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0.05rem;
  display: grid;
  place-items: center;
  width: 1.75rem; height: 1.75rem;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 600;
}
.after-download { max-width: 640px; margin: 0 auto; color: var(--muted); font-size: 0.95rem; }

/* Footer. */

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 28px 22px 36px;
  background: var(--bg-alt);
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.8rem;
}
.footer p { margin: 0; }
.footer strong { color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------------------------------------------
   The play area: a strip of macOS desktop with Stagehand's popover open under its menu bar icon.
   Sizes follow the app's popover (340pt wide, 10pt tile corners); colours are AppKit's.
   --------------------------------------------------------------------------------------------- */

.play {
  --p-bg: rgb(236 236 236 / 0.95);
  --p-tile: rgb(0 0 0 / 0.05);
  --p-lift: #fbfbfb;
  --p-text: #1d1d1f;
  --p-sec: #6e6e73;
  --p-ter: #a1a1a6;
  --p-line: rgb(0 0 0 / 0.1);
  --p-hover: rgb(0 0 0 / 0.08);
  --p-mini: #fff;
  --p-mini-shadow: 0 0.5px 1.5px rgb(0 0 0 / 0.25);
  --p-switch-off: rgb(0 0 0 / 0.12);
  --p-menu: rgb(246 246 246 / 0.97);
  --p-well: rgb(0 0 0 / 0.05);
  --p-sel: #8e8e93;
  --p-green: #34c759;
  --p-blue: #007aff;
  --p-red: #ff3b30;
  --p-orange: #ff9500;
  --p-indigo: #5856d6;
  --p-gray: #8e8e93;
  --p-glare: rgb(255 255 255 / 0.55);
  --wallpaper: linear-gradient(160deg, #5b6c9e 0%, #2b2f5a 45%, #3c2b52 100%);

  max-width: 980px;
  margin: 54px auto 0;
  text-align: left;
}

@media (prefers-color-scheme: dark) {
  .play {
    --p-bg: rgb(40 40 42 / 0.92);
    --p-tile: rgb(255 255 255 / 0.07);
    --p-lift: #3a3a3c;
    --p-text: #f5f5f7;
    --p-sec: #98989d;
    --p-ter: #6e6e73;
    --p-line: rgb(255 255 255 / 0.12);
    --p-hover: rgb(255 255 255 / 0.1);
    --p-mini: rgb(255 255 255 / 0.16);
    --p-mini-shadow: none;
    --p-switch-off: rgb(255 255 255 / 0.18);
    --p-menu: rgb(50 50 52 / 0.97);
    --p-well: rgb(0 0 0 / 0.3);
    --p-green: #30d158;
    --p-blue: #0a84ff;
    --p-red: #ff453a;
    --p-orange: #ff9f0a;
    --p-indigo: #5e5ce6;
    --p-glare: rgb(255 255 255 / 0.12);
  }
}

.desk {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  /* The menu bar row keeps its height, so a short popover (Settings) still hangs right under it. */
  grid-template-rows: auto 1fr;
  column-gap: 40px;
  align-items: start;
  min-height: 640px;
  padding: 0 120px 56px 56px;
  border-radius: 28px;
  overflow: hidden;
  background: var(--wallpaper);
  isolation: isolate;
}

.mb {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
  height: 30px;
  margin: 0 -120px 10px -56px;
  padding: 0 16px;
  background: rgb(255 255 255 / 0.18);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
}
.mb-faders { display: grid; place-items: center; padding: 3px 7px; border-radius: 5px; background: rgb(255 255 255 / 0.25); }
.mb-faders .faders { width: 17px; height: 15px; }
.mb-date { margin-right: 0.5em; }

.play-hint { align-self: center; max-width: 300px; margin-top: 30px; color: #fff; text-align: left; }
.play-title { margin: 0; font-size: 28px; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
.play-hint p { margin: 10px 0 0; font-size: 15px; line-height: 1.5; opacity: 0.75; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.chips button { padding: 6px 12px; border: 0; border-radius: 980px; background: rgb(255 255 255 / 0.16); color: inherit;
  font: inherit; font-size: 13px; cursor: pointer; transition: background 0.15s ease; }
.chips button:hover { background: rgb(255 255 255 / 0.28); }
.chips button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* A chip's demo points at the tile it changed. */
.tile.demo-hit { box-shadow: 0 0 0 2px #0071e3, 0 6px 18px rgb(0 113 227 / 0.25); transition: box-shadow 0.2s ease; }

.pop {
  position: relative;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: var(--p-bg);
  -webkit-backdrop-filter: blur(30px) saturate(1.7);
  backdrop-filter: blur(30px) saturate(1.7);
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.45), 0 0 0 0.5px rgb(0 0 0 / 0.3);
  color: var(--p-text);
  font: 13px/1.3 var(--sans);
  letter-spacing: 0;
  -webkit-tap-highlight-color: transparent;
}
.pop:empty { display: none; }
.desk noscript { grid-column: 2; }
.desk noscript img { display: block; border-radius: 12px; }

.pop button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.pop :focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 6px; }

.pop-screen { display: flex; flex-direction: column; gap: 12px; }

.i { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Header. */

.phead { display: flex; align-items: center; gap: 12px; min-height: 36px; }
.plogo { display: block; width: 32px; height: 32px; flex: none; border-radius: 7px; }
.ptitle { font-size: 14px; font-weight: 700; }
.psub { margin-top: 1px; color: var(--p-sec); font-size: 12.5px; }

/* Tiles. .tile is the grid slot that drag moves; .face is what you see, and what tilts. */

.pgrid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tile {
  position: relative;
  min-width: 0;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.tile:hover { z-index: 2; }
.tile.lifted { z-index: 20; cursor: grabbing; }
.tile.settling { z-index: 20; }

.face {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  min-height: 160px;
  padding: 10px;
  border-radius: 10px;
  background: var(--p-tile);
  transition: transform 0.14s ease-out, background-color 0.15s, box-shadow 0.15s;
  will-change: transform;
}
.face::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), var(--p-glare), transparent 65%);
  opacity: var(--glare, 0);
  transition: opacity 0.2s;
  pointer-events: none;
}
.face.dim > * { opacity: 0.5; }
.face.selected { box-shadow: inset 0 0 0 2px var(--p-sel); }
.tile.lifted .face {
  background: var(--p-lift);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.3);
  transform: scale(1.03) !important;
}
@media (prefers-reduced-motion: reduce) {
  .face { transition: none; }
  .tile.lifted .face { transform: none !important; }
}

.trow { display: flex; align-items: center; justify-content: space-between; height: 22px; margin-bottom: 6px; }
.ticon { display: block; }
.t-green { color: var(--p-green); }
.t-blue { color: var(--p-blue); }
.t-orange { color: var(--p-orange); }
.t-indigo { color: var(--p-indigo); }
.dim .ticon { color: var(--p-gray); }

.tname { font-size: 13px; font-weight: 700; line-height: 1.25; }
.tstatus { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--p-gray); }
.d-green { background: var(--p-green); }
.d-blue { background: var(--p-blue); }
.d-red { background: var(--p-red); }
.tdetail { color: var(--p-sec); font-size: 12px; line-height: 1.3; }

.bars { display: flex; align-items: flex-end; gap: 4px; height: 16px; margin-top: 6px; }
.bars span { width: 4px; border-radius: 1.5px; background: var(--p-green); transition: height 0.3s; }
.bars .bar-fail { background: var(--p-red); }
.bars .bar-run { background: var(--p-blue); }

.tfoot { display: flex; align-items: center; gap: 2px; margin-top: auto; padding-top: 6px; }
.src { flex: 1; color: var(--p-ter); font-size: 11px; font-weight: 600; }

.ico {
  display: grid;
  place-items: center;
  width: 26px; height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  cursor: pointer;
}
.ico .i { width: 16px; height: 16px; }
.ico[aria-expanded="true"] { background: var(--p-hover); }
.ico[aria-disabled="true"]:not(.is-running) { opacity: 0.35; cursor: default; }
.ico.is-running { cursor: default; }
/* The timer while it runs: filled, like timer.circle.fill. */
.ico.active .i { border-radius: 50%; background: var(--p-text); color: var(--p-bg); padding: 1px; stroke: #fff; }
@media (prefers-color-scheme: dark) {
  .ico.active .i { stroke: #1d1d1f; }
}
@media (hover: hover) {
  .ico:not([aria-disabled="true"]):hover { background: var(--p-hover); }
}

.ring { animation: spin 1s linear infinite; }
.ring circle { stroke: var(--p-blue); stroke-width: 2; }
.ring .ring-track { opacity: 0.25; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ring { animation-duration: 3s; }
}

.switch {
  position: relative;
  flex: none;
  width: 32px; height: 18px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: var(--p-green);
  cursor: pointer;
  transition: background-color 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; right: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
  transition: transform 0.2s;
}
.switch[aria-checked="false"] { background: var(--p-switch-off); }
.switch[aria-checked="false"]::after { transform: translateX(-14px); }
.pop .switch:focus-visible { border-radius: 9px; }

/* The log and details panels open full width under the tile's row, pointing at the tile. */

.panel { position: relative; grid-column: 1 / -1; margin-top: 4px; padding: 10px 12px 12px; border-radius: 10px; }
.caret {
  position: absolute;
  top: -8px;
  width: 18px; height: 8px;
  transform: translateX(-50%);
  background: inherit;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.panel .close { width: 22px; height: 22px; margin: -2px -4px 0 0; flex: none; }
.panel .close .i { width: 13px; height: 13px; }

.panel.log { background: #1e1e1e; color: #f2f2f2; font: 11px/1.5 var(--mono); }
.log-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: #9a9a9f; }
.log-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live { display: flex; align-items: center; gap: 5px; }
.live .dot { width: 6px; height: 6px; background: #30d158; }
.log-lines { max-height: 156px; margin: 0 0 6px; overflow: auto; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.panel.log .link { color: #64b5ff; font-family: var(--mono); font-size: 11px; }
.panel.log .ico:hover { background: rgb(255 255 255 / 0.12); }

.panel.info { background: var(--p-tile); font-size: 12.5px; }
.info-top { display: flex; gap: 8px; align-items: flex-start; }
.info-note { flex: 1; margin: 0; font-size: 13px; line-height: 1.35; }
.info-meta { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0 8px; color: var(--p-sec); font-size: 11.5px; }
.facts { display: grid; gap: 4px; margin: 0 0 10px; }
.facts div { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.facts dt { width: 3.6em; flex: none; color: var(--p-sec); }
.facts dd { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facts .mono { font: 11px var(--mono); }

.link { padding: 0; border: 0; background: none; color: var(--link) !important; cursor: pointer; }
.link:hover { text-decoration: underline; }

.mini {
  padding: 2px 10px;
  border: 0;
  border-radius: 6px;
  background: var(--p-mini);
  box-shadow: var(--p-mini-shadow);
  font-size: 12px !important;
  cursor: pointer;
  white-space: nowrap;
}
.mini:active { filter: brightness(0.92); }
.mini[aria-disabled="true"] { opacity: 0.45; cursor: default; }

/* Empty state, footer rows. */

.pempty {
  padding: 26px 16px;
  border: 1px dashed var(--p-line);
  border-radius: 10px;
  color: var(--p-sec);
  line-height: 1.6;
  text-align: center;
}
.pempty-mark { display: block; font-size: 16px; }
.pempty .link { text-decoration: underline; }

.pdivider { height: 1px; background: var(--p-line); }
.pmenu { display: flex; flex-direction: column; margin: -4px -8px 0; }
.mrow {
  padding: 3px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  font-size: 13.5px !important;
  line-height: 20px;
  text-align: left;
  cursor: default;
}
@media (hover: hover) {
  .mrow:hover { background: var(--p-hover); }
}
.mrow:active { background: var(--p-hover); }
.mrow .sec { color: var(--p-sec); }

/* The keep-awake timer menu. */

.menu {
  position: absolute;
  z-index: 30;
  min-width: 176px;
  padding: 5px;
  border-radius: 8px;
  background: var(--p-menu);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.25), 0 0 0 0.5px rgb(0 0 0 / 0.22);
}
.menu-label { padding: 2px 8px 3px; color: var(--p-sec); font-size: 11.5px; font-weight: 600; }
.menu button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 3px 8px;
  border: 0;
  border-radius: 5px;
  background: none;
  text-align: left;
  cursor: default;
}
.menu button:hover, .menu button:focus-visible { background: var(--accent); color: #fff; outline: none; }
.menu .check { visibility: hidden; }
.menu [aria-checked="true"] .check { visibility: visible; }
.menu-sep { height: 1px; margin: 4px 8px; background: var(--p-line); }

/* Settings and AI configurations. */

.navhead { position: relative; display: flex; align-items: center; height: 24px; }
.navhead .title { position: absolute; left: 0; right: 0; font-weight: 700; text-align: center; pointer-events: none; }
.back { position: relative; z-index: 1; padding: 0 4px 0 0; border: 0; background: none; color: var(--link) !important; cursor: pointer; }
.back span { font-size: 17px; line-height: 1; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.sec-title { margin: 0 0 5px 8px; color: var(--p-sec); font-size: 11.5px; font-weight: 600; }
.sec-title .dim { margin-left: 6px; color: var(--p-ter); font-weight: 400; }
.group { border-radius: 8px; background: var(--p-tile); }
.item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  background: none;
  text-align: left;
}
.item + .item::before, .preview + .item::before {
  content: "";
  position: absolute;
  top: 0; left: 10px; right: 10px;
  height: 1px;
  background: var(--p-line);
}
.item.click { cursor: pointer; border-radius: 8px; }
@media (hover: hover) {
  .item.click:hover { background: var(--p-hover); }
}
.item.click:active { background: var(--p-hover); }
.txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.t1 { font-size: 13px; }
.sub { margin-top: 1px; overflow: hidden; color: var(--p-sec); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.val { color: var(--p-sec); white-space: nowrap; }
/* The app's pop-up pickers: the value in grey with up/down chevrons, no box. */
.pick { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: var(--p-sec); font: inherit;
  padding: 2px 18px 2px 4px; text-align: right; cursor: pointer; max-width: 170px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14'%3E%3Cpath d='M2 5l3-3 3 3M2 9l3 3 3-3' fill='none' stroke='%238e8e93' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 2px center; background-size: 9px 13px; }
.pick:hover { color: var(--p-text); }
.mini-row { display: flex; gap: 6px; margin-top: 6px; }
.chev { color: var(--p-ter); font-size: 16px; line-height: 1; transition: transform 0.15s; }
.chev.open { transform: rotate(90deg); }
.badge { margin-left: 4px; padding: 0 5px; border: 1px solid var(--p-line); border-radius: 5px; color: var(--p-sec); font-size: 10.5px; white-space: nowrap; }
.missing { color: var(--p-ter); font-size: 11.5px; white-space: nowrap; }

.preview { position: relative; padding: 0 10px 10px; }
.well {
  height: 176px;
  margin: 0;
  padding: 8px 10px;
  overflow: auto;
  border-radius: 6px;
  background: var(--p-well);
  font: 10.5px/1.5 var(--mono);
  white-space: pre;
}
.well .h { color: var(--link); font-weight: 700; }
.empty-file { color: var(--p-ter); }
.pmeta { display: flex; justify-content: space-between; gap: 8px; margin: 6px 0; color: var(--p-sec); font-size: 11px; }
.pbtns { display: flex; flex-wrap: wrap; gap: 6px; }

.pop-toast {
  position: absolute;
  left: 50%; bottom: 12px;
  z-index: 40;
  max-width: calc(100% - 28px);
  padding: 6px 12px;
  border-radius: 8px;
  background: rgb(0 0 0 / 0.8);
  color: #fff;
  font-size: 12px;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.pop-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .desk { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; min-height: 0; padding: 0 16px 32px; border-radius: 22px; }
  .mb { margin: 0 -16px 0; }
  .play-hint { max-width: none; margin: 24px 4px 22px; text-align: center; }
  .chips { justify-content: center; }
  .pop { max-width: 340px; margin: 0 auto; }
  .desk noscript { grid-column: 1; }
}
@media (max-width: 520px) {
  .desk { padding: 0 8px 20px; border-radius: 18px; }
  .mb { margin: 0 -8px; padding: 0 10px; }
  .mb-date { display: none; }
  .play-title { font-size: 24px; }
  .pop { padding: 12px; }
  .pgrid { gap: 8px; }
  .face { padding: 9px; }
}

/* The coffee note that opens with a download: a centred card, a bottom sheet on a phone. */

.coffee {
  width: min(400px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.25);
}
@media (prefers-color-scheme: dark) {
  .coffee { background: #1d1d1f; }
}
.coffee::backdrop { background: rgb(0 0 0 / 0.4); }
.coffee-body { display: flex; flex-direction: column; align-items: center; padding: 32px 28px 20px; text-align: center; }
.coffee-icon {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--bg-alt);
  color: #a2672e;
}
@media (prefers-color-scheme: dark) {
  .coffee-icon { background: #2c2c2e; color: #e0a46a; }
}
.coffee h2 { margin: 0 0 8px; font-size: 24px; line-height: 1.15; letter-spacing: -0.015em; }
.coffee p { margin: 0 0 22px; color: var(--muted); font-size: 15px; }
.coffee .pill { padding: 11px 22px; font-size: 17px; font-weight: 400; }
.coffee-later {
  margin-top: 8px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.coffee-later:hover { color: var(--text); }

@media (prefers-reduced-motion: no-preference) {
  .coffee[open] { animation: coffee-in 0.22s ease-out; }
  @keyframes coffee-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
}

@media (max-width: 520px) {
  .coffee {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 20px 20px 0 0;
  }
  .coffee-body { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .coffee .pill { align-self: stretch; }
  @media (prefers-reduced-motion: no-preference) {
    .coffee[open] { animation: coffee-sheet 0.25s ease-out; }
    @keyframes coffee-sheet { from { transform: translateY(100%); } }
  }
}
