/* ==========================================================================
   Orion portal — design system
   White canvas, black ink, Orion red for action. One radius scale, one
   shadow, motion that answers the user.
   ========================================================================== */
:root {
  --canvas: #F3F4F4;
  --surface: #FFFFFF;
  --surface-2: #F8F9F9;
  --ink: #111111;
  --ink-2: #3B3B38;
  --muted: #74746E;
  --faint: #A3A39C;
  --line: #E4E7E8;
  --line-2: #EEF0F1;
  --red: #E5322D;
  --red-press: #C9241F;
  --red-soft: #FDEDEB;
  --green: #17864B;
  --green-soft: #E6F4EC;
  --amber: #A8660B;
  --amber-soft: #FBF1DF;
  --blue: #2556C9;
  --blue-soft: #E9EFFC;
  --black: #16222A;       /* slate ink from the Orion prototype — softer than pure black */
  --black-2: #22323C;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;
  --shadow: 0 1px 2px rgba(22,34,42,.05), 0 6px 18px -10px rgba(22,34,42,.12);
  --shadow-pop: 0 24px 60px -20px rgba(17,17,17,.35), 0 2px 6px rgba(17,17,17,.06);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Inter Tight", "Inter", system-ui, sans-serif;

  --ease: cubic-bezier(.22,.8,.24,1);
  --ease-spring: cubic-bezier(.34,1.4,.44,1);
  --fast: 160ms;
  --med: 260ms;
  --side: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: -.02em; line-height: 1.15; }
p { margin: 0; }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.red { color: var(--red); }
.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(--red); outline-offset: 2px; border-radius: 6px; }

/* ---------- Page transitions (cross-document View Transitions) ---------- */
@view-transition { navigation: auto; }
.sidebar { view-transition-name: sidebar; }
.topbar { view-transition-name: topbar; }
::view-transition-old(root) { animation: vt-out 180ms var(--ease) both; }
::view-transition-new(root) { animation: vt-in 320ms var(--ease) both; }
::view-transition-group(sidebar), ::view-transition-group(topbar) { animation: none; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Progress bar ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 100; pointer-events: none; }
.progress i { display: block; height: 100%; width: 0; background: var(--red); box-shadow: 0 0 8px var(--red); transition: width 8s cubic-bezier(.1,.7,.1,1), opacity .3s; opacity: 0; }
.progress.run i { width: 88%; opacity: 1; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px;
  overflow-y: auto; scrollbar-width: thin;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--black); display: grid; place-items: center; }
.brand-mark svg { width: 18px; height: 18px; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -.03em; }
.brand-role { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--line-2); padding: 3px 8px; border-radius: var(--r-pill); }

.nav-group { margin-bottom: 18px; }
.nav-title { font-size: 12px; color: var(--faint); padding: 0 12px 6px; font-weight: 500; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; transition: background var(--fast), color var(--fast);
}
.nav-link svg { width: 18px; height: 18px; color: var(--faint); transition: color var(--fast); flex: none; }
.nav-link:hover { background: var(--canvas); color: var(--ink); }
.nav-link:hover svg { color: var(--ink); }
.nav-link.is-active { background: var(--black); color: #fff; }
.nav-link.is-active svg { color: #fff; }
.nav-link .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--red); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.nav-link.is-active .count { background: #fff; color: var(--black); }

.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-2); }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-md); transition: background var(--fast); }
.me:hover { background: var(--canvas); }
.me-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.me-sub { font-size: 12px; color: var(--muted); }
.me form { margin-left: auto; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 14px 32px; background: rgba(245,245,242,.82); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color var(--med);
}
.topbar.stuck { border-color: var(--line); }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.crumbs a:hover { color: var(--ink); }
.crumbs svg { width: 14px; height: 14px; color: var(--faint); }
.crumbs span:last-child { color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.today-chip { font-size: 13px; color: var(--muted); white-space: nowrap; }
.menu-btn { display: none; }

.content { padding: 8px 32px 64px; width: 100%; max-width: 1180px; animation: enter .42s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 10px 0 20px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(21px, 2.2vw, 26px); font-weight: 600; letter-spacing: -.03em; }
.page-head p { color: var(--muted); margin-top: 4px; max-width: 64ch; font-size: 13.5px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--surface); --fg: var(--ink); --bd: var(--line);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--r-pill); border: 1px solid var(--bd);
  background: var(--bg); color: var(--fg); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: transform var(--fast) var(--ease), background var(--fast), border-color var(--fast), box-shadow var(--fast);
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: #D6D6CF; box-shadow: var(--shadow); }
.btn:active { transform: scale(.97); }
.btn-primary { --bg: var(--red); --fg: #fff; --bd: var(--red); }
.btn-primary:hover { --bg: var(--red-press); --bd: var(--red-press); box-shadow: 0 8px 20px -8px rgba(229,50,45,.6); }
.btn-dark { --bg: var(--black); --fg: #fff; --bd: var(--black); }
.btn-dark:hover { --bg: var(--black-2); --bd: var(--black-2); }
.btn-ghost { --bg: transparent; --bd: transparent; }
.btn-ghost:hover { --bg: var(--line-2); box-shadow: none; }
.btn-danger { --fg: var(--red); }
.btn-danger:hover { --bg: var(--red-soft); --bd: #F6C9C5; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn[disabled], .btn.is-loading { pointer-events: none; opacity: .75; }
.btn.is-loading { color: transparent !important; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--fg) var(--fg) transparent transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.panel-head h2, .panel-head h3 { font-size: 15px; font-weight: 600; }
.panel-head .link { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.panel-head .link:hover { color: var(--ink); }
.panel-head .link svg { width: 14px; height: 14px; }
.panel-body { padding: 16px 20px 20px; }
.panel-flush { padding: 8px 0 6px; }

.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.g-side { grid-template-columns: minmax(0, 1fr) 360px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt { margin-top: 18px; }
.mt-lg { margin-top: 28px; }

/* ---------- Stats (compact) ---------- */
.stat { position: relative; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); transition: border-color var(--fast), box-shadow var(--med); min-width: 0; }
a.stat:hover { border-color: #CFD5D8; box-shadow: var(--shadow); }
.stat-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; }
.stat-label svg { width: 15px; height: 15px; }
.stat-value { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.03em; margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-hint { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* tones are an accent, not a fill */
.stat.tone-dark { box-shadow: inset 3px 0 0 var(--black); }
.stat.tone-red { box-shadow: inset 3px 0 0 var(--red); }
.stat.tone-red .stat-value { color: var(--red); }
.stat.tone-green { box-shadow: inset 3px 0 0 var(--green); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.dark { background: var(--black); color: #fff; }

/* ---------- Tabs & filters ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs { display: inline-flex; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; border-radius: var(--r-pill); font-weight: 500; font-size: 13px; color: var(--muted); white-space: nowrap; transition: color var(--fast), background var(--fast); }
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--black); color: #fff; }
.tab .n { font-size: 11.5px; font-weight: 600; opacity: .6; font-variant-numeric: tabular-nums; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { padding-left: 36px !important; width: 240px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .error { font-size: 12.5px; color: var(--red); display: flex; gap: 6px; align-items: center; animation: shake .3s var(--ease); }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  outline: none; transition: border-color var(--fast), box-shadow var(--fast); font-size: 14px;
}
.textarea { height: auto; min-height: 96px; padding: 11px 14px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2374746E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:hover, .select:hover, .textarea:hover { border-color: #D6D6CF; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(17,17,17,.06); }
.has-error .input, .has-error .select, .has-error .textarea { border-color: var(--red); box-shadow: 0 0 0 4px rgba(229,50,45,.08); }
.input-sm { height: 36px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-section { padding: 22px; border-bottom: 1px solid var(--line-2); }
.form-section:last-of-type { border-bottom: 0; }
.form-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.form-section > p { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.form-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background var(--med) var(--ease); margin: 0; }
.check input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform var(--med) var(--ease-spring); }
.check input:checked { background: var(--ink); }
.check input:checked::after { transform: translateX(16px); }
.seg { display: inline-flex; padding: 3px; background: var(--line-2); border-radius: var(--r-pill); gap: 2px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 6px 14px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500; color: var(--muted); transition: all var(--fast); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg input:focus-visible + span { outline: 2px solid var(--red); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table .r { text-align: right; }
.table tbody tr { transition: background var(--fast); }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr[data-href]:hover { background: var(--surface-2); }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--line); background: var(--surface-2); }
.cell-main { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.bar { height: 6px; background: var(--line-2); border-radius: 9px; overflow: hidden; min-width: 70px; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 9px; transform-origin: left; animation: grow .8s var(--ease) both; }
.bar.red i { background: var(--red); }
.bar.green i { background: var(--green); }
@keyframes grow { from { transform: scaleX(0); } }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 13px 22px; border-top: 1px solid var(--line-2); transition: background var(--fast); }
.list-item:first-child { border-top: 0; }
a.list-item:hover { background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); font-weight: 600; font-size: 12.5px; object-fit: cover; letter-spacing: .02em; }
.avatar.lg { width: 64px; height: 64px; font-size: 20px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.dark { background: var(--black); color: #fff; }
.avatar.red { background: var(--red); color: #fff; }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--faint); }
.tl-item.done::before { border-color: var(--green); background: var(--green); }
.tl-item.now::before { border-color: var(--red); background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }

/* ---------- Empty, alert ---------- */
.empty { text-align: center; padding: 48px 24px; }
.empty-icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--line-2); color: var(--muted); }
.empty-icon svg { width: 24px; height: 24px; }
.empty h3 { font-size: 16px; font-weight: 600; }
.empty p { color: var(--muted); margin: 6px auto 16px; max-width: 42ch; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); background: var(--amber-soft); color: #6B4507; font-size: 13.5px; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert.red { background: var(--red-soft); color: #8E1D19; }
.alert.green { background: var(--green-soft); color: #0F5A32; }
.alert.blue { background: var(--blue-soft); color: #1B3E91; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; min-width: 260px; max-width: 420px; padding: 12px 14px 12px 12px;
  background: var(--black); color: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-pop); font-weight: 500; font-size: 13.5px;
  animation: toast-in .45s var(--ease-spring) both;
}
.toast .ti { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--green); flex: none; }
.toast.error .ti { background: var(--red); }
.toast.info .ti { background: #444; }
.toast .ti svg { width: 14px; height: 14px; }
.toast button { margin-left: auto; background: none; border: 0; color: rgba(255,255,255,.5); cursor: pointer; padding: 4px; }
.toast.out { animation: toast-out .3s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* ---------- Drawer & dialogs ---------- */
dialog { border: 0; padding: 0; color: inherit; background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(10,10,10,.32); backdrop-filter: blur(3px); animation: fade .25s var(--ease); }
dialog.closing::backdrop { animation: fade .2s var(--ease) reverse both; }
@keyframes fade { from { opacity: 0; } }
.drawer { margin: 0 0 0 auto; height: 100dvh; width: min(480px, 100vw); }
.drawer-inner { height: 100%; display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow-pop); animation: drawer-in .38s var(--ease) both; }
.drawer.closing .drawer-inner { animation: drawer-out .24s var(--ease) both; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes drawer-out { to { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line-2); }
.drawer-head h2 { font-size: 20px; font-weight: 600; letter-spacing: -.03em; }
.drawer-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.drawer-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--line-2); background: var(--surface-2); }
.modal { margin: auto; width: min(420px, calc(100vw - 32px)); }
.modal-inner { background: var(--surface); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-pop); animation: pop .32s var(--ease-spring) both; }
.modal.closing .modal-inner { animation: fade .18s var(--ease) reverse both; }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(8px); } }
.modal h3 { font-size: 18px; font-weight: 600; }
.modal p { color: var(--muted); margin: 8px 0 20px; }
.lightbox { margin: auto; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: var(--r-lg); animation: pop .32s var(--ease) both; }

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }
.pager-links { display: flex; gap: 4px; }
.pager-links a, .pager-links span { min-width: 32px; height: 32px; padding: 0 8px; display: grid; place-items: center; border-radius: var(--r-sm); font-weight: 500; color: var(--ink-2); }
.pager-links a:hover { background: var(--line-2); }
.pager-links .on { background: var(--black); color: #fff; }
.pager-links .off { color: var(--faint); }

/* ---------- Skeleton ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--line-2); border-radius: var(--r-md); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.chart-box { position: relative; height: 260px; }
.chart-box canvas { position: relative; z-index: 1; opacity: 0; transition: opacity .5s var(--ease); }
.chart-box.ready canvas { opacity: 1; }
.chart-box .skeleton { position: absolute; inset: 0; transition: opacity .3s; }
.chart-box.ready .skeleton { opacity: 0; }

/* ---------- Invoice builder ---------- */
.lines { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.lines th { font-size: 12px; color: var(--muted); font-weight: 500; text-align: left; padding: 0 6px; }
.lines td { padding: 0 6px; vertical-align: top; }
.lines tr.line { animation: enter .3s var(--ease) both; }
.lines tr.line.removing { animation: fade .2s var(--ease) reverse both; }
.lines .amt { height: 42px; display: flex; align-items: center; justify-content: flex-end; font-weight: 600; font-variant-numeric: tabular-nums; }
.totals { margin-left: auto; width: min(340px, 100%); display: grid; gap: 8px; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -.03em; }

/* ---------- Invoice document ---------- */
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 36px; }
.doc-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.doc-title { font-family: var(--display); font-size: 36px; font-weight: 600; letter-spacing: -.04em; }
.doc-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 22px 0; }
.doc-meta .k { font-size: 12px; color: var(--muted); }
.doc-meta .v { font-weight: 600; margin-top: 3px; }

/* ---------- Clock (employee) ---------- */
.clock-card { position: relative; overflow: hidden; background: var(--black); color: #fff; border-radius: var(--r-lg); padding: 24px; }
.clock-card::before { content: none; }
@keyframes drift { to { transform: translate(-40px, 30px) scale(1.08); } }
.clock-time { font-family: var(--display); font-size: clamp(40px, 6vw, 56px); font-weight: 600; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.clock-date { color: rgba(255,255,255,.65); margin-top: 8px; }
.clock-state { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 13px; font-weight: 500; padding: 6px 12px; background: rgba(255,255,255,.1); border-radius: var(--r-pill); }
.clock-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.clock-state.on i { background: #3DDC84; box-shadow: 0 0 0 0 rgba(61,220,132,.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }
.clock-card .btn-primary { height: 54px; padding: 0 28px; font-size: 15px; }
.clock-meta { display: flex; gap: 28px; margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); flex-wrap: wrap; }
.clock-meta .k { font-size: 12px; color: rgba(255,255,255,.55); }
.clock-meta .v { font-family: var(--display); font-size: 20px; font-weight: 600; margin-top: 2px; }

.photo-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 190px; border: 1.5px dashed #D6D6CF; border-radius: var(--r-lg); background: var(--surface-2); text-align: center; padding: 18px; cursor: pointer; transition: border-color var(--fast), background var(--fast); overflow: hidden; }
.photo-drop:hover { border-color: var(--ink); background: var(--surface); }
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-drop svg { width: 26px; height: 26px; color: var(--muted); }
.photo-drop strong { font-weight: 600; }
.photo-drop span { font-size: 12.5px; color: var(--muted); }
.photo-drop .preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; pointer-events: none; }
.photo-drop.has-image .preview { opacity: 1; }
.photo-drop.has-image::after { content: "Tap to retake"; position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.7); color: #fff; font-size: 12px; padding: 5px 12px; border-radius: 99px; }
.geo-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.geo-chip svg { width: 14px; height: 14px; }
.geo-chip.ok { color: var(--green); }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: var(--line-2); cursor: zoom-in; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.thumb:hover img { transform: scale(1.06); }
.thumb-sm { width: 40px; height: 40px; border-radius: 10px; overflow: hidden; background: var(--line-2); cursor: zoom-in; flex: none; }
.thumb-sm img { width: 100%; height: 100%; object-fit: cover; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day { text-align: center; padding: 12px 4px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-2); }
.day .d { font-size: 12px; color: var(--muted); }
.day .h { font-family: var(--display); font-weight: 600; font-size: 15px; margin-top: 4px; }
.day.on { background: var(--black); color: #fff; border-color: var(--black); }
.day.on .d { color: rgba(255,255,255,.6); }
.day.today { border-color: var(--red); }

/* ---------- Balance card (slate, from the prototype) ---------- */
.points-card { position: relative; border-radius: var(--r-lg); padding: 22px; color: #fff; background: var(--black); }
.points-card .big { font-family: var(--display); font-size: 40px; font-weight: 600; letter-spacing: -.04em; line-height: 1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.points-card .sub { color: rgba(255,255,255,.7); margin-top: 6px; font-size: 13px; }
.points-card .btn { --bg: #fff; --fg: var(--black); --bd: #fff; }
.points-card.center { text-align: center; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.auth-art { position: relative; margin: 14px; border-radius: 28px; overflow: hidden; background: var(--black); color: #fff; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; isolation: isolate; }
.auth-art .silk { position: absolute; inset: -20%; z-index: -1; background:
  radial-gradient(40% 55% at 70% 30%, #FF4A3D 0%, transparent 60%),
  radial-gradient(50% 60% at 30% 80%, #B3140E 0%, transparent 65%),
  radial-gradient(35% 45% at 85% 85%, #FF7A5C 0%, transparent 60%); filter: blur(30px) saturate(1.2); animation: silk 16s ease-in-out infinite alternate; }
@keyframes silk { to { transform: rotate(8deg) scale(1.12) translate(3%, -2%); } }
.auth-art h2 { font-size: clamp(34px, 4vw, 56px); font-weight: 600; letter-spacing: -.045em; line-height: 1.02; max-width: 12ch; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: min(400px, 100%); }
.auth-box h1 { font-size: 32px; font-weight: 600; letter-spacing: -.04em; }


/* ---------- Print ---------- */
@media print {
  .sidebar, .topbar, .page-actions, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  body { background: #fff; }
  .doc { border: 0; padding: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-side, .g-main { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-104%);
    transition: transform .38s var(--ease); box-shadow: var(--shadow-pop); view-transition-name: none;
  }
  body.nav-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.3); opacity: 0; pointer-events: none; transition: opacity .3s; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 18px; }
  .content { padding: 4px 18px 90px; }
  .today-chip { display: none; }
  .g-3 { grid-template-columns: 1fr 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 260px; }
}
@media (max-width: 640px) {
  .g-2, .g-3, .form-grid { grid-template-columns: 1fr; }
  .g-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 16px; }
  .stat-value { font-size: 24px; }
  .page-head { margin: 8px 0 20px; }
  .page-actions .btn { flex: 1; }
  .page-actions { width: 100%; }
  .search input { width: 100%; }
  .search, .filters { width: 100%; }
  .filters .select { flex: 1; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .doc { padding: 20px; }
  .doc-meta { grid-template-columns: 1fr 1fr; }
  .toasts { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; }
  .hide-sm { display: none !important; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .lines thead { display: none; }
  .lines tr.line { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--r-md); margin-bottom: 8px; }
  .lines tr.line td { padding: 0; }
  .lines tr.line td:first-child { grid-column: 1 / -1; }
  .auth-art { margin: 10px; padding: 26px; }
}
@media (min-width: 961px) { .scrim { display: none; } }

/* ---------- Timing chip (balance sheet) ---------- */
.timing { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.timing svg { width: 14px; height: 14px; }
.timing.ok { color: var(--green); }
.timing.late { color: var(--red); }
.perm-grid td, .perm-grid th { text-align: center; }
.perm-grid td:first-child, .perm-grid th:first-child { text-align: left; }
.perm-yes { color: var(--green); }
.perm-no { color: var(--faint); }

/* ==========================================================================
   v2 — simpler layouts + prototype features
   ========================================================================== */

/* ---------- "Needs your attention" strip ---------- */
.todo { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.todo a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 10px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 500; transition: border-color var(--fast), background var(--fast); }
.todo a:hover { border-color: var(--black); }
.todo a svg { width: 16px; height: 16px; color: var(--muted); }
.todo a b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--red); color: #fff; font-size: 11.5px; display: grid; place-items: center; }
.all-clear { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-md); background: var(--green-soft); color: #0F5A32; font-size: 13px; font-weight: 500; margin-bottom: 16px; }
.all-clear svg { width: 16px; height: 16px; }

/* ---------- Compact KPI row: one panel, divided cells ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { padding: 14px 18px; border-left: 1px solid var(--line-2); min-width: 0; transition: background var(--fast); }
.kpi:first-child { border-left: 0; }
a.kpi:hover { background: var(--surface-2); }
.kpi .k { font-size: 12.5px; color: var(--muted); }
.kpi .v { font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v.red { color: var(--red); }
.kpi .h { font-size: 12px; color: var(--faint); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Section header outside panels ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 10px; }
.section-head h2 { font-size: 15px; font-weight: 600; }
.section-head a { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.section-head a:hover { color: var(--ink); }
.section-head a svg { width: 14px; height: 14px; }

/* ---------- Rewards catalogue ---------- */
.catalogue { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.reward { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; transition: border-color var(--fast), transform var(--med) var(--ease); }
.reward:hover { border-color: #CFD5D8; transform: translateY(-2px); }
.reward-img { aspect-ratio: 16 / 10; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.reward-img img { width: 100%; height: 100%; object-fit: cover; }
.reward-img svg { width: 34px; height: 34px; }
.reward-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.reward-title { font-weight: 600; }
.reward-meta { font-size: 12.5px; color: var(--muted); }
.reward-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; }
.pts { font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; }
.pts small { font-family: var(--font); font-weight: 500; color: var(--muted); font-size: 12px; }
.reward.locked .pts { color: var(--muted); }
.progress-line { height: 4px; border-radius: 9px; background: var(--line-2); overflow: hidden; margin-top: 8px; }
.progress-line i { display: block; height: 100%; background: var(--black); border-radius: 9px; }

.item-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.item-hero .reward-img { aspect-ratio: auto; min-height: 260px; border-bottom: 0; border-right: 1px solid var(--line-2); }
.item-hero .reward-img svg { width: 56px; height: 56px; }
.item-info { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.item-info h1 { font-size: 24px; font-weight: 600; letter-spacing: -.03em; }
.item-cost { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -.03em; }

/* Confirmation sheet */
.sheet { max-width: 460px; margin: 8px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.sheet-top { padding: 26px 24px 18px; text-align: center; border-bottom: 1px solid var(--line-2); }
.sheet-top .avatar { width: 56px; height: 56px; margin: 0 auto 12px; background: var(--black); color: #fff; }
.sheet-top .avatar svg { width: 24px; height: 24px; }
.sheet-top h1 { font-size: 20px; font-weight: 600; }
.sheet-rows { padding: 8px 24px; }
.sheet-rows div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.sheet-rows div:last-child { border-bottom: 0; }
.sheet-rows dt { color: var(--muted); }
.sheet-rows dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.sheet-foot { padding: 16px 24px 22px; display: flex; flex-direction: column; gap: 8px; }

/* Status steps (redemption + job flow) */
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; counter-reset: s; }
.steps li { list-style: none; position: relative; padding-top: 14px; font-size: 12.5px; color: var(--muted); }
.steps li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: 9px; background: var(--line-2); }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--black); }
.steps li.now { color: var(--ink); font-weight: 600; }
.steps li.now::before { background: var(--red); }
.steps li.bad::before { background: var(--red); }
.steps { margin: 0; padding: 0; }

/* ---------- Job flow (technician) ---------- */
.job-action { background: var(--black); color: #fff; border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.job-action h2 { font-size: 18px; font-weight: 600; }
.job-action p { color: rgba(255,255,255,.7); font-size: 13.5px; }
.job-action .btn:not(.btn-primary) { --bg: rgba(255,255,255,.08); --fg: #fff; --bd: rgba(255,255,255,.16); }
.job-action .btn:not(.btn-primary):hover { --bg: rgba(255,255,255,.14); box-shadow: none; }
.job-action .row .btn { flex: 1; }
.job-action .geo-chip { color: rgba(255,255,255,.6); }
.job-action .geo-chip.ok { color: #6EE7A2; }

.stars { display: flex; flex-direction: row-reverse; justify-content: center; gap: 6px; }
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label { cursor: pointer; color: var(--line); transition: transform var(--fast) var(--ease-spring), color var(--fast); }
.stars label svg { width: 44px; height: 44px; fill: currentColor; stroke: none; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: #F5B301; }
.stars label:active { transform: scale(.9); }
.stars input:focus-visible + label { outline: 2px solid var(--red); border-radius: 8px; }
.star-row { display: inline-flex; gap: 1px; color: #F5B301; vertical-align: middle; }
.star-row svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.star-row .off { color: var(--line); }

/* ---------- Activity feed (enquiry timeline) ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 12px 0; position: relative; }
.feed-item + .feed-item::before { content: ""; position: absolute; left: 15px; top: -12px; height: 24px; width: 2px; background: var(--line-2); }
.feed-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); position: relative; z-index: 1; }
.feed-icon svg { width: 15px; height: 15px; }
.feed-item.green .feed-icon { background: var(--green-soft); color: var(--green); }
.feed-item.muted .feed-icon { background: var(--surface-2); color: var(--faint); }
.feed-title { font-weight: 600; font-size: 13.5px; }
.feed-when { font-size: 12px; color: var(--faint); }
.feed-body { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; white-space: pre-line; }
.feed-next { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--amber); background: var(--amber-soft); padding: 3px 9px; border-radius: var(--r-pill); }
.feed-next svg { width: 13px; height: 13px; }

/* Simple horizontal bars for counts */
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: 110px 1fr 36px; gap: 10px; align-items: center; font-size: 13px; }
.hbar .bar { height: 8px; }
.hbar .n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Leaderboard rank */
.rank { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--line-2); color: var(--ink-2); flex: none; }
.rank.r1 { background: var(--black); color: #fff; }

/* ---------- Mobile bottom tabs (dealer + employee, like the prototype app) ---------- */
.tabbar { display: none; }
@media (max-width: 960px) {
  body.has-tabbar .content { padding-bottom: 110px; }
  body.has-tabbar .toasts { bottom: 84px; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,.94); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 500; color: var(--muted); border-radius: var(--r-sm); position: relative; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.is-active { color: var(--black); font-weight: 600; }
  .tabbar a.is-active::before { content: ""; position: absolute; top: -7px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 4px 4px; background: var(--red); }
  .tabbar .dot { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10px; display: grid; place-items: center; }
}

/* ---------- Tables become cards on phones (labels filled in by app.js) ---------- */
@media (max-width: 640px) {
  .table.stackable thead { display: none; }
  .table.stackable, .table.stackable tbody, .table.stackable tr, .table.stackable td { display: block; width: 100%; }
  .table.stackable tr { padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
  .table.stackable tr:last-child { border-bottom: 0; }
  .table.stackable td { padding: 3px 0 !important; border: 0; text-align: left !important; display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 26px; }
  .table.stackable td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 500; flex: none; }
  .table.stackable td:first-child { display: block; padding-bottom: 6px !important; }
  .table.stackable td:first-child::before { content: none; }
  .table.stackable td:empty { display: none; }
  .table.stackable .hide-sm { display: none !important; }
  .table.stackable tfoot td { display: flex; }
  .table.stackable td .row { justify-content: flex-end; }

  .kpis, .kpis.k3 { grid-template-columns: 1fr 1fr; }
  .kpi { border-left: 0; border-top: 1px solid var(--line-2); padding: 12px 14px; }
  .kpi:nth-child(-n+2) { border-top: 0; }
  .kpi:nth-child(even) { border-left: 1px solid var(--line-2); }
  .kpis.k3 .kpi:nth-child(3) { grid-column: 1 / -1; border-left: 0; }
  .kpi .v { font-size: 19px; }
  .item-hero { grid-template-columns: 1fr; }
  .item-hero .reward-img { min-height: 180px; border-right: 0; border-bottom: 1px solid var(--line-2); }
  .catalogue { grid-template-columns: 1fr 1fr; gap: 10px; }
  .reward-body { padding: 12px; }
  .reward-foot .btn { display: none; }
  .hbar { grid-template-columns: 90px 1fr 30px; }
  .steps li { font-size: 11px; }
  .page-head .page-actions { width: 100%; }
  .points-card .big { font-size: 34px; }
  .sheet { border-radius: var(--r-md); }
}
@media (max-width: 380px) { .catalogue { grid-template-columns: 1fr; } }

/* ---------- Live camera (clock in / out) ---------- */
.cam { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.cam-stage { position: relative; aspect-ratio: 4 / 3; background: #0E171C; color: #fff; overflow: hidden; }
.cam-stage video, .cam-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam.mirror video { transform: scaleX(-1); }
.cam-shot { display: none; }
.cam-idle { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; text-align: center; font-size: 13.5px; }
.cam-idle svg { width: 28px; height: 28px; opacity: .7; }
.cam-idle strong { font-weight: 500; max-width: 34ch; line-height: 1.45; }
.cam-idle .btn { --bg: #fff; --fg: var(--black); --bd: #fff; display: none; }
.cam-live { position: absolute; top: 12px; left: 12px; display: none; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: rgba(0,0,0,.45); }
.cam-live i { width: 7px; height: 7px; border-radius: 50%; background: #FF4A3D; animation: pulse-red 1.6s infinite; }
@keyframes pulse-red { 50% { opacity: .35; } }
.cam-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; min-height: 76px; }
.cam-shutter { width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--black); background: #fff; padding: 4px; cursor: pointer; transition: transform var(--fast) var(--ease); }
.cam-shutter i { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--red); transition: transform var(--fast) var(--ease); }
.cam-shutter:active i { transform: scale(.86); }
.cam-shutter:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
[data-cam-retake], [data-cam-switch], .cam-shutter { visibility: hidden; }
/* states */
.cam[data-state="live"] .cam-idle { display: none; }
.cam[data-state="live"] .cam-live { display: inline-flex; }
.cam[data-state="live"] .cam-shutter, .cam[data-state="live"] [data-cam-switch] { visibility: visible; }
.cam[data-state="taken"] .cam-shot { display: block; }
.cam[data-state="taken"] .cam-idle, .cam[data-state="taken"] video { display: none; }
.cam[data-state="taken"] [data-cam-retake] { visibility: visible; }
.cam[data-state="taken"] .cam-bar::before { content: "Photo ready"; font-size: 13px; font-weight: 600; color: var(--green); }
.cam[data-state="taken"] .cam-bar { justify-content: space-between; }
.cam[data-state="taken"] .cam-shutter, .cam[data-state="taken"] [data-cam-switch] { display: none; }
.cam[data-state="error"] .cam-idle .btn, .cam[data-state="idle"] .cam-idle .btn { display: inline-flex; }
.cam[data-state="error"] .cam-idle svg { color: #FFB4A8; opacity: 1; }
.has-error .cam { border-color: var(--red); box-shadow: 0 0 0 4px rgba(229,50,45,.08); }
.cam.nudge .cam-shutter { animation: shake .3s var(--ease); }
@media (max-width: 640px) { .cam-stage { aspect-ratio: 3 / 4; } }

/* ---------- Column-header filters (Enquiries list) ---------- */
@media (min-width: 641px) { .table-wrap.has-pop { overflow: visible; } }
.th-filter { padding: 0 !important; }
.table th.th-filter:first-child { padding-left: 12px !important; }
.table th.th-filter:last-child { padding-right: 12px !important; }
.col-filter { position: relative; }
.col-filter summary {
  list-style: none; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none;
  padding: 7px 10px; margin: 5px 0; border-radius: var(--r-sm); color: var(--muted); font-weight: 500; white-space: nowrap;
  transition: background var(--fast), color var(--fast);
}
.col-filter summary::-webkit-details-marker { display: none; }
.col-filter summary:hover, .col-filter[open] summary { background: var(--line-2); color: var(--ink); }
.col-filter summary svg { width: 13px; height: 13px; opacity: .7; transition: transform var(--fast); }
.col-filter[open] summary svg { transform: rotate(180deg); }
.col-filter.is-set summary { color: var(--ink); background: var(--red-soft, #FDECEC); }
.col-filter.is-set summary svg { color: var(--red); opacity: 1; transform: none; }
.col-filter summary em { font-style: normal; color: var(--red); max-width: 16ch; overflow: hidden; text-overflow: ellipsis; }
.col-menu {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; min-width: 210px; max-height: 340px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 12px 32px -12px rgba(22,34,42,.28);
  padding: 6px; display: flex; flex-direction: column; animation: menu-in .14s var(--ease);
}
.col-filter.to-right .col-menu { left: auto; right: 0; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.col-menu a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 400; color: var(--ink-2); white-space: nowrap; }
.col-menu a:hover { background: var(--line-2); color: var(--ink); }
.col-menu a.on { font-weight: 600; color: var(--ink); }
.col-menu a.on::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); flex: none; }
.col-search { padding: 4px 4px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line-2); }
.col-search .search, .col-search .input { width: 100%; }
.no-results td { cursor: default; }

@media (max-width: 640px) {
  /* Headers become a wrap of filter chips above the cards */
  .table.stackable thead.filter-head { display: block; padding: 10px 12px 6px; border-bottom: 1px solid var(--line-2); }
  .table.stackable thead.filter-head tr { display: flex; flex-wrap: wrap; gap: 6px; }
  .table.stackable thead.filter-head th { display: block; padding: 0 !important; border: 0; }
  .table.stackable thead.filter-head th.hide-sm { display: block !important; }
  .col-filter summary { margin: 0; padding: 6px 11px; border: 1px solid var(--line); border-radius: var(--r-pill); font-size: 12.5px; background: var(--surface); }
  .col-filter.is-set summary { border-color: #F3B8B5; }
  /* Menus open as a bottom sheet so they're never cut off */
  .col-filter[open]::before { content: ""; position: fixed; inset: 0; z-index: 60; background: rgba(22,34,42,.35); }
  .col-menu, .col-filter.to-right .col-menu {
    position: fixed; z-index: 61; left: 10px; right: 10px; top: auto; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    min-width: 0; max-height: 65vh; border-radius: var(--r-lg); padding: 8px;
  }
  .col-menu a { padding: 12px; font-size: 15px; }
  .table.stackable tr.no-results td::before { content: none; }
}

/* Quiet text-only delete link under a panel */
.delete-line { display: flex; justify-content: flex-end; margin-top: -6px; }
.text-danger { background: none; border: 0; padding: 2px 4px; font: inherit; font-size: 13px; font-weight: 500; color: var(--red); cursor: pointer; border-radius: 4px; }
.text-danger:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-danger:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.delete-line .text-danger.is-loading { opacity: .5; pointer-events: none; }
/* brief highlight when a field is filled automatically */
.input.autofilled, .select.autofilled, .textarea.autofilled { animation: autofill-flash .9s var(--ease); }
@keyframes autofill-flash { 0% { background: #FFF4D6; border-color: #F5C451; } 100% { background: var(--surface); } }

/* Your own logo in the portal sidebar */
.brand-logo-img { display: block; height: 30px; width: auto; max-width: 150px; object-fit: contain; }

/* ---------- Password show / hide ---------- */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap > input { width: 100%; padding-right: 46px !important; }
.pw-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; transition: color var(--fast), background var(--fast); }
.pw-toggle:hover { color: var(--ink); background: var(--line-2); }
.pw-toggle.on { color: var(--ink); }
.pw-toggle:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.pw-toggle svg { width: 18px; height: 18px; }
input[type="password"]::-ms-reveal, input[type="password"]::-ms-clear { display: none; } /* hide Edge's own eye so there's only one */

/* ---------- Status + points in tables: stacked with space, never overlapping ---------- */
.nowrap { white-space: nowrap; }
.status-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.pts-note { font-size: 12px; font-weight: 600; color: var(--green); white-space: nowrap; }
@media (max-width: 640px) { .table.stackable .status-stack { align-items: flex-end; } }

/* ==========================================================================
   v3 — departments, manual points, notifications
   ========================================================================== */

/* Department */
.dept-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--blue-soft); color: var(--blue); }
.dept-badge.service { background: var(--amber-soft); color: var(--amber); }
.dept-seg { align-self: flex-start; }
.dept-seg span { padding: 9px 26px; font-size: 14px; }

/* Invoice document: single amount */
.doc-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.doc-amount { margin-top: 6px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.doc-amount-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 18px; }
.doc-amount-row strong { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -.03em; }
.doc-amount-row.sub { padding-top: 10px; padding-bottom: 10px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 14px; }
.doc-amount-row.due { background: var(--surface-2); border-top: 1px solid var(--line); font-weight: 600; }
@media (max-width: 640px) { .doc-meta { grid-template-columns: 1fr 1fr; } .doc-amount-row strong { font-size: 22px; } }

/* Missed (dropped) points: shown but never added */
.pts-missed { color: var(--red); font-weight: 600; text-decoration: line-through; text-decoration-thickness: 1.5px; opacity: .85; white-space: nowrap; }
.pts-missed::after { content: " missed"; text-decoration: none; display: inline-block; margin-left: 4px; font-size: 11.5px; font-weight: 500; opacity: .9; }
.table tr.row-missed td { background: #FFF8F7; }

/* Notification bell */
.notif { position: relative; }
.notif > summary { list-style: none; position: relative; }
.notif > summary::-webkit-details-marker { display: none; }
.notif[open] > summary { background: var(--line-2); }
.notif-dot { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--canvas); line-height: 1; }
.notif-menu { position: absolute; z-index: 70; top: calc(100% + 8px); right: -6px; width: min(380px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); overflow: hidden; animation: pop .22s var(--ease) both; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; font-size: 14px; }
.notif-link { background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--red); cursor: pointer; }
.notif-link:hover { text-decoration: underline; }
.notif-list { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; border-top: 1px solid var(--line-2); }
.notif-list.page { max-height: none; border-top: 0; }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); transition: background var(--fast); }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: #FFFBF3; }
.notif-item.unread .notif-title::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-left: 7px; vertical-align: middle; }
.notif-icon { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); }
.notif-icon svg { width: 16px; height: 16px; }
.notif-icon.green { background: var(--green-soft); color: var(--green); }
.notif-icon.red { background: var(--red-soft); color: var(--red); }
.notif-icon.amber { background: var(--amber-soft); color: var(--amber); }
.notif-icon.blue { background: var(--blue-soft); color: var(--blue); }
.notif-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-title { font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.notif-body { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.notif-time { font-size: 12px; color: var(--faint); }
.notif-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 16px; color: var(--muted); font-size: 13px; }
.notif-empty svg { width: 22px; height: 22px; }
.notif-all { display: block; text-align: center; padding: 11px; font-size: 13px; font-weight: 600; border-top: 1px solid var(--line-2); }
.notif-all:hover { background: var(--surface-2); }
@media (max-width: 640px) {
  .notif-menu { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; }
}

/* v5: job acceptance + pending */
.alert.amber { background: var(--amber-soft); color: #6B4507; }
.avatar.amber { background: var(--amber); color: #fff; }
.avatar.blue { background: #2A5BD7; color: #fff; }
.steps li.warn { color: var(--amber); }
.steps li.warn::before { background: var(--amber); }
.job-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.job-actions .btn { min-width: 0; padding-left: 12px; padding-right: 12px; }
.list-item > .grow { min-width: 0; }
.list-item > .badge { flex-shrink: 0; }
.week { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.grid > * { min-width: 0; }

/* v6: enquiry departments (Sales / Service) */
.mt-xs { margin-top: 5px; }
.dept-badge.sm { height: 18px; padding: 0 7px; font-size: 10.5px; vertical-align: 1px; }
.dept-caption { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.dept-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.dept-tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); color: var(--ink); transition: border-color var(--fast), box-shadow var(--fast); min-width: 0; }
.dept-tile:hover { border-color: var(--ink); }
.dept-tile.is-active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.dept-ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--line-2); color: var(--ink); }
.dept-tile.sales .dept-ico { background: var(--blue-soft); color: var(--blue); }
.dept-tile.service .dept-ico { background: var(--amber-soft); color: var(--amber); }
.dept-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dept-txt b { font-size: 14.5px; font-weight: 600; }
.dept-txt small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dept-tile .n { flex: none; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.seg label.is-disabled span { opacity: .4; cursor: not-allowed; }
@media (max-width: 640px) {
  .dept-switch { gap: 8px; }
  .dept-tile { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; }
  .dept-ico { width: 32px; height: 32px; border-radius: 10px; }
  .dept-txt small { display: none; }
  .dept-tile .n { font-size: 17px; }
}

/* v7: employee teams */
.team-warn { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--amber); font-weight: 500; }
.team-warn[hidden] { display: none; }
.dept-badge.none { background: var(--line-2); color: var(--muted); }

/* v8: rating removed — amber text for pending counts */
.amber { color: var(--amber); }
.kpi .v.amber { color: var(--amber); }

/* v9: dd/mm/yyyy date fields (the native date input sits hidden underneath) */
.date-field { position: relative; display: block; width: 100%; }
.date-field > .input { width: 100%; padding-right: 44px; }
.date-field > .date-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; padding: 0; border: 0; }
.date-btn { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.date-btn:hover { color: var(--ink); background: var(--line-2); }
.date-field.sm .date-btn { width: 28px; height: 28px; right: 4px; }
.filters .date-field, .row > form .date-field { width: auto; display: inline-block; }
.row > form .date-field > .input { width: 168px; }

/* =====================================================================
   v10: invoice reward points, reward buckets, monthly employee points
   ===================================================================== */

/* Invoice form: reward points input */
.points-input { position: relative; display: flex; align-items: center; }
.points-input .input { padding-left: 46px; padding-right: 110px; }
.points-input-ico { position: absolute; left: 14px; color: var(--amber); display: grid; place-items: center; pointer-events: none; }
.points-input-worth { position: absolute; right: 14px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; }

/* Admin invoice page: promised points */
.promise { display: flex; gap: 14px; align-items: flex-start; }
.promise-n { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--r-md); background: var(--amber-soft); color: var(--amber); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.promise-n small { font-size: 12px; font-weight: 600; }
.promise-t { font-size: 13px; color: var(--ink-2); line-height: 1.45; }

/* Rewards page: points summary */
.rw-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0; border-radius: var(--r-lg); background: var(--black); color: #fff; overflow: hidden; margin-bottom: 16px; }
.rw-hero-main, .rw-hero-side { padding: 22px 24px; min-width: 0; }
.rw-hero-side { background: rgba(255,255,255,.06); border-left: 1px solid rgba(255,255,255,.08); }
.rw-hero-k { font-size: 12.5px; color: rgba(255,255,255,.65); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.rw-hero-v { font-family: var(--display); font-size: 44px; font-weight: 600; letter-spacing: -.04em; line-height: 1.05; margin-top: 6px; font-variant-numeric: tabular-nums; }
.rw-hero-v small { font-size: 18px; letter-spacing: 0; opacity: .7; }
.rw-hero-v.sm { font-size: 30px; }
.rw-hero-s { font-size: 13px; color: rgba(255,255,255,.72); margin-top: 6px; }
.rw-hero-s b { color: #7CE3A6; font-weight: 600; }
.month-track { height: 6px; border-radius: 9px; background: rgba(255,255,255,.14); margin-top: 12px; overflow: hidden; }
.month-track i { display: block; height: 100%; border-radius: inherit; background: #fff; }
@media (max-width: 640px) { .rw-hero { grid-template-columns: 1fr; } .rw-hero-side { border-left: 0; border-top: 1px solid rgba(255,255,255,.08); } .rw-hero-v { font-size: 38px; } }

/* Employee month switch */
.period-tabs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.period-tab { flex: none; display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); min-width: 150px; transition: border-color var(--fast), box-shadow var(--fast); }
.period-tab span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.period-tab b { font-size: 17px; font-variant-numeric: tabular-nums; }
.period-tab em { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--amber); }
.period-tab:hover { border-color: var(--ink); }
.period-tab.is-active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

/* Dealer: invoices that can still earn points */
.earn-panel { margin-bottom: 16px; }
.earn-row { align-items: center; }
.earn-pts { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 64px; height: 52px; border-radius: 14px; background: var(--amber-soft); color: var(--amber); font-weight: 700; font-size: 16px; line-height: 1; font-variant-numeric: tabular-nums; }
.earn-pts small { font-size: 10.5px; font-weight: 600; margin-top: 3px; }
.earn-time { height: 5px; border-radius: 9px; background: var(--line-2); margin-top: 8px; overflow: hidden; }
.earn-time i { display: block; height: 100%; border-radius: inherit; background: var(--ink); }
.earn-time.hot i { background: var(--red); }
.cash-panel { margin-bottom: 4px; }

/* Reward bucket */
.rb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.rb { position: relative; display: flex; gap: 16px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink); transition: border-color var(--fast), transform var(--med) var(--ease), box-shadow var(--med); min-width: 0; }
.rb:hover { border-color: #CFD5D8; transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(0,0,0,.25); }
.rb:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.rb-vis { position: relative; flex: none; width: 74px; padding-top: 10px; }
.rb-handle { position: absolute; top: 0; left: 50%; width: 54px; height: 26px; transform: translateX(-50%); border: 3px solid #CDD3D6; border-bottom: 0; border-radius: 30px 30px 0 0; }
.rb-pail { position: relative; height: 86px; background: var(--surface-2); border: 2px solid #CDD3D6; border-top-width: 4px; border-radius: 4px 4px 18px 18px; clip-path: polygon(0 0, 100% 0, 90% 100%, 10% 100%); overflow: hidden; }
.rb-fill { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--pct) * 1%); background: linear-gradient(180deg, #F1A23A, var(--amber)); animation: rb-rise 1.1s var(--ease) both; }
.rb-fill i { position: absolute; left: -50%; top: -6px; width: 200%; height: 12px; background: radial-gradient(circle at 10px -2px, transparent 8px, #F1A23A 9px) repeat-x; background-size: 20px 12px; animation: rb-wave 2.4s linear infinite; opacity: .95; }
.rb-extra { position: absolute; left: 0; right: 0; bottom: calc(var(--pct) * 1%); height: calc(var(--extra) * 1%); background: repeating-linear-gradient(-45deg, rgba(168,102,11,.28) 0 6px, rgba(168,102,11,.1) 6px 12px); animation: rb-rise 1.4s var(--ease) both; }
.rb-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 1px; font-weight: 700; font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.rb-pct small { font-size: 11px; font-weight: 600; margin-top: 4px; }
.rb.is-ready .rb-pail { border-color: var(--green); }
.rb.is-ready .rb-handle { border-color: var(--green); }
.rb.is-ready .rb-fill { background: linear-gradient(180deg, #3FBF7F, var(--green)); }
.rb.is-ready .rb-fill i { background-image: radial-gradient(circle at 10px -2px, transparent 8px, #3FBF7F 9px); }
.rb.is-ready .rb-pct { color: #fff; text-shadow: none; }
.rb.is-ready { border-color: rgba(18,128,74,.35); background: linear-gradient(180deg, var(--green-soft), var(--surface) 60%); }
.rb.is-close { border-color: rgba(168,102,11,.35); }
.rb.is-out { opacity: .6; }
.rb-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.rb-kind { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.rb-title { font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.rb-nums { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rb-nums b { color: var(--ink); font-size: 15px; }
.rb-msg { font-size: 13px; line-height: 1.45; color: var(--ink-2); margin-top: 6px; }
.rb.is-ready .rb-msg { color: #0F5A32; font-weight: 600; }
.rb-hint { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; line-height: 1.4; color: var(--amber); font-weight: 500; }
.rb-hint svg { flex: none; margin-top: 2px; }
.rb-cta { margin-top: auto; padding-top: 8px; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--green); }
.rb-compact { flex: none; width: 300px; scroll-snap-align: start; padding: 16px; }
.rb-compact .rb-vis { width: 62px; }
.rb-compact .rb-pail { height: 72px; }
.rb-compact .rb-handle { width: 46px; height: 22px; }
@keyframes rb-rise { from { height: 0; } }
@keyframes rb-wave { from { transform: translateX(0); } to { transform: translateX(20px); } }
@media (prefers-reduced-motion: reduce) { .rb-fill, .rb-extra { animation: none; } .rb-fill i { animation: none; } }

/* Reward item page meter */
.item-meter-bar { position: relative; display: flex; height: 12px; border-radius: 9px; background: var(--line-2); overflow: hidden; }
.item-meter-bar .have { display: block; width: calc(var(--pct) * 1%); background: var(--amber); animation: meter-grow 1s var(--ease) both; }
.item-meter-bar .extra { display: block; width: calc(var(--extra) * 1%); background: repeating-linear-gradient(-45deg, rgba(168,102,11,.35) 0 6px, rgba(168,102,11,.12) 6px 12px); }
@keyframes meter-grow { from { width: 0; } }

/* Horizontal reward strip (dashboards) */
.reward-strip, .month-rewards { margin-bottom: 18px; min-width: 0; }
.strip-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 8px; scrollbar-width: thin; }
.strip-btn { width: 32px; height: 32px; }
[data-strip].at-start .strip-btn[data-strip-prev], [data-strip].at-end .strip-btn[data-strip-next] { opacity: .35; pointer-events: none; }
@media (max-width: 640px) { .strip-btn { display: none; } .rb-compact { width: 82vw; max-width: 320px; } }

/* Employee dashboard: month header */
.month-rewards { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.month-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.month-k { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.month-v { font-family: var(--display); font-size: 40px; font-weight: 600; letter-spacing: -.04em; line-height: 1.05; margin-top: 4px; font-variant-numeric: tabular-nums; }
.month-v small { font-size: 16px; color: var(--muted); letter-spacing: 0; }
.month-s { font-size: 13px; color: var(--muted); margin-top: 6px; }
.month-clock { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.month-ring { --p: 50; width: 84px; height: 84px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(closest-side, var(--surface) 78%, transparent 80% 100%), conic-gradient(var(--red) calc(var(--p) * 1%), var(--line-2) 0); }
.month-ring b { font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.month-ring small { font-size: 10.5px; color: var(--muted); }
.month-rewards .section-head { margin: 14px 0 8px; }

/* Banners: points waiting / unredeemed */
.earn-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--amber-soft); color: #6B4507; border: 1px solid rgba(168,102,11,.18); transition: transform var(--med) var(--ease), box-shadow var(--med); }
.earn-banner:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -14px rgba(168,102,11,.6); }
.earn-banner b { display: block; font-size: 14px; }
.earn-banner small { display: block; font-size: 12.5px; opacity: .85; margin-top: 2px; }
.earn-banner-ico { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--amber); color: #fff; animation: pulse-ico 2.4s ease-in-out infinite; }
@keyframes pulse-ico { 0%, 100% { box-shadow: 0 0 0 0 rgba(168,102,11,.35); } 50% { box-shadow: 0 0 0 7px rgba(168,102,11,0); } }
@media (prefers-reduced-motion: reduce) { .earn-banner-ico { animation: none; } }
.chip-pts { flex: none; font-size: 12px; font-weight: 700; color: var(--amber); background: var(--amber-soft); border-radius: var(--r-pill); padding: 3px 9px; font-variant-numeric: tabular-nums; }

/* Missed points (dealer) / missed rewards (employee) */
.missed-card { border-radius: var(--r-lg); background: var(--surface); border: 1px solid rgba(214,48,39,.25); overflow: hidden; }
.missed-card summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; background: linear-gradient(90deg, var(--red-soft), var(--surface)); }
.missed-card summary::-webkit-details-marker { display: none; }
.missed-card summary b { display: block; font-size: 14px; color: #8E1D19; }
.missed-card summary small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.missed-ico { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--red); color: #fff; }
.missed-caret { flex: none; color: var(--muted); transition: transform var(--fast); }
.missed-card[open] .missed-caret { transform: rotate(180deg); }
.missed-list { border-top: 1px solid var(--line-2); }
.missed-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line-2); }
a.missed-row:hover { background: var(--surface-2); }
.missed-row b { display: block; font-size: 13.5px; }
.missed-row small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.missed-n { font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }
.missed-more { display: flex; align-items: center; gap: 4px; padding: 11px 16px; font-size: 12.5px; color: var(--muted); }
a.missed-more:hover { color: var(--ink); }

/* My redemptions: two ways to redeem */
.redeem-ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.redeem-way { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); text-align: left; font: inherit; color: var(--ink); cursor: pointer; transition: border-color var(--fast), transform var(--med) var(--ease); }
.redeem-way:hover:not([disabled]) { border-color: var(--ink); transform: translateY(-1px); }
.redeem-way[disabled] { cursor: default; opacity: .7; }
.redeem-way b { display: block; font-size: 14px; }
.redeem-way small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
@media (max-width: 640px) { .redeem-ways { grid-template-columns: 1fr; } }
.earn-banner > .grow, .missed-card summary > .grow, .missed-row > .grow, .redeem-way > .grow { flex: 1; min-width: 0; }

/* v11: compact rewards box under the clock-in card (employee Today) */
.month-rewards.mini { padding: 14px 16px; margin-bottom: 0; }
.month-rewards.mini .month-k { font-size: 11px; }
.month-rewards.mini .month-v { font-size: 26px; margin-top: 2px; }
.month-rewards.mini .month-v small { font-size: 13px; }
.month-rewards.mini .month-s { font-size: 12px; margin-top: 2px; }
.month-rewards.mini .month-clock { flex-direction: row; gap: 8px; align-items: center; }
.month-rewards.mini .month-clock .month-s { text-align: left; line-height: 1.35; }
.month-rewards.mini .month-ring { width: 46px; height: 46px; }
.month-rewards.mini .month-ring b { font-size: 15px; }
.month-rewards.mini .section-head { margin: 10px 0 6px; }
.month-rewards.mini .section-head h2 { font-size: 13.5px; }
.month-rewards.mini .strip-track { gap: 8px; padding-bottom: 4px; }
.month-rewards.mini .rb-compact { width: 220px; padding: 10px 12px; gap: 10px; border-radius: var(--r-md); }
.month-rewards.mini .rb-compact .rb-vis { width: 40px; padding-top: 7px; }
.month-rewards.mini .rb-compact .rb-handle { width: 30px; height: 14px; border-width: 2px; }
.month-rewards.mini .rb-compact .rb-pail { height: 44px; border-top-width: 3px; border-radius: 3px 3px 12px 12px; }
.month-rewards.mini .rb-pct { font-size: 12px; }
.month-rewards.mini .rb-pct small { font-size: 9px; margin-top: 2px; }
.month-rewards.mini .rb-pct svg { width: 15px; height: 15px; }
.month-rewards.mini .rb-kind { display: none; }
.month-rewards.mini .rb-title { font-size: 13px; }
.month-rewards.mini .rb-nums { font-size: 12px; }
.month-rewards.mini .rb-nums b { font-size: 13px; }
.month-rewards.mini .rb-msg { font-size: 11.5px; margin-top: 2px; line-height: 1.35; }
.month-rewards.mini .rb-cta { padding-top: 2px; font-size: 12px; }
.stack > .earn-banner, .stack > .missed-card { margin: 0; }
@media (max-width: 640px) { .month-rewards.mini .rb-compact { width: 72vw; max-width: 240px; } }
.month-rewards.mini .rb-msg { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.month-rewards.mini .rb-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* v13: eye-catching rewards box (employee Today) */
.rw-glow { position: relative; overflow: hidden; color: #fff; border: 0;
  background: radial-gradient(120% 90% at 100% 0%, rgba(241,162,58,.45) 0%, rgba(241,162,58,0) 55%),
              radial-gradient(90% 80% at 0% 100%, rgba(214,48,39,.35) 0%, rgba(214,48,39,0) 60%),
              linear-gradient(140deg, #161C26 0%, #1F2633 55%, #2B2216 100%);
  box-shadow: 0 18px 40px -22px rgba(168,102,11,.75); }
.rw-glow .month-k { color: #F6C77A; letter-spacing: .08em; }
.rw-glow .month-v { color: #fff; }
.rw-glow .month-v small, .rw-glow .month-s { color: rgba(255,255,255,.7); }
.rw-glow .month-ring { background: radial-gradient(closest-side, #1F2633 78%, transparent 80% 100%), conic-gradient(#F1A23A calc(var(--p) * 1%), rgba(255,255,255,.15) 0); }
.rw-glow .month-ring b { color: #fff; }
.rw-glow .section-head h2 { color: #fff; }
.rw-glow .section-head a { color: rgba(255,255,255,.75); }
.rw-glow .section-head a:hover { color: #fff; }
.rw-glow .strip-btn { --bg: rgba(255,255,255,.08); --fg: #fff; --bd: rgba(255,255,255,.18); }
.rw-glow .rb { box-shadow: 0 8px 20px -14px rgba(0,0,0,.6); }
.rw-glow > *:not(.rw-spark) { position: relative; z-index: 1; }

/* Sparkles */
.rw-spark { position: absolute; z-index: 0; width: 6px; height: 6px; border-radius: 50%; background: #FFE2A8; box-shadow: 0 0 10px 3px rgba(255,214,140,.65); animation: rw-twinkle 3.2s ease-in-out infinite; }
.rw-spark.s1 { top: 18px; right: 34%; }
.rw-spark.s2 { top: 54%; right: 8%; width: 4px; height: 4px; animation-delay: 1.1s; }
.rw-spark.s3 { bottom: 22px; left: 46%; width: 5px; height: 5px; animation-delay: 2s; }
@keyframes rw-twinkle { 0%, 100% { opacity: .15; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.25); } }

/* Headline goal */
.rw-goal { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: var(--r-md); color: #fff;
  background: linear-gradient(90deg, rgba(241,162,58,.22), rgba(241,162,58,.08)); border: 1px solid rgba(241,162,58,.45); transition: transform var(--med) var(--ease), border-color var(--fast); }
.rw-goal:hover { transform: translateY(-1px); border-color: #F1A23A; }
.rw-goal b { display: block; font-size: 15.5px; line-height: 1.3; }
.rw-goal small { display: block; font-size: 12.5px; color: rgba(255,255,255,.75); margin-top: 2px; }
.rw-goal-ico { flex: none; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: #1F2633; background: linear-gradient(160deg, #FFD58A, #F1A23A); animation: rw-bounce 2.6s var(--ease-spring, ease) infinite; }
@keyframes rw-bounce { 0%, 70%, 100% { transform: translateY(0) rotate(0); } 78% { transform: translateY(-5px) rotate(-8deg); } 86% { transform: translateY(0) rotate(6deg); } 92% { transform: rotate(0); } }
.rw-goal-bar { position: relative; display: block; height: 8px; border-radius: 9px; background: rgba(255,255,255,.15); margin-top: 8px; overflow: hidden; }
.rw-goal-bar i { position: relative; display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #F1A23A, #FFD58A); animation: meter-grow 1.2s var(--ease) both; overflow: hidden; }
.rw-goal-bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); transform: translateX(-100%); animation: rw-shine 2.4s ease-in-out 1.2s infinite; }
@keyframes rw-shine { to { transform: translateX(100%); } }
.rw-goal-pct { flex: none; font-family: var(--display); font-size: 22px; font-weight: 700; color: #FFD58A; font-variant-numeric: tabular-nums; }
.rw-goal-btn { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px; border-radius: var(--r-pill); background: #fff; color: #0F5A32; font-size: 13px; font-weight: 700; }
.rw-goal.is-ready { background: linear-gradient(90deg, rgba(63,191,127,.3), rgba(63,191,127,.1)); border-color: rgba(63,191,127,.6); }
.rw-goal.is-ready .rw-goal-ico { background: linear-gradient(160deg, #8EF0BC, #3FBF7F); }
@media (prefers-reduced-motion: reduce) { .rw-spark, .rw-goal-ico, .rw-goal-bar i::after { animation: none; } }
@media (max-width: 640px) { .rw-goal b { font-size: 14px; } .rw-goal-pct { font-size: 18px; } }
.rw-goal > .grow { flex: 1; min-width: 0; }

/* v14: dealer rewards box (same look as employee) + cards fill the row when there are only a few */
.dealer-rw { margin-bottom: 18px; }
.dealer-rw .month-head { flex-wrap: wrap; align-items: center; }
.dealer-rw .month-head > div:first-child { flex: 1; min-width: 200px; }
.rw-wait { display: flex; flex-direction: column; padding: 8px 14px; border-radius: var(--r-md); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); color: #fff; }
.rw-wait:hover { border-color: rgba(241,162,58,.6); }
.rw-wait b { font-size: 22px; font-weight: 700; color: #FFD58A; font-variant-numeric: tabular-nums; line-height: 1.2; }
.rw-wait b small { font-size: 12px; color: rgba(255,255,255,.7); }
.rw-wait .month-s { margin-top: 0; }
.rw-head-btn { color: var(--ink); }
.rw-goal-bar { display: flex; }
.rw-goal-bar em { display: block; height: 100%; background: repeating-linear-gradient(-45deg, rgba(255,213,138,.55) 0 6px, rgba(255,213,138,.2) 6px 12px); }
/* Few rewards: cards grow to fill the row instead of leaving a gap */
.strip-track > .rb-compact { flex: 1 0 220px; width: auto; max-width: none; }
.month-rewards.mini .strip-track > .rb-compact { flex: 1 0 220px; width: auto; }
[data-strip].no-scroll .strip-btn { display: none; }
@media (max-width: 640px) { .strip-track > .rb-compact, .month-rewards.mini .strip-track > .rb-compact { flex: 0 0 78%; } .dealer-rw .rw-head-btn { width: 100%; justify-content: center; } }
.month-rewards.mini.dealer-rw { margin-bottom: 18px; }

/* v15: ₹ insert button inside text fields */
.rupee-field { position: relative; display: block; }
.rupee-field > .input, .rupee-field > .textarea { width: 100%; padding-right: 52px; }
.rupee-btn { position: absolute; top: 50%; right: 7px; transform: translateY(-50%); width: 36px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 17px; font-weight: 700; cursor: pointer; transition: background var(--fast), border-color var(--fast); }
.rupee-btn:hover { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }
.rupee-field.is-area .rupee-btn { top: 8px; transform: none; }

/* v16: "Points to give" reminders for completed jobs */
.give-points-alert { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 16px; border-radius: var(--r-md); background: var(--amber-soft); border: 1px solid rgba(168,102,11,.25); color: #6B4507; }
.give-points-alert > .grow { flex: 1; min-width: 180px; }
.give-points-alert b { display: block; font-size: 14px; }
.give-points-alert small { display: block; font-size: 12.5px; opacity: .85; margin-top: 2px; }
.give-chip { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
.give-panel { border-color: rgba(168,102,11,.3); }
.give-panel .panel-head h2 { display: inline-flex; align-items: center; gap: 8px; color: #6B4507; }

/* v17: Console → Website */
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ws-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ws-card.is-hidden { opacity: .6; }
.ws-media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.ws-media .art { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; }
.ws-media .art img { width: 100%; height: 100%; object-fit: cover; }
.ws-flag { position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: var(--r-pill); background: rgba(0,0,0,.7); color: #fff; font-size: 12px; font-weight: 600; }
.ws-body { padding: 14px 16px 6px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ws-top { display: flex; align-items: center; gap: 10px; }
.ws-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--black); color: #fff; font-size: 12px; font-weight: 700; }
.ws-body h3 { font-size: 16px; font-weight: 600; }
.ws-body p { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.ws-foot { display: flex; align-items: center; gap: 6px; padding: 10px 12px 14px; }
.ws-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.ws-preview { position: sticky; top: 90px; }
.ws-preview-k { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.ws-live .ws-body { padding-bottom: 16px; }
@media (max-width: 960px) { .ws-form-grid { grid-template-columns: 1fr; } .ws-preview { position: static; order: -1; } }

/* website card artwork (copied from site.css for the console previews) */
.art { position: relative; overflow: hidden; isolation: isolate; background: var(--black); width: 100%; height: 100%; min-height: 120px; }
.art i { position: absolute; border-radius: 50%; filter: blur(22px); transition: transform 1.2s ease; }
.art::after { content: ""; position: absolute; inset: 0; z-index: 1; background: repeating-linear-gradient(120deg, rgba(255,255,255,0) 0 16px, rgba(255,255,255,.09) 22px, rgba(0,0,0,.12) 30px, rgba(255,255,255,0) 38px); mix-blend-mode: overlay; }
.art .a1 { width: 90%; height: 120%; left: -20%; top: -30%; }
.art .a2 { width: 70%; height: 90%; right: -20%; bottom: -30%; }
.art .a3 { width: 40%; height: 50%; left: 40%; top: 30%; }
.art-ups { background: #120404; }
.art-ups .a1 { background: radial-gradient(closest-side, #FF3B2F, transparent); }
.art-ups .a2 { background: radial-gradient(closest-side, #7A0906, transparent); }
.art-ups .a3 { background: radial-gradient(closest-side, #FF9A7A, transparent); }
.art-solar { background: #E5322D; }
.art-solar .a1 { background: radial-gradient(closest-side, #FFB35C, transparent); }
.art-solar .a2 { background: radial-gradient(closest-side, #6B0704, transparent); }
.art-solar .a3 { background: radial-gradient(closest-side, #FFE2B8, transparent); }
.art-solar::before { content: ""; position: absolute; inset: 0; z-index: 1; background-image: linear-gradient(rgba(255,255,255,.14) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.14) 1px, transparent 1px); background-size: 28px 28px; transform: perspective(300px) rotateX(38deg) scale(1.6); transform-origin: bottom; opacity: .7; }
.art-battery { background: #0B0B0B; }
.art-battery .a1 { background: radial-gradient(closest-side, #3A3A3A, transparent); }
.art-battery .a2 { background: radial-gradient(closest-side, #E5322D, transparent); }
.art-battery .a3 { background: radial-gradient(closest-side, #FF7A5C, transparent); }
.art-dark { background: #050505; }
.art-dark .a1 { background: radial-gradient(closest-side, #2B2B2B, transparent); }
.art-dark .a2 { background: radial-gradient(closest-side, #B3140E, transparent); }
.art-dark .a3 { background: radial-gradient(closest-side, #555, transparent); }
.art-red { background: #D8231E; }
.art-red .a1 { background: radial-gradient(closest-side, #FF7058, transparent); }
.art-red .a2 { background: radial-gradient(closest-side, #5E0503, transparent); }
.art-red .a3 { background: radial-gradient(closest-side, #FFC2B0, transparent); }
.art-icon { position: absolute; z-index: 2; right: 14px; bottom: 14px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; border: 1px solid rgba(255,255,255,.22); }
.art-icon svg { width: 20px; height: 20px; }
.art-label { position: absolute; z-index: 2; left: 16px; bottom: 16px; font-size: 12.5px; color: #fff; background: rgba(0,0,0,.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 6px 12px; border-radius: 99px; }
.art-photo { background: #f4f4f2; }
.art-photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease; }
.work-card:hover .art-photo > img, .rail-card:hover .art-photo > img { transform: scale(1.04); }
.art-photo .art-icon { background: rgba(0,0,0,.35); }

/* v19: guest demo bar */
.demo-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 clamp(16px, 3vw, 32px); padding: 9px 14px; border-radius: 0 0 14px 14px; background: #2B2216; color: #FFE2A8; font-size: 13px; box-shadow: 0 8px 20px -14px rgba(0,0,0,.6); }
.demo-bar > .grow { flex: 1; min-width: 200px; }
.demo-bar b { color: #fff; }
.demo-dot { width: 8px; height: 8px; border-radius: 50%; background: #F1A23A; box-shadow: 0 0 0 4px rgba(241,162,58,.25); flex: none; }
.demo-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); background: #fff; color: #2B2216; border: 0; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; list-style: none; }
.demo-btn::-webkit-details-marker { display: none; }
.demo-menu { position: relative; }
.demo-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 300px; max-height: 60vh; overflow: auto; padding: 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop, 0 18px 40px -14px rgba(0,0,0,.35)); color: var(--ink); }
.demo-pop-k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 8px 4px; }
.demo-pop button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border: 0; background: none; border-radius: 10px; font: inherit; font-size: 13.5px; color: var(--ink); text-align: left; cursor: pointer; }
.demo-pop button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-pop button:hover { background: var(--surface-2); }
@media (max-width: 640px) { .demo-bar { margin: 0 12px; } .demo-pop { right: auto; left: 0; width: min(300px, 85vw); } }
