/* WattsWorkforce · Watts design system
   Layout: charcoal rail with the WATTS lockup + cool-grey workspace of dense, scannable panels.
   Orange (#F58220) is the Watts signal: primary action, active state, the brand stripes. Never body text on white. */
:root {
  --orange: #F58220;
  --orange-hover: #E8730F;
  --on-orange: #231F20;
  --orange-text: #A84B06;
  --orange-soft: #FDEBDC;
  --orange-line: #F7B57E;
  --ink: #231F20;
  --graphite: #424244;

  --bg: #EDEFF2;
  --surface: #FFFFFF;
  --surface-2: #F6F7F9;
  --surface-3: #ECEEF1;
  --line: #DADDE3;
  --line-strong: #C2C7CF;
  --text: #1C1B1C;
  --text-2: #474C56;
  --text-3: #676D78;

  --rail: #1F1D1E;
  --rail-2: #282627;
  --rail-text: #E4E4E6;
  --rail-muted: #9A9AA0;
  --rail-line: #353334;
  --logo-letters: #FFFFFF;
  --logo-grey: #8E8E94;

  --success: #1B7A4B;
  --success-soft: #E2F2E9;
  --warning: #855C00;
  --warning-soft: #FFF2C7;
  --danger: #B42318;
  --danger-soft: #FCE7E5;
  --info: #1C5DB5;
  --info-soft: #E2ECFA;
  --violet: #5B45B0;
  --violet-soft: #ECE8F8;
  /* chart series (validated: adjacent CVD ΔE ≥ 9.3 light & dark) */
  --series-1: #2a78d6;
  --series-2: #F58220;
  --series-3: #1baf7a;
  --series-4: #4a3aa7;

  --focus: #F58220;
  --shadow-1: 0 1px 2px rgba(22, 24, 29, .07), 0 1px 1px rgba(22, 24, 29, .04);
  --shadow-2: 0 10px 30px rgba(22, 24, 29, .14), 0 2px 6px rgba(22, 24, 29, .06);
  --shadow-3: 0 24px 60px rgba(22, 24, 29, .22);
  --scrim: rgba(18, 18, 20, .46);

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --rail-w: 252px;
  --top-h: 60px;

  --font-display: 'Saira', 'Arial Narrow', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Cascadia Mono', Consolas, ui-monospace, monospace;

  --fs-xs: 11.5px;
  --fs-sm: 12.5px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 19px;
  --fs-2xl: 24px;
  --fs-3xl: 30px;
  --fs-4xl: 40px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --orange-text: #FF9F4D;
    --orange-soft: #3A2514;
    --orange-line: #7A4517;
    --bg: #111215;
    --surface: #1A1C20;
    --surface-2: #1F2126;
    --surface-3: #262930;
    --line: #2D3138;
    --line-strong: #3E434C;
    --text: #ECEDEF;
    --text-2: #BABEC6;
    --text-3: #8F949D;
    --rail: #0B0C0E;
    --rail-2: #16171A;
    --rail-line: #24262A;
    --success: #44BE80;
    --success-soft: #11301F;
    --warning: #E6B740;
    --warning-soft: #33280B;
    --danger: #F2685C;
    --danger-soft: #3A1714;
    --info: #6EA8F2;
    --info-soft: #132A45;
    --violet: #A897F0;
    --violet-soft: #251E44;
    --series-1: #3987e5;
    --series-2: #E2711A;
    --series-3: #199e70;
    --series-4: #9085e9;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 10px 30px rgba(0, 0, 0, .5);
    --shadow-3: 0 24px 60px rgba(0, 0, 0, .6);
    --scrim: rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --orange-text: #FF9F4D;
  --orange-soft: #3A2514;
  --orange-line: #7A4517;
  --bg: #111215;
  --surface: #1A1C20;
  --surface-2: #1F2126;
  --surface-3: #262930;
  --line: #2D3138;
  --line-strong: #3E434C;
  --text: #ECEDEF;
  --text-2: #BABEC6;
  --text-3: #8F949D;
  --rail: #0B0C0E;
  --rail-2: #16171A;
  --rail-line: #24262A;
  --success: #44BE80;
  --success-soft: #11301F;
  --warning: #E6B740;
  --warning-soft: #33280B;
  --danger: #F2685C;
  --danger-soft: #3A1714;
  --info: #6EA8F2;
  --info-soft: #132A45;
  --violet: #A897F0;
  --violet-soft: #251E44;
  --series-1: #3987e5;
  --series-2: #E2711A;
  --series-3: #199e70;
  --series-4: #9085e9;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, .5);
  --shadow-3: 0 24px 60px rgba(0, 0, 0, .6);
  --scrim: rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
#root { min-height: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; text-wrap: balance; color: var(--text); }
h1 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-3xl); letter-spacing: .005em; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); font-weight: 600; }
h4 { font-size: var(--fs-md); font-weight: 600; }
p { margin: 0; }
a { color: var(--orange-text); text-decoration: underline; text-underline-offset: 2px; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--orange-soft); }
.num, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: .92em; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.strong { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.eyebrow { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--text-3); }
.display { font-family: var(--font-display); }
.tone-success-text { color: var(--success); }
.tone-warning-text { color: var(--warning); }
.tone-danger-text { color: var(--danger); }
.tone-info-text { color: var(--info); }
.tone-brand-text { color: var(--orange-text); }
hr, .divider { border: 0; border-top: 1px solid var(--line); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Layout primitives ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack-xs { gap: 4px; } .stack-sm { gap: 8px; } .stack-md { gap: 12px; } .stack-lg { gap: 24px; } .stack-xl { gap: 32px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; }
.row-xs { gap: 4px; } .row-sm { gap: 8px; } .row-lg { gap: 20px; }
.row-nowrap { flex-wrap: nowrap; }
.row-between { justify-content: space-between; }
.row-end { justify-content: flex-end; }
.row-top { align-items: flex-start; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: 16px; min-width: 0; }
.grid > * { min-width: 0; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cols-main-side { grid-template-columns: minmax(0, 1fr) 340px; }
.cols-side-main { grid-template-columns: 300px minmax(0, 1fr); }
@media (max-width: 1180px) {
  .cols-4, .cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-main-side, .cols-side-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .cols-2, .cols-3, .cols-4, .cols-5 { grid-template-columns: minmax(0, 1fr); }
  .cols-4.keep-2, .cols-5.keep-2, .cols-3.keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.rail {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  background: var(--rail); color: var(--rail-text);
  display: flex; flex-direction: column; border-right: 1px solid var(--rail-line);
  overflow: hidden;
}
.rail-brand { padding: 20px 20px 14px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--rail-line); }
.rail-brand .watts-logo { width: 132px; height: auto; color: var(--logo-letters); }
.rail-brand .product { font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: .28em; text-transform: uppercase; color: var(--orange); padding-left: 2px; }
.rail-scroll { flex: 1 1 auto; overflow-y: auto; padding: 10px 10px 16px; scrollbar-width: thin; scrollbar-color: var(--rail-line) transparent; }
.rail-section { margin-top: 14px; }
.rail-section:first-child { margin-top: 4px; }
.rail-section-title { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--rail-muted); font-weight: 600; padding: 6px 12px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 12px; border: 0; border-radius: 7px; background: transparent;
  color: var(--rail-text); text-align: left; cursor: pointer; font-size: 13.5px; position: relative;
  text-decoration: none;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .82; }
.nav-item:hover { background: var(--rail-2); }
.nav-item.active { background: var(--rail-2); color: #fff; font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 4px; border-radius: 0 3px 3px 0; background: var(--orange); }
.nav-item.active svg { opacity: 1; color: var(--orange); }
.nav-item .nav-count { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--orange); color: var(--on-orange); border-radius: 999px; padding: 0 7px; line-height: 18px; }
.nav-item .nav-count.muted-count { background: var(--rail-line); color: var(--rail-text); }
.rail-foot { border-top: 1px solid var(--rail-line); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.rail-user { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; }
.rail-user .who { min-width: 0; }
.rail-user .who b { display: block; font-size: 13px; color: #fff; font-weight: 600; }
.rail-user .who span { display: block; font-size: 11.5px; color: var(--rail-muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  height: var(--top-h); display: flex; align-items: center; gap: 12px;
  padding: 0 24px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line);
}
.topbar .crumbs { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-3); min-width: 0; }
.topbar .crumbs b { color: var(--text); font-weight: 600; }
.topbar .spacer { flex: 1 1 auto; }
.demo-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.demo-chip svg { width: 14px; height: 14px; }
.content { padding: 24px 28px 48px; width: 100%; max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.content.narrow { max-width: 980px; }
.menu-btn { display: none; }

.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-header .titles { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 820px; }
.page-header .subtitle { color: var(--text-2); font-size: 14.5px; max-width: 72ch; }
.page-header .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); z-index: 60; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-3); }
  .rail.open { transform: none; }
  .rail-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 55; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 96px; }
  .hide-md { display: none !important; }
}
@media (max-width: 600px) {
  h1 { font-size: 24px; }
  .hide-sm { display: none !important; }
}

/* Bottom tabs (staff app on phone width or phone frame) */
.tabbar { display: none; }
@media (max-width: 760px) {
  .tabbar.staff { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
}
.tabbar button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--text-3); padding: 4px 0; cursor: pointer; }
.tabbar button svg { width: 21px; height: 21px; }
.tabbar button.active { color: var(--orange-text); font-weight: 600; }
.tabbar button.punch-tab svg { width: 26px; height: 26px; background: var(--orange); color: var(--on-orange); border-radius: 999px; padding: 5px; box-sizing: content-box; margin-top: -14px; box-shadow: 0 4px 12px rgba(245, 130, 32, .45); }

/* Phone frame preview for the staff app on desktop */
.phone-stage { display: flex; justify-content: center; padding: 8px 0 24px; }
.phone {
  width: 392px; max-width: 100%; height: 812px; border-radius: 46px; padding: 12px;
  background: #121214; box-shadow: var(--shadow-3), inset 0 0 0 2px #2b2b2e;
  position: relative; flex: none;
}
.phone-screen { position: relative; height: 100%; border-radius: 36px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
.phone-status { height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; font-size: 12.5px; font-weight: 600; color: var(--text); background: var(--surface); flex: none; }
.phone-notch { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 112px; height: 30px; background: #121214; border-radius: 20px; z-index: 3; }
.phone-appbar { display: flex; align-items: center; gap: 10px; padding: 8px 16px 10px; background: var(--surface); border-bottom: 1px solid var(--line); flex: none; }
.phone-appbar .watts-logo { width: 74px; color: var(--ink); }
:root[data-theme="dark"] .phone-appbar .watts-logo { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .phone-appbar .watts-logo { color: #fff; } }
.phone-body { flex: 1 1 auto; overflow-y: auto; padding: 14px 14px 20px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: none; }
.phone-body::-webkit-scrollbar { display: none; }
.phone .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: static; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px 14px; flex: none; }
/* inside the phone, collapse multi-column grids */
.phone .cols-2, .phone .cols-3, .phone .cols-4, .phone .cols-5, .phone .cols-main-side, .phone .cols-side-main { grid-template-columns: minmax(0, 1fr); }
.phone .cols-4.keep-2, .phone .cols-3.keep-2, .phone .cols-5.keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.phone .page-header h1 { font-size: 22px; }
.phone .hide-phone { display: none !important; }

/* ---------- Brand bits ---------- */
.watts-logo { display: block; height: auto; }
.watts-logo .lg-g { fill: var(--logo-grey); }
.watts-logo .lg-o { fill: var(--orange); }
.on-light .watts-logo, .watts-logo.on-light { color: var(--ink); }
.on-light .watts-logo .lg-g { fill: var(--graphite); }
:root[data-theme="dark"] .on-light .watts-logo { color: #fff; }
:root[data-theme="dark"] .on-light .watts-logo .lg-g { fill: var(--logo-grey); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .on-light .watts-logo { color: #fff; }
  :root:not([data-theme="light"]) .on-light .watts-logo .lg-g { fill: var(--logo-grey); }
}
.stripes { display: inline-block; vertical-align: middle; }
.stripes line { stroke-linecap: round; }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); min-width: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-header.plain { border-bottom: 0; padding-bottom: 4px; }
.card-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; min-width: 0; }
.card-title svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.card-sub { font-size: var(--fs-sm); color: var(--text-3); }
.card-body { padding: 16px 18px; min-width: 0; }
.card-body.tight { padding: 10px 14px; }
.card-body.flush { padding: 0; }
.card-footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.panel.dashed { border-style: dashed; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title h2 { font-size: 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer;
  white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s, transform .06s;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }
.btn-primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #3a3637; }
:root[data-theme="dark"] .btn-dark { background: #ECEDEF; border-color: #ECEDEF; color: #1A1C20; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-dark { background: #ECEDEF; border-color: #ECEDEF; color: #1A1C20; } }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; gap: 5px; }
.btn-xs svg { width: 14px; height: 14px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; }
.btn-xl { height: 56px; padding: 0 24px; font-size: 17px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--orange-text); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }

/* ---------- Badges, chips, legal citations ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; line-height: 1; padding: 4px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; border: 1px solid transparent; }
.badge svg { width: 12px; height: 12px; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tone-success { background: var(--success-soft); color: var(--success); }
.tone-warning { background: var(--warning-soft); color: var(--warning); }
.tone-danger { background: var(--danger-soft); color: var(--danger); }
.tone-info { background: var(--info-soft); color: var(--info); }
.tone-brand { background: var(--orange-soft); color: var(--orange-text); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.tone-neutral { background: var(--surface-3); color: var(--text-2); }
.tone-outline { background: transparent; border-color: var(--line-strong); color: var(--text-2); }
.law {
  display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  padding: 2px 7px 2px 5px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--text-2);
  background: var(--surface); cursor: pointer; white-space: nowrap; line-height: 1.5; text-decoration: none;
}
.law::before { content: "§"; color: var(--orange-text); font-weight: 600; }
.law:hover { border-color: var(--orange); color: var(--text); }
.kbd { font-family: var(--font-mono); font-size: 11px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius); border: 1px solid; font-size: 13.5px; }
.alert > svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert .alert-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.alert .alert-title { font-weight: 600; }
.alert.tone-info { border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.alert.tone-success { border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.alert.tone-warning { border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.alert.tone-danger { border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert.tone-brand { border-color: var(--orange-line); }
.alert.tone-neutral { border-color: var(--line); }
.alert .alert-body, .alert .alert-title { color: var(--text); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; min-width: 0; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { position: sticky; top: 0; z-index: 1; text-align: left; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; color: var(--text-3); background: var(--surface-2); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-3) 55%, transparent); }
.table tr.clickable { cursor: pointer; }
.table tr.selected td { background: var(--orange-soft); }
.table tr.row-warning td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
.table tr.row-danger td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.table tr.row-success td:first-child { box-shadow: inset 3px 0 0 var(--success); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--line-strong); border-bottom: 0; }
.table.compact td { padding: 7px 10px; }
.table.compact th { padding: 7px 10px; }
.table .cell-sub { display: block; font-size: 12px; color: var(--text-3); }
.table input.input { height: 30px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.label .req { color: var(--danger); }
.hint { font-size: 12px; color: var(--text-3); }
.error-text { font-size: 12px; color: var(--danger); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 11px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-size: 14px; min-width: 0;
  transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 22%, transparent); }
.input.invalid, .select.invalid, .textarea.invalid { border-color: var(--danger); }
.input[readonly], .input[disabled], .select[disabled] { background: var(--surface-2); color: var(--text-2); }
.input-group { display: flex; align-items: stretch; min-width: 0; }
.input-group .addon { display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-3); font-size: 13px; }
.input-group .addon:first-child { border-radius: var(--radius) 0 0 var(--radius); border-right: 0; }
.input-group .addon:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-left: 0; }
.input-group .input:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group .input:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--orange); flex: none; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 9px; border: 1px solid var(--line); flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + .track { background: var(--orange); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid.cols-3f { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .form-grid, .form-grid.cols-3f { grid-template-columns: minmax(0, 1fr); } }
.phone .form-grid, .phone .form-grid.cols-3f { grid-template-columns: minmax(0, 1fr); }
.otp { display: flex; gap: 8px; }
.otp input { width: 44px; height: 52px; text-align: center; font-size: 22px; font-family: var(--font-mono); border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); }
.otp input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 22%, transparent); }

/* ---------- Stats ---------- */
.stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); min-width: 0; box-shadow: var(--shadow-1); }
.stat-label { font-size: 12px; color: var(--text-3); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat-label svg { width: 15px; height: 15px; }
.stat-value { font-family: var(--font-display); font-weight: 600; font-size: 27px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-value small { font-size: 14px; font-weight: 500; color: var(--text-3); margin-left: 3px; font-family: var(--font-body); }
.stat-meta { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stat.accent { border-top: 3px solid var(--orange); }
.stat.warn { border-top: 3px solid var(--warning); }
.stat.danger { border-top: 3px solid var(--danger); }
.stat.ok { border-top: 3px solid var(--success); }
.kv { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 8px 18px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover { background: color-mix(in srgb, var(--surface-3) 50%, transparent); }
.list-item .li-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-item .li-title { font-weight: 600; font-size: 13.5px; }
.list-item .li-sub { font-size: 12.5px; color: var(--text-3); }
.icon-tile { width: 36px; height: 36px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--surface-3); color: var(--text-2); }
.icon-tile svg { width: 18px; height: 18px; }
.icon-tile.tone-brand { background: var(--orange-soft); color: var(--orange-text); }

/* ---------- Avatar ---------- */
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; flex: none; color: #fff; letter-spacing: .02em; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.xl { width: 84px; height: 84px; font-size: 28px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: transparent; padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tab svg { width: 15px; height: 15px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--orange); }
.tab .count { font-size: 11px; background: var(--surface-3); border-radius: 999px; padding: 0 6px; line-height: 17px; color: var(--text-2); }
.tab.active .count { background: var(--orange-soft); color: var(--orange-text); }

/* ---------- Stepper (brand stripes) ---------- */
.stepper { display: flex; gap: 6px; align-items: stretch; flex-wrap: wrap; }
.step { flex: 1 1 0; min-width: 64px; display: flex; flex-direction: column; gap: 6px; background: none; border: 0; padding: 0; text-align: left; cursor: default; }
.step.clickable { cursor: pointer; }
.step .bar { height: 7px; border-radius: 999px; background: var(--line-strong); transform: skewX(-28deg); transition: background .2s; }
.step.done .bar { background: var(--graphite); }
:root[data-theme="dark"] .step.done .bar { background: #8E8E94; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .step.done .bar { background: #8E8E94; } }
.step.current .bar { background: var(--orange); }
.step .step-label { font-size: 12px; font-weight: 600; color: var(--text-3); display: flex; gap: 6px; align-items: baseline; }
.step .step-label .n { font-family: var(--font-display); font-weight: 600; }
.step.current .step-label, .step.done .step-label { color: var(--text); }

/* ---------- Timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.tl-item { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; position: relative; padding-bottom: 14px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--text-3); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.tl-dot svg { width: 12px; height: 12px; }
.tl-dot.tone-success { background: var(--success); color: #fff; }
.tl-dot.tone-brand { background: var(--orange); color: var(--on-orange); }
.tl-dot.tone-danger { background: var(--danger); color: #fff; }
.tl-dot.tone-warning { background: var(--warning); color: #fff; }
.tl-dot.tone-info { background: var(--info); color: #fff; }
.tl-title { font-size: 13.5px; font-weight: 600; }
.tl-meta { font-size: 12px; color: var(--text-3); }

/* ---------- Progress & meters ---------- */
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--orange); }
.progress.tone-success > span { background: var(--success); }
.progress.tone-warning > span { background: var(--warning); }
.progress.tone-danger > span { background: var(--danger); }
.progress.tone-info > span { background: var(--info); }
.progress.thin { height: 5px; }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 80; background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade-in .14s ease; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-3); width: min(560px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; border: 1px solid var(--line); animation: pop-in .16s ease; }
.modal.wide { width: min(860px, 100%); }
.modal.xwide { width: min(1100px, 100%); }
.modal.narrow { width: min(420px, 100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.modal-header h2 { font-size: 19px; }
.modal-header .modal-sub { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.modal-body { padding: 4px 20px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 14px 14px; }
.overlay.right { justify-content: flex-end; padding: 0; }
.drawer { background: var(--surface); width: min(520px, 100%); height: 100%; box-shadow: var(--shadow-3); display: flex; flex-direction: column; border-left: 1px solid var(--line); animation: slide-in .2s ease; }
.drawer.wide { width: min(760px, 100%); }
.drawer .modal-body { flex: 1 1 auto; padding-top: 8px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (max-width: 600px) {
  .overlay { padding: 0; align-items: flex-end; }
  .modal, .modal.wide, .modal.xwide, .modal.narrow { width: 100%; max-height: 92dvh; border-radius: 16px 16px 0 0; }
  .modal-footer { border-radius: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}

.toasts { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--ink); color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow-2); font-size: 13.5px; animation: pop-in .18s ease; }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.tone-success svg { color: #5BD394; }
.toast.tone-danger svg { color: #FF8A80; }
.toast.tone-warning svg { color: #FFD166; }
.toast.tone-brand svg { color: var(--orange); }
.toast b { display: block; }
:root[data-theme="dark"] .toast { background: #ECEDEF; color: #16171A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast { background: #ECEDEF; color: #16171A; } }
@media (max-width: 760px) { .toasts { left: 16px; right: 16px; bottom: 84px; max-width: none; } }

.popover { position: absolute; z-index: 70; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-2); min-width: 220px; padding: 6px; animation: pop-in .12s ease; }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; background: transparent; border-radius: 7px; cursor: pointer; font-size: 13.5px; text-align: left; color: var(--text); }
.menu-item:hover { background: var(--surface-3); }
.menu-item svg { width: 16px; height: 16px; color: var(--text-3); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* ---------- Empty / skeleton ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 32px 16px; color: var(--text-3); }
.empty svg { width: 30px; height: 30px; color: var(--line-strong); }
.empty b { color: var(--text-2); font-size: 14.5px; }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: 6px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--orange) 55%, transparent); } 100% { box-shadow: 0 0 0 22px transparent; } }
.pulse { animation: pulse-ring 1.6s ease-out infinite; }

/* ---------- Document (pay stub, forms, letters) ---------- */
.doc-sheet { background: #FFFFFF; color: #1C1B1C; border-radius: 4px; box-shadow: var(--shadow-2); padding: 34px 38px; width: 100%; max-width: 860px; margin: 0 auto; font-size: 12.5px; line-height: 1.45; border: 1px solid #E2E4E8; }
.doc-sheet h1, .doc-sheet h2, .doc-sheet h3, .doc-sheet h4 { color: #1C1B1C; }
.doc-sheet .watts-logo { color: #231F20; }
.doc-sheet .watts-logo .lg-g { fill: #424244; }
.doc-sheet table { width: 100%; border-collapse: collapse; font-size: 12px; }
.doc-sheet th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: #5C626C; border-bottom: 1.5px solid #231F20; padding: 5px 6px; font-weight: 600; }
.doc-sheet td { padding: 5px 6px; border-bottom: 1px solid #E4E6EA; vertical-align: top; color: #1C1B1C; }
.doc-sheet td.num, .doc-sheet th.num { text-align: right; font-variant-numeric: tabular-nums; }
.doc-sheet .doc-muted { color: #6A707A; }
.doc-sheet .doc-band { background: #F3F4F6; border-radius: 4px; padding: 10px 12px; }
.doc-sheet .doc-total { background: #231F20; color: #fff; border-radius: 4px; padding: 10px 14px; }
.doc-sheet .doc-total * { color: #fff; }
.doc-sheet .law { background: #fff; color: #474C56; border-color: #C9CDD4; }
.doc-sheet .law::before { color: #A84B06; }
.doc-stage { background: var(--surface-3); border-radius: var(--radius-lg); padding: 24px 16px; overflow-x: auto; }
.code-block { font-family: var(--font-mono); font-size: 12px; line-height: 1.6; background: #16171A; color: #E6E6E6; border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; white-space: pre; tab-size: 4; }
.code-block .hl { color: #FFB066; }
.code-block .dim { color: #8B8F98; }

/* ---------- Maps (geofence) ---------- */
.map { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.map svg { display: block; width: 100%; height: auto; }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--font-body); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-line { stroke: var(--line-strong); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Auth screens ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art { position: relative; background: var(--rail); color: #fff; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.auth-art .watts-logo { width: 190px; color: #fff; }
.auth-art .art-stripes { position: absolute; right: -60px; bottom: -40px; width: 520px; opacity: .9; pointer-events: none; }
.auth-art h1 { color: #fff; font-size: 40px; font-weight: 600; max-width: 14ch; line-height: 1.08; }
.auth-art p { color: #C9C9CE; max-width: 46ch; font-size: 15px; }
.auth-art .auth-foot { font-size: 12px; color: #8E8E94; position: relative; max-width: 30ch; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.auth-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 18px; }
.auth-card h2 { font-size: 26px; }
.persona-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.persona { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; min-width: 0; }
.persona:hover { border-color: var(--orange); background: var(--orange-soft); }
.persona.selected { border-color: var(--orange); box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 30%, transparent); }
.persona .p-name { display: block; font-size: 13px; }
.persona .p-sub { display: block; font-size: 11.5px; color: var(--text-3); }
.persona .p-text { min-width: 0; display: flex; flex-direction: column; }
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { padding: 28px 20px; min-height: 0; }
  .auth-art h1 { font-size: 28px; }
  .auth-art .art-stripes { width: 300px; right: -40px; bottom: -30px; opacity: .5; }
  .auth-art .hide-auth-sm { display: none; }
}
@media (max-width: 420px) { .persona-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Kiosk (biometric clock device) ---------- */
.kiosk-stage { min-height: 100vh; min-height: 100dvh; background: radial-gradient(circle at 50% 30%, #2a2829, #121112 70%); display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.device { width: min(440px, 100%); background: linear-gradient(180deg, #2c2c2f, #1a1a1c); border-radius: 28px; padding: 18px 18px 26px; box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08); color: #fff; }
.device-cam { width: 10px; height: 10px; border-radius: 50%; background: #0d0d0e; margin: 0 auto 12px; box-shadow: inset 0 0 0 2px #3a3a3e; }
.device-screen { background: #0E0F11; border-radius: 14px; aspect-ratio: 3 / 4; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.device-brand { text-align: center; font-family: var(--font-display); letter-spacing: .3em; font-size: 11px; color: #77777d; margin-top: 14px; }

/* ---------- Misc ---------- */
.dot-status { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot-status.on { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent); }
.dot-status.warn { background: var(--warning); }
.dot-status.off { background: var(--danger); }
.callout-num { font-family: var(--font-display); font-weight: 600; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.big-clock { font-family: var(--font-display); font-weight: 600; font-size: 56px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.formula { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); }
.highlight-row { background: var(--orange-soft); }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--line); padding: 12px 0; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.scroll-y { overflow-y: auto; }
.max-h-320 { max-height: 320px; overflow-y: auto; }
.max-h-480 { max-height: 480px; overflow-y: auto; }
.w-full { width: 100%; }
.mt-0 { margin-top: 0; } .mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.p-0 { padding: 0; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .cal-h { font-size: 11px; color: var(--text-3); text-align: center; font-weight: 600; padding: 4px 0; text-transform: uppercase; letter-spacing: .05em; }
.cal .cal-d { min-height: 64px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; font-size: 12px; background: var(--surface); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .cal-d.out { background: var(--surface-2); color: var(--text-3); }
.cal .cal-d.today { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
.cal .cal-d .ev { font-size: 10.5px; border-radius: 4px; padding: 1px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* law chips never stretch inside column stacks */
.stack > .law, .stack > .tag-list { align-self: flex-start; }
.icon-tile.tone-success { background: var(--success-soft); color: var(--success); }
.icon-tile.tone-warning { background: var(--warning-soft); color: var(--warning); }
.icon-tile.tone-danger { background: var(--danger-soft); color: var(--danger); }
.icon-tile.tone-info { background: var(--info-soft); color: var(--info); }
.icon-tile.tone-violet { background: var(--violet-soft); color: var(--violet); }
.icon-tile.tone-neutral { background: var(--surface-3); color: var(--text-2); }

/* ---------- detail level: simple (default) shows only what the task needs; "full" adds legal basis, formulas and explanations ---------- */
:root:not([data-detail="full"]) .more,
:root:not([data-detail="full"]) .formula { display: none !important; }
:root[data-detail="full"] .only-simple { display: none !important; }
.lang-toggle .segmented button { padding: 3px 9px; font-size: 12px; }
.auth-lang { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: 16px; z-index: 50; }

.alert > .row { flex: none; }
/* narrow screens: actions drop below the text instead of squeezing it */
@media (max-width: 640px) { .alert { flex-wrap: wrap; } .alert > .alert-body { flex-basis: 0; } .alert > .row { flex: 1 1 100%; padding-left: 28px; } }
.phone .alert { flex-wrap: wrap; }
.phone .alert > .alert-body { flex-basis: 0; }
.phone .alert > .row { flex: 1 1 100%; padding-left: 28px; }
