/* DRG Daily Protocol Tracker — DRG palette and type (matches dailyrebuildguide.com). */

@font-face { font-family: 'Nunito Sans'; src: url('../fonts/nunito-sans.woff2') format('woff2'); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: 'Roboto Condensed'; src: url('../fonts/roboto-condensed.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --canvas: #f9f3e8;
  --surface: #fffdf8;
  --brand: #156971;
  --brand-deep: #0f4f55;
  --ink: #16302f;
  --ink-soft: #3d5c5f;
  --line: #d9cfbd;
  --warn: #9a3412;
  --warn-bg: #fdf0e6;
  --focus: #b8742a;
  --font-display: 'Roboto Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Nunito Sans', system-ui, sans-serif;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--ink);
  font: 17px/1.55 var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--brand); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 10; }

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left));
}
.brand { font: 700 1.25rem/1 var(--font-display); color: var(--brand-deep); text-decoration: none; text-transform: uppercase; letter-spacing: .04em; }
.brand span span { color: var(--brand); }

.wrap { flex: 1; width: 100%; max-width: 480px; margin: 0 auto; padding: 8px 16px 32px; }

.card { background: var(--surface); border-radius: var(--radius); padding: 28px 22px; box-shadow: 0 1px 2px rgb(15 79 85 / .06), 0 8px 24px rgb(15 79 85 / .06); }
h1 { font: 700 1.75rem/1.15 var(--font-display); color: var(--brand-deep); margin: 0 0 10px; }
.lead { color: var(--ink-soft); margin: 0 0 22px; }

label { display: block; font-weight: 700; margin: 18px 0 6px; }
.opt { font-weight: 400; color: var(--ink-soft); }
.hint { font-size: .9rem; color: var(--ink-soft); margin: 6px 0 0; }

input[type=email], input[type=text] {
  width: 100%;
  font: inherit;
  font-size: 1rem;             /* 16px+ stops iOS zooming into the field */
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input:focus { border-color: var(--brand); }
input[aria-invalid=true] { border-color: var(--warn); }
.code-input { font: 700 1.6rem/1 var(--font-display); letter-spacing: .25em; text-align: center; }

.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.check label { margin: 0; font-weight: 400; }

.field-error { color: var(--warn); font-size: .92rem; font-weight: 600; margin: 6px 0 0; }
.alert { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 10px 14px; font-weight: 600; }

.btn {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding: 14px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font: 700 1.05rem/1.2 var(--font-body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}
.btn:active { background: var(--brand-deep); }
@media (hover: hover) { .btn:hover { background: var(--brand-deep); } }

.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.aside { margin: 18px 0 0; font-size: .95rem; color: var(--ink-soft); text-align: center; }

.foot { padding: 20px 16px max(24px, env(safe-area-inset-bottom)); text-align: center; font-size: .85rem; color: var(--ink-soft); }
.foot p { margin: 6px auto; max-width: 480px; }
.support { background: var(--surface); border-radius: 10px; padding: 10px 14px; }
.credit { font-weight: 700; text-decoration: none; }

/* --- Today screen ----------------------------------------------------- */
:root {
  --mint: #d5efe8;
  --ok: #0b6b3a;
  --field: #5ab292;                                   /* the green of the logo's fields */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);         /* entering, feedback */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);     /* on-screen movement */
}

[data-done="1"] .mark-hint { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.today-head { margin: 4px 0 18px; }
.eyebrow { margin: 0 0 4px; font: 700 .8rem/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.today-head h1 { margin-bottom: 12px; }
.progress { margin: 0; color: var(--ink-soft); font-weight: 600; font-size: .95rem; }

.day-complete { display: none; margin: 0 0 16px; padding: 14px 16px; border-radius: var(--radius); background: var(--mint); color: var(--brand-deep); }
[data-complete="1"] .day-complete { display: block; }

.steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.step {
  background: var(--surface);
  border-radius: var(--radius);
  border: 2px solid transparent;
  box-shadow: 0 1px 2px rgb(15 79 85 / .06), 0 8px 24px rgb(15 79 85 / .06);
  transition: border-color .25s ease;
  scroll-margin-top: 16px;
}
.step[data-done="1"] { border-color: var(--brand); }

.step-main {
  display: grid;
  grid-template-columns: 48px 1fr 28px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 84px;
  padding: 16px 18px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.step-main:disabled, .step-main--static { cursor: default; }
.step-main:not(:disabled):active { background: rgb(21 105 113 / .06); }
summary.step-main { list-style: none; }
summary.step-main::-webkit-details-marker { display: none; }

.step-icon {
  width: 48px; height: 48px; padding: 12px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--brand);
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: background-color .25s ease, color .25s ease;
}
[data-done="1"] .step-icon { background: var(--brand); color: #fff; }

.step-text { display: grid; gap: 2px; min-width: 0; }
.step-label { font: 700 1.3rem/1.15 var(--font-display); color: var(--brand-deep); }
.step-status { font-size: .95rem; color: var(--ink-soft); }
[data-done="1"] .step-status { color: var(--ok); font-weight: 700; }

.step-check, .step-chev { grid-column: 3; grid-row: 1; justify-self: center; }
/* Tick: the check draws itself just after the icon fills (feedback, under 300ms). */
.step-check { width: 28px; height: 28px; fill: none; stroke: var(--brand); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.step-check path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 260ms var(--ease-out) 60ms; }
[data-done="1"] .step-check path { stroke-dashoffset: 0; }
.step-chev { width: 10px; height: 10px; border: solid var(--ink-soft); border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-3px); transition: transform .2s ease; }
[data-done="1"] .step-chev { display: none; }
details[open] .step-chev { transform: rotate(-135deg); }

.habit-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 18px 18px; }
.picks-q { grid-column: 1 / -1; margin: 0 0 2px; font-size: .95rem; color: var(--ink-soft); }
.pick {
  min-height: 48px;
  padding: 10px 6px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--brand-deep);
  font: 700 .98rem/1.2 var(--font-body);
  cursor: pointer;
  touch-action: manipulation;
}
.pick[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (hover: hover) { .pick:hover { border-color: var(--brand); } }

.step-undo { display: none; padding: 0 18px 14px; font-size: .9rem; }
[data-done="1"] .step-undo { display: block; }
.step-undo .link-btn { color: var(--ink-soft); }

.reflect { padding: 0 18px 18px; }
.prompt { display: block; margin: 0 0 8px; font-weight: 700; }
.reflect textarea {
  display: block;
  width: 100%;
  min-height: 150px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  resize: vertical;
}
.reflect textarea:focus { border-color: var(--brand); }
.count { min-height: 1.4em; margin: 6px 0 0; font-size: .9rem; color: var(--ink-soft); }
.count.ok { color: var(--ok); font-weight: 700; }
.btn--small { margin-top: 10px; }
.btn[disabled] { opacity: .6; cursor: wait; }
.note { margin: 12px 0 0; font-size: .85rem; color: var(--ink-soft); }
.note--support { margin-top: 6px; }

.step-error { margin: 0; padding: 0 18px 14px; color: var(--warn); font-weight: 600; font-size: .92rem; }
.step-error:empty { display: none; }
.is-busy { opacity: .75; }

/* --- Streak tiles ------------------------------------------------------ */
.streak { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; margin: 0 0 16px; }
.streak-tile { background: var(--surface); border-radius: 12px; padding: 10px 12px; box-shadow: 0 1px 2px rgb(15 79 85 / .06); }
.streak-tile dt { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.streak-tile dd { margin: 2px 0 0; display: flex; align-items: baseline; gap: 4px; }
.streak-num { font: 700 1.6rem/1 var(--font-display); color: var(--brand-deep); font-variant-numeric: tabular-nums; }
.streak-unit { font-size: .9rem; color: var(--ink-soft); }
.streak-tile--main { background: var(--brand); }
.streak-tile--main dt, .streak-tile--main .streak-unit { color: var(--on-brand-soft, #c9e4dd); }
.streak-tile--main .streak-num { color: #fff; font-size: 2rem; }

/* --- Bottom tab bar ---------------------------------------------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; justify-content: center; gap: 8px;
  padding: 6px 16px max(8px, env(safe-area-inset-bottom));
  background: rgb(255 253 248 / .96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.tab {
  flex: 0 1 140px;
  display: grid; justify-items: center; gap: 2px;
  padding: 6px 8px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: .8rem; font-weight: 700;
  text-decoration: none;
  -webkit-touch-callout: none;
}
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab.is-on { color: var(--brand); }
.foot--tabs { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

/* --- Calendar ---------------------------------------------------------- */
.cal-card { padding: 18px 14px; }
.cal-nav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin-bottom: 8px; }
.cal-month { margin: 0; text-align: center; font: 700 1.25rem/1.2 var(--font-display); color: var(--brand-deep); }
.cal-arrow { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-size: 1.6rem; line-height: 1; color: var(--brand); text-decoration: none; }
a.cal-arrow:active { background: rgb(21 105 113 / .08); }

.cal-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal-grid th { padding: 4px 0 8px; font-size: .78rem; font-weight: 700; color: var(--ink-soft); }
.cal-grid td { padding: 3px 0; text-align: center; }
.cal-day {
  position: relative;
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid transparent;
  color: var(--ink);
  font-weight: 700; font-size: .95rem;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.cal-day--complete { background: var(--brand); color: #fff; }
.cal-day--rest { border: 2px dashed var(--brand); color: var(--brand-deep); }
.cal-day--missed { color: var(--ink-soft); }
.cal-day--missed::after { content: ''; position: absolute; bottom: 5px; width: 12px; height: 2px; border-radius: 2px; background: var(--warn); }
.cal-day--before, .cal-day--future, .cal-day--none { color: #a99f8d; font-weight: 400; }
.cal-day.is-today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--focus); }
a.cal-day:active { transform: scale(.94); }

.cal-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; margin: 14px 0 0; padding: 0; list-style: none; font-size: .88rem; color: var(--ink-soft); }
.cal-legend li { display: flex; align-items: center; gap: 6px; }
.cal-legend strong { color: var(--ink); }
.cal-key { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 0; }
.cal-key.cal-day--rest { border: 2px dashed var(--brand); }
.cal-key.cal-day--missed { background: none; }
.cal-key.cal-day--missed::after { content: ""; position: absolute; left: 1px; bottom: 6px; width: 12px; height: 2px; border-radius: 2px; background: var(--warn); }

/* --- Day detail -------------------------------------------------------- */
.back { margin: 0 0 8px; }
.back a { font-weight: 700; text-decoration: none; }
.day-steps { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.day-step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); }
.day-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--line); color: var(--ink-soft); font-weight: 700; }
.day-step[data-done="1"] .day-mark { background: var(--brand); color: #fff; }
.day-reflection h2 { margin: 0 0 8px; font: 700 1.1rem/1.2 var(--font-display); color: var(--brand-deep); }
.day-reflection p { margin: 0; white-space: normal; overflow-wrap: anywhere; }

/* --- Settings ---------------------------------------------------------- */
.settings { display: grid; gap: 14px; }
.settings .today-head { margin-bottom: 0; }
.settings-card { padding: 22px 20px; }
.settings-card h2 { margin: 26px 0 0; font: 700 1.2rem/1.2 var(--font-display); color: var(--brand-deep); }
.settings-card h2:first-of-type { margin-top: 0; }
.settings-card form + form { margin-top: 0; }
.field-name { margin: 18px 0 6px; font-weight: 700; }
.readonly { margin: 0; color: var(--ink-soft); overflow-wrap: anywhere; }
select {
  width: 100%;
  padding: 12px 40px 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23156971' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center / 12px 8px;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  appearance: none;
}
select:focus { border-color: var(--brand); }
.is-off { opacity: .45; }
.radios { margin: 12px 0 0; padding: 0; border: 0; }
.radios legend { padding: 0; font-weight: 700; }
.radios .check { margin-top: 10px; }
.radios input[type=radio] { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--brand); }
.confirm-box { margin-top: 16px; padding: 14px 16px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); }
.confirm-box p { margin: 0; }
.confirm-box .check { margin-top: 10px; }
.confirm-box label { color: var(--warn); font-weight: 700; }
.notice { margin: 0; padding: 12px 16px; border-radius: 10px; background: var(--mint); color: var(--brand-deep); font-weight: 600; }

.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-row .btn { margin-top: 14px; padding-inline: 8px; font-size: .98rem; white-space: nowrap; }
.btn--ghost { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn--ghost:active { background: rgb(21 105 113 / .08); }
@media (hover: hover) { .btn--ghost:hover { background: rgb(21 105 113 / .08); } }
.btn--warn { background: var(--warn); color: #fff; box-shadow: none; }
.btn--ghost.btn--warn { background: transparent; color: var(--warn); box-shadow: inset 0 0 0 1.5px var(--warn); }
@media (hover: hover) { .btn--warn:hover { background: #7c2a0e; } .btn--ghost.btn--warn:hover { background: var(--warn-bg); } }
.danger { border: 2px solid var(--warn-bg); }
.danger h2 { color: var(--warn); }
.link-btn--warn { margin-top: 14px; color: var(--warn); font-size: .9rem; }

/* --- Move sessions and Listen audio ------------------------------------ */
.pick { display: inline-flex; align-items: center; justify-content: center; gap: 2px; }
.sessions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0 18px; list-style: none; }
.sessions:not(:has(li)) { display: none; }
.sessions:has(li) { padding-bottom: 14px; }
.session {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 2px 2px 12px;
  border-radius: 99px;
  background: var(--mint);
  color: var(--brand-deep);
  font-size: .9rem; font-weight: 700;
}
.session form { display: contents; }
.session-x {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border: 0; border-radius: 50%;
  background: none;
  color: var(--brand-deep);
  font-size: 1.15rem; line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.session-x:active { background: rgb(15 79 85 / .12); }
@media (hover: hover) { .session-x:hover { background: rgb(15 79 85 / .12); } }

.listen-audio { padding: 0 18px 16px; }
.audio-title { margin: 0 0 8px; font-weight: 700; font-size: .95rem; color: var(--brand-deep); }
.listen-audio audio { display: block; width: 100%; height: 44px; }
.listen-audio .note { margin-top: 6px; }

/* --- Logo ------------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 34px; height: 34px; flex: none; }
.card-logo { display: block; width: 156px; height: auto; margin: -4px auto 12px; }

/* --- Motion ----------------------------------------------------------- */

/* Today ring: one arc per step round the emblem. State indication:
   each arc sweeps in as its step is done; the full ring fades in when
   the day completes (a once-a-day moment), with a soft glint. */
.today-head--ring { display: flex; align-items: center; gap: 16px; }
.today-head--ring h1 { margin-bottom: 4px; }
.today-head-text { min-width: 0; }
.today-ring { position: relative; flex: none; width: 84px; height: 84px; }
.today-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.today-ring circle { fill: none; stroke-width: 4.5; stroke-linecap: round; }
.ring-track { stroke: var(--line); }
.ring-seg { stroke: var(--brand); transition: stroke-dashoffset 300ms var(--ease-out); }
.ring-seg.on { stroke-dashoffset: 0; }
.ring-full { stroke: var(--brand); opacity: 0; transition: opacity 400ms var(--ease-out); }
[data-complete="1"] .ring-full { opacity: 1; }
.ring-emblem { position: absolute; inset: 16px; border-radius: 50%; overflow: hidden; }
.ring-emblem img { display: block; width: 100%; height: 100%; }
.ring-glint {
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgb(255 255 255 / .7) 50%, transparent 65%);
  transform: translateX(-120%);
  pointer-events: none;
}
.today-ring.is-glinting .ring-glint { animation: ring-glint 900ms var(--ease-in-out) 250ms both; }
@keyframes ring-glint { to { transform: translateX(120%); } }

/* Breathing circle: paces the breath while the Listen audio plays and
   pauses with it. Constant, slow motion: 4s in, 6s out. */
.audio-head { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; }
.audio-head .audio-title { margin: 0; }
.breath { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--mint); }
.breath-core {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--field);
  transform: scale(.72);
  animation: breathe 10s var(--ease-in-out) infinite;
  animation-play-state: paused;
}
[data-playing="1"] .breath-core { animation-play-state: running; }
@keyframes breathe {
  0% { transform: scale(.72); opacity: .7; }
  40% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(.72); opacity: .7; }
}

/* Milestone line in the "Day complete" banner. */
.day-complete.is-milestone { background: var(--brand); color: #fff; }

/* Streak number roll (driven from app.js with WAAPI). */
.streak-num { display: inline-block; }

/* Tab changes: a quick crossfade between pages; header and tab bar stay put. */
@view-transition { navigation: auto; }
.bar { view-transition-name: app-bar; }
.tabbar { view-transition-name: app-tabs; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; animation-timing-function: var(--ease-out); }

/* Reduced motion: fewer and gentler. Keep fades that explain a change,
   drop sweeps, pulses and movement. */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .ring-seg { transition: none; }
  .ring-glint { display: none; }
  .breath-core { animation: none; transform: none; opacity: .9; }
  .step-check { opacity: 0; transition: opacity 200ms ease; }
  .step-check path { stroke-dashoffset: 0; transition: none; }
  [data-done="1"] .step-check { opacity: 1; }
  .step-chev, .btn, .pick, .session-x, a.cal-day { transition: none; }
  a.cal-day:active { transform: none; }
}

/* Pages that show the logo themselves have no logo top left: keep Log out
   on the right, and give the sign-in card room at the top. */
.bar > form { margin-left: auto; }
body:not(:has(.bar)) .wrap { padding-top: max(32px, env(safe-area-inset-top)); }

/* --- Installed-app polish (mobile-native) ------------------------------ */
/* An app, not a document: no pull-to-refresh or page rubber band fighting the screen. */
html, body { overscroll-behavior: none; }
/* Controls aren't text: no selection or long-press callout on them. */
.tab, .pick, .session-x, .link-btn, .step-main, .cal-day, .cal-arrow {
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
}
.tab:active { background: rgb(21 105 113 / .08); }
.offline .card { margin-top: 24px; text-align: center; }
.offline .lead { text-align: center; }

/* Install help card (Today) */
.install-card { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 16px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--mint); }
.install-card[hidden] { display: none; }
.install-card img { flex: none; border-radius: 10px; }
.install-text { min-width: 0; }
.install-title { margin: 0 0 4px; font-weight: 700; color: var(--brand-deep); }
.install-how { margin: 0; font-size: .95rem; color: var(--ink-soft); }
.share-glyph { display: inline-grid; place-items: center; width: 22px; height: 22px; vertical-align: -5px; border-radius: 6px; background: var(--mint); }
.share-glyph svg { width: 15px; height: 15px; fill: none; stroke: var(--brand); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.install-actions { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.install-actions .btn { display: inline-block; width: auto; margin: 0; padding: 10px 18px; font-size: .95rem; }
.install-actions .btn[hidden] { display: none; }
.install-actions .link-btn { color: var(--ink-soft); font-size: .92rem; }

/* Legal pages */
.wrap:has(.legal) { max-width: 720px; }
.legal h2 { margin: 26px 0 8px; font: 700 1.2rem/1.25 var(--font-display); color: var(--brand-deep); }
.legal p, .legal li { color: var(--ink); }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal mark { background: var(--warn-bg); color: var(--warn); padding: 0 4px; border-radius: 4px; }
.legal-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); }
.legal-table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
@media (max-width: 520px) {
  .legal-table thead { display: none; }
  .legal-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .legal-table td { display: block; border: 0; padding: 2px 0; }
  .legal-table td:first-child { font-weight: 700; }
}
.legal-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0 0 18px; }
.legal-dl dt { font-weight: 700; }
.legal-dl dd { margin: 0; }
