/* ---------------------------------------------------------------------------
   Tokens. Ink and fibre-yellow on cool concrete. Yellow is a marker colour (active page, focus, fills on dark),
   never text on a light surface.
--------------------------------------------------------------------------- */
:root {
  --paper: #eceff1;
  --panel: #fafbfb;
  --raised: #ffffff;
  --ink: #0e1a24;
  --ink-2: #2b3a47;
  --muted: #5f6d79;
  --line: #d9dee2;
  --line-2: #e8ecef;

  --fibre: #f2c200;
  --fibre-soft: #fff4c2;

  --ok: #17794f;
  --ok-soft: #dff3e8;
  --soon: #a85000;
  --soon-soft: #ffe9d2;
  --bad: #b3261e;
  --bad-soft: #fbe3e0;
  --hold: #5b4a9e;
  --hold-soft: #e9e5f7;
  --idle: #4f5d68;
  --idle-soft: #e3e8ec;

  --btn-bg: #0e1a24;
  --btn-ink: #ffffff;
  --btn-hover: #24384a;

  --rail: #0e1a24;
  --rail-ink: #aab7c2;
  --rail-line: #223341;

  --display: 'Bricolage Grotesque Variable', 'Bricolage Grotesque', system-ui, sans-serif;
  --ui: 'Instrument Sans Variable', 'Instrument Sans', system-ui, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --r-sm: 5px;
  --r-md: 8px;
  --r-lg: 14px;
  color-scheme: light;
}

[data-theme='dark'] {
  --paper: #0a1218;
  --panel: #101b24;
  --raised: #15222d;
  --ink: #e7edf1;
  --ink-2: #c3ced6;
  --muted: #8d9ba6;
  --line: #263640;
  --line-2: #1b2a34;
  --ok: #4cc38a;
  --ok-soft: #12352a;
  --soon: #ffa04d;
  --soon-soft: #3b2612;
  --bad: #ff8a82;
  --bad-soft: #40181a;
  --hold: #b0a4f4;
  --hold-soft: #2a2350;
  --idle: #9aa8b3;
  --idle-soft: #1d2a33;
  --btn-bg: #f2c200;
  --btn-ink: #0e1a24;
  --btn-hover: #ffd633;
  --rail: #071017;
  --rail-line: #172530;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 14.5px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.01em; font-weight: 650; }
h1 { font-size: 26px; line-height: 1.15; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }
.num, td, .stat-num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--fibre); outline-offset: 2px; box-shadow: 0 0 0 4px rgba(14, 26, 36, 0.35); }
[data-theme='dark'] :focus-visible { box-shadow: none; }

/* ---------------------------------------------------------------------------
   App frame
--------------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100%; }

.rail {
  background: var(--rail);
  color: var(--rail-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; }
.brand svg { flex: none; }
.brand b { font: 650 16px/1.1 var(--display); letter-spacing: -0.01em; }
.brand small { display: block; font-size: 12px; color: var(--rail-ink); font-weight: 400; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--rail-ink);
  font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav a.active { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav a.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 3px 3px 0;
  background: var(--fibre);
}
.rail-foot { margin-top: auto; border-top: 1px solid var(--rail-line); padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.rail-foot button {
  display: flex; align-items: center; gap: 11px; width: 100%; background: none; border: 0; cursor: pointer;
  padding: 9px 12px; border-radius: var(--r-md); color: var(--rail-ink); text-align: left; font-weight: 500;
}
.rail-foot button:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.rail-user { padding: 6px 12px 2px; font-size: 12.5px; color: var(--rail-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; padding: 28px 36px 64px; max-width: 1480px; width: 100%; }
.mobile-bar { display: none; }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; max-width: 62ch; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 920px) {
  .app { display: block; }
  .rail {
    position: fixed; z-index: 40; inset: 0 auto 0 0; width: 260px; height: 100%;
    transform: translateX(-102%); transition: transform 0.2s ease;
  }
  .rail.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(5, 12, 18, 0.5); z-index: 39; }
  .mobile-bar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30;
    background: var(--rail); color: #fff; padding: 10px 16px;
  }
  .mobile-bar b { font: 650 16px var(--display); }
  .mobile-bar button { background: none; border: 0; color: #fff; padding: 6px; display: grid; place-items: center; cursor: pointer; }
  .main { padding: 20px 16px 56px; }
  h1 { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------------------------------------------------------------------------
   Panels, tables
--------------------------------------------------------------------------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.panel-head .sub { color: var(--muted); font-size: 13px; }
.panel-body { padding: 18px; }
.section { margin-top: 26px; }

.table-wrap { overflow-x: auto; }
table.data th {
  text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted);
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel);
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr.click { cursor: pointer; }
table.data tbody tr:hover td { background: color-mix(in srgb, var(--fibre) 9%, transparent); }
table.data tr.selected td { background: var(--fibre-soft); }
[data-theme='dark'] table.data tr.selected td { background: #2f2a10; }
table.data th.right, table.data td.right { text-align: right; }
table.data th.check, table.data td.check { width: 38px; padding-right: 0; }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 13px; }

input[type='checkbox'] { width: 16px; height: 16px; accent-color: var(--ink); cursor: pointer; }
[data-theme='dark'] input[type='checkbox'] { accent-color: var(--fibre); }

/* ---------------------------------------------------------------------------
   Controls
--------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--raised); color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
.btn.primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--idle-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: var(--r-sm); }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }

.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--raised); color: var(--ink); font: inherit;
}
textarea.input { height: auto; min-height: 88px; padding: 9px 12px; resize: vertical; line-height: 1.4; }
.input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--fibre) 55%, transparent); }
.input.sm { height: 34px; }
.input::placeholder { color: #93a0aa; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field > .label { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field .err { font-size: 12.5px; color: var(--bad); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.check-row { display: flex; align-items: center; gap: 9px; font-weight: 500; }

.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 34px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.filters .search { flex: 1 1 240px; min-width: 200px; max-width: 360px; }
.filters select.input { width: auto; min-width: 130px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button {
  background: none; border: 0; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs button.on { color: var(--ink); border-bottom-color: var(--fibre); }

.bulkbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 18px;
  background: var(--ink); color: var(--paper); border-radius: 0;
}
[data-theme='dark'] .bulkbar { background: #1f3140; color: var(--ink); }
.bulkbar .btn { background: transparent; color: inherit; border-color: rgba(255, 255, 255, 0.28); }
.bulkbar .btn:hover { background: rgba(255, 255, 255, 0.12); }

.pager { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.pager .spacer { flex: 1; }

/* ---------------------------------------------------------------------------
   Status
--------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 11px;
  font-size: 12.5px; font-weight: 600; background: var(--idle-soft); color: var(--idle); white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.soon { background: var(--soon-soft); color: var(--soon); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.hold { background: var(--hold-soft); color: var(--hold); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.unknown { background: transparent; border: 1.5px dashed var(--muted); }

/* Signal bars: how much time is left on a subscription */
.signal { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; flex: none; }
.signal i { width: 4px; border-radius: 1px; background: var(--line); display: block; }
.signal i:nth-child(1) { height: 5px; }
.signal i:nth-child(2) { height: 8px; }
.signal i:nth-child(3) { height: 12px; }
.signal i:nth-child(4) { height: 16px; }
.signal.ok i.f { background: var(--ok); }
.signal.soon i.f { background: var(--soon); }
.signal.bad i { background: var(--bad-soft); }
.signal.idle i.f { background: var(--idle); }
.signal.lg { height: 26px; gap: 3px; }
.signal.lg i { width: 7px; }
.signal.lg i:nth-child(1) { height: 8px; }
.signal.lg i:nth-child(2) { height: 13px; }
.signal.lg i:nth-child(3) { height: 19px; }
.signal.lg i:nth-child(4) { height: 26px; }
.timeleft { display: flex; align-items: center; gap: 10px; }
.timeleft .when { line-height: 1.25; }
.timeleft .when small { display: block; color: var(--muted); font-size: 12.5px; }
.timeleft.soon .when b { color: var(--soon); }
.timeleft.bad .when b { color: var(--bad); }

/* ---------------------------------------------------------------------------
   Dashboard
--------------------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 0; overflow: hidden; }
.hero-left { padding: 24px 26px; border-right: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 18px; }
.hero-left .label { color: var(--muted); font-weight: 600; }
.big { font: 650 44px/1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.big small { font-size: 18px; font-weight: 550; color: var(--muted); margin-right: 6px; letter-spacing: 0; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mini-stats b { display: block; font: 600 18px var(--display); font-variant-numeric: tabular-nums; }
.mini-stats span { color: var(--muted); font-size: 13px; }
.hero-right { padding: 18px 22px 12px; min-width: 0; }
.hero-right .row { margin-bottom: 8px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: var(--ink); }
[data-theme='dark'] .chart .bar { fill: var(--fibre); }
.chart .bar.today { fill: var(--fibre); }
[data-theme='dark'] .chart .bar.today { fill: #fff; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--ui); }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.chart .bar:nth-of-type(2n) { animation-delay: 0.03s; }
@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; }
  .hero-left { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .big { font-size: 38px; }
}

.ledger { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; }
.ledger a { padding: 16px 20px; border-right: 1px solid var(--line-2); display: block; }
.ledger a:last-child { border-right: 0; }
.ledger a:hover { background: color-mix(in srgb, var(--fibre) 9%, transparent); }
.ledger .stat-num { font: 650 30px/1.1 var(--display); letter-spacing: -0.01em; }
.ledger .stat-label { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
@media (max-width: 760px) {
  .ledger { grid-template-columns: 1fr 1fr; }
  .ledger a:nth-child(2) { border-right: 0; }
  .ledger a:nth-child(-n + 2) { border-bottom: 1px solid var(--line-2); }
}

.two-col { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

.attention a { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.attention a:last-child { border-bottom: 0; }
.attention a:hover { background: color-mix(in srgb, var(--fibre) 9%, transparent); }
.attention .n { min-width: 30px; height: 26px; border-radius: 13px; display: grid; place-items: center; font-weight: 700; background: var(--soon-soft); color: var(--soon); font-variant-numeric: tabular-nums; padding: 0 8px; }
.attention .n.fine { background: var(--ok-soft); color: var(--ok); }
.attention small { display: block; color: var(--muted); font-size: 13px; }

.statusbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line-2); gap: 2px; }
.statusbar i { display: block; min-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------------------------------------------------------------------------
   Detail page
--------------------------------------------------------------------------- */
.detail-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 22px; }
.detail-head .who h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-head .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); margin-top: 6px; }
.detail-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.back:hover { color: var(--ink); }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dt { margin-top: 8px; } }
.meter { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ink); border-radius: 4px; }
[data-theme='dark'] .meter i { background: var(--fibre); }
.meter.warn i { background: var(--soon); }
.meter.full i { background: var(--bad); }
.hint-box { background: var(--fibre-soft); color: #4a3b00; border-radius: var(--r-md); padding: 10px 12px; font-size: 13.5px; }
[data-theme='dark'] .hint-box { background: #2f2a10; color: #f2e08a; }
.hint-box.bad { background: var(--bad-soft); color: var(--bad); }
.hint-box.ok { background: var(--ok-soft); color: var(--ok); }

/* ---------------------------------------------------------------------------
   Modal, toast, misc
--------------------------------------------------------------------------- */
.overlay { position: fixed; inset: 0; background: rgba(8, 16, 22, 0.55); z-index: 60; display: grid; place-items: center; padding: 16px; overflow-y: auto; animation: fade 0.12s ease; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
.modal { background: var(--panel); border-radius: var(--r-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; border: 1px solid var(--line); animation: pop 0.16s ease; }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); }

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast { background: var(--ink); color: var(--paper); padding: 11px 14px; border-radius: var(--r-md); display: flex; gap: 10px; align-items: flex-start; animation: pop 0.18s ease; }
[data-theme='dark'] .toast { background: #223341; color: var(--ink); }
.toast.error { background: var(--bad); color: #fff; }

.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font: 600 16px var(--display); margin-bottom: 4px; }
.skeleton { background: linear-gradient(90deg, var(--line-2), var(--line), var(--line-2)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--r-sm); height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-art { background: var(--rail); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art h2 { font-size: 34px; line-height: 1.1; max-width: 14ch; }
.login-art p { color: var(--rail-ink); max-width: 36ch; margin-top: 12px; }
.login-art .bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; }
.login-art .bars i { width: 26px; border-radius: 4px; background: var(--fibre); display: block; }
.login-art .bars i:nth-child(1) { height: 36px; opacity: 0.5; }
.login-art .bars i:nth-child(2) { height: 70px; opacity: 0.7; }
.login-art .bars i:nth-child(3) { height: 110px; opacity: 0.85; }
.login-art .bars i:nth-child(4) { height: 160px; }
.login-form { display: grid; place-items: center; padding: 32px; }
.login-form form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 820px) { .login { grid-template-columns: 1fr; } .login-art { padding: 28px; min-height: 0; gap: 24px; } .login-art .bars { height: 70px; } .login-art .bars i:nth-child(4) { height: 70px; } .login-art .bars i:nth-child(3) { height: 52px; } .login-art .bars i:nth-child(2) { height: 34px; } .login-art .bars i:nth-child(1) { height: 18px; } .login-art h2 { font-size: 26px; } }

.share { display: flex; align-items: center; gap: 10px; }
.share .meter { flex: 1; min-width: 60px; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 5px 11px; border-radius: 16px; border: 1px solid var(--line); background: var(--raised); font-weight: 600; cursor: pointer; font-size: 13px; }
.pill.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
[data-theme='dark'] .pill.on { background: var(--fibre); color: #0e1a24; border-color: var(--fibre); }

.hide-md { }
@media (max-width: 1180px) { .hide-md { display: none; } }
@media (max-width: 720px) { .hide-sm { display: none; } .filters { padding: 12px; } .panel-head { padding: 12px 14px; } table.data th, table.data td { padding: 10px 10px; } }

@media (max-width: 720px) { .timeleft .when small { display: none; } .detail-head .actions { margin-left: 0; } .timeleft.lg-wrap .when small { display: block; } .panel-body .timeleft .when small { display: block; } .page-head .actions { margin-left: 0; } }
.panel-body .timeleft .when b { font-size: 20px; font-family: var(--display); }

/* ---------------------------------------------------------------------------
   Livewire / Alpine helpers
--------------------------------------------------------------------------- */
[x-cloak] { display: none !important; }
.sort { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.sort:hover { color: var(--ink); }
.loading-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 90; background: var(--fibre); transform-origin: left; animation: load 1.2s ease-in-out infinite; }
@keyframes load { 0% { transform: scaleX(0); } 60% { transform: scaleX(0.8); } 100% { transform: scaleX(1); opacity: 0; } }
.pick { justify-content: flex-start; height: auto; padding: 8px 12px; text-align: left; width: 100%; }
.pick span span { font-weight: 400; opacity: 0.8; }
.inline-form { display: contents; }
.nowrap { white-space: nowrap; }
.mt-6 { margin-top: 6px; }
.mt-12 { margin-top: 12px; }
.mb-18 { margin-bottom: 18px; }
.gap-22 { gap: 22px; }
.gap-18 { gap: 18px; }
.gap-6 { gap: 6px; }
.dim { opacity: 0.6; }
.w-auto { width: auto !important; }
.w-90 { width: 90px !important; flex: none; }
.w-120 { width: 120px !important; flex: none; }
.max-720 { max-width: 720px; }
.totals { gap: 40px; border-bottom: 1px solid var(--line-2); }
.big.md { font-size: 34px; }
