/* Burger 99 Crew — design system
   Palette: white surfaces, dark grey ink and structure, maroon for actions and the current place.
   No beige, cream or gold anywhere. Neutral greys only; status colours (green, amber, red) are used for status alone.
   Type: Inter for text, Plus Jakarta Sans for headings and numbers. Spacing on a 4 px grid. */

/* ======================================================================
   1. Tokens
   ====================================================================== */
:root {
  color-scheme: light;
  /* surfaces */
  --bg: #ffffff;
  --surface: #ffffff;
  --soft: #f7f7f9;
  --tone: #f1f1f4;
  --tone-ink: #4a4c54;
  --line: #ececf0;
  --line-strong: #dcdde3;
  /* ink */
  --ink: #18191d;
  --ink-2: #565861;
  --ink-3: #8b8d96;
  /* dark grey structure */
  --hero: #1d1e22;
  --hero-2: #2a2b31;
  --on-hero: #ffffff;
  --on-hero-2: #b9bbc3;
  /* maroon */
  --maroon: #7a1f2b;
  --maroon-hover: #651822;
  --maroon-2: #9b2a39;
  --maroon-tint: #f8eef0;
  --maroon-line: #ecd3d7;
  --maroon-text: #7a1f2b;
  --on-maroon: #ffffff;
  /* status */
  --ok: #1d7a4b; --ok-tint: #eaf6ef; --ok-ink: #17603b;
  --warn: #b45f06; --warn-tint: #fdf4e8; --warn-ink: #8a4705;
  --bad: #b42318; --bad-tint: #fdeeec; --bad-ink: #9a1d14;
  /* depth */
  --shadow-sm: 0 1px 2px rgba(17, 18, 22, .04);
  --shadow: 0 1px 2px rgba(17, 18, 22, .04), 0 8px 24px rgba(17, 18, 22, .06);
  --shadow-lg: 0 24px 64px rgba(17, 18, 22, .22);
  --ring: 0 0 0 3px color-mix(in srgb, var(--maroon) 18%, transparent);
  /* shape */
  --r: 16px; --r-sm: 10px; --r-xs: 8px;
  /* type */
  --font: 'Inter', 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Plus Jakarta Sans', 'Inter', 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --side-w: 248px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme="dark"] {
  --bg: #121316; --surface: #18191c; --soft: #1f2024; --tone: #26272c; --tone-ink: #d4d5db;
  --line: #26272c; --line-strong: #34363c; --ink: #f3f3f5; --ink-2: #b8bac2; --ink-3: #868892;
  --hero: #1f2024; --hero-2: #2a2b31; --on-hero: #ffffff; --on-hero-2: #b9bbc3;
  --maroon: #a83343; --maroon-hover: #bd4555; --maroon-2: #c24c5c; --maroon-tint: #2c1a1e; --maroon-line: #4a262d; --maroon-text: #ef9aa5;
  --ok: #3fae74; --ok-tint: #17291f; --ok-ink: #8fd8b0;
  --warn: #e0a043; --warn-tint: #2e2414; --warn-ink: #f2c47c;
  --bad: #e46a5e; --bad-tint: #321b19; --bad-ink: #f5a9a0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* ======================================================================
   2. Base and type
   ====================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.55 var(--font); letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  padding-left: max(0px, env(safe-area-inset-left, 0px)); padding-right: max(0px, env(safe-area-inset-right, 0px));
}
body.no-scroll { overflow: hidden; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); margin: 0; text-wrap: balance; }
h1 { font-size: 1.6rem; line-height: 1.2; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 1rem; line-height: 1.35; font-weight: 700; letter-spacing: -.01em; }
.h3 { font-size: 1rem; font-weight: 700; margin: 0 0 6px; font-family: var(--font-head); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--maroon); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--maroon) 18%, transparent); }
.ic { flex: none; vertical-align: -.2em; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.block { display: block; }
.right { text-align: right; white-space: nowrap; }
.r { text-align: right; }
.c { text-align: center; }
small { font-size: .8rem; }
.link { color: var(--maroon-text); font-weight: 600; font-size: .88rem; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.lead { font-size: 1.02rem; color: var(--ink-2); margin-bottom: 16px; max-width: 62ch; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
mark { background: var(--maroon-tint); color: var(--maroon-text); border-radius: 3px; padding: 0 2px; }

/* ======================================================================
   3. Layout primitives
   ====================================================================== */
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 28px; }
.row { display: flex; align-items: center; }
.row.end { justify-content: flex-end; } .row.center { justify-content: center; }
.row.gap { gap: 10px; } .row.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 0; min-width: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }

/* ======================================================================
   4. App shell: sidebar, top bar, bottom tabs
   ====================================================================== */
.app { min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 40; padding: 20px 12px 12px;
  padding-top: max(20px, env(safe-area-inset-top, 0px)); padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 18px; }
.side-brand strong { font-family: var(--font-head); font-size: 1rem; font-weight: 700; display: block; line-height: 1.2; letter-spacing: -.01em; }
.side-brand small { color: var(--ink-3); font-size: .78rem; }
.side-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; scrollbar-width: thin; margin: 0 -4px; padding: 0 4px; }
.nav-title { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); padding: 18px 12px 6px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--r-xs); color: var(--ink-2); font-weight: 500; font-size: .9rem; min-height: 40px; transition: background .15s, color .15s; }
.nav-item .ic { color: var(--ink-3); transition: color .15s; }
.nav-item:hover { background: var(--soft); color: var(--ink); }
.nav-item.on { background: var(--maroon-tint); color: var(--maroon-text); font-weight: 600; }
.nav-item.on .ic { color: var(--maroon-text); }
.badge { margin-left: auto; background: var(--maroon); color: var(--on-maroon); font-size: .7rem; border-radius: 99px; padding: 1px 7px; font-weight: 600; min-width: 20px; text-align: center; }
.side-foot { display: flex; align-items: center; gap: 4px; padding: 12px 6px 0; border-top: 1px solid var(--line); margin-top: 10px; }
.side-foot .who { flex: 1; min-width: 0; overflow: hidden; padding: 4px; border-radius: var(--r-xs); }
.side-foot .who:hover { background: var(--soft); }
.side-mode { padding: 0 6px 12px; }
.side-mode .mode-switch { width: 100%; }
.scrim { display: none; }
.main { margin-left: var(--side-w); min-height: 100vh; }
.topbar { display: none; }
.content { padding: 36px 40px 72px; margin: 0 auto; }
.content.wide { max-width: 1240px; }
.content.narrow { max-width: 760px; }
.bnav { display: none; }
.app.crew .main { margin-left: var(--side-w); }

.mark-img { width: 40px; height: 40px; border-radius: 11px; flex: none; display: block; box-shadow: 0 0 0 1px var(--line); }
.mark-img.sm { width: 32px; height: 32px; border-radius: 9px; }
.mark-img.xl { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 8px 24px rgba(17, 18, 22, .12); }
.mark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--maroon); color: #fff; font: 700 1rem var(--font-head); flex: none; }
.mark.sm { width: 30px; height: 30px; font-size: .85rem; border-radius: 9px; }
.mark.xl { width: 72px; height: 72px; font-size: 1.9rem; border-radius: 18px; }

@media (max-width: 959px) {
  .main, .app.crew .main { margin-left: 0; }
  .side { transform: translateX(-102%); transition: transform .24s var(--ease); box-shadow: var(--shadow-lg); }
  .app.crew .side { display: none; }
  .app.nav-open .side { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(17, 18, 22, .4); z-index: 35; backdrop-filter: blur(2px); }
  .topbar {
    display: flex; align-items: center; gap: 8px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
    background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--line); padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); min-height: 60px;
  }
  .top-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-size: .98rem; min-width: 0; }
  .top-brand strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; letter-spacing: -.01em; }
  .content { padding: 20px max(16px, env(safe-area-inset-right, 0px)) 56px max(16px, env(safe-area-inset-left, 0px)); }
  .app.crew .content { padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px)); }
  .bnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 30;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
    border-top: 1px solid var(--line); padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
  }
  .bnav .nav-item { flex-direction: column; gap: 3px; font-size: .68rem; font-weight: 500; padding: 6px 2px; min-height: 54px; justify-content: center; text-align: center; border-radius: 12px; background: none; }
  .bnav .nav-item span { line-height: 1.1; }
  .bnav .nav-item.on { background: none; color: var(--maroon-text); font-weight: 600; }
  .bnav .nav-item.on::before { content: ""; position: absolute; top: 0; left: 50%; width: 22px; height: 3px; margin-left: -11px; border-radius: 0 0 3px 3px; background: var(--maroon); }
  .cols, .cols.even { grid-template-columns: 1fr; }
  h1 { font-size: 1.4rem; }
}
@media (min-width: 960px) { .menu-btn { display: none; } }
@media (max-width: 480px) {
  .topbar:has(.mode-switch) .top-brand strong { display: none; }
  .topbar .mode-switch { flex: 0 1 auto; }
}

/* ======================================================================
   5. Buttons
   ====================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: var(--tone); color: var(--ink); font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .08s; text-align: center; line-height: 1.2;
}
.btn:active { transform: scale(.985); }
.btn:not(.btn-primary):not(.btn-danger):not(.btn-dark):not(.btn-light):not(.btn-ghost):not(.btn-light-ghost):not(.btn-danger-ghost):hover { background: color-mix(in srgb, var(--tone) 75%, var(--line-strong)); }
.btn:disabled, .btn.disabled { opacity: 1; background: var(--tone); border-color: transparent; color: var(--ink-3); box-shadow: none; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--maroon); color: var(--on-maroon); box-shadow: 0 1px 2px rgba(122, 31, 43, .25); }
.btn-primary:hover { background: var(--maroon-hover); }
.btn-dark { background: var(--hero); color: var(--on-hero); }
.btn-dark:hover { background: var(--hero-2); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--soft); border-color: color-mix(in srgb, var(--line-strong) 70%, var(--ink-3)); }
.btn-light { background: #fff; color: #18191d; }
.btn-light:hover { background: #f1f1f4; }
.btn-light-ghost { background: transparent; border-color: rgba(255, 255, 255, .3); color: var(--on-hero); }
.btn-light-ghost:hover { background: rgba(255, 255, 255, .08); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger-ghost { background: transparent; border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); color: var(--bad-ink); }
.btn-danger-ghost:hover { background: var(--bad-tint); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .84rem; border-radius: var(--r-xs); gap: 6px; }
.btn-xl { min-height: 56px; font-size: 1.04rem; border-radius: 14px; width: 100%; }
.btn-block { width: 100%; min-height: 50px; font-size: .98rem; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--ink-2); cursor: pointer; flex: none; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.lang-btn { margin-right: 4px; }
.btn-row { width: 100%; background: transparent; border: 0; font: inherit; text-align: left; cursor: pointer; color: var(--ink); }

/* ======================================================================
   6. Surfaces: cards, headings, empty states, chips, avatars, bars
   ====================================================================== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; min-width: 0; box-shadow: var(--shadow-sm); }
a.card { display: block; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.card .sec-head { margin-bottom: 14px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sec-head h2 { font-size: .98rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head > div:first-child { min-width: 0; max-width: 68ch; }
.page-head p { margin-top: 6px; font-size: .92rem; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-weight: 500; margin-bottom: 14px; min-height: 36px; font-size: .9rem; }
.back:hover { color: var(--ink); }
.back .ic { transform: rotate(180deg); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 40px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--surface); }
.empty strong { font-family: var(--font-head); font-weight: 700; }
.empty .muted { max-width: 44ch; font-size: .9rem; }
.empty-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-3); margin-bottom: 6px; }
.empty .btn { margin-top: 10px; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: .74rem; font-weight: 600; line-height: 1.4; background: var(--tone); color: var(--tone-ink); white-space: nowrap; }
.chip.grey { background: var(--tone); color: var(--tone-ink); }
.chip.ok { background: var(--ok-tint); color: var(--ok-ink); }
.chip.warn { background: var(--warn-tint); color: var(--warn-ink); }
.chip.bad { background: var(--bad-tint); color: var(--bad-ink); }
.chip.maroon { background: var(--maroon-tint); color: var(--maroon-text); }

.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--tone); color: var(--ink-2); font-weight: 600; font-size: .78rem; flex: none; font-family: var(--font-head); letter-spacing: .01em; }
.avatar.lg { width: 52px; height: 52px; font-size: 1rem; }
.avatar.xl { width: 72px; height: 72px; font-size: 1.3rem; }
.avatar.on-dark { background: rgba(255, 255, 255, .12); color: var(--on-hero); }
.avatar.has-img { padding: 0; overflow: hidden; }
.avatar.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who > span:not(.avatar) { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; font-weight: 600; white-space: nowrap; font-size: .9rem; }
.who > span:not(.avatar) small { overflow: hidden; text-overflow: ellipsis; }
.who small { font-weight: 400; }

.bar { height: 6px; border-radius: 99px; background: var(--tone); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--maroon); border-radius: 99px; transition: width .4s var(--ease); }
.bar.glow i { background: linear-gradient(90deg, var(--maroon), var(--maroon-2)); }

/* ======================================================================
   7. Forms
   ====================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: .84rem; font-weight: 600; color: var(--ink); }
.field > small { line-height: 1.4; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline > span { white-space: nowrap; color: var(--ink-2); font-weight: 500; }
.input, .select {
  width: 100%; min-height: 44px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); color: var(--ink);
  transition: border-color .15s, box-shadow .15s; font-size: .94rem;
}
.input::placeholder { color: var(--ink-3); }
.input:hover, .select:hover { border-color: color-mix(in srgb, var(--line-strong) 60%, var(--ink-3)); }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }
.input:focus, .select:focus { outline: none; border-color: var(--maroon); box-shadow: var(--ring); }
.input[readonly] { background: var(--soft); color: var(--ink-2); }
.input.lg { min-height: 52px; font-size: 1rem; }
.input.num { width: 92px; min-height: 36px; padding: 4px 8px; text-align: right; }
.select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238b8d96' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; width: auto; min-width: 150px; cursor: pointer; }
.field .select, .two .select { width: 100%; }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; font-size: .92rem; }
.check input { width: 18px; height: 18px; accent-color: var(--maroon); flex: none; }
.check.day { display: inline-flex; margin: 0 12px 6px 0; }
.fieldset { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; margin: 0; }
.fieldset legend { font-size: .84rem; font-weight: 600; padding: 0 6px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 18px; }
.grow-s { flex: 1 1 220px; max-width: 380px; }
.head-actions .input { width: auto; min-width: 160px; }
.form-error { background: var(--bad-tint); color: var(--bad-ink); padding: 10px 14px; border-radius: var(--r-sm); font-size: .9rem; }
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--tone); border: 0; border-radius: 12px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: .86rem; color: var(--ink-2); cursor: pointer; min-height: 36px; white-space: nowrap; transition: background .15s, color .15s; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(17, 18, 22, .08), 0 0 0 1px var(--line); }

/* ======================================================================
   8. Lists and row cards
   ====================================================================== */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); }
.list.flush { border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); min-width: 0; transition: background .12s; }
.list.flush .list-row { padding-left: 0; padding-right: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row > .grow { display: flex; flex-direction: column; gap: 1px; }
.list-row > .grow small { line-height: 1.4; }
.list-row.attn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot.bad { background: var(--bad) !important; } .dot.warn { background: var(--warn) !important; } .dot.ok { background: var(--ok) !important; }
a.list-row:hover, button.list-row:hover { background: var(--soft); }
.list.flush a.list-row:hover { background: transparent; }
.list.flush a.list-row:hover strong { color: var(--maroon-text); }
.list-row.me { background: var(--maroon-tint); }
.list-row.off { opacity: .55; }
.list-row.tk.done { opacity: .6; }
.list-row.tk.open { box-shadow: inset 3px 0 0 var(--bad); }
.row-card, .train-card { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); border-radius: var(--r); min-height: 72px; transition: border-color .15s, box-shadow .15s; }
.row-card:hover, .train-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.row-card .grow, .train-card .grow { display: flex; flex-direction: column; gap: 2px; }
.row-ic, .tc-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); border: 1px solid var(--line); color: var(--ink-2); flex: none; }
.row-ic.ok { background: var(--ok-tint); border-color: transparent; color: var(--ok-ink); }
.row-ic.bad { background: var(--bad-tint); border-color: transparent; color: var(--bad-ink); }
.tc-ic { background: var(--maroon-tint); border-color: transparent; color: var(--maroon-text); }
.chev { color: var(--ink-3); display: grid; }
.mini-list { margin: 8px 0 14px; padding-left: 20px; color: var(--ink-2); font-size: .9rem; display: flex; flex-direction: column; gap: 3px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.mini-stats div { background: var(--soft); border-radius: var(--r-sm); padding: 10px; text-align: center; }
.mini-stats strong { display: block; font: 700 1.15rem var(--font-head); }
.mini-stats span { font-size: .76rem; color: var(--ink-2); }

/* ======================================================================
   9. Tables
   ====================================================================== */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.card .tbl-wrap { border: 0; border-radius: 0; margin: 0 -6px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th.r { text-align: right; } .tbl th.c { text-align: center; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tbl td.wrap { white-space: normal; min-width: 180px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover td { background: var(--soft); }
.tbl tr.off td { opacity: .5; }
.tbl tfoot td { background: var(--soft); padding: 14px; border-top: 1px solid var(--line); }
.tbl .num { margin-left: auto; display: block; }
.tbl.pay { min-width: 940px; } .tbl.pay .input.num { width: 78px; }
.tbl.pay td:first-child, .tbl.matrix td:first-child { white-space: nowrap; }
.th-sort { border: 0; background: none; font: inherit; font-weight: 600; color: inherit; cursor: pointer; padding: 0; white-space: nowrap; text-transform: inherit; letter-spacing: inherit; }
.th-sort:hover { color: var(--ink); }
.matrix td, .matrix th { text-align: center; } .matrix td:first-child, .matrix th:first-child { text-align: left; }
.cell-btn { border: 0; background: transparent; cursor: pointer; padding: 4px; border-radius: var(--r-xs); min-width: 40px; min-height: 36px; }
.cell-btn:hover { background: var(--soft); }
.cell { display: inline-grid; place-items: center; min-width: 32px; height: 26px; padding: 0 8px; border-radius: 99px; font-size: .76rem; font-weight: 600; }
.cell.ok { background: var(--ok-tint); color: var(--ok-ink); } .cell.warn { background: var(--warn-tint); color: var(--warn-ink); }
.cell.bad { background: var(--bad-tint); color: var(--bad-ink); } .cell.part { background: var(--tone); color: var(--tone-ink); } .cell.none { color: var(--ink-3); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 12px; font-size: .86rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }

/* ======================================================================
   10. Dashboard: KPIs, stats, live feed
   ====================================================================== */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; min-width: 0; }
.kpi strong { font: 700 1.7rem/1.1 var(--font-head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi strong small { font-size: .95rem; color: var(--ink-3); font-weight: 600; }
.kpi span { color: var(--ink-2); font-size: .78rem; font-weight: 500; line-height: 1.3; }
.kpi.warn strong { color: var(--ink); }
.kpi.bad strong { color: var(--bad-ink); }
.kpi.ok strong { color: var(--ok-ink); }
.kpi.warn { box-shadow: inset 0 2px 0 var(--warn), var(--shadow-sm); }
.kpi.bad { box-shadow: inset 0 2px 0 var(--bad), var(--shadow-sm); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .kpi { padding: 14px; } .kpi strong { font-size: 1.45rem; } .two { grid-template-columns: 1fr; } }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 600; color: var(--ok-ink); background: var(--ok-tint); padding: 5px 11px; border-radius: 99px; min-height: 30px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.feed { display: flex; flex-direction: column; }
.feed-row { display: grid; grid-template-columns: 72px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.feed-row:last-child { border-bottom: 0; }
.feed-row time { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.stats3, .stats4 { display: grid; gap: 12px; margin: 4px 0; }
.stats3 { grid-template-columns: repeat(3, 1fr); } .stats4 { grid-template-columns: repeat(4, 1fr); }
.stat { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); border-radius: var(--r); padding: 14px 16px; text-align: left; min-width: 0; }
.stat strong { display: block; font: 700 1.5rem/1.1 var(--font-head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-2); font-size: .8rem; }
@media (max-width: 640px) { .stats4 { grid-template-columns: repeat(2, 1fr); } .stat strong { font-size: 1.3rem; } }

/* ======================================================================
   11. Staff screens: hero, checklists, attendance, quiz, profile
   ====================================================================== */
.hero { position: relative; overflow: hidden; background: linear-gradient(155deg, var(--hero-2), var(--hero) 65%); color: var(--on-hero); border-radius: 20px; padding: 24px; box-shadow: 0 12px 32px rgba(17, 18, 22, .16); }
.hero::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(168, 51, 67, .35), transparent 70%); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: var(--on-hero); font-size: 1.5rem; }
.hero-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hero-sub { color: var(--on-hero-2); margin-top: 4px; font-size: .92rem; }
.hero-status { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); }
.hero-big { font: 700 1.2rem var(--font-head); }
.hero-status .btn { min-width: 150px; }
.two > .card, .two { min-width: 0; }
section.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { section.two { grid-template-columns: 1fr; } }
.stat-line { font-size: .95rem; margin-bottom: 8px; } .stat-line strong { font: 700 1.5rem var(--font-head); }
.next-up { display: flex; flex-direction: column; margin-top: 14px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--soft); border: 1px solid var(--line); }
.next-up:hover { border-color: var(--line-strong); }
.note-line { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; color: var(--ink-2); font-size: .88rem; }
.progress-line { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; font-size: .88rem; color: var(--ink-2); }

.check-item { display: flex; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.check-item.done { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); background: color-mix(in srgb, var(--ok-tint) 45%, var(--surface)); }
.check-item.issue { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); background: color-mix(in srgb, var(--bad-tint) 45%, var(--surface)); }
.ci-mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ok-tint); color: var(--ok-ink); }
.check-item.issue .ci-mark { background: var(--bad-tint); color: var(--bad-ink); }
.ci-text { display: block; margin-bottom: 10px; }
.check-item .note { display: block; color: var(--bad-ink); margin-top: 2px; }
.check-item textarea { margin-top: 10px; }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
.seg button:hover { border-color: var(--ink-3); }
.seg button.on.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.seg button.on.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.photo-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.proof { display: block; max-width: 100%; border-radius: var(--r-sm); margin-top: 14px; border: 1px solid var(--line); }
.proof.sm { width: 96px; height: 96px; object-fit: cover; margin: 0; }
.sticky-cta { position: sticky; bottom: 12px; margin-top: 20px; padding: 12px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.sticky-cta.row { flex-direction: row; }
@media (max-width: 959px) { .app.crew .sticky-cta { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); } }

.punch { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px 20px; }
.clock { font: 700 3rem/1 var(--font-head); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.punch .btn-xl { max-width: 380px; margin: 10px 0 4px; }
.punch-times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 380px; margin-top: 10px; }
.punch-times > div { background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.punch-times strong { font: 700 1.05rem var(--font-head); }
.done-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--ok-tint); color: var(--ok-ink); padding: 12px 20px; border-radius: 14px; font-weight: 600; margin: 10px 0; }

.video { position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: var(--r); overflow: hidden; background: #000; margin-bottom: 16px; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.notes { white-space: pre-wrap; line-height: 1.7; max-width: 66ch; }
.quiz-cta { display: flex; gap: 20px; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; margin-top: 16px; background: var(--soft); }
.quiz-cta .stack-sm { min-width: 220px; }
.q { font-weight: 600; margin-bottom: 12px; font-size: 1rem; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 14px; min-height: 54px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; line-height: 1.4; transition: border-color .15s, background .15s; }
.opt:hover { border-color: var(--maroon); }
.opt.on { border-color: var(--maroon); background: var(--maroon-tint); box-shadow: inset 0 0 0 1px var(--maroon); }
.opt-key { width: 28px; height: 28px; border-radius: 50%; background: var(--tone); color: var(--ink-2); display: grid; place-items: center; font-weight: 600; font-size: .82rem; flex: none; }
.opt.on .opt-key { background: var(--maroon); color: var(--on-maroon); }
.result { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 20px; }
.score { font: 700 4rem/1 var(--font-head); letter-spacing: -.04em; } .score small { font-size: 1.5rem; color: var(--ink-3); }
.result.pass .score { color: var(--ok-ink); } .result.fail .score { color: var(--bad-ink); }
.unlock { display: inline-flex; gap: 8px; align-items: center; margin-top: 12px; padding: 10px 16px; border-radius: var(--r-sm); background: var(--maroon-tint); color: var(--maroon-text); }
.review.ok { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); } .review.bad { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-head .grow { min-width: 170px; }
.profile-head h1 { font-size: 1.4rem; }
.skill-row { display: flex; gap: 14px; align-items: center; }
.skill-row .grow { display: flex; flex-direction: column; gap: 4px; }
.earn-big { font: 700 2.1rem/1.1 var(--font-head); letter-spacing: -.03em; margin: 2px 0 6px; font-variant-numeric: tabular-nums; }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.qa { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); font: inherit; text-align: left; cursor: pointer; color: var(--ink); min-height: 60px; transition: border-color .15s, box-shadow .15s; }
.qa:hover { border-color: var(--line-strong); box-shadow: var(--shadow); } .qa strong { font-size: .88rem; } .qa .row-ic { width: 36px; height: 36px; flex: none; }

/* editors */
.q-edit { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--soft); }
.opt-edit { display: flex; align-items: center; gap: 10px; }
.opt-edit input[type=radio] { width: 18px; height: 18px; accent-color: var(--maroon); flex: none; }

/* ======================================================================
   12. Modal and toast
   ====================================================================== */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(17, 18, 22, .45); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .18s; }
.sheet { background: var(--surface); border-radius: 20px; width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: rise .24s var(--ease); border: 1px solid var(--line); }
.sheet.wide { max-width: 760px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 16px 4px 24px; }
.sheet-head h3 { font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; }
.sheet-body { padding: 12px 24px 24px; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } } @keyframes rise { from { transform: translateY(12px); opacity: 0; } }
@media (max-width: 640px) {
  .overlay { align-items: flex-end; padding: 0; }
  .sheet, .sheet.wide { max-width: none; border-radius: 20px 20px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom, 0px); border-bottom: 0; }
  .sheet-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: var(--line-strong); }
  .sheet { position: relative; }
}
#toast-root { position: fixed; z-index: 200; left: 0; right: 0; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
@media (max-width: 959px) { #toast-root { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); } }
.toast { background: var(--hero); color: var(--on-hero); padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 500; font-size: .9rem; max-width: 440px; animation: rise .22s var(--ease); }
.toast.bad { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; transition: opacity .4s; }

/* ======================================================================
   13. Sign in
   ====================================================================== */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); }
.login-brand { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--hero-2), var(--hero) 70%); color: var(--on-hero); display: flex; align-items: flex-end; padding: 56px; }
.login-brand::after { content: ""; position: absolute; top: -120px; right: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(168, 51, 67, .45), transparent 65%); }
.lb-inner { position: relative; z-index: 1; max-width: 440px; display: flex; flex-direction: column; gap: 18px; }
.lb-inner h2 { color: var(--on-hero); font-size: 2.4rem; line-height: 1.08; font-weight: 700; letter-spacing: -.035em; }
.lb-inner p { color: var(--on-hero-2); font-size: 1.05rem; line-height: 1.6; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px max(20px, env(safe-area-inset-left, 0px)); }
.lf-inner { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.lf-inner h1 { font-size: 1.75rem; }
.lf-logo { display: none; align-items: center; gap: 12px; font-family: var(--font-head); font-size: 1.05rem; margin-bottom: 18px; }
.demo-box { margin-top: 12px; padding: 16px; border-radius: var(--r); background: var(--soft); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 859px) { .login { grid-template-columns: 1fr; } .login-brand { display: none; } .lf-logo { display: flex; } .login-form { align-items: flex-start; padding-top: max(48px, env(safe-area-inset-top, 0px)); } }
.boot { min-height: 100vh; display: grid; place-items: center; padding: 20px; }

/* ======================================================================
   14. Print: salary slip, certificate, QR poster
   ====================================================================== */
.print-sheet { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 22px; background: var(--surface); }
.slip-head { display: flex; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--maroon); padding-bottom: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.slip-who { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.slip-who div { display: flex; flex-direction: column; }
.slip-tbl td { padding: 8px 4px; } .slip-tbl tr.strong td { font-weight: 700; background: var(--soft); }
.qr-sheet { text-align: center; padding: 20px; }
.qr-box { width: 260px; max-width: 100%; margin: 12px auto; background: #fff; padding: 8px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.qr-box svg { width: 100%; height: auto; display: block; }
.qr-code { font-family: var(--font-head); font-size: 2rem; letter-spacing: .3em; font-weight: 700; color: var(--maroon); margin: 4px 0; }
.cert { text-align: center; }
.cert-in { border: 1px solid var(--maroon); outline: 4px solid var(--maroon-tint); outline-offset: -10px; border-radius: 12px; padding: 32px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: #fff; color: #18191d; }
.cert h2 { font-family: var(--font-head); font-size: 1.6rem; margin: 6px 0; color: var(--maroon); }
.cert-top { letter-spacing: .22em; text-transform: uppercase; font-weight: 600; font-size: .8rem; margin: 4px 0 0; color: #565861; }
.cert-name { font-family: var(--font-head); font-size: 2rem; font-weight: 700; margin: 2px 0; letter-spacing: -.02em; }
.cert-skill { font-size: 1.3rem; font-weight: 600; color: var(--maroon); margin: 2px 0 10px; }
.cert-meta { display: flex; gap: 28px; flex-wrap: wrap; justify-content: center; margin-top: 8px; } .cert-meta div { display: flex; flex-direction: column; }
@media print {
  .print-page .side, .print-page .topbar, .print-page .bnav, .print-page .page-head .head-actions, .print-page .filters, .print-page .tabs, .print-page .no-print { display: none !important; }
  .print-page .main { margin: 0 !important; } .print-page .content { max-width: none; padding: 0; }
  .print-page .tbl-wrap { overflow: visible; } .print-page .tbl { font-size: 11px; min-width: 0; }
  body:not(.print-page) * { visibility: hidden; }
  body:not(.print-page) .print-sheet, body:not(.print-page) .print-sheet * { visibility: visible; }
  .print-sheet { position: absolute; inset: 0 auto auto 0; width: 100%; border: 0; color: #000; }
  .print-sheet .muted { color: #444; }
}

/* ======================================================================
   15. Feature screens: roster, stock, notices, charts, growth
   ====================================================================== */
.tbl.roster { min-width: 860px; } .tbl.roster td, .tbl.roster th { padding: 8px 8px; } .tbl.roster th.today, .tbl.roster td.today { background: var(--maroon-tint); }
.flip { display: inline-flex; transform: rotate(180deg); }
.select.cell { min-height: 34px; padding: 4px 26px 4px 10px; background-position: right 9px center; font-size: .8rem; min-width: 104px; }
.select.cell.set { border-color: var(--line-strong); } .select.cell.off { background-color: var(--tone); color: var(--tone-ink); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wk { background: var(--soft); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 4px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.wk small { color: var(--ink-3); font-size: .68rem; } .wk strong { font-size: .76rem; }
.wk.today { border-color: var(--maroon); background: var(--maroon-tint); } .wk.off { background: var(--tone); color: var(--tone-ink); }
.stock-row .input.num { width: 84px; } .stock-row .unit { min-width: 28px; } .neg { color: var(--bad-ink); }
.notice .grow { display: flex; flex-direction: column; } .stock-spacer { height: 96px; }
.notice.pin { box-shadow: inset 3px 0 0 var(--maroon), var(--shadow-sm); }
.notice.urgent { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); box-shadow: inset 3px 0 0 var(--bad), var(--shadow-sm); }
.notice p { margin: 8px 0 0; color: var(--ink-2); white-space: pre-wrap; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; align-items: center; gap: 10px; padding: 6px 0; font-size: .88rem; } .hbar .bar { height: 8px; }
.chart { width: 100%; height: auto; display: block; } .chart .grid { stroke: var(--line); stroke-width: 1; } .chart .axis { fill: var(--ink-3); font-size: 11px; } .chart .val { fill: var(--ink); font-size: 11px; font-weight: 600; }
.chart rect { fill: var(--maroon); } .chart rect:hover { opacity: .85; }
.offline-bar { display: flex; gap: 8px; align-items: center; background: var(--warn-tint); color: var(--warn-ink); padding: 10px 16px; font-size: .86rem; font-weight: 500; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge-tile { display: flex; flex-direction: column; gap: 3px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.badge-tile small { color: var(--ink-3); font-size: .74rem; line-height: 1.35; }
.badge-tile strong { font-size: .86rem; }
.badge-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); color: var(--ink-3); margin-bottom: 6px; }
.badge-tile:not(.on) { color: var(--ink-3); }
.badge-tile:not(.on) strong { color: var(--ink-2); }
.badge-tile.on { border-color: var(--maroon-line); }
.badge-tile.on .badge-ic { background: var(--maroon); border-color: transparent; color: #fff; }
.eom-star { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--maroon); color: #fff; flex: none; }

/* equipment alerts and maintenance calendar */
.eq-alert { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--bad) 20%, var(--line)); background: var(--bad-tint); color: var(--bad-ink); padding: 10px 16px; cursor: pointer; font: inherit; font-size: .9rem; }
.eq-alert strong { font-weight: 600; }
.eq-alert.urgent { background: color-mix(in srgb, var(--bad-tint) 70%, var(--bad) 8%); }
.eq-alert .grow { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.eq-alert small { opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eq-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex: none; animation: eqp 1.6s ease-out infinite; }
@keyframes eqp { 0% { box-shadow: 0 0 0 0 rgba(180, 35, 24, .5); } 100% { box-shadow: 0 0 0 10px rgba(180, 35, 24, 0); } }
.tk-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.tk-upd { display: block; color: var(--ink-3); border-left: 2px solid var(--line); padding-left: 8px; margin-top: 4px; }
.eq-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.eq-cal > b { font-size: 11px; font-weight: 600; color: var(--ink-3); text-align: center; text-transform: uppercase; letter-spacing: .06em; }
.eq-day { min-height: 78px; border: 1px solid var(--line); border-radius: var(--r-xs); padding: 6px; display: flex; flex-direction: column; gap: 3px; background: var(--surface); overflow: hidden; }
.eq-day.today { border-color: var(--maroon); box-shadow: inset 0 0 0 1px var(--maroon); }
.eq-day small { color: var(--ink-3); font-size: 11px; }
.eq-chip { font-size: 10.5px; line-height: 1.25; background: var(--tone); color: var(--tone-ink); border-radius: 5px; padding: 2px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq-chip.od { background: var(--bad-tint); color: var(--bad-ink); }
@media (max-width: 640px) { .eq-day { min-height: 60px; } .eq-chip { font-size: 9.5px; } }

/* ======================================================================
   16. Round 7: directory and suggestion box
   ====================================================================== */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { min-height: 34px; padding: 5px 13px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font: inherit; font-size: .84rem; font-weight: 500; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.chip-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.chip-btn.on { background: var(--hero); border-color: var(--hero); color: #fff; }
.dir-filters { align-items: flex-start; }
.dir-row .code { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--soft); border: 1px solid var(--line); font: 500 .72rem/1.6 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--ink-2); vertical-align: 1px; }
.dir-row .grow { min-width: 0; }
.dir-row .grow strong, .dir-row .grow small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-acts { display: flex; gap: 6px; flex: none; align-items: center; }
.dir-btn { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-2); }
.dir-btn:hover { border-color: var(--maroon); color: var(--maroon-text); background: var(--maroon-tint); }
.dir-btn.wa:hover { border-color: var(--ok); color: var(--ok-ink); background: var(--ok-tint); }
@media (max-width: 520px) { .dir-row { flex-wrap: wrap; } .dir-row .grow { flex: 1 1 calc(100% - 60px); } .dir-row > .chip { margin-left: 48px; } .dir-acts { margin-left: auto; } }
.sg-note { background: var(--soft); border: 1px solid var(--line); color: var(--ink-2); border-radius: var(--r-sm); padding: 12px 14px; align-items: flex-start; }
.sg-note .row-ic { flex: none; width: 34px; height: 34px; background: var(--surface); }
.sg-thanks .row-ic { background: var(--ok-tint); color: var(--ok-ink); border-color: transparent; }
.sg-text, .sg-said, .sg-did { margin: 12px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sg-said .muted, .sg-did .muted { text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; font-weight: 600; margin-bottom: 2px; }
.sg-did { padding: 12px 14px; border-left: 2px solid var(--maroon); background: var(--soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.sg-item.is-new { box-shadow: inset 3px 0 0 var(--maroon), var(--shadow-sm); }
.sg-item .row.end { margin-top: 14px; }

/* ======================================================================
   17. Round 8: mini games
   ====================================================================== */
.game-card { display: flex; flex-direction: column; justify-content: space-between; }
.game-card .row-ic { flex: none; background: var(--maroon-tint); border-color: transparent; color: var(--maroon-text); }
.game-play { padding: 22px; }
.g-timer { height: 6px; border-radius: 99px; background: var(--tone); overflow: hidden; }
.g-timer i { display: block; height: 100%; width: 100%; background: var(--maroon); border-radius: 99px; animation-name: gshrink; animation-timing-function: linear; animation-fill-mode: forwards; }
.g-timer.still i { animation: none; }
@keyframes gshrink { from { width: 100%; } to { width: 0; } }
.g-left { min-width: 44px; text-align: right; font: 600 .95rem var(--font-head); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.gq-q { font-size: 1.2rem; font-weight: 700; margin: 20px 0 16px; line-height: 1.4; letter-spacing: -.015em; }
.gq-opt { display: block; width: 100%; min-height: 52px; padding: 13px 16px; text-align: left; font: inherit; font-weight: 500; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.gq-opt:hover:not([disabled]) { border-color: var(--maroon); background: var(--maroon-tint); }
.gq-opt[disabled] { cursor: default; }
.gq-opt.right { background: var(--ok-tint); border-color: var(--ok); color: var(--ok-ink); font-weight: 600; }
.gq-opt.wrong { background: var(--bad-tint); border-color: var(--bad); color: var(--bad-ink); font-weight: 600; }
.gq-opt.dim { opacity: .5; }
.gq-fb { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-sm); }
.gq-fb.ok { background: var(--ok-tint); color: var(--ok-ink); } .gq-fb.bad { background: var(--bad-tint); color: var(--bad-ink); }
.game-result { text-align: center; padding: 32px 22px; }
.g-big { display: block; font: 700 2.1rem/1.1 var(--font-head); letter-spacing: -.03em; margin: 4px 0 6px; }
.gt-order { margin: 16px 0 14px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--hero); color: #fff; font: 600 1.02rem var(--font-head); }
.gt-order small { display: block; color: var(--on-hero-2); font: 500 .7rem var(--font); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 2px; }
.gt-order .muted { color: var(--on-hero-2); }
.gt-need { display: inline-flex; align-items: center; gap: 4px; }
.gt-need.got { opacity: .55; text-decoration: line-through; }
.gt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gt-tile { min-height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: .86rem; line-height: 1.25; text-align: center; cursor: pointer; touch-action: manipulation; user-select: none; transition: border-color .12s, background .12s, transform .08s; }
.gt-tile:hover { border-color: var(--ink-3); }
.gt-tile:active { transform: scale(.97); }
.gt-tile img { width: 40px; height: 40px; object-fit: cover; border-radius: 10px; }
.gt-tile.got { border-color: var(--ok); background: var(--ok-tint); color: var(--ok-ink); }
.gt-tile.flash { border-color: var(--bad); background: var(--bad-tint); color: var(--bad-ink); animation: gflash .35s ease-out 1; }
@keyframes gflash { 0% { transform: translateX(-3px); } 50% { transform: translateX(3px); } 100% { transform: none; } }
.kdot { display: block; width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid currentColor; position: relative; }
.kdot::after { content: ""; position: absolute; inset: 2.5px; border-radius: 50%; background: currentColor; }
.k-veg .kdot { color: #1d7a4b; } .k-non-veg .kdot { color: #8a3b12; } .k-side .kdot, .k-drink .kdot, .k-dessert .kdot { color: var(--ink-3); }
.gc-img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--soft); border: 1px solid var(--line); color: var(--ink-3); }
.gc-img.sm { width: 28px; height: 28px; border-radius: 8px; }

/* ======================================================================
   18. Round 9: spin the wheel and points dashboard
   ====================================================================== */
:root { --wh-a: #7a1f2b; --wh-b: #ffffff; --wh-c: #2a2b31; --wh-ink: #18191d; --wh-line: #ffffff; --wh-rim: #18191d; --wh-dot: #ffffff; }
.spin-cols { align-items: start; }
.spin-card { display: flex; flex-direction: column; gap: 4px; }
.wheel { position: relative; max-width: 340px; width: 100%; margin: 12px auto 18px; filter: drop-shadow(0 14px 28px rgba(17, 18, 22, .14)); }
.wheel.sm { max-width: 260px; }
.wheel svg { display: block; width: 100%; height: auto; }
.wheel-g { transform-origin: 0 0; }
.wheel-g.spinning { animation-name: wspin; animation-timing-function: cubic-bezier(.12, .72, .14, 1); animation-fill-mode: forwards; }
@keyframes wspin { from { transform: rotate(var(--from)); } to { transform: rotate(var(--to)); } }
.wheel text { pointer-events: none; font-family: var(--font-head); }
.spin-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.spin-stats > div { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.spin-stats > div + div { border-left: 1px solid var(--line); }
.spin-stats strong { font: 700 1.3rem/1.15 var(--font-head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spin-stats span { color: var(--ink-2); font-size: .74rem; line-height: 1.3; }
.spin-stats .ok strong { color: var(--ok-ink); }
.spin-stats .bad strong { color: var(--bad-ink); }
.spin-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spin-btns small { display: block; min-height: 1.3em; margin-top: 6px; text-align: center; font-size: .76rem; }
@media (max-width: 420px) { .spin-btns { grid-template-columns: 1fr; } .spin-btns small:empty { display: none; } }
.spin-result { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0 6px; }
.spin-result img { width: 120px; height: 120px; border-radius: 24px; object-fit: cover; box-shadow: 0 0 0 1px var(--line), 0 12px 28px rgba(17, 18, 22, .14); }
.spin-ic { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: var(--maroon-tint); color: var(--maroon-text); }
.spin-result h2 { margin: 10px 0 0; font-size: 1.3rem; }
.spin-result .btn { margin-top: 12px; min-width: 140px; }
.spin-link { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.spin-link .row-ic { background: var(--maroon-tint); border-color: transparent; color: var(--maroon-text); }
.note-box { background: var(--soft); border: 1px solid var(--line); color: var(--ink-2); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 18px; font-size: .86rem; }
.wheel-admin { align-items: start; }
.prize-row { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.prize-pic { width: 64px; height: 64px; flex: none; border-radius: 14px; border: 1px dashed var(--line-strong); background: var(--soft); display: grid; place-items: center; cursor: pointer; overflow: hidden; color: var(--ink-3); transition: border-color .15s; }
.prize-pic:hover { border-color: var(--maroon); color: var(--maroon-text); }
.prize-pic img { width: 100%; height: 100%; object-fit: cover; }
.prize-acts { display: flex; flex-direction: column; }
.prize-acts .icon-btn:first-child svg { transform: rotate(-90deg); }
.prize-acts .icon-btn.flip { transform: none; }
.prize-acts .icon-btn.flip svg { transform: rotate(90deg); }
.mini { display: flex; flex-direction: column; font-size: .72rem; font-weight: 500; color: var(--ink-3); gap: 3px; }
.mini .input { width: 96px; padding: 6px 10px; min-height: 36px; font-size: .88rem; }
.wheel-preview { position: sticky; top: 16px; align-self: start; text-align: center; }
@media (max-width: 640px) { .prize-row { flex-wrap: wrap; } .prize-acts { flex-direction: row; width: 100%; justify-content: flex-end; } .wheel-preview { position: static; } }
:root[data-theme="dark"] { --wh-b: #f3f3f5; --wh-c: #34363c; --wh-rim: #0d0e10; }

/* ======================================================================
   19. Work / Training switch and Training Mode (game look)
   Work Mode keeps the clean white app. Training Mode turns into a dark game hub: 3D cards that tilt and press,
   a glossy XP bar, a spinning coin, Chef Bun the guide and short animations. Brand colours only (maroon, white, dark grey).
   ====================================================================== */
.mode-switch { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; align-items: center; min-height: 38px; min-width: 188px; padding: 3px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--soft); color: var(--ink-2); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; flex: none; }
.mode-switch span { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 10px; min-height: 30px; transition: color .25s; white-space: nowrap; }
.mode-switch .ms-knob { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 99px; background: var(--surface); box-shadow: 0 1px 2px rgba(17, 18, 22, .12), 0 0 0 1px var(--line); transition: transform .2s ease, background .2s; }
.mode-switch:not(.on) .ms-l { color: var(--ink); }
.mode-switch.on { background: var(--hero); border-color: var(--hero); color: #9a9ca6; }
.mode-switch.on .ms-knob { transform: translateX(100%); background: var(--maroon); box-shadow: none; }
.mode-switch.on .ms-r { color: #fff; }
.topbar .mode-switch { min-width: 0; font-size: .74rem; min-height: 36px; }
.topbar .mode-switch span { padding: 0 8px; min-height: 28px; }
.mode-card .mode-switch { min-width: 188px; }
@media (max-width: 420px) { .topbar .lang-btn { padding-inline: 10px; } .topbar .mode-switch .ic { display: none; } }

/* ---------- Training Mode theme: always a dark game hub ---------- */
:root[data-mode="training"] {
  --bg: #0d0e12; --surface: #17181e; --soft: #1e1f27; --tone: #262832; --tone-ink: #d9dae2;
  --line: rgba(255, 255, 255, .07); --line-strong: rgba(255, 255, 255, .13); --ink: #f6f6f8; --ink-2: #b3b5c0; --ink-3: #7c7f8b;
  --hero: #1d1e26; --hero-2: #2a2c37; --on-hero: #fff; --on-hero-2: #b3b5c0;
  --maroon: #c0344a; --maroon-hover: #d1405a; --maroon-2: #e05a72; --maroon-tint: rgba(192, 52, 74, .16); --maroon-line: rgba(192, 52, 74, .4); --maroon-text: #ff8fa1;
  --ok: #3ccf86; --ok-tint: rgba(60, 207, 134, .14); --ok-ink: #7fe5b0;
  --warn: #f0a63b; --warn-tint: rgba(240, 166, 59, .14); --warn-ink: #f6c47e;
  --bad: #ff5d5d; --bad-tint: rgba(255, 93, 93, .14); --bad-ink: #ff9a9a;
  --shadow-sm: 0 2px 0 rgba(0, 0, 0, .35); --shadow: 0 4px 0 rgba(0, 0, 0, .35), 0 14px 30px rgba(0, 0, 0, .35);
  --depth: #07080b; --glow: 0 0 0 1px rgba(192, 52, 74, .35), 0 0 26px rgba(192, 52, 74, .25);
  color-scheme: dark;
}
[data-mode="training"] body { background:
  radial-gradient(60vw 50vh at 85% -10%, rgba(192, 52, 74, .22), transparent 70%),
  radial-gradient(50vw 40vh at -10% 110%, rgba(192, 52, 74, .12), transparent 70%), var(--bg); background-attachment: fixed; }
[data-mode="training"] body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 34px 34px; mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); animation: grid-drift 24s linear infinite; }
@keyframes grid-drift { to { background-position: 0 34px, 34px 0; } }
[data-mode="training"] body::before { background: var(--bg); }
[data-mode="training"] .side { background: rgba(16, 17, 22, .92); border-right-color: var(--line); backdrop-filter: blur(12px); }
[data-mode="training"] .side-brand strong { color: #fff; }
[data-mode="training"] .nav-item:hover { background: rgba(255, 255, 255, .05); }
[data-mode="training"] .nav-item.on { background: linear-gradient(90deg, rgba(192, 52, 74, .28), rgba(192, 52, 74, .08)); color: #fff; box-shadow: inset 2px 0 0 var(--maroon); }
[data-mode="training"] .nav-item.on .ic { color: var(--maroon-text); }
[data-mode="training"] .topbar { background: rgba(13, 14, 18, .8); border-bottom-color: var(--line); }
[data-mode="training"] .bnav { background: rgba(16, 17, 22, .92); border-top-color: var(--line); }
[data-mode="training"] .bnav .nav-item.on { color: #fff; background: none; box-shadow: none; }
[data-mode="training"] .bnav .nav-item.on::before { width: 34px; height: 34px; top: 6px; margin-left: -17px; border-radius: 12px; background: linear-gradient(180deg, #d1405a, #9b2a39); box-shadow: 0 3px 0 #5d1822, 0 0 18px rgba(209, 64, 90, .5); z-index: -1; }
[data-mode="training"] .bnav .nav-item { position: relative; z-index: 0; }
[data-mode="training"] .bnav .nav-item.on .ic { animation: nav-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes nav-pop { 0% { transform: scale(.6) translateY(3px); } 100% { transform: none; } }
[data-mode="training"] .card, [data-mode="training"] .kpi, [data-mode="training"] .stat, [data-mode="training"] .list, [data-mode="training"] .tbl-wrap { border-radius: 18px; background: linear-gradient(180deg, #1b1c23, #16171d); border-color: var(--line); box-shadow: 0 4px 0 var(--depth), 0 12px 28px rgba(0, 0, 0, .25); }
[data-mode="training"] .list.flush { background: transparent; box-shadow: none; }
[data-mode="training"] .btn { border-radius: 12px; }
[data-mode="training"] .btn-primary { background: linear-gradient(180deg, #d1405a, #a52e42); box-shadow: 0 4px 0 #5d1822, 0 8px 18px rgba(192, 52, 74, .3); transform: translateY(0); transition: transform .08s, box-shadow .08s, filter .15s; }
[data-mode="training"] .btn-primary:hover { filter: brightness(1.08); background: linear-gradient(180deg, #d1405a, #a52e42); }
[data-mode="training"] .btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #5d1822, 0 4px 10px rgba(192, 52, 74, .25); }
[data-mode="training"] .btn-ghost { background: rgba(255, 255, 255, .04); border-color: var(--line-strong); color: #fff; box-shadow: 0 3px 0 var(--depth); }
[data-mode="training"] .btn-ghost:hover { background: rgba(255, 255, 255, .08); }
[data-mode="training"] .btn-ghost:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--depth); }
[data-mode="training"] .btn:disabled { background: #22232b; color: #6c6f7a; box-shadow: 0 3px 0 var(--depth); }
[data-mode="training"] .tabs { background: #121318; box-shadow: inset 0 0 0 1px var(--line); }
[data-mode="training"] .tabs button.on { background: linear-gradient(180deg, #2b2d38, #22232c); color: #fff; box-shadow: 0 2px 0 var(--depth), 0 0 0 1px var(--line-strong); }
[data-mode="training"] .input, [data-mode="training"] .select { background: #121318; }
[data-mode="training"] .eq-alert { background: rgba(255, 93, 93, .12); color: #ffb3b3; border-bottom-color: rgba(255, 93, 93, .25); }
[data-mode="training"] .bar { background: rgba(255, 255, 255, .08); }
[data-mode="training"] .bar i { background: linear-gradient(90deg, #a52e42, #ff6b85); box-shadow: 0 0 12px rgba(255, 107, 133, .5); }
[data-mode="training"] .overlay { background: rgba(5, 6, 9, .7); }
[data-mode="training"] .sheet { background: linear-gradient(180deg, #1d1e26, #17181e); border-color: var(--line-strong); box-shadow: 0 6px 0 var(--depth), 0 30px 80px rgba(0, 0, 0, .6); }
[data-mode="training"] .page-head h1 { background: linear-gradient(180deg, #fff, #c9cad3); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-mode="training"] .avatar { background: #2a2c37; color: #fff; }
[data-mode="training"] .chip.maroon { background: rgba(192, 52, 74, .2); color: #ff9eae; }
[data-mode="training"] .list-row.me { background: linear-gradient(90deg, rgba(192, 52, 74, .22), transparent); }
[data-mode="training"] .wheel { filter: drop-shadow(0 0 30px rgba(192, 52, 74, .3)) drop-shadow(0 18px 30px rgba(0, 0, 0, .5)); }
[data-mode="training"] .tbl th { background: transparent; }
[data-mode="training"] .tbl tbody tr:hover td { background: rgba(255, 255, 255, .03); }
[data-mode="training"] .empty { background: rgba(255, 255, 255, .02); }

/* 3D tilt (mouse) and pop-in */
[data-mode="training"] [data-tilt] { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease-out, box-shadow .25s; transform-style: preserve-3d; will-change: transform; }
[data-mode="training"] [data-tilt].tilting { transition: transform .06s linear; }
[data-mode="training"] .stack-lg > *, [data-mode="training"] .content > .card, [data-mode="training"] .content > section { animation: rise-in .5s cubic-bezier(.2, .8, .2, 1) both; }
[data-mode="training"] .stack-lg > *:nth-child(2) { animation-delay: .05s; } [data-mode="training"] .stack-lg > *:nth-child(3) { animation-delay: .1s; } [data-mode="training"] .stack-lg > *:nth-child(4) { animation-delay: .15s; } [data-mode="training"] .stack-lg > *:nth-child(5) { animation-delay: .2s; }
@keyframes rise-in { from { transform: translateY(10px); } }

/* ---------- tip line ---------- */
.tip { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 16px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); color: var(--ink); font-size: .92rem; font-weight: 500; }
.tip-ic { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--maroon-tint); color: var(--maroon-text); }
.scen-q { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0 6px; }
.scen-q .gq-q { margin: 2px 0 12px; }
.scen-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--maroon-tint); color: var(--maroon-text); }

/* mode intro: a game icon and a quick fade */
.mode-intro { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(13, 14, 18, .82); animation: mi-in .15s ease-out both; pointer-events: none; }
.mode-intro.out { animation: mi-out .25s ease-in both; }
.mi-card { display: flex; flex-direction: column; align-items: center; gap: 12px; color: #fff; animation: mi-pop .25s ease-out both; }
.mi-card strong { font: 700 1.3rem var(--font-head); letter-spacing: -.02em; }
.mi-ic { width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; background: var(--maroon, #7a1f2b); color: #fff; }
@keyframes mi-in { from { opacity: 0; } } @keyframes mi-out { to { opacity: 0; } }
@keyframes mi-pop { from { opacity: 0; transform: scale(.92); } }

/* sparkle burst */
.burst { position: fixed; z-index: 400; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 2px; background: #ff6b85; transform: rotate(45deg); animation: burst-fly .9s cubic-bezier(.15, .7, .3, 1) forwards; }
.burst i:nth-child(3n) { background: #fff; width: 7px; height: 7px; border-radius: 50%; }
.burst i:nth-child(4n) { background: #c0344a; }
@keyframes burst-fly { 0% { transform: translate(0, 0) rotate(45deg) scale(.4); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(225deg) scale(1); opacity: 0; } }

/* coin */
.coin-amt { display: inline-flex; align-items: center; gap: 6px; font: 700 1rem var(--font-head); font-variant-numeric: tabular-nums; }
.coin-amt.lg { font-size: 1.15rem; }
.coin3d { position: relative; display: inline-block; width: 18px; height: 18px; flex: none; transform-style: preserve-3d; animation: coin-spin 3.2s linear infinite; }
.coin3d::before, .coin3d::after, .coin3d b { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.coin3d::before { background: radial-gradient(circle at 35% 30%, #ff9aab, #c0344a 55%, #7a1f2b); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); transform: translateZ(1.5px); }
.coin3d::after { background: radial-gradient(circle at 35% 30%, #ff9aab, #c0344a 55%, #7a1f2b); transform: rotateY(180deg) translateZ(1.5px); }
.coin3d b { background: #5d1822; transform: rotateY(90deg); border-radius: 2px; inset: 0 7.5px; }
.coin3d.xl { width: 64px; height: 64px; }
.coin3d.xl b { inset: 0 28px; }
@keyframes coin-spin { to { transform: rotateY(360deg); } }

/* ---------- player card ---------- */
.player { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "guide guide" "main ring" "stats stats"; gap: 6px 16px; align-items: center; padding: 18px 20px 16px; border-radius: 24px; color: #fff; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 0%, rgba(192, 52, 74, .45), transparent 55%), linear-gradient(160deg, #2a2c37, #17181e 70%); border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 6px 0 var(--depth, #07080b), 0 20px 40px rgba(0, 0, 0, .45), var(--glow, none); }
.player::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .07) 45%, transparent 60%); transform: translateX(-100%); animation: sheen 5s ease-in-out infinite 1s; pointer-events: none; }
@keyframes sheen { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.player > * { position: relative; z-index: 1; }
.pl-guide { grid-area: guide; position: relative; display: flex; align-items: center; gap: 12px; }
.pl-bubble { position: relative; flex: 0 1 auto; max-width: 420px; background: #fff; color: #18191d; font-size: .78rem; font-weight: 600; line-height: 1.35; padding: 8px 11px; border-radius: 14px 14px 14px 4px; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); animation: bubble-in .5s cubic-bezier(.3, 1.5, .5, 1) both .3s; z-index: 3; }
.pl-main { grid-area: main; min-width: 0; padding-top: 4px; }
.pl-main h1 { color: #fff; font-size: 1.45rem; margin: 2px 0 10px; background: none; -webkit-text-fill-color: #fff; }
.pl-ring { grid-area: ring; align-self: center; }
.pl-stats { grid-area: stats; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.pl-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 3px 0 rgba(0, 0, 0, .3); color: #fff; transition: transform .1s, background .15s; }
a.pl-stat:hover { background: rgba(255, 255, 255, .1); }
a.pl-stat:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.pl-stat b { display: inline-flex; align-items: center; gap: 4px; font: 700 1.1rem var(--font-head); }
.pl-stat small { color: #b3b5c0; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.pl-stat .flame { color: #ff8a5c; } .pl-stat .flame .ic { animation: flicker 1.2s ease-in-out infinite; }
@keyframes flicker { 50% { transform: scale(1.12) rotate(-4deg); } }
@media (max-width: 560px) {
  .player { grid-template-columns: 1fr auto; grid-template-areas: "guide guide" "main ring" "stats stats"; padding: 16px; }
  .pl-guide { align-items: center; gap: 10px; }
  .pl-bubble { flex: 1; }
  .pl-main h1 { font-size: 1.3rem; }
}
.tm-kicker { display: block; text-transform: uppercase; letter-spacing: .12em; font-size: .66rem; font-weight: 700; color: var(--maroon-text); }
.player .tm-kicker { color: #ff9eae; }
.xp small { display: block; margin-top: 8px; font-size: .76rem; color: #c9cad3; }
.xp-bar { position: relative; height: 12px; border-radius: 99px; background: rgba(0, 0, 0, .35); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .4), 0 1px 0 rgba(255, 255, 255, .06); overflow: hidden; }
.xp-bar i { position: relative; display: block; height: 100%; border-radius: 99px; background: linear-gradient(180deg, #ff8fa1, #c0344a 55%, #8f2335); box-shadow: 0 0 14px rgba(255, 107, 133, .6); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.xp-bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); transform: translateX(-100%); animation: xp-shine 2.4s ease-in-out infinite; }
@keyframes xp-shine { to { transform: translateX(100%); } }
.xp-bar.wide { height: 10px; background: var(--tone); }
.lvl-ring { width: 68px; height: 68px; flex: none; filter: drop-shadow(0 0 10px rgba(255, 107, 133, .45)); }
.lvl-ring .lr-bg { fill: rgba(0, 0, 0, .25); stroke: rgba(255, 255, 255, .12); stroke-width: 5; }
.lvl-ring .lr-fg { fill: none; stroke: #ff6b85; stroke-width: 5; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 32px 32px; transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1); }
.lvl-ring text { fill: #fff; font: 700 20px var(--font-head); }

/* ---------- missions ---------- */
.m-count { font: 600 .9rem var(--font-head); color: var(--ink-2); } .m-count b { color: var(--ink); font-size: 1.1rem; }
.m-progress { margin-bottom: 12px; }
.mission-grid { display: grid; gap: 10px; }
@media (min-width: 760px) { .mission-grid { grid-template-columns: 1fr 1fr; } }
.mission { position: relative; display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; font: inherit; color: var(--ink); padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; min-height: 72px; transition: border-color .15s, box-shadow .15s, transform .1s; }
.mission:hover { border-color: var(--line-strong); }
.mission:active { transform: translateY(2px); }
.mission .grow { display: flex; flex-direction: column; gap: 2px; }
.mission strong { font-weight: 600; font-size: .94rem; }
.mission .m-ic { width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center; background: var(--maroon-tint); color: var(--maroon-text); }
.mission .m-tick { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; }
.mission .m-pts { color: var(--maroon-text); font-weight: 600; font-size: .74rem; margin-top: 2px; }
.mission.done .m-ic { background: var(--ok-tint); color: var(--ok-ink); }
.mission.done strong { color: var(--ink-2); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ok) 60%, transparent); }
.mission.done .m-tick { background: var(--ok); border-color: var(--ok); color: #fff; animation: tick-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.mission.done .m-pts { color: var(--ok-ink); }
.mission.missed .m-tick { background: var(--bad-tint); color: var(--bad-ink); border-color: transparent; }
@keyframes tick-pop { from { transform: scale(.3); } }
[data-mode="training"] .mission { background: linear-gradient(180deg, #1d1e26, #17181e); box-shadow: 0 4px 0 var(--depth); animation: card-in .5s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: calc(var(--i, 0) * 70ms + .1s); }
[data-mode="training"] .mission:hover { box-shadow: 0 4px 0 var(--depth), 0 0 0 1px var(--maroon-line); transform: translateY(-2px); }
[data-mode="training"] .mission:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--depth); }
[data-mode="training"] .mission .m-ic { background: linear-gradient(180deg, #d1405a, #9b2a39); color: #fff; box-shadow: 0 3px 0 #5d1822; }
[data-mode="training"] .mission.done .m-ic { background: linear-gradient(180deg, #3ccf86, #22995c); box-shadow: 0 3px 0 #135c37; }
@keyframes card-in { from { transform: translateY(12px) scale(.98); } }

/* hub tiles, hub tabs */
.hub-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); min-height: 128px; transition: border-color .15s, transform .1s; }
.tile:hover { border-color: var(--line-strong); }
.tile strong { font: 700 1.02rem var(--font-head); letter-spacing: -.01em; margin-top: 2px; }
.tile-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--maroon-tint); color: var(--maroon-text); margin-bottom: 8px; }
[data-mode="training"] .tile { background: linear-gradient(180deg, #1f2029, #17181e); box-shadow: 0 5px 0 var(--depth), 0 14px 26px rgba(0, 0, 0, .25); }
[data-mode="training"] .tile:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--depth); }
[data-mode="training"] .tile-ic { background: linear-gradient(180deg, #2f313d, #23252e); color: #ff9eae; box-shadow: 0 3px 0 var(--depth), inset 0 1px 0 rgba(255, 255, 255, .08); }
.hub-tabs { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.hub-tabs::-webkit-scrollbar { display: none; }
.hub-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 12px; font-weight: 600; font-size: .86rem; color: var(--ink-2); background: var(--soft); border: 1px solid var(--line); white-space: nowrap; min-height: 40px; transition: background .15s, color .15s, transform .1s; }
.hub-tabs a:hover { color: var(--ink); }
.hub-tabs a.on { color: #fff; background: linear-gradient(180deg, #d1405a, #9b2a39); border-color: transparent; box-shadow: 0 3px 0 #5d1822, 0 0 16px rgba(209, 64, 90, .35); }
.hub-tabs a:active { transform: translateY(2px); }

/* badges strip */
.badge-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.badge-strip .bs { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--soft); color: var(--ink-3); border: 1px solid var(--line); transform: rotate(45deg); }
.badge-strip .bs .ic { transform: rotate(-45deg); }
.badge-strip .bs.on { background: linear-gradient(135deg, #d1405a, #7a1f2b); color: #fff; border-color: transparent; box-shadow: 0 4px 0 #5d1822, 0 0 16px rgba(209, 64, 90, .35); animation: badge-in .5s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes badge-in { from { transform: rotate(45deg) scale(.6); } to { transform: rotate(45deg); } }
.badge-tile.on { border-color: var(--maroon-line); }
.badge-tile.on .badge-ic { background: var(--maroon); border-color: transparent; color: #fff; }
[data-mode="training"] .badge-tile { background: linear-gradient(180deg, #1d1e26, #17181e); box-shadow: 0 4px 0 var(--depth); animation: card-in .45s both; animation-delay: calc(var(--i, 0) * 50ms); }
[data-mode="training"] .badge-tile.on .badge-ic { background: linear-gradient(135deg, #d1405a, #7a1f2b); box-shadow: 0 3px 0 #5d1822; }

/* ---------- skill map ---------- */
.skill-map { list-style: none; margin: 0; padding: 0; position: relative; display: flex; flex-direction: column; gap: 16px; }
.skill-map::before { content: ""; position: absolute; left: 50%; top: 12px; bottom: 12px; width: 4px; margin-left: -2px; border-radius: 4px; background: repeating-linear-gradient(180deg, var(--maroon) 0 10px, transparent 10px 20px); opacity: .45; animation: path-flow 1.6s linear infinite; }
@keyframes path-flow { to { background-position: 0 20px; } }
.node { position: relative; display: flex; }
.node.left { justify-content: flex-start; padding-right: 50%; } .node.right { justify-content: flex-end; padding-left: 50%; }
.node-in { position: relative; display: flex; align-items: center; gap: 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; width: 100%; margin: 0 16px; box-shadow: var(--shadow-sm); }
.node-dot { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--soft); border: 1px solid var(--line); color: var(--ink-3); transform: rotate(45deg); }
.node-dot .ic { transform: rotate(-45deg); }
.node-txt { display: flex; flex-direction: column; min-width: 0; }
.node-txt strong { font-weight: 600; font-size: .92rem; } .node-txt small { color: var(--ink-3); }
.node.done .node-dot { background: linear-gradient(135deg, #3ccf86, #1d7a4b); border-color: transparent; color: #fff; box-shadow: 0 3px 0 #135c37; }
.node.available .node-in { border-color: var(--maroon); box-shadow: 0 0 0 3px var(--maroon-tint), var(--shadow); }
.node.available .node-dot { background: linear-gradient(135deg, #d1405a, #7a1f2b); border-color: transparent; color: #fff; box-shadow: 0 3px 0 #5d1822, 0 0 18px rgba(209, 64, 90, .45); animation: node-pulse 1.8s ease-in-out infinite; }
@keyframes node-pulse { 50% { box-shadow: 0 3px 0 #5d1822, 0 0 30px rgba(209, 64, 90, .75); } }
.node.available .node-txt small { color: var(--maroon-text); font-weight: 600; }
.node.locked .node-in { background: var(--soft); box-shadow: none; opacity: .7; }
.node-here { position: absolute; right: 10px; top: -10px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 99px; background: var(--maroon); color: #fff; }
.node.goal .goal-in { justify-content: center; gap: 8px; border-style: dashed; color: var(--ink-2); }
.node.goal.done .goal-in { border-style: solid; border-color: var(--ok); color: var(--ok-ink); }
.node.goal { justify-content: center; padding: 0; }
.node.goal .node-in { max-width: 280px; }
[data-mode="training"] .node-in { background: linear-gradient(180deg, #1d1e26, #17181e); box-shadow: 0 4px 0 var(--depth); animation: card-in .45s both; animation-delay: calc(var(--i, 0) * 60ms); }
[data-mode="training"] a.node-in:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--depth); }
@media (max-width: 560px) { .skill-map::before { left: 38px; } .node.left, .node.right { padding: 0; justify-content: flex-start; } .node-in { margin: 0; } .node.goal { justify-content: flex-start; } .node-here { right: 4px; } }

/* ---------- stations ---------- */
.station-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.station-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 20px 16px 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.station-card h3 { font: 700 1.1rem var(--font-head); margin: 4px 0 0; }
.st-badge { position: relative; width: 84px; height: 84px; display: grid; place-items: center; }
.st-badge .hex { width: 70px; height: 70px; display: grid; place-items: center; color: var(--ink-3); background: var(--soft); clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); }
.st-lvl { position: absolute; right: 4px; bottom: 4px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 .8rem var(--font-head); background: var(--hero); color: #fff; border: 2px solid var(--surface); }
.s-trainee .hex { background: linear-gradient(160deg, #f0a63b, #b46b10); color: #fff; }
.s-certified .hex { background: linear-gradient(160deg, #3ccf86, #1d7a4b); color: #fff; }
.s-trainer .hex { background: linear-gradient(160deg, #ff6b85, #7a1f2b); color: #fff; }
.s-expired .hex { background: linear-gradient(160deg, #5c5e69, #33353e); color: #ff9a9a; }
.s-trainer .st-badge { filter: drop-shadow(0 0 14px rgba(255, 107, 133, .55)); }
.st-steps { display: flex; gap: 6px; margin: 2px 0 6px; }
.st-steps i { width: 26px; height: 6px; border-radius: 99px; background: var(--tone); }
.st-steps i.on { background: var(--maroon); box-shadow: 0 0 8px rgba(209, 64, 90, .5); }
.st-wait { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--warn-ink); background: var(--warn-tint); padding: 6px 10px; border-radius: 10px; }
.st-wait.done { color: var(--ok-ink); background: var(--ok-tint); }
[data-mode="training"] .station-card { background: linear-gradient(180deg, #1f2029, #17181e); box-shadow: 0 5px 0 var(--depth), 0 14px 26px rgba(0, 0, 0, .25); animation: card-in .5s both; animation-delay: calc(var(--i, 0) * 80ms); }
[data-mode="training"] .st-badge .hex { animation: hex-float 3.2s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.6s); }
@keyframes hex-float { 50% { transform: translateY(-4px) rotateY(18deg); } }
.cell.tr { background: var(--maroon-tint); color: var(--maroon-text); }
.cell-btn { position: relative; }
.req-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--surface); }

/* ---------- quest, challenge, praise, shop, ledger ---------- */
.quest .q-row { display: flex; align-items: center; gap: 8px; font-size: .88rem; margin-top: 4px; }
.quest .q-row strong { font-variant-numeric: tabular-nums; }
.challenge .ch-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; }
.challenge .ch-row.mine { background: var(--maroon-tint); }
.ch-pos { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font: 700 .9rem var(--font-head); background: var(--tone); flex: none; }
.ch-row:first-child .ch-pos { background: var(--maroon); color: #fff; }
.ch-row .grow { display: flex; flex-direction: column; gap: 3px; }
.ch-bar { display: block; height: 6px; border-radius: 99px; background: var(--tone); overflow: hidden; }
.ch-bar i { display: block; height: 100%; background: var(--maroon); border-radius: 99px; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.ch-avg { font: 700 1.15rem var(--font-head); text-align: right; } .ch-avg small { display: block; font: 500 .66rem var(--font); color: var(--ink-3); }
.praise { margin: 0; padding: 12px 14px; border-left: 2px solid var(--maroon); background: var(--soft); border-radius: 0 12px 12px 0; }
.praise p { font-style: italic; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.shop-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 16px 12px 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.shop-item img { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; }
.shop-ic { width: 72px; height: 72px; border-radius: 18px; display: grid; place-items: center; background: var(--maroon-tint); color: var(--maroon-text); }
.shop-item strong { font-size: .9rem; }
.shop-foot { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; }
[data-mode="training"] .shop-item { background: linear-gradient(180deg, #1f2029, #17181e); box-shadow: 0 5px 0 var(--depth); animation: card-in .45s both; animation-delay: calc(var(--i, 0) * 60ms); }
[data-mode="training"] .shop-ic { background: linear-gradient(160deg, #d1405a, #7a1f2b); color: #fff; box-shadow: 0 4px 0 #5d1822; }
.coin-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 20px; border-radius: 22px; margin-bottom: 18px; color: #fff; background: radial-gradient(120% 140% at 0% 0%, rgba(192, 52, 74, .45), transparent 55%), linear-gradient(160deg, #2a2c37, #17181e 70%); box-shadow: 0 6px 0 var(--depth, #07080b), 0 18px 36px rgba(0, 0, 0, .35); }
.coin-hero > div:first-of-type strong { display: block; font: 700 2.4rem/1 var(--font-head); letter-spacing: -.03em; }
.coin-hero > div:first-of-type span { color: #c9cad3; }
.ch-split { margin-left: auto; display: flex; gap: 14px; color: #c9cad3; font-size: .86rem; } .ch-split b { color: #fff; font-family: var(--font-head); }
.ledger .lg-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok); }
.ledger .lg-dot.spend { background: var(--maroon); } .ledger .lg-dot.bonus { background: #8f9bff; }
.ledger .pos { color: var(--ok-ink); } .ledger .neg { color: var(--maroon-text); }

/* ---------- games extras ---------- */
.q-dots { display: flex; gap: 6px; margin-bottom: 14px; }
.q-dots i { flex: 1; height: 4px; border-radius: 99px; background: var(--tone); }
.q-dots i.now { background: var(--ink-3); } .q-dots i.ok { background: var(--ok); } .q-dots i.bad { background: var(--bad); }
.scen-q .bubble { font-size: 1.02rem; font-weight: 600; }
[data-mode="training"] .gq-opt { background: linear-gradient(180deg, #1f2029, #191a21); border-color: var(--line-strong); box-shadow: 0 3px 0 var(--depth); transition: transform .08s, box-shadow .08s, border-color .15s; }
[data-mode="training"] .gq-opt:hover:not([disabled]) { border-color: var(--maroon); background: linear-gradient(180deg, #2a1a20, #1d1419); }
[data-mode="training"] .gq-opt:active:not([disabled]) { transform: translateY(2px); box-shadow: 0 1px 0 var(--depth); }
[data-mode="training"] .gq-opt.right { background: rgba(60, 207, 134, .16); animation: tick-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
[data-mode="training"] .gq-opt.wrong { background: rgba(255, 93, 93, .14); animation: gflash .35s; }
[data-mode="training"] .gt-tile { background: linear-gradient(180deg, #23242d, #1a1b22); box-shadow: 0 4px 0 var(--depth); border-color: var(--line-strong); }
[data-mode="training"] .gt-tile:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--depth); }
[data-mode="training"] .gt-order { background: linear-gradient(180deg, #2a2c37, #1d1e26); box-shadow: 0 4px 0 var(--depth); }
[data-mode="training"] .g-timer i { background: linear-gradient(90deg, #a52e42, #ff6b85); box-shadow: 0 0 10px rgba(255, 107, 133, .5); }

/* ---------- podium (3D blocks) ---------- */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 26px 0 18px; perspective: 700px; }
.pod { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 30%; max-width: 150px; text-align: center; min-width: 0; animation: pod-rise .7s cubic-bezier(.2, .9, .3, 1.15) both; animation-delay: calc(var(--i, 1) * 120ms); }
.pod strong { font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.pod > span:not(.crown):not(.avatar) { font: 700 .95rem var(--font-head); color: var(--ink-2); }
.pod-step { position: relative; width: 100%; margin-top: 8px; border-radius: 10px 10px 0 0; display: grid; place-items: center; font: 700 1.4rem var(--font-head); color: #fff; transform: rotateX(8deg); transform-origin: bottom; }
.pod-step::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; border-radius: 10px 10px 0 0; background: inherit; filter: brightness(1.3); transform: skewX(-20deg) translateX(5px); }
.pod.p1 .pod-step { height: 100px; background: linear-gradient(180deg, #c0344a, #7a1f2b); box-shadow: 0 0 26px rgba(192, 52, 74, .45); }
.pod.p2 .pod-step { height: 74px; background: linear-gradient(180deg, #4a4c58, #2a2c37); }
.pod.p3 .pod-step { height: 56px; background: linear-gradient(180deg, #6e717d, #4a4c58); }
.pod.p1 .avatar { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--maroon), 0 0 22px rgba(209, 64, 90, .55); }
.crown { position: absolute; top: -22px; color: #ff8fa1; }
.pod.me strong { color: var(--maroon-text); }
@keyframes pod-rise { from { transform: translateY(24px); } }

/* level up */
.lvl-up { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lvl-up .lu-ring { background: #17181e; border-radius: 50%; padding: 12px; animation: luring .9s var(--ease) 1; }
.lvl-up .lvl-ring { width: 104px; height: 104px; }
.lvl-up h2 { font-size: 1.25rem; margin-top: 10px; }
.lvl-up.still .lu-ring { animation: none; }
@keyframes luring { 0% { transform: scale(.7); box-shadow: 0 0 0 0 rgba(209, 64, 90, .6); } 70% { transform: scale(1.03); box-shadow: 0 0 0 18px rgba(209, 64, 90, 0); } 100% { transform: none; } }

/* ---------- work side: follow-ups, quick lesson, shift talk, training door, audits, sticker ---------- */
.jit { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .8rem; font-weight: 600; color: var(--maroon-text); background: var(--maroon-tint); padding: 4px 10px; border-radius: 8px; width: fit-content; }
.jit:hover { text-decoration: underline; }
.list-row.fu.done { opacity: .7; }
.ok-text { color: var(--ok-ink); }
.shift-talk { box-shadow: inset 3px 0 0 var(--maroon), var(--shadow-sm); }
.shift-talk.read { box-shadow: inset 3px 0 0 var(--ok), var(--shadow-sm); }
.st-body { white-space: pre-wrap; line-height: 1.6; margin-bottom: 6px; }
.train-door .row-ic { background: var(--hero); color: #fff; border-color: transparent; }
.aud-item { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.aud-item .input { grid-column: 1 / -1; min-height: 38px; }
.aud-item .seg label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: .84rem; cursor: pointer; }
.aud-item .seg input { accent-color: var(--maroon); }
@media (max-width: 560px) { .aud-item { grid-template-columns: 1fr; } }
.sticker h2 { margin-top: 8px; }

/* ======================================================================
   20. Reduced motion
   ====================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .wheel-g.spinning { animation: none !important; transform: rotate(var(--to)); }
  .g-timer i { animation: none !important; }
  .mode-intro, .burst { display: none !important; }
  [data-mode="training"] [data-tilt] { transform: none !important; }
}

.pl-av { width: 60px !important; height: 60px !important; font-size: 1.2rem !important; box-shadow: 0 0 0 3px rgba(255, 255, 255, .12), 0 0 0 5px var(--maroon); }

/* Owner viewing a staff member's app */
.view-as { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: var(--maroon, #7a1f2b); color: #fff; font-size: .88rem; }
@media (max-width: 959px) { .view-as { top: 60px; } }
.view-as .btn-light .ic { transform: rotate(180deg); }
/* PINs */
.pin-cell { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
/* span.pin only: pinned notice cards also carry the class "pin" */
span.pin, b.pin, code.pin { font: 600 .9rem ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: .12em; padding: 2px 8px; border-radius: 6px; background: var(--soft); border: 1px solid var(--line); }
span.pin.lg, b.pin.lg, code.pin.lg { font-size: 1.1rem; padding: 4px 12px; }
.icon-btn.sm { width: 32px; height: 32px; }
.my-pin .row-ic { background: var(--maroon-tint); color: var(--maroon-text); border-color: transparent; }
/* icon picker, award list */
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.icon-pick label { cursor: pointer; }
.icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick span { display: grid; place-items: center; height: 44px; border-radius: 12px; border: 1px solid var(--line-strong); color: var(--ink-2); transition: background .15s, border-color .15s, color .15s; }
.icon-pick label:hover span { border-color: var(--ink-3); color: var(--ink); }
.icon-pick input:checked + span { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.icon-pick input:focus-visible + span { outline: 2px solid var(--maroon); outline-offset: 2px; }
.award-list { max-height: 50vh; overflow-y: auto; }
.row-ic.sm { width: 32px; height: 32px; border-radius: 10px; }
.skill-row .row-ic { flex: none; }

/* Bulk Excel upload */
.bulk-bar { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-right: 6px; }
.bulk-sum { display: flex; flex-wrap: wrap; gap: 6px; }
.bulk-err { background: #fdf0f1; border: 1px solid #f1c7cc; border-radius: 10px; padding: 10px 12px; font-size: 13px; color: #6b1420; }
.bulk-err ul { margin: 6px 0 0; padding-left: 18px; }
.bulk-list { max-height: 300px; overflow: auto; }
/* ======================================================================
   Premium polish (2/11/2026): depth, rhythm and touch feedback. Colours stay white, dark grey, maroon.
   ====================================================================== */
html { scroll-behavior: smooth; }
h1, h2, .h3, .kpi b, .kpis b, .stat b { font-feature-settings: "tnum" 1, "cv11" 1; }
.card { transition: box-shadow .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease); }
a.card:hover, .card[data-go]:hover, .card[data-act]:hover { box-shadow: var(--shadow); border-color: var(--line-strong); transform: translateY(-1px); }
a.card:active, .card[data-go]:active, .card[data-act]:active { transform: translateY(0) scale(.995); }
.btn { transition: background .15s var(--ease), box-shadow .15s var(--ease), transform .12s var(--ease), border-color .15s var(--ease); letter-spacing: .005em; }
.btn-primary { background: linear-gradient(180deg, var(--maroon-2) 0%, var(--maroon) 100%); box-shadow: 0 1px 2px rgba(122, 31, 43, .3), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn-primary:hover { background: linear-gradient(180deg, var(--maroon) 0%, var(--maroon-hover) 100%); box-shadow: 0 4px 14px rgba(122, 31, 43, .28), inset 0 1px 0 rgba(255, 255, 255, .1); }
.btn-dark { box-shadow: 0 1px 2px rgba(17, 18, 22, .3), inset 0 1px 0 rgba(255, 255, 255, .08); }
.list-row { transition: background .15s var(--ease); }
.list-row:hover { background: var(--soft); }
.chip { letter-spacing: .01em; }
.nav-item.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--maroon); }
.input, .select, textarea.input { transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease); }
.sheet { border-radius: 22px; }
@media (max-width: 640px) { .sheet { border-radius: 22px 22px 0 0; } }
.overlay { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.tabs button[aria-selected="true"], .tabs button.on { box-shadow: 0 1px 3px rgba(17, 18, 22, .12); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid var(--bg); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .card, .btn { transition: none; } a.card:hover, .card[data-go]:hover, .card[data-act]:hover { transform: none; } }
