/* App styles. The look comes from the shared tokens — this file
   does layout + a couple of app-specific touches.
   tokens.css is vendored from Lumistead-Standard/lumistead-tokens.css —
   keep it in sync; don't hardcode colors it already names.

   Mobile-first: base rules target an iPhone (Waypoint's primary target as a
   web app). The desktop / Tauri look is restored at `min-width: 700px`. */

@import "./tokens.css";

/* This app's signature accent — the ONLY palette override allowed.
   Same value goes in lumistead.app.json `accent`. */
:root {
  --accent: #4d84c6;
  --wp-navh: 58px;   /* mobile bottom tab-bar height */
}

.hidden { display: none !important; }

/* ---- iPhone hardening ---- */
/* border-box everywhere: width:100% + padding must not overflow (this app
   predates the reset, so several elements rely on it now). */
*, *::before, *::after { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-size: 16.5px; overscroll-behavior-y: none; }
/* The page must never scroll sideways on a phone; long content wraps or uses
   its own inner scroll (heatmap, filter strip) instead. */
html, body { max-width: 100%; overflow-x: hidden; }

/* ======================================================================
   Layout shell — phone-first
   ====================================================================== */
.app {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  /* room for the notch (top) and the fixed bottom tab bar + home indicator */
  padding:
    calc(env(safe-area-inset-top) + var(--sp-4))
    max(var(--sp-4), env(safe-area-inset-right))
    calc(var(--wp-navh) + env(safe-area-inset-bottom) + var(--sp-5))
    max(var(--sp-4), env(safe-area-inset-left));
}

/* Header: compact on a phone. */
.app-head { padding-top: 0; }
.app-head-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.app-head .lumi-eyebrow { font-size: 0.64rem; }
.app-head h1 { font-size: 1.7rem; margin: 2px 0 0; }
.app-head p { margin: 0; }

.wp-error {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  background: color-mix(in srgb, var(--danger) 12%, var(--bg-2));
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  margin: 0;
}

/* ======================================================================
   Bottom tab bar (phone) — the primary, thumb-reachable navigation.
   Restyled into an inline header pill on desktop further down.
   ====================================================================== */
.wp-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.wp-nav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: var(--wp-navh); padding: 6px 4px;
  font-family: var(--font-sans); font-size: 0.7rem; font-weight: 500;
  color: var(--ink-mute); background: transparent; border: none; cursor: pointer;
  transition: color 0.18s var(--ease);
}
.wp-nav-btn.active { color: var(--accent); }
.wp-nav-ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ======================================================================
   Smart quick-capture — sticky at the top on a phone so "add anything"
   is always one thumb away.
   ====================================================================== */
.wp-capture { display: flex; flex-direction: column; gap: var(--sp-3); }
.wp-capture-form { display: flex; gap: var(--sp-2); }
.wp-capture-form input {
  flex: 1; min-width: 0;
  font-family: var(--font-sans); font-size: 1.05rem; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 13px 14px; min-height: 50px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.wp-capture-form input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
#capture-add { min-height: 50px; padding: 0 var(--sp-5); font-size: 1rem; white-space: nowrap; }
.wp-capture-hint { margin: 0; font-size: 0.8rem; }

.wp-preview {
  display: flex; flex-direction: column; gap: var(--sp-2);
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4);
  animation: rise 0.25s var(--ease);
}
.wp-preview-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3); }
.wp-preview-title { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); }
.wp-preview-chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-left: auto; }
.wp-preview-why { margin: 0; font-family: var(--font-mono); font-size: 0.7rem; }

.wp-typeswitch { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; }
.wp-type-btn {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em;
  color: var(--ink-mute); background: transparent; border: none; cursor: pointer;
  padding: 8px 14px; min-height: 36px; border-radius: 999px; transition: all 0.2s var(--ease);
}
.wp-type-btn.active { background: var(--accent); color: var(--on-accent); }

/* ======================================================================
   Toolbar (search) + filter tabs
   ====================================================================== */
.wp-toolbar { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.wp-search { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.wp-search input { min-width: 0; }
.wp-search-icon { position: absolute; left: calc(var(--sp-3) + 2px); font-size: 1.05rem; color: var(--ink-faint); pointer-events: none; }
.wp-search input {
  flex: 1; width: 100%; min-height: 46px;
  font-family: var(--font-sans); font-size: 1rem; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-6) var(--sp-3) calc(var(--sp-6) + 6px);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.wp-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.wp-search-clear {
  position: absolute; right: var(--sp-2); background: transparent; border: none;
  color: var(--ink-faint); cursor: pointer; font-size: 1.3rem; line-height: 1;
  width: 34px; height: 34px; border-radius: 8px;
}
.wp-help-btn {
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-mute);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
  padding: var(--sp-2) var(--sp-4); min-height: 40px; cursor: pointer; white-space: nowrap;
}

/* Filter tabs — a horizontally scrollable segmented strip. */
.wp-filter {
  display: flex; flex-wrap: nowrap; gap: var(--sp-2);
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  margin: 0 calc(-1 * var(--sp-1)); padding: 2px var(--sp-1);
}
.wp-filter::-webkit-scrollbar { display: none; }
.wp-filter-btn {
  flex: none; min-height: 40px;
  font-family: var(--font-sans); font-size: 0.9rem; color: var(--ink-mute);
  background: transparent; border: 1px solid transparent; border-radius: 999px;
  padding: var(--sp-2) var(--sp-4); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: color 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.wp-filter-btn.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.wp-filter-n {
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-faint);
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 0 6px; min-width: 18px; text-align: center;
}
.wp-filter-btn.active .wp-filter-n { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }

/* ======================================================================
   Board grid — single column on a phone, two columns on wide screens.
   ====================================================================== */
/* Board/Stats are column-flex items of .app; without this an auto-fit grid
   inside (the stat tiles) reports a huge min-content and overflows the phone. */
#view-board, #view-stats { min-width: 0; }
#stats-root, .wp-tiles, .wp-stat-grid { min-width: 0; }

.wp-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-5); min-width: 0; }
.wp-section { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.wp-section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.wp-section-head h2 { margin: 0; font-size: 1.3rem; }

.wp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }

/* ======================================================================
   Task row — a big tappable PRIMARY line + a collapsible DETAIL panel.
   ====================================================================== */
.wp-item {
  display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  animation: rise 0.3s var(--ease);
}
.wp-item-someday { opacity: 0.9; }
.wp-item-done { opacity: 0.62; }
.wp-item-sel { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }

.wp-item-main { display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; min-width: 0; }
.wp-check-box { width: 26px; height: 26px; flex: none; accent-color: var(--accent); cursor: pointer; }
.wp-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wp-item-titlerow { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.wp-dot { font-size: 0.7rem; flex: none; }
.wp-item-title { flex: 1 1 auto; min-width: 0; font-size: 1.05rem; color: var(--ink); overflow-wrap: anywhere; }
.wp-item-done .wp-item-title { text-decoration: line-through; }
.wp-item-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.wp-item-meta:empty { display: none; }

/* At-a-glance meta chips on the primary line */
.wp-chip {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 0.68rem; line-height: 1; color: var(--ink-soft);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 9px; white-space: nowrap;
}
.wp-chip-soft { color: var(--ink-faint); }
.wp-chip-today { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.wp-chip-overdue { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.wp-chip-goal { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* Expand chevron */
.wp-item-expand {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  background: transparent; border: none; border-radius: 10px; color: var(--ink-faint); cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.wp-item-expand:hover { background: var(--panel-2); color: var(--ink); }
.wp-chev { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s var(--ease); }
.wp-item.wp-open .wp-chev { transform: rotate(180deg); }

/* Detail panel — the editors, hidden until the row is expanded */
.wp-item-detail {
  display: none; flex-direction: column; gap: var(--sp-1);
  margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line);
}
.wp-item.wp-open .wp-item-detail { display: flex; animation: rise 0.2s var(--ease); }
.wp-field { display: flex; align-items: center; gap: var(--sp-3); min-height: 46px; }
.wp-field-label {
  flex: 0 0 68px; font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-mute);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.wp-field-controls { flex: 1; display: flex; align-items: center; gap: var(--sp-2); justify-content: flex-end; flex-wrap: wrap; }
.wp-field-hint { font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-faint); }
.wp-detail-actions { display: flex; justify-content: flex-end; padding-top: var(--sp-1); }

/* Inline editors — sized ≥16px so iOS never zoom-jumps on focus */
.wp-inline-select, .wp-inline-date {
  font-family: var(--font-sans); font-size: 1rem; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 8px 10px; min-height: 42px;
}
.wp-inline-date:focus, .wp-inline-select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.wp-inline-contrib {
  width: 76px; font-family: var(--font-sans); font-size: 1rem; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; min-height: 42px;
}
.wp-inline-contrib:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.wp-link-select { max-width: 62%; }
.wp-link-select.wp-link-active { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--bg-2)); }

.wp-chip-btn {
  font-family: var(--font-sans); font-size: 0.9rem; color: var(--ink-soft);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; min-height: 42px; cursor: pointer;
}
.wp-chip-btn:hover { color: var(--ink); border-color: var(--line-2); }
.wp-delete-btn {
  font-family: var(--font-sans); font-size: 0.88rem; color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--line)); border-radius: 10px;
  padding: 9px 16px; min-height: 42px; cursor: pointer;
}
.wp-delete-btn:hover { background: color-mix(in srgb, var(--danger) 15%, transparent); }

/* generic × remove (goals, help close) */
.wp-remove {
  background: transparent; border: none; color: var(--ink-faint);
  cursor: pointer; font-size: 1.3rem; line-height: 1;
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.wp-remove:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }

/* ======================================================================
   Goals
   ====================================================================== */
.wp-goal {
  display: flex; flex-direction: column; gap: var(--sp-2);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: var(--sp-4); animation: rise 0.3s var(--ease);
}
.wp-goal-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); }
.wp-goal-stat { margin-left: auto; }
.wp-goal-actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.wp-goal-done { opacity: 0.75; }
.wp-goal-editing { gap: var(--sp-3); }

.wp-progress { width: 100%; height: 9px; border-radius: 999px; background: var(--line); overflow: hidden; }
.wp-progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s var(--ease); }

.wp-meta { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint); white-space: nowrap; }

.lumi-btn.small, .lumi-btn-ghost.small { padding: 9px var(--sp-4); font-size: 0.85rem; min-height: 40px; }

.wp-status { text-align: center; padding: var(--sp-4) 0; }
.wp-empty { text-align: center; padding: var(--sp-4) 0; }

.wp-details { font-size: 0.85rem; }
.wp-details summary { cursor: pointer; color: var(--ink-mute); padding: var(--sp-3) 0; min-height: 40px; }
.wp-details .wp-list { margin-top: var(--sp-2); }

.app-foot { margin-top: auto; font-family: var(--font-mono); font-size: 0.72rem; text-align: center; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ======================================================================
   View switcher + inline editing
   ====================================================================== */
.wp-nav-btn:hover { color: var(--ink); }

.wp-editable { cursor: text; border-radius: 6px; padding: 1px 3px; margin: -1px -3px; transition: background 0.15s var(--ease); }
.wp-editable:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.wp-edit-input {
  font-family: var(--font-sans); font-size: 1rem; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--accent); border-radius: var(--radius-sm);
  padding: 10px 12px; min-height: 44px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.wp-edit-input:focus { outline: none; }
.wp-title-edit { flex: 1 1 auto; min-width: 120px; }
.wp-goal-edit-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; width: 100%; }
.wp-goal-edit-row .wp-edit-input:first-child { flex: 1 1 160px; }
.wp-edit-target { width: 90px; flex: none; }

/* ======================================================================
   Goal-side of task↔goal linking (feeders)
   ====================================================================== */
.wp-feeders { display: flex; flex-direction: column; gap: var(--sp-2); padding-top: var(--sp-1); }
.wp-feeders-head { font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink-faint); letter-spacing: 0.02em; }
.wp-feeder-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.wp-feeder { display: flex; align-items: center; gap: var(--sp-2); font-size: 0.95rem; padding: 4px 0; min-height: 36px; }
.wp-feeder input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); cursor: pointer; flex: none; }
.wp-feeder-title { color: var(--ink-soft); flex: 1 1 auto; min-width: 60px; }
.wp-feeder-contrib {
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 6px; padding: 0 6px; white-space: nowrap;
}

/* ======================================================================
   Stats dashboard
   ====================================================================== */
/* Exactly two columns on a phone. minmax(0,1fr) (not 140px) lets the tracks
   shrink to fit — a 140px floor + grid-item min-content overflows a 390px screen. */
.wp-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.wp-tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: var(--sp-4);
  display: flex; flex-direction: column; gap: 2px;
}
.wp-tile-value { font-family: var(--font-display); font-size: 2.1rem; line-height: 1; color: var(--ink); }
.wp-tile-label { font-size: 0.88rem; color: var(--ink-soft); }
.wp-tile-sub { font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-faint); }

.wp-stat-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-5); }
.wp-statcard { display: flex; flex-direction: column; gap: var(--sp-4); }
.wp-statcard-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.wp-statcard-title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 1.1rem; color: var(--ink); }

.wp-heatmap { display: flex; gap: 3px; overflow-x: auto; padding-bottom: var(--sp-1); }
.wp-hm-col { display: flex; flex-direction: column; gap: 3px; }
.wp-hm-cell { width: 13px; height: 13px; border-radius: 3px; background: var(--line); }
.wp-hm-future { background: transparent; }
.wp-hm-l0 { background: var(--line); }
.wp-hm-l1 { background: color-mix(in srgb, var(--accent) 28%, var(--panel-2)); }
.wp-hm-l2 { background: color-mix(in srgb, var(--accent) 50%, var(--panel-2)); }
.wp-hm-l3 { background: color-mix(in srgb, var(--accent) 74%, var(--panel-2)); }
.wp-hm-l4 { background: var(--accent); }
.wp-hm-legend { display: inline-flex; align-items: center; gap: 3px; }
.wp-hm-legend-lab { font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-faint); margin: 0 var(--sp-1); }

.wp-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.wp-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); height: 100%; justify-content: flex-end; }
.wp-bar { width: 60%; max-width: 22px; min-height: 3px; background: var(--accent); border-radius: 4px 4px 2px 2px; transition: height 0.3s var(--ease); }
.wp-bar-empty { background: var(--line-2); }
.wp-bar-lab { font-family: var(--font-mono); font-size: 0.6rem; color: var(--ink-faint); }

.wp-prio { display: flex; flex-direction: column; gap: var(--sp-3); }
.wp-prio-row { display: flex; align-items: center; gap: var(--sp-3); }
.wp-prio-dot { font-size: 0.7rem; }
.wp-prio-label { width: 64px; font-size: 0.9rem; color: var(--ink-soft); }
.wp-prio-track { flex: 1; height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.wp-prio-fill { height: 100%; background: color-mix(in srgb, var(--accent) 70%, var(--panel)); border-radius: 999px; }
.wp-prio-count { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); width: 24px; text-align: right; }

.wp-goalprog { display: flex; flex-direction: column; gap: var(--sp-4); }
.wp-goalprog-row { display: flex; flex-direction: column; gap: var(--sp-2); }
.wp-goalprog-top { display: flex; justify-content: space-between; gap: var(--sp-3); }
.wp-goalprog-name { color: var(--ink); }
.wp-goalprog-stat { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-faint); white-space: nowrap; }

/* ======================================================================
   Keyboard-shortcuts overlay (desktop / Tauri affordance)
   ====================================================================== */
.wp-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: var(--sp-5);
  background: color-mix(in srgb, var(--ink) 42%, transparent);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade 0.18s var(--ease);
}
.wp-overlay-card {
  width: 100%; max-width: 430px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: var(--sp-5) var(--sp-6);
  animation: rise 0.2s var(--ease);
}
.wp-overlay-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-4); }
.wp-overlay-head h3 { margin: 0; font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); }
.wp-keys { margin: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.wp-keys > div { display: flex; align-items: baseline; gap: var(--sp-4); }
.wp-keys dt { flex: 0 0 92px; display: flex; gap: 4px; }
.wp-keys dd { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
kbd {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line-2); border-bottom-width: 2px;
  border-radius: 6px; padding: 2px 7px; min-width: 20px; text-align: center; display: inline-block;
}
.wp-foot-hint { margin-left: var(--sp-3); }
.wp-foot-hint kbd { font-size: 0.64rem; padding: 1px 5px; min-width: 0; }

/* Touch devices don't have a keyboard — hide the keyboard-only affordances. */
@media (hover: none) and (pointer: coarse) {
  .wp-help-btn, .wp-foot-hint { display: none; }
}

/* ======================================================================
   Desktop / Tauri — restore the roomier two-column layout + header pill.
   ====================================================================== */
@media (min-width: 700px) {
  .app {
    max-width: 1040px;
    gap: var(--sp-6);
    padding: var(--sp-8) var(--sp-6) var(--sp-6);
  }
  .app-head { padding-top: var(--sp-5); }
  .app-head-row { align-items: flex-end; }
  .app-head h1 { font-size: 3rem; margin: var(--sp-2) 0 var(--sp-3); }

  /* nav becomes the inline header pill again */
  .wp-nav {
    position: static; display: inline-flex; gap: 2px;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
    padding: 3px; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .wp-nav-btn {
    flex: 0 0 auto; flex-direction: row; gap: 6px; min-height: 0;
    padding: var(--sp-2) var(--sp-5); border-radius: 999px; font-size: 0.92rem;
  }
  .wp-nav-btn.active { background: var(--accent); color: var(--on-accent); }
  .wp-nav-ico { display: none; }

  .wp-capture { position: static; }

  .wp-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
  .wp-stat-grid { grid-template-columns: 1fr 1fr; }
  .wp-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .wp-section-head h2 { font-size: 1.4rem; }
}
