/* Puzzle Lab account layer: account button, "How everyone did" sheet, history, friends and
   today's mix. Everything is scoped under .plab so it sits on top of any game's own styles.
   Light tokens live on .plab; dark ones follow the system setting unless the page sets
   data-theme="light", and data-theme="dark" forces them. */

.plab {
  --plab-paper: #EBEFF3;
  --plab-sheet: #F7F9FB;
  --plab-card: #FFFFFF;
  --plab-ink: #0F1B2C;
  --plab-ink-2: #45536A;
  --plab-rule: #BCC6D2;
  --plab-rule-soft: #DCE2E9;
  --plab-mark: #FFE34F;
  --plab-mark-soft: #FFF3B0;
  --plab-on-mark: #0F1B2C;
  --plab-accent: #2442D6;
  --plab-focus: #2442D6;
  --plab-bar: #7D8BA0;
  --plab-bar-mine: #0F1B2C;
  --plab-danger: #B42318;
  --plab-ok: #1D6B3A;
  --plab-backdrop: rgba(15, 27, 44, 0.48);
  --plab-shadow: 0 10px 30px rgba(15, 27, 44, 0.22);
  /* the "Continue with Google" button, in Google's own light and dark button colours */
  --plab-google-bg: #FFFFFF;
  --plab-google-ink: #1F1F1F;
  --plab-google-line: #747775;
  --plab-font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --plab-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .plab {
    --plab-paper: #0C131D;
    --plab-sheet: #121B27;
    --plab-card: #172231;
    --plab-ink: #E6ECF3;
    --plab-ink-2: #A0AEC0;
    --plab-rule: #34445A;
    --plab-rule-soft: #223042;
    --plab-mark: #E8CF4A;
    --plab-mark-soft: #4A4220;
    --plab-on-mark: #0C131D;
    --plab-accent: #A3B5FF;
    --plab-focus: #A3B5FF;
    --plab-bar: #6E7F96;
    --plab-bar-mine: #E6ECF3;
    --plab-danger: #FF9C8F;
    --plab-ok: #86D7A0;
    --plab-backdrop: rgba(0, 0, 0, 0.62);
    --plab-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --plab-google-bg: #131314;
    --plab-google-ink: #E3E3E3;
    --plab-google-line: #8E918F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] .plab {
  --plab-paper: #0C131D;
  --plab-sheet: #121B27;
  --plab-card: #172231;
  --plab-ink: #E6ECF3;
  --plab-ink-2: #A0AEC0;
  --plab-rule: #34445A;
  --plab-rule-soft: #223042;
  --plab-mark: #E8CF4A;
  --plab-mark-soft: #4A4220;
  --plab-on-mark: #0C131D;
  --plab-accent: #A3B5FF;
  --plab-focus: #A3B5FF;
  --plab-bar: #6E7F96;
  --plab-bar-mine: #E6ECF3;
  --plab-danger: #FF9C8F;
  --plab-ok: #86D7A0;
  --plab-backdrop: rgba(0, 0, 0, 0.62);
  --plab-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --plab-google-bg: #131314;
  --plab-google-ink: #E3E3E3;
  --plab-google-line: #8E918F;
  color-scheme: dark;
}

/* ---------- base (defensive: games style bare elements) ----------
   Resets use `.plab :where(...)`: one class of specificity, so they beat a game's bare element
   rules (button { }, p { }) but lose to the component classes further down. */

.plab, .plab :where(*, *::before, *::after) { box-sizing: border-box; }
.plab {
  font-family: var(--plab-font);
  font-size: 15px;
  line-height: 1.45;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
  color: var(--plab-ink);
  -webkit-text-size-adjust: 100%;
}
.plab [hidden] { display: none !important; }
.plab :where(h1, h2, h3, h4, p, ul, ol, li, dl, dt, dd, figure, fieldset, legend, pre, form, label) { margin: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; letter-spacing: inherit; text-transform: none; text-align: inherit; }
.plab :where(ul, ol) { list-style: none; }
.plab :where(a) { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.plab :where(a:hover) { color: var(--plab-accent); }
.plab :where(:focus) { outline: none; }
.plab :focus-visible { outline: 3px solid var(--plab-focus); outline-offset: 2px; }
.plab :where(button, input, textarea, select) {
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
  color: inherit;
  margin: 0;
  box-shadow: none;
}
.plab :where(button) { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.plab :where(button:disabled) { cursor: default; opacity: 0.55; }
.plab :where(svg) { display: block; flex: none; }
.plab-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.plab-mono { font-family: var(--plab-mono); font-variant-numeric: tabular-nums; }
.plab-kicker {
  font: 500 11.5px/1.3 var(--plab-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--plab-ink-2);
}

/* ---------- buttons, fields, notes ---------- */

.plab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border: 1px solid var(--plab-ink);
  border-radius: 4px;
  background: transparent;
  color: var(--plab-ink);
  font: 600 15px/1.2 var(--plab-font);
  text-decoration: none;
  white-space: nowrap;
}
.plab-btn:hover { background: var(--plab-rule-soft); color: var(--plab-ink); }
.plab-btn-primary { background: var(--plab-ink); color: var(--plab-sheet); }
.plab-btn-primary:hover { background: var(--plab-ink); color: var(--plab-sheet); text-decoration: underline; text-underline-offset: 3px; }
.plab-btn-quiet { border-color: transparent; padding: 0 10px; }
.plab-btn-quiet:hover { background: var(--plab-rule-soft); }
.plab-btn-danger { border-color: var(--plab-danger); color: var(--plab-danger); }
.plab-btn-danger:hover { background: var(--plab-danger); color: var(--plab-card); }
.plab-btn-small { min-height: 44px; padding: 0 12px; font-size: 14px; }
.plab-btn[aria-busy="true"] { opacity: 0.7; }
.plab-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.plab-field { display: grid; gap: 6px; }
.plab-field > label, .plab-label { font: 600 14px/1.3 var(--plab-font); }
.plab-input {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--plab-ink-2);
  border-radius: 4px;
  background: var(--plab-card);
  color: var(--plab-ink);
  font: 400 16px/1.3 var(--plab-font);
  -webkit-appearance: none;
  appearance: none;
}
.plab-input::placeholder { color: var(--plab-ink-2); opacity: 0.8; }
.plab-input[aria-invalid="true"] { border-color: var(--plab-danger); box-shadow: inset 0 0 0 1px var(--plab-danger); }
.plab-input:focus-visible { outline: 3px solid var(--plab-focus); outline-offset: 1px; }
.plab-hint { color: var(--plab-ink-2); font-size: 13.5px; }
.plab-msg { min-height: 0; font-size: 14px; }
.plab-msg:empty { display: none; }
.plab-msg.is-error { color: var(--plab-danger); font-weight: 600; }
.plab-msg.is-ok { color: var(--plab-ok); font-weight: 600; }
.plab-row-input { display: flex; gap: 8px; }
.plab-row-input .plab-input { flex: 1 1 auto; min-width: 0; }
.plab-row-input .plab-btn { flex: none; }

.plab-note {
  padding: 12px 14px;
  border-left: 4px solid var(--plab-mark);
  background: var(--plab-card);
  color: var(--plab-ink);
  font-size: 14.5px;
}
.plab-note p + p { margin-top: 6px; }
.plab-note .plab-actions { margin-top: 10px; }
.plab-note.is-ok { border-left-color: var(--plab-ok); }
.plab-note.is-error { border-left-color: var(--plab-danger); }
.plab-mark { background: var(--plab-mark); color: var(--plab-on-mark); padding: 1px 5px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ---------- account button (top-right of the site bar) ---------- */

.plab-acct { display: inline-flex; }
.plab-acct-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  max-width: 100%;
  padding: 0 12px 0 10px;
  border: 1px solid var(--plab-rule);
  border-radius: 4px;
  background: var(--plab-sheet);
  color: var(--plab-ink);
  font: 600 14px/1.2 var(--plab-font);
}
.plab-acct-btn:hover { border-color: var(--plab-ink); }
.plab-acct-btn svg { width: 18px; height: 18px; }
.plab-acct-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plab-acct-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--plab-mark); box-shadow: 0 0 0 1px var(--plab-ink); }
/* In a page's top line (the site bar on game pages, .pl-bar, and the hub's, .pl-hub-bar) the button
   looks 32px tall, so the 36px bar keeps its height, and an invisible layer gives it a 44px tall hit
   area. In the site bar that layer starts at the bar's top edge and reaches 8px below the bar, so all
   44px can be tapped; site/tests/site.playwright.cjs checks no game control sits there. Anywhere
   else the button stays 44px tall. */
:where(.pl-bar, .pl-hub-bar) .pl-account .plab-acct-btn { position: relative; min-height: 32px; height: 32px; padding: 0 10px 0 8px; gap: 6px; border-color: var(--plab-ink-2); }
:where(.pl-bar, .pl-hub-bar) .pl-account .plab-acct-btn::before { content: ""; position: absolute; left: -1px; right: -1px; top: 50%; height: 44px; margin-top: -22px; }
.pl-bar .pl-account .plab-acct-btn::before { top: calc((31px - var(--pl-bar-h, 36px)) / 2); margin-top: 0; } /* the padding box starts 1px below the button top */
:where(.pl-bar, .pl-hub-bar) .pl-account .plab-acct-btn:hover { border-color: var(--plab-ink); background: var(--plab-card); }

/* ---------- "See how everyone did" in the page's top line ---------- */

/* Game pages put it in their top line (the site bar), just left of the account button (lab.js,
   ensureToastHost): it is part of that line, so it never lies over the game. The slot takes the
   line's free room, and the button's words shrink with it: "See how everyone did", then "Everyone",
   then the chart icon alone (its name, with the game and level, is in aria-label and title). Like
   the account button, in the site bar it looks 32px tall and has a 44px tall hit area from the bar's
   top edge to 8px below it; anywhere else it is 44px tall. */
/* the same button in a slot in a game's own result card (mountEveryoneButton): a line of its own under the card's buttons */
.plab-everyone { display: block; margin-top: 8px; }
.plab-everyone[hidden] { display: none; }
.plab-chart-slot { position: relative; z-index: 1; flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: flex-end; container-type: inline-size; } /* above the game, as the account slot is, so the hit area below the bar takes its taps */
.plab-chart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
  padding: 0 9px;
  border: 1px solid var(--plab-ink-2);
  border-radius: 4px;
  background: var(--plab-sheet);
  color: var(--plab-ink);
  font: 600 14px/1.2 var(--plab-font);
  white-space: nowrap;
}
:where(.pl-bar, .pl-hub-bar) .plab-chart-btn { min-height: 32px; height: 32px; }
:where(.pl-bar, .pl-hub-bar) .plab-chart-btn::before { content: ""; position: absolute; left: -1px; right: -1px; top: 50%; height: 44px; margin-top: -22px; }
.pl-bar .plab-chart-btn::before { top: calc((31px - var(--pl-bar-h, 36px)) / 2); margin-top: 0; } /* the padding box starts 1px below the button top */
.plab-chart-btn:hover { border-color: var(--plab-ink); background: var(--plab-card); }
.plab-chart-btn.is-new { animation: plab-fade 0.3s ease-out; } /* a fade only: it never moves over the game */
.plab-chart-icon { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 3px; background: var(--plab-mark); color: var(--plab-on-mark); }
.plab-chart-icon svg { width: 16px; height: 16px; }
.plab-chart-long, .plab-chart-short { display: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@container (min-width: 120px) {
  .plab-chart-btn { padding: 0 10px 0 4px; justify-content: flex-start; }
  .plab-chart-short { display: inline; }
}
@container (min-width: 210px) {
  .plab-chart-short { display: none; }
  .plab-chart-long { display: inline; }
}

/* ---------- toast ("See how everyone did"), for a page without an account slot ---------- */

/* A page that pins something to the bottom of the screen (a game's action bar) sets
   --puzzlelab-bottom-inset on :root to that element's height while it shows ('72px'; '0px' or unset
   when it is gone). The toast, its chart button and the phone spacer below stay above it, plus the
   safe area. Registered as a length so a unitless 0 or a stray value falls back to 0px instead of
   breaking the sums below. */
@property --puzzlelab-bottom-inset {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}
.plab-toast {
  position: fixed;
  z-index: 2147483000;
  left: max(16px, env(safe-area-inset-left, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(16px + var(--puzzlelab-bottom-inset, 0px) + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.plab-toast-in {
  display: flex;
  align-items: stretch;
  max-width: 100%;
  border-radius: 6px;
  background: var(--plab-ink);
  color: var(--plab-sheet);
  box-shadow: var(--plab-shadow);
  pointer-events: auto;
  animation: plab-rise 0.2s ease-out;
}
.plab-toast-open {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  min-width: 0;
  padding: 6px 6px 6px 14px;
  border: 0;
  border-radius: 6px 0 0 6px;
  background: transparent;
  color: inherit;
  text-align: left;
}
.plab-toast-open:hover .plab-toast-title { text-decoration: underline; text-underline-offset: 3px; }
.plab-toast-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 4px; background: var(--plab-mark); color: var(--plab-on-mark); }
.plab-toast-icon svg { width: 18px; height: 18px; }
.plab-toast-text { display: grid; min-width: 0; }
.plab-toast-title { font: 600 15px/1.25 var(--plab-font); }
.plab-toast-sub { font: 400 12.5px/1.3 var(--plab-mono); opacity: 0.82; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plab-toast-x {
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 48px;
  border: 0;
  border-left: 1px solid color-mix(in srgb, var(--plab-sheet) 25%, transparent);
  border-radius: 0 6px 6px 0;
  background: transparent;
  color: inherit;
}
.plab-toast-x svg { width: 16px; height: 16px; }
.plab-toast :focus-visible { outline: 3px solid var(--plab-mark); outline-offset: -3px; }
@media (min-width: 720px) {
  .plab-toast { left: auto; justify-content: flex-end; }
}
/* Game pages with accounts on keep room for the toast on a phone, where it spans the bottom of the
   screen (lab.js adds both, see makeRoom): the game's own scrolling, such as bringing its result
   card into view, stops above the toast, and the page ends with a spacer so its last control can
   scroll clear of it. Both grow by the page's own bottom bar, if it has one. */
.plab-room { display: none; }
@media (max-width: 719px) {
  html.plab-roomy { scroll-padding-bottom: calc(80px + var(--puzzlelab-bottom-inset, 0px) + env(safe-area-inset-bottom, 0px)); }
  .plab-room { display: block; height: calc(72px + var(--puzzlelab-bottom-inset, 0px) + env(safe-area-inset-bottom, 0px)); }
}
.plab-toast.is-mini { justify-content: flex-end; }
.plab-toast-in.is-mini .plab-toast-text, .plab-toast-in.is-mini .plab-toast-x { display: none; }
.plab-toast-in.is-mini .plab-toast-open { min-width: 48px; padding: 10px; border-radius: 6px; justify-content: center; }

/* inline variant of the same button, for a slot inside a game's result card */
.plab-everyone { display: inline-flex; }

/* ---------- sheet (bottom sheet dialog) ---------- */

.plab-lock { overflow: hidden !important; }
dialog.plab-sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: 560px;
  max-height: min(88vh, 900px);
  max-height: min(88dvh, 900px);
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-top: 3px solid var(--plab-ink);
  border-radius: 12px 12px 0 0;
  background: var(--plab-sheet);
  color: var(--plab-ink);
  box-shadow: var(--plab-shadow);
  overflow: hidden;
  animation: plab-up 0.22s ease-out;
}
dialog.plab-sheet:not([open]) { display: none; }
dialog.plab-sheet[open] { display: flex; flex-direction: column; }
dialog.plab-sheet::backdrop { background: var(--plab-backdrop); }
.plab-sheet-fallback-backdrop { position: fixed; inset: 0; z-index: 2147482999; background: rgba(15, 27, 44, 0.48); }
dialog.plab-sheet.plab-sheet-fallback { z-index: 2147483001; }
.plab-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px max(10px, env(safe-area-inset-right, 0px)) 10px max(18px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--plab-rule);
  background: var(--plab-sheet);
}
.plab-sheet-titles { display: grid; gap: 2px; min-width: 0; padding-top: 2px; }
.plab-sheet-title { font: 600 20px/1.2 var(--plab-font); letter-spacing: -0.01em; }
.plab-sheet-title:focus { outline: none; }
.plab-sheet-title:focus-visible { outline: 3px solid var(--plab-focus); outline-offset: 2px; }
dialog[data-plab-auto] .plab-sheet-title:focus-visible { outline: none; } /* opened by the page, not the player */
.plab-x {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--plab-ink);
}
.plab-x:hover { border-color: var(--plab-rule); }
.plab-x svg { width: 18px; height: 18px; }
.plab-sheet-body {
  display: grid;
  gap: 18px;
  padding: 16px max(18px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.plab-section { display: grid; gap: 10px; }
.plab-section > h3, .plab-h3 {
  font: 500 11.5px/1.3 var(--plab-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--plab-ink-2);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--plab-rule);
}
@media (min-width: 640px) and (min-height: 560px) {
  dialog.plab-sheet {
    inset: 0;
    margin: auto;
    max-height: min(84vh, 860px);
    border-radius: 10px;
    animation-name: plab-pop;
  }
}

/* level chips inside the sheet */
.plab-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.plab-chip {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--plab-rule);
  border-radius: 999px;
  background: var(--plab-card);
  color: var(--plab-ink);
  font: 600 14px/1 var(--plab-font);
}
.plab-chip[aria-pressed="true"] { border-color: var(--plab-ink); background: var(--plab-ink); color: var(--plab-sheet); }

/* stat tiles */
.plab-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--plab-rule); border: 1px solid var(--plab-rule); }
.plab-stat { display: grid; gap: 2px; padding: 10px 12px; background: var(--plab-card); }
.plab-stat dt { font: 500 11px/1.3 var(--plab-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--plab-ink-2); }
.plab-stat dd { font: 600 22px/1.15 var(--plab-font); letter-spacing: -0.01em; }
@media (min-width: 420px) { .plab-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.plab-callout { font: 600 17px/1.35 var(--plab-font); }
.plab-callout .plab-mark { padding: 0 4px; }

/* the histogram: horizontal bars, one highlighted, values at the bar tips */
.plab-hist { display: grid; gap: 2px; }
.plab-hist-row {
  display: grid;
  grid-template-columns: minmax(84px, 34%) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 32px;
}
.plab-hist-label { display: flex; align-items: center; gap: 6px; min-width: 0; font: 500 13.5px/1.2 var(--plab-font); color: var(--plab-ink); }
.plab-hist-label span:first-child { overflow-wrap: anywhere; }
.plab-hist-you {
  flex: none;
  padding: 1px 5px;
  background: var(--plab-mark);
  color: var(--plab-on-mark);
  font: 600 11px/1.3 var(--plab-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.plab-hist-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.plab-hist-bar {
  flex: none;
  height: 20px;
  min-width: 2px;
  border-radius: 0 4px 4px 0;
  background: var(--plab-bar);
}
.plab-hist-row.is-mine .plab-hist-bar { background: var(--plab-bar-mine); }
.plab-hist-row.is-mine .plab-hist-label { font-weight: 700; }
.plab-hist-row.is-zero .plab-hist-bar { background: var(--plab-rule); }
.plab-hist-val { flex: none; font: 500 13px/1 var(--plab-mono); font-variant-numeric: tabular-nums; color: var(--plab-ink-2); }
.plab-hist-row.is-mine .plab-hist-val { color: var(--plab-ink); font-weight: 600; }
.plab-chart-caption { color: var(--plab-ink-2); font-size: 13.5px; }

/* your own result line and friends list */
/* "Perfect · 5 turns · par 5 · 1:35": the mark word in bold, then the facts */
.plab-mine { padding: 10px 12px; background: var(--plab-card); border: 1px solid var(--plab-rule); overflow-wrap: anywhere; }
.plab-mine b { font-weight: 600; }
.plab-mine .plab-mono { color: var(--plab-ink-2); font-size: 14px; }
/* a replay that beat the result: a small note beside it, never the result itself */
.plab-mine-wrap { display: grid; gap: 6px; }
.plab-replay { color: var(--plab-ink-2); font: 400 12.5px/1.4 var(--plab-mono); overflow-wrap: anywhere; }
.plab-list { display: grid; }
.plab-list > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-height: 48px;
  padding: 8px 0;
  border-bottom: 1px solid var(--plab-rule-soft);
}
.plab-list > li:last-child { border-bottom: 0; }
.plab-who { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.plab-who small { font: 400 12.5px/1.2 var(--plab-mono); color: var(--plab-ink-2); }
.plab-what { font: 400 14px/1.3 var(--plab-mono); font-variant-numeric: tabular-nums; color: var(--plab-ink-2); }
.plab-is-you .plab-who::after { content: "you"; padding: 1px 5px; background: var(--plab-mark); color: var(--plab-on-mark); font: 600 10.5px/1.3 var(--plab-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.plab-empty { color: var(--plab-ink-2); }
.plab-spin { color: var(--plab-ink-2); font: 400 13px/1.4 var(--plab-mono); }

/* account sheet */
.plab-google { display: grid; gap: 10px; }
.plab-btn-google { width: 100%; gap: 10px; border-color: var(--plab-google-line); background: var(--plab-google-bg); color: var(--plab-google-ink); }
.plab-btn-google:hover { border-color: var(--plab-google-ink); background: var(--plab-google-bg); color: var(--plab-google-ink); }
.plab-btn-google svg { width: 18px; height: 18px; }
.plab-or { display: flex; align-items: center; gap: 10px; color: var(--plab-ink-2); font: 500 11.5px/1.3 var(--plab-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.plab-or::before, .plab-or::after { content: ""; flex: 1 1 0; height: 1px; background: var(--plab-rule); }
.plab-tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--plab-ink); border-radius: 4px; overflow: hidden; }
.plab-tab { min-height: 44px; border: 0; background: var(--plab-card); color: var(--plab-ink); font: 600 14.5px/1.2 var(--plab-font); }
.plab-tab + .plab-tab { border-left: 1px solid var(--plab-ink); }
.plab-tab[aria-pressed="true"] { background: var(--plab-ink); color: var(--plab-sheet); }
.plab-form { display: grid; gap: 14px; }
.plab-lede { font: 600 18px/1.3 var(--plab-font); }
.plab-who-card { display: grid; gap: 4px; padding: 12px 14px; background: var(--plab-card); border: 1px solid var(--plab-rule); }
.plab-who-card .plab-big { font: 600 20px/1.2 var(--plab-font); overflow-wrap: anywhere; }
.plab-links { display: flex; flex-wrap: wrap; gap: 8px; }
.plab-edit { display: grid; justify-items: start; gap: 10px; }
.plab-edit > form { justify-self: stretch; }

/* ---------- hub panels: today's mix, history, friends ---------- */

.plab-panel {
  display: grid;
  gap: 14px;
  padding: 10px 0 18px;
  border-top: 2px solid var(--plab-ink);
  background: transparent;
}
.plab-panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.plab-panel-title { font: 500 12px/1.3 var(--plab-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--plab-ink); }
.plab-panel-meta { font: 400 12.5px/1.3 var(--plab-mono); color: var(--plab-ink-2); }
.plab-panel-lede { font-size: 15px; color: var(--plab-ink); max-width: 60ch; }

/* today's mix */
.plab-mix { display: grid; gap: 0; border: 1px solid var(--plab-rule); background: var(--plab-card); }
.plab-mix-row { display: flex; align-items: flex-start; gap: 12px; min-height: 52px; padding: 10px 12px; border-top: 1px solid var(--plab-rule-soft); cursor: pointer; }
.plab-mix-row:first-child { border-top: 0; }
.plab-mix-row input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--plab-ink); cursor: pointer; }
.plab-mix-row:has(input:focus-visible) { outline: 3px solid var(--plab-focus); outline-offset: -3px; }
.plab-mix-row input:focus-visible { outline: none; }
.plab-mix-text { display: grid; gap: 2px; min-width: 0; }
.plab-mix-name { font-weight: 600; }
.plab-mix-line { font: 400 13.5px/1.4 var(--plab-mono); color: var(--plab-ink-2); overflow-wrap: anywhere; }
.plab-share {
  padding: 12px 14px;
  border: 1px dashed var(--plab-rule);
  background: var(--plab-sheet);
  color: var(--plab-ink);
  font: 400 13.5px/1.55 var(--plab-mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.plab-copybox { display: grid; gap: 6px; }
.plab-copybox textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  border: 1px solid var(--plab-ink-2);
  border-radius: 4px;
  background: var(--plab-card);
  color: var(--plab-ink);
  font: 400 14px/1.5 var(--plab-mono);
  resize: vertical;
}

/* history */
.plab-games { display: grid; gap: 12px; }
.plab-game { display: grid; gap: 10px; padding: 12px 14px 14px; border: 1px solid var(--plab-rule); background: var(--plab-card); }
.plab-game-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.plab-game-name { font: 600 17px/1.2 var(--plab-font); }
.plab-game-name a { text-decoration: none; }
.plab-game-name a:hover { text-decoration: underline; }
.plab-streak { font: 500 12.5px/1.3 var(--plab-mono); color: var(--plab-ink-2); }
.plab-streak b { color: var(--plab-on-mark); background: var(--plab-mark); padding: 0 4px; font-weight: 600; }
.plab-cal { display: flex; flex-wrap: wrap; gap: 4px; }
.plab-day {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--plab-rule);
  background: transparent;
  color: var(--plab-ink-2);
  font: 500 11.5px/1 var(--plab-mono);
}
.plab-day.is-all { background: var(--plab-mark); border-color: var(--plab-mark); color: var(--plab-on-mark); }
.plab-day.is-some { background: var(--plab-mark-soft); border-color: var(--plab-mark); color: var(--plab-ink); }
.plab-day.is-revealed { border-style: dashed; border-color: var(--plab-ink-2); color: var(--plab-ink); }
.plab-day.is-today { box-shadow: inset 0 0 0 1px var(--plab-ink); font-weight: 700; }
.plab-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--plab-ink-2); font: 400 12px/1.3 var(--plab-mono); }
.plab-legend span { display: inline-flex; align-items: center; gap: 6px; }
.plab-legend i { display: inline-block; width: 12px; height: 12px; border: 1px solid var(--plab-rule); }
.plab-legend i.is-all { background: var(--plab-mark); border-color: var(--plab-mark); }
.plab-legend i.is-some { background: var(--plab-mark-soft); border-color: var(--plab-mark); }
.plab-legend i.is-revealed { border-style: dashed; border-color: var(--plab-ink-2); }
.plab-days { display: grid; }
.plab-days > li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--plab-rule-soft); }
.plab-days-date { font: 500 12.5px/1.45 var(--plab-mono); color: var(--plab-ink-2); }
.plab-days-levels { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 14px; }
.plab-days-levels .plab-lv { white-space: nowrap; }
.plab-days-levels .plab-replay { font-size: 12px; white-space: normal; }
.plab-days-levels .is-solved b, .plab-days-levels .is-day b { font-weight: 600; font-variant-numeric: tabular-nums; }
.plab-days-levels .is-revealed { color: var(--plab-ink-2); }
.plab-unfinished { color: var(--plab-ink-2); font-size: 14px; }
.plab-streak-rule { color: var(--plab-ink-2); font-size: 13.5px; max-width: 60ch; }
.plab-others, .plab-kept { color: var(--plab-ink-2); font-size: 13.5px; max-width: 60ch; }

/* friends */
.plab-invite { display: grid; gap: 8px; }

/* ---------- motion ---------- */

@keyframes plab-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes plab-pop { from { transform: translateY(8px) scale(0.985); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes plab-rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes plab-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .plab, .plab *, dialog.plab-sheet, .plab-toast-in { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .plab-hist-bar { background: CanvasText; forced-color-adjust: none; }
  .plab-hist-row.is-mine .plab-hist-bar { background: Highlight; }
  .plab-day.is-all, .plab-day.is-some { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}
