/* The three looks from the Plexus palette. Technical is the default; the reader picks
   one with the header switch, stored per device, applied as data-look on <html>. */
:root, :root[data-look="technical"] {
  --bg: #220f09; --card: #2b130b; --line: #4a1e10;
  --ink: #fbe9e1; --text: #ffd2c2; --muted: #d9a08a;
  --accent: #F0997B; --badge: #D85A30;
  --keep: #F0997B; --keep-bg: #3a1a0f; --keep-line: #5e2614;
  --chip: #2b130b; --top: rgba(34, 15, 9, .94); --band: #2b130b; --top-ink: #F0997B;
  --logo-a: #D85A30; --logo-b: #F0997B;
  --toast: #fbe9e1; --toast-ink: #2b130b; --toast-act: #993C1D;
  --ui-font: ui-monospace, "SF Mono", Menlo, "Roboto Mono", Consolas, monospace;
  color-scheme: dark;
}
:root[data-look="dark"] {
  --bg: #140e0c; --card: #241815; --line: #36231c;
  --ink: #faeee8; --text: #e6d2ca; --muted: #cdb0a6;
  --accent: #F0997B; --badge: #D85A30;
  --keep: #F0997B; --keep-bg: #2f201b; --keep-line: #4a2c22;
  --chip: #241815; --top: rgba(20, 14, 12, .94); --band: #1a1210; --top-ink: #F0997B;
  --logo-a: #D85A30; --logo-b: #F0997B;
  --toast: #faeee8; --toast-ink: #1a1210; --toast-act: #993C1D;
  --ui-font: inherit;
  color-scheme: dark;
}
:root[data-look="light"] {
  --bg: #fbf0eb; --card: #ffffff; --line: #f0d2c6;
  --ink: #2a140d; --text: #4a2a1f; --muted: #7a4f41;
  --accent: #993C1D; --badge: #D85A30;
  --keep: #993C1D; --keep-bg: #fbf0eb; --keep-line: #f0d2c6;
  --chip: #ffffff; --top: rgba(251, 240, 235, .94); --band: #993C1D; --top-ink: #fde7de;
  --logo-a: #fde7de; --logo-b: #F0997B;
  --toast: #2a140d; --toast-ink: #fde7de; --toast-act: #F0997B;
  --ui-font: inherit;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }

.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--top);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 0;
}
.bar, .tabs, .filters { max-width: 600px; margin: 0 auto; padding: 0 16px; }
/* The brand bar is a full-width band: brown in the light look, like the Plexus top bar. */
.bar { display: flex; align-items: center; padding-top: calc(10px + env(safe-area-inset-top)); padding-bottom: 10px;
  background: var(--band); box-shadow: 0 0 0 100vmax var(--band); clip-path: inset(0 -100vmax); }
.brand { margin: 0; font-size: 18px; font-weight: 700; color: var(--top-ink); font-family: var(--ui-font); letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.mark { width: 30px; height: auto; display: block; }
.stamp { font-size: 11px; color: var(--top-ink); opacity: .75; margin-left: auto; }
.menu-btn { border: 0; background: none; color: var(--top-ink); padding: 4px; margin: -4px -4px -4px 10px; display: flex; }
.menu-btn svg { width: 20px; height: 20px; }
.menu {
  position: absolute; right: max(16px, calc(50% - 284px)); z-index: 6; min-width: 200px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25); font-family: var(--ui-font);
}
.menu[hidden], .search[hidden] { display: none; }
.menu-item { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--ink);
  font-weight: 600; padding: 8px 10px; border-radius: 6px; }
.menu-item:hover { background: var(--bg); }
.menu-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  padding: 8px 10px 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.looks { display: flex; gap: 4px; padding: 2px 6px 6px; }
.looks button { flex: 1; border: 1px solid var(--line); background: none; color: var(--text); border-radius: 999px;
  padding: 4px 6px; font-size: 11.5px; font-weight: 600; }
.looks button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

/* Monospace runs wide, so the technical look sets its header text a size smaller. */
:root[data-look="technical"] .brand { font-size: 15px; letter-spacing: -.02em; }
:root[data-look="technical"] .stamp { font-size: 10px; }
:root[data-look="technical"] .tabs button { font-size: 12.5px; padding: 7px 8px; }
:root[data-look="technical"] .week-head { font-size: 11px; }

.tabs { display: flex; gap: 4px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  border: 0; background: none; padding: 7px 10px; border-radius: 8px;
  color: var(--muted); font-weight: 600; white-space: nowrap; font-family: var(--ui-font);
}
.tabs button[aria-selected="true"] { color: var(--accent); background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.tabs .n { font-weight: 500; color: var(--muted); margin-left: 4px; font-size: 12px; }

.filters { display: flex; align-items: center; gap: 10px; padding-top: 8px; padding-bottom: 8px; }
.chips { display: flex; gap: 6px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--line); background: var(--chip); border-radius: 999px;
  padding: 3px 10px; font-size: 12px; white-space: nowrap; color: var(--text);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.search { max-width: 600px; margin: 0 auto; padding: 0 16px 8px; }
.search input {
  width: 100%; border: 1px solid var(--line); background: var(--chip); color: var(--ink);
  border-radius: 999px; padding: 5px 12px; font: 13px var(--ui-font); outline: none;
}
.search input:focus { border-color: var(--accent); }
.search input::placeholder { color: var(--muted); }
mark { background: none; color: var(--accent); font-weight: 700; }
.toggle { font-size: 12px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 4px; }

.sc { max-width: 600px; margin: 0 auto; padding: 12px 16px 40px; }
.week-head { font-family: var(--ui-font); font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 18px 2px 8px; }
.week-head:first-child { margin-top: 4px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; margin-bottom: 14px;
  transition: transform .25s ease, opacity .25s ease;
}
.card.gone.keep { transform: translateX(110%) rotate(4deg); opacity: 0; }
.card.gone.pass { transform: translateX(-110%) rotate(-4deg); opacity: 0; }

.figs {
  display: flex; align-items: flex-start; overflow-x: auto; overflow-y: hidden;
  transition: height .2s ease; scroll-snap-type: x mandatory;
  background: #fff; scrollbar-width: none;
}
.figs::-webkit-scrollbar { display: none; }
.fig { flex: 0 0 100%; scroll-snap-align: start; }
.fig img { display: block; width: 100%; max-height: 62vh; object-fit: contain; background: #fff; }
.fig-tag {
  background: rgba(43, 19, 11, .92); color: #fde7de; font-size: 11px; line-height: 1.35;
  padding: 4px 10px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fig-tag.open { white-space: normal; }
.preview .fig img { max-height: 40vh; object-fit: cover; }

.band { height: 6px; }

.body { padding: 12px 14px 10px; touch-action: pan-y; }
.meta { font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.meta .dot { width: 8px; height: 8px; border-radius: 50%; }
.meta .new { color: var(--accent); font-weight: 700; }
.title { font-size: 15px; font-weight: 650; color: var(--ink); line-height: 1.3; margin: 4px 0 6px; }
.text-only .title { font-size: 14px; }
.title a { color: inherit; text-decoration: none; }
.summary { font-size: 14px; color: var(--text); margin: 0; }
.credit { font-size: 11px; color: var(--muted); margin-top: 6px; }
.credit a { color: inherit; }

.acts { display: flex; gap: 8px; padding: 0 14px 12px; }
.acts button, .acts a {
  flex: 1; text-align: center; border: 1px solid var(--line); background: none;
  border-radius: 8px; padding: 7px 0; font-size: 13px; font-weight: 600; text-decoration: none;
}
.acts .pass { color: var(--muted); }
.acts .open { color: var(--accent); }
.acts .keep { color: var(--keep); background: var(--keep-bg); border-color: var(--keep-line); }
.acts .keep[aria-pressed="true"]::before { content: "✓ "; }

.weeks { list-style: none; margin: 0; padding: 0; }
.weeks button {
  width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; color: var(--ink); font-weight: 600;
  display: flex; justify-content: space-between;
}
.weeks .n { color: var(--muted); font-weight: 500; }
.back { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 0 0 8px; }
.backup { display: flex; align-items: center; gap: 8px; padding: 2px 0 12px; font-size: 12.5px; color: var(--muted); }
.backup span { flex: 1; }
.backup button { border: 1px solid var(--line); background: var(--card); color: var(--accent);
  font: inherit; font-weight: 600; border-radius: 999px; padding: 5px 12px; }

.toast {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--toast); color: var(--toast-ink); border-radius: 10px; padding: 8px 8px 8px 14px;
  display: flex; gap: 12px; align-items: center; font-size: 13px; z-index: 10;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25); max-width: calc(100% - 32px);
}
.toast[hidden] { display: none; }
.toast button { background: none; border: 0; color: var(--toast-act); font-weight: 700; padding: 4px 8px; }

.foot { max-width: 600px; margin: 0 auto; padding: 0 16px 40px; font-size: 11px; color: var(--muted); }
.foot a { color: inherit; }
