/* =====================================================================================================================
   _blanco ui – the one stylesheet for every _blanco tool ("slate": the look of Backup's big-photo panel)
   Show it: shared/blanco-ui.html. Rules in short:
   · Big display titles (page heroes, group names) in Inter 900, tight (-0.055em) – as they always were.
   · Inter 500 for content and smaller titles, JetBrains Mono for labels, chips, data, menus.
   · Lime is a line and a word, never a big filled block: one lime-outlined main action per view.
   · Chips (radius 7) instead of filled buttons; icon-only buttons are square chips with a name tip on hover.
   · Hairline rules separate; panels only where a thing is really separate.
   · Motion: transform and opacity only, 150–250 ms, ease-out. Phones: floating buttons stay round.
   · Page head, the same on every page: big title 48px below the top bar (phone 36), grey mono line 14px under it,
     buttons below it on phones 12px, then always 30px to the content (tokens --b-hero-*; applied in prod-rail.js).
   · Rows of buttons: the "…" (more) button is always last, at the far right of its row (16 Nov 2026; slate.css).
   Use the b- classes in new markup. Old pages are mapped onto the same look in slate.css.
   ===================================================================================================================== */

/* ---------- tokens ---------- */
:root {
  --b-bg: #0a0a0a;          /* page */
  --b-surface: #121212;     /* panels, inputs */
  --b-raise: #1a1a1a;       /* menus, tips, hovered rows */
  --b-line: #242424;        /* hairlines */
  --b-line-2: #343432;      /* chip borders, inputs */
  --b-ink: #f4f4f2;         /* text */
  --b-ink-2: #b9b9b4;       /* secondary text */
  --b-mute: #8e8e8a;        /* labels, hints */
  --b-lime: #d6fb00;        /* the accent: lines, words, icons */
  --b-on-lime: #0a0a0a;     /* text on lime (only the round phone button, the avatar) */
  --b-warn: #ff4d4f;        /* delete, errors (signal red) */

  --b-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --b-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --b-r-chip: 7px; --b-r-field: 8px; --b-r-panel: 12px; --b-r-round: 999px;
  --b-ease: cubic-bezier(.22, 1, .36, 1);
  --b-fast: .15s; --b-mid: .25s;
  /* page head rhythm */
  --b-hero-top: 8px;        /* + the page's 40px (phone 28px) = title 48px (36px) below the top bar */
  --b-hero-line: 14px;      /* title → grey mono line */
  --b-hero-actions: 12px;   /* line → buttons, when they wrap below on phones */
  --b-hero-after: 30px;     /* head → content */
}
html[data-ui="light"] {
  --b-bg: #f4f4f2; --b-surface: #fff; --b-raise: #ececea; --b-line: #e0e0dc; --b-line-2: #cfcfca;
  --b-ink: #111; --b-ink-2: #3d3d3a; --b-mute: #6b6b66; --b-lime: #5a6b00; --b-on-lime: #fff; --b-warn: #d92d20;
}

/* ---------- type ---------- */
.b-display { font: 900 clamp(44px, 8vw, 84px)/.9 var(--b-sans); letter-spacing: -.055em; color: var(--b-ink); margin: 0; text-wrap: balance; }
/* phones: big display titles get a little more room between their lines (Blanco, 24 Nov 2026 – .9 made them touch) */
@media (max-width: 760px) { .b-display { line-height: 1; } }
.b-title   { font: 500 26px/1.15 var(--b-sans); letter-spacing: -.01em; color: var(--b-ink); margin: 0; overflow-wrap: anywhere; }
.b-h3      { font: 500 17px/1.3 var(--b-sans); color: var(--b-ink); margin: 0; }
.b-text    { font: 400 15px/1.6 var(--b-sans); color: var(--b-ink-2); margin: 0; max-width: 62ch; }
.b-small   { font: 400 13px/1.5 var(--b-sans); color: var(--b-mute); margin: 0; }
.b-label   { font: 500 10.5px/1.4 var(--b-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--b-mute); }
.b-data    { font: 500 13px/1.4 var(--b-mono); color: var(--b-ink); font-variant-numeric: tabular-nums; }

/* the type line above a title: what it is in lime, a count or size on the right */
.b-typeline { display: flex; justify-content: space-between; gap: 12px; font: 500 11px/1.4 var(--b-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--b-mute); }
.b-typeline > :first-child { color: var(--b-lime); }
.b-rule { height: 1px; border: 0; background: var(--b-line); margin: 16px 0; }

/* label / value rows (Date, Size, Pixels …) */
.b-rows { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 0; }
.b-rows dt { font: 500 11px/1.5 var(--b-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--b-mute); }
.b-rows dd { margin: 0; font: 500 12.5px/1.5 var(--b-mono); color: var(--b-ink); overflow-wrap: anywhere; }

/* ---------- buttons: chips ---------- */
.b-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 12px;
  border: 1px solid var(--b-line-2); border-radius: var(--b-r-chip); background: transparent; color: var(--b-ink);
  font: 500 11px/1 var(--b-mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: border-color var(--b-fast), color var(--b-fast), transform .12s;
}
.b-chip:hover:not(:disabled) { border-color: var(--b-lime); }
.b-chip:active:not(:disabled) { transform: scale(.97); }
.b-chip:focus-visible { outline: 2px solid var(--b-lime); outline-offset: 2px; }
.b-chip:disabled { opacity: .38; cursor: default; }
.b-chip svg { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--b-lime); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.b-chip.is-main { border-color: var(--b-lime); color: var(--b-lime); }          /* the one main action of a view */
.b-chip.is-on { border-color: var(--b-lime); color: var(--b-lime); }            /* a chosen option */
.b-chip.is-danger svg { stroke: var(--b-warn); }
.b-chip.is-danger:hover { border-color: var(--b-warn); color: var(--b-warn); }
.b-chip.is-big { height: 40px; padding: 0 16px; }
.b-chip.is-wide { width: 100%; }
/* icon only: a square chip; the name comes as a tip on hover (data-tip, shared/tip.js) */
.b-icon { width: 34px; height: 34px; padding: 0; border-radius: var(--b-r-field); }
.b-icon svg { width: 16px; height: 16px; stroke: currentColor; }
.b-icon:hover:not(:disabled) { color: var(--b-lime); }

/* text links: the lightest action (PREV, NEXT, Reset) */
.b-link { background: none; border: 0; padding: 0 0 2px; border-bottom: 1px solid var(--b-line-2); color: var(--b-mute); font: 500 11px var(--b-mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; text-decoration: none; }
.b-link:hover:not(:disabled) { color: var(--b-lime); border-color: var(--b-lime); }

/* phones: a floating action stays a round button (the only filled lime, so it is found with the thumb) */
.b-fab { width: 52px; height: 52px; border-radius: var(--b-r-round); border: 0; background: var(--b-lime); color: var(--b-on-lime); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.b-fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- choosing: words, tabs, segments ---------- */
.b-words { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.b-words button { background: none; border: 0; padding: 5px 0; color: var(--b-mute); font: 500 11px var(--b-mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; transition: color var(--b-fast); }
.b-words button:hover { color: var(--b-ink); }
.b-words button.is-on, .b-words button[aria-pressed="true"], .b-words button[aria-selected="true"] { color: var(--b-ink); box-shadow: inset 0 -1.5px 0 var(--b-lime); }
.b-words .b-accent { color: var(--b-lime); }

/* icon tabs: icons only, the chosen one shows its word */
.b-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--b-line); }
.b-tabs button { position: relative; display: inline-flex; align-items: center; gap: 0; padding: 9px 10px 11px; background: none; border: 0; color: var(--b-mute); cursor: pointer; transition: gap var(--b-mid), color var(--b-fast); }
.b-tabs button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.b-tabs button span { max-width: 0; overflow: hidden; opacity: 0; white-space: nowrap; font: 500 10.5px var(--b-mono); letter-spacing: .08em; text-transform: uppercase; transition: max-width var(--b-mid) var(--b-ease), opacity .2s; }
.b-tabs button[aria-selected="true"] { color: var(--b-ink); gap: 6px; }
.b-tabs button[aria-selected="true"] svg { color: var(--b-lime); }
.b-tabs button[aria-selected="true"] span { max-width: 110px; opacity: 1; }
.b-tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--b-lime); }

/* ---------- fields ---------- */
.b-field { display: grid; gap: 7px; }
.b-field > span { font: 500 10.5px/1.4 var(--b-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--b-mute); }
.b-input, .b-textarea, .b-select {
  width: 100%; box-sizing: border-box; border: 1px solid var(--b-line-2); border-radius: var(--b-r-field); background: var(--b-surface);
  color: var(--b-ink); font: 400 14px/1.4 var(--b-sans); padding: 10px 12px; transition: border-color var(--b-fast);
}
.b-input { height: 40px; }
.b-textarea { min-height: 96px; resize: vertical; }
.b-select { height: 34px; padding: 0 30px 0 11px; font: 500 11px var(--b-mono); letter-spacing: .06em; text-transform: uppercase; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--b-mute) 50%), linear-gradient(135deg, var(--b-mute) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 11px) 50%; background-size: 4px 4px; background-repeat: no-repeat; }
.b-input:focus, .b-textarea:focus, .b-select:focus { outline: none; border-color: var(--b-lime); }
.b-input::placeholder, .b-textarea::placeholder { color: var(--b-mute); }
/* search: just a line, the word in mono */
.b-search { display: flex; align-items: center; gap: 9px; height: 36px; border-bottom: 1px solid var(--b-line-2); color: var(--b-mute); }
.b-search svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; flex: none; }
.b-search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; color: var(--b-ink); font: 400 14px var(--b-sans); }
.b-search input::placeholder { font: 500 11px var(--b-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--b-mute); }
.b-search:focus-within { border-color: var(--b-lime); }

/* ---------- surfaces ---------- */
.b-panel { background: var(--b-surface); border: 1px solid var(--b-line); border-radius: var(--b-r-panel); padding: 18px; }
.b-menu { min-width: 200px; padding: 5px; background: var(--b-raise); border: 1px solid var(--b-line-2); border-radius: var(--b-r-panel); box-shadow: 0 18px 50px rgba(0,0,0,.45); display: grid; gap: 1px; }
.b-menu button { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; color: var(--b-ink); font: 500 11px var(--b-mono); letter-spacing: .08em; text-transform: uppercase; text-align: left; cursor: pointer; }
.b-menu button:hover { background: rgba(255,255,255,.06); }
.b-menu button svg { width: 16px; height: 16px; fill: none; stroke: var(--b-mute); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.b-menu button.is-main { color: var(--b-lime); box-shadow: inset 0 0 0 1px var(--b-lime); }
.b-menu button.is-main svg { stroke: var(--b-lime); }
.b-menu button.is-danger { color: var(--b-warn); }
.b-menu hr { border: 0; height: 1px; background: var(--b-line); margin: 4px 6px; }
.b-tip { display: inline-block; padding: 5px 8px; border-radius: 6px; background: var(--b-raise); border: 1px solid var(--b-line-2); color: var(--b-ink); font: 500 10.5px/1.2 var(--b-mono); letter-spacing: .08em; text-transform: uppercase; }
.b-toast { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--b-raise); border: 1px solid var(--b-line-2); color: var(--b-ink); font: 500 11px var(--b-mono); letter-spacing: .06em; text-transform: uppercase; }
.b-toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--b-lime); }
.b-count { font: 500 10.5px var(--b-mono); color: var(--b-lime); font-variant-numeric: tabular-nums; }
.b-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--b-lime); display: inline-block; }

/* ---------- progress ---------- */
.b-bar { height: 2px; border-radius: 2px; background: var(--b-line-2); overflow: hidden; }
.b-bar > i { display: block; height: 100%; width: 0; background: var(--b-lime); transition: width .3s var(--b-ease); }
/* the viewfinder: four corners breathing while something loads */
.b-finder { position: relative; width: 46px; height: 34px; animation: b-finder 1.6s cubic-bezier(.45,0,.2,1) infinite; }
.b-finder i { position: absolute; width: 10px; height: 10px; border: 1.5px solid var(--b-lime); }
.b-finder i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.b-finder i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.b-finder i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.b-finder i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
@keyframes b-finder { 0%, 100% { transform: scale(1); opacity: .5; } 50% { transform: scale(.78); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .b-finder { animation: none; opacity: 1; } .b-chip, .b-tabs button { transition: none; } }
