/* ==========================================================================
   PRTY OS — Components
   One definition per component. Screens compose these; they do not restyle them.
   ========================================================================== */

/* ---------- Icon ---------- */
.icon { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: middle; }

/* ---------- Buttons ---------- */
.btn {
  --btn-h: var(--h-ctl);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--btn-h); padding: 0 12px;
  border-radius: var(--r-2);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-13); font-weight: 500;
  white-space: nowrap; user-select: none;
  transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1), transform var(--dur-1);
}
.btn:hover { background: var(--surface-3); border-color: #3A3E44; }
.btn:active { transform: translateY(0.5px); }
.btn .icon { color: var(--text-2); }
.btn--primary { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }
.btn--primary .icon { color: var(--on-inverse); }
.btn--primary:hover { background: #FFFFFF; border-color: #FFFFFF; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--hover); border-color: transparent; color: var(--text); }
.btn--danger { color: var(--red); }
.btn--sm { --btn-h: var(--h-ctl-sm); padding: 0 9px; font-size: var(--fs-12); }
.btn--sm .icon { width: 14px; height: 14px; }
.btn--icon { width: var(--btn-h); padding: 0; }
.btn[disabled], .btn.is-disabled { opacity: 0.45; pointer-events: none; }
.btn.is-active { background: var(--press); color: var(--text); }
.btn__count { font-size: var(--fs-11); color: var(--text-3); font-variant-numeric: tabular-nums; }
.btn--primary .btn__count { color: rgba(12, 13, 15, 0.6); }

.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 4px;
  font: 500 var(--fs-10)/1 var(--font); color: var(--text-3);
  background: var(--surface-2);
}

/* ---------- Pill (status) ---------- */
.pill {
  --c: var(--grey);
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px 0 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 13%, transparent);
  color: color-mix(in srgb, var(--c) 78%, var(--text));
  font-size: var(--fs-12); font-weight: 500;
  white-space: nowrap; line-height: 1;
  transition: background var(--dur-3) var(--ease), color var(--dur-3) var(--ease);
}
.pill__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); flex-shrink: 0; transition: background var(--dur-3) var(--ease); }
.pill--dashed .pill__dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.pill--outline { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent); }
.pill--sm { height: 20px; font-size: var(--fs-11); padding: 0 7px 0 6px; gap: 5px; }
.pill .icon { width: 12px; height: 12px; stroke-width: 2; }
.pill--changed { animation: pulse-ring 700ms var(--ease); }

.dot { --c: var(--grey); width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; flex-shrink: 0; }
.dot--sm { width: 6px; height: 6px; }
.dot--ring { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }

/* Neutral tag (brand, category) */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 6px;
  border-radius: var(--r-1);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font: 500 var(--fs-11)/1 var(--font);
  white-space: nowrap;
}
.brand {
  display: inline-flex; align-items: center; justify-content: center;
  height: 18px; min-width: 38px; padding: 0 5px;
  border-radius: 3px;
  font: 600 10px/1 var(--mono); letter-spacing: 0.06em;
  white-space: nowrap;
}
.brand--PRTY { background: var(--text); color: var(--on-inverse); }
.brand--NRG { box-shadow: inset 0 0 0 1px var(--text-2); color: var(--text); }
.brand--other { box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-2); }
.brand--collab { padding: 0; gap: 0; min-width: 0; background: transparent; }
.brand--collab .brand__part { display: inline-flex; align-items: center; height: 18px; padding: 0 5px; border-radius: 3px; }
.brand__x { padding: 0 4px; color: var(--text-3); font-weight: 500; }

/* ---------- Brand select ---------- */
.brandsel { position: relative; display: inline-flex; }
.brandsel__trigger { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: var(--surface); color: var(--text-3); }
.brandsel__trigger:hover { border-color: #3A3E44; }
.brandsel__trigger.is-sm { height: 28px; padding: 0 8px; }
.brandsel__pop { top: calc(100% + 4px); width: 300px; max-height: 420px; overflow-y: auto; }
.brandsel__form { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
.brandsel__collab { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.3fr); gap: 6px; align-items: center; }

/* ---------- Time, duration, booking fee, VAT inputs ---------- */
.timeinput { width: 72px; text-align: center; font-variant-numeric: tabular-nums; }
.timeinput.input--sm { width: 64px; }
.is-invalid, .input.is-invalid { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent); }
.dursel { width: 96px; }
.durinput, .bfee__pct, .vatinput { width: 64px; text-align: right; }
.vatsel { width: 84px; }
.settime { display: flex; gap: var(--s-2); align-items: flex-end; flex-wrap: wrap; }
.settime--stack { flex-direction: column; align-items: stretch; }
.settime__f { display: flex; flex-direction: column; gap: 4px; }
.settime__l { font-size: var(--fs-11); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.bfee { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.bfee__sel { width: 136px; }
.bfee__val { min-width: 64px; text-align: right; }
.bfee__fixed { display: inline-flex; align-items: center; gap: 2px; min-width: 88px; }
.bfee__reset { color: var(--text-3); padding: 2px; border-radius: 3px; }
.bfee__reset:hover { color: var(--text); background: var(--hover); }

/* ---------- Event forecast (persistent summary) ---------- */
.efc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.efc__head { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 12px var(--s-4); border-bottom: 1px solid var(--line-soft); }
.efc__title { font-size: var(--fs-11); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); }
.efc__group { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.efc__group:last-of-type { border-bottom: 0; }
.efc__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 5px var(--s-4); transition: background var(--dur-3) var(--ease); }
.efc__row.is-flash { background: color-mix(in srgb, var(--text) 5%, transparent); }
.efc__label { color: var(--text-3); font-size: var(--fs-12); }
.efc__value { font-size: var(--fs-13); font-weight: 500; color: var(--text); white-space: nowrap; }
.efc__value small { font-size: var(--fs-11); color: var(--text-3); font-weight: 400; }
.efc__row.is-strong .efc__label { color: var(--text-2); font-weight: 500; }
.efc__row.is-strong .efc__value { font-size: var(--fs-16); font-weight: 600; letter-spacing: -0.01em; }
.efc__value.c-green { color: var(--green); } .efc__value.c-red { color: var(--red); } .efc__value.c-amber { color: var(--amber); }
.efc__foot { padding: 10px var(--s-4); border-top: 1px solid var(--line-soft); font-size: var(--fs-11); color: var(--text-3); }

/* Importance badge (advancing) */
.imp { display: inline-flex; align-items: center; gap: 4px; font: 600 var(--fs-10)/1 var(--font); text-transform: uppercase; letter-spacing: 0.07em; white-space: nowrap; }
.imp--critical { color: var(--red); }
.imp--important { color: var(--text-2); }
.imp--optional { color: var(--text-4); }
.imp .icon { width: 12px; height: 12px; stroke-width: 2.25; }

/* Priority signal bars */
.signal { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.signal i { width: 3px; background: var(--line-strong); border-radius: 1px; }
.signal i:nth-child(1) { height: 5px; } .signal i:nth-child(2) { height: 8px; } .signal i:nth-child(3) { height: 12px; }
.signal i.on { background: var(--text); }

/* ---------- Avatar ---------- */
.avatar {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-grid; place-items: center; flex-shrink: 0;
  background: var(--surface-4); color: var(--text-2);
  font: 600 9px/1 var(--font); letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.avatar--lg { width: 40px; height: 40px; font-size: 13px; }
.avatar--xl { width: 56px; height: 56px; font-size: 17px; border-radius: 12px; }
.avatar--sq { border-radius: 6px; }
.person { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--text-2); }

/* ---------- Panel ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); min-width: 0; }
.panel__head { display: flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-4); border-bottom: 1px solid var(--line-soft); }
.panel__title { font-size: var(--fs-13); font-weight: 600; letter-spacing: -0.005em; display: flex; align-items: center; gap: 8px; }
.panel__count { color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.panel__actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.panel__body { padding: var(--s-4); }
.panel__body--flush { padding: 0; }
.panel__foot { border-top: 1px solid var(--line-soft); padding: 10px var(--s-4); display: flex; align-items: center; gap: var(--s-2); color: var(--text-3); font-size: var(--fs-12); }
.panel--quiet { background: transparent; }

/* Section label (unboxed grouping) */
.section-label { display: flex; align-items: center; gap: 8px; min-height: 28px; margin-bottom: var(--s-3); }
.section-label__text { font-size: var(--fs-11); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.section-label__count { font-size: var(--fs-11); color: var(--text-4); font-variant-numeric: tabular-nums; }
.section-label__right { margin-left: auto; display: flex; gap: 6px; align-items: center; }

/* ---------- KPI strip ---------- */
.kpis { display: grid; grid-template-columns: repeat(var(--kpi-cols, 6), minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); overflow: hidden; }
.kpi { padding: 14px var(--s-4) 14px; border-left: 1px solid var(--line-soft); min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.kpi:first-child { border-left: 0; }
.kpi__label { font-size: var(--fs-11); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi__value { font-size: var(--fs-20); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; white-space: nowrap; color: var(--c, var(--text)); }
.kpi__value small { font-size: var(--fs-13); color: var(--text-3); font-weight: 500; letter-spacing: 0; margin-left: 2px; }
.kpi__sub { font-size: var(--fs-12); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.kpi--emph .kpi__value { font-size: var(--fs-24); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(min(var(--kpi-cols, 6), 4), minmax(0, 1fr)); } .kpi:nth-child(4n+1) { border-left: 0; } .kpi:nth-child(n+5) { border-top: 1px solid var(--line-soft); } }
@media (max-width: 720px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi { border-left: 0; border-top: 1px solid var(--line-soft); } .kpi:nth-child(-n+2) { border-top: 0; } .kpi:nth-child(even) { border-left: 1px solid var(--line-soft); } .kpi__value { font-size: 18px; } }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 10px; color: var(--text-3); font-weight: 500; white-space: nowrap;
  transition: color var(--dur-1);
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); }
.tab.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--text); border-radius: 2px 2px 0 0; }
.tab__count { font-size: var(--fs-11); color: var(--text-3); font-variant-numeric: tabular-nums; }
.tab__alert { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--red)); }

/* Segmented control */
.seg { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); }
.seg__opt { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 4px; color: var(--text-3); font-size: var(--fs-12); font-weight: 500; white-space: nowrap; transition: background var(--dur-1), color var(--dur-1); }
.seg__opt:hover { color: var(--text); }
.seg__opt.is-active { background: var(--surface-4); color: var(--text); }
.seg__opt .icon { width: 14px; height: 14px; }

/* Filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  --c: var(--text-3);
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--text-2); font-size: var(--fs-12); font-weight: 500;
  white-space: nowrap;
  transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1);
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.is-active { background: var(--press); border-color: var(--line-strong); color: var(--text); }
.chip__count { color: var(--text-3); font-variant-numeric: tabular-nums; }
.chip[disabled] { opacity: 0.4; pointer-events: none; }
.chip .dot { width: 7px; height: 7px; }
.chips__sep { width: 1px; height: 16px; background: var(--line); margin: 0 4px; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; padding: 0 0 var(--s-3); }

/* ---------- Form controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: var(--fs-12); color: var(--text-2); font-weight: 500; }
.field__hint { font-size: var(--fs-12); color: var(--text-3); }
.input, .select, .textarea {
  height: 34px; width: 100%;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  color: var(--text);
  font-size: var(--fs-13);
  outline: none;
  transition: border-color var(--dur-1), background var(--dur-1), box-shadow var(--dur-1);
}
.textarea { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:hover, .select:hover { border-color: #3A3E44; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(138, 164, 242, 0.14); }
.input--lg { height: 42px; font-size: var(--fs-16); padding: 0 12px; }
.input--sm { height: 28px; font-size: var(--fs-12); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .icon { position: absolute; left: 10px; color: var(--text-3); pointer-events: none; }
.input-wrap > .input { padding-left: 32px; }
.select { appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E737B' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.checkbox { appearance: none; width: 15px; height: 15px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; flex-shrink: 0; margin: 0; transition: background var(--dur-1), border-color var(--dur-1); }
.checkbox:hover { border-color: var(--text-3); }
.checkbox:checked { background: var(--inverse); border-color: var(--inverse); }
.checkbox:checked::after { content: ""; width: 8px; height: 5px; border-left: 2px solid var(--on-inverse); border-bottom: 2px solid var(--on-inverse); transform: rotate(-45deg) translate(1px, -1px); }
.checkbox:indeterminate { background: var(--inverse); border-color: var(--inverse); }
.checkbox:indeterminate::after { content: ""; width: 8px; height: 2px; background: var(--on-inverse); }

/* Inline editable cell */
.inline-edit {
  display: flex; align-items: center; gap: 6px;
  min-height: 28px; padding: 0 8px; margin: 0 -8px;
  border-radius: var(--r-1);
  border: 1px solid transparent;
  cursor: text;
  transition: background var(--dur-1), border-color var(--dur-1);
}
.inline-edit:hover { background: var(--hover); border-color: var(--line); }
.inline-edit--right { justify-content: flex-end; }
.inline-edit__input { width: 100%; height: 28px; padding: 0 8px; margin: 0 -8px; background: var(--surface-2); border: 1px solid var(--focus); border-radius: var(--r-1); outline: none; color: var(--text); font-variant-numeric: tabular-nums; box-shadow: 0 0 0 3px rgba(138,164,242,0.14); }
.inline-edit__input--right { text-align: right; }
.inline-edit__empty { color: var(--text-4); }
.saved { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-size: var(--fs-11); animation: fade-in var(--dur-2) var(--ease); }
.saved .icon { width: 12px; height: 12px; stroke-width: 2.5; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; min-width: 0; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-13); font-variant-numeric: tabular-nums; }
.tbl th {
  position: sticky; top: 0; z-index: 1;
  height: 34px; padding: 0 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
  font-size: var(--fs-11); font-weight: 500; text-transform: uppercase; letter-spacing: 0.07em;
  text-align: left; white-space: nowrap;
}
.panel .tbl th { background: var(--surface); }
.tbl td { height: var(--h-row); padding: 0 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; vertical-align: middle; }
.tbl tbody tr { transition: background var(--dur-1); }
.tbl tbody tr:hover { background: var(--hover); }
.tbl tbody tr.is-selected { background: var(--select); }
.tbl tr.is-clickable { cursor: pointer; }
.tbl .r, .tbl th.r { text-align: right; }
.tbl .c, .tbl th.c { text-align: center; }
.tbl td.wrap { white-space: normal; }
.tbl th:first-child, .tbl td:first-child { padding-left: var(--s-4); }
.tbl th:last-child, .tbl td:last-child { padding-right: var(--s-4); }
.tbl--flushleft th:first-child, .tbl--flushleft td:first-child { padding-left: 0; }
.tbl--dense td { height: var(--h-row-dense); }
.tbl tfoot td { height: 40px; border-bottom: 0; border-top: 1px solid var(--line); color: var(--text-2); font-weight: 500; background: var(--surface); }
.tbl .group-row td { height: 32px; background: var(--bg-2); color: var(--text-3); font-size: var(--fs-11); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600; }
.tbl .is-muted td { color: var(--text-3); }
.th-sort { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.th-sort:hover { color: var(--text); }
.th-sort .icon { width: 12px; height: 12px; }

/* ---------- Progress ---------- */
.progress { --c: var(--text-2); height: 4px; border-radius: 4px; background: var(--surface-4); overflow: hidden; min-width: 40px; position: relative; }
.progress__fill { height: 100%; background: var(--c); border-radius: 4px; transition: width var(--dur-3) var(--ease); }
.progress--lg { height: 6px; }

.capbar { position: relative; height: 6px; border-radius: 6px; background: var(--surface-4); min-width: 60px; }
.capbar__fill { position: absolute; inset: 0 auto 0 0; background: var(--c, var(--text-2)); border-radius: 6px; transition: width var(--dur-3) var(--ease); }
/* layout hooks that used to target .capbar directly */
.ev-mrow__sold .capbar-wrap, .home-up__cap .capbar-wrap { flex: 1; }
.capbar-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 60px; }
.capbar { background: repeating-linear-gradient(135deg, var(--surface-4) 0 4px, var(--surface-3, var(--surface-4)) 4px 8px); box-shadow: inset -2px 0 0 var(--line-strong, var(--text-4)); }
.capbar__be { position: absolute; top: -4px; bottom: -3px; width: 2px; background: var(--text); border-radius: 1px; opacity: 0.95; }
.capbar__be::before { content: ""; position: absolute; top: -1px; left: -3px; width: 8px; height: 5px; background: var(--text); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.capbar__legend { display: flex; flex-wrap: wrap; gap: 2px 10px; line-height: 1.3; }
.capbar__legend--panel { padding: 8px 16px 0; }
.capbar__key { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.capbar__sw { display: inline-block; width: 10px; height: 8px; border-radius: 2px; }
.capbar__sw--sold { background: var(--text-2); }
.capbar__sw--be { width: 2px; height: 10px; background: var(--text); }
.capbar__sw--cap { border-right: 2px solid var(--text-3); background: repeating-linear-gradient(135deg, var(--surface-4) 0 3px, transparent 3px 6px); }

.ring { --c: var(--green); position: relative; display: inline-grid; place-items: center; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring__track { stroke: var(--surface-4); fill: none; }
.ring__fill { stroke: var(--c); fill: none; stroke-linecap: round; transition: stroke-dashoffset var(--dur-3) var(--ease); }
.ring__label { position: absolute; font-size: var(--fs-11); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Alerts / attention rows ---------- */
.alert {
  --c: var(--amber);
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-2);
  background: color-mix(in srgb, var(--c) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
  color: var(--text);
}
.alert > .icon { color: var(--c); margin-top: 1px; }
.alert__body { flex: 1; min-width: 0; }
.alert__title { font-weight: 500; }
.alert__text { color: var(--text-2); font-size: var(--fs-12); margin-top: 2px; }
.alert__action { margin-left: auto; flex-shrink: 0; align-self: center; }

.issue { --c: var(--amber); display: flex; align-items: center; gap: 10px; padding: 0 var(--s-4); min-height: 44px; border-bottom: 1px solid var(--line-soft); transition: background var(--dur-1); }
.issue:last-child { border-bottom: 0; }
.issue:hover { background: var(--hover); }
.issue__bar { width: 3px; align-self: stretch; margin: 10px 0; border-radius: 2px; background: var(--c); flex-shrink: 0; }
.issue__main { flex: 1; min-width: 0; padding: 8px 0; }
.issue__title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.issue__meta { color: var(--text-3); font-size: var(--fs-12); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.issue__side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; color: var(--text-3); font-size: var(--fs-12); }

/* ---------- Empty ---------- */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: var(--s-10) var(--s-4); color: var(--text-3); }
.empty .icon { width: 20px; height: 20px; color: var(--text-4); }
.empty__title { color: var(--text-2); font-weight: 500; }
.empty__text { font-size: var(--fs-12); max-width: 42ch; }

/* ---------- Drawer ---------- */
.drawer-scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 80; animation: fade-in var(--dur-2) var(--ease); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 81;
  width: min(var(--drawer-w, 440px), 100vw);
  background: var(--surface);
  border-left: 1px solid var(--line-strong);
  display: flex; flex-direction: column;
  animation: drawer-in var(--dur-3) var(--ease) both;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer__head { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-4) var(--s-4) var(--s-3) var(--s-5); border-bottom: 1px solid var(--line-soft); padding-top: calc(var(--s-4) + env(safe-area-inset-top, 0px)); }
.drawer__title { font-size: var(--fs-16); font-weight: 600; letter-spacing: -0.01em; }
.drawer__subtitle { color: var(--text-3); font-size: var(--fs-12); margin-top: 2px; }
.drawer__body { flex: 1; overflow-y: auto; padding: var(--s-4) var(--s-5) var(--s-6); display: flex; flex-direction: column; gap: var(--s-5); }
.drawer__foot { border-top: 1px solid var(--line-soft); padding: var(--s-3) var(--s-5); display: flex; gap: var(--s-2); justify-content: flex-end; }

/* Key/value list */
.kv { display: grid; grid-template-columns: minmax(96px, max-content) minmax(0, 1fr); gap: 8px 16px; font-size: var(--fs-13); }
.kv dt { color: var(--text-3); white-space: nowrap; }
.kv dd { margin: 0; color: var(--text); min-width: 0; font-variant-numeric: tabular-nums; }

/* ---------- Popover / menu ---------- */
.popover {
  position: absolute; z-index: 95;
  min-width: 220px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-3);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  padding: 4px;
  animation: rise-in var(--dur-2) var(--ease);
}
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 6px 8px; border-radius: var(--r-1); text-align: left; color: var(--text-2); }
.menu-item:hover, .menu-item.is-hl { background: var(--press); color: var(--text); }
.menu-sep { height: 1px; background: var(--line); margin: 4px -4px; }
.menu-label { padding: 8px 8px 4px; font-size: var(--fs-11); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 500; }

/* ---------- Artist select ---------- */
.aselect { position: relative; min-width: 0; }
.aselect__list { left: 0; right: 0; top: calc(100% + 4px); max-height: 360px; overflow-y: auto; min-width: 300px; }
.aselect__opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: var(--r-2); text-align: left; }
.aselect__opt:hover, .aselect__opt.is-hl { background: var(--press); }
.aselect__name { font-weight: 600; letter-spacing: 0.01em; }
.aselect__name mark { background: transparent; color: var(--text); text-decoration: underline; text-decoration-color: var(--text-3); text-underline-offset: 3px; }
.aselect__meta { font-size: var(--fs-12); color: var(--text-3); display: flex; gap: 6px; flex-wrap: wrap; }
.aselect__dup { margin: 4px; padding: 8px 10px; border-radius: var(--r-2); background: color-mix(in srgb, var(--amber) 9%, transparent); border: 1px solid color-mix(in srgb, var(--amber) 24%, transparent); font-size: var(--fs-12); color: var(--text-2); display: flex; gap: 8px; }
.aselect__dup .icon { color: var(--amber); width: 14px; height: 14px; margin-top: 1px; }
.linked { display: inline-flex; align-items: center; gap: 6px; }
.linked .icon { width: 12px; height: 12px; color: var(--text-3); }

/* ---------- Command palette ---------- */
.cmdk-scrim { position: fixed; inset: 0; z-index: 90; background: var(--overlay); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fade-in var(--dur-1) var(--ease); }
.cmdk { width: min(640px, 100%); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 24px 64px rgba(0,0,0,0.55); overflow: hidden; animation: rise-in var(--dur-2) var(--ease); display: flex; flex-direction: column; max-height: 70vh; }
.cmdk__input { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 52px; border-bottom: 1px solid var(--line); }
.cmdk__input input { flex: 1; background: none; border: 0; outline: none; font-size: var(--fs-16); color: var(--text); }
.cmdk__input input::placeholder { color: var(--text-4); }
.cmdk__results { overflow-y: auto; padding: 6px; }
.cmdk__group { padding: 10px 10px 4px; font-size: var(--fs-11); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 500; }
.cmdk__item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 6px 10px; border-radius: var(--r-2); text-align: left; }
.cmdk__item.is-hl { background: var(--press); }
.cmdk__item .icon { color: var(--text-3); }
.cmdk__item-title { font-weight: 500; }
.cmdk__item-sub { font-size: var(--fs-12); color: var(--text-3); }
.cmdk__item-right { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: var(--fs-12); flex-shrink: 0; }
.cmdk__foot { border-top: 1px solid var(--line); padding: 8px 14px; display: flex; gap: 14px; color: var(--text-3); font-size: var(--fs-11); }
.cmdk__foot span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { --c: var(--green); display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-strong); box-shadow: 0 8px 24px rgba(0,0,0,0.4); font-size: var(--fs-13); animation: rise-in var(--dur-2) var(--ease); pointer-events: auto; white-space: nowrap; }
.toast .icon { color: var(--c); width: 15px; height: 15px; }

/* ---------- Contact card ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.contact:last-child { border-bottom: 0; }
.contact__name { font-weight: 500; display: flex; align-items: center; gap: 8px; min-width: 0; }
.contact__role { color: var(--text-3); font-size: var(--fs-12); }
.contact__lines { grid-column: 1; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: var(--fs-12); color: var(--text-2); }
.contact__lines a:hover { color: var(--text); }
.contact__actions { grid-row: 1 / span 3; grid-column: 2; display: flex; gap: 4px; align-items: center; }
.contact__notes { grid-column: 1 / -1; font-size: var(--fs-12); color: var(--text-3); }
.primary-mark { display: inline-flex; align-items: center; height: 17px; padding: 0 5px; border-radius: 3px; font: 600 9px/1 var(--font); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
@media (max-width: 720px) { .contact__actions .btn { --btn-h: 38px; } }

/* ---------- Charts ---------- */
.chart text { fill: var(--text-3); font: 500 10px var(--font); font-variant-numeric: tabular-nums; }
.chart .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis-line { stroke: var(--line); stroke-width: 1; }

/* ---------- Legend ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-12); color: var(--text-2); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.swatch { --c: var(--grey); width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex-shrink: 0; }

/* ---------- List rows (generic) ---------- */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px var(--s-4); border-bottom: 1px solid var(--line-soft); transition: background var(--dur-1); min-width: 0; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover, button.list-row:hover, .list-row.is-clickable:hover { background: var(--hover); }
.list-row__main { flex: 1; min-width: 0; }
.list-row__title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row__sub { font-size: var(--fs-12); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row__side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Date block (event lists) */
.dateblock { width: 40px; flex-shrink: 0; text-align: center; line-height: 1; display: flex; flex-direction: column; gap: 3px; }
.dateblock__m { font-size: var(--fs-10); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); font-weight: 600; }
.dateblock__d { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* Link-out tile (Drive etc.) */
.linkout { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-2); color: var(--text-2); font-size: var(--fs-12); font-weight: 500; transition: border-color var(--dur-1), color var(--dur-1), background var(--dur-1); white-space: nowrap; }
.linkout:hover { border-color: var(--line-strong); color: var(--text); background: var(--hover); }
.linkout .icon { width: 14px; height: 14px; color: var(--text-3); }

/* Prototype note */
.proto-note { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-11); color: var(--text-3); border: 1px dashed var(--line-strong); border-radius: var(--r-1); padding: 3px 7px; }

/* ---------- Company finance frame ---------- */
.fin__eyebrow { display: flex; align-items: center; gap: 10px; padding-top: var(--s-5); }
.fin__lock { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-11); color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px 1px 6px; }
.finnav { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-top: var(--s-2); }
.finnav::-webkit-scrollbar { display: none; }
.finnav__group { display: flex; align-items: center; gap: 2px; }
.finnav__sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 8px; }
.pstatus { --c: var(--amber); display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 4px; font: 600 var(--fs-11)/1 var(--font); letter-spacing: 0.08em; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent); white-space: nowrap; }
.pstatus--lg { height: 26px; padding: 0 10px; font-size: var(--fs-12); }
.phead { padding: var(--s-5) 0 var(--s-4); display: flex; flex-direction: column; gap: var(--s-4); border-bottom: 1px solid var(--line-soft); margin-bottom: var(--s-6); }
.phead__top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.phead__title { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.phead__period { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.phead__nav { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.pnav { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); padding: 2px; }
.pnav__arrow { width: 26px; height: 26px; display: grid; place-items: center; color: var(--text-2); border-radius: 4px; }
.pnav__arrow:hover:not([disabled]) { background: var(--hover); color: var(--text); }
.pnav__arrow[disabled] { opacity: 0.35; cursor: default; }
.pnav__m { position: relative; height: 26px; padding: 0 10px; border-radius: 4px; font: 600 var(--fs-11)/1 var(--font); letter-spacing: 0.08em; color: var(--text-3); }
.pnav__m + .pnav__m { box-shadow: -1px 0 0 var(--line-soft); }
.pnav__m:hover { color: var(--text); }
.pnav__m.is-active { background: var(--surface-4); color: var(--text); box-shadow: none; }
.pnav__m.is-prov::after { content: ""; position: absolute; top: 5px; right: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--amber); }
.phead__figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); }
.phead__fig { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.phead__fig span { font-size: var(--fs-11); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.07em; }
.phead__fig b { font-size: var(--fs-20); font-weight: 600; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.phead__fig b small { font-size: var(--fs-12); color: var(--text-3); font-weight: 500; }
.phead__fig b.c-green { color: var(--green); } .phead__fig b.c-red { color: var(--red); } .phead__fig b.c-amber { color: var(--amber); }
.phead__notice { --c: var(--amber); display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-2); background: color-mix(in srgb, var(--c) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 24%, transparent); font-size: var(--fs-12); color: var(--text-2); flex-wrap: wrap; }
.phead__notice > .icon { color: var(--c); }
.phead__notice b { color: var(--text); font-weight: 500; }
.finfresh { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--fs-11); color: var(--text-3); }
.finfresh span { display: inline-flex; align-items: center; gap: 5px; }
.finfresh__note { color: var(--text-4); }
@media (max-width: 720px) { .phead__figs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .phead__period { font-size: 22px; } }

/* Lineup completeness bar: text + percentage always shown; colour is reinforcement only. */
.lineupbar { display: flex; flex-direction: column; gap: 3px; min-width: 132px; max-width: 220px; }
.lineupbar__row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lineupbar__label { color: var(--c, var(--text-2)); font-size: var(--fs-12); font-weight: 600; white-space: nowrap; }
.lineupbar__pct { color: var(--text); font-size: var(--fs-12); }
.lineupbar__track { position: relative; height: 6px; border-radius: 6px; background: var(--surface-4); overflow: hidden; }
.lineupbar__fill { position: absolute; inset: 0 auto 0 0; background: var(--c, var(--text-2)); border-radius: 6px; transition: width var(--dur-3) var(--ease); }
.lineupbar__count { color: var(--text-3); font-size: var(--fs-11); white-space: nowrap; }

.tag--button { cursor: pointer; font: inherit; }
.tag--button:hover:not(:disabled) { border-color: var(--text-3); }
.tag--button.is-headliner { color: var(--text); font-weight: 600; }

.toast__action { margin-left: 12px; background: transparent; border: 1px solid currentColor; color: inherit; border-radius: 6px; padding: 4px 10px; font: inherit; font-weight: 600; cursor: pointer; min-height: 32px; }

/* Ticket percentage next to a count: always visibly separate ("230 · 19%"), never "23019%". */
.kpi__value small.kpi__pct { margin-left: 4px; white-space: pre; }
