/* Seertech: glass over a living aurora (DESIGN.md, "Glass over aurora").
   One dark world. Glass on the top bar, panels, cards and dialogs; rows inside glass use tints only.
   Status is a pulsing circle; pictures and chips carry the information, not sentences. */

/* ---------- Type: IBM Plex Sans + IBM Plex Sans Arabic, self-hosted ---------- */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --night: #0B0E1A;
  --night-2: #121733;

  --glass: rgb(255 255 255 / .07);
  --glass-hi: rgb(255 255 255 / .1);
  --glass-solid: rgb(20 24 46 / .8);       /* menus and dialogs: legible over anything */
  --edge: rgb(255 255 255 / .12);
  --edge-hi: rgb(255 255 255 / .2);
  --hair: rgb(255 255 255 / .07);
  --row-hover: rgb(255 255 255 / .05);
  --well: rgb(5 7 16 / .45);               /* picture frames */
  --field: rgb(255 255 255 / .06);         /* inputs */
  --field-line: rgb(255 255 255 / .16);

  --ink: #F2F3F7;
  --ink-2: rgb(242 243 247 / .74);
  --ink-3: rgb(242 243 247 / .6);

  --violet: #6452A3;
  --violet-fill: #6A57B2;
  --violet-fill-hi: #7A67C6;
  --violet-hi: #8E7BEA;
  --violet-wash: rgb(142 123 234 / .18);

  --ok: #3DDC97;
  --bad: #FF6B5E;
  --warn: #F2B84B;
  --idle: #A7B0C8;
  --setup: #A996FF;
  --ok-wash: rgb(61 220 151 / .14);
  --bad-wash: rgb(255 107 94 / .14);
  --warn-wash: rgb(242 184 75 / .14);
  --idle-wash: rgb(167 176 200 / .12);

  --r-1: 8px;
  --r-2: 16px;
  --r-3: 18px;
  --edge-light: inset 0 1px 0 rgb(255 255 255 / .14);
  --shadow-glass: 0 20px 50px -20px rgb(0 0 0 / .55);
  --shadow-lift: 0 30px 60px -24px rgb(0 0 0 / .7);
  --blur: blur(18px) saturate(140%);

  --t-fast: 130ms;
  --t-med: 220ms;
  --t-slow: 380ms;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --font: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-12: .75rem; --fs-13: .8125rem; --fs-14: .875rem; --fs-16: 1rem;
  --fs-19: 1.1875rem; --fs-23: 1.4375rem; --fs-28: 1.75rem;
  --bar-h: 60px;

  /* Bootstrap reads these */
  --bs-body-font-family: var(--font);
  --bs-body-font-size: var(--fs-14);
  --bs-body-line-height: 1.5;
  --bs-body-bg: var(--night);
  --bs-body-color: var(--ink);
  --bs-emphasis-color: var(--ink);
  --bs-secondary-color: var(--ink-3);
  --bs-tertiary-bg: var(--field);
  --bs-heading-color: var(--ink);
  --bs-border-color: var(--edge);
  --bs-border-radius: var(--r-1);
  --bs-border-radius-lg: var(--r-2);
}

/* ---------- Base and browser surfaces ---------- */
html { -webkit-text-size-adjust: 100%; background: var(--night); }
body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-14);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgb(142 123 234 / .4); color: #fff; }
input, textarea, select, [contenteditable] { caret-color: var(--violet-hi); }
:focus-visible { outline: 2px solid var(--violet-hi); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .18) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgb(255 255 255 / .18); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
a { color: var(--violet-hi); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #A898F2; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-family: var(--font); }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .92em; color: var(--ink); }
.num, time, .tabular { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
img { max-width: 100%; }
.text-muted { color: var(--ink-3) !important; }
.text-success { color: var(--ok) !important; }
.text-warning { color: var(--warn) !important; }
.text-danger { color: var(--bad) !important; }
.sr-only, .visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
  margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}
.skip-link { position: absolute; left: 16px; top: 8px; z-index: 2000; background: var(--glass-solid); color: var(--ink); padding: 8px 12px; border-radius: var(--r-1); }

/* ---------- The living aurora (fixed, transform-only, still under reduced motion) ---------- */
.aurora {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(140% 100% at 50% -10%, var(--night-2) 0%, var(--night) 62%),
    var(--night);
}
.aurora i {
  position: absolute; display: block; border-radius: 50%;
  will-change: transform;
  animation: drift 96s var(--ease) infinite alternate;
}
.aurora .f1 { /* Seertech violet leads */
  width: 78vmax; height: 78vmax; left: -18vmax; top: -30vmax;
  background: radial-gradient(closest-side, rgb(112 90 190 / .78), rgb(100 82 163 / .3) 55%, rgb(100 82 163 / 0));
  --dx: 9vmax; --dy: 7vmax; --s: 1.08;
}
.aurora .f2 { /* cooler indigo, upper right */
  width: 70vmax; height: 70vmax; right: -22vmax; top: -18vmax;
  background: radial-gradient(closest-side, rgb(64 92 214 / .58), rgb(59 79 184 / .2) 60%, rgb(59 79 184 / 0));
  --dx: -8vmax; --dy: 10vmax; --s: 1.12;
  animation-duration: 118s; animation-delay: -40s;
}
.aurora .f3 { /* one warm amber glow, low on the left */
  width: 56vmax; height: 56vmax; left: -12vmax; bottom: -34vmax;
  background: radial-gradient(closest-side, rgb(236 160 72 / .34), rgb(224 140 69 / .1) 60%, rgb(224 168 69 / 0));
  --dx: 12vmax; --dy: -5vmax; --s: 1.1;
  animation-duration: 84s; animation-delay: -20s;
}
.aurora .f4 { /* deep violet under the right half */
  width: 64vmax; height: 64vmax; right: -8vmax; bottom: -40vmax;
  background: radial-gradient(closest-side, rgb(120 70 200 / .5), rgb(84 62 168 / .16) 60%, rgb(84 62 168 / 0));
  --dx: -10vmax; --dy: -6vmax; --s: 1.06;
  animation-duration: 104s; animation-delay: -64s;
}
/* The curtain: a long tilted band of violet-to-teal light across the sky, swaying slowly */
.aurora .f5 {
  width: 150vmax; height: 26vmax; left: -25vmax; top: 18vh; border-radius: 50%;
  background: linear-gradient(90deg, rgb(99 201 242 / 0), rgb(99 201 242 / .14) 22%, rgb(142 123 234 / .3) 50%,
              rgb(196 110 220 / .16) 76%, rgb(196 110 220 / 0));
  filter: blur(40px);
  transform: rotate(-14deg);
  animation: sway 132s var(--ease) infinite alternate; animation-delay: -30s;
}
@keyframes sway {
  from { transform: rotate(-14deg) translate3d(-6vmax, 0, 0) scaleY(.9); }
  to   { transform: rotate(-8deg) translate3d(6vmax, 4vmax, 0) scaleY(1.15); }
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(var(--dx), var(--dy), 0) scale(var(--s)); }
}

/* ---------- Glass ---------- */
.topbar, .panel, .table-wrap, .log-list, .form-panel, .login-card, .sched {
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: var(--r-2);
  box-shadow: var(--edge-light), var(--shadow-glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
/* Repeated cards and tiles: the same glass without a backdrop blur (the aurora behind is already soft) */
.screen-card, .tile, .role-tile, .person-tile {
  background: rgb(255 255 255 / .065);
  border: 1px solid var(--edge);
  border-radius: var(--r-2);
  box-shadow: var(--edge-light), var(--shadow-glass);
  transition: transform var(--t-med) var(--ease), background-color var(--t-med) var(--ease),
              border-color var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.screen-card:hover, a.tile:hover, button.tile:hover, .role-tile:hover, .person-tile:hover {
  transform: translateY(-2px);
  background: rgb(255 255 255 / .095);
  border-color: var(--edge-hi);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), var(--shadow-lift);
}

/* Entrance: things rise in once, staggered within 240 ms */
.rise { animation: rise var(--t-slow) var(--ease) both; animation-delay: min(calc(var(--i, 0) * 30ms), 240ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1030;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 28px;
  padding: 0 24px;
  border-radius: 0;
  border-width: 0 0 1px;
  background: rgb(14 17 34 / .55);
}
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 30px; width: auto; display: block; }
.topnav { display: flex; align-items: stretch; align-self: stretch; gap: 2px; }
.topnav a {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  color: var(--ink-2); font-weight: 500; font-size: var(--fs-14); text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
.topnav a .fas { font-size: 13px; opacity: .8; }
.topnav a:hover { color: var(--ink); }
.topnav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: var(--violet-hi); border-radius: 2px 2px 0 0;
  transform: scaleX(0); transition: transform var(--t-med) var(--ease);
}
.topnav a.is-active { color: var(--ink); }
.topnav a.is-active::after { transform: scaleX(1); }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.person-btn {
  display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 8px 0 4px;
  border: 0; background: transparent; border-radius: 12px;
  color: var(--ink); font: 500 var(--fs-14)/1 var(--font);
  transition: background-color var(--t-fast) var(--ease);
}
.person-btn:hover, .person-btn[aria-expanded="true"] { background: var(--row-hover); }
.person-btn .fa-chevron-down { font-size: 10px; color: var(--ink-3); transition: transform var(--t-med) var(--ease); }
.person-btn[aria-expanded="true"] .fa-chevron-down { transform: rotate(180deg); }
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(rgb(142 123 234 / .38), rgb(100 82 163 / .38));
  color: #fff; border: 1px solid rgb(255 255 255 / .18);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .18);
  font-size: var(--fs-12); font-weight: 600; letter-spacing: .02em;
  overflow: hidden; position: relative;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 76px; height: 76px; font-size: var(--fs-23); }
.avatar--md { width: 44px; height: 44px; font-size: var(--fs-14); }
.person-menu { min-width: 230px; }
.person-menu .who { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; }
.person-menu .who strong { display: block; font-weight: 600; color: var(--ink); }
.person-menu .who span.sub { display: block; font-size: var(--fs-12); color: var(--ink-3); }
.nav-toggle {
  display: none; width: 42px; height: 42px; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink); font-size: 16px;
  transition: background-color var(--t-fast) var(--ease);
}
.nav-toggle:hover { background: var(--row-hover); }

/* ---------- Buttons ---------- */
.btn {
  --bs-btn-padding-x: 16px; --bs-btn-padding-y: 0;
  --bs-btn-font-family: var(--font); --bs-btn-font-size: var(--fs-14); --bs-btn-font-weight: 500; --bs-btn-line-height: 1;
  --bs-btn-border-radius: 10px; --bs-btn-box-shadow: none; --bs-btn-focus-box-shadow: none; --bs-btn-disabled-opacity: .45;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--violet-hi); outline-offset: 2px; box-shadow: none; }
.btn .fas, .btn .far { font-size: 13px; width: 14px; text-align: center; }
.btn-sm { --bs-btn-padding-x: 12px; --bs-btn-font-size: var(--fs-13); height: 34px; gap: 6px; }
.btn-primary {
  --bs-btn-bg: var(--violet-fill); --bs-btn-color: #fff; --bs-btn-border-color: rgb(255 255 255 / .16);
  --bs-btn-hover-bg: var(--violet-fill-hi); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: rgb(255 255 255 / .24);
  --bs-btn-active-bg: var(--violet-fill-hi); --bs-btn-active-color: #fff; --bs-btn-active-border-color: rgb(255 255 255 / .24);
  --bs-btn-disabled-bg: var(--violet-fill); --bs-btn-disabled-color: #fff; --bs-btn-disabled-border-color: transparent;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), 0 10px 24px -12px rgb(100 82 163 / .9);
}
.btn-secondary, .btn-outline-secondary, .btn-light {
  --bs-btn-bg: rgb(255 255 255 / .07); --bs-btn-color: var(--ink); --bs-btn-border-color: var(--edge);
  --bs-btn-hover-bg: rgb(255 255 255 / .12); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--edge-hi);
  --bs-btn-active-bg: rgb(255 255 255 / .12); --bs-btn-active-color: var(--ink); --bs-btn-active-border-color: var(--edge-hi);
  --bs-btn-disabled-bg: rgb(255 255 255 / .05); --bs-btn-disabled-color: var(--ink-3); --bs-btn-disabled-border-color: var(--hair);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .1);
}
.btn-quiet, .btn-link {
  --bs-btn-bg: transparent; --bs-btn-color: var(--ink-2); --bs-btn-border-color: transparent;
  --bs-btn-hover-bg: var(--row-hover); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: transparent;
  --bs-btn-active-bg: var(--row-hover); --bs-btn-active-color: var(--ink); --bs-btn-active-border-color: transparent;
  --bs-btn-disabled-color: var(--ink-3); --bs-btn-disabled-border-color: transparent;
  text-decoration: none;
}
.btn-danger, .btn-outline-danger {
  --bs-btn-bg: transparent; --bs-btn-color: var(--bad); --bs-btn-border-color: transparent;
  --bs-btn-hover-bg: var(--bad-wash); --bs-btn-hover-color: var(--bad); --bs-btn-hover-border-color: transparent;
  --bs-btn-active-bg: var(--bad-wash); --bs-btn-active-color: var(--bad); --bs-btn-active-border-color: transparent;
}
.btn.is-unavailable { --bs-btn-color: var(--ink-3); }

/* Icon buttons: 40px targets, named by tooltip and aria-label */
.icon-btn {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 12px; background: transparent;
  color: var(--ink-2); font-size: 15px;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.icon-btn:hover { background: rgb(255 255 255 / .09); color: var(--ink); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn.is-unavailable { color: rgb(242 243 247 / .38); }
.icon-btn.is-unavailable:hover { color: var(--ink-3); }
.icon-btn .badge-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--violet-hi); box-shadow: 0 0 0 2px rgb(20 24 46); }

/* ---------- Status circles ---------- */
.state { display: inline-flex; align-items: center; gap: 7px; flex: none; color: var(--ink-2); font-size: var(--fs-12); font-weight: 500; line-height: 1; white-space: nowrap; }
.dot { position: relative; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--idle)); flex: none; }
.dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--c, var(--idle)); opacity: 0; }
.state--online { --c: var(--ok); }
.state--online .dot::after { animation: ring 2.4s cubic-bezier(.2, .6, .3, 1) infinite; }
.state--sleep { --c: var(--idle); }
.state--sleep .dot { animation: breath 4.8s ease-in-out infinite; }
.state--offline { --c: var(--bad); }
.state--setup { --c: var(--setup); }
.state--setup .dot { background: transparent; box-shadow: inset 0 0 0 2px var(--setup); }
.state--setup .dot::after { background: transparent; box-shadow: inset 0 0 0 2px var(--setup); animation: ring 3.2s cubic-bezier(.2, .6, .3, 1) infinite; }
.state--fault { --c: var(--warn); }
.state--fault .dot { animation: blink2 2.4s linear infinite; }
.state--online .dot-word { color: var(--ok); }
.state--offline .dot-word { color: var(--bad); }
.state--fault .dot-word { color: var(--warn); }
.state--setup .dot-word { color: var(--setup); }
.state--lg .dot { width: 11px; height: 11px; }
.state--lg { font-size: var(--fs-13); }
@keyframes ring { 0% { transform: scale(1); opacity: .6; } 80%, 100% { transform: scale(2.8); opacity: 0; } }
@keyframes breath { 50% { opacity: .45; } }
@keyframes blink2 { 0%, 16%, 32%, 100% { opacity: 1; } 8%, 24% { opacity: .2; } }

/* ---------- Chips (counts, states, small facts) ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; max-width: 100%;
  border-radius: 8px; background: rgb(255 255 255 / .07); border: 1px solid rgb(255 255 255 / .06);
  color: var(--ink-2); font-size: var(--fs-12); font-weight: 500; line-height: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums;
}
.tag > span { overflow: hidden; text-overflow: ellipsis; }
.tag .fas, .tag .far, .tag .fab { font-size: 11px; opacity: .85; flex: none; }
.tag--ok { color: var(--ok); background: var(--ok-wash); }
.tag--warn { color: var(--warn); background: var(--warn-wash); }
.tag--bad { color: var(--bad); background: var(--bad-wash); }
.tag--violet { color: #B9ABFF; background: var(--violet-wash); }
.tag .swatch { width: 8px; height: 8px; border-radius: 2px; background: var(--chip, var(--idle)); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .3); flex: none; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px;
  border-radius: 999px; background: rgb(255 255 255 / .07); border: 1px solid var(--edge);
  font-size: var(--fs-13); font-weight: 500; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.pill strong { color: var(--ink); font-weight: 600; }

/* ---------- Picture frames ---------- */
.frame {
  position: relative; display: block; flex: none;
  aspect-ratio: 16 / 9;
  background: var(--well);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08);
}
.frame > img, .frame > video { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame.is-off > img { filter: grayscale(1) brightness(.62) contrast(.92); }
.frame-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--ink-3); font-size: var(--fs-12); padding: 8px; }
.frame-empty .fas { display: block; font-size: 18px; margin: 0 auto 6px; opacity: .7; }

/* ---------- Panels ---------- */
.panel { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.panel-head { flex: none; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 16px 0 18px; border-bottom: 1px solid var(--hair); }
.panel-head h2 { font-size: var(--fs-16); font-weight: 600; margin: 0; line-height: 1.2; }
.panel-head .count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: rgb(255 255 255 / .08); font-size: var(--fs-12); font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.panel-head .head-end { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.panel-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.panel-foot { flex: none; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; border-top: 1px solid var(--hair); border-radius: 0 0 var(--r-2) var(--r-2); }
.panel-foot .btn-primary { margin-left: auto; }
.empty { padding: 28px 18px; color: var(--ink-3); font-size: var(--fs-13); line-height: 1.5; text-align: center; }
.empty .fas { display: block; font-size: 22px; margin: 0 auto 10px; color: rgb(255 255 255 / .3); }
.empty strong { display: block; color: var(--ink-2); font-weight: 500; margin-bottom: 2px; }

#progressContainer { min-width: 0; flex: 1; font-size: var(--fs-12); color: var(--ink-3); font-variant-numeric: tabular-nums; }
#progressContainer progress {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 4px; border: 0; border-radius: 4px;
  margin: 0 0 4px; background: rgb(255 255 255 / .1); overflow: hidden;
}
#progressContainer progress::-webkit-progress-bar { background: rgb(255 255 255 / .1); }
#progressContainer progress::-webkit-progress-value { background: var(--violet-hi); }
#progressContainer progress::-moz-progress-bar { background: var(--violet-hi); }

/* ---------- Overview: three glass columns ---------- */
body.is-bench { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.bench { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1.12fr); gap: 16px; padding: 16px 24px 24px; }
.bench-tabs { display: none; }

.media-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 14px;
  transition: background-color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.media-item + .media-item { box-shadow: inset 0 1px 0 var(--hair); }
.dragFrom .media-item { cursor: grab; }
.dragFrom .media-item:hover, .playlist-content .media-item:hover { background: var(--row-hover); }
.thumb {
  flex: none; position: relative; width: 96px; height: 54px; border-radius: 8px;
  background: var(--well); overflow: hidden; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb > .fas { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: 14px; }
.thumb.is-missing::after { content: "Missing"; position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--fs-12); font-weight: 500; color: var(--bad); background: var(--bad-wash); }
.media-info { flex: 1; min-width: 0; }
.media-title { display: block; font-weight: 500; font-size: var(--fs-14); line-height: 1.35; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 5px; font-size: var(--fs-12); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.media-item .edit-btn, .row-btn {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-3);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.media-item .edit-btn:hover, .row-btn:hover, .row-btn[aria-expanded="true"] { background: rgb(255 255 255 / .09); color: var(--ink); }
.media-item .edit-btn .fas, .row-btn .fas { font-size: 13px; }

/* Playlists */
.dragTo { display: grid; grid-template-rows: auto 1fr; box-shadow: inset 0 -1px 0 var(--hair); transition: grid-template-rows var(--t-med) var(--ease), background-color var(--t-fast) var(--ease); }
.dragTo.collapsed { grid-template-rows: auto 0fr; }
.playlist-header { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 10px 8px 14px; cursor: pointer; user-select: none; transition: background-color var(--t-fast) var(--ease); }
.playlist-header:hover { background: var(--row-hover); }
.dragTo:has(input[name="playlist-choose"]:checked) { background: var(--violet-wash); }
.dragTo:has(input[name="playlist-choose"]:checked) > .playlist-header:hover { background: transparent; }
.stack { display: flex; flex: none; width: 74px; }
.stack img, .stack .blank { width: 44px; height: 25px; border-radius: 6px; object-fit: cover; flex: none; background: var(--well); box-shadow: 0 0 0 2px rgb(24 27 52), 0 4px 10px -4px rgb(0 0 0 / .6); }
.stack > * + * { margin-left: -29px; }
.stack > :nth-child(1) { position: relative; z-index: 3; }
.stack > :nth-child(2) { position: relative; z-index: 2; transform: translateY(-3px) scale(.92); }
.stack > :nth-child(3) { position: relative; z-index: 1; transform: translateY(-6px) scale(.84); }
.stack .blank { display: grid; place-items: center; color: var(--ink-3); font-size: 11px; }
.chip { flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--chip, var(--idle)); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .35); }
.pl-text { flex: 1; min-width: 0; }
.playlist-title { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.dragTo > .playlist-header > .playlist-title { flex: 1; min-width: 0; }
.pl-meta { display: flex; gap: 6px; margin-top: 5px; font-size: var(--fs-12); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.toggle-btn { flex: none; width: 30px; height: 30px; display: grid; place-items: center; font-size: 0; color: var(--ink-3); border-radius: 10px; transition: transform var(--t-med) var(--ease), color var(--t-fast) var(--ease); }
.toggle-btn::before { font-family: "Font Awesome 6 Free"; font-weight: 900; content: "\f078"; font-size: 11px; }
.dragTo:not(.collapsed) .toggle-btn { transform: rotate(180deg); color: var(--ink); }
.playlist-content { min-height: 0; overflow: hidden; counter-reset: pl; background: rgb(0 0 0 / .14); }
.dragTo.collapsed .playlist-content { visibility: hidden; transition: visibility 0s linear var(--t-med); }
.dragTo:not(.collapsed) .playlist-content { visibility: visible; }
.playlist-content > .media-item { counter-increment: pl; padding-left: 12px; cursor: grab; }
.playlist-content > .media-item::before { content: counter(pl); flex: none; width: 18px; text-align: right; font-size: var(--fs-12); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.playlist-content .thumb { width: 64px; height: 36px; }
.playlist-content:not(:has(.media-item)):not(:has(.placeholder))::after {
  content: "\f0c5  Drop content here"; display: block; margin: 10px 14px 12px; padding: 14px; border-radius: 10px;
  border: 1px dashed rgb(255 255 255 / .18); text-align: center; font-size: var(--fs-13); color: var(--ink-3);
  font-family: "Font Awesome 6 Free", var(--font); font-weight: 400;
}
.dragTo.drag-hover { background: var(--violet-wash) !important; box-shadow: inset 0 0 0 1px var(--violet-hi); }
.playlist-content .placeholder, p.placeholder {
  display: block !important; opacity: 1 !important; cursor: grabbing !important;
  background: var(--violet-wash) !important; border: 1px dashed var(--violet-hi) !important;
  border-radius: 10px; margin: 4px 12px !important; min-height: 0; vertical-align: initial;
}
.drag-ghost { background: rgb(28 32 62 / .92) !important; border-radius: 12px !important; box-shadow: var(--shadow-lift) !important; outline: 1px solid var(--edge-hi); opacity: .96 !important; cursor: grabbing; }
.playlist-item.dragging { opacity: .35 !important; }

/* Drawn radio and tick */
.circle-choice, .circle-checkbox { position: relative; flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin: 0; cursor: pointer; }
.circle-choice input, .circle-checkbox input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.circle-choice .checkmark, .circle-checkbox .checkmark {
  width: 20px; height: 20px; display: grid; place-items: center;
  background: rgb(255 255 255 / .05); border: 1.5px solid rgb(255 255 255 / .3);
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.circle-choice .checkmark { border-radius: 50%; }
.circle-checkbox .checkmark { border-radius: 6px; }
.circle-choice .checkmark::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--violet-hi); transform: scale(0); transition: transform var(--t-fast) var(--ease); }
.circle-checkbox .checkmark::after { content: ""; width: 5px; height: 10px; margin-top: -2px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform var(--t-fast) var(--ease); }
.circle-choice:hover .checkmark, .circle-checkbox:hover .checkmark { border-color: rgb(255 255 255 / .55); }
.circle-choice input:checked + .checkmark { border-color: var(--violet-hi); }
.circle-choice input:checked + .checkmark::after { transform: scale(1); }
.circle-checkbox input:checked + .checkmark { background: var(--violet-fill); border-color: var(--violet-hi); }
.circle-checkbox input:checked + .checkmark::after { transform: rotate(45deg) scale(1); }
.circle-choice input:focus-visible + .checkmark, .circle-checkbox input:focus-visible + .checkmark { outline: 2px solid var(--violet-hi); outline-offset: 2px; }

/* Screens on the workbench */
.device-item { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 12px; box-shadow: inset 0 -1px 0 var(--hair); transition: background-color var(--t-fast) var(--ease); }
.device-item:hover { background: var(--row-hover); }
.device-item:has(.device-checkbox:checked) { background: var(--violet-wash); }
.device-item .frame { width: 80px; border-radius: 8px; }
.device-item .media-title { font-weight: 500; }
.publish-plan { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink-3); font-size: var(--fs-13); }
.publish-plan .fa-arrow-right { font-size: 11px; opacity: .7; }

/* ---------- Pages ---------- */
.page { max-width: 1400px; margin: 0 auto; padding: 28px 24px 56px; }
.page--narrow { max-width: 960px; }
.page--form { max-width: 780px; }
.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 22px; }
.page-head h1 { font-size: var(--fs-23); font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
.page-head .count { display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding: 0 8px; border-radius: 999px; background: rgb(255 255 255 / .08); font-size: var(--fs-13); font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.page-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-13); color: var(--ink-3); text-decoration: none; margin-bottom: 10px; }
.back-link:hover { color: var(--ink); }
.section-title { display: flex; align-items: center; gap: 10px; font-size: var(--fs-16); font-weight: 600; margin: 32px 0 14px; }

/* Screens page */
.fleet { display: flex; flex-wrap: wrap; gap: 8px; }
.screen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.screen-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.shot { position: relative; aspect-ratio: 16 / 9; background: var(--well); overflow: hidden; margin: 6px 6px 0; border-radius: 12px; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08); }
.shot > img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--t-slow) var(--ease); }
.screen-card:hover .shot > img { transform: scale(1.025); }
.shot.is-off > img { filter: grayscale(1) brightness(.6) contrast(.92); }
.shot-scrim {
  position: absolute; inset: auto 0 0 0; display: flex; align-items: center; gap: 10px;
  padding: 36px 14px 12px;
  background: linear-gradient(to top, rgb(8 10 22 / .86), rgb(8 10 22 / .5) 55%, rgb(8 10 22 / 0));
}
.shot-scrim h2 { flex: 1; min-width: 0; margin: 0; font-size: var(--fs-16); font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; text-shadow: 0 1px 2px rgb(0 0 0 / .4); }
.shot-scrim .state { color: rgb(255 255 255 / .85); }
.shot-note { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 8px; background: rgb(8 10 22 / .62); color: rgb(255 255 255 / .82); font-size: var(--fs-12); font-weight: 500; }
.screen-body { padding: 12px 14px 4px; flex: 1; min-width: 0; }
.screen-meta { display: flex; gap: 4px 14px; flex-wrap: wrap; margin: 10px 0 0; font-size: var(--fs-12); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.screen-meta .fas { font-size: 10px; margin-right: 5px; opacity: .8; }
.screen-actions { display: flex; align-items: center; justify-content: space-between; gap: 2px; padding: 6px 8px 8px; margin-top: 6px; border-top: 1px solid var(--hair); }

/* Library page: a picture grid (no glass blur per tile) */
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px 18px; }
.content-card { position: relative; min-width: 0; }
.content-card .frame { border-radius: 14px; cursor: pointer; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .1), 0 18px 40px -22px rgb(0 0 0 / .8); transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease); }
.content-card:hover .frame { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .2), 0 26px 50px -22px rgb(0 0 0 / .9); }
.on-pic { position: absolute; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 8px; background: rgb(8 10 22 / .66); color: #fff; font-size: var(--fs-12); font-weight: 500; font-variant-numeric: tabular-nums; pointer-events: none; }
.on-pic.type { left: 8px; top: 8px; width: 26px; padding: 0; justify-content: center; }
.on-pic.type .fas { font-size: 11px; }
.on-pic.len { right: 8px; bottom: 8px; }
.on-pic.facts { left: 8px; bottom: 8px; opacity: 0; transform: translateY(4px); transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease); }
.content-card:hover .on-pic.facts, .content-card:focus-within .on-pic.facts { opacity: 1; transform: none; }
.on-pic.missing { left: 8px; bottom: 8px; color: #FFB3AA; }
.content-card .card-title { display: flex; align-items: center; gap: 4px; margin-top: 10px; min-width: 0; }
.content-card .media-title { flex: 1; font-size: var(--fs-14); padding-left: 2px; }
.content-card .full-edit-btn { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; border-radius: 10px; background: rgb(8 10 22 / .66); color: #fff; opacity: 0; transform: translateY(-3px); transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease), background-color var(--t-fast) var(--ease); }
.content-card .full-edit-btn:hover { background: var(--violet-fill); }
.content-card:hover .full-edit-btn, .content-card:focus-within .full-edit-btn, .content-card .full-edit-btn:focus-visible { opacity: 1; transform: none; }
@media (hover: none) and (pointer: coarse) { .content-card .full-edit-btn, .on-pic.facts { opacity: 1; transform: none; } }

/* Tiles (Settings, Account) */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 22px;
  min-height: 188px; padding: 22px; color: var(--ink); text-decoration: none; text-align: left; overflow: hidden;
  --hue: var(--violet-hi);
}
a.tile, button.tile { cursor: pointer; font: inherit; }
.tile:hover { color: var(--ink); }
.tile-icon {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px;
  background: color-mix(in srgb, var(--hue) 16%, rgb(255 255 255 / .06));
  border: 1px solid color-mix(in srgb, var(--hue) 34%, rgb(255 255 255 / .1));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .16);
  color: var(--hue); font-size: 26px;
}
/* each tile carries a faint glow of its own colour in the corner */
.tile::before { content: ""; position: absolute; width: 180px; height: 180px; right: -70px; top: -80px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--hue) 30%, transparent), transparent); pointer-events: none;
  transition: transform var(--t-slow) var(--ease), opacity var(--t-slow) var(--ease); opacity: .7; }
a.tile:hover::before, button.tile:hover::before { transform: scale(1.15); opacity: 1; }
.tile-name { font-size: 18px; font-weight: 600; line-height: 1.25; }
.tile-sub { display: block; margin-top: 4px; font-size: var(--fs-12); color: var(--ink-3); font-weight: 500; }
.tile .tile-go { position: absolute; right: 16px; top: 18px; color: var(--ink-3); font-size: 12px; opacity: 0; transform: translateX(-4px); transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease); }
a.tile:hover .tile-go, button.tile:hover .tile-go { opacity: 1; transform: none; }
.hue-violet { --hue: #9C8CF0; } .hue-cyan { --hue: #63C9F2; } .hue-amber { --hue: #F2B84B; } .hue-rose { --hue: #F28CB0; }
.hue-indigo { --hue: #8B98FF; } .hue-teal { --hue: #4FD1C5; } .hue-slate { --hue: #B4BDD6; } .hue-green { --hue: #3DDC97; }

/* Roles */
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.role-tile { display: flex; flex-direction: column; gap: 16px; padding: 18px; min-height: 150px; }
.role-tile .role-top { display: flex; align-items: flex-start; gap: 12px; }
.role-tile h2 { font-size: var(--fs-16); font-weight: 600; margin: 2px 0 0; line-height: 1.3; overflow-wrap: anywhere; }
.role-tile .tags { margin-top: auto; }
.role-tile .role-actions { display: flex; gap: 2px; margin-left: auto; margin-top: -6px; margin-right: -6px; }
.role-tile .open-abilities { all: unset; cursor: pointer; display: contents; }
.ability-chips { display: flex; flex-wrap: wrap; gap: 6px; text-align: left; }
.ability-group { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.ability-group legend { font-size: var(--fs-13); font-weight: 600; color: var(--ink); margin: 0 0 10px; padding: 0; float: none; width: auto; }
.ability-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.ability-grid label {
  display: flex; align-items: center; gap: 10px; font-size: var(--fs-14); color: var(--ink); cursor: pointer;
  padding: 8px 10px; border-radius: 10px; background: rgb(255 255 255 / .04); border: 1px solid var(--hair);
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.ability-grid label:hover { background: rgb(255 255 255 / .07); }
.ability-grid label:has(input:checked) { background: var(--violet-wash); border-color: rgb(142 123 234 / .4); }

/* People */
.people { list-style: none; margin: 0; padding: 4px 0; }
.people li { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 18px; box-shadow: inset 0 -1px 0 var(--hair); transition: background-color var(--t-fast) var(--ease); }
.people li:last-child { box-shadow: none; }
.people li:hover { background: var(--row-hover); }
.people .who { flex: 1; min-width: 0; }
.people .who strong { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.people .who span { display: block; font-size: var(--fs-12); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.people .col-role { width: 190px; flex: none; display: flex; flex-wrap: wrap; gap: 4px; }
.people .col-state { width: 96px; flex: none; }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; box-shadow: 0 0 0 2px rgb(22 26 50); }
.avatar-wrap { position: relative; flex: none; display: inline-grid; }
.avatar-wrap .state { position: absolute; right: -2px; bottom: -2px; }
.avatar-wrap .state .dot { box-shadow: 0 0 0 2.5px rgb(24 28 54); }
.person-tile { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 14px 16px; text-align: center; min-width: 0; }
.person-tile strong { display: block; max-width: 100%; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-tile .status { font-size: var(--fs-12); font-weight: 500; color: var(--ink-3); }
.person-tile .status.text-success { color: var(--ok) !important; }
.person-tile .status.text-warning { color: var(--warn) !important; }
.person-tile .status.text-muted, .person-tile .status.text-danger { color: var(--ink-3) !important; }
.person-tile .status::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.profile-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 26px; }
.profile-hero h1 { font-size: var(--fs-23); font-weight: 600; margin: 0 0 8px; }
.photo-pick { position: relative; flex: none; border-radius: 50%; cursor: pointer; }
.photo-pick .avatar, .photo-pick > img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; display: grid; }
.photo-pick > img { border: 1px solid rgb(255 255 255 / .18); }
.photo-pick .photo-cue { position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgb(28 32 62); color: var(--ink-2); border: 1px solid var(--edge-hi); font-size: 11px; transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.photo-pick:hover .photo-cue { color: var(--violet-hi); border-color: var(--violet-hi); }
.photo-pick .photo-blank { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; background: rgb(255 255 255 / .06); color: var(--ink-3); border: 1px dashed rgb(255 255 255 / .25); font-size: 20px; }
.photo-pick img.is-set + .photo-blank { display: none; }
.fact-tile { display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: 14px; padding: 16px 18px; min-height: 0; min-width: 0; }
.fact-tile::before { display: none; }
.fact-tile .tile-icon { width: 40px; height: 40px; font-size: 16px; border-radius: 12px; }
.fact-tile .fact { min-width: 0; }
.fact-tile .fact span { display: block; font-size: var(--fs-12); color: var(--ink-3); }
.fact-tile .fact strong { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Forms */
.form-panel { padding: 24px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.field-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.form-label, .field > label, .field-label { display: block; margin: 0 0 6px; font-size: var(--fs-13); font-weight: 500; color: var(--ink-2); }
.field-error, .errorlist { margin: 6px 0 0; padding: 0; list-style: none; font-size: var(--fs-12); color: var(--bad); }
.form-control, .form-select {
  height: 40px; padding: 0 12px; font-family: var(--font); font-size: var(--fs-14); color: var(--ink);
  background-color: var(--field); border: 1px solid var(--field-line); border-radius: 10px; box-shadow: none;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
textarea.form-control { height: auto; min-height: 80px; padding: 10px 12px; }
input[type="file"].form-control { padding: 0; line-height: 38px; }
input[type="file"].form-control::file-selector-button { height: 38px; margin: 0 12px 0 0; padding: 0 14px; border: 0; border-right: 1px solid var(--field-line); background: rgb(255 255 255 / .08); color: var(--ink); font: 500 var(--fs-13) var(--font); }
.form-control::placeholder { color: rgb(242 243 247 / .42); opacity: 1; }
.form-control:hover, .form-select:hover { border-color: rgb(255 255 255 / .28); }
.form-control:focus, .form-select:focus { color: var(--ink); background-color: rgb(255 255 255 / .09); border-color: var(--violet-hi); box-shadow: 0 0 0 3px rgb(142 123 234 / .22); outline: none; }
.form-control:disabled, .form-control[readonly], .form-select:disabled { background-color: rgb(255 255 255 / .03); color: var(--ink-2); border-color: var(--hair); opacity: 1; }
.form-select { padding-right: 34px; --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23B9BCC8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='m3 6 5 5 5-5'/%3e%3c/svg%3e"); background-position: right 12px center; background-size: 14px 14px; }
.form-select option { background: #161a33; color: var(--ink); }
.form-check { min-height: 0; margin-bottom: 0; }
.form-check-label { color: var(--ink); cursor: pointer; }
.form-check-input { width: 17px; height: 17px; margin-top: 0; background-color: rgb(255 255 255 / .06); border: 1.5px solid rgb(255 255 255 / .3); cursor: pointer; transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background-position var(--t-med) var(--ease); }
.form-check-input[type="checkbox"] { border-radius: 5px; }
.form-check-input:checked { background-color: var(--violet-fill); border-color: var(--violet-hi); }
.form-check-input:focus { border-color: var(--violet-hi); box-shadow: none; }
.form-check-input:focus-visible { outline: 2px solid var(--violet-hi); outline-offset: 2px; }
.form-switch .form-check-input { width: 38px; height: 22px; margin-left: 0; border-radius: 22px; --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23B9BCC8'/%3e%3c/svg%3e"); }
.form-switch .form-check-input:focus { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23B9BCC8'/%3e%3c/svg%3e"); }
.form-switch .form-check-input:checked { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e"); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; }
.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.slider { position: absolute; inset: 0; cursor: pointer; border-radius: 22px; background: rgb(255 255 255 / .16); transition: background-color var(--t-fast) var(--ease); }
.slider::before { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .35); transition: transform var(--t-med) var(--ease); }
.switch input:checked + .slider { background: var(--violet-fill-hi); }
.switch input:checked + .slider::before { transform: translateX(16px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--violet-hi); outline-offset: 2px; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); }
.data-table th { text-align: left; font-size: var(--fs-12); font-weight: 500; color: var(--ink-3); padding: 14px 18px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.data-table td { padding: 12px 18px; border-bottom: 1px solid var(--hair); vertical-align: middle; color: var(--ink); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background-color var(--t-fast) var(--ease); }
.data-table tbody tr:hover { background: var(--row-hover); }
.data-table .td-actions { width: 56px; text-align: right; }
.person-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-cell > div > strong { display: block; font-weight: 500; }
.person-cell > div > span { display: block; font-size: var(--fs-12); color: var(--ink-3); }

/* ---------- Dropdowns and the right-click menu (glass, move both ways) ---------- */
.dropdown-menu {
  --bs-dropdown-bg: var(--glass-solid); --bs-dropdown-color: var(--ink); --bs-dropdown-border-color: var(--edge);
  --bs-dropdown-border-radius: 14px; --bs-dropdown-inner-border-radius: 14px; --bs-dropdown-padding-y: 6px;
  --bs-dropdown-font-size: var(--fs-14); --bs-dropdown-link-color: var(--ink); --bs-dropdown-link-hover-color: var(--ink);
  --bs-dropdown-link-hover-bg: rgb(255 255 255 / .08); --bs-dropdown-link-active-color: var(--ink); --bs-dropdown-link-active-bg: var(--violet-wash);
  --bs-dropdown-link-disabled-color: var(--ink-3); --bs-dropdown-item-padding-x: 12px; --bs-dropdown-item-padding-y: 9px;
  --bs-dropdown-divider-bg: var(--hair); --bs-dropdown-divider-margin-y: 6px; --bs-dropdown-header-color: var(--ink-3);
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--edge-light), var(--shadow-lift);
  min-width: 190px; padding: 6px;
  opacity: 0; translate: 0 -4px; scale: .98;
  transition: opacity var(--t-fast) var(--ease), translate var(--t-fast) var(--ease), scale var(--t-fast) var(--ease), display var(--t-fast) allow-discrete;
}
.dropdown-menu:not(.show) { top: 100%; margin-top: 2px; }
.dropdown-menu:not(.show):not(.dropdown-menu-end) { left: 0; }
.dropdown-menu-end:not(.show) { right: 0; }
.dropdown-menu.show { opacity: 1; translate: 0 0; scale: 1; }
@starting-style { .dropdown-menu.show { opacity: 0; translate: 0 -4px; scale: .98; } }
.dropdown-item { display: flex; align-items: center; gap: 10px; border-radius: 9px; font-weight: 400; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
button.dropdown-item { border: 0; background: transparent; width: 100%; text-align: left; }
.dropdown-item .fas { width: 15px; text-align: center; font-size: 13px; color: var(--ink-3); }
.dropdown-item.is-danger, .dropdown-item.text-danger { color: var(--bad) !important; }
.dropdown-item.is-danger .fas, .dropdown-item.text-danger .fas { color: var(--bad); }
.dropdown-item.is-unavailable { color: var(--ink-3); }
.dropdown-item.disabled, .dropdown-item:disabled { color: var(--ink-3); }
#custom-context-menu {
  min-width: 190px; padding: 6px;
  background: var(--glass-solid); border: 1px solid var(--edge); border-radius: 14px;
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--edge-light), var(--shadow-lift);
  opacity: 1; translate: 0 0;
  transition: opacity var(--t-fast) var(--ease), translate var(--t-fast) var(--ease), display var(--t-fast) allow-discrete;
}
#custom-context-menu[style*="display: none"] { opacity: 0; translate: 0 -4px; }
@starting-style { #custom-context-menu { opacity: 0; translate: 0 -4px; } }
#contextMenuList { list-style: none; margin: 0; padding: 0; }
#contextMenuList .ctx-action { padding: 9px 12px !important; border-radius: 9px; font-size: var(--fs-14); color: var(--ink) !important; cursor: pointer; transition: background-color var(--t-fast) var(--ease); }
#contextMenuList .ctx-action:hover { background: rgb(255 255 255 / .08); }
#contextMenuList .ctx-action[data-action="delete"] { color: var(--bad) !important; }
#contextMenuList .ctx-action[data-action="delete"]:hover { background: var(--bad-wash); }
#contextMenuList .ctx-action[data-action="device-reboot"] { color: var(--ink) !important; }
.tooltip { --bs-tooltip-bg: rgb(20 24 46 / .96); --bs-tooltip-color: var(--ink); --bs-tooltip-font-size: var(--fs-12); --bs-tooltip-border-radius: 8px; --bs-tooltip-padding-x: 9px; --bs-tooltip-padding-y: 6px; --bs-tooltip-max-width: 260px; --bs-tooltip-opacity: 1; }
.tooltip-inner { border: 1px solid var(--edge); box-shadow: 0 10px 24px -10px rgb(0 0 0 / .7); text-align: left; }

/* ---------- Bootstrap modal (content edit, new role) ---------- */
.modal {
  --bs-modal-bg: var(--glass-solid); --bs-modal-color: var(--ink); --bs-modal-border-color: var(--edge);
  --bs-modal-border-radius: var(--r-3); --bs-modal-inner-border-radius: var(--r-3); --bs-modal-box-shadow: var(--shadow-lift);
  --bs-modal-header-border-color: var(--hair); --bs-modal-footer-border-color: var(--hair);
  --bs-modal-header-padding: 16px 22px; --bs-modal-padding: 22px; --bs-modal-title-line-height: 1.3;
}
.modal-content { -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%); box-shadow: var(--edge-light), var(--shadow-lift); }
.modal-content > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.modal-dialog-scrollable .modal-content > form { overflow: hidden; }
.modal-dialog-scrollable .modal-content > form > .modal-body { overflow-y: auto; }
.modal-title { font-size: var(--fs-16); font-weight: 600; }
.modal.fade .modal-dialog { transform: translateY(10px) scale(.97); opacity: 0; transition: transform var(--t-med) var(--ease), opacity var(--t-med) var(--ease); }
.modal.show .modal-dialog { transform: none; opacity: 1; }
.modal-backdrop { --bs-backdrop-bg: #05060d; --bs-backdrop-opacity: .5; }
.btn-close { width: 34px; height: 34px; padding: 0; border-radius: 10px; background-size: 12px; opacity: .7; filter: invert(1) grayscale(1) brightness(1.6); transition: opacity var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.btn-close:hover { opacity: 1; background-color: rgb(0 0 0 / .12); }
.btn-close:focus { box-shadow: none; }
.btn-close:focus-visible { outline: 2px solid var(--violet-hi); outline-offset: 2px; }
.edit-preview { margin-bottom: 20px; }
.edit-preview .frame { max-width: 680px; margin: 0 auto; border-radius: 14px; }
.edit-preview .frame > img, .edit-preview .frame > video { object-fit: contain; background: #05060d; }
.edit-preview .open-original { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: var(--fs-13); }

/* ---------- SweetAlert2: glass dialogs and toasts ---------- */
.swal2-container.swal2-backdrop-show, .swal2-container.swal2-noanimation { background: rgb(5 6 13 / .5); }
.swal2-popup {
  background: var(--glass-solid); color: var(--ink);
  border: 1px solid var(--edge); border-radius: var(--r-3);
  -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%);
  box-shadow: var(--edge-light), var(--shadow-lift);
  padding: 26px; font-family: var(--font);
  width: min(30em, calc(100vw - 32px)); max-width: calc(100vw - 32px);
}
.swal2-popup.swal2-show { animation: dlg-in var(--t-med) var(--ease); }
.swal2-popup.swal2-hide { animation: dlg-out var(--t-fast) ease-in forwards; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes dlg-out { to { opacity: 0; transform: translateY(6px) scale(.97); } }
.swal2-title { color: var(--ink); font-size: var(--fs-19); font-weight: 600; line-height: 1.3; padding: 0; margin: 0 0 4px; text-wrap: balance; }
.swal2-title small, .swal2-title .text-muted { display: block; font-size: var(--fs-14); font-weight: 400; color: var(--ink-3); margin-top: 4px; }
.swal2-html-container { color: var(--ink-2); font-size: var(--fs-14); font-weight: 400; line-height: 1.55; margin: 8px 0 0; padding: 0; text-wrap: pretty; }
.swal2-icon { font-size: 11px; margin: 4px auto 16px; border-width: .3em; }
.swal2-icon .swal2-icon-content { font-size: 3.4em; font-weight: 500; }
.swal2-icon.swal2-success { border-color: var(--ok); color: var(--ok); }
.swal2-icon.swal2-success .swal2-success-ring { border-color: rgb(61 220 151 / .3); }
.swal2-icon.swal2-success [class^="swal2-success-line"] { background-color: var(--ok); }
.swal2-icon.swal2-success [class^="swal2-success-circular-line"], .swal2-icon.swal2-success .swal2-success-fix { background-color: transparent !important; }
.swal2-icon.swal2-error { border-color: var(--bad); color: var(--bad); }
.swal2-icon.swal2-error [class^="swal2-x-mark-line"] { background-color: var(--bad); }
.swal2-icon.swal2-warning { border-color: var(--warn); color: var(--warn); }
.swal2-icon.swal2-info { border-color: var(--idle); color: var(--idle); }
.swal2-icon.swal2-question { border-color: var(--violet-hi); color: var(--violet-hi); }
.swal2-actions { gap: 8px; margin: 22px 0 0; }
.swal2-styled { height: 38px; padding: 0 18px !important; margin: 0 !important; border-radius: 10px !important; font: 500 var(--fs-14)/1 var(--font) !important; box-shadow: none !important; transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.swal2-styled:active { transform: translateY(1px); }
.swal2-styled:focus-visible { outline: 2px solid var(--violet-hi) !important; outline-offset: 2px; }
.swal2-styled.swal2-confirm { background: var(--violet-fill) !important; color: #fff !important; border: 1px solid rgb(255 255 255 / .16) !important; }
.swal2-styled.swal2-confirm:hover { background: var(--violet-fill-hi) !important; }
.swal2-styled.swal2-confirm.is-danger, .swal2-styled.swal2-confirm[style*="231, 76, 60"] { background: #C8463A !important; border-color: rgb(255 255 255 / .16) !important; color: #fff !important; }
.swal2-styled.swal2-cancel, .swal2-styled.swal2-deny { background: rgb(255 255 255 / .07) !important; color: var(--ink) !important; border: 1px solid var(--edge) !important; }
.swal2-styled.swal2-cancel:hover, .swal2-styled.swal2-deny:hover { background: rgb(255 255 255 / .12) !important; }
.swal2-close { color: var(--ink-3); font-size: 28px; width: 36px; height: 36px; border-radius: 10px; margin: -12px -12px -24px 0; transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.swal2-close:hover { color: var(--ink); background: rgb(255 255 255 / .08); }
.swal2-close:focus { box-shadow: none; }
.swal2-close:focus-visible { outline: 2px solid var(--violet-hi); outline-offset: -2px; }
.swal2-input, .swal2-textarea, .swal2-select, .swal2-file {
  width: 100%; box-sizing: border-box; margin: 8px 0 0 !important; height: 40px; padding: 0 12px;
  font: 400 var(--fs-14) var(--font); color: var(--ink); background: var(--field);
  border: 1px solid var(--field-line) !important; border-radius: 10px; box-shadow: none !important;
  transition: border-color var(--t-fast) var(--ease);
}
.swal2-textarea { height: 88px; padding: 10px 12px; resize: vertical; }
.swal2-input:focus, .swal2-textarea:focus, .swal2-select:focus { border-color: var(--violet-hi) !important; box-shadow: 0 0 0 3px rgb(142 123 234 / .22) !important; outline: none; }
.swal2-input::placeholder, .swal2-textarea::placeholder { color: rgb(242 243 247 / .42); }
.swal2-validation-message { background: var(--bad-wash); color: var(--bad); font-size: var(--fs-13); font-weight: 500; border-radius: 10px; margin: 12px 0 0; padding: 8px 12px; }
.swal2-validation-message::before { background-color: var(--bad); color: #1a0d0a; width: 16px; min-width: 16px; height: 16px; font-size: 11px; margin: 0 8px 0 0; }
.swal2-timer-progress-bar { background: var(--violet-wash); }
.swal2-loader { border-color: var(--violet-hi) transparent var(--violet-hi) transparent; width: 28px; height: 28px; border-width: 3px; }
.swal2-popup.swal2-toast { padding: 12px 16px; width: auto; max-width: min(380px, calc(100vw - 32px)); border-radius: 14px; }
.swal2-popup.swal2-toast .swal2-title { font-size: var(--fs-14); margin: 0 0 0 8px; }
.swal2-popup.swal2-toast .swal2-icon { font-size: 6px; margin: 0; }
.swal-form .swal2-title { text-align: left; padding-right: 32px; }
.swal-form .swal2-actions { justify-content: flex-start; }
.dlg { text-align: left; color: var(--ink-2); }
.dlg .field { margin-top: 14px; }
.dlg .field:first-child { margin-top: 4px; }
.dlg label.field-label { margin-bottom: 0; }
.dlg .switch-row { box-shadow: inset 0 1px 0 var(--hair); margin-top: 14px; padding-top: 12px; color: var(--ink); }
.dlg .switch-row + .switch-row { margin-top: 0; }
.reveal-btn { border: 0; background: transparent; color: var(--violet-hi); padding: 0; font: 500 var(--fs-12) var(--font); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.hours-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: var(--fs-14); }
.hours-table th { font-size: var(--fs-12); font-weight: 500; color: var(--ink-3); text-align: left; padding: 0 0 6px; }
.hours-table td { padding: 4px 8px 4px 0; border-top: 1px solid var(--hair); }
.hours-table td:first-child { width: 56px; color: var(--ink); font-weight: 500; }
.hours-table .swal2-input { margin: 0 !important; }
.colour-input { width: 60px !important; padding: 3px !important; height: 40px; }
/* Screen info: a picture, a circle and chips */
.swal2-popup.swal-screen { width: min(560px, calc(100vw - 32px)); padding: 0 0 22px; overflow: hidden; }
.swal-screen .swal2-title { display: none !important; }
.swal-screen .swal2-html-container { margin: 0; }
.swal-screen .swal2-actions { margin-top: 18px; padding: 0 22px; justify-content: flex-start; }
.swal-screen .swal2-close { position: absolute; right: 18px; top: 18px; margin: 0; background: rgb(8 10 22 / .55); color: #fff; z-index: 3; }
.info-shot { position: relative; aspect-ratio: 16 / 7; background: var(--well); overflow: hidden; }
.info-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.info-shot.is-off img { filter: grayscale(1) brightness(.6); }
.info-shot .shot-scrim { padding: 50px 22px 16px; }
.info-shot .shot-scrim h2 { font-size: var(--fs-19); }
.info-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 22px 0; text-align: left; }
.info-chips .tag { height: 30px; padding: 0 11px; font-size: var(--fs-13); border-radius: 10px; }
.info-chips .tag .fas, .info-chips .tag .fab { font-size: 12px; }
.info-chips .tag code { font-size: var(--fs-13); color: var(--ink); background: none; padding: 0; }
.info-chips .license-regenerate { height: 30px; }
/* Live view */
.swal2-popup.swal-live { width: min(880px, calc(100vw - 32px)); }
.live-frame { position: relative; aspect-ratio: 16 / 9; background: #05060d; border-radius: 12px; overflow: hidden; margin-top: 8px; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08); }
.live-frame img { width: 100%; height: 100%; object-fit: contain; display: block; animation: fade-in var(--t-med) var(--ease); }
.live-message { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; margin: 0; padding: 24px; color: var(--ink-2); font-size: var(--fs-14); line-height: 1.5; text-wrap: balance; }
.live-message[data-tone="bad"] { color: #FF9C92; }
.live-message[data-tone="warn"] { color: #F6CB79; }
.live-note { margin: 10px 0 0; font-size: var(--fs-12); color: var(--ink-3); text-align: left; }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- Schedule ---------- */
.sched-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.sched-legend .pill i.k { display: inline-block; width: 16px; height: 9px; border-radius: 3px; }
.sched-legend .k-on { background: var(--ok-wash); box-shadow: inset 0 0 0 1px rgb(61 220 151 / .5); }
.sched-legend .k-slot { background: rgb(255 255 255 / .55); }
.sched { margin-bottom: 16px; }
.sched .panel-head { gap: 10px; }
.sched .panel-head h2 { order: 1; } .sched .panel-head .state { order: 0; } .sched .panel-head .tag { order: 2; }
.sched-body { padding: 8px 18px 16px; overflow-x: auto; }
.sched-grid { min-width: 640px; }
.sched-axis, .sched-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; }
.sched-axis .hours { position: relative; height: 22px; }
.sched-axis .hours > span { position: absolute; top: 4px; transform: translateX(-50%); font-size: var(--fs-12); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sched-axis .hours > span:first-child { transform: none; }
.sched-axis .hours > span:last-child { transform: translateX(-100%); }
.sched-day { font-size: var(--fs-13); font-weight: 500; color: var(--ink-2); }
.sched-track { position: relative; height: 34px; margin: 2px 0; background: repeating-linear-gradient(to right, rgb(255 255 255 / .06) 0 1px, transparent 1px calc(100% / 24)), rgb(0 0 0 / .16); border-radius: 8px; box-shadow: inset 0 0 0 1px var(--hair); overflow: hidden; }
.sched-power { position: absolute; top: 0; bottom: 0; background: var(--ok-wash); box-shadow: inset 0 0 0 1px rgb(61 220 151 / .45); border-radius: 8px; display: flex; align-items: center; padding: 0 8px; font-size: var(--fs-12); color: var(--ok); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.schedule-block { position: absolute; top: 8px; bottom: 8px; background: var(--slot, var(--ink-2)); border-radius: 5px; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .35); color: #fff; font-size: var(--fs-12); font-weight: 500; line-height: 18px; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schedule-block.is-light { color: #16171A; }
.sched-track:has(.schedule-block) { height: 48px; }
.sched-track:has(.schedule-block) .sched-power { align-items: flex-start; padding-top: 4px; }
.sched-track .schedule-block { top: auto; bottom: 5px; height: 20px; line-height: 20px; }
.sched-off { position: absolute; inset: 0; display: flex; align-items: center; gap: 6px; padding: 0 10px; font-size: var(--fs-12); color: var(--ink-3); }

/* ---------- Activity ---------- */
.log-list { padding: 4px 0; }
.log-entry { display: flex; align-items: center; gap: 14px; padding: 12px 18px; box-shadow: inset 0 -1px 0 var(--hair); animation: fade-in var(--t-med) var(--ease); }
.log-entry:last-child { box-shadow: none; }
.log-entry .avatar { width: 34px; height: 34px; }
.log-action { flex: 1; min-width: 0; font-size: var(--fs-14); color: var(--ink); overflow-wrap: anywhere; line-height: 1.45; }
.log-action a { font-weight: 500; color: var(--ink); text-decoration: none; border-bottom: 1px solid rgb(142 123 234 / .5); }
.log-action a:hover { color: #fff; border-bottom-color: var(--violet-hi); }
.log-time { flex: none; font-size: var(--fs-12); color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-status { text-align: center; padding: 16px; font-size: var(--fs-13); color: var(--ink-3); }

/* ---------- Sign in ---------- */
body.is-login { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px 16px; }
.login-card { width: 100%; max-width: 390px; padding: 34px 30px 30px; animation: rise var(--t-slow) var(--ease) both; }
.login-card .brand img { height: 38px; }
.login-card h1 { font-size: var(--fs-23); font-weight: 600; margin: 26px 0 22px; letter-spacing: -.01em; }
.login-card .field + .field { margin-top: 16px; }
.login-card .btn-primary { width: 100%; height: 44px; margin-top: 24px; }
.login-card .form-control { height: 44px; }
.login-alert { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bad-wash); color: #FF9C92; font-size: var(--fs-13); font-weight: 500; }
.login-foot { margin: 18px 0 0; font-size: var(--fs-12); color: var(--ink-3); text-align: center; }
.error-message { display: none; font-size: var(--fs-12); color: var(--bad); margin-top: 6px; }

/* ---------- Phone and narrow ---------- */
@media (max-width: 899.98px) {
  .topbar { gap: 12px; padding: 0 8px 0 16px; }
  .brand img { height: 28px; }
  .nav-toggle { display: grid; place-items: center; }
  .person-btn .person-name, .person-btn .fa-chevron-down { display: none; }
  .topnav {
    position: fixed; left: 8px; right: 8px; top: calc(var(--bar-h) + 6px);
    flex-direction: column; align-self: auto; gap: 2px; padding: 8px;
    background: var(--glass-solid); border: 1px solid var(--edge); border-radius: var(--r-2);
    -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
    box-shadow: var(--edge-light), var(--shadow-lift);
    opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.98);
    transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease), visibility 0s linear var(--t-med);
  }
  .topbar.nav-open .topnav { opacity: 1; visibility: visible; transform: none; transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease), visibility 0s; }
  .topnav a { height: 46px; border-radius: 10px; font-size: var(--fs-16); gap: 12px; }
  .topnav a .fas { width: 18px; text-align: center; }
  .topnav a::after { display: none; }
  .topnav a.is-active { background: var(--violet-wash); }

  body.is-bench { height: auto; overflow: visible; display: block; }
  .bench { display: block; padding: 0 12px 24px; }
  .bench-tabs {
    display: flex; gap: 4px; position: sticky; top: calc(var(--bar-h) + 8px); z-index: 20;
    margin: 10px 0 12px; padding: 4px;
    background: rgb(20 24 46 / .7); border: 1px solid var(--edge); border-radius: 14px;
    -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
    box-shadow: var(--edge-light), var(--shadow-glass);
  }
  .bench-tabs button { position: relative; flex: 1; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font: 500 var(--fs-14) var(--font); transition: color var(--t-fast) var(--ease), background-color var(--t-med) var(--ease); }
  .bench-tabs button .count { color: var(--ink-3); font-size: var(--fs-12); margin-left: 4px; font-variant-numeric: tabular-nums; }
  .bench-tabs button[aria-selected="true"] { color: var(--ink); background: rgb(255 255 255 / .1); }
  .bench > .panel { display: none; }
  .bench > .panel.is-shown { display: flex; animation: pane-in var(--t-med) var(--ease); }
  .bench .panel-body { overflow: visible; }
  .bench .panel-foot { position: sticky; bottom: 0; z-index: 5; background: #171B36; box-shadow: 0 -12px 24px -12px rgb(0 0 0 / .6); }
  .bench .panel-head { min-height: 50px; }

  .page { padding: 20px 14px 48px; }
  .people .col-role { display: none; }
  .field-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sched-body { padding: 8px 12px 12px; }
  .sched-grid { min-width: 0; }
  .sched-axis, .sched-row { grid-template-columns: 36px minmax(0, 1fr); }
  .sched-axis .hours .mm { display: none; }
}
@keyframes pane-in { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 640px) {
  .field-grid, .field-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .form-panel { padding: 18px; }
  .content-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile { min-height: 128px; padding: 16px; }
  .role-grid { grid-template-columns: minmax(0, 1fr); }
  .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-hero { gap: 16px; }
  .log-entry { align-items: flex-start; }
  .log-time { display: block; }
  .people .col-state .dot-word { display: none; }
  .people .col-state { width: auto; }
  .swal2-popup { padding: 22px 16px; }
  .swal2-popup.swal-screen { padding: 0 0 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora i { animation: none !important; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; scroll-behavior: auto !important; }
  .dot, .dot::after { animation: none !important; }
  .dropdown-menu, .topnav, .modal.fade .modal-dialog { translate: none !important; transform: none !important; scale: 1 !important; }
  .screen-card:hover, a.tile:hover, button.tile:hover, .role-tile:hover, .person-tile:hover, .content-card:hover .frame, .screen-card:hover .shot > img { transform: none; }
  .btn:active, .icon-btn:active, .swal2-styled:active { transform: none; }
  .dragTo, .toggle-btn, .topnav a::after { transition-duration: 1ms !important; }
}
.pill .dot, .pill .dot::after { animation: none !important; }
