/* ==========================================================================
   OUAB Booking UI (V2 design system)

   One stylesheet for every surface. Hand-written on purpose: the V1
   Tailwind builds dropped dynamically named classes (badge-{{ stage }})
   and the two bundles defined ~25 classes twice with different values.

   Surfaces:
     body.ui-manage  light, dense "operate" surface for the booking managers
     body.ui-public  dark, calm surface for promoters (portal, public site)

   Rules (see docs/v2/02-design-system.md):
     - colour encodes status, never decoration
     - one primary action per view
     - numbers and dates are tabular
     - no inline styles or scripts (the CSP forbids them)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts: self-hosted (the CSP allows font-src 'self' only). Variable woff2,
   weights 100-900, from @fontsource-variable 5.3.0, SIL OFL 1.1 (licences
   next to the files). swap: text shows in the fallback font while loading.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/outfit-latin-ext-wght-normal.6a2414e384c3.woff2") format("woff2-variations"), url("../fonts/outfit-latin-ext-wght-normal.6a2414e384c3.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: "Outfit";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/outfit-latin-wght-normal.fdf9c509a809.woff2") format("woff2-variations"), url("../fonts/outfit-latin-wght-normal.fdf9c509a809.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: "Work Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/work-sans-latin-ext-wght-normal.9c3fdbf06f3b.woff2") format("woff2-variations"), url("../fonts/work-sans-latin-ext-wght-normal.9c3fdbf06f3b.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: "Work Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/work-sans-latin-wght-normal.97b33529e13b.woff2") format("woff2-variations"), url("../fonts/work-sans-latin-wght-normal.97b33529e13b.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;
}

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  --font-sans: "Work Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Outfit", var(--font-sans);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-xs: 0.75rem;   /* 12 */
  --fs-sm: 0.8125rem; /* 13 */
  --fs-base: 0.9375rem; /* 15 */
  --fs-md: 1.0625rem; /* 17 */
  --fs-lg: 1.25rem;   /* 20 */
  --fs-xl: 1.625rem;  /* 26 */
  --fs-2xl: 2.125rem; /* 34 */

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 160ms;

  /* light (manage) palette */
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --surface-3: #e9ecf1;
  --border: #e1e5eb;
  --border-strong: #c9cfd8;
  --text: #121826;
  --text-2: #3f4a5c;
  --text-3: #5d6879;
  --link: #5b2bc9;

  --brand: #6327d9;
  --brand-hover: #521fb8;
  --brand-soft: #f1ebff;
  --brand-text: #4c1fae;
  --on-brand: #ffffff;
  --ring: #7c4dff;

  --ok: #0f7a4d;      --ok-soft: #e7f6ee;     --ok-line: #b5e2c9;
  --warn: #9a5a00;    --warn-soft: #fff5e1;   --warn-line: #f3d391;
  --danger: #b42318;  --danger-soft: #fdecea; --danger-line: #f5b9b2;
  --info: #1f56c2;    --info-soft: #eaf1ff;   --info-line: #bcd0f7;
  --neutral: #4b5565; --neutral-soft: #eef0f4; --neutral-line: #d6dbe3;

  --shadow-pop: 0 8px 24px rgba(18, 24, 38, .12), 0 1px 3px rgba(18, 24, 38, .08);

  --sidebar-bg: #15101f;
  --sidebar-text: #c9c3d8;
  --sidebar-muted: #8e86a3;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: rgba(255, 255, 255, .08);
}

body.ui-public {
  --fs-base: 1rem;
  --bg: #0e0b17;
  --surface: #17121f;
  --surface-2: #1e1829;
  --surface-3: #282034;
  --border: #2e2640;
  --border-strong: #463b5c;
  --text: #f4f1fa;
  --text-2: #cdc6dc;
  --text-3: #a59cb9;
  --link: #c4b1ff;

  --brand: #7c4dff;
  --brand-hover: #6a3af0;
  --brand-soft: #241a3b;
  --brand-text: #c4b1ff;
  --on-brand: #ffffff;
  --ring: #b69cff;

  --ok: #4ad295;      --ok-soft: #10261c;     --ok-line: #1d5b40;
  --warn: #f5b84d;    --warn-soft: #2b2010;   --warn-line: #6b5020;
  --danger: #ff8b80;  --danger-soft: #2e1414;  --danger-line: #6e2a25;
  --info: #8fb4ff;    --info-soft: #141f36;   --info-line: #2c4677;
  --neutral: #b9b1cc; --neutral-soft: #221c2e; --neutral-line: #3b3150;

  --shadow-pop: 0 12px 32px rgba(0, 0, 0, .45);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); line-height: 1.25; color: var(--text); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-md); }
h3 { font-size: var(--fs-base); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
blockquote, figure { margin: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-4) 0; }
code, kbd, .mono { font-family: var(--font-mono); font-size: max(12px, .92em); }
::selection { background: var(--brand); color: var(--on-brand); }

.num, td.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.soft { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.strong { font-weight: 600; color: var(--text); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.prewrap { white-space: pre-wrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }

/* layout helpers */
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--sp-2); }
.stack-lg { display: flex; flex-direction: column; gap: var(--sp-6); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.cluster-lg { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); }
.between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.push { margin-left: auto; }
.grid { display: grid; gap: var(--sp-4); }
.grid-2 { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
.grid-4 { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.split { display: grid; gap: var(--sp-6); grid-template-columns: 1fr; }
@media (min-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr) 340px; } }
.mt-1 { margin-top: var(--sp-1); } .mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); } .mt-8 { margin-top: var(--sp-8); }
.mb-2 { margin-bottom: var(--sp-2); } .mb-4 { margin-bottom: var(--sp-4); }

/* --------------------------------------------------------------------------
   App shell (manage)
   -------------------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: 232px; flex-shrink: 0;
  display: none; flex-direction: column;
  background: var(--sidebar-bg); color: var(--sidebar-text);
}
@media (min-width: 1024px) { .sidebar { display: flex; } }
.brandmark { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-5) var(--sp-5) var(--sp-4); color: #fff; }
.brandmark img { width: 32px; height: 32px; border-radius: 8px; }
.brandmark strong { font-family: var(--font-display); font-size: var(--fs-base); display: block; line-height: 1.2; }
.brandmark span { font-size: var(--fs-xs); color: var(--sidebar-muted); }
.nav { flex: 1; overflow-y: auto; padding: var(--sp-2) var(--sp-3); }
.nav-group { margin-top: var(--sp-5); }
.nav-group-label { padding: 0 var(--sp-3) var(--sp-1); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--sidebar-muted); }
.nav-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 7px var(--sp-3); border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-size: var(--fs-sm); font-weight: 500;
}
.nav-item:hover { background: var(--sidebar-active-bg); color: #fff; text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--sidebar-active-bg); color: var(--sidebar-active); box-shadow: inset 2px 0 0 #a98bff; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav-count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: #a98bff; color: #15101f; font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }
.nav-count.is-urgent { background: #ff8b80; }
.sidebar-foot { padding: var(--sp-4) var(--sp-5); border-top: 1px solid rgba(255,255,255,.08); font-size: var(--fs-xs); color: var(--sidebar-muted); }
.sidebar-foot strong { color: var(--sidebar-text); }
.sidebar-foot button, .sidebar-foot a { display: inline-flex; align-items: center; min-height: 28px; color: var(--sidebar-muted); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.sidebar-foot button:hover, .sidebar-foot a:hover { color: #fff; }

.topbar { position: sticky; top: 0; z-index: 30; background: var(--sidebar-bg); color: #fff; }
@media (min-width: 1024px) { .topbar { display: none; } }
.topbar-row { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-3) var(--sp-4); }
.topbar .brandmark { padding: 0; }
.topbar .btn-ghost { color: var(--sidebar-text); }
.topbar .btn-ghost:hover { background: var(--sidebar-active-bg); color: #fff; }
.topbar-nav { display: flex; gap: var(--sp-1); overflow-x: auto; padding: 0 var(--sp-3) var(--sp-3); scrollbar-width: none; }
.topbar-nav .nav-item { white-space: nowrap; padding: 6px 10px; }
.topbar-nav .nav-group, .topbar-nav .nav-group-label { display: contents; }
.topbar-nav .nav-group-label { display: none; }
.topbar-nav .nav-item svg { display: none; }

.main { flex: 1; min-width: 0; }
.page { width: 100%; max-width: 1240px; margin: 0 auto; padding: var(--sp-6) var(--sp-4) var(--sp-12); }
@media (min-width: 720px) { .page { padding: var(--sp-8) var(--sp-8) var(--sp-12); } }
.page-narrow { max-width: 860px; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-6); }
.page-head .eyebrow { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: var(--sp-1); }
.page-head .eyebrow .status { text-transform: none; letter-spacing: 0; vertical-align: 1px; }
.page-head .sub { margin-top: var(--sp-1); color: var(--text-2); font-size: var(--fs-sm); }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; font-size: var(--fs-sm); color: var(--text-3); margin-bottom: var(--sp-2); }
.back:hover { color: var(--text); }

/* --------------------------------------------------------------------------
   Panels
   -------------------------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-3); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: var(--fs-base); }
.panel-head .meta { font-size: var(--fs-sm); color: var(--text-3); }
.panel-body { padding: var(--sp-5); }
.panel-body.tight { padding: 0; }
.panel-foot { padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.panel + .panel { margin-top: 0; }
.panel-plain { border: 0; background: transparent; }
.section-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: var(--sp-2); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 36px; padding: 0 var(--sp-4);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: 600 var(--fs-sm)/1 var(--font-sans); cursor: pointer; white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn:hover { text-decoration: none; border-color: var(--text-3); background: var(--surface-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-brand); }
.btn-danger { background: var(--surface); border-color: var(--danger-line); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--brand-text); }
.btn-ghost:hover { background: var(--brand-soft); border-color: transparent; }
.btn-sm { min-height: 30px; padding: 0 var(--sp-3); font-size: var(--fs-xs); }
.btn-lg { min-height: 44px; padding: 0 var(--sp-6); font-size: var(--fs-base); }
.btn-block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
form.inline { display: inline; }

/* --------------------------------------------------------------------------
   Status (one vocabulary: see ux.PHASES)
   -------------------------------------------------------------------------- */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px 2px 8px; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 600; line-height: 18px; white-space: nowrap;
  background: var(--neutral-soft); color: var(--neutral); border: 1px solid var(--neutral-line);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.is-plain::before { display: none; }
.status-ok, .status-confirmed, .status-done, .status-paid { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.status-warn, .status-signature, .status-waiting, .status-pending { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.status-danger, .status-cancelled, .status-overdue, .status-urgent { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.status-info, .status-new, .status-action { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.status-brand { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; }
.status-neutral, .status-preparing, .status-draft { background: var(--neutral-soft); color: var(--neutral); border-color: var(--neutral-line); }
.status-done { opacity: .9; }

.pill { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; }

.tone-ok { color: var(--ok); } .tone-warn { color: var(--warn); } .tone-danger { color: var(--danger); }
.tone-action { color: var(--info); } .tone-neutral { color: var(--text-2); }

/* --------------------------------------------------------------------------
   Date stamp: the signature element (a gig listing date)
   -------------------------------------------------------------------------- */
.datestamp {
  display: inline-grid; justify-items: center;
  width: 52px; flex-shrink: 0; padding: 4px 0 5px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.datestamp .d { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--text); }
.datestamp .m { margin-top: 3px; font-size: 12px; letter-spacing: .04em; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.datestamp.is-past { opacity: .55; }
.datestamp .y { margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.datestamp.is-lg { width: 64px; padding: 8px 0; }
.datestamp.is-lg .d { font-size: 1.75rem; }

/* --------------------------------------------------------------------------
   Tables & key-value
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { padding: var(--sp-2) var(--sp-4); text-align: left; font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.table td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; white-space: nowrap; }
.table a.rowlink { color: var(--text); font-weight: 600; }
.table .sub { display: block; font-size: var(--fs-xs); color: var(--text-3); font-weight: 400; }
.table-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); }

.kv { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: var(--sp-2) var(--sp-5); font-size: var(--fs-sm); }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: var(--sp-2); } }

.facts { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.fact .label { font-size: var(--fs-xs); color: var(--text-3); }
.fact .value { margin-top: 2px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.fact .note { font-size: var(--fs-xs); color: var(--text-3); }

.stat { padding: var(--sp-4) var(--sp-5); }
.stat .value { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .label { margin-top: var(--sp-1); font-size: var(--fs-sm); color: var(--text-2); }
.stat .note { font-size: var(--fs-xs); color: var(--text-3); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stats .stat + .stat { border-left: 1px solid var(--border); }
@media (max-width: 899px) { .stats .stat:nth-child(3) { border-left: 0; } .stats .stat:nth-child(n+3) { border-top: 1px solid var(--border); } }

/* --------------------------------------------------------------------------
   Next action + status strip (booking workspace header)
   -------------------------------------------------------------------------- */
.next {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-5);
  padding: var(--sp-4) var(--sp-5); border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
}
.next .who { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.next .title { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 600; }
.next .detail { font-size: var(--fs-sm); color: var(--text-2); }
.next .body { flex: 1; min-width: 220px; }
.next.is-urgent { border-color: var(--danger-line); background: var(--danger-soft); }
.next.is-urgent .who { color: var(--danger); }
.next.is-action { border-color: var(--info-line); background: var(--info-soft); }
.next.is-action .who { color: var(--info); }
.next.is-waiting .who { color: var(--warn); }
.next.is-done .who { color: var(--ok); }

.strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
@media (min-width: 900px) { .strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.strip a { display: block; padding: var(--sp-3) var(--sp-4); color: inherit; }
.strip a:hover { background: var(--surface-2); text-decoration: none; }
.strip a + a { border-left: 1px solid var(--border); }
@media (max-width: 899px) { .strip a:nth-child(3) { border-left: 0; } .strip a:nth-child(n+3) { border-top: 1px solid var(--border); } }
.strip .label { font-size: var(--fs-xs); color: var(--text-3); }
.strip .value { margin-top: 2px; font-size: var(--fs-sm); font-weight: 600; }
.strip .value::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--border-strong); vertical-align: 1px; }
.strip .tone-ok::before { background: var(--ok); } .strip .tone-warn::before { background: var(--warn); }
.strip .tone-danger::before { background: var(--danger); } .strip .tone-action::before { background: var(--info); }
.strip .value.tone-neutral { color: var(--text); }

/* --------------------------------------------------------------------------
   Tabs (server-side: each tab is a link, ?tab=)
   -------------------------------------------------------------------------- */
.tabs { display: flex; gap: var(--sp-1); overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: var(--sp-3) var(--sp-3); color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"]::after { content: ""; position: absolute; left: var(--sp-2); right: var(--sp-2); bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.tab .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.tab .dot.is-action { background: var(--info); }
.tab .count { font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--radius-sm); background: var(--surface-3); }
.segmented a { padding: 5px 12px; border-radius: 5px; color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; }
.segmented a:hover { color: var(--text); text-decoration: none; }
.segmented a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.segmented .count { margin-left: 4px; color: var(--text-3); font-weight: 500; }

/* --------------------------------------------------------------------------
   Task list (Today inbox)
   -------------------------------------------------------------------------- */
.tasks { list-style: none; }
.task { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--border); }
.task:last-child { border-bottom: 0; }
.task .body { flex: 1; min-width: 0; }
.task .title { font-weight: 600; color: var(--text); }
.task .subject { font-size: var(--fs-sm); color: var(--text-2); }
.task .detail { font-size: var(--fs-xs); color: var(--text-3); }
.task .flag { flex-shrink: 0; }
.task:hover { background: var(--surface-2); }
@media (max-width: 640px) { .task { flex-wrap: wrap; } .task .cta { width: 100%; } .task .cta .btn { width: 100%; } }

/* --------------------------------------------------------------------------
   Callouts
   -------------------------------------------------------------------------- */
.callout { padding: var(--sp-4) var(--sp-5); border-radius: var(--radius); border: 1px solid var(--neutral-line); background: var(--neutral-soft); font-size: var(--fs-sm); }
.callout .title { font-weight: 600; color: var(--text); margin-bottom: 2px; }
.callout-warn { border-color: var(--warn-line); background: var(--warn-soft); }
.callout-warn .title { color: var(--warn); }
.callout-danger { border-color: var(--danger-line); background: var(--danger-soft); }
.callout-danger .title { color: var(--danger); }
.callout-info { border-color: var(--info-line); background: var(--info-soft); }
.callout-info .title { color: var(--info); }
.callout-ok { border-color: var(--ok-line); background: var(--ok-soft); }
.callout-ok .title { color: var(--ok); }
.callout .actions { margin-top: var(--sp-3); }

/* flash messages */
.flashes { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.flash { padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm); border: 1px solid var(--ok-line); background: var(--ok-soft); color: var(--text); font-size: var(--fs-sm); }
.flash-error { border-color: var(--danger-line); background: var(--danger-soft); }
.flash-warning { border-color: var(--warn-line); background: var(--warn-soft); }
.flash-info { border-color: var(--info-line); background: var(--info-soft); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-grid { display: grid; gap: var(--sp-4) var(--sp-5); grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .span-2 { grid-column: span 2; } }
@media (min-width: 900px) { .form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .form-grid.cols-3 .span-3 { grid-column: span 3; } }
.field-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.label .opt { font-weight: 400; color: var(--text-3); }
.label .req { color: var(--danger); }
.help { font-size: var(--fs-xs); color: var(--text-3); }
.errorlist, .field-error { list-style: none; margin: 0; padding: 0; font-size: var(--fs-xs); color: var(--danger); font-weight: 600; }
.field, .field-group input:not([type=checkbox]):not([type=radio]):not([type=file]), .field-group select, .field-group textarea {
  width: 100%; min-height: 38px; padding: 8px 11px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field-group textarea, textarea.field { min-height: 88px; resize: vertical; line-height: 1.5; }
.field:focus, .field-group input:focus, .field-group select:focus, .field-group textarea:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent); }
.field::placeholder, .field-group input::placeholder, .field-group textarea::placeholder { color: var(--text-3); opacity: .8; }
.field-group.has-error input, .field-group.has-error select, .field-group.has-error textarea { border-color: var(--danger); }
.field-group input[type=file], input[type=file].field { padding: 6px; font-size: var(--fs-sm); color: var(--text-2); }
input[type=file]::file-selector-button { margin-right: var(--sp-3); padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--surface-2); color: var(--text); font: 600 var(--fs-xs) var(--font-sans); cursor: pointer; }
.check { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-size: var(--fs-sm); cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); flex-shrink: 0; }
fieldset.section { border: 0; margin: 0; padding: 0; }
fieldset.section legend { padding: 0; margin-bottom: var(--sp-4); font-family: var(--font-display); font-size: var(--fs-md); font-weight: 600; color: var(--text); }
fieldset.section legend .step { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-right: var(--sp-2); border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); font-size: var(--fs-sm); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); padding-top: var(--sp-4); }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-2); }
.inline-form .field-group { flex: 1; min-width: 180px; }
.amount { display: flex; align-items: center; gap: 6px; }
.amount input { width: 110px !important; text-align: right; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Feed (timeline), mail archive, folds
   -------------------------------------------------------------------------- */
.feed { list-style: none; }
.feed li { position: relative; padding: 0 0 var(--sp-4) var(--sp-5); }
.feed li::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: -2px; width: 1px; background: var(--border); }
.feed li:last-child::before { display: none; }
.feed li::after { content: ""; position: absolute; left: 0; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.feed li.by-promoter::after { border-color: var(--brand); }
.feed li.by-system::after { border-color: var(--text-3); }
.feed .what { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.feed .meta { font-size: var(--fs-xs); color: var(--text-3); }
.feed .details { margin-top: 2px; font-size: var(--fs-xs); color: var(--text-2); overflow-wrap: anywhere; }

details.fold { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
details.fold + details.fold { margin-top: var(--sp-2); }
details.fold > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); cursor: pointer; list-style: none; font-size: var(--fs-sm); font-weight: 600; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg); transition: transform var(--dur) var(--ease); flex-shrink: 0; }
details.fold[open] > summary::after { transform: rotate(-135deg); }
details.fold > summary .sub { font-weight: 400; color: var(--text-3); font-size: var(--fs-xs); margin-left: auto; text-align: right; }
details.fold > summary > span:first-child { min-width: 0; }
details.fold > .fold-body { padding: 0 var(--sp-4) var(--sp-4); }

.empty { padding: var(--sp-8) var(--sp-5); text-align: center; color: var(--text-3); font-size: var(--fs-sm); }
.empty .title { color: var(--text-2); font-weight: 600; margin-bottom: 2px; }

/* --------------------------------------------------------------------------
   Paper: contract / rider documents rendered on screen
   -------------------------------------------------------------------------- */
.paper {
  max-width: 820px; margin: 0 auto; padding: var(--sp-8) var(--sp-8);
  background: #ffffff; color: #121826; border: 1px solid #e1e5eb; border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 15px; line-height: 1.6; font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) { .paper { padding: var(--sp-5) var(--sp-4); font-size: 15px; } }
.paper h1, .paper h2, .paper h3 { font-family: var(--font-display); font-weight: 600; color: #121826; letter-spacing: -0.01em; }
.paper h1 { margin: 1.6em 0 .6em; padding-top: .6em; border-top: 2px solid #121826; font-size: 19px; }
.paper h1:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.paper h2 { margin: 1.6em 0 .6em; font-size: 16px; border-bottom: 1px solid #d6dbe3; padding-bottom: 4px; }
.paper h3 { margin: 1.2em 0 .4em; font-size: 15px; }
.paper p { margin: .6em 0; }
.paper ul, .paper ol { margin: .5em 0 .5em 1.4em; }
.paper table { width: 100%; border-collapse: collapse; margin: .8em 0; font-size: 14px; }
.paper th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #6b7280; border-bottom: 1.5px solid #121826; padding: 6px 8px 6px 0; }
.paper td { padding: 8px 8px 8px 0; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
.paper td:first-child { color: #4b5563; }
.paper .table-scroll { overflow-x: auto; }
.paper img { margin: 0 auto 1em; max-height: 72px; border-radius: 14px; }
.paper-frame { max-height: 560px; overflow-y: auto; padding: var(--sp-4); background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* --------------------------------------------------------------------------
   Steps (promoter progress) and to-do list
   -------------------------------------------------------------------------- */
.steps { display: flex; list-style: none; gap: 0; counter-reset: step; overflow-x: auto; }
.steps li { flex: 1; min-width: 90px; position: relative; padding-top: 22px; font-size: var(--fs-xs); color: var(--text-3); text-align: center; }
.steps li::before { content: ""; position: absolute; top: 6px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); z-index: 1; }
.steps li::after { content: ""; position: absolute; top: 11px; left: calc(50% + 8px); right: calc(-50% + 8px); height: 2px; background: var(--border); }
.steps li:last-child::after { display: none; }
.steps li.is-done { color: var(--text-2); }
.steps li.is-done::before { background: var(--ok); border-color: var(--ok); }
.steps li.is-done::after { background: var(--ok); }
.steps li.is-current { color: var(--text); font-weight: 600; }
.steps li.is-current::before { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

.todo { list-style: none; display: flex; flex-direction: column; gap: var(--sp-2); }
.todo li { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5); border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.todo li .mark { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); }
.todo li.is-now { border-color: var(--brand); background: var(--brand-soft); }
.todo li.is-now .mark { border-color: var(--brand); }
.todo li.is-late { border-color: var(--danger-line); background: var(--danger-soft); }
.todo li.is-late .mark { border-color: var(--danger); }
.todo li.is-done { opacity: .75; }
.todo li.is-done .mark { background: var(--ok); border-color: var(--ok); }
.todo .body { flex: 1; min-width: 0; }
.todo .title { font-weight: 600; color: var(--text); }
.todo .detail { font-size: var(--fs-sm); color: var(--text-2); }
@media (max-width: 640px) { .todo li { flex-wrap: wrap; } .todo li .cta { width: 100%; } .todo li .cta .btn { width: 100%; } }

/* --------------------------------------------------------------------------
   Calendar
   -------------------------------------------------------------------------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal .dow { padding: var(--sp-2); font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); text-align: center; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal .day { min-height: 96px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); font-size: var(--fs-xs); }
.cal .day.is-other { background: var(--surface-2); color: var(--text-3); }
.cal .day.is-today .n { background: var(--brand); color: var(--on-brand); }
.cal .n { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal .ev { display: block; margin-top: 4px; padding: 3px 6px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .ev:hover { text-decoration: none; border-color: var(--text-3); }
.cal .ev.status-confirmed, .cal .ev.status-done { border-left: 3px solid var(--ok); }
.cal .ev.status-signature { border-left: 3px solid var(--warn); }
.cal .ev.status-preparing { border-left: 3px solid var(--neutral); }
.cal .ev.is-request { border-style: dashed; background: transparent; color: var(--text-2); }
@media (max-width: 720px) { .cal-wrap { display: none; } }
.agenda { list-style: none; }
.agenda li { display: flex; gap: var(--sp-4); align-items: center; padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--border); }
.agenda li:last-child { border-bottom: 0; }

/* --------------------------------------------------------------------------
   Public surface
   -------------------------------------------------------------------------- */
.pub-header { border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 88%, transparent); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px); }
.pub-header .inner { display: flex; align-items: center; justify-content: space-between; max-width: 1080px; margin: 0 auto; padding: var(--sp-3) var(--sp-4); }
.pub-header .brandmark { padding: 0; color: var(--text); }
.pub-header .brandmark span { color: var(--text-3); }
.pub-main { max-width: 1080px; margin: 0 auto; padding: var(--sp-8) var(--sp-4) var(--sp-12); }
.pub-main.narrow { max-width: 760px; }
.pub-footer { border-top: 1px solid var(--border); padding: var(--sp-6) var(--sp-4); text-align: center; font-size: var(--fs-xs); color: var(--text-3); }
.pub-footer a { color: var(--text-2); }
.hero { padding: var(--sp-8) 0 var(--sp-10); }
.hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.05; letter-spacing: -0.02em; max-width: 14ch; }
.hero .lede { margin-top: var(--sp-4); max-width: 56ch; font-size: var(--fs-md); color: var(--text-2); }
.kicker { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-text); }

.roster { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.artist-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; color: inherit; transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.artist-card:hover { border-color: var(--border-strong); text-decoration: none; transform: translateY(-2px); }
.artist-card .photo { aspect-ratio: 1 / 1; background: var(--surface-3); display: flex; align-items: center; justify-content: center; }
.artist-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.artist-card .initial { font-family: var(--font-display); font-size: 4rem; color: var(--text-3); }
.artist-card .body { padding: var(--sp-4) var(--sp-5) var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; }
.artist-card .name { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; color: var(--text); }
.artist-card .bio { font-size: var(--fs-sm); color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.artist-card .go { margin-top: auto; padding-top: var(--sp-3); font-size: var(--fs-sm); font-weight: 600; color: var(--brand-text); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: var(--fs-xs); color: var(--text-2); }

.howto { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; counter-reset: how; margin-top: var(--sp-10); }
@media (min-width: 720px) { .howto { grid-template-columns: repeat(4, 1fr); } }
.howto li { list-style: none; padding-top: var(--sp-3); border-top: 2px solid var(--border-strong); font-size: var(--fs-sm); color: var(--text-2); }
.howto li strong { display: block; color: var(--text); font-family: var(--font-display); font-size: var(--fs-base); margin-bottom: 2px; }
.howto li::before { counter-increment: how; content: "0" counter(how); display: block; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--brand-text); margin-bottom: var(--sp-1); }

.profile { display: grid; gap: var(--sp-6); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 860px) { .profile { grid-template-columns: 280px minmax(0, 1fr); } }
.profile .photo { aspect-ratio: 1/1; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-3); display: flex; align-items: center; justify-content: center; }
.profile .photo img { width: 100%; height: 100%; object-fit: cover; }
.links { display: flex; flex-wrap: wrap; gap: var(--sp-3); font-size: var(--fs-sm); }

.portal-head { padding: var(--sp-6) 0 var(--sp-5); }
.portal-head h1 { font-size: clamp(1.6rem, 4vw, 2.25rem); }
.portal-head .where { margin-top: var(--sp-1); color: var(--text-2); }
.moneyband { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-5); border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); }
.moneyband .amount-now { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.moneyband.is-late { border-color: var(--danger-line); }

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */
@media print {
  .sidebar, .topbar, .tabs, .btn, .pub-header, .pub-footer { display: none !important; }
  body { background: #fff; }
  .panel { border-color: #ccc; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* --- lead: public forms and portal helpers --- */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-card { padding: var(--sp-6); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
@media (max-width: 640px) { .form-card { padding: var(--sp-5) var(--sp-4); } }
.form-card fieldset.section + fieldset.section { margin-top: var(--sp-8); padding-top: var(--sp-6); border-top: 1px solid var(--border); }
.rating { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.rating label { cursor: pointer; font-size: 28px; line-height: 1; color: var(--border-strong); }
.rating label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating label.is-on, .rating label:hover, .rating label:hover ~ label { color: #f5b84d; }
.rating label:focus-within { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
.todo li.is-waiting .mark { border-color: var(--info); border-style: dashed; }
.todo li.is-later { opacity: .8; }

/* --- pages: money/calendar/roster --- */
dl.kv { margin: 0; }
.rating { flex-direction: row; }
.rating label:hover ~ label { color: var(--border-strong); }
.rating label.is-on { color: #f5b84d; }
.profile .initial { font-family: var(--font-display); font-size: 5rem; color: var(--text-3); }
.single { max-width: 640px; margin: 0 auto; }
.center { text-align: center; }
.split > * { min-width: 0; }
.prose { color: var(--text-2); max-width: 68ch; }
.prose h2 { margin: var(--sp-8) 0 var(--sp-2); font-size: var(--fs-lg); }
.prose p, .prose ul { margin: var(--sp-3) 0; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: var(--sp-2) 0; }
.prose strong { color: var(--text); }
.items-table td { vertical-align: top; }
.items-table td:first-child { min-width: 220px; }
.items-table td:nth-child(2) { min-width: 180px; }
.items-table .num .field { width: 104px; text-align: right; font-variant-numeric: tabular-nums; }
.items-table .item-amount { padding-top: 20px; }
.items-table td:last-child { padding-top: 15px; }

/* --- pages: forms/log/settings --- */
.bullets { padding-left: 1.2em; }
.bullets li + li { margin-top: var(--sp-1); }
.callout .bullets { margin-top: var(--sp-1); }
.field-group.is-code textarea { min-height: 520px; font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 1.65; tab-size: 2; }
.log-day + .log-day { margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px solid var(--border); }
.log-day .section-label { margin-bottom: var(--sp-3); }
.log-day .section-label .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.log-search { flex: 1; }
.log-search .field-group:first-child { min-width: 240px; flex: 2; }
.help-steps { margin-top: 0; }
.help-steps .status { display: inline-flex; margin: 0 0 var(--sp-2); }
@media (min-width: 1100px) { .help-steps { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.empty .forbidden-code { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .1em; color: var(--danger); margin-bottom: var(--sp-2); }
.empty .cluster { justify-content: center; }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--sp-10) var(--sp-4); }
.login-card { width: 100%; max-width: 380px; box-shadow: var(--shadow-pop); }
.login-card .panel-body { padding: var(--sp-8) var(--sp-6); }
.login-brand { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.login-brand img { width: 44px; height: 44px; border-radius: var(--radius-sm); }
.login-brand h1 { font-size: var(--fs-lg); }
.login .flashes { margin-bottom: 0; }
.login-foot { text-align: center; }
fieldset.section { min-width: 0; }
.form-card .field-group textarea, .panel .field-group textarea { height: 6.5em; }
.steps li.is-skipped::before { background: var(--surface); border-color: var(--ok); }
.avatar { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 56px; height: 56px; overflow: hidden; border-radius: var(--radius); background: var(--surface-3); color: var(--text-3); font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.is-lg { width: 96px; height: 96px; font-size: var(--fs-2xl); }
.checklist { list-style: none; display: grid; gap: var(--sp-1); font-size: var(--fs-sm); }
.checklist li { display: flex; align-items: center; gap: var(--sp-2); color: var(--text-2); }
.checklist li::before { content: ""; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.checklist li.is-missing { color: var(--text-3); }
.checklist li.is-missing::before { background: transparent; border: 2px solid var(--warn); }
details.fold > summary .stack-sm .sub { margin-left: 0; text-align: left; }
.panel .field-group textarea.is-tall { height: auto; min-height: 320px; }

/* --- lead: mobile type (UI UX Pro Max: readable-font-size) ---
   Body text at least 16px on phones, and form controls at 16px so iOS
   does not zoom into a field on focus. */
@media (max-width: 640px) {
  body.ui-manage { --fs-base: 1rem; }
  .field, .field-group input:not([type=checkbox]):not([type=radio]):not([type=file]),
  .field-group select, .field-group textarea, .amount input, .items-table input { font-size: 16px; }
}


/* ==========================================================================
   UI UX Pro Max audit fixes (docs/v2/04-ux-audit.md). Rule ids in brackets.
   ========================================================================== */

/* [z-index-management] one layered scale */
:root { --z-sticky: 20; --z-topbar: 30; --z-overlay: 40; --z-toast: 50; }
.pub-header { z-index: var(--z-sticky); }
.topbar { z-index: var(--z-topbar); }

/* [skip-links] */
.skip-link { position: absolute; left: var(--sp-4); top: -60px; z-index: var(--z-toast); padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-sm); background: var(--brand); color: var(--on-brand); font-weight: 600; }
.skip-link:focus { top: var(--sp-3); text-decoration: none; }

/* [focus-not-obscured] sticky headers never cover a focused control; [Smooth Scroll] with reduced-motion guard */
html { scroll-padding-top: 88px; }
@media (min-width: 1024px) { body.ui-manage { scroll-padding-top: var(--sp-6); } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* [tap-delay] [cursor-pointer] */
a, button, summary, label, input, select, textarea, .btn { touch-action: manipulation; }
summary, label.check, select { cursor: pointer; }

/* [press-feedback] [state-clarity] pressed state without moving layout */
.btn:active:not(:disabled) { filter: brightness(.92); }
.btn-primary:active:not(:disabled) { filter: brightness(.88); }
.task:active, .strip a:active, .artist-card:active { background: var(--surface-3); }

/* [loading-buttons] busy state set by ui.js on submit */
.btn.is-busy { opacity: .7; cursor: progress; }
.btn.is-busy::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: ui-spin .7s linear infinite; }
@keyframes ui-spin { to { transform: rotate(360deg); } }

/* [error-placement] [inline-validation] */
.field-group.has-error .label { color: var(--danger); }
.field-error-live:empty { display: none; }
.error-summary { padding: var(--sp-4) var(--sp-5); border: 2px solid var(--danger); border-radius: var(--radius); background: var(--danger-soft); }
.error-summary:focus { outline: 3px solid var(--ring); outline-offset: 2px; }
.error-summary a { color: var(--danger); font-weight: 600; }

/* [heading-line-balance] [long-token-wrapping] */
h1, h2, .title { text-wrap: balance; }
td, dd, .sub, .detail { overflow-wrap: anywhere; }

/* [read-only-distinction] locked values are text, disabled controls look disabled */
.btn:disabled, .field:disabled { opacity: .5; cursor: not-allowed; }

/* [web-target-size] small inline links that stand alone get a 24px+ target */
.panel-foot a, .panel-head a.small, .agenda a.strong, .task .subject a { display: inline-block; padding: 4px 0; }

/* [touch-target-size] [touch-friendly-input] 44px on phones */
@media (max-width: 640px) {
  .btn, .btn-sm { min-height: 44px; }
  .field, .field-group input:not([type=checkbox]):not([type=radio]):not([type=file]), .field-group select { min-height: 44px; }
  .tab, .segmented a { min-height: 44px; display: inline-flex; align-items: center; }
  .back { min-height: 44px; }
  details.fold > summary { min-height: 44px; }
  .topbar-nav .nav-item, .mobile-more summary { min-height: 44px; }
  .topbar .brandmark { min-height: 44px; }
  .pub-header .brandmark, .pub-header nav a { min-height: 44px; display: inline-flex; align-items: center; }
  .panel-foot a, .panel-head a.small { padding: 12px 0; }
}

/* [bottom-nav-limit] [nav-hierarchy] phones: 4 primary items + More */
.mobile-more { position: relative; }
.mobile-more summary { list-style: none; display: flex; align-items: center; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--sidebar-text); font-size: var(--fs-sm); font-weight: 500; cursor: pointer; white-space: nowrap; }
.mobile-more summary::-webkit-details-marker { display: none; }
.mobile-more[open] summary { background: var(--sidebar-active-bg); color: #fff; }
.mobile-more .more-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: var(--z-overlay); min-width: 200px; padding: var(--sp-2); border-radius: var(--radius); background: var(--sidebar-bg); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; }
.topbar-nav { overflow: visible; flex-wrap: wrap; }

/* [color-contrast] the contract paper is always a light document, also on the dark portal */
.paper {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f2f4f7; --surface-3: #e9ecf1; --border: #e1e5eb; --border-strong: #c9cfd8;
  --text: #121826; --text-2: #3f4a5c; --text-3: #5d6879; --link: #5b2bc9;
  --ok: #0f7a4d; --ok-soft: #e7f6ee; --ok-line: #b5e2c9; --warn: #8a5000; --warn-soft: #fff5e1; --warn-line: #f3d391;
  --danger: #b42318; --danger-soft: #fdecea; --danger-line: #f5b9b2;
  color: var(--text);
}
.paper h2 { margin: 1.6em 0 .6em; padding-top: .6em; border-top: 2px solid #121826; font-size: 19px; border-bottom: 0; }
.paper h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.paper h3 { margin: 1.6em 0 .6em; font-size: 16px; border-bottom: 1px solid #d6dbe3; padding-bottom: 4px; }
.paper h4 { margin: 1.2em 0 .4em; font-size: 15px; font-family: var(--font-display); }

/* [dark-mode-pairing] [color-dark-mode] the dashboard follows the system theme */
@media (prefers-color-scheme: dark) {
  body.ui-manage {
    --bg: #0f0c16; --surface: #17121f; --surface-2: #1e1829; --surface-3: #282034;
    --border: #2e2640; --border-strong: #463b5c;
    --text: #f4f1fa; --text-2: #cdc6dc; --text-3: #a59cb9; --link: #c4b1ff;
    --brand: #7c4dff; --brand-hover: #6a3af0; --brand-soft: #241a3b; --brand-text: #c4b1ff; --on-brand: #ffffff; --ring: #b69cff;
    --ok: #4ad295; --ok-soft: #10261c; --ok-line: #1d5b40;
    --warn: #f5b84d; --warn-soft: #2b2010; --warn-line: #6b5020;
    --danger: #ff8b80; --danger-soft: #2e1414; --danger-line: #6e2a25;
    --info: #8fb4ff; --info-soft: #141f36; --info-line: #2c4677;
    --neutral: #b9b1cc; --neutral-soft: #221c2e; --neutral-line: #3b3150;
    --shadow-pop: 0 12px 32px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}

/* [color-contrast] text on the solid danger button in both themes */
:root { --on-danger: #ffffff; }
@media (prefers-color-scheme: dark) { body.ui-manage { --on-danger: #2a0a07; } }
body.ui-public { --on-danger: #2a0a07; }
.btn-danger-solid { color: var(--on-danger); }

/* [web-target-size] checkboxes and radios: 20px boxes inside full-width
   labels; the spacing exception of WCAG 2.5.8 covers the remaining gap. */
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--brand); }

/* [web-target-size] links that stand alone in lists, tables and nav rows */
.table td > a, .agenda .body > a, .kv dd > a, .artist-card a, nav.cluster a, .cluster > a:not(.btn), .stack-sm > li > a, td > a:only-child { display: inline-block; padding-block: 3px; }
h2 > a, h3 > a, dt > a { display: inline-block; padding-block: 3px; min-width: 24px; }
