/* Media Junkbox Tracker: the MediaJunkbox design system in plain CSS.
 * Tokens come from the MediaJunkbox Design System bundle (tokens/*.css). Where a brand colour fails WCAG 2.2 AA
 * contrast on a light surface it stays decoration only, and an accessible variant (marked a11y) carries text.
 * The old HeroUI names further down are aliases, so every screen keeps working.
 * No inline styles anywhere: the content security policy forbids them.
 */

/* Gabarito (display) and Inter (body), self-hosted. SIL Open Font License, see static/fonts/README.md. */
@font-face { font-family: "Gabarito"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("../fonts/gabarito-latin.61a712c463a9.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Gabarito"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("../fonts/gabarito-latin-ext.3373cce1b0db.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/inter-latin.260c81a4759b.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/inter-latin-ext.1ad231aac0a8.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* ---- Brand gold: a fill, with dark ink on top. Gold on white is 1.53:1, so never text or a line on light. ---- */
  --mjb-gold: #f8cd02;          /* ink on it 11.37:1; on the dark frame 12.94:1 */
  --mjb-gold-dark: #d4af02;     /* hover / pressed fill; ink on it 8.23:1 */
  --gold-ink: #7a6200;          /* a11y: gold for text and links on light, 5.87:1 white, 5.39:1 page */
  --gold-ink-strong: #5c4a00;   /* a11y: text on gold tints, 7.67:1 on gold-100 */
  --gold-50: #fffbe6;           /* tints: selected rows, info banners */
  --gold-100: #fef3b0;
  --border-gold: rgba(248, 205, 2, 0.3);

  /* ---- Surfaces ---- */
  --mediajb-bg: #f5f5f5;        /* page */
  --metaljb-bg: #0a0a0a;
  --content-bg: #ffffff;        /* cards, always light */
  --header-bg: #0a0a0a;         /* the frame: sidebar, phone bars (always dark) */
  --surface-elevated: #18181b;  /* frame hover / active */
  --surface-sunken: #27272a;
  --surface-sunken-light: #f4f4f5;

  /* ---- Ink ---- */
  --text-dark: #1a1a1a;         /* 17.40:1 white, 15.96:1 page */
  --text-light: #e5e5e5;        /* on the frame, 15.72:1 */
  --text-muted: #5c6370;        /* a11y: the DS #6b7280 is 4.43:1 on the page; this is 5.54:1 (6.05:1 white) */
  --text-faint: #646b77;        /* a11y: placeholders, "none"; 4.92:1 page, 5.37:1 white */
  --text-muted-dark: #a1a1aa;   /* on the frame, 7.72:1 */

  /* ---- Lines ---- */
  --border-light: #e5e7eb;      /* decorative hairlines only, never the edge of a control */
  --border-dark: #27272a;
  --border-control: #71717a;    /* a11y: inputs, checkboxes, switches, outline buttons; 4.83:1 white */
  --focus: #1a1a1a;             /* focus ring on light surfaces */
  --focus-on-dark: #f8cd02;     /* focus ring on the frame */

  /* ---- Rating scale (0-10 scores) ---- */
  --rating-excellent: #10b981; --rating-great: #22c55e; --rating-good: #eab308;
  --rating-average: #f59e0b; --rating-poor: #ef4444; --rating-bad: #dc2626;

  /* ---- Status pairs (text on fill, all at least 6:1). Info and violet are derived: the DS has no blue or purple. ---- */
  --status-success-bg: #d1fae5; --status-success-fg: #065f46;
  --status-warning-bg: #fef3c7; --status-warning-fg: #854d0e;
  --status-danger-bg: #fee2e2;  --status-danger-fg: #991b1b;
  --status-info-bg: #dbeafe;    --status-info-fg: #1e40af;
  --status-violet-bg: #ede9fe;  --status-violet-fg: #5b21b6;
  --status-orange-bg: #ffedd5;  --status-orange-fg: #9a3412;

  /* ---- Semantic aliases ---- */
  --color-accent: var(--mjb-gold);
  --color-accent-hover: var(--mjb-gold-dark);
  --color-page: var(--mediajb-bg);
  --color-surface: var(--content-bg);
  --color-text: var(--text-dark);
  --color-text-secondary: var(--text-muted);
  --color-border: var(--border-light);
  --color-on-accent: #1a1a1a;

  /* ---- Type ---- */
  --font-display: "Gabarito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", Times, serif;
  --font-mono: Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
  --text-xs: 0.75rem; --text-sm: 0.875rem; --text-base: 1rem; --text-lg: 1.125rem;
  --text-xl: 1.25rem; --text-2xl: 1.5rem; --text-3xl: 1.875rem;
  --tracking-tight: -0.02em; --tracking-wide: 0.05em; --tracking-button: 0.06em; --tracking-wider: 0.12em;

  /* ---- Spacing (4px base) and layout ---- */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem; --space-16: 4rem; --space-20: 5rem;
  --touch-target: 44px;

  /* ---- Corners: the brand is sharp. Pills only for badges, chips, avatars, switches, icon buttons. ---- */
  --radius-none: 0;
  --radius-pill: 9999px;

  /* ---- Signature parallelogram, drawn as a skewed background layer (keeps focus rings unclipped) ---- */
  --skew-parallelogram: -12deg;
  --skew-parallelogram-full: -4deg;

  /* ---- Depth ---- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.25);
  --shadow-nav: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-gold-lift: 0 6px 20px rgba(248, 205, 2, 0.35);
  --shadow-gold-press: 0 2px 8px rgba(248, 205, 2, 0.25);
  --glow-gold: 0 0 0 4px rgba(248, 205, 2, 0.55);

  /* ---- Motion ---- */
  --dur-fast: 200ms; --dur-medium: 300ms; --dur-slow: 400ms;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  /* ---- Old HeroUI names, kept as aliases so templates and mobile.css keep working ---- */
  --background: var(--color-surface);
  --foreground: var(--text-dark);
  --divider: var(--border-light);
  --content1: var(--color-surface);
  --default-50: var(--color-page); --default-100: var(--surface-sunken-light); --default-200: #e4e4e7;
  --default-300: #a1a1aa; --default-400: var(--text-faint); --default-500: var(--text-muted);
  --default-600: #52525b; --default-700: #3f3f46; --default-800: #27272a; --default-900: #18181b;
  --primary-50: var(--gold-50); --primary-100: var(--gold-100); --primary-500: var(--mjb-gold);
  --primary-600: var(--gold-ink); --primary-700: var(--gold-ink-strong); --primary-800: #3d3100;
  --secondary-50: var(--status-violet-bg); --secondary-600: var(--status-violet-fg);
  --success-50: var(--status-success-bg); --success-500: var(--rating-excellent); --success-700: var(--status-success-fg);
  --warning-50: #fffbeb; --warning-100: var(--status-warning-bg); --warning-500: var(--rating-average);
  --warning-700: var(--status-warning-fg); --warning-800: #713f12;
  --danger-50: var(--status-danger-bg); --danger-300: #fca5a5; --danger-500: var(--rating-bad); --danger-600: #b91c1c;
  --radius-sm: var(--radius-none); --radius-md: var(--radius-none); --radius-lg: var(--radius-none);
  --shadow-small: 0 0 0 1px var(--border-light), var(--shadow-sm);
  --shadow-medium: 0 0 0 1px var(--border-light), var(--shadow-md);
  --shadow-large: var(--shadow-xl);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-sans); font-size: 14px; line-height: 20px; color: var(--foreground);
  background: var(--color-page); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* Links in running text carry an underline, so they never rely on colour alone. Component links (they all have a class) don't. */
a { color: var(--gold-ink); text-decoration: none; }
a:hover { color: var(--text-dark); text-decoration: underline; text-decoration-color: var(--mjb-gold); }
a:not([class]) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:not([class]):hover { text-decoration-thickness: 2px; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
code, .mono { font-family: var(--font-mono); font-size: 12px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* The dark frame (sidebar, phone bars, bulk bar) uses a gold ring instead. */
.sidebar, .mobile-bar, .bottom-nav, .dark-bar { --focus: var(--focus-on-dark); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--header-bg); color: var(--text-light); border-right: 1px solid var(--border-dark);
  display: flex; flex-direction: column; padding: 20px 12px; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  scrollbar-color: var(--surface-sunken) transparent;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 14px; color: var(--foreground); }
.brand:hover { text-decoration: none; color: var(--foreground); }
.brand__mark {
  width: 32px; height: 32px; border-radius: 0; background: var(--header-bg); color: var(--mjb-gold);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; font-size: 13px; flex-shrink: 0;
}
/* Media Junkbox wordmark. The artwork is black; on the dark frame it is inverted to white. */
.brand--logo { padding: 4px 12px 18px; }
.mobile-bar .brand--logo { padding: 0; }
.logo-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.logo-tile img { display: block; height: auto; width: 148px; }
.sidebar .logo-tile img, .mobile-bar .logo-tile img, .logo-band .logo-tile img { filter: invert(1); }
.logo-tile__sub { font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: var(--tracking-wider); text-transform: uppercase; color: var(--gold-ink); }
.sidebar .logo-tile__sub, .logo-band .logo-tile__sub { color: var(--mjb-gold); }
.logo-tile--sm img { width: 104px; }
.logo-tile--lg img { width: 200px; }
.brand__mark--lg { width: 36px; height: 36px; font-size: 14px; }
.brand__text { display: flex; flex-direction: column; }
.brand__name { font-size: 14px; font-weight: 600; line-height: 18px; }
.brand__sub { font-size: 12px; color: var(--default-500); line-height: 16px; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between; padding: 6px 12px 6px 9px; border-radius: 0;
  border-left: 3px solid transparent; font-size: 14px; color: var(--default-600); min-height: 32px;
  transition: background-color var(--dur-fast) var(--ease-smooth), color var(--dur-fast) var(--ease-smooth);
}
.nav-item:hover { background: var(--default-100); color: var(--foreground); text-decoration: none; }
.nav-item.is-active { background: var(--default-100); color: var(--foreground); font-weight: 600; border-left-color: var(--mjb-gold); }
.sidebar .nav-item { color: var(--text-muted-dark); }
.sidebar .nav-item:hover { background: var(--surface-elevated); color: #fff; }
.sidebar .nav-item.is-active { background: var(--surface-elevated); color: #fff; }
.nav-item__main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-icon { flex-shrink: 0; opacity: .85; }
.nav-item.is-active .nav-icon { opacity: 1; color: var(--mjb-gold); }
.sidebar__toggle {
  align-self: flex-end; background: none; border: 2px solid transparent; width: 28px; height: 28px; padding: 0; margin-bottom: 4px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted-dark); border-radius: var(--radius-pill);
}
.sidebar__toggle:hover { color: var(--color-on-accent); background: var(--mjb-gold); }
.nav-badge { font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: var(--radius-pill); background: var(--mjb-gold); color: var(--color-on-accent); line-height: 20px; min-width: 20px; text-align: center; }
.nav-badge--danger { background: var(--rating-poor); color: var(--color-on-accent); }
.nav-section { font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: var(--tracking-wider); text-transform: uppercase; color: var(--default-500); padding: 14px 12px 4px; }
.sidebar .nav-section { color: var(--text-muted-dark); }
.sidebar__spacer { flex: 1; }
.sidebar__user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--divider); }
.sidebar .sidebar__user { border-top-color: var(--border-dark); }
.sidebar__user-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sidebar__user-text:hover { text-decoration: none; }
.sidebar__user-name { font-size: 14px; font-weight: 500; line-height: 18px; color: var(--foreground); }
.sidebar__user-role { font-size: 12px; color: var(--default-500); line-height: 16px; }
.sidebar .sidebar__user-name { color: #fff; }
.sidebar .sidebar__user-role { color: var(--text-muted-dark); }
.avatar {
  width: 32px; height: 32px; border-radius: var(--radius-pill); background: var(--mjb-gold); color: var(--color-on-accent);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 12px; font-weight: 800; flex-shrink: 0;
}
a.avatar:hover { text-decoration: none; color: var(--color-on-accent); background: var(--mjb-gold-dark); }
.avatar--sm { width: 28px; height: 28px; font-size: 11px; background: var(--default-100); color: var(--default-700); }
/* IconButton: round, 32px on desktop (44px on phones, mobile.css). */
.icon-btn {
  background: none; border: 2px solid transparent; width: 32px; height: 32px; padding: 0; border-radius: var(--radius-pill); cursor: pointer;
  color: var(--default-500); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background-color var(--dur-fast) var(--ease-smooth), color var(--dur-fast) var(--ease-smooth);
}
.icon-btn:hover { background: var(--mjb-gold); color: var(--color-on-accent); }
.sidebar .icon-btn { color: var(--text-muted-dark); border-color: var(--border-gold); }
.sidebar .icon-btn:hover { color: var(--color-on-accent); border-color: var(--mjb-gold); }

/* Collapsed sidebar (desktop only): icons with their counters; labels show as tooltips. */
@media (min-width: 769px) {
  .sidebar-collapsed .sidebar { width: 64px; padding-left: 8px; padding-right: 8px; align-items: stretch; }
  .sidebar-collapsed .sidebar__toggle { align-self: center; }
  .sidebar-collapsed .sidebar__toggle svg { transform: scaleX(-1); }
  .sidebar-collapsed .brand--logo, .sidebar-collapsed .nav-label, .sidebar-collapsed .sidebar__user-text,
  .sidebar-collapsed .sidebar__user form { display: none; }
  .sidebar-collapsed .nav-section { font-size: 0; padding: 8px 0 2px; border-top: 1px solid var(--border-dark); margin-top: 6px; }
  .sidebar-collapsed .nav-item { position: relative; justify-content: center; padding: 6px 0; border-left-width: 0; box-shadow: inset 3px 0 0 transparent; }
  .sidebar-collapsed .nav-item.is-active { box-shadow: inset 3px 0 0 var(--mjb-gold); }
  .sidebar-collapsed .nav-badge { position: absolute; top: 0; right: 0; font-size: 10px; line-height: 16px; min-width: 16px; padding: 0 4px; }
  .sidebar-collapsed .sidebar__user { justify-content: center; padding: 12px 0 0; }
}

.page { flex: 1; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.page--narrow { max-width: 1100px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
/* Page titles: Gabarito uppercase with the section header's gold bar. */
.page-title {
  font-family: var(--font-display); font-size: 26px; line-height: 30px; font-weight: 800; letter-spacing: -0.01em; text-transform: uppercase;
  position: relative; padding-left: 15px; text-wrap: balance;
}
.page-title::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 5px; background: var(--mjb-gold); }
.page-sub { margin-top: 6px; font-size: 14px; color: var(--default-500); max-width: 900px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack--sm { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stack.stack--sm { gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.split--wide-side { grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; }
.muted { color: var(--default-500); }
.soft { color: var(--default-600); }
.faint { color: var(--default-400); }
.strong { font-weight: 600; }
.medium { font-weight: 500; }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.right { text-align: right; justify-self: end; margin-left: auto; }
.mt-8 { margin-top: 8px; }
.flex-1 { flex: 1; }
.table-title { padding: 8px 12px 10px; font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: var(--tracking-button); text-transform: uppercase; }
.mt-16 { margin-top: 16px; }

/* ---------- Cards: flat white rectangles with a hairline ---------- */
.card { background: var(--content1); border-radius: 0; box-shadow: var(--shadow-small); }
.card--pad { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card--pad-lg { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.card--table { padding: 0; overflow-x: auto; }
.card__head { padding: 14px 18px; border-bottom: 1px solid var(--divider); display: flex; align-items: center; gap: 14px; }
.card__title { font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: var(--tracking-button); text-transform: uppercase; }
.card__foot { padding: 12px 18px; border-top: 1px solid var(--divider); display: flex; gap: 16px; font-size: 13px; flex-wrap: wrap; }
.card--dashed { border: 1px dashed var(--border-control); border-radius: 0; padding: 16px; display: flex; flex-direction: column; gap: 8px; font-size: 12px; line-height: 17px; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat__label { font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--default-500); }
.stat__value { font-family: var(--font-display); font-size: 28px; line-height: 32px; font-weight: 800; letter-spacing: var(--tracking-tight); font-variant-numeric: tabular-nums; }
.dl { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 12px; font-size: 13px; }
.dl dt { color: var(--default-500); }
.dl dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Tables: dark header band, gold-tinted row hover ---------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th {
  text-align: left; font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-light); background: var(--text-dark); padding: 10px 12px; vertical-align: bottom;
}
.tbl th:first-child, .tbl th:last-child { border-radius: 0; }
.tbl th a { color: inherit; text-decoration: none; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--gold-50); }
.tbl tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--mjb-gold); }
.tbl td.actions { text-align: right; white-space: nowrap; }
.tbl .cell-strong { font-weight: 600; }
.tbl--compact td { padding: 10px 12px; }
.empty { padding: 32px 16px; text-align: center; color: var(--default-500); font-size: 14px; }

/* ---------- Badges (status pills, each keeps its text), tags, chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; line-height: 20px; padding: 0 8px; border-radius: var(--radius-pill); white-space: nowrap; width: max-content; max-width: 100%; }
.badge[class*="st-"]::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-pill); background: currentColor; flex-shrink: 0; }
/* Small labels ("Direct") read as the design system's Tag: Gabarito uppercase. */
.badge--xs { font-family: var(--font-display); font-size: 10px; line-height: 18px; padding: 0 7px; font-weight: 700; letter-spacing: var(--tracking-wide); text-transform: uppercase; }
.badge--xs[class*="st-"]::before { content: none; }
.st-warning { background: var(--status-warning-bg); color: var(--status-warning-fg); }
.st-default { background: var(--default-100); color: var(--default-700); }
.st-muted { background: var(--default-100); color: var(--default-600); }
.st-primary { background: var(--status-info-bg); color: var(--status-info-fg); }
.st-secondary { background: var(--status-violet-bg); color: var(--status-violet-fg); }
.st-success { background: var(--status-success-bg); color: var(--status-success-fg); }
.st-danger { background: var(--status-danger-bg); color: var(--status-danger-fg); }
.st-yellow { background: var(--gold-100); color: var(--gold-ink-strong); }
.st-orange { background: var(--status-orange-bg); color: var(--status-orange-fg); }
/* Tag: the design system's Gabarito uppercase label. */
.tag { display: inline-flex; align-items: center; font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: var(--tracking-button);
  text-transform: uppercase; line-height: 1; padding: 5px 9px; white-space: nowrap; background: var(--mjb-gold); color: var(--color-on-accent); }
.tag--solid { background: var(--text-dark); color: var(--mjb-gold); }
.tag--outline { background: transparent; color: var(--text-dark); box-shadow: inset 0 0 0 1px var(--border-control); }
a.tag:hover { text-decoration: none; color: var(--color-on-accent); background: var(--mjb-gold-dark); }
.chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip {
  font-size: 12px; font-weight: 600; line-height: 28px; padding: 0 12px; border-radius: var(--radius-pill); background: var(--content1);
  box-shadow: inset 0 0 0 1px var(--border-control); color: var(--foreground); white-space: nowrap; border: 0; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-smooth), box-shadow var(--dur-fast) var(--ease-smooth);
}
.chip:hover { text-decoration: none; color: var(--foreground); box-shadow: inset 0 0 0 1.5px var(--text-dark); }
.chip.is-active, .chip.is-active:hover { background: var(--text-dark); color: var(--mjb-gold); box-shadow: none; }
.chip--square { border-radius: 0; line-height: 36px; }
.me-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 3px 2px 10px; border-radius: var(--radius-pill);
  background: var(--gold-100); color: var(--text-dark); font-weight: 600; white-space: nowrap; border: 0; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--mjb-gold-dark);
}
.me-pill:hover { background: var(--mjb-gold); }
.me-pill__x {
  width: 18px; height: 18px; border-radius: var(--radius-pill); background: var(--text-dark); color: var(--mjb-gold);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1;
}
.add-pill {
  padding: 2px 10px; border-radius: var(--radius-pill); border: 1px dashed var(--border-control); color: var(--text-dark);
  font-size: 12px; white-space: nowrap; background: none; cursor: pointer; line-height: 18px; min-height: 24px;
}
.add-pill:hover { border-style: solid; border-color: var(--text-dark); background: var(--gold-50); }
.add-pill--stretch { color: var(--status-warning-fg); border-color: var(--status-warning-fg); }
.who-open { color: var(--gold-ink); font-weight: 500; }
.who-none { color: var(--default-400); }

/* ---------- Buttons ----------
 * Gabarito uppercase, sharp. Primary (gold) and dark are the design system's parallelogram, drawn by a skewed ::before
 * layer kept inside the box, so outlines and hit areas stay rectangular and nothing is clipped. */
.btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px;
  border-radius: 0; border: 0; box-shadow: inset 0 0 0 1px var(--border-control); cursor: pointer; white-space: nowrap;
  font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: var(--tracking-button); text-transform: uppercase; line-height: 1;
  background: var(--content1); color: var(--text-dark); text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-smooth), color var(--dur-fast) var(--ease-smooth),
    box-shadow var(--dur-medium) var(--ease-smooth), transform var(--dur-medium) var(--ease-spring);
}
.btn:hover { text-decoration: none; color: var(--text-dark); background: var(--default-100); box-shadow: inset 0 0 0 1.5px var(--text-dark); }
.btn:focus-visible { outline-offset: 3px; }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; }
.btn--primary, .btn--dark { background: transparent; box-shadow: none; padding: 0 22px; }
.btn--primary::before, .btn--dark::before {
  content: ""; position: absolute; inset: 0 5px; z-index: -1; transform: skewX(var(--skew-parallelogram));
  background: var(--mjb-gold); transition: background-color var(--dur-fast) var(--ease-smooth), box-shadow var(--dur-medium) var(--ease-smooth);
}
.btn--primary, .btn--primary:hover { color: var(--color-on-accent); background: transparent; box-shadow: none; }
.btn--primary:hover { transform: translateY(-2px); }
.btn--primary:hover::before { background: var(--mjb-gold-dark); box-shadow: var(--shadow-gold-lift); }
.btn--primary:active { transform: translateY(0); }
.btn--primary:active::before { box-shadow: var(--shadow-gold-press); }
.btn--primary:focus-visible::before { box-shadow: var(--glow-gold); }
.btn--dark::before { background: var(--text-dark); }
.btn--dark, .btn--dark:hover { color: #fff; background: transparent; box-shadow: none; }
.btn--dark:hover { color: var(--mjb-gold); transform: translateY(-2px); }
.btn--dark:hover::before { background: #2a2a2a; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
.btn--block.btn--primary::before, .btn--block.btn--dark::before { transform: skewX(var(--skew-parallelogram-full)); inset: 0 2px; }
.btn--success, .btn--success:hover { background: var(--rating-excellent); color: var(--color-on-accent); box-shadow: inset 0 0 0 1px #047857; }
.btn--success:hover { background: #0ea371; }
.btn--warning, .btn--warning:hover { background: var(--rating-average); color: var(--color-on-accent); box-shadow: none; }
.btn--danger, .btn--danger:hover { background: var(--content1); color: var(--danger-600); box-shadow: inset 0 0 0 1px var(--danger-600); }
.btn--danger:hover { background: var(--danger-50); box-shadow: inset 0 0 0 1.5px var(--danger-600); }
.btn--light, .btn--light:hover { background: #fff; color: var(--text-dark); box-shadow: none; }
.btn--light:hover { background: var(--mjb-gold); }
.btn--ghost, .btn--ghost:hover { background: transparent; color: var(--text-dark); box-shadow: none;
  text-decoration: underline; text-decoration-color: var(--mjb-gold-dark); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.btn--ghost:hover { text-decoration-color: var(--text-dark); }
.btn--outline, .btn--outline:hover { background: transparent; color: var(--foreground); }
.btn--locked, .btn--locked:hover, .btn:disabled, .btn:disabled:hover {
  background: var(--default-100); color: var(--text-faint); box-shadow: inset 0 0 0 1px var(--default-200); cursor: not-allowed; transform: none; }
.btn--primary:disabled::before, .btn--dark:disabled::before { background: var(--default-200); box-shadow: none; }
.btn--primary:disabled, .btn--dark:disabled { background: transparent; box-shadow: none; }
.btn--md { height: 36px; padding: 0 14px; font-size: 12px; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn--xs { height: 28px; padding: 0 10px; font-size: 11px; }
.btn--primary.btn--md, .btn--dark.btn--md, .btn--primary.btn--sm, .btn--dark.btn--sm { padding: 0 18px; }
.btn--primary.btn--xs, .btn--dark.btn--xs { padding: 0 14px; }
.btn--sm.btn--primary::before, .btn--sm.btn--dark::before, .btn--xs.btn--primary::before, .btn--xs.btn--dark::before { inset: 0 4px; }
.btn--block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold-ink); cursor: pointer; font-size: inherit; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text-dark); text-decoration-color: var(--mjb-gold); text-decoration-thickness: 2px; }
.inline-form { display: inline; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--text-dark); }
.input, .select, .textarea {
  width: 100%; height: 40px; border-radius: 0; background: var(--content1); border: 1px solid var(--border-control);
  padding: 0 12px; font: inherit; font-size: 14px; color: var(--foreground);
  transition: border-color var(--dur-fast) var(--ease-smooth), box-shadow var(--dur-fast) var(--ease-smooth);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-dark); }
/* Focus: a 2px dark edge (17:1) with the gold glow around it. */
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--text-dark); background: var(--content1); box-shadow: 0 0 0 1px var(--text-dark), var(--glow-gold); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"],
.field:has(> .errorlist) .input, .field:has(> .errorlist) .select, .field:has(> .errorlist) .textarea { border-color: var(--danger-600); box-shadow: inset 3px 0 0 var(--danger-600); }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--default-100); color: var(--text-faint); border-color: var(--default-300); cursor: not-allowed; }
select.input, .select {
  -webkit-appearance: none; appearance: none; padding-right: 36px; background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='2.5' stroke-linecap='square'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
select.input[multiple], select.select[multiple] { background-image: none; padding-right: 12px; height: auto; }
.textarea { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; }
.textarea--tall { min-height: 420px; font-family: var(--font-mono); font-size: 13px; line-height: 20px; }
.input--search { width: 280px; height: 36px; padding-left: 36px; background-repeat: no-repeat; background-position: left 12px center; background-size: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c6370' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E"); }
.input--sm { height: 32px; font-size: 13px; }
.input-wrap { position: relative; }
/* Date fields: dd/mm/yyyy label over the native field (see app.js); the native text shows only while typing. */
.date-wrap { position: relative; display: block; }
.date-wrap.is-uk > input:not(:focus) { color: transparent; }
.date-wrap.is-uk:not(:focus-within)::after {
  content: attr(data-display); position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: var(--foreground); pointer-events: none;
}
.date-wrap.is-uk.is-empty::after { color: var(--text-faint); }
.input-suffix { position: absolute; right: 12px; top: 10px; font-size: 12px; color: var(--default-500); pointer-events: none; }
.help { font-size: 12px; color: var(--default-500); }
.errorlist { margin: 0; padding: 0; list-style: none; font-size: 12px; font-weight: 500; color: var(--danger-600); }
.errorlist li::before { content: "! "; font-weight: 800; }
.form-grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.form-grid-even { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.checkbox { display: flex; gap: 8px; align-items: center; font-size: 14px; }

/* Checkboxes and radios: native inputs (keyboard, labels, screen readers unchanged), drawn in the brand.
 * Unticked: 1.5px #71717a edge (4.83:1). Ticked: gold fill, dark edge and dark tick. */
input[type=checkbox]:not(.switch input), input[type=radio]:not(.segmented input) {
  -webkit-appearance: none; appearance: none; margin: 0; flex-shrink: 0; vertical-align: middle; cursor: pointer;
  width: 18px; height: 18px; border: 1.5px solid var(--border-control); background: var(--content1) no-repeat center / 12px;
  transition: background-color var(--dur-fast) var(--ease-smooth), border-color var(--dur-fast) var(--ease-smooth);
}
input[type=radio]:not(.segmented input) { border-radius: var(--radius-pill); }
input[type=checkbox]:not(.switch input):hover, input[type=radio]:not(.segmented input):hover { border-color: var(--text-dark); }
input[type=checkbox]:not(.switch input):checked {
  background-color: var(--mjb-gold); border-color: var(--text-dark);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='3.5' stroke-linecap='square'%3E%3Cpath d='m4 12.5 5 5L20 6.5'/%3E%3C/svg%3E");
}
input[type=checkbox]:not(.switch input):indeterminate {
  background-color: var(--mjb-gold); border-color: var(--text-dark);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='%231a1a1a' stroke-width='3.5'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
}
input[type=radio]:not(.segmented input):checked { border-color: var(--text-dark); background-color: var(--mjb-gold); box-shadow: inset 0 0 0 3px var(--content1); }
input[type=checkbox]:not(.switch input):disabled, input[type=radio]:not(.segmented input):disabled { cursor: not-allowed; border-color: var(--default-300); background-color: var(--default-100); }
input[type=checkbox]:not(.switch input):disabled:checked { background-color: var(--default-200); border-color: var(--border-control); }
.checkbox input { width: 18px; height: 18px; }

/* Segmented control built from radio inputs */
.segmented { display: inline-flex; padding: 3px; gap: 3px; border-radius: 0; background: var(--content1); box-shadow: inset 0 0 0 1px var(--border-control); width: max-content; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label, .segmented a { padding: 6px 14px; border-radius: 0; font-size: 13px; font-weight: 600; color: var(--default-500); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-smooth), color var(--dur-fast) var(--ease-smooth); }
.segmented label:hover, .segmented a:hover { text-decoration: none; color: var(--foreground); background: var(--default-100); }
.segmented input:checked + label, .segmented .is-active, .segmented .is-active:hover {
  background: var(--text-dark); box-shadow: none; color: var(--mjb-gold);
}
.segmented input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.segmented--block { display: flex; width: 100%; }
.segmented--block label, .segmented--block a { flex: 1; text-align: center; padding: 10px 0; }

/* Switch built from a checkbox. Off: outlined track, grey thumb left. On: gold track, dark edge, dark thumb right. */
.switch { position: relative; display: inline-flex; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch__track { width: 44px; height: 24px; border-radius: var(--radius-pill); background: var(--content1); box-shadow: inset 0 0 0 1.5px var(--border-control);
  padding: 4px; display: flex; align-items: center; transition: background-color var(--dur-fast) var(--ease-smooth); }
.switch__thumb { width: 16px; height: 16px; border-radius: var(--radius-pill); background: var(--border-control); transition: transform var(--dur-fast) var(--ease-spring), background-color var(--dur-fast); }
.switch:hover .switch__track { box-shadow: inset 0 0 0 1.5px var(--text-dark); }
.switch input:checked + .switch__track { background: var(--mjb-gold); box-shadow: inset 0 0 0 1.5px var(--text-dark); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(20px); background: var(--text-dark); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + .switch__track { opacity: .55; cursor: not-allowed; }
.switch--sm .switch__track { width: 36px; height: 20px; padding: 3px; }
.switch--sm .switch__thumb { width: 14px; height: 14px; }
.switch--sm input:checked + .switch__track .switch__thumb { transform: translateX(16px); }
.switch--success input:checked + .switch__track { background: var(--rating-excellent); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.toggle-row__text { display: flex; flex-direction: column; }

/* ---------- Alerts: white with a status bar on the left; the text says what kind it is ---------- */
.alert { padding: 12px 16px; border-radius: 0; font-size: 13px; line-height: 18px; background: var(--content1); color: var(--text-dark);
  box-shadow: inset 4px 0 0 var(--alert-bar, var(--border-control)), inset 0 0 0 1px var(--border-light); padding-left: 18px; }
.alert--primary { --alert-bar: var(--mjb-gold); background: var(--gold-50); }
.alert--default { --alert-bar: var(--border-control); background: var(--default-100); }
.alert--success { --alert-bar: #047857; }
.alert--danger { --alert-bar: var(--danger-600); }
.alert--warning { --alert-bar: #d97706; background: var(--warning-50); padding: 16px 16px 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.alert__title { font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: var(--tracking-wide); text-transform: uppercase; }
.alert__lead { font-weight: 700; margin-right: 4px; }
.alert--success .alert__lead { color: var(--status-success-fg); }
.alert--danger .alert__lead { color: var(--danger-600); }
.alert--warning .alert__lead { color: var(--status-warning-fg); }
.alert--row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 16px 18px; }
/* Django messages show as toasts: fixed top right, over the page, dismissed on click or after a few seconds. */
.messages { position: fixed; top: 16px; right: 16px; z-index: 60; width: calc(100vw - 32px); max-width: 420px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.messages .alert { pointer-events: auto; cursor: pointer; display: flex; align-items: flex-start; gap: 12px; background: var(--content1);
  box-shadow: inset 4px 0 0 var(--alert-bar, var(--border-control)), inset 0 0 0 1px var(--border-light), 0 8px 24px rgba(0, 0, 0, .14);
  animation: toast-in .18s ease-out; transition: opacity .25s, transform .25s; }
.messages .alert.is-leaving { opacity: 0; transform: translateX(16px); }
.toast__text { flex: 1 1 auto; }
.toast__close { flex: none; border: 0; background: none; padding: 0 2px; font-size: 18px; line-height: 18px; color: var(--text-muted, inherit); cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .messages .alert { animation: none; transition: none; } }
.dark-bar {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-radius: 0;
  background: var(--header-bg); color: var(--text-light); font-size: 13px; position: sticky; top: 12px; z-index: 5;
  box-shadow: var(--shadow-nav); border-bottom: 3px solid var(--mjb-gold);
}

/* ---------- Tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px 24px; border-bottom: 1px solid var(--divider); font-size: 14px; }
.tab { padding: 0 0 10px; font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: var(--tracking-button); text-transform: uppercase;
  color: var(--default-500); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--foreground); text-decoration: none; border-bottom-color: var(--mjb-gold); }
.tab.is-active { border-bottom-color: var(--text-dark); color: var(--foreground); box-shadow: 0 3px 0 var(--mjb-gold); }

/* ---------- Slot / approval / duplicate cards ---------- */
.slot__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.slot__title { font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.slot__meta { display: flex; gap: 16px; font-size: 13px; color: var(--default-600); flex-wrap: wrap; }
.group__title { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.section-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin: 24px 0 12px; }
.pick-row {
  display: grid; grid-template-columns: 24px minmax(0, 1.2fr) 130px 110px 70px minmax(0, 1.2fr) 70px minmax(0, 2fr); gap: 12px; align-items: center;
  padding: 10px 18px; font-size: 13px; border-bottom: 1px solid var(--default-100); cursor: pointer;
}
.pick-row:last-child { border-bottom: 0; }
.pick-row:has(input:checked) { background: var(--gold-50); box-shadow: inset 3px 0 0 var(--mjb-gold); }
.pick-row input[type=checkbox], .pick-row input[type=radio], .pick-simple input { width: 18px; height: 18px; margin: 0; }
.pick-simple { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 8px 10px; border-radius: 0; background: var(--default-50); cursor: pointer; }
.pick-simple:has(input:checked) { background: var(--gold-50); box-shadow: inset 3px 0 0 var(--mjb-gold); }
.role-label { padding: 8px 18px 0; font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--default-500); }

/* Score bar */
.scorebar { display: flex; align-items: center; gap: 8px; }
.scorebar progress { appearance: none; width: 72px; height: 6px; border: 0; border-radius: 9999px; background: var(--default-200); overflow: hidden; }
.scorebar progress::-webkit-progress-bar { background: var(--default-200); border-radius: 9999px; }
.scorebar progress::-webkit-progress-value { background: var(--default-700); border-radius: 9999px; }
.scorebar progress::-moz-progress-bar { background: var(--default-700); border-radius: 9999px; }

/* RatingBadge: 0-10 score, coloured by the design system's rating scale. Dark ink on every band (4.62:1 or more)
 * except the lowest, where white reads better (4.83:1). The DS's white ink on green fails at 2.54:1. */
.rating { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 28px; padding: 0 8px;
  border-radius: var(--radius-pill); font-family: var(--font-display); font-size: 13px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--color-on-accent); background: var(--mjb-gold); flex-shrink: 0; }
.rating--excellent { background: var(--rating-excellent); }
.rating--great { background: var(--rating-great); }
.rating--good { background: var(--rating-good); }
.rating--average { background: var(--rating-average); }
.rating--poor { background: var(--rating-poor); }
.rating--bad { background: var(--rating-bad); color: #fff; }
.rating--lg { min-width: 48px; height: 48px; font-size: 15px; box-shadow: var(--shadow-md); }

/* Status mix bar (summary) */
.mixbar { display: flex; height: 12px; border-radius: 9999px; overflow: hidden; gap: 2px; }
.mixbar span { display: block; height: 100%; }
.legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; }
.legend__item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 9999px; flex-shrink: 0; }
.c-success { background: var(--success-500); } .c-muted { background: var(--default-400); } .c-danger { background: var(--danger-500); }
.c-primary { background: #2563eb; } .c-warning { background: var(--warning-500); } .c-danger-soft { background: var(--danger-300); }
.c-light { background: var(--default-300); } .c-secondary { background: var(--secondary-600); }
.c-orange { background: #F97316; } .c-danger-light { background: #FDA4AF; }

/* ---------- Calendar ---------- */
.cal { padding: 8px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal__wd { font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--default-500); padding: 8px; }
.cal__day { border-radius: 0; background: var(--default-50); padding: 8px; display: flex; flex-direction: column; gap: 4px; min-height: 96px; min-width: 0; }
.cal__day--out { background: transparent; }
.cal__day--today { background: var(--gold-50); box-shadow: inset 0 3px 0 var(--mjb-gold); }
.cal__n { font-size: 12px; font-weight: 500; color: var(--default-600); }
.cal__day--today .cal__n { color: var(--text-dark); font-weight: 800; }
.cal__ev { font-size: 11px; line-height: 16px; padding: 2px 6px; border-radius: 0; background: var(--success-50); color: var(--success-700); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal__ev--mine { background: var(--text-dark); color: var(--mjb-gold); }
.agenda__day { font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--default-500); padding: 12px 12px 4px; }

/* ---------- Guidelines ---------- */
.guide { display: flex; flex: 1; min-width: 0; }
.guide__nav { width: 240px; flex-shrink: 0; padding: 32px 16px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--divider); }
.guide__link { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 0; border-left: 3px solid transparent; font-size: 13px; color: var(--default-600); }
.guide__link:hover { background: var(--default-100); text-decoration: none; color: var(--foreground); }
.guide__link.is-active { background: var(--content1); color: var(--foreground); font-weight: 600; border-left-color: var(--mjb-gold); box-shadow: var(--shadow-sm); }
.guide__link--child { padding-left: 22px; }
.guide__mark { font-size: 11px; color: var(--default-400); font-weight: 400; }
.guide__mark--new { color: var(--gold-ink); font-weight: 600; }
.guide__links { display: flex; flex-direction: column; gap: 6px; padding: 12px 10px 0; border-top: 1px solid var(--divider); font-size: 13px; }
.guide__main { flex: 1; min-width: 0; padding: 40px 64px; display: flex; flex-direction: column; gap: 16px; max-width: 824px; }
.guide__crumb { font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--default-500); }
.guide__title { font-family: var(--font-display); font-size: 34px; line-height: 38px; font-weight: 800; letter-spacing: var(--tracking-tight); text-wrap: balance; }
.prose { font-size: 16px; line-height: 26px; color: var(--default-700); display: flex; flex-direction: column; gap: 14px; }
.prose h2 { font-family: var(--font-display); font-size: 20px; line-height: 28px; font-weight: 700; color: var(--foreground); margin-top: 12px; }
.prose h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--foreground); margin-top: 8px; }
.prose ul, .prose ol { margin: 0; padding-left: 22px; }
.prose li + li { margin-top: 4px; }
.prose img { max-width: 100%; height: auto; border-radius: 0; border: 1px solid var(--default-200); box-shadow: var(--shadow-small); margin: 6px 0; }
.prose li > img, .prose p > img { display: block; }
.prose blockquote { margin: 0; padding: 12px 16px; border-radius: var(--radius-md); background: var(--default-100); font-size: 14px; }
.prose table { border-collapse: separate; border-spacing: 0; background: var(--content1); border-radius: 0; box-shadow: var(--shadow-small); overflow: hidden; font-size: 14px; }
.prose th, .prose td { padding: 10px 16px; border-bottom: 1px solid var(--default-100); text-align: left; }
.prose th { font-weight: 600; color: var(--foreground); }
.prose code { background: var(--default-100); padding: 2px 6px; border-radius: 0; }

/* ---------- Login ---------- */
.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--default-50); }
.login-card { width: 400px; max-width: 100%; display: flex; flex-direction: column; gap: 20px; padding: 0 32px 32px; background: var(--content1); border-radius: 0; box-shadow: var(--shadow-medium); }
/* Dark band with the wordmark at the top of the sign-in card */
.logo-band { background: var(--header-bg); margin: 0 -32px; padding: 24px 32px 20px; border-bottom: 4px solid var(--mjb-gold); }
.login-title { font-family: var(--font-display); font-size: 24px; line-height: 28px; font-weight: 800; letter-spacing: -0.01em; text-transform: uppercase; }
.qr { width: 200px; height: 200px; align-self: center; background: #fff; padding: 8px; border-radius: 0; box-shadow: inset 0 0 0 1px var(--border-light); }

/* ---------- Mobile ---------- */
.mobile-bar, .bottom-nav, .only-mobile { display: none; }
.htmx-request.htmx-indicator, .htmx-request .htmx-indicator { opacity: 1; }
.htmx-indicator { opacity: 0; transition: opacity .2s; }

@media (max-width: 900px) {
  .split, .split--wide-side, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide { flex-direction: column; }
  .guide__nav { width: auto; border-right: 0; border-bottom: 1px solid var(--divider); padding: 16px; }
  .guide__main { padding: 24px 20px; }
}

@media (max-width: 768px) {
  body { padding-bottom: 76px; }
  .sidebar { display: none; }
  .only-desktop { display: none !important; }
  .only-mobile { display: flex; }
  .page { padding: 8px 16px 24px; gap: 14px; }
  .page-sub { font-size: 13px; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 0; }
  .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .grid-4.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .input--search { width: 100%; }
  .btn { height: 44px; }
  .btn--sm, .btn--xs { height: 36px; }
  .form-grid-2, .form-grid-even, .legend { grid-template-columns: minmax(0, 1fr); }
  /* 16px stops iPhones zooming in when a field gets focus */
  .input, .select { height: 48px; background-color: var(--content1); font-size: 16px; }
  .textarea { background-color: var(--content1); font-size: 16px; }
  .input--sm, .select.input--sm { height: 40px; }
  .chip { line-height: 34px; font-size: 13px; }
  .segmented { width: 100%; display: flex; }
  .segmented label, .segmented a { flex: 1; text-align: center; padding: 10px 0; }
  .dark-bar { position: sticky; top: 8px; }
  .cal__day { min-height: 64px; padding: 4px; }
  .cal__ev { font-size: 10px; padding: 1px 4px; }
  .tbl { font-size: 12px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: 76px;
    background: var(--header-bg); border-top: 1px solid var(--border-dark); padding-top: 0; z-index: 20;
  }
  .bottom-nav a { font-size: 11px; font-weight: 600; text-align: center; color: var(--text-muted-dark); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
  .bottom-nav a:hover { color: #fff; text-decoration: none; }
  .bottom-nav a.is-active { color: var(--mjb-gold); font-weight: 700; box-shadow: inset 0 3px 0 var(--mjb-gold); }
  .bottom-nav svg { width: 22px; height: 22px; }
  .m-card { background: var(--content1); border-radius: 0; box-shadow: var(--shadow-small); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
  .m-list { display: flex; flex-direction: column; gap: 10px; }
  .more-menu { display: flex; flex-direction: column; gap: 4px; }
}
.more-menu .nav-item { padding: 12px; }

/* SVG fills for the status mix bar */
.mixsvg { display: block; width: 100%; height: 12px; border-radius: 9999px; overflow: hidden; }
.mixsvg .c-success { fill: var(--success-500); } .mixsvg .c-muted { fill: var(--default-400); }
.mixsvg .c-danger { fill: var(--danger-500); } .mixsvg .c-primary { fill: #2563eb; }
.mixsvg .c-warning { fill: var(--warning-500); } .mixsvg .c-danger-soft { fill: var(--danger-300); }
.mixsvg .c-light { fill: var(--default-300); }
.mixsvg .c-orange { fill: #F97316; } .mixsvg .c-danger-light { fill: #FDA4AF; }
.year-grid { display: grid; grid-template-columns: repeat(4, 1fr); font-size: 13px; gap: 6px 0; }
.year-grid .head { font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--default-500); }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: flex-end; font-size: 13px; padding: 8px 12px; }
.select.input--sm { width: auto; max-width: 100%; }
.st-danger-text { color: var(--danger-600); }
.st-success-text { color: var(--success-700); }
.preview-frame { width: 100%; min-height: 420px; border: 1px solid var(--default-200); border-radius: 0; background: #fff; }
.kv { display: flex; gap: 8px; font-size: 13px; } .kv > span:first-child { color: var(--default-500); min-width: 64px; }
.tick { display: inline-block; width: 18px; height: 18px; border-radius: 0; border: 1.5px solid var(--border-control); background: transparent no-repeat center / 12px; padding: 0; vertical-align: middle; }
.tick.is-on { background-color: var(--mjb-gold); border-color: var(--text-dark);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='3.5' stroke-linecap='square'%3E%3Cpath d='m4 12.5 5 5L20 6.5'/%3E%3C/svg%3E"); }
button.tick { cursor: pointer; } button.tick:hover { border-color: var(--text-dark); }
.page--flush { padding: 0; gap: 0; flex-direction: row; }
@media (max-width: 768px) { .page--flush { flex-direction: column; } }

/* Names in lists read as text, as in the design; they still link to the detail page. */
.tbl td.cell-strong a, a.slot__title, a.group__title, .m-card a.strong { color: var(--foreground); text-decoration: none; }
.tbl td.cell-strong a:hover, a.slot__title:hover, a.group__title:hover { color: var(--text-dark); text-decoration: underline; text-decoration-color: var(--mjb-gold); text-decoration-thickness: 2px; }
.guide__nav .input--search { width: 100%; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--default-100); }
.list-row:last-child { border-bottom: 0; }
.list-row .toggle-row__text { min-width: 0; }
.pick-row--status { grid-template-columns: 90px minmax(0, 1.2fr) 130px 110px 70px minmax(0, 1.2fr) 70px minmax(0, 2fr); cursor: default; }
.card__foot { align-items: center; }
.card__foot .select { width: auto; height: 36px; }
.tbl td .inline-form + .inline-form, .tbl td span + .inline-form { margin-left: 4px; }
.form-section { font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: var(--tracking-wide); text-transform: uppercase; padding-top: 10px; border-top: 1px solid var(--border-light); }
.tbl tr.is-selected td { background: var(--gold-50); }
.formula { font-family: var(--font-mono); font-size: 12.5px; line-height: 22px; background: var(--default-100); border-radius: 0; padding: 12px 14px; box-shadow: inset 3px 0 0 var(--mjb-gold); }
.explain { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; align-items: end; }
@media (max-width: 768px) { .rules-grid { grid-template-columns: minmax(0, 1fr); } }
.pr-send { padding: 8px 0; border-bottom: 1px solid var(--default-100); } .pr-send:last-of-type { border-bottom: 0; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.suggest__chip { line-height: 24px; font-size: 12px; font-family: var(--font-sans); font-weight: 600; letter-spacing: 0; text-transform: none; }
.deliver-form { flex-wrap: nowrap; } .deliver-form .input { width: 180px; }
.pr-email-form { flex-wrap: nowrap; } .pr-email-form .input { flex: 1; min-width: 0; }
/* Dashboard */
.stat--link { color: var(--foreground); transition: box-shadow var(--dur-medium) var(--ease-smooth), transform var(--dur-medium) var(--ease-spring); }
.stat--link:hover { text-decoration: none; box-shadow: 0 0 0 1px var(--text-dark), var(--shadow-md); color: var(--foreground); transform: translateY(-2px); }
.dash-row { padding: 6px 0; border-bottom: 1px solid var(--default-100); } .dash-row:last-child { border-bottom: 0; }
.barchart { display: block; width: 100%; height: 140px; }
.barchart .bar, .hbar .bar { fill: var(--default-700); }
.barchart .bar:hover, .hbar:hover .bar { fill: var(--mjb-gold-dark); }
.bar-axis { display: grid; grid-template-columns: repeat(13, 1fr); font-size: 11px; color: var(--default-500); text-align: center; }
.hbar { display: grid; grid-template-columns: 110px 1fr 36px; gap: 10px; align-items: center; }
.hbar__label { color: var(--default-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar__track { width: 100%; height: 10px; display: block; }
.hbar__value { text-align: right; }
.festival-ask { flex-direction: column; align-items: stretch; } .festival-ask summary { list-style: none; width: max-content; } .festival-ask summary::-webkit-details-marker { display: none; }
.restore-box { padding-top: 12px; border-top: 1px solid var(--default-100); }
.dropout { display: inline-block; text-align: left; } .dropout summary { list-style: none; } .dropout summary::-webkit-details-marker { display: none; } .dropout form { width: 240px; max-width: 100%; white-space: normal; }

/* Tablets and phones: list tables become one card per row; each cell shows its column name. */
@media (max-width: 1000px) {
  .card--table:has(.tbl--stack) { overflow-x: visible; padding: 4px 14px; }
  .tbl--stack, .tbl--stack tbody { display: block; }
  .tbl--stack thead { display: none; }
  .tbl--stack tr { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--default-100); }
  .tbl--stack tr:last-child { border-bottom: 0; }
  .tbl--stack tbody tr:hover td { background: none; }
  .tbl--stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0; border: 0;
    font-size: 13px; text-align: right; min-width: 0; overflow-wrap: anywhere; }
  .tbl--stack td::before { content: attr(data-label); color: var(--default-500); text-align: left; flex-shrink: 0; max-width: 45%; }
  .tbl--stack td:empty { display: none; }
  .tbl--stack td.cell-strong, .tbl--stack tr:not(:has(.cell-strong)) td:first-child {
    order: -1; font-size: 15px; text-align: left; justify-content: flex-start; }
  .tbl--stack tr:not(:has(.cell-strong)) td:first-child::before { content: none; }
  .tbl--stack td .nowrap { white-space: normal; }
  .tbl--stack td > .row { min-width: 0; }
  .tbl--stack td.cell-strong::before, .tbl--stack td.actions::before, .tbl--stack td.empty::before,
  .tbl--stack td:not([data-label])::before { content: none; }
  .tbl--stack td.actions { justify-content: flex-start; flex-wrap: wrap; text-align: left; white-space: normal; }
  .tbl--stack td.empty { justify-content: center; text-align: center; padding: 24px 0; }
  .tbl--stack td:has(form:not(.inline-form)) { flex-direction: column; align-items: stretch; text-align: left; }
  .tbl--stack .deliver-form { flex-wrap: nowrap; } .tbl--stack .deliver-form .input { width: auto; flex: 1; min-width: 0; }
  .tbl--stack details.dropout { width: 100%; }
  .card__foot .select { flex: 1 1 140px; }
  .chips:has(> .input--search) { flex-wrap: wrap; overflow-x: visible; }
  .chips > .input--search { flex: 1 1 100%; }
  .chips:has(> .input--search) > .select { flex: 1 1 40%; width: auto; }
}

/* Sortable table headers */
.tbl th.sortable a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.tbl th.sortable a:hover { color: var(--mjb-gold); text-decoration: none; }
.tbl th.is-sorted { color: var(--mjb-gold); }
.sort-arrow { font-size: 11px; min-width: 8px; }
.tbl th.sortable:not(.is-sorted) a:hover .sort-arrow::after { content: "↕"; color: var(--text-muted-dark); }

/* Filter panel (Upcoming events, admin) */
.filters { padding: 0; }
.filters__head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; cursor: pointer; list-style: none; font-family: var(--font-display); font-weight: 700; letter-spacing: var(--tracking-wide); text-transform: uppercase; font-size: 13px; }
.filters__head .tiny { font-family: var(--font-sans); font-weight: 400; letter-spacing: 0; text-transform: none; }
.filters__head::-webkit-details-marker { display: none; }
.filters__head::before { content: "▸"; color: var(--text-dark); transition: transform var(--dur-fast) var(--ease-smooth); }
.filters[open] .filters__head::before { transform: rotate(90deg); }
.filters__head .tiny { margin-left: auto; }
.filters__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 12px; padding: 4px 18px 16px; align-items: end; }
.filters__grid .field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dark); margin: 0; }
.filters__grid .input, .filters__grid .select { height: 36px; width: 100%; }
.filters__actions { display: flex; gap: 8px; grid-column: 1 / -1; justify-content: flex-end; }
@media (max-width: 1100px) { .filters__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 768px) {
  .filters__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters__grid .input, .filters__grid .select { height: 44px; }
  .filters__actions { justify-content: stretch; } .filters__actions .btn { flex: 1; }
}

/* Row selection for bulk actions */
.tbl th.pick, .tbl td.pick { width: 28px; padding-right: 0; }
.dark-bar .select { background-color: var(--content1); color: var(--foreground); }
@media (max-width: 1000px) { .tbl--stack td.pick { order: -2; justify-content: flex-start; } .tbl--stack td.pick::before { content: none; } }

/* To-do board */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.board__col { display: flex; flex-direction: column; gap: 10px; background: var(--default-200); border-radius: 0; border-top: 3px solid var(--text-dark); padding: 12px; min-height: 120px; }
.board__head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px; }
.board__card { display: flex; flex-direction: column; gap: 6px; }
.board__card .medium { color: var(--foreground); }
.board__empty { padding: 8px 4px; }
.todo-buttons { display: inline-flex; flex-wrap: wrap; gap: 4px; }
@media (max-width: 1100px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .board { grid-template-columns: minmax(0, 1fr); } }
.dark-bar--flat { border-radius: 0; position: static; }

/* Guidelines menu as a tree (like Coda): parents fold with a chevron, open by default */
.guide__group > summary { list-style: none; }
.guide__group > summary::-webkit-details-marker { display: none; }
.guide__link--parent { justify-content: flex-start; gap: 4px; cursor: pointer; padding-left: 4px; }
.guide__link--parent .guide__mark { margin-left: auto; }
.guide__link--leaf { padding-left: 26px; }
.guide__title-link { color: inherit; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.guide__title-link:hover { text-decoration: none; color: var(--foreground); }
.guide__chev { width: 18px; height: 18px; flex-shrink: 0; border-radius: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--default-400); }
.guide__chev::before { content: ""; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s; margin-left: -2px; }
.guide__group[open] > summary .guide__chev::before { transform: rotate(45deg); margin: -3px 0 0; }
.guide__chev { color: var(--default-500); }
.guide__chev:hover { background: var(--mjb-gold); color: var(--text-dark); }
.guide__children { display: flex; flex-direction: column; gap: 2px; margin-left: 13px; padding-left: 4px; border-left: 1px solid var(--default-300); }
.guide__children .guide__link--leaf { padding-left: 22px; }
.guide__group[open] > summary .guide__mark--folded { display: none; }

/* Settings: a menu of sections on the left, one section at a time */
.settings { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings__nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; }
.settings__tab { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px 9px 9px; border-radius: 0; border-left: 3px solid transparent; color: var(--default-600); font-size: 14px; }
.settings__tab:hover { background: var(--default-100); text-decoration: none; color: var(--foreground); }
.settings__tab.is-active { background: var(--content1); box-shadow: var(--shadow-small); color: var(--foreground); border-left-color: var(--mjb-gold); font-weight: 600; }
.settings__hint { font-size: 12px; color: var(--default-500); }
.settings__body { max-width: 760px; }
@media (max-width: 900px) {
  .settings { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .settings__nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .settings__tab { padding: 8px 12px; background: var(--content1); box-shadow: var(--shadow-small); }
  .settings__tab.is-active { background: var(--text-dark); color: var(--mjb-gold); border-left-color: var(--mjb-gold); }
  .settings__hint { display: none; }
}

a.name-link { color: var(--foreground); }
a.name-link:hover { color: var(--primary-600); }

/* PR template editor: code on the left, rendered email on the right */
.tpl-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.preview-frame--tall { min-height: 640px; border: 0; border-radius: 0; }
@media (max-width: 1100px) { .tpl-edit { grid-template-columns: minmax(0, 1fr); } }

.kit-grid { gap: 10px; }
.kit-grid > div { display: flex; flex-direction: column; gap: 2px; }
.kit-value { font-family: var(--font-display); font-size: 22px; font-weight: 800; line-height: 26px; font-variant-numeric: tabular-nums; }
@media (max-width: 768px) { .grid-4.kit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Readiness checklist (event page) */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.checklist label { display: flex; gap: 8px; align-items: flex-start; }
.checklist input { margin: 1px 0 0; flex-shrink: 0; }
.checklist__detail { display: block; font-size: 12px; overflow-wrap: anywhere; }
.checklist__detail.is-ok { color: var(--success-700); } .checklist__detail.is-bad { color: var(--danger-600); }


/* ---------- Responsive pass ----------
 * Laptops (about 1000 to 1440px): a slimmer sidebar and tighter spacing so pages need no sideways scrolling.
 * Tablets and phones: nothing is hidden, content stacks instead.
 */
.only-narrow { display: none; }
.pick-list-card { container-type: inline-size; }

/* One person in a People list: a full row when the card is wide, two lines when it is narrow. */
.pick-meta { display: contents; }
@container (max-width: 900px) {
  .pick-row, .pick-row--status { grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; }
  .pick-row > :nth-child(1) { grid-column: 1; grid-row: 1; }
  .pick-row > :nth-child(2) { grid-column: 2; grid-row: 1; min-width: 0; overflow-wrap: anywhere; }
  .pick-row > :nth-child(3) { grid-column: 3; grid-row: 1; }
  .pick-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; grid-column: 2 / -1; grid-row: 2; font-size: 12px; min-width: 0; }
  .pick-meta > * { min-width: 0; overflow-wrap: anywhere; }
  .pick-meta > :empty { display: none; }
}

@media (max-width: 1440px) {
  .tbl th, .tbl td { padding-left: 8px; padding-right: 8px; }
  .tbl--compact td { padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 1280px) {
  .sidebar { width: 208px; }
  .page { padding: 24px; }
  .split { grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; }
  .split--wide-side { grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; }
  .settings { grid-template-columns: 200px minmax(0, 1fr); gap: 20px; }
  .guide__main { padding: 32px 40px; }
}
@media (max-width: 1000px) {
  .split, .split--wide-side { grid-template-columns: minmax(0, 1fr); }
  .only-wide { display: none !important; }
  .only-narrow { display: flex; }
  .tpl-edit { grid-template-columns: minmax(0, 1fr); }
  .m-card { background: var(--content1); border-radius: 0; box-shadow: var(--shadow-small); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
  .m-list { display: flex; flex-direction: column; gap: 10px; }
}
.table-scroll { overflow-x: auto; }
@media (max-width: 768px) {
  .tbl--stack td.only-desktop { display: none; }
  .badge { white-space: normal; }
}
@media (max-width: 480px) {
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .page-title { font-size: 21px; line-height: 28px; }
  .toggle-row { gap: 12px; }
}

/* Guidelines gate: lightbox shown when someone who hasn't confirmed the guidelines tries to request a gig. */
.gate { border: 0; border-top: 4px solid var(--mjb-gold); border-radius: 0; padding: 24px; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-large); color: var(--foreground); }
.gate::backdrop { background: rgba(10, 10, 10, .6); }
.gate__title { font-family: var(--font-display); font-size: 20px; line-height: 24px; font-weight: 800; text-transform: uppercase; margin: 0 0 8px; text-wrap: balance; }
.gate__list { margin: 12px 0 0; padding-left: 18px; }
.gate__actions { margin-top: 20px; justify-content: flex-end; }

/* Guideline editor: uploaded images with a copy button instead of a truncated snippet. */
.img-row { display: flex; align-items: center; gap: 10px; }
.img-row img { width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); background: var(--default-100); flex: none; }
.img-row__alt { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* Guideline pages: links, dividers, callouts, spacing. */
.prose { overflow-wrap: anywhere; }
.prose h2 { margin-top: 28px; padding-top: 4px; font-size: 22px; line-height: 30px; letter-spacing: -0.01em; }
.prose h3 { margin-top: 20px; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose strong { color: var(--foreground); font-weight: 600; }
.prose a { color: var(--gold-ink); text-decoration: underline; text-decoration-color: var(--gold-ink); text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 500; }
.prose a:hover { color: var(--text-dark); text-decoration-color: var(--mjb-gold); }
.prose hr { border: 0; border-top: 1px solid var(--default-200); width: 100%; margin: 12px 0; }
.prose li > p { margin: 0; }
.prose li > ul, .prose li > ol { margin-top: 4px; }
.prose ol > li::marker { color: var(--gold-ink); font-weight: 700; font-family: var(--font-display); }
.prose blockquote { border-left: 3px solid var(--border-control); border-radius: var(--radius-sm) var(--radius-md) var(--radius-md) var(--radius-sm); color: var(--default-700); }
.prose blockquote > * + * { margin-top: 8px; }
.prose blockquote p, .prose blockquote ul, .prose blockquote ol { margin: 0; }
.prose blockquote ul, .prose blockquote ol { padding-left: 20px; }
.prose .callout { padding: 14px 18px; font-size: 15px; line-height: 23px; border-left-width: 4px; }
.prose .callout__label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-right: 4px; }
.prose .callout--info { background: var(--gold-50); border-left-color: var(--mjb-gold-dark); }
.prose .callout--info .callout__label { color: var(--gold-ink-strong); }
.prose .callout--tip { background: var(--success-50); border-left-color: var(--success-500); }
.prose .callout--tip .callout__label { color: var(--success-700); }
.prose .callout--alert { background: var(--warning-50); border-left-color: var(--warning-500); }
.prose .callout--alert .callout__label { color: var(--warning-800); }

/* Motion: the brand's lifts, springs and glows are off for people who ask for less motion; colour changes stay. */
/* Settings → Messages: each message is its own box; title, trigger and wording stack on the left, the switch and Edit sit in fixed columns */
.msg-list { display: grid; gap: 12px; padding: 16px 18px; }
.msg { display: grid; grid-template-columns: minmax(0, 1fr) 56px 72px; align-items: center; gap: 8px 16px; padding: 14px 16px; border: 1px solid var(--default-200); background: var(--content1); }
.msg.is-off { background: var(--default-50); }
.msg__title { font-weight: 600; }
.msg__when { color: var(--default-600); font-size: 13px; margin-top: 2px; }
.msg__body { grid-column: 1 / -1; margin: 0; padding: 8px 12px; background: var(--default-50); border-left: 3px solid var(--mjb-gold); font-size: 13px; color: var(--default-700); white-space: pre-line; overflow-wrap: anywhere; }
.msg.is-off .msg__body { border-left-color: var(--default-300); color: var(--text-faint); }
.msg__switch { display: flex; justify-content: center; margin: 0; }
.msg__edit { display: flex; justify-content: flex-end; }
@media (max-width: 640px) { .msg { grid-template-columns: minmax(0, 1fr) auto auto; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .btn:hover, .btn--primary:hover, .btn--dark:hover, .stat--link:hover { transform: none; }
  .btn--primary:hover::before { box-shadow: none; }
}

/* Checkbox dropdown: pick several values for one filter */
.multi { position: relative; }
.multi__sum { display: flex; align-items: center; height: 36px; cursor: pointer; list-style: none; }
.multi__sum::-webkit-details-marker { display: none; }
.multi__list { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 100%; max-height: 260px; overflow: auto; background: var(--surface, #fff); border: 1px solid var(--border, #ddd); border-radius: 8px; padding: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.multi__opt { display: flex; align-items: center; gap: 8px; padding: 5px 8px; white-space: nowrap; cursor: pointer; border-radius: 6px; }
.multi__opt:hover { background: rgba(0,0,0,.05); }
@media (max-width: 640px) { .multi__sum { height: 44px; } }
