/* observer.clinic — the "Try the panel" sample. The panel is always dark, like the real device. */

/* ---------- page around the panel ---------- */
.demo-intro { padding: 48px 0 24px; }
.demo-intro h1 { font-size: clamp(30px, 4.6vw, 46px); line-height: 1.1; margin: 0 0 14px; letter-spacing: -.01em; }
.demo-intro .lede { font-size: clamp(17px, 2vw, 19px); color: var(--muted); max-width: 720px; margin: 0; }
.demo-after { padding: 20px 0 56px; }
.demo-after .note { max-width: 720px; margin: 0 0 18px; }
button.btn { font: inherit; font-weight: 600; cursor: pointer; border: 0; }
button.btn.ghost { border: 1.5px solid var(--accent); }

.demo-stage { padding: 8px 0; }
.pn-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- the device ---------- */
.panel {
  --bg: #0b1019; --device: #0f1623; --surface: #172131; --surface2: #1e2a3d; --line: #2c3a50;
  --ink: #eef2f8; --muted: #b4bfd0; --faint: #8f9cb1;
  --accent: #4fd1c5; --accent-ink: #06201d; --accent-soft: #12322f;
  --ok: #5ee08f; --ok-soft: #113221; --warn: #f6c453; --warn-soft: #352a0e; --bad: #ff8a80; --bad-soft: #3a1714;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 14px;
  color-scheme: dark;
  position: relative;
  width: 100%;
  aspect-ratio: 1280 / 800;
  min-height: 560px;
  background: var(--device);
  color: var(--ink);
  border: 10px solid #1b1f27;
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  font-size: 16px;
  line-height: 1.45;
  container-type: inline-size;
  container-name: panel;
}
@media (max-width: 720px) {
  .panel { aspect-ratio: auto; height: 720px; max-height: calc(100vh - 32px); max-height: calc(100svh - 32px); border-width: 8px; border-radius: 26px; }
}
.panel *, .panel *::before, .panel *::after { box-sizing: border-box; }
.panel button, .panel input, .panel select { font: inherit; color: inherit; }
.panel button { cursor: pointer; }
.panel :focus-visible, .panel a:focus-visible, .panel button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.panel [hidden] { display: none !important; }
.pn-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.panel p { margin: 0; }

svg.pn-i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.pn-i.sm { width: 18px; height: 18px; }

.pn-banner {
  grid-row: 1;
  background: var(--warn); color: #2a2005;
  font-size: 14px; font-weight: 600; text-align: center;
  padding: 7px 12px; line-height: 1.3;
}

/* ---------- buttons ---------- */
.pn-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface2); color: var(--ink); font-weight: 600;
}
.pn-btn:hover { border-color: var(--faint); }
.pn-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pn-btn.big { min-height: 60px; padding: 0 34px; font-size: 20px; border-radius: 16px; }
.pn-btn.danger { border-color: var(--bad); color: var(--bad); background: transparent; }
.pn-btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #210604; }
.pn-btn.small { min-height: 44px; padding: 0 14px; font-size: 15px; }
.pn-btn.done { color: var(--ok); border-color: #2f6b47; background: var(--ok-soft); }
.pn-iconbtn {
  display: inline-grid; place-items: center; min-width: 48px; height: 48px; border-radius: 12px;
  background: transparent; border: 1px solid transparent; color: var(--ink);
}
.pn-iconbtn:hover, .pn-iconbtn[aria-current="page"] { background: var(--surface2); border-color: var(--line); }
.pn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; margin-top: 20px; }

/* ---------- lock screen ---------- */
.pn-lock {
  grid-row: 2; min-height: 0;
  display: grid; grid-template-rows: 1fr auto; gap: 18px;
  padding: 34px 40px;
  background: radial-gradient(1200px 600px at 50% 0%, #15233a, var(--device));
}
.pn-lock-place { font-weight: 650; font-size: 18px; color: var(--muted); }
.pn-clock { font-size: clamp(60px, 11cqi, 104px); font-weight: 250; letter-spacing: -.02em; line-height: 1.05; margin-top: 8px !important; }
.pn-lock-date { font-size: 20px; color: var(--muted); }
.pn-lock-note { display: flex; align-items: center; gap: 8px; margin-top: 22px !important; color: var(--muted); font-size: 15px; }
.pn-lock-bar { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }
.pn-demo-pin { font-size: 17px; color: var(--muted); }
.pn-demo-pin strong { color: var(--ink); font-family: var(--mono); letter-spacing: .12em; }

/* ---------- unlocked frame ---------- */
.pn-app { grid-row: 2; min-height: 0; display: grid; grid-template-rows: 60px 1fr 74px; position: relative; }
.pn-top { display: flex; align-items: center; gap: 8px; padding: 0 10px 0 18px; background: var(--surface); border-bottom: 1px solid var(--line); min-width: 0; }
.pn-place { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pn-place small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.pn-spacer { flex: 1; }
.pn-time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; white-space: nowrap; }

.pn-main { overflow: auto; padding: 22px 26px 28px; overscroll-behavior: contain; min-height: 0; }
.pn-h1 { font-size: 26px; font-weight: 650; margin: 0 0 4px; line-height: 1.2; }
.pn-h1:focus { outline: none; }
.pn-h1:focus-visible { outline: 3px solid var(--accent); }
.pn-sub { color: var(--muted); margin: 0 0 18px !important; }
.pn-h2 { font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; font-weight: 650; }
.pn-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.pn-label { display: block; font-size: 15px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.pn-hint { color: var(--muted); font-size: 15px; margin: 8px 0 12px !important; }
.pn-count { color: var(--muted); font-size: 14px; margin: 8px 0 4px !important; min-height: 1.4em; }
.pn-empty { color: var(--muted); padding: 18px 0; }

/* ---------- tab bar ---------- */
.pn-tabs { display: flex; background: var(--surface); border-top: 1px solid var(--line); }
.pn-tabs button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: none; border: 0; border-top: 3px solid transparent; color: var(--muted);
  font-size: 14px; font-weight: 600; min-width: 0; padding: 0 4px;
}
.pn-tabs button:hover { color: var(--ink); }
.pn-tabs button[aria-current="page"] { color: var(--accent); border-top-color: var(--accent); background: #132030; }

/* ---------- Today ---------- */
.pn-tiles { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); margin-bottom: 14px; }
.pn-tile .n { font-size: 32px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pn-tile .n small { font-size: 17px; font-weight: 600; color: var(--muted); }
.pn-tile .l { color: var(--muted); font-size: 14px; margin-top: 4px; }
.pn-chart { width: 100%; height: auto; display: block; }
.pn-chart .bar { fill: var(--accent); }
.pn-chart .bar.hi { fill: var(--warn); }
.pn-chart .val { fill: var(--ink); font-size: 13px; font-weight: 600; }
.pn-chart .ax { fill: var(--muted); font-size: 12.5px; }
.pn-chart.narrow .val { font-size: 15px; }
.pn-chart.narrow .ax { font-size: 14px; }
.pn-chart .base { stroke: var(--line); stroke-width: 1; }
.pn-chart .avg { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.pn-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 14px; margin-top: 10px; }
.pn-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--accent); }
.pn-legend i.hi { background: var(--warn); }
.pn-legend i.avg { background: none; border-top: 2px dashed var(--muted); height: 0; width: 16px; border-radius: 0; vertical-align: 3px; }

/* ---------- Heard ---------- */
.pn-search { margin-bottom: 6px; max-width: 560px; }
.pn-search-box { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
.pn-search-box:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.pn-search-box input { flex: 1; min-width: 0; min-height: 48px; background: transparent; border: 0; outline: none; font-size: 16px; }
.pn-search-box input::placeholder { color: var(--faint); }
.pn-lines { list-style: none; margin: 0; padding: 0; }
.pn-line { display: grid; grid-template-columns: 82px 96px 1fr 48px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid #243145; }
.pn-line .t { font-family: var(--mono); color: var(--muted); font-size: 14px; }
.pn-line .s { font-weight: 650; font-size: 15px; color: var(--accent); }
.pn-line .s.other { color: var(--faint); font-weight: 500; font-style: italic; }
.pn-line .x { min-width: 0; overflow-wrap: anywhere; }
.pn-line mark { background: #3b3310; color: var(--warn); border-radius: 4px; padding: 0 2px; }
.pn-play { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--surface2); border: 1px solid var(--line); color: var(--ink); padding: 0; }
.pn-play svg.pn-i { width: 18px; height: 18px; fill: currentColor; stroke-width: 1.5; }
.pn-play:hover { border-color: var(--faint); }

/* ---------- Follow-ups ---------- */
.pn-follow { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pn-fu { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 12px 18px; }
.pn-fu.is-done .what { color: var(--muted); }
.pn-fu .what { font-weight: 600; }
.pn-fu .meta { color: var(--muted); font-size: 14px; margin-top: 4px !important; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.pn-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 2px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; font-weight: 600; }
.pn-badge.ok { color: var(--ok); border-color: #2f6b47; background: var(--ok-soft); }
.pn-badge.warn { color: var(--warn); border-color: #6b5a22; background: var(--warn-soft); }
.pn-badge.kind { color: var(--accent); border-color: #2b6b64; background: var(--accent-soft); }

/* ---------- Report ---------- */
.pn-report-actions { margin-bottom: 14px; }
.pn-report { background: #fbfaf7; color: #1b2430; border-radius: var(--r); padding: 24px 28px; max-width: 720px; }
.pn-report h3 { font-size: 22px; margin: 0 0 2px; }
.pn-report .rp-meta { color: #4f5b69; margin: 0 0 16px !important; }
.pn-report dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0; margin: 0 0 18px; border-top: 1px solid #e3e0d8; }
.pn-report dt, .pn-report dd { padding: 9px 0; border-bottom: 1px solid #e3e0d8; margin: 0; }
.pn-report dd { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; padding-left: 16px; }
.pn-report h4 { font-size: 16px; margin: 0 0 6px; }
.pn-report ul { margin: 0 0 16px; padding-left: 20px; }
.pn-report li { margin: 4px 0; }
.pn-report .rp-foot { font-size: 14px; color: #4f5b69; border-top: 1px solid #e3e0d8; padding-top: 10px; }

/* ---------- Privacy ---------- */
.pn-promises { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; max-width: 760px; }
.pn-promises li { display: flex; gap: 12px; align-items: flex-start; }
.pn-promises svg { color: var(--ok); margin-top: 3px; }
.pn-setting { max-width: 560px; margin-bottom: 14px; }
.pn-setting select { width: 100%; min-height: 48px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font-size: 16px; }

/* ---------- overlays ---------- */
.pn-overlay { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(5, 8, 13, .82); padding: 16px; }
.pn-sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; width: min(440px, 100%); max-height: 100%; overflow: auto; }
.pn-dots { display: flex; gap: 16px; justify-content: center; margin: 8px 0 6px; }
.pn-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); }
.pn-dots i.on { background: var(--accent); border-color: var(--accent); }
.pn-pin-msg { color: var(--bad); text-align: center; min-height: 1.45em; font-size: 15px; }
.pn-pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.pn-pinpad button { min-height: 60px; font-size: 26px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--line); }
.pn-pinpad button:hover { border-color: var(--faint); }
.pn-pinpad button:active { background: var(--accent-soft); }
.pn-pinpad .pn-pk-word { font-size: 17px; color: var(--muted); }

.pn-warn {
  position: absolute; left: 50%; top: 70px; transform: translateX(-50%); z-index: 26;
  background: var(--warn); color: #2a2005; border-radius: 12px; padding: 8px 8px 8px 16px;
  display: flex; gap: 12px; align-items: center; font-weight: 650; box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
  width: max-content; max-width: calc(100% - 24px);
}
.pn-warn .pn-btn { background: #2a2005; color: #fff3d0; border-color: #2a2005; }
.pn-warn .pn-btn:focus-visible { outline-color: #2a2005; }

.pn-toast {
  position: absolute; left: 50%; bottom: 90px; transform: translate(-50%, 12px); z-index: 40;
  background: var(--surface2); border: 1px solid var(--faint); border-radius: 12px; padding: 12px 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5); max-width: calc(100% - 32px); width: max-content;
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.pn-toast.show { opacity: 1; transform: translate(-50%, 0); }
.panel.is-locked .pn-toast { bottom: 24px; }

/* ---------- narrower panels (phones) ---------- */
@container panel (max-width: 820px) {
  .pn-tiles { grid-template-columns: repeat(2, 1fr); }
}
@container panel (max-width: 600px) {
  .pn-main { padding: 16px 14px 22px; }
  .pn-lock { padding: 24px 18px; }
  .pn-h1 { font-size: 23px; }
  .pn-tile .n { font-size: 26px; }
  .pn-tiles { gap: 10px; }
  .pn-card { padding: 14px; }
  .pn-line { grid-template-columns: 82px 1fr 48px; gap: 2px 10px; }
  .pn-line .x { grid-column: 1 / -1; grid-row: 2; }
  .pn-line .pn-play { grid-column: 3; grid-row: 1; }
  .pn-fu { grid-template-columns: 1fr; padding: 12px 14px; }
  .pn-fu .pn-btn { justify-self: start; }
  .pn-tabs button { font-size: 12.5px; }
  .pn-time { display: none; }
  .pn-report { padding: 18px; }
  .pn-top { padding-left: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .pn-toast { transition: none; transform: translate(-50%, 0); }
}

/* ---------- print: only the report card ---------- */
@media print {
  header.site, footer.site, .skip, .demo-intro, .demo-after, .pn-banner, .pn-top, .pn-tabs, .pn-lock,
  .pn-overlay, .pn-toast, .pn-warn, .pn-report-actions, .pn-view > .pn-h1, .pn-view > .pn-sub,
  .pn-view:not(#view-report) { display: none !important; }
  .panel.is-locked { display: none !important; }
  #view-report { display: block !important; }
  .panel { border: 0; box-shadow: none; aspect-ratio: auto; height: auto; min-height: 0; max-height: none; background: #fff; color: #000; display: block; overflow: visible; }
  .pn-app, .pn-main { display: block !important; overflow: visible; padding: 0; }
  .pn-report { background: #fff; color: #000; max-width: none; padding: 0; }
}
