/* Nosify */
/* ============================================================
   1. Tokens — Studio Light Craft (Light Mode Only)
   ============================================================ */
:root {
  --font-ui: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: "Bricolage Grotesque", "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Crisp Warm Alabaster Canvas & Pure White Surfaces */
  --bg: #F4F4F1;
  --bg-dot: rgba(17, 17, 20, .042);
  --surface: #FFFFFF;
  --raised: #F1F1EC;
  --sunken: #E9E8E2;
  --line: rgba(17, 17, 20, .08);
  --line-strong: rgba(17, 17, 20, .15);

  /* Ink Typography */
  --text: #111114;
  --text-2: #42424A;
  --muted: #767680;

  /* Studio Accent System (Non-AI, High-Craft Editorial) */
  --ink: #111114;
  --ink-soft: rgba(17, 17, 20, .06);

  --orange: #FF5420;
  --orange-hi: #FF6B3D;
  --orange-bg: #FFF1EB;
  --orange-line: rgba(255, 84, 32, .28);
  --orange-glow: rgba(255, 84, 32, .28);

  --blue: #2B59FF;
  --blue-bg: #EDF2FF;
  --blue-line: rgba(43, 89, 255, .24);

  --mint: #0E9F6E;
  --mint-bg: #E7F8EE;
  --mint-line: rgba(14, 159, 110, .28);

  --amber: #C97A06;
  --amber-bg: #FFF6E5;
  --amber-line: rgba(201, 122, 6, .28);

  --coral: #E02D49;
  --coral-bg: #FFEDF0;
  --coral-line: rgba(224, 45, 73, .28);

  --sand-bg: #EFEFE9;

  --hatch: repeating-linear-gradient(-45deg, rgba(17, 17, 20, .11) 0 3px, transparent 3px 7px);
  --stripe-orange: repeating-linear-gradient(-45deg, rgba(255, 84, 32, .28) 0 5px, transparent 5px 10px);
  --shadow-xs: 0 1px 2px rgba(17, 17, 20, .05);
  --shadow-card: 0 1px 2px rgba(17, 17, 20, .04), 0 10px 28px -18px rgba(17, 17, 20, .12);
  --shadow-pop: 0 22px 54px -14px rgba(17, 17, 20, .2), 0 0 0 1px rgba(17, 17, 20, .08);

  --r-sm: 9px;
  --r-md: 13px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-pill: 999px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: 140ms;
  --t-med: 260ms;
  --t-slow: 440ms;

  --sidebar: 248px;
  color-scheme: light;
}

/* ============================================================
   2. Base & Typography
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, var(--bg-dot) 1.15px, transparent 0);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: clip;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--ink); color: #FFFFFF; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); font-size: .88em; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.svg-i { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.svg-i svg { width: 100%; height: 100%; display: block; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.03em; margin: 0; line-height: 1.12; }
h1 { font-size: clamp(26px, 3.2vw, 34px); }
h2 { font-size: 20px; }
h3 { font-size: 16px; letter-spacing: -.02em; }
p { margin: 0; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* ============================================================
   3. Top Loading Bar & Smooth Stagger Animations
   ============================================================ */
#topbar-progress {
  position: fixed;
  z-index: 400;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--ink), var(--orange), var(--blue));
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: width 320ms var(--ease-out), opacity 220ms ease;
  pointer-events: none;
}
#topbar-progress.on, #topbar-progress.pulling { opacity: 1; }
#topbar-progress.pulling { transition: none; }

.pop-in {
  animation: pop-card 420ms var(--ease-out) both;
  animation-delay: calc(var(--st, 0) * 34ms);
}
@keyframes pop-card {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   4. Tactile Buttons + Arrow-Shoot + Liquid Pill-Sweep
   ============================================================ */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-line: var(--line-strong);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--btn-line);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: -.01em;
  white-space: nowrap;
  user-select: none;
  box-shadow: var(--shadow-xs);
  -webkit-tap-highlight-color: transparent;
  transition: transform 220ms var(--ease-spring), background-color var(--t-fast), border-color var(--t-fast), box-shadow 220ms ease;
}
.btn:hover { border-color: rgba(17, 17, 20, .28); transform: translateY(-1px); box-shadow: 0 6px 16px -10px rgba(17, 17, 20, .24); }
.btn:active { transform: scale(.965) translateY(0); box-shadow: none; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* Primary Matte Jet-Black Button (1:1 f5ae1a57 + jooob + a9fd45d2) */
.btn-primary {
  --btn-bg: var(--ink);
  --btn-fg: #FFFFFF;
  --btn-line: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 8px 20px -10px rgba(17, 17, 20, .5);
}
.btn-primary:hover {
  --btn-bg: #222228;
  border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 12px 26px -10px rgba(17, 17, 20, .55);
}

.btn-orange {
  --btn-bg: var(--orange);
  --btn-fg: #FFFFFF;
  --btn-line: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 8px 22px -8px var(--orange-glow);
}
.btn-orange:hover { --btn-bg: var(--orange-hi); border-color: transparent; }

.btn-ghost { --btn-bg: transparent; --btn-line: transparent; box-shadow: none; }
.btn-ghost:hover { --btn-bg: rgba(17, 17, 20, .06); border-color: transparent; transform: none; box-shadow: none; }

.btn-danger { --btn-bg: var(--coral-bg); --btn-fg: var(--coral); --btn-line: var(--coral-line); box-shadow: none; }
.btn-danger:hover { --btn-bg: var(--coral); --btn-fg: #FFFFFF; --btn-line: transparent; }

.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 14.5px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 11px; }
.btn-icon.btn-sm { width: 32px; height: 32px; border-radius: 9px; }

.sync-btn:active .svg-i { transform: rotate(-180deg); transition: transform 340ms var(--ease-spring); }

/* Arrow-Shoot Hover Micro-Interaction (1:1 original-f031645a.mp4) */
.arrow-btn .arr-track {
  position: relative;
  width: 18px; height: 18px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
}
.arrow-btn .arr-track .svg-i {
  position: absolute;
  inset: 0;
  transition: transform 320ms var(--ease-out);
}
.arrow-btn .arr-track .svg-i:nth-child(2) { transform: translateX(-140%); }
.arrow-btn:hover .arr-track .svg-i:nth-child(1) { transform: translateX(140%); }
.arrow-btn:hover .arr-track .svg-i:nth-child(2) { transform: translateX(0); }

/* Liquid Emerald Pill Sweep (1:1 original-c92d27a3.mp4 SEND -> SENT) */
.sweep-pill {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--mint);
  color: #FFFFFF;
  font-weight: 700;
  font-size: inherit;
  border-radius: inherit;
  transform: translateX(-105%);
  transition: transform 320ms var(--ease-out);
  pointer-events: none;
}
.sweep-pill.in { transform: translateX(0); }
.sweep-pill.out { transform: translateX(105%); transition-duration: 240ms; }
.sweep-pill .svg-i { width: 16px; height: 16px; }

.ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: currentColor;
  opacity: .12;
  transform: scale(0);
  animation: ripple 500ms var(--ease-out) forwards;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

.btn.is-loading { pointer-events: none; color: transparent; }
.btn.is-loading > * { opacity: 0; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  left: 24%; right: 24%; top: 50%; height: 3px; margin-top: -1.5px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--btn-fg), transparent) 0 0 / 40% 100% no-repeat, color-mix(in srgb, var(--btn-fg) 22%, transparent);
  animation: btnbar 850ms ease-in-out infinite;
}
@keyframes btnbar { from { background-position: -40% 0, 0 0; } to { background-position: 140% 0, 0 0; } }

/* ============================================================
   5. Badges & Brand Mark (Jet Black Monogram + Vermilion Dot)
   ============================================================ */
.brand-mark {
  width: 36px; height: 36px; flex: none;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--ink);
  color: #FFFFFF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 6px 14px -8px rgba(17, 17, 20, .45);
  transition: transform 280ms var(--ease-spring);
}
.brand-mark svg { width: 20px; height: 20px; display: block; }
.brand:hover .brand-mark { transform: scale(1.06) rotate(-4deg); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--raised);
  color: var(--text-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--mint-bg); color: var(--mint); border-color: var(--mint-line); }
.badge.iris, .badge.blue { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-line); }
.badge.orange { background: var(--orange-bg); color: var(--orange); border-color: var(--orange-line); }
.badge.warn { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-line); }
.badge.bad { background: var(--coral-bg); color: var(--coral); border-color: var(--coral-line); }
.badge.live .dot { animation: pulse 1.5s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ============================================================
   6. Panels & Tactile Form Controls
   ============================================================ */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  overflow: clip;
}
.panel-pad { padding: 20px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-head > div { min-width: 0; flex: 1 1 150px; }
.panel-head p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.panel-body { padding: 20px; }

.field { display: grid; gap: 7px; }
.field + .field { margin-top: 16px; }
.label { font-size: 13.5px; font-weight: 650; color: var(--text); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.help { font-size: 12.5px; color: var(--muted); font-weight: 400; }

.input, .textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 13px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: var(--raised);
  color: var(--text);
  outline: none;
  transition: border-color var(--t-fast), box-shadow 220ms var(--ease-out), background-color var(--t-fast);
}
.textarea { resize: vertical; min-height: 98px; line-height: 1.5; }
.input:hover, .textarea:hover { border-color: rgba(17, 17, 20, .28); }
.input:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 17, 20, .09); background: var(--surface); }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .78; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .suffix-btn { position: absolute; right: 5px; }
.input-wrap .input[type="password"], .input-wrap .input[type="text"] { padding-right: 44px; }

.field.has-error .input, .field.has-error .textarea, .field.has-error .chips { border-color: var(--coral); box-shadow: 0 0 0 3px var(--coral-bg); }
.field-error { font-size: 12.5px; color: var(--coral); display: flex; gap: 6px; align-items: center; animation: drop-in 220ms var(--ease-out); }
.shake { animation: shake 380ms var(--ease-out); }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); }
}
@keyframes drop-in { from { opacity: 0; transform: translateY(-4px); } }

/* Adaptive-Width Spring Number Stepper (1:1 6661c9ef.mp4 + a9fd45d2.mp4) */
.stepper {
  display: flex;
  align-items: stretch;
  gap: 5px;
  width: 100%;
  min-width: 0;
  padding: 4px;
  border-radius: 14px;
  background: var(--raised);
  border: 1px solid var(--line);
}
.stepper button {
  flex: 0 0 42px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-xs);
  transition: flex-basis 260ms var(--ease-spring), background-color 140ms, color 140ms, transform 140ms;
}
.stepper button:hover { border-color: var(--line-strong); }
.stepper.press-dec button[data-d="-1"] { flex-basis: 56px; background: var(--ink); color: #FFFFFF; border-color: transparent; }
.stepper.press-dec button[data-d="1"] { flex-basis: 34px; opacity: .7; }
.stepper.press-inc button[data-d="1"] { flex-basis: 56px; background: var(--ink); color: #FFFFFF; border-color: transparent; }
.stepper.press-inc button[data-d="-1"] { flex-basis: 34px; opacity: .7; }
.stepper input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: center;
  outline: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper input.tick-up { animation: tick-up 200ms var(--ease-out); }
.stepper input.tick-down { animation: tick-down 200ms var(--ease-out); }
@keyframes tick-up { 0% { transform: translateY(5px); opacity: .45; } 100% { transform: none; opacity: 1; } }
@keyframes tick-down { 0% { transform: translateY(-5px); opacity: .45; } 100% { transform: none; opacity: 1; } }
.stepper .unit { align-self: center; padding-right: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }

/* Tactile Machined ON / OFF Toggle Switch (1:1 Toggle.mov!) */
.switch { position: relative; width: 60px; height: 30px; flex: none; display: inline-block; }
.switch.sm { transform: scale(.86); transform-origin: right center; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 2; }
.switch .track {
  position: absolute;
  inset: 0;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, #E3E2DC 0%, #ECEBE6 100%);
  border: 1px solid rgba(17, 17, 20, .14);
  box-shadow: inset 0 2px 5px rgba(17, 17, 20, .12), 0 1px 0 rgba(255, 255, 255, .9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  transition: background 280ms var(--ease-out), border-color 280ms, box-shadow 280ms;
}
.switch .sw-on, .switch .sw-off {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  user-select: none;
  pointer-events: none;
  transition: opacity 220ms ease;
}
.switch .sw-on { color: rgba(255, 255, 255, .86); opacity: 0; }
.switch .sw-off { color: rgba(17, 17, 20, .48); opacity: 1; }
.switch .thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #FFFFFF 0%, #E7E6E0 100%);
  border: 1px solid rgba(17, 17, 20, .14);
  box-shadow: 0 2px 5px rgba(17, 17, 20, .2), inset 0 1px 1px #FFFFFF;
  transition: transform 340ms var(--ease-spring), width 160ms var(--ease-out), background 240ms, border-color 240ms, box-shadow 240ms;
}
.switch .thumb::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: linear-gradient(180deg, #DFDED7 0%, #F5F5F1 100%);
  transition: background 240ms;
}
.switch input:active ~ .thumb { width: 29px; }
.switch input:checked ~ .track {
  background: linear-gradient(180deg, #101013 0%, #232329 100%);
  border-color: #0D0D10;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .65), 0 1px 0 rgba(255, 255, 255, .6);
}
.switch input:checked ~ .track .sw-on { opacity: 1; }
.switch input:checked ~ .track .sw-off { opacity: 0; }
.switch input:checked ~ .thumb {
  transform: translateX(30px);
  background: linear-gradient(180deg, #3A3A42 0%, #1C1C22 100%);
  border-color: rgba(255, 255, 255, .14);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .55), inset 0 1px 1px rgba(255, 255, 255, .18);
}
.switch input:checked ~ .thumb::after {
  background: linear-gradient(180deg, #25252C 0%, #34343D 100%);
}
.switch input:checked:active ~ .thumb { transform: translateX(25px); }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 15px;
  background: var(--raised);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color var(--t-fast);
}
.toggle-row:hover { border-color: var(--line-strong); }
.toggle-row .text { display: grid; gap: 2px; }

/* Checkbox */
.check { position: relative; width: 20px; height: 20px; flex: none; }
.check input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.check .box { position: absolute; inset: 0; border-radius: 6px; border: 1.5px solid var(--line-strong); background: var(--surface); transition: background-color var(--t-fast), border-color var(--t-fast), transform 240ms var(--ease-spring); }
.check svg { position: absolute; inset: 3px; stroke: #FFFFFF; stroke-width: 3; fill: none; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset var(--t-med) var(--ease-out); }
.check input:checked ~ .box { background: var(--ink); border-color: var(--ink); transform: scale(1.06); }
.check input:checked ~ svg { stroke-dashoffset: 0; }

/* Floating-Thumb Segmented Switcher (1:1 68a86980.png & f5ae1a57.mp4) */
.seg {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  width: 100%;
  min-width: 0;
  padding: 4px;
  border-radius: 13px;
  background: #E9E9E5;
  border: 1px solid rgba(17, 17, 20, .06);
}
.seg button {
  position: relative;
  z-index: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.25;
  transition: color 220ms ease;
}
.seg button[aria-pressed="true"] { color: var(--text); }
.seg .seg-thumb {
  position: absolute;
  top: 4px; bottom: 4px; left: 0;
  border-radius: 9px;
  background: #FFFFFF;
  border: 1px solid rgba(17, 17, 20, .07);
  box-shadow: 0 2px 8px -2px rgba(17, 17, 20, .14), 0 1px 1px rgba(17, 17, 20, .05);
  transition: transform 320ms var(--ease-spring), width 260ms var(--ease-out);
}
.seg-lg button { padding: 10px 12px; font-size: 13.5px; }

/* Select & Popover Menu */
.select { position: relative; }
.select-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 43px; padding: 0 13px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: var(--raised);
  text-align: left;
  transition: border-color var(--t-fast), box-shadow var(--t-med);
}
.select-btn[aria-expanded="true"] { border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 3px rgba(17, 17, 20, .09); }
.select-btn .chev { transition: transform var(--t-med) var(--ease-spring); color: var(--muted); }
.select-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

.menu {
  position: fixed;
  z-index: 90;
  min-width: 186px;
  max-width: min(320px, calc(100vw - 24px));
  padding: 6px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  transform-origin: var(--origin, top left);
  animation: menu-in 200ms var(--ease-spring);
}
.menu.closing { animation: menu-out 130ms ease-in forwards; }
@keyframes menu-in { from { opacity: 0; transform: scale(.92) translateY(-5px); } }
@keyframes menu-out { to { opacity: 0; transform: scale(.96); } }
.menu-item {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border: 0; border-radius: 10px;
  background: transparent;
  text-align: left;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text);
  transition: background-color var(--t-fast);
}
.menu-item:hover, .menu-item:focus-visible { background: var(--raised); outline: none; }
.menu-item.danger { color: var(--coral); }
.menu-item.danger:hover { background: var(--coral-bg); }
.menu-item .tick { margin-left: auto; color: var(--orange); }
.menu-sep { height: 1px; margin: 5px 4px; background: var(--line); }

/* Chips Input (Shared Channel IDs) */
.chips {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 46px; max-width: 100%;
  padding: 7px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: var(--raised);
  cursor: text;
  transition: border-color var(--t-fast), box-shadow var(--t-med), background-color var(--t-fast);
}
.chips:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 17, 20, .09); background: var(--surface); }
.chips input { flex: 1; min-width: 120px; border: 0; background: transparent; outline: none; padding: 4px 6px; font-family: var(--font-mono); font-size: 13px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%; overflow: hidden;
  padding: 4px 7px 4px 10px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-xs);
  font-family: var(--font-mono);
  font-size: 12.5px;
  animation: chip-in 260ms var(--ease-spring);
}
.chip .hash { color: var(--orange); font-weight: 700; }
.chip button { width: 20px; height: 20px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; transition: background-color var(--t-fast), color var(--t-fast); }
.chip button:hover { background: var(--coral-bg); color: var(--coral); }
.chip.out { animation: chip-out 180ms ease-in forwards; }
.chip.bad { border-color: var(--coral); color: var(--coral); }
@keyframes chip-in { from { opacity: 0; transform: scale(.7); } }
@keyframes chip-out { to { opacity: 0; transform: scale(.7); width: 0; padding: 0; margin: 0; } }

/* ============================================================
   7. Empty States, Skeletons, Avatars, Toasts & Modals
   ============================================================ */
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 38px 20px; color: var(--muted); }
.empty.compact { padding: 28px 18px; }
.empty .art { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-line); }
.empty .art .svg-i { width: 24px; height: 24px; }
.empty h3 { color: var(--text); }

.skel { border-radius: 9px; background: linear-gradient(100deg, var(--raised) 30%, #E4E3DC 50%, var(--raised) 70%) 0 0 / 300% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.avatar {
  width: 40px; height: 40px; flex: none;
  border-radius: 12px; overflow: hidden;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; color: #FFFFFF; background: var(--ink);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 12px; }
.avatar.round { border-radius: 50%; }

.avatar-stack { display: flex; align-items: center; }
.avatar-stack > span { display: inline-flex; }
.avatar-stack > * + * { margin-left: -9px; }
.avatar-stack .avatar { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--surface); font-size: 12px; }
.avatar-stack .avatar-more { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--surface); background: var(--ink); color: #FFFFFF; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

.toasts { position: fixed; z-index: 160; right: 16px; bottom: 16px; display: grid; gap: 8px; width: min(370px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start;
  padding: 13px 12px 13px 14px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  animation: toast-in 340ms var(--ease-spring);
}
.toast.out { animation: toast-out 200ms ease-in forwards; }
.toast .ti { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.toast.ok .ti { background: var(--mint-bg); color: var(--mint); }
.toast.bad .ti { background: var(--coral-bg); color: var(--coral); }
.toast.warn .ti { background: var(--amber-bg); color: var(--amber); }
.toast.info .ti { background: var(--blue-bg); color: var(--blue); }
.toast strong { display: block; font-size: 13.5px; font-weight: 650; }
.toast span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.toast .timer { position: absolute; left: 0; bottom: 0; height: 2.5px; background: currentColor; opacity: .55; animation: toast-timer linear forwards; }
.toast.ok .timer { color: var(--mint); } .toast.bad .timer { color: var(--coral); } .toast.warn .timer { color: var(--amber); } .toast.info .timer { color: var(--blue); }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(36px); } }
@keyframes toast-timer { from { width: 100%; } to { width: 0; } }

.modal-back { position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(17, 17, 20, .38); backdrop-filter: blur(8px); animation: fade-in 200ms ease-out; }
.modal-back.out { animation: fade-out 180ms ease-in forwards; }
.modal { width: min(468px, 100%); max-height: calc(100dvh - 32px); overflow: auto; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop); animation: modal-in 340ms var(--ease-spring); }
.modal-back.out .modal { animation: modal-out 180ms ease-in forwards; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 22px 6px; }
.modal-head p { color: var(--muted); font-size: 13.5px; margin-top: 5px; }
.modal-body { padding: 16px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 8px 22px 22px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.96); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }
@media (max-width: 560px) {
  .modal-back { place-items: end stretch; padding: 0; }
  .modal { width: 100%; border-radius: 26px 26px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: sheet-in 360ms var(--ease-out); }
  .modal-back.out .modal { animation: sheet-out 200ms ease-in forwards; }
  @keyframes sheet-in { from { transform: translateY(100%); } }
  @keyframes sheet-out { to { transform: translateY(100%); } }
  .modal-foot .btn { flex: 1; }
}

/* ============================================================
   8. Login & Admin Gate (Junojo Diagonal Orange-Stripe Frame)
   ============================================================ */
.gate {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  overflow: hidden;
}
.gate-grid {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: repeat(auto-fill, 80px); grid-auto-rows: 80px;
  justify-content: center; align-content: center;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 18%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 18%, transparent 78%);
}
.gate-grid .cell { border-right: 1px solid rgba(17, 17, 20, .05); border-bottom: 1px solid rgba(17, 17, 20, .05); transition: background-color 480ms ease; }
.gate-grid .cell.lit { background: rgba(255, 84, 32, .08); transition: background-color 80ms; }
.gate-grid .tile { display: none; }

.gate-stack { position: relative; z-index: 2; width: min(444px, 100%); animation: card-in 540ms var(--ease-out) both; }
.gate.unlocked .gate-stack { animation: card-out 320ms var(--ease-out) forwards; }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes card-out { to { opacity: 0; transform: translateY(-10px) scale(1.02); filter: blur(4px); } }

/* Junojo-inspired subtle diagonal orange-stripe offset backing */
.gate-stripe-frame { position: relative; }
.gate-stripe-frame::before {
  content: "";
  position: absolute;
  inset: 10px -8px -10px 10px;
  border-radius: 26px;
  background-image: var(--stripe-orange);
  border: 1.5px solid rgba(255, 84, 32, .35);
  z-index: 0;
  pointer-events: none;
  transition: transform 340ms var(--ease-spring);
}
.gate-stripe-frame:focus-within::before { transform: translate(3px, 3px); }

.gate-card {
  position: relative;
  z-index: 1;
  padding: 26px 24px 24px;
  border-radius: 26px;
  background: var(--surface);
  border: 1.5px solid rgba(17, 17, 20, .12);
  box-shadow: var(--shadow-pop);
}
.gate-brand-bar {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.gate-brand-meta { flex: 1; min-width: 0; }
.gate-brand-meta b { display: block; font-family: var(--font-display); font-size: 16px; line-height: 1.1; }
.gate-brand-meta span { display: block; font-size: 12px; color: var(--muted); }
.gate-copy h1 { font-size: 25px; }
.gate-desc { color: var(--text-2); margin: 7px 0 18px; font-size: 13.5px; line-height: 1.5; }

.key-input { font-family: var(--font-mono); font-size: 15px; font-weight: 600; letter-spacing: .06em; height: 48px; text-align: center; text-transform: uppercase; }
.key-progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 18px; }
.key-progress i { height: 4px; border-radius: 4px; background: var(--sunken); transition: background-color 240ms, transform 300ms var(--ease-spring); }
.key-progress i.on { background: var(--orange); transform: scaleY(1.25); }

.gate-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.spec-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600;
}
.spec-chip .svg-i { width: 13px; height: 13px; }
.sc-mint { background: var(--mint-bg); color: var(--mint); }
.sc-blue { background: var(--blue-bg); color: var(--blue); }
.sc-orange { background: var(--orange-bg); color: var(--orange); }

.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input { min-width: 0; width: 100%; height: 50px; text-align: center; font-family: var(--font-mono); font-size: 20px; font-weight: 700; border-radius: 13px; border: 1px solid var(--line-strong); background: var(--raised); outline: none; transition: border-color var(--t-fast), transform 220ms var(--ease-spring), box-shadow var(--t-med); }
.otp input:focus { border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 3px rgba(17, 17, 20, .09); transform: translateY(-2px); }
.otp input.filled { border-color: var(--orange); animation: pop 220ms var(--ease-spring); }
@keyframes pop { 50% { transform: scale(1.08); } }

/* ============================================================
   9. App Shell — Collapsible Desktop Rail Sidebar (1000354648.png)
   ============================================================ */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100dvh;
  transition: grid-template-columns 280ms var(--ease-out);
}
.shell.is-collapsed, .side-col-init .shell { --sidebar: 76px; }

.side {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 12px 14px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  z-index: 30;
}
.side-toggle {
  position: absolute;
  top: 22px;
  right: -13px;
  z-index: 5;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-2);
  display: grid; place-items: center;
  box-shadow: 0 4px 12px -4px rgba(17, 17, 20, .18);
  transition: transform 280ms var(--ease-spring), color 160ms, border-color 160ms;
}
.side-toggle .svg-i { width: 14px; height: 14px; transition: transform 280ms var(--ease-spring); }
.side-toggle:hover { color: var(--text); border-color: var(--ink); transform: scale(1.08); }
.shell.is-collapsed .side-toggle .svg-i { transform: rotate(180deg); }

.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 14px; overflow: hidden; }
.brand-txt { min-width: 0; transition: opacity 180ms ease; }
.brand b { font-family: var(--font-display); font-size: 17px; font-weight: 800; letter-spacing: -.03em; display: block; line-height: 1.1; }
.brand small { font-size: 11.5px; color: var(--muted); display: block; white-space: nowrap; }

.side-sec-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--muted);
  padding: 6px 10px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.side-acc-add {
  width: 20px; height: 20px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--muted);
  transition: background-color 160ms, color 160ms;
}
.side-acc-add:hover { background: var(--raised); color: var(--text); }
.side-acc-add .svg-i { width: 13px; height: 13px; }

.nav { position: relative; display: grid; gap: 3px; }
.nav-ind {
  position: absolute;
  left: 0; right: 0; top: 0; height: 42px;
  border-radius: 12px;
  background: var(--ink);
  box-shadow: 0 8px 18px -8px rgba(17, 17, 20, .4);
  transition: transform 340ms var(--ease-spring);
  z-index: 0;
}
.nav a {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  transition: color var(--t-fast);
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: #FFFFFF; }
.nav a[aria-current="page"] .count { color: rgba(255, 255, 255, .75); }
.nav a .count { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav a .live-dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); animation: pulse 1.6s ease-out infinite; color: var(--mint); }

/* Sidebar Quick Accounts List (1:1 1000354648.png MESSAGES list) */
.side-accounts { display: grid; gap: 3px; margin-top: 2px; }
.side-acc-row, .side-acc-empty {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-2);
  transition: background-color 160ms, color 160ms;
}
.side-acc-row:hover, .side-acc-empty:hover { background: var(--raised); color: var(--text); }
.sa-av-wrap { position: relative; display: inline-flex; flex: none; }
.sa-status {
  position: absolute;
  right: -1px; bottom: -1px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #D0CFC8;
  border: 2px solid var(--surface);
}
.sa-status.live { background: var(--mint); }
.sa-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-dot-add {
  width: 26px; height: 26px; flex: none;
  border-radius: 50%;
  border: 1.5px dashed var(--line-strong);
  display: grid; place-items: center;
  color: var(--muted);
}
.sa-dot-add .svg-i { width: 13px; height: 13px; }

.side-foot { margin-top: auto; display: grid; gap: 8px; }
.key-card { padding: 12px 13px; border-radius: 15px; border: 1px solid var(--line); background: var(--raised); }
.key-card .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.key-card .meter { height: 7px; margin-top: 9px; border-radius: 6px; background-color: var(--sunken); background-image: var(--hatch); overflow: hidden; }
.key-card .meter i { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--ink); transition: width 800ms var(--ease-out); }
.key-card small { display: block; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.nosify-mark { text-align: center; font-size: 10px; letter-spacing: .22em; color: var(--muted); opacity: .45; user-select: none; }

/* Collapsed Rail State + Floating Hover Labels (1000354648.png) */
.shell.is-collapsed .brand { justify-content: center; padding: 2px 0 14px; }
.shell.is-collapsed .brand-txt,
.shell.is-collapsed .nav-txt,
.shell.is-collapsed .nav a .count,
.shell.is-collapsed .side-sec-lbl,
.shell.is-collapsed .key-card,
.shell.is-collapsed .nosify-mark { display: none; }
.shell.is-collapsed .nav a,
.shell.is-collapsed .side-acc-row,
.shell.is-collapsed .side-acc-empty,
.shell.is-collapsed .logout-btn { justify-content: center; padding: 0; }
.shell.is-collapsed .side-acc-row,
.shell.is-collapsed .side-acc-empty { height: 38px; }
.shell.is-collapsed [data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  padding: 6px 10px;
  border-radius: 9px;
  background: var(--ink);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 24px -8px rgba(17, 17, 20, .4);
  transition: opacity 160ms ease, transform 200ms var(--ease-out);
  z-index: 60;
}
.shell.is-collapsed [data-tip]:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }

/* Header & Main Content */
.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 26px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med);
}
.top.scrolled { border-bottom-color: var(--line); }
.top-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; overflow: hidden; }
.top-title .crumb { color: var(--muted); font-size: 14px; }
.top-title b { font-family: var(--font-display); font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb-count { font-size: 12px; color: var(--muted); background: var(--sunken); padding: 1px 7px; border-radius: var(--r-pill); }
.crumb-count:empty { display: none; }
.top-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.mobile-brand { display: none; }

.content { width: 100%; max-width: 1120px; padding: 10px 26px 56px; margin: 0 auto; min-width: 0; }
.view { display: none; min-width: 0; }
.view.active { display: block; animation: view-lift 360ms var(--ease-out); }
.view.active.back { animation-name: view-lift-back; }
@keyframes view-lift { from { opacity: 0; transform: translateY(10px); filter: blur(3px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes view-lift-back { from { opacity: 0; transform: translateY(-10px); filter: blur(3px); } to { opacity: 1; transform: none; filter: blur(0); } }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 18px; flex-wrap: wrap; }
.view-head p { color: var(--muted); margin-top: 5px; font-size: 13.5px; max-width: 58ch; }
.tabbar { display: none; }

/* ============================================================
   10. Overview — Page Hero Bar + Pastel Bento + Activity Matrix + 3D Deck
   ============================================================ */
.hero-bar { position: relative; padding: 22px; display: grid; gap: 18px; }
.hero-bar.is-live { border-color: var(--mint-line); box-shadow: 0 0 0 1px var(--mint-bg), 0 14px 36px -22px rgba(14, 159, 110, .35); }
.hero-bar-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero-bar-left { min-width: 0; flex: 1 1 280px; }
.hero-bar-left h1 { margin-top: 10px; font-size: clamp(24px, 3.2vw, 34px); }
.hero-bar-left h1.running { color: var(--mint); }
.hero-sess { font-size: 11.5px; letter-spacing: .06em; }
.hero-sub { color: var(--text-2); font-size: 13.5px; margin-top: 5px; max-width: 52ch; }
.hero-bar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* 4 Pastel KPI Tiles inside Hero Bar (1:1 Waste-Analytics + a9fd45d2) */
.hero-kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kpi-tile {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 14px;
  border-radius: 16px;
  background: var(--raised);
  border: 1px solid var(--line);
  transition: transform 240ms var(--ease-spring), border-color 180ms, box-shadow 220ms;
}
.kpi-tile:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 10px 22px -16px rgba(17, 17, 20, .2); }
.kpi-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.kpi-ic .svg-i { width: 17px; height: 17px; }
.kt-mint { background: var(--mint-bg); border-color: var(--mint-line); }
.kt-mint .kpi-ic { background: #FFFFFF; color: var(--mint); }
.kt-blue { background: var(--blue-bg); border-color: var(--blue-line); }
.kt-blue .kpi-ic { background: #FFFFFF; color: var(--blue); }
.kt-orange { background: var(--orange-bg); border-color: var(--orange-line); }
.kt-orange .kpi-ic { background: #FFFFFF; color: var(--orange); }
.kt-rose { background: var(--coral-bg); border-color: var(--coral-line); }
.kt-rose .kpi-ic { background: #FFFFFF; color: var(--coral); }
.kpi-meta { flex: 1; min-width: 0; display: grid; gap: 1px; }
.kpi-meta small { font-size: 12px; color: var(--text-2); font-weight: 550; }
.kpi-meta b { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-arr { color: var(--muted); transition: transform 260ms var(--ease-spring), color 160ms; }
.kpi-arr .svg-i { width: 15px; height: 15px; }
.kpi-tile:hover .kpi-arr { transform: translate(2px, -2px); color: var(--text); }

.pulse-line { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; overflow: hidden; }
.pulse-line i { position: absolute; top: 0; height: 100%; width: 32%; background: linear-gradient(90deg, transparent, var(--mint), var(--blue), transparent); animation: scan 2s linear infinite; }
@keyframes scan { from { left: -32%; } to { left: 100%; } }

/* Row 2: 2x2 Soft Action Bento + Interactive Activity Matrix */
.ov-bento-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; margin-top: 16px; align-items: stretch; }
.action-bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.ab-card {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform 260ms var(--ease-spring), box-shadow 240ms ease, border-color 180ms;
}
.ab-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px -20px rgba(17, 17, 20, .25); }
.ab-card:active { transform: scale(.97); }
.ab-orange { background: var(--orange-bg); border-color: var(--orange-line); }
.ab-mint { background: var(--mint-bg); border-color: var(--mint-line); }
.ab-blue { background: var(--blue-bg); border-color: var(--blue-line); }
.ab-sand { background: var(--surface); border-color: var(--line-strong); }

.ab-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ab-ic {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--ink); color: #FFFFFF;
  transition: transform 280ms var(--ease-spring);
}
.ab-orange .ab-ic { background: var(--orange); }
.ab-mint .ab-ic { background: var(--mint); }
.ab-blue .ab-ic { background: var(--blue); }
.ab-card:hover .ab-ic { transform: scale(1.08) rotate(-5deg); }
.ab-pill {
  font-size: 10.5px; font-weight: 700;
  padding: 3px 8px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .86);
  color: var(--text);
  border: 1px solid rgba(17, 17, 20, .08);
}
.ab-body { display: grid; gap: 2px; padding-right: 22px; }
.ab-body b { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.ab-body span { font-size: 12.5px; color: var(--text-2); }
.ab-go {
  position: absolute; right: 14px; bottom: 14px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  border: 1px solid rgba(17, 17, 20, .08);
  display: grid; place-items: center; color: var(--text);
  transition: transform 260ms var(--ease-spring), background-color 160ms, color 160ms;
}
.ab-go .svg-i { width: 13px; height: 13px; }
.ab-card:hover .ab-go { background: var(--ink); color: #FFFFFF; transform: translate(2px, -2px); }

/* Interactive Activity Matrix + Toggleable Hatched Bars (1:1 charts.mp4 + VaultBank) */
.matrix-card { padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
.matrix-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.matrix-head p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
#matrix-mode-btn.is-active { background: var(--ink); color: #FFFFFF; }

.tile-matrix {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}
.tm-cell {
  aspect-ratio: 1;
  width: 100%;
  border: 0;
  border-radius: 9px;
  background: #ECECE6;
  transition: transform 240ms var(--ease-spring), background-color 220ms, box-shadow 220ms;
}
.tm-cell:hover, .tm-cell:focus-visible { transform: scale(1.16); z-index: 2; box-shadow: 0 6px 14px -4px rgba(17, 17, 20, .25); }
.tm-cell.lv-mint { background: var(--mint); }
.tm-cell.lv-blue.mid { background: #7FA2FF; }
.tm-cell.lv-blue.hi { background: var(--blue); }
.tm-cell.lv-orange { background: var(--orange); }
.tm-cell.lv-live { background: var(--mint); animation: pulse 1.5s ease-out infinite; }
.tm-cell.lv-err { background: var(--coral); }

.hatch-bars {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  height: 132px;
  align-items: end;
}
.hb-col { display: grid; gap: 6px; justify-items: center; height: 100%; grid-template-rows: 1fr auto; }
.hb-bar {
  width: 100%; height: 100%;
  border-radius: 12px;
  background-color: var(--raised);
  background-image: var(--hatch);
  border: 1px solid var(--line);
  display: flex; align-items: flex-end;
  overflow: hidden; padding: 3px;
}
.hb-fill { width: 100%; height: 22%; border-radius: 8px; transition: height 620ms var(--ease-spring); }
.hb-mint { background: var(--mint); }
.hb-blue { background: var(--blue); }
.hb-orange { background: var(--orange); }
.hb-ink { background: var(--ink); }
.hb-emerald { background: #14B881; }
.hb-col small { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; color: var(--muted); }

.matrix-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 12px;
}
.matrix-tip {
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
}

/* Connected Accounts Strip (Single Clean Card, Crisp White + on Black Tile) */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.acc-strip-pad { padding: 16px 20px; display: grid; gap: 12px; }
.acc-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.acc-strip::-webkit-scrollbar { display: none; }
.acc-pill { flex: none; width: 64px; display: grid; justify-items: center; gap: 6px; text-align: center; transition: transform 240ms var(--ease-spring); }
.acc-pill:hover { transform: translateY(-2px); }
.acc-pill .acc-box {
  width: 50px; height: 50px;
  border-radius: 15px;
  display: grid; place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--raised);
  font-family: var(--font-display); font-weight: 700; font-size: 18px; color: #FFFFFF;
}
.acc-pill .acc-box.add-box-ic {
  background: var(--ink);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 6px 14px -6px rgba(17, 17, 20, .4);
}
.acc-pill .acc-box.add-box-ic .svg-i { color: #FFFFFF; width: 20px; height: 20px; }
.acc-pill .acc-box img { width: 100%; height: 100%; object-fit: cover; }
.acc-pill span { font-size: 12px; color: var(--text-2); width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

.ov-bots-compact:empty { display: none; }
.ov-bots-compact { border-top: 1px solid var(--line); margin: 0 -20px -16px; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; }
.list-row.compact { padding: 10px 20px; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .s { font-size: 12.5px; color: var(--muted); }

/* 3D Expanding / Collapsing Card Deck (1:1 Expanding-Transactions.mp4!) */
.stack-toggle .svg-i { transition: transform 280ms var(--ease-spring); width: 14px; height: 14px; }
.is-folded .stack-toggle .svg-i { transform: rotate(-90deg); }
.deck-wrap { padding: 12px 14px 14px; }
.deck-list { display: grid; gap: 8px; transition: gap 360ms var(--ease-out); }
.deck-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 15px;
  background: var(--raised);
  border: 1px solid var(--line);
  transform-origin: top center;
  transition: transform 380ms var(--ease-spring), opacity 300ms ease, margin-top 360ms var(--ease-out), box-shadow 300ms;
}
.deck-card .deck-ic {
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--text);
}
.deck-card .grow { flex: 1; min-width: 0; }
.deck-card .t { font-weight: 650; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-card .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Folded 3D Stack Physics */
.stack-panel.is-folded .deck-list { gap: 0; padding-bottom: 14px; }
.stack-panel.is-folded .deck-card {
  background: var(--surface);
  box-shadow: 0 6px 18px -10px rgba(17, 17, 20, .18);
  position: relative;
  z-index: calc(10 - var(--di, 0));
}
.stack-panel.is-folded .deck-card:nth-child(n+2) {
  margin-top: -50px;
  transform: scale(calc(1 - var(--di, 1) * 0.055)) translateY(calc(var(--di, 1) * 8px));
  opacity: calc(1 - var(--di, 1) * 0.22);
}
.stack-panel.is-folded .deck-card:nth-child(n+4) { opacity: 0; pointer-events: none; margin-top: -62px; }

/* History 3D Stack Mode */
#history.is-folded { padding: 14px; background: transparent; border: 0; box-shadow: none; }
#history.is-folded .history-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 22px -12px rgba(17, 17, 20, .18);
  position: relative;
  z-index: calc(10 - var(--di, 0));
  transition: transform 380ms var(--ease-spring), opacity 300ms, margin-top 360ms var(--ease-out);
}
#history.is-folded .history-item:nth-child(n+2) {
  margin-top: -54px;
  transform: scale(calc(1 - var(--di, 1) * 0.045)) translateY(calc(var(--di, 1) * 9px));
  opacity: calc(1 - var(--di, 1) * 0.18);
}
#history.is-folded .history-item:nth-child(n+4) { display: none; }

/* ============================================================
   11. Accounts Vault Page
   ============================================================ */
.add-box { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.add-results { display: grid; gap: 8px; margin-top: 14px; }
.add-result { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 13px; background: var(--raised); border: 1px solid var(--line); animation: drop-in 280ms var(--ease-out) both; }
.add-result .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.add-result.ok .ic { background: var(--mint-bg); color: var(--mint); }
.add-result.bad .ic { background: var(--coral-bg); color: var(--coral); }
.add-result .fix { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.draw-check path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 440ms var(--ease-out) 100ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.bots-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.token-pill { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--raised); border: 1px solid var(--line); font-size: 11.5px; color: var(--text-2); }
.bots { display: grid; grid-template-columns: repeat(auto-fill, minmax(256px, 1fr)); gap: 12px; margin-top: 16px; }
.bot {
  display: grid; gap: 14px; padding: 16px;
  border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  transition: border-color var(--t-fast), transform 240ms var(--ease-spring), box-shadow 220ms;
}
.bot:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(17, 17, 20, .18); }
.bot.is-active { border-color: var(--mint-line); }
.bot.removing { animation: bot-out 280ms var(--ease-out) forwards; }
@keyframes bot-out { to { opacity: 0; transform: scale(.88); } }
.bot-top { display: flex; gap: 12px; align-items: center; }
.bot-top .grow { flex: 1; min-width: 0; }
.bot-name { font-family: var(--font-display); font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bot-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bot-meta { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.rename-input { height: 32px; padding: 4px 8px; font-weight: 700; }

/* ============================================================
   12. Studio & Run — Compact 2x2 Presets, Per-Channel Studio & Slide-to-Start
   ============================================================ */
.preset-strip { padding: 14px 16px; margin-bottom: 16px; display: grid; gap: 10px; }
.preset-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.preset-head b { font-family: var(--font-display); font-size: 14px; color: var(--text); }
.preset-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.preset-btn {
  display: flex; align-items: center; gap: 10px;
  min-width: 0; width: 100%; overflow: hidden;
  padding: 10px 12px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--raised);
  text-align: left;
  transition: border-color var(--t-fast), transform 240ms var(--ease-spring), background-color var(--t-fast), box-shadow 220ms;
}
.preset-btn:hover { transform: translateY(-2px); border-color: var(--line-strong); background: var(--surface); }
.preset-btn:active { transform: scale(.96); }
.preset-btn .p-orb {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; flex: none;
  transition: transform 260ms var(--ease-spring);
}
.preset-btn .p-orb .svg-i { width: 16px; height: 16px; }
.pb-mint .p-orb { background: var(--mint-bg); color: var(--mint); }
.pb-blue .p-orb { background: var(--blue-bg); color: var(--blue); }
.pb-orange .p-orb { background: var(--orange-bg); color: var(--orange); }
.pb-ink .p-orb { background: var(--ink); color: #FFFFFF; }
.preset-btn:hover .p-orb { transform: scale(1.08); }
.preset-btn.active {
  background: var(--ink);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 8px 20px -10px rgba(17, 17, 20, .5);
}
.preset-btn.active small { color: rgba(255, 255, 255, .72); }
.preset-btn.active .p-orb { background: rgba(255, 255, 255, .16); color: #FFFFFF; }
.preset-btn .p-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.preset-btn b { font-family: var(--font-display); font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preset-btn small { font-size: 11px; color: var(--muted); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.run-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.run-layout > *, .run-side { min-width: 0; }
.run-side { position: sticky; top: 76px; display: grid; gap: 16px; }
.run-side .panel, #logs-panel { overflow: visible; }
.form-section + .form-section { margin-top: 16px; }
.form-section .panel-body { display: grid; gap: 18px; }
.form-section .field + .field { margin-top: 0; }
.cond { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 380ms var(--ease-out), opacity var(--t-med); }
.cond > .inner { overflow: hidden; display: grid; gap: 18px; }
.cond.closed { grid-template-rows: 0fr; opacity: 0; }
#stagger-wrap .inner { padding-top: 14px; }
.char-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.char-count.near { color: var(--amber); }

/* Custom Per-Channel Cards */
.ch-studio { display: grid; gap: 12px; }
.ch-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ch-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ch-list { display: grid; gap: 10px; }
.ch-empty { padding: 24px 16px; border-radius: 15px; border: 1.5px dashed var(--line-strong); background: var(--raised); text-align: center; color: var(--muted); font-size: 13.5px; }

.ch-card {
  border-radius: 16px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-left: 3.5px solid var(--line-strong);
  overflow: hidden;
  transition: border-color var(--t-fast), opacity 220ms, transform 220ms var(--ease-out);
}
.ch-card[data-state="valid"] { border-left-color: var(--mint); }
.ch-card[data-state="warn"] { border-left-color: var(--amber); }
.ch-card[data-state="paused"] { border-left-color: var(--muted); opacity: .62; }
.ch-card.removing { opacity: 0; transform: scale(.95); }

.ch-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 12px; }
.ch-head-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 2px 0; text-align: left; }
.ch-num { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); font-size: 11.5px; font-weight: 700; color: var(--text); flex: none; }
.ch-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ch-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ch-title-row b { font-family: var(--font-display); font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ch-time { font-size: 11px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.ch-preview-line { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.ch-del:hover { color: var(--coral) !important; background: var(--coral-bg) !important; }
.ch-chev .svg-i { transition: transform 280ms var(--ease-spring); }
.ch-card.open .ch-chev .svg-i { transform: rotate(180deg); }

.ch-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 320ms var(--ease-out); }
.ch-card.open .ch-body { grid-template-rows: 1fr; }
.ch-body-inner { overflow: hidden; display: grid; gap: 14px; padding: 0 14px; border-top: 1px solid transparent; transition: padding 260ms var(--ease-out), border-color 200ms; }
.ch-card.open .ch-body-inner { padding: 14px; border-top-color: var(--line); }
.ch-grid-2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; }
.ch-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.pref-in { display: flex; align-items: center; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface); overflow: hidden; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.pref-in:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 17, 20, .08); }
.pref-in .pref { padding: 0 9px; font-size: 11px; color: var(--muted); border-right: 1px solid var(--line); height: 38px; display: grid; place-items: center; background: var(--raised); flex: none; }
.pref-in .input { border: 0 !important; box-shadow: none !important; background: transparent !important; height: 38px; min-height: 38px; padding: 0 8px; width: 100%; min-width: 0; }
.pref-in .suf { padding-right: 10px; font-size: 12px; color: var(--muted); flex: none; }

.id-pill { font-family: var(--font-mono); font-size: 11px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.id-pill.ok { background: var(--mint-bg); color: var(--mint); border-color: var(--mint-line); }
.id-pill.bad { background: var(--coral-bg); color: var(--coral); border-color: var(--coral-line); }

.ch-add-dashed {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 16px;
  border-radius: 15px;
  border: 1.5px dashed var(--line-strong);
  background: transparent;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  transition: border-color var(--t-fast), background-color var(--t-fast), transform 220ms var(--ease-spring);
}
.ch-add-dashed:hover:not(:disabled) { border-color: var(--ink); background: var(--raised); transform: translateY(-1px); }
.ch-add-dashed:disabled { opacity: .45; cursor: not-allowed; }

/* Discord Markdown Preview */
.ta-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.dc-preview { margin-top: 8px; padding: 12px 14px; border-radius: 13px; background: #F2F3F5; border: 1px solid #DCDFE6; color: #2E3338; font-size: 14px; line-height: 1.45; animation: drop-in 200ms var(--ease-out); }
.dc-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; font-size: 12.5px; }
.dc-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--orange); display: inline-block; }
.dc-user { font-weight: 700; color: #060607; }
.dc-ts { font-size: 11px; color: #6E7681; }
.dc-body { overflow-wrap: anywhere; }
.dc-code { font-family: var(--font-mono); font-size: 12.5px; padding: 1px 5px; border-radius: 4px; background: rgba(17, 17, 20, .08); }
.dc-pre { font-family: var(--font-mono); font-size: 12.5px; padding: 8px 10px; margin: 6px 0; border-radius: 8px; background: rgba(17, 17, 20, .08); overflow-x: auto; }

.pick-list { display: grid; gap: 4px; max-height: 280px; overflow: auto; padding: 8px; }
.pick { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 12px; cursor: pointer; transition: background-color var(--t-fast); }
.pick:hover { background: var(--raised); }
.pick .grow { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tactile Slide-to-Start Sweep Pill (1:1 091ce629-Showcase.png!) */
.launch-card { border-color: var(--line-strong); }
.power {
  position: relative;
  height: 60px;
  border-radius: 18px;
  background: #EAE9E3;
  border: 1px solid rgba(17, 17, 20, .1);
  box-shadow: inset 0 2px 5px rgba(17, 17, 20, .07);
  overflow: hidden;
  user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.power.launched { animation: launch-ring 540ms var(--ease-out); }
@keyframes launch-ring { 0% { box-shadow: 0 0 0 0 rgba(14, 159, 110, .45); } 100% { box-shadow: 0 0 0 16px transparent; } }
.power .fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: var(--orange);
  transition: width 260ms var(--ease-out);
}
.power .label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 60px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.power .label .arrows { display: inline-flex; margin-right: 7px; color: var(--orange); }
.power .label .arrows i { animation: chevrons 1.4s ease-in-out infinite; opacity: .25; font-style: normal; }
.power .label .arrows i:nth-child(2) { animation-delay: .15s; }
.power .label .arrows i:nth-child(3) { animation-delay: .3s; }
@keyframes chevrons { 40% { opacity: 1; } }
.power .knob {
  position: absolute;
  top: 5px; left: 5px;
  width: 48px; height: 48px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: #FFFFFF;
  color: var(--ink);
  border: 1px solid rgba(17, 17, 20, .08);
  box-shadow: 0 4px 12px -2px rgba(17, 17, 20, .18), 0 1px 2px rgba(17, 17, 20, .08);
  cursor: grab;
  transition: transform 380ms var(--ease-spring), background-color 220ms, color 220ms;
  touch-action: none;
}
.power .knob .svg-i { width: 20px; height: 20px; }
.power.dragging .knob, .power.dragging .fill { transition: none; }
.power.running { background: var(--mint); border-color: transparent; box-shadow: 0 10px 26px -12px rgba(14, 159, 110, .55); }
.power.running .knob { background: #FFFFFF; color: var(--coral); }
.power.running .label { color: #FFFFFF; padding: 0 60px 0 18px; }
.power.running .stripes { opacity: 1; }
.power .stripes { position: absolute; inset: 0; opacity: 0; transition: opacity var(--t-med); background: repeating-linear-gradient(-45deg, transparent 0 14px, rgba(255, 255, 255, .14) 14px 28px); background-size: 40px 40px; animation: stripes 1s linear infinite; }
@keyframes stripes { to { background-position: 40px 0; } }
.power.busy { pointer-events: none; opacity: .7; }
.power-hint { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 8px; }

/* ============================================================
   13. Live Logs & History
   ============================================================ */
.log-progress-bar { height: 3px; background: var(--raised); overflow: hidden; border-radius: 22px 22px 0 0; }
.log-progress-bar .lp-seg { display: block; height: 100%; width: 34%; background: linear-gradient(90deg, transparent, var(--orange), var(--mint), transparent); animation: lp-slide 1.7s ease-in-out infinite; }
@keyframes lp-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(380%); } }

.log-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.log-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.log-search { max-width: 210px; min-width: 140px; }
.log-search .input { height: 34px; min-height: 34px; font-size: 13px; }
.log-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: #E9E9E5; border: 1px solid var(--line); }
.log-tabs button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 6px 10px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--muted); transition: background-color var(--t-fast), color var(--t-fast); }
.log-tabs button[aria-pressed="true"] { background: #FFFFFF; color: var(--text); box-shadow: var(--shadow-xs); }
.log-tabs .n { font-size: 11px; min-width: 18px; padding: 1px 6px; border-radius: var(--r-pill); background: var(--raised); font-variant-numeric: tabular-nums; }
.log-tabs [data-filter="success"] .n { background: var(--mint-bg); color: var(--mint); }
.log-tabs [data-filter="warn"] .n { background: var(--amber-bg); color: var(--amber); }
.log-tabs [data-filter="error"] .n { background: var(--coral-bg); color: var(--coral); }

.bot-filter { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.bot-filter::-webkit-scrollbar { display: none; }
.bot-chip { display: inline-flex; align-items: center; gap: 7px; flex: none; height: 30px; padding: 0 12px 0 9px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text-2); transition: all var(--t-fast); }
.bot-chip[aria-pressed="true"] { background: var(--ink); border-color: transparent; color: #FFFFFF; }
.bot-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.bot-chip .dot.running { background: var(--mint); color: var(--mint); animation: pulse 1.6s ease-out infinite; }
.bot-chip .dot.failed { background: var(--coral); }
.bot-chip .dot.done, .bot-chip .dot.stopped { background: var(--blue); }

.log-box { height: min(62vh, 620px); overflow: auto; padding: 8px 0; font-size: 13.5px; background: #FAFAF8; position: relative; }
.log { display: grid; grid-template-columns: 34px 66px 10px 1fr; gap: 0 8px; padding: 6px 14px; border-left: 3px solid transparent; align-items: start; animation: log-in 240ms var(--ease-out); }
.log:hover { background: var(--raised); }
.log.success { border-left-color: var(--mint); }
.log.warn { border-left-color: var(--amber); background: rgba(201, 122, 6, .04); }
.log.error { border-left-color: var(--coral); background: rgba(224, 45, 73, .04); }
.log .lnum { font-size: 11px; color: var(--muted); opacity: .55; text-align: right; padding-top: 2px; user-select: none; font-variant-numeric: tabular-nums; }
.log .time { font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding-top: 2px; font-variant-numeric: tabular-nums; }
.log .lpipe { color: var(--line-strong); font-family: var(--font-mono); font-size: 12px; padding-top: 1px; user-select: none; }
.log .msg { min-width: 0; overflow-wrap: anywhere; }
.lvl-pill { display: inline-block; margin-right: 7px; padding: 0 7px; border-radius: var(--r-pill); font-size: 10.5px; font-weight: 700; background: var(--raised); color: var(--text-2); border: 1px solid var(--line); vertical-align: 1px; }
.lvl-pill.success { background: var(--mint-bg); color: var(--mint); border-color: var(--mint-line); }
.lvl-pill.warn { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-line); }
.lvl-pill.error { background: var(--coral-bg); color: var(--coral); border-color: var(--coral-line); }
.log .who { display: inline-block; margin-right: 7px; padding: 0 7px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 650; color: var(--text-2); }
.log.error .text { color: var(--coral); }
.log.warn .text { color: var(--amber); }
.log .fix { margin-top: 6px; padding: 8px 10px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--amber); font-size: 13px; color: var(--text-2); display: flex; gap: 8px; }
.log.error .fix { border-left-color: var(--coral); }
.log .fix .svg-i { width: 16px; height: 16px; margin-top: 1px; color: var(--amber); }
@keyframes log-in { from { opacity: 0; transform: translateX(-6px); } }
.log-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.jump { position: absolute; right: 18px; bottom: 70px; z-index: 3; animation: drop-in 220ms var(--ease-spring); }
.log-box:not(:has(.log:not(.hidden))):not(:has(.empty))::after { content: "No lines match this filter yet."; display: block; padding: 40px 16px; text-align: center; color: var(--muted); }

.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 16px; border-top: 1px solid var(--line); }
.result-card { padding: 13px 14px; border-radius: 15px; border: 1px solid var(--line); background: var(--raised); display: grid; gap: 6px; }
.result-card[data-status="done"] { border-left: 3.5px solid var(--mint); }
.result-card[data-status="failed"] { border-left: 3.5px solid var(--coral); }
.result-card .stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.result-card .stats b { color: var(--text); font-variant-numeric: tabular-nums; }

/* History */
.history-item { border-top: 1px solid var(--line); }
.history-item:first-child { border-top: 0; }
.history-sum { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 15px 20px; border: 0; background: transparent; text-align: left; transition: background-color var(--t-fast); }
.history-sum:hover { background: var(--raised); }
.history-sum .chev { color: var(--muted); transition: transform var(--t-med) var(--ease-spring); }
.history-item.open .history-sum .chev { transform: rotate(90deg); }
.history-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 360ms var(--ease-out); }
.history-item.open .history-body { grid-template-rows: 1fr; }
.history-body > div { overflow: hidden; }
.history-body .log-box { height: auto; max-height: 360px; border-top: 1px solid var(--line); }

/* ============================================================
   14. Admin Tables & Stats
   ============================================================ */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 650; font-size: 12px; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color var(--t-fast); }
.table tbody tr:hover { background: var(--raised); }
.table .num { font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.row-click { cursor: pointer; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 18px 20px; display: grid; gap: 6px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat span { font-size: 13px; color: var(--muted); }
.stat b { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .bar { height: 7px; border-radius: 5px; background-color: var(--sunken); background-image: var(--hatch); overflow: hidden; margin-top: 4px; }
.stat .bar i { display: block; height: 100%; width: 0; background: var(--orange); border-radius: 5px; transition: width 850ms var(--ease-out); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1; min-width: 180px; max-width: 320px; }
.search .svg-i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.search .input { padding-left: 36px; min-height: 38px; height: 38px; }
.key-pill { font-family: var(--font-mono); font-size: 12px; padding: 3px 8px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); white-space: nowrap; }
.key-cards { display: none; }
.reveal-list { display: grid; gap: 8px; }
.reveal-key { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-radius: 13px; background: var(--raised); border: 1.5px dashed var(--orange-line); }
.reveal-key code { flex: 1; font-family: var(--font-mono); font-size: 14px; overflow-wrap: anywhere; }
.reveal-key small { display: block; color: var(--muted); font-family: var(--font-ui); font-size: 12px; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 13px; background: var(--amber-bg); border: 1px solid var(--amber-line); color: var(--amber); font-size: 13.5px; }
.copied { animation: pop 260ms var(--ease-spring); color: var(--mint) !important; }

.live-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 16px 20px; }
.live-row + .live-row { border-top: 1px solid var(--line); }
.live-row .bars { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 8px; }
.live-row .bars i { width: 14px; height: 6px; border-radius: 3px; background: var(--sunken); }
.live-row .bars i.on { background: var(--mint); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .45; } }

/* Utilities */
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.hstack { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hstack.tight { gap: 6px; }
.clickable { cursor: pointer; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.span-all { grid-column: 1 / -1; }
.sk-dot { width: 22px; height: 22px; border-radius: 50%; }
.sk-line { height: 12px; width: 60%; margin-top: 5px; }
.sk-a { height: 14px; width: 40%; margin-bottom: 8px; }
.sk-b { height: 12px; width: 65%; }
#tabbar.admin-tabs { --tabs: 3; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .field + .field { margin-top: 0; }

/* ============================================================
   15. Responsive (PC, Tablet & Mobile — Zero Overlap, Floating Black Dock)
   ============================================================ */
@media (max-width: 1040px) {
  .ov-bento-grid { grid-template-columns: 1fr; }
  .hero-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .run-layout { grid-template-columns: 1fr; }
  .run-side { position: static; }
  .preset-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

@media (max-width: 820px) {
  .shell, .shell.is-collapsed { grid-template-columns: 1fr; }
  .side { display: none; }
  .mobile-brand { display: flex; align-items: center; }
  .top { padding: 11px 14px; }
  .top-title .crumb, .top-title .sep { display: none; }
  .content { padding: 8px 14px calc(106px + env(safe-area-inset-bottom)); }

  /* Floating Pitch-Black Bottom Pill Dock (1:1 jooob.mp4!) */
  .tabbar {
    display: grid;
    grid-template-columns: repeat(var(--tabs, 5), 1fr);
    position: fixed;
    z-index: 50;
    left: 12px; right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    padding: 5px;
    border-radius: 22px;
    background: #111114;
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 20px 44px -10px rgba(17, 17, 20, .48);
  }
  .tabbar a {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 8px 0 6px;
    border-radius: 17px;
    color: rgba(255, 255, 255, .56);
    font-size: 10.5px;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
    transition: color 220ms ease;
  }
  .tabbar a .svg-i { width: 19px; height: 19px; transition: transform 300ms var(--ease-spring); }
  .tabbar a[aria-current="page"] { color: #111114; }
  .tabbar a[aria-current="page"] .svg-i { transform: translateY(-1px) scale(1.06); }
  .tabbar a:active .svg-i { transform: scale(.8); }
  .tabbar .tab-ind {
    position: absolute;
    top: 5px; bottom: 5px; left: 5px;
    border-radius: 17px;
    background: #FFFFFF;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, .35);
    transition: transform 360ms var(--ease-spring);
  }
  .tabbar .live-dot { position: absolute; top: 6px; right: calc(50% - 15px); width: 7px; height: 7px; border-radius: 50%; background: var(--mint); color: var(--mint); animation: pulse 1.6s ease-out infinite; }

  .grid-2 { grid-template-columns: 1fr; }
  .add-box { grid-template-columns: 1fr; }
  .add-box .btn { width: 100%; }
  .ch-grid-2, .ch-grid-3 { grid-template-columns: 1fr; }
  .ch-head { flex-wrap: wrap; }
  .ch-actions { width: 100%; justify-content: space-between; padding-top: 8px; border-top: 1px dashed var(--line); }
  .ch-tools { width: 100%; }
  .ch-tools .btn { flex: 1 1 auto; }

  .log { grid-template-columns: 58px 8px minmax(0, 1fr); gap: 0 6px; padding: 6px 10px; font-size: 13px; }
  .log .lnum { display: none; }
  .log .time { font-size: 10.5px; }
  .log-box { height: 58vh; }
  .log-search { max-width: none; width: 100%; }
  .log-controls { width: 100%; }
  .log-tabs { width: 100%; justify-content: space-between; }
  .log-tabs button { flex: 1; justify-content: center; padding: 6px 4px; font-size: 11.5px; }

  .table-keys { display: none; }
  .key-cards { display: grid; }
  .key-cards .kc { padding: 14px 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
  .key-cards .kc:first-child { border-top: 0; }
  .key-cards .kc .row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
  .key-cards .kc .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 13px; color: var(--muted); }
  .key-cards .kc .meta b { color: var(--text); font-weight: 650; }
  .bots-toolbar .search, .toolbar .search { flex: 1 1 100%; max-width: none; }
  .bots-toolbar .seg, .toolbar .seg { width: 100%; }
  .history-sum { padding: 14px; gap: 8px; }
  .toasts { left: 14px; right: 14px; bottom: calc(92px + env(safe-area-inset-bottom)); width: auto; }
}

@media (max-width: 540px) {
  .hero-bar { padding: 16px; gap: 14px; }
  .kpi-tile { padding: 11px 11px; gap: 9px; border-radius: 14px; }
  .kpi-ic { width: 30px; height: 30px; border-radius: 9px; }
  .kpi-meta b { font-size: 20px; }
  .kpi-arr { display: none; }

  .action-bento { gap: 9px; }
  .ab-card { padding: 13px; gap: 12px; border-radius: 17px; }
  .ab-ic { width: 34px; height: 34px; border-radius: 10px; }
  .ab-body { padding-right: 0; }
  .ab-body b { font-size: 14.5px; }
  .ab-body span { font-size: 11.5px; }
  .ab-go { display: none; }

  .tile-matrix { gap: 5px; }
  .tm-cell { border-radius: 7px; }

  /* Compact 2x2 Quick Presets even on 360px phones! */
  .preset-strip { padding: 12px; }
  .preset-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .preset-btn { padding: 9px 10px; gap: 8px; border-radius: 13px; }
  .preset-btn .p-orb { width: 28px; height: 28px; border-radius: 8px; }
  .preset-btn .p-orb .svg-i { width: 14px; height: 14px; }
  .preset-btn b { font-size: 12.5px; }
  .preset-btn small { font-size: 10.5px; }

  .panel-pad, .panel-body { padding: 15px; }
  .panel-head { padding: 14px 15px; }
  .acc-strip-pad { padding: 14px 15px; }
  .seg button { white-space: normal; padding: 8px 6px; font-size: 12px; }
  .seg-lg button { padding: 9px 8px; font-size: 12.5px; }
  .form-grid { grid-template-columns: 1fr; }
  .gate-card { padding: 22px 18px 20px; }
  .key-input { font-size: 13.5px; letter-spacing: .04em; }
  #top-live { padding: 0 8px; font-size: 11px; height: 24px; }
}

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