/* Brand Decks kit: the shared contract.

   Every brand theme sets the same --b- variables. Every app builds its screens from the same b- classes.
   Swap the theme file and the data-brand attribute, and the whole app changes brand.

   How to use in an app:
     <html data-brand="shoddy">            (the value is the theme's id; some themes also take data-stage="…")
     <link rel="stylesheet" href="brand/base.css">
     <link rel="stylesheet" href="brand/shoddy/theme.css">

   Rules for themes:
     - A theme only sets variables and adds rules scoped to [data-brand="<id>"].
     - Never set one --b- variable from another inside a theme (it goes stale when a stage changes
       on an inner element). The components below fall back from one variable to the next instead. */

/* ---------- Neutral defaults: what you get with no brand at all ---------- */
:root {
  /* Colour */
  --b-bg: #ffffff;            /* page background */
  --b-bg-sunk: #f2f2ef;       /* sunken panels, code, wells */
  --b-surface: #ffffff;       /* cards and raised panels */
  --b-text: #1b1b1b;          /* main text */
  --b-text-soft: #444444;     /* standfirsts, summaries */
  --b-text-muted: #6a6a6a;    /* small secondary text (must pass AA on --b-bg) */
  --b-line: #d8d8d4;          /* hairlines between things */
  --b-edge: #8d8d88;          /* borders of controls, link underlines */
  --b-line-strong: #1b1b1b;   /* heavy rules */
  --b-accent: #1f5fbf;        /* the accent */
  --b-on-accent: #ffffff;     /* text on the accent */

  /* Type */
  --b-font-display: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --b-font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --b-font-label: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* --b-font-prose: optional. Long reading (.b-prose) uses it when a brand reads in a different face from its interface. */
  --b-display-weight: 700;
  --b-display-style: normal;
  --b-display-case: none;
  --b-display-tracking: 0;
  --b-body-size: 1rem;
  --b-body-leading: 1.6;
  --b-prose-size: 1.0625rem;
  --b-prose-leading: 1.75;
  --b-h1: clamp(1.9rem, 4.5vw, 2.8rem);
  --b-h2: 1.45rem;
  --b-h3: 1.15rem;
  --b-label-size: .72rem;
  --b-label-weight: 600;
  --b-label-tracking: .08em;
  --b-label-case: uppercase;

  /* Buttons */
  --b-btn-size: .85rem;
  --b-btn-weight: 600;
  --b-btn-tracking: 0;
  --b-btn-case: none;
  --b-btn-pad: .7rem 1.2rem;

  /* Shape */
  --b-radius: 8px;            /* cards, panels, dialogs */
  --b-radius-btn: 6px;
  --b-radius-input: 6px;
  --b-radius-tag: 4px;
  --b-card-border-width: 1px;
  --b-card-pad: 1.5rem;
  --b-shadow: none;           /* cards */
  --b-shadow-btn: none;

  /* Layout */
  --b-measure: 42rem;         /* reading column */
  --b-page: 72rem;            /* widest the page gets */
  --b-gutter: 1rem;
  --b-head-align: left;       /* title blocks */
  --b-s1: .5rem; --b-s2: 1rem; --b-s3: 1.75rem; --b-s4: 3rem; --b-s5: 4.5rem;

  /* Motion */
  --b-speed: .15s;
  --b-ease: ease;
}
@media (min-width: 40rem) { :root { --b-gutter: 2rem; } }

/* ---------- The branded surface ---------- */
[data-brand], [data-brand] [data-stage] { background: var(--b-bg); color: var(--b-text); }
[data-brand] {
  font-family: var(--b-font-body);
  font-size: var(--b-body-size);
  line-height: var(--b-body-leading);
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}
:where(html[data-brand]) body { margin: 0; }
[data-brand], [data-brand] *, [data-brand] *::before, [data-brand] *::after { box-sizing: border-box; }

/* Plain elements. :where() keeps these easy for an app to override. */
:where([data-brand]) :where(h1, h2, h3) {
  font-family: var(--b-font-display);
  font-weight: var(--b-display-weight);
  font-style: var(--b-display-style);
  text-transform: var(--b-display-case);
  letter-spacing: var(--b-display-tracking);
  line-height: 1.25;
  text-wrap: balance;
  margin: 0 0 .6em;
}
:where([data-brand]) h1 { font-size: var(--b-h1); }
:where([data-brand]) h2 { font-size: var(--b-h2); }
:where([data-brand]) h3 { font-size: var(--b-h3); }
:where([data-brand]) p { margin: 0; text-wrap: pretty; }
:where([data-brand]) p + p { margin-top: var(--b-s2); }
:where([data-brand]) a { color: inherit; text-decoration: underline 1px var(--b-edge); text-underline-offset: .2em; }
:where([data-brand]) a:hover { color: var(--b-accent); text-decoration-color: currentColor; }
:where([data-brand]) :focus-visible { outline: 2px solid var(--b-accent); outline-offset: 3px; }
:where([data-brand]) hr { border: 0; border-top: 1px solid var(--b-line); margin: var(--b-s4) 0; }
:where([data-brand]) img { max-width: 100%; height: auto; display: block; }
:where([data-brand]) blockquote {
  margin: var(--b-s3) 0; padding-left: 1.2rem;
  border-left: 2px solid var(--b-accent);
  font-style: italic; color: var(--b-text-soft);
}
:where([data-brand]) :where(button, input, select, textarea) { font: inherit; color: inherit; }

/* ---------- Layout ---------- */
.b-page { max-width: var(--b-page); margin-inline: auto; padding-inline: max(var(--b-gutter), env(safe-area-inset-left)) max(var(--b-gutter), env(safe-area-inset-right)); padding-bottom: env(safe-area-inset-bottom); }
.b-reading { max-width: var(--b-measure); margin-inline: auto; }
.b-stack > * + * { margin-top: var(--b-s3); }
.b-split { display: grid; gap: var(--b-s4); }
@media (min-width: 56rem) { .b-split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }

/* ---------- Voices ---------- */
.b-label {
  font-family: var(--b-font-label);
  font-size: var(--b-label-size);
  font-weight: var(--b-label-weight);
  letter-spacing: var(--b-label-tracking);
  text-transform: var(--b-label-case);
  line-height: 1.5;
  color: var(--b-text-muted);
}
.b-meta { font-family: var(--b-font-label); font-size: .82rem; line-height: 1.6; color: var(--b-text-muted); }
.b-standfirst { font-size: 1.2rem; line-height: 1.75; color: var(--b-text-soft); }
.b-wordmark { font-family: var(--b-font-display); font-size: 1.2rem; font-weight: var(--b-display-weight); text-decoration: none; }

/* A two-line headline inside one h1: a loud line, then a quieter line in the accent */
.b-shout { display: block; }
.b-drama { display: block; font-size: .6em; font-style: italic; font-weight: 400; color: var(--b-accent); margin-top: .3em; }

.b-tag {
  display: inline-block;
  font-family: var(--b-font-label);
  font-size: calc(var(--b-label-size) * .94);
  font-weight: var(--b-label-weight);
  letter-spacing: var(--b-label-tracking);
  text-transform: var(--b-label-case);
  line-height: 1.5;
  white-space: nowrap;
  color: var(--b-tag-text, var(--b-accent));
  background: var(--b-tag-bg, transparent);
  border: 1px solid var(--b-tag-border, currentColor);
  border-radius: var(--b-radius-tag);
  padding: .12rem .5rem;
}

/* A filled tag: for the one thing on the screen that matters most */
.b-tag--fill { background: var(--b-tag-fill, var(--b-accent)); color: var(--b-on-tag-fill, var(--b-on-accent)); border-color: transparent; }

/* ---------- Title block ---------- */
.b-head { text-align: var(--b-head-align); padding-block: var(--b-s4); }
.b-head h1 { margin: .4rem 0 var(--b-s2); }
.b-head .b-standfirst { max-width: 36rem; }

/* ---------- Navigation ---------- */
.b-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 2rem; }
.b-nav a {
  font-family: var(--b-font-label);
  font-size: var(--b-label-size);
  font-weight: var(--b-label-weight);
  letter-spacing: var(--b-label-tracking);
  text-transform: var(--b-label-case);
  text-decoration: none;
  padding: .7rem 0;
}
.b-nav a:hover, .b-nav a[aria-current] { color: var(--b-accent); }

/* ---------- Buttons ---------- */
.b-btn {
  display: inline-block;
  cursor: pointer;
  font-family: var(--b-font-label);
  font-size: var(--b-btn-size);
  font-weight: var(--b-btn-weight);
  letter-spacing: var(--b-btn-tracking);
  text-transform: var(--b-btn-case);
  line-height: 1.4;
  text-decoration: none;
  padding: var(--b-btn-pad);
  background: var(--b-btn-bg, var(--b-text));
  color: var(--b-btn-text, var(--b-bg));
  border: 1px solid var(--b-btn-border, var(--b-btn-bg, var(--b-text)));
  border-radius: var(--b-radius-btn);
  box-shadow: var(--b-shadow-btn);
  transition: background var(--b-speed) var(--b-ease), color var(--b-speed) var(--b-ease), border-color var(--b-speed) var(--b-ease), transform var(--b-speed) var(--b-ease);
}
.b-btn:hover {
  background: var(--b-btn-hover-bg, var(--b-accent));
  border-color: var(--b-btn-hover-bg, var(--b-accent));
  color: var(--b-btn-hover-text, var(--b-on-accent));
}
.b-btn--plain { background: transparent; color: var(--b-text); border-color: var(--b-edge); box-shadow: none; }
.b-btn--plain:hover { background: transparent; color: var(--b-accent); border-color: currentColor; }
.b-buttons { display: flex; flex-wrap: wrap; gap: var(--b-s2); }

/* ---------- Cards and panels ---------- */
.b-card {
  background: var(--b-surface);
  border: var(--b-card-border-width) solid var(--b-card-border-color, var(--b-line));
  border-radius: var(--b-radius);
  box-shadow: var(--b-shadow);
  padding: var(--b-card-pad);
}
.b-well { background: var(--b-bg-sunk); border-radius: var(--b-radius); padding: var(--b-s3); }

/* ---------- Forms ---------- */
.b-field { display: block; }
.b-field + .b-field { margin-top: var(--b-s3); }
.b-field > label, .b-field > .b-field-name { display: block; font-weight: 700; }
.b-input {
  display: block; width: 100%;
  margin-top: .5rem; padding: .7rem .9rem;
  background: var(--b-input-bg, var(--b-bg));
  color: var(--b-text);
  border: 1px solid var(--b-edge);
  border-radius: var(--b-radius-input);
  font-family: var(--b-font-body); font-size: 1rem; line-height: 1.6;
}
textarea.b-input { min-height: 6rem; resize: vertical; }
.b-input::placeholder { color: var(--b-text-muted); opacity: 1; }

/* ---------- Lists of entries (ruled, not boxed) ---------- */
.b-list { list-style: none; margin: 0; padding: 0; }
.b-list > li { padding: var(--b-s3) 0; border-top: 1px solid var(--b-line); }
.b-list > li:first-child { border-top: 0; padding-top: 0; }
.b-entry-title { font-family: var(--b-font-display); font-weight: var(--b-display-weight); font-style: var(--b-display-style); font-size: 1.25rem; line-height: 1.4; margin: .5rem 0; }
.b-entry-title a { text-decoration: none; }
.b-entry-title a:hover { text-decoration: underline; }
.b-entry-summary { color: var(--b-text-soft); }

/* ---------- Name and value rows ---------- */
.b-rows { margin: 0; border-top: 1px solid var(--b-line); }
.b-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--b-s2); padding: .9rem 0; border-bottom: 1px solid var(--b-line); }
.b-rows dt { font-family: var(--b-font-label); font-size: var(--b-label-size); font-weight: var(--b-label-weight); letter-spacing: var(--b-label-tracking); text-transform: var(--b-label-case); color: var(--b-text-muted); }
.b-rows dd { margin: 0; text-align: right; }

/* ---------- Long reading ---------- */
.b-prose { font-family: var(--b-font-prose, var(--b-font-body)); font-size: var(--b-prose-size); line-height: var(--b-prose-leading); max-width: var(--b-measure); }
.b-prose > * + * { margin-top: 1.4em; }
.b-prose h2 { margin-top: 2.2em; }
.b-prose ul, .b-prose ol { padding-left: 1.3rem; }
.b-prose li + li { margin-top: .3em; }

/* ---------- Footer ---------- */
.b-foot { border-top: 1px solid var(--b-line-strong); padding: var(--b-s4) var(--b-gutter); text-align: center; color: var(--b-text-muted); }

@media (prefers-reduced-motion: reduce) {
  [data-brand] *, [data-brand] *::before, [data-brand] *::after { animation: none !important; transition: none !important; }
}

/* ---------- Map and game parts (used by the 16-Bit brands; plain in the others) ---------- */
/* A pin on a map or in a room: an icon cap with a small name under it */
.b-pin { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; background: none; border: 0; cursor: pointer; }
.b-pin-cap { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; background: var(--b-accent); color: var(--b-on-accent); border-radius: var(--b-radius-btn); }
.b-pin-cap svg { width: 1.1rem; height: 1.1rem; }
.b-pin-label { padding: 3px 8px; border-radius: 999px; background: var(--b-text); color: var(--b-bg); font-family: var(--b-font-label); font-size: .6rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; line-height: 1.2; white-space: nowrap; }

/* A speech bubble: who is speaking in <strong>, then what they say */
.b-bubble { position: relative; display: inline-block; max-width: 16rem; padding: .6rem .8rem; background: var(--b-surface); color: var(--b-text); border: 1px solid var(--b-line); border-radius: var(--b-radius); }
.b-bubble strong { display: block; margin-bottom: 2px; font-family: var(--b-font-label); font-size: var(--b-label-size); letter-spacing: var(--b-label-tracking); text-transform: var(--b-label-case); color: var(--b-accent); }

/* Pixel art keeps its hard edges when scaled */
.b-pixel { image-rendering: pixelated; image-rendering: crisp-edges; }

/* =====================================================================================
   App parts: for working screens (tools, dashboards, back-office). Added after the first
   re-skin test (Hooga reviews app, 1 December 2026), which had to write all of these by hand.
   ===================================================================================== */

/* ---------- Status: good, warning, bad ---------- */
/* Status colours are for facts about data (a score, a result, an overdue job). Never decoration.
   A brand that sets none falls back to the plain ones below. Always pair the colour with a word or a symbol. */
:root { --b-good: #2e7d4f; --b-warn: #a86200; --b-bad: #b3261e; }
.b-tag--good { --b-tag-text: var(--b-good); --b-tag-border: currentColor; }
.b-tag--warn { --b-tag-text: var(--b-warn); --b-tag-border: currentColor; }
.b-tag--bad  { --b-tag-text: var(--b-bad);  --b-tag-border: currentColor; }
.b-tag--quiet { --b-tag-text: var(--b-text-muted); --b-tag-border: var(--b-line); }
.b-good { color: var(--b-good); } .b-warn { color: var(--b-warn); } .b-bad { color: var(--b-bad); }

/* ---------- Numbers ---------- */
.b-num { font-variant-numeric: tabular-nums; }

/* A stat: a small name over a big number. Put several in .b-stats. */
.b-stats { display: flex; flex-wrap: wrap; gap: var(--b-s2) var(--b-s4); margin: 0; padding: 0; list-style: none; }
.b-stat { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.b-stat-value { font-family: var(--b-font-stat, var(--b-font-display)); font-size: var(--b-h2); font-weight: var(--b-stat-weight, var(--b-display-weight)); line-height: 1.15; font-variant-numeric: tabular-nums; }

/* A rating in stars: write the stars as text (★★★★☆) and give the number beside it for screen readers */
.b-stars { color: var(--b-accent); letter-spacing: .1em; white-space: nowrap; }

/* ---------- Tabs: switch between views of one screen ---------- */
/* On a phone the row scrolls sideways; from tablet width it wraps. Mark the current one with aria-current="page" or aria-selected="true". */
.b-tabs { display: flex; gap: var(--b-s1); overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--b-gutter) * -1); padding: var(--b-s1) var(--b-gutter); }
.b-tabs::-webkit-scrollbar { display: none; }
@media (min-width: 48rem) { .b-tabs { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; } }
.b-tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: var(--b-s1);
  min-height: 2.5rem; padding: var(--b-s1) var(--b-s2);
  background: transparent; cursor: pointer; text-decoration: none;
  border: 1px solid var(--b-line); border-radius: var(--b-radius-tab, var(--b-radius-btn));
  font-family: var(--b-font-label); font-size: var(--b-label-size); font-weight: var(--b-label-weight);
  letter-spacing: var(--b-label-tracking); text-transform: var(--b-label-case); line-height: 1.5;
  color: var(--b-text-muted);
  transition: color var(--b-speed) var(--b-ease), border-color var(--b-speed) var(--b-ease), background var(--b-speed) var(--b-ease);
}
.b-tab[aria-current], .b-tab[aria-selected="true"] { color: var(--b-tab-on-text, var(--b-accent)); border-color: var(--b-tab-on-border, var(--b-edge)); background: var(--b-tab-on-bg, transparent); }
@media (hover: hover) { .b-tab:hover { color: var(--b-text); } .b-tab[aria-current]:hover, .b-tab[aria-selected="true"]:hover { color: var(--b-tab-on-text, var(--b-accent)); } }
/* A small count inside a tab or beside a title */
.b-count { letter-spacing: .03em; text-transform: none; font-variant-numeric: tabular-nums; opacity: .85; }

/* ---------- A tick box, and a list of things to tick ---------- */
/* <ul class="b-list b-ticklist"><li class="is-done"><button class="b-tick" aria-pressed="true">✓</button><div>…</div></li></ul> */
.b-tick {
  flex: 0 0 auto; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; padding: 0; cursor: pointer;
  background: transparent; color: transparent; border: 1px solid var(--b-edge); border-radius: var(--b-radius-tick, var(--b-radius-tag));
  font-size: .9rem; line-height: 1; transition: background var(--b-speed) var(--b-ease), border-color var(--b-speed) var(--b-ease);
}
.b-tick svg { width: .9rem; height: .9rem; }
.b-tick[aria-pressed="true"], .is-done > .b-tick { background: var(--b-accent); border-color: var(--b-accent); color: var(--b-on-accent); }
.b-ticklist > li { display: flex; gap: var(--b-s2); align-items: flex-start; }
.b-ticklist > li > :not(.b-tick) { flex: 1; min-width: 0; }
.b-ticklist > li.is-done :where(h3, h4, .b-entry-title) { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--b-text-muted); }

/* ---------- Smaller and inline controls ---------- */
.b-btn--small { display: inline-flex; align-items: center; gap: .4em; padding: var(--b-s1) var(--b-s2); min-height: 2.5rem; }
/* A box with its button on the same line. The button drops underneath when there isn't room. */
.b-inline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--b-s1); }
.b-inline > .b-input { margin-top: 0; flex: 1 1 13rem; min-width: 0; width: auto; }

/* ---------- A card with a photo on top ---------- */
/* <article class="b-card b-card--photo"><div class="b-card-photo"><img …><span class="b-tag">4.8 ★</span></div><div class="b-card-body">…</div></article> */
.b-card--photo { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.b-card-photo { position: relative; aspect-ratio: var(--b-photo-ratio, 4 / 5); }
.b-card-photo > img, .b-card-photo > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.b-card-photo > .b-tag { position: absolute; top: var(--b-s2); right: var(--b-s2); }
.b-card-body { flex: 1; display: flex; flex-direction: column; gap: var(--b-s1); padding: var(--b-s3) var(--b-card-pad, 1.5rem) var(--b-card-pad, 1.5rem); }
.b-card-body > :where(h2, h3) { margin: 0; }

/* ---------- Code to copy ---------- */
.b-code { display: block; margin: 0; padding: var(--b-s2); max-height: 12rem; overflow: auto; background: var(--b-bg-sunk); border-radius: var(--b-radius-input); font: .8rem/1.6 ui-monospace, Consolas, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Fit ---------- */
/* Two equal columns, for when neither side is the main one */
@media (min-width: 56rem) { .b-split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .b-split--flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
/* A well or a card inside a card gets less padding, so words keep their room on a phone */
.b-card .b-well, .b-card .b-card:not(.b-card--photo) { padding: var(--b-s2); }
/* The logo in a header */
.b-logo { height: var(--b-logo-height, 3rem); width: auto; }

/* ---------- Added after the second Hooga pass (reviews app): the last parts it wrote by hand ---------- */
/* An inline icon (lucide or similar, drawn in currentColor) sized to the words beside it */
.b-icon { width: 1.1em; height: 1.1em; flex: 0 0 auto; vertical-align: -.2em; }
.b-tick .b-icon { width: .9rem; height: .9rem; vertical-align: 0; }

/* A ruled footer along the bottom of a card: a count on one side, a "go" link on the other */
.b-card-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--b-s1) var(--b-s2);
  margin-top: auto; padding-top: var(--b-s2); border-top: 1px solid var(--b-line);
}
.b-card-foot > .b-label { display: inline-flex; align-items: center; gap: var(--b-s1); }

/* A wide photo at the top of a screen: tall on a phone, letterbox on a desk */
.b-photo--hero { position: relative; width: 100%; aspect-ratio: 4 / 5; max-height: 34rem; }
@media (min-width: 40rem) { .b-photo--hero { aspect-ratio: 21 / 9; } }

/* Tags laid across the top of a photo (a rating, a count). The theme's tag background is the soft patch behind them. */
.b-photo-tags { position: absolute; z-index: 1; top: var(--b-s2); left: var(--b-s2); right: var(--b-s2); display: flex; flex-wrap: wrap; gap: var(--b-s1); }

/* The hidden attribute always wins, whatever display a part sets */
[hidden] { display: none !important; }
