/* Campus landing — generated backdrop + live glass hotspots. All classes are prefixed cmp-. */

.cmp {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #1a2a40 0%, #0d1526 55%, #070b14 100%);
}

.cmp-hud {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(10, 16, 30, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.cmp-hud-brand {
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: #fde68a;
}

.cmp-hud-stat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cmp-led {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-offline);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}
.cmp-led.ok {
  background: var(--status-available);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.7);
}
.cmp-led.busy {
  background: var(--status-working);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
}
.cmp-led.warn {
  background: var(--status-waiting);
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.7);
}
.cmp-led.idle {
  background: var(--muted);
}

.cmp-stage {
  --cmp-px: 0;
  --cmp-py: 0;
  position: relative;
  aspect-ratio: 16 / 9;
  width: min(100%, calc((100vh - 150px) * 16 / 9));
  max-height: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: #101a2c;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  isolation: isolate;
}

.cmp-bg {
  position: absolute;
  inset: -2%;
  width: 104%;
  height: 104%;
  object-fit: cover;
  opacity: 0;
  transform: translate(calc(var(--cmp-px) * 1px), calc(var(--cmp-py) * 1px)) scale(1.01);
  transition: opacity 0.6s ease, transform 0.5s ease-out;
  will-change: transform;
}
.cmp-stage.is-ready .cmp-bg {
  opacity: 1;
}

.cmp-light {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 214, 150, 0) 32%, rgba(255, 214, 150, 0.16) 46%, rgba(255, 214, 150, 0) 60%);
  mix-blend-mode: screen;
  animation: cmp-light 26s ease-in-out infinite alternate;
}

.cmp-dust {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.cmp-dust i {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 240, 205, 0.8);
  filter: blur(0.4px);
  opacity: 0;
  animation: cmp-float 14s linear infinite;
}

.cmp-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  z-index: 2;
}
.cmp-hotspot:focus-visible {
  outline: none;
}

.cmp-glow {
  position: absolute;
  inset: 4% 6%;
  border-radius: 40% / 34%;
  box-shadow: 0 0 0 0 rgba(255, 196, 110, 0);
  transition: box-shadow 0.35s ease, background 0.35s ease;
}
.cmp-finance.is-online .cmp-glow {
  animation: cmp-breathe 5s ease-in-out infinite;
}
.cmp-hotspot:hover .cmp-glow,
.cmp-hotspot:focus-visible .cmp-glow {
  box-shadow: 0 0 90px 24px rgba(255, 196, 110, 0.32), inset 0 0 70px rgba(255, 196, 110, 0.22);
  background: rgba(255, 196, 110, 0.06);
}
.cmp-hotspot:focus-visible .cmp-plate {
  box-shadow: 0 0 0 2px var(--accent), 0 14px 40px rgba(0, 0, 0, 0.4);
}

/* Marketing hut: the same hotspot pattern in the department's warm amber. */
.cmp-marketing {
  --cmp-amber: 245, 158, 11;
}
.cmp-marketing .cmp-glow {
  inset: 6% 8%;
  border-radius: 38% / 34%;
}
.cmp-marketing.is-online .cmp-glow {
  animation: cmp-breathe-amber 5.5s ease-in-out infinite;
}
.cmp-marketing:hover .cmp-glow,
.cmp-marketing:focus-visible .cmp-glow {
  box-shadow: 0 0 70px 18px rgba(var(--cmp-amber), 0.3), inset 0 0 50px rgba(var(--cmp-amber), 0.22);
  background: rgba(var(--cmp-amber), 0.07);
}
.cmp-marketing:focus-visible .cmp-plate {
  box-shadow: 0 0 0 2px #f59e0b, 0 14px 40px rgba(0, 0, 0, 0.4);
}
.cmp-marketing.is-offline .cmp-plate {
  opacity: 0.86;
}

.cmp-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}

.cmp-plate {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(12, 18, 32, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  text-align: left;
  white-space: nowrap;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cmp-plate-main {
  position: absolute;
  left: 50%;
  bottom: -6%;
  transform: translate(-50%, 0);
}
.cmp-hotspot:hover .cmp-plate-main {
  transform: translate(-50%, -4px);
}
.cmp-plate-title {
  font-size: clamp(14px, 1.4vw, 20px);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.cmp-plate-sub {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: clamp(11px, 0.95vw, 13px);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cmp-plate-cta {
  margin-top: 4px;
  font-size: clamp(11px, 0.9vw, 12px);
  font-weight: 600;
  color: #fde68a;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* the Marketing plate hangs below a smaller hut, so it is a size down from the Finance one */
.cmp-plate-marketing {
  bottom: -22%;
  padding: 8px 12px;
  border-radius: 12px;
  border-color: rgba(245, 158, 11, 0.35);
}
.cmp-plate-marketing .cmp-plate-title {
  font-size: clamp(13px, 1.15vw, 17px);
}
.cmp-plate-marketing .cmp-plate-sub {
  font-size: clamp(10px, 0.85vw, 12px);
}
.cmp-plate-marketing .cmp-plate-cta {
  font-size: clamp(10px, 0.8vw, 11px);
  color: #fcd34d;
}

.cmp-plate-muted {
  opacity: 0.78;
  padding: 7px 11px;
  border-radius: 11px;
}
.cmp-plate-muted .cmp-plate-title {
  font-size: clamp(12px, 1.05vw, 15px);
}
.cmp-plate-muted .cmp-plate-sub {
  font-size: clamp(10px, 0.8vw, 12px);
}

.cmp-tag {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: clamp(10px, 0.8vw, 12px);
  color: rgba(226, 232, 240, 0.9);
  background: rgba(12, 18, 32, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
}

@keyframes cmp-light {
  from {
    transform: translateX(-14%);
  }
  to {
    transform: translateX(14%);
  }
}
@keyframes cmp-float {
  0% {
    transform: translate(0, 0);
    opacity: 0;
  }
  12% {
    opacity: 0.9;
  }
  85% {
    opacity: 0.55;
  }
  100% {
    transform: translate(22px, -70px);
    opacity: 0;
  }
}
@keyframes cmp-breathe {
  0%,
  100% {
    box-shadow: 0 0 40px 6px rgba(255, 196, 110, 0.14), inset 0 0 40px rgba(255, 196, 110, 0.1);
  }
  50% {
    box-shadow: 0 0 70px 16px rgba(255, 196, 110, 0.26), inset 0 0 60px rgba(255, 196, 110, 0.16);
  }
}
@keyframes cmp-breathe-amber {
  0%,
  100% {
    box-shadow: 0 0 30px 4px rgba(245, 158, 11, 0.14), inset 0 0 30px rgba(245, 158, 11, 0.1);
  }
  50% {
    box-shadow: 0 0 56px 12px rgba(245, 158, 11, 0.26), inset 0 0 46px rgba(245, 158, 11, 0.16);
  }
}

/* Hidden tab, reduced motion: freeze the ambience (the picture itself stays). */
.cmp-still .cmp-light,
.cmp-still .cmp-dust i,
.cmp-still .cmp-glow {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .cmp-light,
  .cmp-dust i,
  .cmp-glow,
  .cmp-bg,
  .cmp-plate {
    animation: none;
    transition: none;
  }
}

@media (max-width: 900px) {
  .cmp {
    padding: 8px;
  }
  .cmp-hud {
    gap: 10px;
    padding: 6px 12px;
    font-size: 12px;
  }
  .cmp-hud-stat:nth-child(3) {
    display: none;
  }
  .cmp-tag {
    display: none;
  }
}

/* Manufacturing (2026-10-24): the third department, on the hut that used to be "HR, coming soon".
   Same shape as Marketing, in teal. */
.cmp-manufacturing {
  --cmp-amber: 20, 184, 166;
}
.cmp-manufacturing:focus-visible .cmp-plate {
  box-shadow: 0 0 0 2px #14b8a6, 0 14px 40px rgba(0, 0, 0, 0.4);
}
.cmp-plate-manufacturing {
  border-color: rgba(20, 184, 166, 0.4);
}
.cmp-plate-manufacturing .cmp-plate-cta {
  color: #5eead4;
}
/* ============================================================================
   LivingOffice — the animated "living office" floor (premium dark glass).

   Namespace: every class in this file starts with `lo-`. Design tokens come
   from styles.css (:root): --bg, --panel, --border, --text, --muted, --accent
   and the --status-* colours.

   Cascade note: this file is evaluated BEFORE styles.css (App's module graph
   loads first), so every override of a pre-existing rule (toolbar buttons,
   TallyPanel, EmployeePanel) uses two classes and wins by specificity, never
   by source order.
   ========================================================================== */

/* ---------- Root + stage (16:9 "contain" box inside the floor room) ---------- */

.lo-root {
  --lo-glass: rgba(15, 23, 42, 0.58);
  --lo-glass-strong: rgba(15, 23, 42, 0.76);
  --lo-line: rgba(255, 255, 255, 0.22);
  --lo-line-strong: rgba(255, 255, 255, 0.3);
  --lo-shadow: 0 12px 32px rgba(2, 6, 23, 0.45);
  --lo-radius: 14px;
  --lo-ease: cubic-bezier(0.22, 1, 0.36, 1);

  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 14px;
  container-type: size;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(120% 90% at 50% 38%, #172440 0%, var(--bg) 52%, #060a14 100%);
}

/* letterbox vignette */
.lo-root::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.65);
}

.lo-stage {
  --lo-px: 0;
  --lo-py: 0;
  position: relative;
  z-index: 1;
  width: min(100%, calc(100cqh * 16 / 9));
  aspect-ratio: 16 / 9;
  container-type: inline-size;
  overflow: hidden;
  border-radius: 18px;
  isolation: isolate;
  background: #0b1120;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

@supports not (width: 1cqh) {
  .lo-stage {
    width: 100%;
    max-height: 100%;
  }
}

/* ---------- Layer a/b: still + looping video (+ SVG fallback) ---------- */

.lo-media {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform: translate3d(calc(var(--lo-px) * -3px), calc(var(--lo-py) * -3px), 0);
  transition: transform 0.4s var(--lo-ease);
  will-change: transform;
}

.lo-still,
.lo-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
}

.lo-still {
  animation: lo-fade-in 0.6s ease-out;
}

.lo-video {
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

.lo-video.lo-video-live {
  opacity: 1;
}

/* gentle grade so plates and the legend stay legible over any photo */
.lo-grade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.18) 0%, transparent 22%, transparent 70%, rgba(2, 6, 23, 0.42) 100%);
}

/* ---------- Layer c: drifting light shaft / warmth ---------- */

.lo-ambient {
  position: absolute;
  inset: -12%;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.85;
  background:
    linear-gradient(104deg, transparent 28%, rgba(255, 224, 170, 0.14) 42%, rgba(255, 243, 214, 0.26) 49%, rgba(255, 224, 170, 0.12) 56%, transparent 70%),
    radial-gradient(55% 45% at 18% 8%, rgba(125, 211, 252, 0.16), transparent 72%),
    radial-gradient(40% 40% at 88% 92%, rgba(56, 189, 248, 0.08), transparent 70%);
  animation: lo-drift 26s ease-in-out infinite alternate;
  will-change: transform;
}

.lo-evening .lo-ambient {
  background:
    linear-gradient(104deg, transparent 28%, rgba(255, 176, 96, 0.16) 42%, rgba(255, 204, 150, 0.26) 49%, rgba(255, 176, 96, 0.12) 56%, transparent 70%),
    radial-gradient(55% 45% at 18% 8%, rgba(251, 146, 60, 0.14), transparent 72%),
    radial-gradient(40% 40% at 88% 92%, rgba(129, 140, 248, 0.1), transparent 70%);
}

@keyframes lo-drift {
  from {
    transform: translate3d(-3.5%, -1.5%, 0) rotate(0.35deg);
  }
  to {
    transform: translate3d(3.5%, 1.5%, 0) rotate(-0.35deg);
  }
}

/* ---------- Layer d: interactive overlay positioned by anchors ---------- */

.lo-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  transform: translate3d(calc(var(--lo-px) * 6px), calc(var(--lo-py) * 6px), 0);
  transition: transform 0.35s var(--lo-ease);
  will-change: transform;
}

.lo-desk {
  --lo-tone: var(--status-available);
  --lo-ring: var(--lo-tone);
  position: absolute;
  height: 28%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.lo-desk-tone-available {
  --lo-tone: var(--status-available);
}
.lo-desk-tone-working {
  --lo-tone: var(--status-working);
}
.lo-desk-tone-reviewing {
  --lo-tone: var(--status-reviewing);
}
.lo-desk-tone-waiting {
  --lo-tone: var(--status-waiting);
}
.lo-desk-tone-attention {
  --lo-tone: var(--status-attention);
}
.lo-desk-tone-offline {
  --lo-tone: var(--status-offline);
}
.lo-desk-selected:not(.lo-desk-busy) {
  --lo-ring: var(--accent);
}

/* spotlight ring around the desk */
.lo-ring {
  position: absolute;
  left: 50%;
  top: 56%;
  width: min(118%, 30cqw);
  height: 96%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--lo-ring) 0%, transparent 68%);
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.lo-ring::after {
  content: '';
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1.5px solid var(--lo-ring);
  opacity: 0.55;
}

.lo-desk:hover .lo-ring {
  opacity: 0.22;
}
.lo-desk-busy .lo-ring {
  opacity: 0.34;
  animation: lo-breathe 2.8s ease-in-out infinite;
}
.lo-desk-selected .lo-ring {
  opacity: 0.44;
}

@keyframes lo-breathe {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.26;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
    opacity: 0.4;
  }
}

/* desk hotspot — the one interactive element per desk: an invisible region over the seat that
   also contains the visible name plate, so the whole card is the click, hover and tooltip target */
.lo-hotspot {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 22px;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  pointer-events: auto;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.lo-hotspot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.18);
}

/* glass name plate below the desk (part of the hotspot button, so it takes clicks and hover) */
.lo-plate {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.5cqw);
  transform: translateX(-50%);
  /* content-sized: wide desks (w up to ~38%) must not produce a plate as wide as the desk */
  width: max-content;
  min-width: 11em;
  max-width: min(150%, 24em);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28em;
  padding: 0.55em 0.95em 0.65em;
  border-radius: var(--lo-radius);
  background: var(--lo-glass);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid var(--lo-line);
  box-shadow: var(--lo-shadow);
  font-size: clamp(10px, 0.85cqw, 13.5px);
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  pointer-events: auto;
  transition:
    opacity 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.35s var(--lo-ease);
}

.lo-desk:hover .lo-plate {
  transform: translateX(-50%) translateY(-2px);
}

.lo-desk-selected .lo-plate {
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.35),
    0 0 28px rgba(56, 189, 248, 0.22),
    var(--lo-shadow);
}

/* away: dim the chrome (LED, portrait) rather than the text, which must stay >= 4.5:1 */
.lo-desk-away .lo-plate {
  opacity: 0.8;
}

.lo-desk-away .lo-led,
.lo-desk-away .lo-avatar {
  opacity: 0.55;
}

.lo-plate-head {
  display: flex;
  align-items: center;
  gap: 0.55em;
  max-width: 100%;
}

.lo-avatar {
  width: 2.3em;
  height: 2.3em;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 1px solid var(--lo-line-strong);
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.lo-name {
  font-weight: 700;
  font-size: 1.06em;
  color: #ffffff;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

/* status LED — pulses while busy */
.lo-led {
  width: 0.72em;
  height: 0.72em;
  border-radius: 50%;
  flex: none;
  background: var(--lo-tone);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.14),
    0 0 10px var(--lo-tone);
}

.lo-desk-busy .lo-led {
  animation: lo-led-pulse 1.25s ease-in-out infinite;
}

@keyframes lo-led-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.14),
      0 0 8px var(--lo-tone);
  }
  50% {
    transform: scale(1.3);
    box-shadow:
      0 0 0 3px rgba(255, 255, 255, 0.1),
      0 0 16px var(--lo-tone);
  }
}

.lo-activity {
  display: block;
  max-width: 100%;
  color: var(--text);
  font-size: 0.94em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lo-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4em;
  max-width: 100%;
}

.lo-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38em;
  padding: 0.14em 0.65em;
  border-radius: 999px;
  font-size: 0.86em;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.lo-chip i {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
}

.lo-chip-count strong {
  font-weight: 800;
  font-size: 1.05em;
}

.lo-tone-low {
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.35);
}
.lo-tone-medium {
  color: #fde68a;
  border-color: rgba(253, 230, 138, 0.35);
}
.lo-tone-high {
  color: #fca5a5;
  border-color: rgba(252, 165, 165, 0.35);
}

.lo-chip-tally.lo-ok {
  color: #bbf7d0;
}
.lo-chip-tally.lo-ok i {
  background: var(--status-available);
}
.lo-chip-tally.lo-fail {
  color: #fecaca;
}
.lo-chip-tally.lo-fail i {
  background: var(--status-attention);
}

@media (max-width: 900px) {
  .lo-chips {
    flex-direction: column;
    gap: 0.25em;
  }
}

/* away badge (sits on the plate's top edge, never dimmed with it) */
.lo-away-badge {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, -45%);
  z-index: 1;
  padding: 0.18em 0.75em;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.16);
  border: 1px solid rgba(253, 224, 71, 0.45);
  color: #fde68a;
  font-size: clamp(9px, 0.72cqw, 12px);
  font-weight: 700;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  animation: lo-fade-in 0.4s ease-out;
}

/* speech bubble above the head while working / thinking */
.lo-bubble {
  position: absolute;
  left: 50%;
  bottom: 68%;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  min-width: 9em;
  max-width: 150%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.55em 0.85em;
  border-radius: 12px;
  background: rgba(241, 245, 249, 0.94);
  color: #0f172a;
  font-size: clamp(10px, 0.8cqw, 13px);
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.45);
  pointer-events: none;
  animation: lo-bubble-in 0.35s var(--lo-ease);
}

.lo-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: rgba(241, 245, 249, 0.94);
  border-bottom: 0;
}

.lo-bubble-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.lo-dots {
  display: inline-flex;
  gap: 0.28em;
  margin-top: 0.35em;
  justify-content: center;
}

.lo-dots i {
  width: 0.42em;
  height: 0.42em;
  border-radius: 50%;
  background: #0f172a;
  opacity: 0.35;
  animation: lo-dot 1.2s ease-in-out infinite;
}
.lo-dots i:nth-child(2) {
  animation-delay: 0.18s;
}
.lo-dots i:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes lo-dot {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-0.2em);
  }
}

@keyframes lo-bubble-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes lo-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* away marker at the water station / meeting pavilion */
.lo-marker {
  --lo-marker-size: clamp(26px, 2.4cqw, 42px);
  position: absolute;
  width: var(--lo-marker-size);
  height: var(--lo-marker-size);
  margin: 0;
  /* markers sharing a spot fan out by their own width plus an 8px gap (--lo-fan is set inline,
     -0.5 / 0.5 for two, -1 / 0 / 1 for three), so they never overlap each other's hit area */
  margin-left: calc(var(--lo-fan, 0) * (var(--lo-marker-size) + 8px));
  padding: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid var(--lo-line-strong);
  background: var(--lo-glass-strong);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #ffffff;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(11px, 1cqw, 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  box-shadow:
    var(--lo-shadow),
    0 0 0 4px rgba(56, 189, 248, 0.14);
  animation: lo-float 3.2s ease-in-out infinite;
}

.lo-marker::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.45);
  animation: lo-halo 2.4s ease-out infinite;
}

.lo-marker:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@keyframes lo-float {
  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-4px);
  }
}

@keyframes lo-halo {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ---------- Tally / AI-engine glass card (top-left) ---------- */

.lo-tally-card {
  position: absolute;
  top: 1.2cqw;
  left: 1.2cqw;
  z-index: 5;
  max-width: min(250px, 24%);
  max-height: 42%;
  overflow: auto;
  border-radius: var(--lo-radius);
  /* the strong glass: the card sits over the bright window area of the photo, where the lighter
     glass left 10.5px labels at ~2.4:1 */
  background: var(--lo-glass-strong);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--lo-line);
  box-shadow: var(--lo-shadow);
  animation: lo-fade-in 0.5s ease-out;
}

.lo-tally-card .tally-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  min-width: 0;
  color: var(--text);
  font-size: clamp(10.5px, 0.8cqw, 12.5px);
  padding: 0.9em 1.05em;
}

.lo-tally-card .tally-panel-title {
  color: #ffffff;
}

.lo-tally-card .tally-panel-row {
  color: var(--text);
}

.lo-tally-card .tally-panel-label,
.lo-tally-card .tally-panel-muted {
  /* lighter than --muted: ~6.8:1 on the measured card background, where --muted was ~2.7:1 */
  color: #cbd5e1;
}

/* ---------- Status legend (bottom-right) ---------- */

.lo-legend {
  position: absolute;
  right: 1.2cqw;
  top: 1.2cqw;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.9em;
  padding: 0.45em 0.95em;
  border-radius: 999px;
  background: var(--lo-glass);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--lo-line);
  box-shadow: var(--lo-shadow);
  font-size: clamp(10px, 0.75cqw, 12px);
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
}

.lo-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}

.lo-legend i {
  width: 0.62em;
  height: 0.62em;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px currentColor;
}

.lo-legend-available i {
  background: var(--status-available);
  color: var(--status-available);
}
.lo-legend-working i {
  background: var(--status-working);
  color: var(--status-working);
}
.lo-legend-thinking i {
  background: var(--status-reviewing);
  color: var(--status-reviewing);
}

/* ---------- EmployeePanel re-skin (behaviour untouched; scoped to the floor) ---------- */

.lo-root .employee-panel {
  top: 22px;
  right: 22px;
  background: var(--lo-glass-strong);
  border: 1px solid var(--lo-line);
  border-radius: var(--lo-radius);
  box-shadow: var(--lo-shadow);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  color: var(--text);
}

.lo-root .employee-panel-name {
  color: #ffffff;
}

.lo-root .employee-panel-status {
  color: var(--text);
}

.lo-root .employee-panel-activity,
.lo-root .employee-panel-close {
  color: var(--muted);
}

.lo-root .employee-panel-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--lo-line);
  color: var(--text);
}

.lo-root .employee-panel-btn.primary {
  background: var(--accent);
  color: #0f172a;
  border-color: transparent;
}

/* ---------- Floor toolbar (glass bar) — used by FinanceFloor ---------- */

.floor-room.lo-room {
  background: var(--bg);
}

.floor-scene-toolbar.lo-toolbar {
  position: relative;
  z-index: 8;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.78), rgba(15, 23, 42, 0.66));
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.35);
}

.lo-toolbar .dept-heading h2 {
  letter-spacing: 0.01em;
}

.lo-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.lo-toolbar button.ghost-btn,
.lo-toolbar button.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.lo-toolbar button.ghost-btn {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
}

.lo-toolbar button.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.32);
}

.lo-toolbar button.primary-btn {
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.28);
}

.lo-toolbar button.primary-btn:hover {
  box-shadow: 0 8px 22px rgba(56, 189, 248, 0.38);
  transform: translateY(-1px);
}

.lo-toolbar button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lo-toolbar-icon {
  width: 14px;
  height: 14px;
  flex: none;
}

.lo-motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.lo-motion-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lo-motion-toggle[aria-pressed='true'] {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.12);
  color: #e0f2fe;
}

.lo-switch {
  position: relative;
  width: 26px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  flex: none;
  transition: background 0.2s ease;
}

.lo-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.lo-motion-toggle[aria-pressed='true'] .lo-switch {
  background: var(--accent);
}

.lo-motion-toggle[aria-pressed='true'] .lo-switch::after {
  transform: translateX(12px);
}

/* ---------- Motion off / hidden tab / reduced motion ---------- */

/* Motion: Off promises to pause "the video and animations" — the same set the reduced-motion
   preference stops, so the explicit toggle is never weaker than the OS setting. */
.lo-motion-off .lo-ambient,
.lo-motion-off .lo-marker,
.lo-motion-off .lo-marker::before,
.lo-motion-off .lo-ring,
.lo-motion-off .lo-led,
.lo-motion-off .lo-dots i,
.lo-motion-off .lo-bubble,
.lo-motion-off .lo-still,
.lo-motion-off .lo-away-badge,
.lo-motion-off .lo-tally-card {
  animation: none;
}

.lo-motion-off .lo-dots i {
  opacity: 0.6;
}

.lo-motion-off .lo-overlay,
.lo-motion-off .lo-media {
  transform: none;
  transition: none;
}

.lo-paused .lo-ambient,
.lo-paused .lo-marker,
.lo-paused .lo-marker::before,
.lo-paused .lo-ring,
.lo-paused .lo-led,
.lo-paused .lo-dots i {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .lo-ambient,
  .lo-marker,
  .lo-marker::before,
  .lo-ring,
  .lo-led,
  .lo-dots i,
  .lo-bubble,
  .lo-still,
  .lo-away-badge,
  .lo-tally-card {
    animation: none;
  }

  .lo-overlay,
  .lo-media {
    transform: none;
    transition: none;
  }

  .lo-plate,
  .lo-switch::after,
  .lo-toolbar button.primary-btn {
    transition: none;
  }

  .lo-desk:hover .lo-plate {
    transform: translateX(-50%);
  }

  .lo-toolbar button.primary-btn:hover {
    transform: none;
  }

  .lo-dots i {
    opacity: 0.6;
  }
}
.document-review-comparison {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr);
  align-items: start;
  gap: 24px;
  margin-top: 18px;
}
.document-review-comparison > * { min-width: 0; }
.finance-source-preview {
  position: sticky;
  top: 16px;
  border: 1px solid var(--border, #354459);
  border-radius: 12px;
  padding: 14px;
  background: rgba(15, 23, 42, .34);
}
.finance-source-heading, .finance-source-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.finance-source-heading { justify-content: space-between; }
.finance-source-heading h4 { margin: 0; }
.finance-source-toolbar { margin: 12px 0; }
.finance-source-toolbar label { margin-left: auto; font-size: 12px; }
.finance-source-toolbar select { margin-left: 5px; max-width: 95px; }
.finance-source-pages { overflow: auto; max-height: min(76vh, 850px); min-height: 180px; background: #e5e7eb; border-radius: 6px; }
.finance-source-pages .hint { padding: 8px; color: #334155; }
.finance-source-canvas { display: block; max-width: 100%; height: auto; margin: 0 auto; background: white; }
.finance-source-canvas.zoomed { max-width: none; }
.finance-source-canvas-wrap { position: relative; margin: 0 auto; }
.finance-source-canvas-wrap .finance-source-canvas { width: 100%; margin: 0; }
.finance-source-canvas-wrap.zoomed .finance-source-canvas { max-width: 100%; }
.finance-source-text-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.finance-source-text-overlay polygon { fill: rgba(56,189,248,.05); stroke: rgba(2,132,199,.3); stroke-width: .6; cursor: pointer; }
.finance-source-text-overlay polygon:hover, .finance-source-text-overlay polygon.current { fill: rgba(56,189,248,.25); stroke: #0284c7; }
.finance-source-text-overlay polygon.selected { fill: rgba(34,197,94,.25); stroke: #15803d; }
.finance-source-span-picker { border-top: 1px solid var(--border, #354459); margin-top: 12px; padding-top: 8px; }
.finance-source-span-picker label, .finance-source-span-picker textarea, .finance-source-span-picker select { display: block; width: 100%; box-sizing: border-box; margin: 6px 0; }
.finance-source-span-picker select { max-width: 100%; }
.document-review-comparison.document-review-summary-only { grid-template-columns: minmax(0, 1fr); }
.finance-source-image { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.finance-source-text { white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; max-height: 70vh; padding: 12px; }
.finance-source-placeholder { padding: 36px 12px; text-align: center; }
.finance-source-fallback { margin-bottom: 0; }
.document-card.document-card-focused { outline: 2px solid #38bdf8; outline-offset: 3px; scroll-margin-top: 20px; }
.document-focus-label { display: block; margin-top: 6px; color: #7dd3fc; font-size: 12px; }
@media (max-width: 1100px) {
  .document-review-comparison { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .finance-source-preview { position: static; }
  .finance-source-pages { max-height: 60vh; }
}
.saved-sales-pdf-disclosure { margin: 14px 0; }
.saved-sales-pdf-review { border: 1px solid var(--border, #354459); border-radius: 10px; padding: 16px; margin-top: 12px; overflow-wrap: anywhere; }
.saved-sales-pdf-comparison { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.saved-sales-pdf-comparison > * { min-width: 0; }
.saved-sales-pdf-comparison > div:first-child { position: sticky; top: 16px; }
.saved-sales-pdf-comparison .finance-source-preview { position: static; }
.saved-sales-pdf-comparison .finance-source-pages { max-height: 52vh; }
.saved-sales-pdf-field { border-left: 3px solid var(--border, #354459); padding: 8px 10px; margin: 8px 0; }
.saved-sales-pdf-field.selected { border-left-color: #38bdf8; background: rgba(56,189,248,.07); }
.saved-sales-pdf-raw, .saved-sales-pdf-field small { display: block; white-space: pre-wrap; overflow-wrap: anywhere; margin: 5px 0; }
.saved-sales-pdf-item { border: 1px solid var(--border, #354459); padding: 10px; border-radius: 7px; margin: 10px 0; }
.saved-sales-pdf-item summary { cursor: pointer; }
.saved-sales-pdf-download { margin-top: 12px; }
@media (max-width: 1100px) { .saved-sales-pdf-comparison { grid-template-columns: minmax(0, 1fr); } .saved-sales-pdf-comparison > div:first-child { position: static; } }
.sales-pdf-panel { border: 1px solid var(--border, #354459); border-radius: 12px; padding: 18px; margin-top: 22px; }
.sales-pdf-comparison { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(320px, 1fr); gap: 22px; align-items: start; }
.sales-pdf-comparison > * { min-width: 0; }
.sales-pdf-comparison .finance-source-preview { max-height: calc(100vh - 40px); overflow: auto; }
.sales-pdf-comparison .finance-source-pages { max-height: 48vh; }
.sales-pdf-form label, .sales-pdf-master label { display: block; margin: 10px 0; }
.sales-pdf-form input:not([type=checkbox]), .sales-pdf-form select, .sales-pdf-form textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 5px; }
.sales-pdf-form h4 { margin: 22px 0 12px; }
.sales-pdf-form h4:first-child { margin-top: 0; }
.sales-pdf-field { border: 1px solid var(--border, #354459); border-radius: 7px; padding: 10px; margin: 8px 0; }
.sales-pdf-field.active { outline: 2px solid #38bdf8; outline-offset: 1px; }
.sales-pdf-field .sales-pdf-printed { display: block; white-space: pre-wrap; overflow-wrap: anywhere; padding: 6px 0; }
.sales-pdf-field small { display: block; overflow-wrap: anywhere; opacity: .8; margin-bottom: 7px; }
.sales-pdf-field button { margin: 3px 5px 0 0; }
.sales-pdf-item { min-width: 0; border: 1px solid var(--border, #354459); border-radius: 9px; margin: 14px 0; padding: 12px; }
.sales-pdf-check { display: flex !important; align-items: flex-start; gap: 9px; line-height: 1.5; }
.sales-pdf-check input, .sales-pdf-page-check input { flex: 0 0 auto; margin-top: 5px; }
.sales-pdf-page-check { display: inline-flex !important; align-items: center; gap: 7px; margin-right: 18px !important; }
.sales-pdf-master { margin: 12px 0; }
.sales-pdf-master-results { border-left: 3px solid #38bdf8; padding-left: 10px; max-height: 300px; overflow: auto; }
.sales-pdf-master-results ul { list-style: none; padding: 0; margin: 4px 0; }
.sales-pdf-master-results button { text-align: left; overflow-wrap: anywhere; }
.sales-pdf-result { border-top: 1px solid var(--border, #354459); margin-top: 20px; padding-top: 10px; }
.sales-pdf-panel code { overflow-wrap: anywhere; }
@media (max-width: 1100px) { .sales-pdf-comparison { grid-template-columns: minmax(0, 1fr); } }
.sales-catalogue-panel { display: grid; gap: 16px; min-width: 0; }
.sales-catalogue-panel fieldset, .sales-catalogue-review { min-width: 0; border: 1px solid #3a4d65; border-radius: 11px; padding: 17px; margin: 9px 0; }
.sales-catalogue-panel legend { padding: 0 7px; color: #c8deef; font-weight: 650; }
.sales-catalogue-panel label { display: grid; gap: 7px; min-width: 0; }
.sales-catalogue-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 225px), 1fr)); gap: 15px; align-items: start; }
.sales-catalogue-panel input:not([type=checkbox]), .sales-catalogue-panel select, .sales-catalogue-panel textarea { box-sizing: border-box; width: 100%; padding: 10px 11px; border-radius: 8px; border: 1px solid #4a607b; background: #0f1b2d; color: #e8f4ff; font: inherit; }
.sales-catalogue-panel .sales-catalogue-check { display: flex; align-items: flex-start; gap: 9px; margin: 16px 0; }
.sales-catalogue-check input { flex: 0 0 auto; margin-top: 5px; }
.sales-catalogue-panel button { padding: 10px 14px; margin: 5px 8px 5px 0; border: 1px solid #476680; border-radius: 9px; background: #1b3c54; color: #eaf6ff; cursor: pointer; font: inherit; }
.sales-catalogue-panel button:disabled { opacity: .5; cursor: default; }
.sales-catalogue-panel summary { cursor: pointer; color: #d0e5f5; padding: 8px 0; }
.sales-catalogue-panel pre, .sales-catalogue-panel code { overflow-wrap: anywhere; white-space: pre-wrap; font-size: .84rem; }
.sales-catalogue-panel pre { max-height: 32rem; overflow: auto; padding: 12px; background: #0d1828; border-radius: 8px; }
.sales-catalogue-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 14px 0; }
.sales-catalogue-summary span { display: grid; gap: 8px; padding: 14px; background: #14283c; border-radius: 9px; }
.sales-catalogue-table { overflow: auto; max-height: 32rem; }
@media (max-width: 600px) { .sales-catalogue-grid, .sales-catalogue-summary { grid-template-columns: minmax(0, 1fr); } .sales-catalogue-panel fieldset { padding: 12px; } }
.sales-tax-lines-panel { padding: 18px; border: 1px solid var(--border, #334155); border-radius: 12px; margin: 16px 0; }
.sales-tax-lines-panel p { line-height: 1.55; }
.sales-tax-lines-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.sales-tax-lines-controls label { display: grid; gap: 6px; min-width: 180px; }
.sales-tax-lines-panel input, .sales-tax-lines-panel select { padding: 9px 11px; background: var(--bg-input, #111d30); color: inherit; border: 1px solid var(--border, #334155); border-radius: 7px; }
.sales-tax-lines-panel button { color: inherit; background: var(--bg-elevated, #1e3048); border: 1px solid var(--border, #405975); border-radius: 7px; padding: 9px 12px; cursor: pointer; }
.sales-tax-lines-panel button:disabled { opacity: .5; cursor: default; }
.sales-tax-lines-scroll { overflow-x: auto; margin: 12px 0; }
.sales-tax-lines-panel table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.sales-tax-lines-panel th, .sales-tax-lines-panel td { padding: 9px; text-align: left; border-bottom: 1px solid var(--border, #334155); }
.sales-tax-lines-panel caption { text-align: left; font-weight: 600; padding: 8px 0; }
.sales-tax-lines-panel details { border: 1px solid var(--border, #334155); border-radius: 8px; margin: 10px 0; padding: 11px; }
.sales-tax-lines-panel summary { cursor: pointer; line-height: 1.5; }
.sales-tax-lines-panel pre { max-height: 420px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.mixed-stock-margin-panel { margin: 16px 0; padding: 18px; border: 1px solid var(--border, #334155); border-radius: 12px; }
.mixed-stock-margin-panel p { line-height: 1.55; }
.mixed-margin-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin: 15px 0; }
.mixed-margin-controls label { display: grid; gap: 6px; }
.mixed-stock-margin-panel input { background: var(--bg-input, #111d30); color: inherit; border: 1px solid var(--border, #334155); padding: 9px; border-radius: 7px; }
.mixed-stock-margin-panel button { color: inherit; background: var(--bg-elevated, #1e3048); padding: 9px 12px; border: 1px solid var(--border, #405975); border-radius: 7px; cursor: pointer; }
.mixed-stock-margin-panel button:disabled { opacity: .5; cursor: default; }
.mixed-margin-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 14px 0; }
.mixed-margin-summary span { background: var(--bg-elevated, #17263c); border: 1px solid var(--border, #334155); border-radius: 8px; padding: 12px; }
.mixed-margin-summary strong { display: block; font-size: 1.2em; margin-top: 7px; }
.mixed-margin-scroll { overflow-x: auto; margin: 12px 0; }
.mixed-stock-margin-panel table { border-collapse: collapse; width: 100%; white-space: nowrap; }
.mixed-stock-margin-panel th, .mixed-stock-margin-panel td { text-align: left; padding: 9px; border-bottom: 1px solid var(--border, #334155); }
.mixed-stock-margin-panel caption { text-align: left; padding: 8px 0; font-weight: 600; }
.mixed-stock-margin-panel details { border: 1px solid var(--border, #334155); border-radius: 8px; padding: 11px; margin: 11px 0; }
.mixed-stock-margin-panel summary { cursor: pointer; line-height: 1.5; }
.mixed-stock-margin-panel pre { max-height: 420px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.company-bootstrap { margin: 16px 0; min-width: 0; }
/* This disclosure has an explicit light surface even in the dark office.
 * Pair its local foregrounds with that surface, not inherited dark-theme text. */
.company-bootstrap.accounting-advanced { color: #203747; background: #fbfcfd; border-color: #bdcbd5; }
.company-bootstrap.accounting-advanced > summary, .company-bootstrap.accounting-advanced details > summary { color: #36566b; }
.company-bootstrap.accounting-advanced .hint, .company-bootstrap.accounting-advanced small { color: #405968; }
.company-bootstrap.accounting-advanced .document-callout.warn { color: #674600; background: #fff4d6; border: 1px solid #b5882b; }
.company-bootstrap.accounting-advanced .document-callout.error { color: #8c2436; background: #fff1f3; border: 1px solid #c6818c; }
.company-bootstrap.accounting-advanced code { color: #203747; background: #edf2f6; }
.company-bootstrap.accounting-advanced pre { color: #203747; background: #edf2f6; }
.company-bootstrap.accounting-advanced button.ghost-btn { color: #203747; background: #ffffff; border-color: #7f94a4; }
.company-bootstrap.accounting-advanced button.primary-btn { color: #ffffff; background: #086b6e; }
.company-bootstrap > summary { cursor: pointer; font-weight: 650; padding: 7px 0; }
.company-bootstrap fieldset, .company-bootstrap-review { min-width: 0; padding: 16px; border: 1px solid #bdcbd5; border-radius: 10px; margin: 14px 0; }
.company-bootstrap legend { padding: 0 6px; font-weight: 600; }
.company-bootstrap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 15px; }
.company-bootstrap label { display: grid; gap: 7px; }
.company-bootstrap input:not([type=checkbox]) { width: 100%; box-sizing: border-box; font: inherit; color: #203747; background: #ffffff; border: 1px solid #7f94a4; border-radius: 7px; padding: 10px; }
.company-bootstrap .company-bootstrap-check { display: flex; align-items: flex-start; gap: 9px; margin: 15px 0; }
.company-bootstrap-check input { flex: 0 0 auto; margin-top: 4px; }
.company-bootstrap button { margin: 10px 8px 5px 0; }
.company-bootstrap dl { display: grid; grid-template-columns: minmax(95px, 1fr) 3fr; gap: 10px 16px; }
.company-bootstrap dt { font-weight: 600; }
.company-bootstrap dd { margin: 0; overflow-wrap: anywhere; }
.company-bootstrap pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 28rem; overflow: auto; }
.company-bootstrap code { display: inline-block; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; margin: 8px 0; }
@media (max-width: 600px) { .company-bootstrap dl { grid-template-columns: minmax(0, 1fr); } .company-bootstrap fieldset { padding: 12px; } }
.empty-stock-panel { border:1px solid var(--border,#cbd5e1); border-radius:12px; padding:1rem; margin:1rem 0; }
.empty-stock-panel .empty-stock-actions { display:flex; flex-wrap:wrap; gap:.5rem; margin:1rem 0; }
.empty-stock-panel button { padding:.5rem .75rem; border:1px solid var(--border,#a6b8c7); border-radius:7px; background:var(--panel,#f5f8fb); color:var(--text,#213b4d); cursor:pointer; }
.empty-stock-panel button[aria-pressed="true"] { background:#154f71; color:#fff; }
.empty-stock-panel button:disabled { opacity:.5; cursor:not-allowed; }
.empty-stock-panel fieldset { border:1px solid var(--border,#cbd5e1); border-radius:8px; margin:1rem 0; padding:1rem; min-width:0; }
.empty-stock-panel .empty-stock-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:.75rem; margin:.75rem 0; }
.empty-stock-panel label { display:flex; flex-direction:column; gap:.35rem; margin:.5rem 0; }
.empty-stock-panel .empty-stock-check { flex-direction:row; align-items:flex-start; gap:.5rem; }
.empty-stock-panel input:not([type="checkbox"]),.empty-stock-panel select { min-width:0; width:100%; box-sizing:border-box; padding:.55rem; border:1px solid var(--border,#a6b8c7); border-radius:6px; color:var(--text,#213b4d); background:var(--panel,#fff); }
.empty-stock-panel details { border-top:1px solid var(--border,#cbd5e1); padding:.7rem 0; margin-top:.7rem; }
.empty-stock-panel summary { cursor:pointer; font-weight:600; }
.empty-stock-panel pre,.empty-stock-panel code { white-space:pre-wrap; overflow-wrap:anywhere; font-size:.8rem; }
.empty-stock-panel pre { max-height:24rem; overflow:auto; }
.empty-stock-panel .empty-stock-scroll { overflow:auto; }
.empty-stock-panel table { min-width:560px; width:100%; }
.empty-stock-panel th,.empty-stock-panel td { text-align:left; padding:.5rem; border-bottom:1px solid var(--border,#cbd5e1); }
.empty-stock-panel .document-callout.warn { background:#fff4d6; border:1px solid #cfad56; color:#674600; border-radius:7px; padding:.75rem; }
.empty-stock-panel .hint { opacity:.85; font-size:.9rem; }
.vt-manual-journal { color: var(--text, #e5edf5); padding: 16px; border: 1px solid #405267; border-radius: 12px; background: #142033; }
.vt-manual-journal p { line-height: 1.55; }
.vt-manual-journal fieldset { margin: 18px 0; padding: 14px; min-width: 0; border: 1px solid #61758c; border-radius: 8px; }
.vt-manual-journal legend { padding: 0 6px; font-weight: 600; }
.vt-manual-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; margin: 12px 0; }
.vt-manual-fields label, .vt-manual-review fieldset > label { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.vt-manual-journal input:not([type=checkbox]), .vt-manual-journal select { box-sizing: border-box; max-width: 100%; min-height: 36px; padding: 7px 9px; color: #f4f7fb; background: #0e1929; border: 1px solid #74879e; border-radius: 5px; }
.vt-manual-journal button { min-height: 36px; padding: 7px 12px; margin-top: 6px; border: 1px solid #8ba8c8; border-radius: 6px; background: #164a68; color: #fff; cursor: pointer; }
.vt-manual-journal button:disabled { opacity: .5; cursor: default; }
.vt-manual-journal button:focus-visible, .vt-manual-journal input:focus-visible, .vt-manual-journal select:focus-visible { outline: 3px solid #72c8ff; outline-offset: 2px; }
.vt-manual-scroll { max-width: 100%; overflow-x: auto; }
.vt-manual-journal table { border-collapse: collapse; width: 100%; min-width: 560px; }
.vt-manual-journal th, .vt-manual-journal td { text-align: left; vertical-align: top; padding: 10px 7px; border-bottom: 1px solid #43566e; }
.vt-manual-journal td input { width: 130px; }
.vt-manual-journal td select { width: 280px; }
.vt-manual-journal code { overflow-wrap: anywhere; }
.vt-manual-journal [role=alert] { color: #ffb5b5; }
.vt-manual-notice, .vt-manual-review { padding: 12px; border-left: 3px solid #76c8ea; background: #192d43; }
.vt-manual-review { margin-top: 18px; }
.vt-manual-review fieldset > label.vt-manual-approval-checkbox { flex-direction: row; align-items: flex-start; gap: 10px; }
.vt-manual-approval-checkbox input { flex: 0 0 18px; width: 18px; height: 18px; margin: 4px 0 0; }
.sales-proforma-entry { margin: 1rem 0; padding: 1rem; border: 1px solid #334155; border-radius: 12px; }
.sales-entry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: .8rem; margin: .8rem 0; }
.sales-entry-grid label { display: grid; gap: .35rem; }
.sales-proforma-entry input, .sales-proforma-entry select { max-width: 100%; box-sizing: border-box; }
.sales-proforma-entry td input { min-width: 90px; width: 110px; }
.sales-proforma-entry td select { min-width: 150px; }
.sales-proforma-entry button { margin: .35rem .45rem .35rem 0; }
.sales-entry-confirm { display: flex; align-items: flex-start; gap: .5rem; margin: .9rem 0; }
.sales-entry-confirm input { flex: 0 0 auto; margin-top: .25rem; }
.sales-proforma-review { border-top: 1px solid #475569; margin-top: 1rem; padding-top: .5rem; }
.virtual-sales-entry { min-width: 0; margin: 1rem 0; padding: 1rem; color: var(--text, #192d3d); background: var(--panel, #fff); border: 1px solid var(--border, #dce4eb); border-radius: 12px; overflow-wrap: anywhere; }
.virtual-sales-entry p { line-height: 1.55; }
.virtual-sales-entry fieldset { min-width: 0; margin: 1rem 0; padding: .9rem; border: 1px solid var(--border, #dce4eb); border-radius: 9px; }
.virtual-sales-entry legend { padding: 0 .4rem; font-weight: 600; }
.virtual-sales-entry label { display: grid; gap: .4rem; margin: .6rem 0; }
.virtual-sales-entry label:has(input[type=checkbox]) { display: flex; align-items: flex-start; gap: .65rem; }
.virtual-sales-entry input[type=checkbox] { flex: 0 0 18px; width: 18px; height: 18px; margin: 2px 0 0; }
.virtual-sales-entry input:not([type=checkbox]), .virtual-sales-entry select { box-sizing: border-box; width: 100%; min-height: 38px; max-width: 100%; padding: .5rem .65rem; color: var(--text, #192d3d); background: var(--panel, #fff); border: 1px solid var(--border, #dce4eb); border-radius: 6px; font: inherit; }
.virtual-sales-entry button { min-height: 36px; margin: .35rem .5rem .35rem 0; padding: .45rem .8rem; border: 1px solid var(--border, #dce4eb); border-radius: 7px; color: var(--text, #192d3d); background: var(--panel-light, #f4f7fa); font: inherit; cursor: pointer; }
.virtual-sales-entry button:hover:not(:disabled) { border-color: var(--accent, #087f82); }
.virtual-sales-entry button:disabled { opacity: .5; cursor: default; }
.virtual-sales-entry button:focus-visible, .virtual-sales-entry input:focus-visible, .virtual-sales-entry select:focus-visible { outline: 3px solid var(--accent, #087f82); outline-offset: 2px; }
.virtual-sales-entry .sales-entry-row { margin: .8rem 0; padding: .8rem; border: 1px solid var(--border, #dce4eb); border-radius: 8px; background: var(--panel-light, #f4f7fa); }
.virtual-sales-entry > [role=status] { padding: .8rem; border-left: 3px solid var(--accent, #087f82); background: var(--panel-light, #f4f7fa); border-radius: 6px; }
.virtual-sales-entry section[aria-label] { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--border, #dce4eb); }
.virtual-sales-entry .data-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.purchase-commercial-source {
  min-width: 0;
  max-width: 100%;
  margin-top: 22px;
  display: grid;
  gap: 14px;
  padding: clamp(14px, 2vw, 24px);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  overflow-wrap: anywhere;
}
.purchase-commercial-source h4, .purchase-commercial-source h5,
.purchase-commercial-source p { margin: 0; }
.purchase-commercial-source p { font-size: 13px; line-height: 1.6; }
.purchase-commercial-source h4 { font-size: 18px; }
.purchase-commercial-source label { display: grid; gap: 7px; font-size: 12px; color: var(--muted); }
.purchase-commercial-source input:not([type="checkbox"]), .purchase-commercial-source select, .purchase-commercial-source textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
  font: inherit;
}
.purchase-commercial-source input:focus-visible, .purchase-commercial-source select:focus-visible, .purchase-commercial-source textarea:focus-visible,
.purchase-commercial-source button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.purchase-commercial-source button { justify-self: start; max-width: 100%; white-space: normal; font: inherit; font-size: 12px; }
.purchase-commercial-source button:not(.primary-btn) {
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
  cursor: pointer;
}
.purchase-commercial-source button:disabled { opacity: .55; cursor: not-allowed; }
.purchase-commercial-worksheet, .purchase-commercial-package { display: grid; min-width: 0; gap: 18px; }
.purchase-commercial-worksheet fieldset, .purchase-commercial-package fieldset {
  display: grid;
  min-inline-size: 0;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 18px;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.purchase-commercial-worksheet legend, .purchase-commercial-package legend { padding: 0 7px; font-size: 14px; font-weight: 650; }
.purchase-commercial-source .virtual-tally-books-form {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  align-items: start;
  gap: 16px;
  min-width: 0;
}
.purchase-commercial-source .virtual-tally-books-form label:nth-child(n) { grid-column: auto; }
.purchase-commercial-worksheet label:has(input[type="checkbox"]), .purchase-commercial-package label:has(input[type="checkbox"]) { display: block; line-height: 1.7; }
.purchase-commercial-worksheet input[type="checkbox"], .purchase-commercial-package input[type="checkbox"] { vertical-align: middle; margin-right: 8px; }
.purchase-commercial-worksheet details, .purchase-commercial-package details { min-width: 0; font-size: 12px; }
.purchase-commercial-worksheet summary, .purchase-commercial-package summary { cursor: pointer; font-weight: 600; }
.purchase-commercial-package section { display: grid; min-width: 0; gap: 12px; }
.purchase-commercial-package textarea { resize: vertical; min-height: 76px; }
.purchase-commercial-package code { overflow-wrap: anywhere; }
.purchase-commercial-result { display: grid; min-width: 0; gap: 14px; padding: 18px; border: 1px solid #b9d8cc; border-radius: 12px; background: #eff8f4; color: #234b3f; }
.purchase-commercial-result h5 { font-size: 16px; }
.purchase-commercial-table-wrap { width: 100%; min-width: 0; overflow-x: auto; }
.purchase-commercial-table-wrap table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 12px; }
.purchase-commercial-table-wrap th, .purchase-commercial-table-wrap td { padding: 9px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
@media (max-width: 600px) {
  .purchase-commercial-source { padding: 12px; }
  .purchase-commercial-worksheet fieldset, .purchase-commercial-package fieldset { padding: 12px; }
  .purchase-commercial-source .virtual-tally-books-form { grid-template-columns: minmax(0, 1fr); }
}
/* Month-end only: routine downloads first, optional exact-target evidence below. */
.vt-month-end { min-width: 0; color: #dce7f5; line-height: 1.55; }
.vt-month-end h3, .vt-month-end h4, .vt-month-end h5 { color: #edf5ff; margin: 0 0 12px; line-height: 1.3; }
.vt-month-end h3 { font-size: 21px; }
.vt-month-end h4 { font-size: 18px; }
.vt-month-end h5 { font-size: 16px; }
.vt-month-end p { margin: 12px 0; color: #b6c5d9; overflow-wrap: anywhere; }
.vt-month-end strong { color: #edf5ff; }
.vt-month-end > .vt-section, .vt-month-end section[aria-label="Separate manual Sales target approval"] {
  padding: 20px; margin-top: 22px; border: 1px solid #33445c; border-radius: 14px; background: #162235;
}
.vt-month-end button {
  appearance: none; border: 1px solid #405571; border-radius: 9px; padding: 9px 14px;
  margin: 4px 6px 4px 0; min-height: 40px; background: #22334b; color: #e3efff;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: normal; text-align: left;
}
.vt-month-end button:hover:not(:disabled) { background: #2d4563; border-color: #58b7e6; }
.vt-month-end button.vt-export-primary { color: #082438; background: #55c5f4; border-color: #55c5f4; }
.vt-month-end button.vt-export-primary:hover:not(:disabled) { color: #082438; background: #8cdcff; }
.vt-month-end button:disabled { opacity: .48; cursor: not-allowed; }
.vt-month-end label { display: inline-flex; flex-direction: column; gap: 7px; margin: 8px 12px 8px 0; max-width: 100%; font-size: 13px; }
.vt-month-end input, .vt-month-end select, .vt-month-end textarea {
  box-sizing: border-box; min-height: 40px; min-width: 0; max-width: 100%; padding: 8px 10px;
  border: 1px solid #465a75; border-radius: 8px; color: #e6f1ff; background: #0f1b2c; font: inherit; color-scheme: dark;
}
.vt-month-end input:read-only { color: #b1c4db; background: #1d2a3d; }
.vt-month-end input:disabled, .vt-month-end select:disabled { opacity: .6; }
.vt-month-end :is(button,input,select,summary,textarea):focus-visible { outline: 2px solid #6bd0ff; outline-offset: 3px; }
.vt-month-end label:has(input[type="checkbox"]) { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; }
.vt-month-end input[type="checkbox"] { min-height: 18px; width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; accent-color: #55c5f4; }
.vt-month-end fieldset { border: 1px solid #405571; border-radius: 12px; padding: 18px; margin: 18px 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 18px; }
.vt-month-end fieldset > label { margin-right: 0; }
.vt-month-end fieldset > :is(p,button,label:has(input[type="checkbox"])) { grid-column: 1 / -1; }
.vt-month-end fieldset > button { justify-self: start; }
.vt-month-end legend { padding: 0 8px; color: #cce8fa; font-weight: 600; }
.vt-month-end details { margin: 12px 0; border: 1px solid #35465f; border-radius: 9px; padding: 10px 12px; }
.vt-month-end summary { cursor: pointer; color: #b9d6ef; font-size: 13px; }
.vt-month-end pre { background: #0c1727; border-radius: 8px; padding: 12px; font-size: 12px; }
.vt-month-end code { font-size: 12px; overflow-wrap: anywhere; }
.vt-month-end table { width: 100%; border-collapse: collapse; font-size: 13px; }
.vt-month-end th, .vt-month-end td { padding: 10px; border-bottom: 1px solid #36465f; text-align: left; vertical-align: top; }
.vt-month-end th { color: #a8bfd7; background: #101d30; }
.vt-month-end [role="alert"] { padding: 12px; border: 1px solid #b76d65; border-radius: 9px; color: #ffcbc3; background: #392728; }
.vt-month-end [role="status"] { padding: 12px; border: 1px solid #396c65; border-radius: 9px; color: #a5ddca; background: #152e30; }
/* The daily accounting shell is explicitly light. Match both foreground and
 * nested surfaces here; the dark office keeps all defaults above unchanged. */
.accounting-dashboard .vt-month-end { color: #203747; }
.accounting-dashboard .vt-month-end :is(h3,h4,h5,strong,label,legend) { color: #203747; }
.accounting-dashboard .vt-month-end :is(p,li,.hint) { color: #405968; }
.accounting-dashboard .vt-month-end > .vt-section,
.accounting-dashboard .vt-month-end section[aria-label="Separate manual Sales target approval"] {
  background: #f9fbfc; border-color: #c4d2dd; color: #203747;
}
.accounting-dashboard .vt-month-end details { background: #f8fafc; border-color: #c4d2dd; }
.accounting-dashboard .vt-month-end summary { color: #28576b; }
.accounting-dashboard .vt-month-end :is(pre,code) { color: #203747; background: #edf2f6; }
.accounting-dashboard .vt-month-end code { padding: 2px 4px; border-radius: 4px; }
.accounting-dashboard .vt-month-end pre code { padding: 0; background: transparent; }
.accounting-dashboard .vt-month-end fieldset { border-color: #b8c9d6; }
.accounting-dashboard .vt-month-end :is(input,select,textarea) {
  color: #203747; background: #ffffff; border-color: #839aaa; color-scheme: light;
}
.accounting-dashboard .vt-month-end input:read-only { color: #405968; background: #edf2f6; }
.accounting-dashboard .vt-month-end input[type="checkbox"] { accent-color: #087f82; }
.accounting-dashboard .vt-month-end th { color: #36566b; background: #edf3f7; }
.accounting-dashboard .vt-month-end :is(th,td) { border-color: #c4d2dd; }
.accounting-dashboard .vt-month-end td { color: #203747; }
.accounting-dashboard .vt-month-end [role="alert"] { color: #8c2436; background: #fff1f3; border-color: #c6818c; }
.accounting-dashboard .vt-month-end [role="status"] { color: #245d49; background: #edf8f2; border-color: #9fc8b4; }
.accounting-dashboard .vt-month-end :is(button,input,select,summary,textarea):focus-visible { outline-color: #087f82; }
@media (max-width: 700px) {
  .vt-month-end > .vt-section { padding: 14px; }
  .vt-month-end fieldset { grid-template-columns: minmax(0,1fr); padding: 12px; }
  .vt-month-end label { display: flex; margin-right: 0; }
  .vt-month-end button { max-width: 100%; }
}
.purchase-catalogue-panel { display: grid; gap: 18px; min-width: 0; margin-top: 20px; padding: clamp(14px, 2vw, 24px); border: 1px solid var(--border, #33445c); border-radius: 14px; background: var(--panel, #162235); color: var(--text, #dce7f5); line-height: 1.6; overflow-wrap: anywhere; }
.purchase-catalogue-panel :is(h4, h5, p) { margin: 0; }
.purchase-catalogue-panel h4 { font-size: 19px; line-height: 1.4; }
.purchase-catalogue-panel fieldset { display: grid; gap: 15px; min-width: 0; min-inline-size: 0; margin: 0; padding: 18px; border: 1px solid var(--border, #405571); border-radius: 12px; }
.purchase-catalogue-panel legend { padding: 0 7px; font-size: 14px; font-weight: 650; }
.purchase-catalogue-panel label { display: grid; gap: 7px; min-width: 0; font-size: 13px; }
.purchase-catalogue-panel :is(input:not([type="checkbox"]), select, textarea) { box-sizing: border-box; width: 100%; min-width: 0; min-height: 42px; padding: 10px 12px; border: 1px solid var(--border, #465a75); border-radius: 8px; background: var(--panel, #0f1b2c); color: var(--text, #e6f1ff); font: inherit; }
.purchase-catalogue-panel textarea { min-height: 80px; resize: vertical; }
.purchase-catalogue-panel button { appearance: none; justify-self: start; max-width: 100%; min-height: 42px; padding: 10px 15px; border: 1px solid var(--border, #405571); border-radius: 9px; background: var(--panel, #22334b); color: var(--text, #e3efff); font: inherit; font-size: 13px; font-weight: 600; white-space: normal; cursor: pointer; }
.purchase-catalogue-panel button.primary-btn { background: var(--accent, #2274a0); color: #fff; }
.purchase-catalogue-panel button:hover:not(:disabled) { border-color: var(--accent, #55c5f4); }
.purchase-catalogue-panel :disabled { opacity: .55; cursor: not-allowed; }
.purchase-catalogue-panel :is(button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--accent, #55c5f4); outline-offset: 3px; }
.purchase-catalogue-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); align-items: start; gap: 15px; min-width: 0; }
.purchase-catalogue-panel .purchase-catalogue-check { display: flex; align-items: flex-start; gap: 9px; }
.purchase-catalogue-check input { flex: 0 0 auto; margin-top: 5px; }
.purchase-catalogue-summary { display: flex; flex-wrap: wrap; gap: 14px 28px; padding: 15px; border: 1px solid var(--border, #405571); border-radius: 10px; }
.purchase-catalogue-summary span { display: grid; gap: 4px; }
.purchase-catalogue-panel details { padding: 12px 14px; border: 1px solid var(--border, #33445c); border-radius: 9px; min-width: 0; }
.purchase-catalogue-panel summary { cursor: pointer; font-weight: 600; }
.purchase-catalogue-panel pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 30rem; overflow: auto; font-size: 12px; }
.purchase-catalogue-panel code { overflow-wrap: anywhere; }
.purchase-catalogue-panel .purchase-catalogue-table { overflow: auto; max-height: 32rem; }
.purchase-catalogue-panel :is(th, td) { padding: 10px 12px; border-bottom: 1px solid var(--border, #33445c); text-align: left; vertical-align: top; }
.purchase-catalogue-panel .purchase-catalogue-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.purchase-catalogue-panel .purchase-catalogue-line { border-left: 3px solid var(--accent, #55c5f4); }
@media (max-width: 600px) { .purchase-catalogue-panel { padding: 12px; } .purchase-catalogue-panel fieldset { padding: 12px; } .purchase-catalogue-grid { grid-template-columns: minmax(0, 1fr); } }
.stock-catalogue-panel { margin-top: 1rem; min-width: 0; padding: 20px; border: 1px solid #33445c; border-radius: 14px; background: #162235; color: #dce7f5; line-height: 1.55; }
.stock-catalogue-panel h3, .stock-catalogue-panel h4 { color: #edf5ff; line-height: 1.3; }
.stock-catalogue-panel h3 { margin: 0 0 12px; font-size: 21px; }
.stock-catalogue-panel p { overflow-wrap: anywhere; color: #b6c5d9; }
.stock-catalogue-panel button { appearance: none; min-height: 40px; margin: 4px 6px 4px 0; padding: 9px 14px; border: 1px solid #405571; border-radius: 9px; background: #22334b; color: #e3efff; font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.stock-catalogue-panel button:hover:not(:disabled) { background: #2d4563; border-color: #58b7e6; }
.stock-catalogue-panel button[aria-pressed="true"] { background: #164b65; border-color: #55c5f4; color: #eaffff; }
.stock-catalogue-panel button:disabled { opacity: .48; cursor: not-allowed; }
.stock-catalogue-panel :is(button, input, select, summary):focus-visible { outline: 2px solid #55c5f4; outline-offset: 3px; }
.stock-catalogue-panel input:not([type="checkbox"]), .stock-catalogue-panel select { box-sizing: border-box; min-width: 0; min-height: 40px; max-width: 100%; padding: 8px 10px; border: 1px solid #465a75; border-radius: 8px; color: #e6f1ff; background: #0f1b2c; font: inherit; color-scheme: dark; }
.stock-catalogue-panel details { margin: 12px 0; padding: 10px 12px; border: 1px solid #33445c; border-radius: 9px; background: #142033; }
.stock-catalogue-panel summary { cursor: pointer; color: #dce7f5; font-weight: 600; overflow-wrap: anywhere; }
.stock-catalogue-panel > section { padding: 16px; margin-top: 18px; border: 1px solid #405571; border-radius: 12px; background: #18283e; }
.stock-catalogue-panel th, .stock-catalogue-panel td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #33445c; white-space: nowrap; }
.stock-catalogue-panel .catalogue-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin: .9rem 0; }
.stock-catalogue-panel .catalogue-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: .85rem; }
.stock-catalogue-panel .catalogue-form-grid label { display: flex; flex-direction: column; gap: .35rem; }
.stock-catalogue-panel fieldset { border: 1px solid var(--border, #334155); border-radius: .65rem; padding: 1rem; margin: 1rem 0; }
.stock-catalogue-panel legend { font-weight: 650; padding: 0 .35rem; }
.stock-catalogue-panel .catalogue-check { display: flex; align-items: flex-start; gap: .55rem; margin: .85rem 0; }
.stock-catalogue-panel .catalogue-check input { flex: 0 0 auto; margin-top: .25rem; }
.stock-catalogue-panel .catalogue-scroll { overflow: auto; max-height: 32rem; }
.stock-catalogue-panel pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 28rem; overflow: auto; }
.stock-catalogue-panel code { overflow-wrap: anywhere; }
.stock-catalogue-panel .catalogue-metrics { display: flex; flex-wrap: wrap; gap: .65rem 1.5rem; }
.stock-catalogue-panel .catalogue-metrics span { display: flex; flex-direction: column; }
.stock-catalogue-panel .catalogue-muted { color: var(--text-muted, #94a3b8); }
@media (max-width: 600px) { .stock-catalogue-panel { padding: 14px; } .stock-catalogue-panel button { width: 100%; margin-right: 0; } .stock-catalogue-panel .catalogue-actions { gap: .25rem; } }
.mixed-stock-panel .mixed-stock-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); align-items: start; gap: 15px; }
.mixed-stock-panel label { min-width: 0; }
.mixed-stock-panel .mixed-stock-grid label { display: grid; gap: 7px; }
.mixed-stock-panel .mixed-stock-table { overflow: auto; max-height: 32rem; }
.mixed-stock-panel .mixed-stock-check { display: flex; align-items: flex-start; gap: 9px; margin: 15px 0; }
.mixed-stock-panel .mixed-stock-check input { flex: 0 0 auto; margin-top: 5px; }
.mixed-stock-panel .mixed-stock-evidence { display: grid; gap: 14px; }
.mixed-stock-panel textarea { box-sizing: border-box; width: 100%; padding: 10px; border: 1px solid #465a75; border-radius: 8px; background: #0f1b2c; color: #e6f1ff; font: inherit; }
@media (max-width: 600px) { .mixed-stock-panel .mixed-stock-grid { grid-template-columns: minmax(0, 1fr); } }
.virtual-tally-panel .virtual-tally-secondary-tools { min-width: 0; margin: 10px 0; padding: 12px 15px; border: 1px solid var(--border, #344760); border-radius: 9px; background: var(--panel-light, #273449); }
.virtual-tally-panel .virtual-tally-secondary-tools > summary { color: var(--text, #e2e8f0); cursor: pointer; font-size: 13px; font-weight: 600; }
.virtual-tally-panel .virtual-tally-secondary-tools[open] > summary { margin-bottom: 14px; }
.virtual-tally-panel .virtual-tally-import-help .accounting-tally-pilot { margin: 12px 0 0; }
.virtual-tally-panel .virtual-tally-secondary-tools > .virtual-tally-archives { margin-bottom: 0; }
.virtual-tally-panel .workspace-recovery-status { min-width: 0; margin: 10px 0; }
.virtual-tally-panel .workspace-recovery-status > [role=alert] { margin: 8px 0; }
.virtual-tally-panel .workspace-recovery-status .virtual-tally-secondary-tools { margin: 0; }
.virtual-tally-panel .workspace-recovery-summary-note { color: var(--muted, #94a3b8); font-size: 12px; font-weight: 400; margin-left: 8px; }
.virtual-operational-company { color: #21313d; min-width: 0; padding: 18px; background: #fff; border: 1px solid #bdcdd6; border-radius: 12px; color-scheme: light; }
.virtual-operational-company header { display: flex; justify-content: space-between; align-items: start; gap: 16px; flex-wrap: wrap; }
.virtual-operational-company h2 { margin: 0 0 6px; font-size: 21px; }
.virtual-operational-company h3 { font-size: 16px; margin: 20px 0 12px; }
.virtual-operational-company p { line-height: 1.5; overflow-wrap: anywhere; }
.virtual-operational-company .hint { color: #526574; font-size: 13px; }
.virtual-operational-company nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 14px; }
.virtual-operational-company button { cursor: pointer; color: #fff; background: #28526b; border: 1px solid #46617d; border-radius: 6px; padding: 9px 12px; margin: 4px 5px 4px 0; }
.virtual-operational-company button[aria-pressed=true], .virtual-operational-company button[type=submit] { background: #166384; border-color: #368db1; }
.virtual-operational-company button:disabled { opacity: .5; cursor: default; }
.virtual-operational-company label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; margin: 8px 0; min-width: 0; }
.virtual-operational-company label:has(input[type=checkbox]) { flex-direction: row; align-items: start; line-height: 1.5; }
.virtual-operational-company input, .virtual-operational-company select, .virtual-operational-company textarea { background: #fff; color: #21313d; font: inherit; border: 1px solid #809cab; border-radius: 6px; padding: 9px; min-width: 0; max-width: 100%; }
.virtual-operational-company input[type=checkbox] { margin-top: 3px; flex-shrink: 0; }
.virtual-operational-company fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.virtual-operational-company fieldset:disabled { opacity: .6; }
.virtual-operational-company .operational-fields { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.virtual-operational-company .operational-fields > label { flex: 1 1 160px; }
.virtual-operational-company .operational-entry-line { display: grid; grid-template-columns: minmax(160px, 2fr) minmax(90px, 1fr) minmax(90px, 1fr); gap: 10px; margin: 12px 0; padding: 12px; border: 1px solid #344760; border-radius: 8px; }
.virtual-operational-company .operational-allocations { grid-column: 1 / -1; }
.virtual-operational-company .operational-table { overflow-x: auto; margin: 12px 0; }
.virtual-operational-company table { border-collapse: collapse; width: 100%; font-size: 13px; }
.virtual-operational-company td, .virtual-operational-company th { padding: 10px; border-bottom: 1px solid #bdcdd6; text-align: left; white-space: nowrap; }
.virtual-operational-company .operational-review, .virtual-operational-company .operational-pending { margin: 16px 0; padding: 16px; border: 1px solid #bd963b; background: #fff8e6; color: #21313d; border-radius: 9px; }
.virtual-operational-company pre { font-size: 12px; max-height: 420px; overflow: auto; background: #eef4f7; color: #21313d; padding: 12px; }
.virtual-operational-company code { overflow-wrap: anywhere; white-space: normal; font-size: 12px; }
.virtual-operational-company .operational-message { border-left: 3px solid #267593; padding: 8px 12px; background: #edf7fb; color: #21313d; }
.virtual-operational-company .operational-business-review details { margin: 12px 0; }
.virtual-operational-company .operational-business-review summary { cursor: pointer; font-weight: 600; }
.virtual-operational-company .operational-facts { margin: 10px 0; }
.virtual-operational-company .operational-facts > div { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 3fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid #e2d7b8; }
.virtual-operational-company .operational-facts dt { font-weight: 600; }
.virtual-operational-company .operational-facts dd { margin: 0; overflow-wrap: anywhere; }
.virtual-operational-company .operational-fact-list { padding-left: 20px; }
@media (max-width: 620px) { .virtual-operational-company { padding: 12px; } .virtual-operational-company .operational-entry-line { grid-template-columns: 1fr 1fr; } .virtual-operational-company .operational-entry-line > label:first-child { grid-column: 1 / -1; } }
.virtual-operational-company .operational-original iframe { width: 100%; height: 36rem; border: 1px solid #b9cbd5; background: white; }
.virtual-operational-company .operational-original img { display: block; max-width: 100%; max-height: 48rem; object-fit: contain; }
.virtual-operational-company .operational-original pre { max-height: 30rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: #163744; background: #f4f8fa; padding: 1rem; }
.virtual-operational-company .operational-month-export > section { margin: 18px 0; padding: 14px; border: 1px solid #bdcdd6; border-radius: 8px; }
.virtual-operational-company .operational-month-export details { padding: 12px 0; border-bottom: 1px solid #bdcdd6; }
.virtual-operational-company .operational-month-export summary { cursor: pointer; font-weight: 600; overflow-wrap: anywhere; }
.virtual-operational-company .operational-month-export progress { display: block; width: min(100%, 40rem); }
.operational-import-setup {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  margin: 16px 0;
  padding: 20px;
  border: 1px solid #cfdee3;
  border-radius: 14px;
  background: #fff;
  color: #243b48;
}
.operational-import-setup h3,
.operational-import-setup h4,
.operational-import-setup h5,
.operational-import-setup p { margin: 0; line-height: 1.55; }
.operational-import-setup h4 { padding-top: 12px; border-top: 1px solid #e0e9ed; }
.operational-import-setup fieldset { min-width: 0; margin: 0; padding: 16px; border: 1px solid #cfdee3; border-radius: 10px; }
.operational-import-setup legend { padding: 0 6px; font-weight: 700; }
.operational-import-setup .operational-import-source { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 14px; }
.operational-import-source > p { grid-column: 1 / -1; }
.operational-import-setup label { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13px; }
.operational-import-setup input:not([type=checkbox]),
.operational-import-setup select,
.operational-import-setup textarea { box-sizing: border-box; width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #b8cbd3; border-radius: 6px; background: #fff; color: #243b48; font: inherit; }
.operational-import-setup input[readonly] { background: #f0f5f7; }
.operational-import-setup button { max-width: 100%; padding: 9px 13px; border: 1px solid #b8cbd3; border-radius: 7px; background: #edf5f7; color: #174858; font: inherit; line-height: 1.4; cursor: pointer; }
.operational-import-setup button:disabled { cursor: default; opacity: .55; }
.operational-import-setup button:focus-visible,
.operational-import-setup input:focus-visible,
.operational-import-setup select:focus-visible,
.operational-import-setup textarea:focus-visible { outline: 3px solid #16829f; outline-offset: 2px; }
.operational-import-setup article { display: flex; flex-direction: column; gap: 12px; min-width: 0; margin: 12px 0; padding: 14px; border: 1px solid #dce6eb; border-radius: 8px; }
.operational-import-setup details { min-width: 0; padding: 12px; overflow-x: auto; border: 1px solid #dce6eb; border-radius: 8px; }
.operational-import-setup summary { cursor: pointer; font-weight: 600; }
.operational-import-setup table { width: 100%; margin: 12px 0; border-collapse: collapse; font-size: 13px; }
.operational-import-setup th,
.operational-import-setup td { padding: 9px; border-bottom: 1px solid #dce6eb; text-align: left; overflow-wrap: anywhere; }
.operational-import-setup [role=alert] { padding: 12px; border: 1px solid #dfba75; border-radius: 8px; background: #fff7e7; }
.operational-import-setup [role=status] { padding: 12px; border-radius: 8px; background: #edf5f7; }
.operational-import-setup [aria-label="Approve reviewed company setup"] { display: flex; flex-direction: column; gap: 14px; padding: 16px; border: 2px solid #75a6b4; border-radius: 10px; }
.operational-import-setup label:has(> input[type=checkbox]) { flex-direction: row; align-items: start; gap: 10px; }
.operational-import-setup input[type=checkbox] { width: 18px; height: 18px; flex: none; margin-top: 2px; }
@media (max-width: 800px) {
  .operational-import-setup { padding: 14px; }
  .operational-import-setup .operational-import-source { grid-template-columns: minmax(0, 1fr); }
}
.first-purchase-review { display: grid; gap: .8rem; min-width: 0; }
.first-purchase-review p, .first-purchase-review h3, .first-purchase-review h4 { margin: 0; }
.first-purchase-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.first-purchase-table { overflow: auto; max-width: 100%; }
.first-purchase-table table { border-collapse: collapse; width: 100%; }
.first-purchase-table th, .first-purchase-table td { padding: .55rem; text-align: left; vertical-align: top; border-bottom: 1px solid currentColor; }
.first-purchase-review label { display: block; }
.first-purchase-review textarea { display: block; width: 100%; min-height: 5rem; box-sizing: border-box; }
.first-purchase-review details, .first-purchase-phrase { overflow-wrap: anywhere; }
.first-purchase-phrase { display: block; white-space: normal; }
/* Finance's sidebar consumes viewport width. Stack by the actual review width,
   not the screen width, so all six accounting columns remain visible on laptops. */
.bank-pdf-review { container: bank-pdf-review / inline-size; }
.document-review-comparison.bank-pdf-review-comparison {
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
.bank-pdf-review-comparison .finance-source-preview { position: static; }
.bank-pdf-review .bank-pdf-row-list {
  max-height: 34rem;
  max-width: 100%;
  overflow: auto;
}
.bank-pdf-review .bank-pdf-rows {
  min-width: 650px;
  table-layout: fixed;
}
.bank-pdf-rows col:nth-child(1) { width: 10%; }
.bank-pdf-rows col:nth-child(2) { width: 15%; }
.bank-pdf-rows col:nth-child(3) { width: 30%; }
.bank-pdf-rows col:nth-child(n + 4) { width: 15%; }
.bank-pdf-review .bank-pdf-rows caption {
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  padding: 10px 0;
}
.bank-pdf-review .bank-pdf-row-list .bank-pdf-rows th,
.bank-pdf-review .bank-pdf-row-list .bank-pdf-rows td {
  padding: 9px 8px;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}
.bank-pdf-rows td:nth-child(n + 4) { font-variant-numeric: tabular-nums; }
@container bank-pdf-review (min-width: 1080px) {
  .document-review-comparison.bank-pdf-review-comparison {
    grid-template-columns: minmax(280px, 1fr) minmax(650px, 1.4fr);
  }
  .bank-pdf-review-comparison .finance-source-preview { position: sticky; }
}
/* The books screen, in the manner of TallyPrime: a blue top strip, a dark title bar, a pale paper
   for reports, an amber bar on the chosen row, a column of key buttons on the right. Everything is
   scoped under .tb-root so that nothing here reaches another screen. */
.tb-root {
  --tb-top: #1d4f86;
  --tb-title: #0d3350;
  --tb-paper: #fbfcfd;
  --tb-panel: #e4edf5;
  --tb-line: #c3d0dc;
  --tb-ink: #10202e;
  --tb-soft: #4d6275;
  --tb-bar: #f6c443;
  --tb-bar-ink: #1b1400;
  --tb-hot: #b3261e;
  --tb-good: #1b6b3a;
  --tb-bad: #a4281c;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--tb-panel);
  color: var(--tb-ink);
  font: 14px/1.35 'Segoe UI', system-ui, -apple-system, 'Noto Sans', sans-serif;
  font-variant-numeric: tabular-nums;
  outline: none;
}
.tb-root *, .tb-root *::before, .tb-root *::after { box-sizing: border-box; }

.tb-top { display: flex; align-items: center; gap: 18px; padding: 6px 14px; background: var(--tb-top); color: #fff; }
.tb-brand { font-weight: 700; letter-spacing: 0.04em; }
.tb-top-company { font-weight: 600; }
.tb-top-note { margin-left: auto; font-size: 12px; opacity: 0.85; }
.tb-top-button { border: 1px solid rgba(255, 255, 255, 0.55); background: transparent; color: #fff; padding: 3px 10px; border-radius: 3px; cursor: pointer; font: inherit; font-size: 13px; }
.tb-top-button:hover { background: rgba(255, 255, 255, 0.14); }

.tb-titlebar { display: flex; justify-content: space-between; align-items: center; padding: 4px 14px; background: var(--tb-title); color: #fff; font-weight: 600; }
.tb-crumbs { font-weight: 400; font-size: 12px; opacity: 0.8; }

.tb-body { flex: 1; min-height: 0; display: flex; }
.tb-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--tb-paper); border-right: 1px solid var(--tb-line); }

.tb-buttons { width: 148px; flex: none; display: flex; flex-direction: column; gap: 3px; padding: 6px 5px; background: var(--tb-panel); overflow-y: auto; }
.tb-buttons-report { display: flex; flex-direction: column; gap: 3px; }
.tb-buttons-gap { flex: 1; }
.tb-side-button { display: flex; align-items: baseline; gap: 6px; width: 100%; padding: 5px 8px; border: 1px solid var(--tb-line); border-radius: 2px; background: #f4f8fb; color: var(--tb-ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.tb-side-button b { color: var(--tb-top); font-weight: 700; min-width: 30px; }
.tb-side-button:hover:not(:disabled) { background: #fff; border-color: var(--tb-top); }
.tb-side-button:disabled { opacity: 0.45; cursor: default; }

/* Gateway */
.tb-gateway { flex: 1; min-height: 0; display: flex; gap: 0; overflow: auto; }
.tb-gateway-info { flex: 1; min-width: 0; padding: 18px 22px; background: var(--tb-panel); }
.tb-info-row { display: flex; gap: 40px; padding-bottom: 14px; border-bottom: 1px solid var(--tb-line); }
.tb-gateway-info span { display: block; font-size: 11px; letter-spacing: 0.08em; color: var(--tb-soft); }
.tb-gateway-info b { display: block; font-size: 15px; margin-top: 2px; }
.tb-info-company { padding-top: 14px; }
.tb-info-company b { font-size: 19px; }
.tb-info-company small { display: block; margin-top: 6px; color: var(--tb-soft); font-size: 12.5px; max-width: 46ch; }
.tb-menu { width: 330px; flex: none; margin: 18px 26px 18px 0; align-self: flex-start; background: #fff; border: 1px solid var(--tb-line); box-shadow: 0 1px 3px rgba(13, 51, 80, 0.18); padding-bottom: 8px; }
.tb-menu-title { background: var(--tb-title); color: #fff; text-align: center; font-weight: 600; padding: 5px 8px; }
.tb-menu-section { margin: 9px 0 2px; text-align: center; font-size: 11px; letter-spacing: 0.1em; color: var(--tb-soft); }
.tb-menu-item { display: block; width: 100%; border: 0; background: transparent; padding: 3px 12px; text-align: center; font: inherit; font-size: 14.5px; color: var(--tb-ink); cursor: pointer; }
.tb-hot { color: var(--tb-hot); font-weight: 700; }
.tb-root .tb-selected, .tb-root .tb-menu-item.tb-selected { background: var(--tb-bar); color: var(--tb-bar-ink); }
.tb-root .tb-selected .tb-hot { color: #7a1009; }

/* Reports */
.tb-report { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tb-report-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; padding: 8px 14px 6px; border-bottom: 2px solid var(--tb-ink); }
.tb-report-title { font-weight: 700; }
.tb-report-title small { display: block; font-weight: 600; font-size: 13px; color: var(--tb-soft); }
.tb-report-company { font-weight: 700; font-size: 16px; text-align: center; }
.tb-report-period { text-align: right; font-weight: 600; }
.tb-path { margin: 0; padding: 3px 14px; font-size: 12.5px; color: var(--tb-soft); border-bottom: 1px solid var(--tb-line); }
.tb-scroll { flex: 1; min-height: 0; overflow: auto; }
.tb-scroll-short { flex: none; max-height: 44vh; }

.tb-table { width: 100%; border-collapse: collapse; }
.tb-table th, .tb-table td { padding: 2px 12px; text-align: right; white-space: nowrap; vertical-align: top; }
.tb-table .tb-left { text-align: left; white-space: normal; }
.tb-table .tb-date { width: 92px; white-space: nowrap; }
/* The headings and the totals stay in sight while the rows between them scroll. */
.tb-table thead { position: sticky; top: 0; z-index: 1; }
.tb-table thead th { background: #edf2f7; font-weight: 600; font-size: 13px; }
.tb-table thead tr:last-child th { border-bottom: 1px solid var(--tb-ink); }
/* A row brought into view by the arrow keys must clear them (two heading rows, three total rows at most). */
.tb-table tbody tr { border-bottom: 1px solid #edf1f5; scroll-margin: 50px 0 76px; }
.tb-table tbody tr.tb-opens { cursor: pointer; }
.tb-table tbody tr.tb-opens:hover:not(.tb-selected) { background: #fff6da; }
.tb-table tfoot { position: sticky; bottom: 0; z-index: 1; }
.tb-table tfoot td { background: #edf2f7; font-weight: 700; }
.tb-table tfoot tr:first-child td { border-top: 1px solid var(--tb-ink); }
.tb-group-row td { font-weight: 600; }
.tb-result-row td { font-weight: 700; font-style: italic; }
.tb-muted-row td { color: var(--tb-soft); }
.tb-table em { font-style: normal; color: var(--tb-soft); font-size: 12.5px; }
.tb-selected em, .tb-selected small { color: #4a3900; }
.tb-empty { padding: 18px 12px !important; color: var(--tb-soft); }
.tb-nature { color: var(--tb-soft); text-transform: capitalize; }
.tb-instrument { display: block; font-size: 12px; color: var(--tb-soft); padding-left: 30px; }
.tb-drcr { display: inline-block; width: 30px; font-weight: 700; color: var(--tb-soft); }
.tb-link { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.tb-link:hover { text-decoration: underline; }

.tb-two { display: grid; grid-template-columns: 1fr 1fr; align-items: start; border-bottom: 2px solid var(--tb-ink); }
.tb-two > .tb-side + .tb-side { border-left: 1px solid var(--tb-ink); }
.tb-side thead, .tb-side tfoot { position: static; }

.tb-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; padding: 6px 14px; border-bottom: 1px solid var(--tb-line); background: #f3f7fa; }
.tb-filters label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--tb-soft); }
.tb-filters input, .tb-filters select, .tb-dialog input { font: inherit; font-size: 14px; padding: 3px 6px; border: 1px solid var(--tb-line); border-radius: 2px; background: #fff; color: var(--tb-ink); min-width: 220px; }
.tb-count { margin-left: auto; font-size: 13px; color: var(--tb-soft); }

.tb-voucher-head { display: flex; align-items: baseline; gap: 22px; padding: 8px 14px; border-bottom: 2px solid var(--tb-ink); }
.tb-voucher-type { background: var(--tb-title); color: #fff; font-weight: 700; padding: 2px 12px; }
.tb-voucher-date { margin-left: auto; font-weight: 700; }
.tb-voucher-party { margin: 0; padding: 5px 14px; border-bottom: 1px solid var(--tb-line); }
.tb-narration { margin: 0; padding: 8px 14px; border-top: 1px solid var(--tb-line); }
.tb-narration span { color: var(--tb-soft); }

.tb-message { margin: 10px 14px; padding: 7px 10px; background: #eef3f8; border-left: 3px solid var(--tb-top); }
.tb-error { background: #fdeceb; border-left-color: var(--tb-bad); color: var(--tb-bad); }
.tb-message.tb-good { background: #e9f6ee; border-left-color: var(--tb-good); color: #134a29; }
td.tb-good { color: var(--tb-good); }
td.tb-bad { color: var(--tb-bad); white-space: normal !important; }
.tb-note { margin: 8px 14px; font-size: 12.5px; color: var(--tb-soft); max-width: 110ch; }
.tb-subhead { margin: 16px 14px 4px; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--tb-soft); }
.tb-list { margin: 4px 14px 8px 34px; padding: 0; max-width: 100ch; }
.tb-list li { margin: 3px 0; }
.tb-check td:first-child { width: 290px; color: var(--tb-soft); }
.tb-check { margin-bottom: 14px; }
.tb-pager { display: flex; align-items: center; gap: 12px; margin: 0; padding: 6px 14px; border-top: 1px solid var(--tb-line); font-size: 13px; }
.tb-pager button, .tb-button { border: 1px solid var(--tb-line); background: #f4f8fb; color: var(--tb-ink); border-radius: 2px; padding: 3px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.tb-button:hover:not(:disabled), .tb-pager button:hover:not(:disabled) { border-color: var(--tb-top); background: #fff; }
.tb-button:disabled, .tb-pager button:disabled { opacity: 0.5; cursor: default; }
.tb-button.tb-primary { background: var(--tb-top); border-color: var(--tb-top); color: #fff; }
.tb-button.tb-danger { background: var(--tb-bad); border-color: var(--tb-bad); color: #fff; }

.tb-drop { margin: 14px; padding: 22px 16px; border: 2px dashed #8fb0cc; background: #f3f8fc; text-align: center; }
.tb-drop p { margin: 4px 0 10px; color: var(--tb-soft); }
.tb-drop .tb-drop-title { font-size: 17px; font-weight: 700; color: var(--tb-ink); }
.tb-drop-over { border-color: var(--tb-top); background: #e3effa; }

.tb-dialog-back { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(13, 51, 80, 0.32); z-index: 5; }
.tb-dialog { width: 380px; background: #fff; border: 1px solid var(--tb-title); box-shadow: 0 6px 22px rgba(13, 51, 80, 0.35); display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.tb-dialog label { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; }
.tb-dialog p { margin: 0; padding: 0 14px; }
.tb-quit { width: 320px; }
.tb-hot-light { font-weight: 700; text-decoration: underline; }
.tb-dialog-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px; }
.tb-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 14px; }

/* Entering a voucher, approving, the bridge (CompanyBooksEntries.tsx) */
.tb-entry input, .tb-entry select, .tb-entry textarea { font: inherit; font-size: 14px; padding: 2px 6px; border: 1px solid var(--tb-line); border-radius: 2px; background: #fff; color: var(--tb-ink); }
.tb-entry input:focus, .tb-entry select:focus, .tb-entry textarea:focus { outline: 2px solid var(--tb-bar); outline-offset: -1px; background: #fffbea; }
.tb-entry input:disabled, .tb-entry select:disabled, .tb-entry textarea:disabled { background: #f3f6f9; color: var(--tb-ink); border-color: #e3e9ef; }
.tb-entry input.tb-unknown { border-color: var(--tb-bad); background: #fdf1f0; }
.tb-kinds { display: flex; flex-wrap: wrap; gap: 3px; padding: 6px 14px 0; }
.tb-kind { border: 1px solid var(--tb-line); border-bottom: 0; background: #edf2f7; color: var(--tb-ink); padding: 3px 12px; font: inherit; font-size: 13px; cursor: pointer; border-radius: 3px 3px 0 0; }
.tb-kind b { color: var(--tb-top); margin-right: 6px; font-weight: 700; }
.tb-kind:disabled { opacity: 0.4; cursor: default; }
.tb-kind-on, .tb-kind-on:disabled { background: var(--tb-title); color: #fff; border-color: var(--tb-title); opacity: 1; }
.tb-kind-on b { color: var(--tb-bar); }
.tb-entry-head { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; padding: 8px 14px; border-top: 2px solid var(--tb-title); border-bottom: 1px solid var(--tb-line); background: #f3f7fa; }
.tb-entry-head label, .tb-ledger-form label, .tb-narration-box { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--tb-soft); }
.tb-entry-head .tb-grow { flex: 1; min-width: 240px; }
.tb-entry-head .tb-voucher-type { align-self: center; }
.tb-entry-table { margin-top: 2px; }
.tb-entry-table td { padding: 2px 6px; vertical-align: middle; }
.tb-entry-table thead, .tb-entry-table tfoot { position: static; }
.tb-entry-table td.tb-left input { width: 100%; min-width: 150px; }
.tb-entry-table input.tb-num { width: 118px; text-align: right; }
.tb-entry-table td.tb-left input.tb-short { min-width: 100px; width: 132px; }
.tb-entry-table input.tb-wide { min-width: 300px; }
.tb-side-col { width: 78px; }
.tb-entry .tb-filters input, .tb-entry .tb-filters select { min-width: 0; }
.tb-entry input.tb-tiny { width: 64px; }
.tb-filters input.tb-wide { min-width: 380px; }
.tb-gst { align-items: end; }
.tb-diff { color: var(--tb-bad) !important; font-weight: 600; margin-left: 10px; }
.tb-narration-box { margin: 8px 14px 0; }
.tb-narration-box textarea { resize: vertical; width: 100%; max-width: 900px; }
.tb-status { display: flex; flex-direction: column; gap: 3px; margin: 10px 14px 4px; padding: 8px 10px; border-left: 4px solid var(--tb-soft); background: #eef3f8; }
.tb-status small { color: var(--tb-soft); }
.tb-status-actions { display: flex; gap: 8px; margin-top: 4px; }
.tb-status-actions:empty { display: none; }
.tb-status-verified { border-left-color: var(--tb-good); background: #e9f6ee; }
.tb-status-refused, .tb-status-uncertain { border-left-color: var(--tb-bad); background: #fdeceb; }
.tb-status-approved, .tb-status-sending, .tb-status-sent { border-left-color: var(--tb-top); }
.tb-status-draft { border-left-color: #b98a00; background: #fff8e1; }
.tb-mark { display: inline-block; padding: 0 6px; border-radius: 8px; font-size: 11.5px; font-weight: 600; line-height: 17px; white-space: nowrap; border: 1px solid transparent; }
.tb-mark-draft { background: #fff3c9; color: #6b4e00; border-color: #e6c860; }
.tb-mark-approved, .tb-mark-sending, .tb-mark-sent { background: #dde9f6; color: #123f6b; border-color: #a9c4e0; }
.tb-mark-verified { background: #d9f0e0; color: #134a29; border-color: #9fd0b0; }
.tb-mark-refused, .tb-mark-uncertain { background: #fbdcd9; color: #7d1c12; border-color: #e9a59e; }
.tb-ledger-form { display: grid; grid-template-columns: repeat(2, minmax(240px, 420px)); gap: 10px 22px; padding: 12px 14px; }
.tb-ledger-form .tb-ledger-address { grid-column: 1 / -1; max-width: 862px; }
.tb-pager .tb-count { margin-left: 0; }
.tb-message .tb-button { margin-left: 8px; }

/* The number of an invoice on the voucher screen, and its print preview (CompanyBooksPrint.tsx) */
.tb-number { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--tb-soft); }
.tb-number output { display: block; min-width: 150px; padding: 2px 8px; border: 1px solid var(--tb-line); border-radius: 2px; background: #f3f6f9; color: var(--tb-ink); font-size: 14px; font-weight: 700; line-height: 20px; }
.tb-number output.tb-number-expected { background: #fff8e1; border-color: #e6c860; }
.tb-number output.tb-number-own { background: #e9f6ee; border-color: #9fd0b0; }
.tb-number output.tb-number-none { font-weight: 400; color: var(--tb-soft); }
.tb-voucher-head .tb-button { align-self: center; }
.tb-print-back { align-items: stretch; padding: 14px; }
.tb-dialog.tb-print { width: min(980px, 100%); max-height: 100%; margin: 0 auto; gap: 6px; padding-bottom: 0; outline: none; overflow: hidden; }
.tb-print-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 2px 14px; }
.tb-print-bar .tb-count { margin-left: auto; }
.tb-dialog.tb-print p.tb-message { margin: 0 14px; padding: 6px 10px; }
.tb-print-mark { background: #fff8e1; border-left-color: #b98a00; }
.tb-print-notes { margin: 0 14px 0 34px; font-size: 12.5px; color: var(--tb-soft); max-width: none; }
.tb-print-pages { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px 16px; background: #dfe7ee; border-top: 1px solid var(--tb-line); }
.tb-print-page { margin: 0 auto 12px; max-width: 850px; background: #fff; box-shadow: 0 1px 5px rgba(13, 51, 80, 0.35); }
.tb-print-page canvas { display: block; width: 100%; height: auto; }
.tb-print-details { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 0 14px; }
.tb-dialog.tb-print label.tb-print-box { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 3px; font-size: 13px; color: var(--tb-ink); }
.tb-print-box small { color: var(--tb-soft); font-size: 12px; }
.tb-print-box textarea { font: inherit; font-size: 14px; padding: 4px 6px; border: 1px solid var(--tb-line); border-radius: 2px; resize: vertical; }

@media (max-width: 900px) {
  .tb-ledger-form { grid-template-columns: 1fr; }
  .tb-top-note, .tb-crumbs { display: none; }
  .tb-gateway { flex-direction: column; }
  .tb-menu { width: auto; margin: 12px; align-self: stretch; }
  .tb-buttons { width: 92px; }
  .tb-side-button { flex-direction: column; gap: 0; }
  .tb-two { grid-template-columns: 1fr; }
  .tb-two > .tb-side + .tb-side { border-left: 0; border-top: 1px solid var(--tb-ink); }
  .tb-report-head { grid-template-columns: 1fr; }
  .tb-report-company, .tb-report-period { text-align: left; }
}
/* ============================================================================
   Marketing department — floor theme + dashboard (premium dark glass, warm amber).

   Namespace: every class in this file starts with `mk-`. Design tokens come from
   styles.css (:root): --bg, --panel, --border, --text, --muted and the
   --status-* colours. The department accent is set ONCE as --mk-accent and
   re-exported as --accent inside the two marketing roots (.mk-scene, .mk-dash),
   so the shared components they contain (LivingOffice, toolbar buttons,
   EmployeePanel) pick up the amber while the Finance floor stays sky-blue.
   ========================================================================== */

.mk-scene,
.mk-dash {
  --mk-accent: #f59e0b;
  --mk-accent-strong: #fbbf24;
  --mk-accent-ink: #1c1917;
  --mk-accent-rgb: 245, 158, 11;
  --mk-accent-soft: rgba(245, 158, 11, 0.14);
  --mk-accent-line: rgba(245, 158, 11, 0.5);
  --mk-glass: rgba(30, 41, 59, 0.55);
  --mk-glass-strong: rgba(15, 23, 42, 0.78);
  --mk-inset: rgba(15, 23, 42, 0.55);
  --mk-border: rgba(255, 255, 255, 0.18);
  --mk-border-strong: rgba(255, 255, 255, 0.3);
  --mk-border-soft: rgba(255, 255, 255, 0.1);
  --mk-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.75), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  --mk-radius: 16px;
  --mk-radius-s: 12px;
  --mk-radius-xs: 8px;
  --mk-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --accent: var(--mk-accent);
}

/* ---------- Floor: amber re-tint of the shared living-office chrome ---------- */

.mk-scene .lo-toolbar button.primary-btn {
  box-shadow: 0 6px 18px rgba(var(--mk-accent-rgb), 0.28);
}
.mk-scene .lo-toolbar button.primary-btn:hover {
  box-shadow: 0 8px 22px rgba(var(--mk-accent-rgb), 0.38);
}
.mk-scene .lo-motion-toggle[aria-pressed='true'] {
  border-color: var(--mk-accent-line);
  background: var(--mk-accent-soft);
  color: #fef3c7;
}
.mk-scene .lo-hotspot:focus-visible {
  box-shadow: 0 0 0 6px rgba(var(--mk-accent-rgb), 0.18);
}
.mk-scene .lo-desk-selected .lo-plate {
  border-color: rgba(var(--mk-accent-rgb), 0.7);
  box-shadow:
    0 0 0 1px rgba(var(--mk-accent-rgb), 0.35),
    0 0 28px rgba(var(--mk-accent-rgb), 0.22),
    var(--lo-shadow);
}
.mk-scene .lo-marker {
  box-shadow:
    var(--lo-shadow),
    0 0 0 4px rgba(var(--mk-accent-rgb), 0.14);
}
.mk-scene .lo-marker::before {
  border-color: rgba(var(--mk-accent-rgb), 0.45);
}
.mk-scene .lo-root {
  background: radial-gradient(120% 90% at 50% 38%, #2a2416 0%, var(--bg) 52%, #0a0806 100%);
}
.mk-scene .lo-ambient {
  background:
    linear-gradient(104deg, transparent 28%, rgba(255, 214, 150, 0.14) 42%, rgba(255, 236, 200, 0.26) 49%, rgba(255, 214, 150, 0.12) 56%, transparent 70%),
    radial-gradient(55% 45% at 18% 8%, rgba(251, 191, 36, 0.14), transparent 72%),
    radial-gradient(40% 40% at 88% 92%, rgba(245, 158, 11, 0.08), transparent 70%);
}

/* the role line under a person's name on the plate */
.mk-scene .lo-subtitle {
  color: #cbd5e1;
  font-size: 0.84em;
  letter-spacing: 0.01em;
}

/* toolbar meta: the publishing gate LED */
.mk-meta-gate {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.mk-meta-gate i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  background: var(--status-offline);
}
.mk-meta-gate.is-off {
  color: #fde68a;
}
.mk-meta-gate.is-off i {
  background: var(--mk-accent);
  box-shadow: 0 0 8px rgba(var(--mk-accent-rgb), 0.7);
}
.mk-meta-gate.is-on {
  color: #86efac;
}
.mk-meta-gate.is-on i {
  background: var(--status-available);
}
.mk-meta-gate.is-unknown {
  color: var(--muted);
}

/* thin notice under the toolbar when /api/marketing/status does not answer */
.mk-banner {
  position: relative;
  z-index: 7;
  padding: 8px 20px;
  font-size: 12.5px;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.1);
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
}

/* ---------- Floor: the DEPARTMENT glass card (inside LivingOffice's corner slot) ---------- */

.mk-dept {
  padding: 0.9em 1.05em;
  font-size: clamp(10.5px, 0.8cqw, 12.5px);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.45em;
}
.mk-dept-title {
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 0.85em;
  color: #fde68a;
  margin-bottom: 0.2em;
}
.mk-dept-row {
  display: flex;
  justify-content: space-between;
  gap: 1em;
  line-height: 1.3;
}
.mk-dept-key {
  color: #cbd5e1;
  flex: none;
}
.mk-dept-val {
  text-align: right;
  font-weight: 600;
  color: #ffffff;
  overflow-wrap: anywhere;
}
.mk-dept-val.is-on {
  color: #bbf7d0;
}
.mk-dept-val.is-off {
  color: #fde68a;
}
.mk-dept-val.is-warn {
  color: #fdba74;
}
.mk-dept-val.is-muted {
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Dashboard: layout ---------- */

.mk-dash {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(245, 158, 11, 0.12), transparent 60%),
    radial-gradient(900px 480px at -10% 100%, rgba(251, 146, 60, 0.08), transparent 60%),
    var(--bg);
}
.mk-dash *,
.mk-dash *::before,
.mk-dash *::after {
  box-sizing: border-box;
}
.mk-dash :focus-visible {
  outline: 2px solid var(--mk-accent);
  outline-offset: 2px;
}
.mk-dash h2,
.mk-dash h3,
.mk-dash h4,
.mk-dash p {
  margin: 0;
}

.mk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--mk-border-soft);
  flex-wrap: wrap;
}
.mk-head-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.mk-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.mk-title h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.mk-title p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.mk-stats {
  display: flex;
  gap: 8px;
  padding: 12px 20px 0;
  flex-wrap: wrap;
}
.mk-stat {
  display: flex;
  flex-direction: column;
  min-width: 108px;
  padding: 8px 12px;
  border-radius: var(--mk-radius-s);
  background: var(--mk-glass);
  border: 1px solid var(--mk-border-soft);
  box-shadow: var(--mk-shadow);
}
.mk-stat strong {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}
.mk-stat span {
  font-size: 11.5px;
  color: var(--muted);
}
.mk-stat.is-attn {
  border-color: var(--mk-accent-line);
  background: var(--mk-accent-soft);
}
.mk-stat.is-attn strong {
  color: #fde68a;
}
.mk-stat.is-bad {
  border-color: rgba(239, 68, 68, 0.5);
}
.mk-stat.is-bad strong {
  color: #fecaca;
}

.mk-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 20px 0;
  flex-wrap: wrap;
}
.mk-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--mk-border);
  background: var(--mk-glass);
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s var(--mk-ease), background-color 0.15s var(--mk-ease), color 0.15s var(--mk-ease);
}
.mk-tab:hover {
  border-color: var(--mk-border-strong);
  color: var(--text);
}
.mk-tab.is-active {
  color: #fef3c7;
  border-color: var(--mk-accent-line);
  background: var(--mk-accent-soft);
}
.mk-tab-count {
  min-width: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.mk-tab.is-active .mk-tab-count {
  background: rgba(var(--mk-accent-rgb), 0.3);
}

.mk-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- Dashboard: shared bits ---------- */

.mk-panel {
  background: var(--mk-glass);
  border: 1px solid var(--mk-border-soft);
  border-radius: var(--mk-radius);
  box-shadow: var(--mk-shadow);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mk-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--mk-border);
  background: var(--mk-glass);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.mk-pill-ok {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.1);
}
.mk-pill-dry,
.mk-pill-warn {
  color: #fde68a;
  border-color: var(--mk-accent-line);
  background: var(--mk-accent-soft);
}
.mk-pill-off {
  color: var(--muted);
}
.mk-pill-bad {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.1);
}

.mk-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--mk-border);
  color: var(--text);
  white-space: nowrap;
}
.mk-badge-dry {
  color: #fde68a;
  border-color: var(--mk-accent-line);
  background: var(--mk-accent-soft);
}
.mk-badge-ok {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.45);
}
.mk-badge-bad {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.5);
}
.mk-badge-muted {
  color: var(--muted);
}

.mk-note {
  padding: 10px 14px;
  border-radius: var(--mk-radius-s);
  border: 1px solid var(--mk-border-soft);
  background: var(--mk-inset);
  font-size: 12.5px;
}
.mk-note-error {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
  overflow-wrap: anywhere;
}
.mk-note-info {
  color: var(--text);
}
.mk-note-info strong {
  color: #fde68a;
}

.mk-hint {
  color: var(--muted);
  font-size: 12px;
}
.mk-empty {
  color: var(--muted);
  font-size: 12.5px;
  font-style: italic;
}
.mk-error {
  color: #fca5a5;
  font-size: 12px;
  overflow-wrap: anywhere;
  margin: 0;
}

.mk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--mk-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s var(--mk-ease), border-color 0.15s var(--mk-ease), transform 0.15s var(--mk-ease), box-shadow 0.15s var(--mk-ease);
}
.mk-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--mk-border-strong);
}
.mk-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.mk-btn-primary {
  background: var(--mk-accent);
  border-color: transparent;
  color: var(--mk-accent-ink);
  box-shadow: 0 6px 18px rgba(var(--mk-accent-rgb), 0.28);
}
.mk-btn-primary:hover:not(:disabled) {
  background: var(--mk-accent-strong);
  box-shadow: 0 8px 22px rgba(var(--mk-accent-rgb), 0.38);
  transform: translateY(-1px);
}
.mk-btn-danger {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.1);
}
.mk-btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.7);
}
.mk-btn-ghost {
  background: transparent;
}
.mk-btn-sm {
  height: 26px;
  padding: 0 10px;
  font-size: 11.5px;
}
.mk-link {
  background: none;
  border: 0;
  padding: 0;
  color: #fde68a;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.mk-link:hover {
  color: #fef3c7;
}

/* forms */
.mk-form {
  gap: 12px;
}
.mk-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}
.mk-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.mk-field > span,
.mk-field > legend {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
  padding: 0;
}
.mk-field-wide {
  grid-column: 1 / -1;
}
.mk-dash .mk-input {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: var(--mk-radius-xs);
  border: 1px solid var(--mk-border);
  background: var(--mk-inset);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.mk-dash textarea.mk-input {
  resize: vertical;
  min-height: 64px;
  line-height: 1.4;
}
.mk-dash .mk-input:focus-visible {
  border-color: var(--mk-accent-line);
}
.mk-checks {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.mk-checks > legend {
  flex-basis: 100%;
}
.mk-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  border: 1px solid var(--mk-border-soft);
  background: var(--mk-inset);
  font-size: 12.5px;
  cursor: pointer;
}
.mk-check input {
  margin: 0;
  accent-color: var(--mk-accent);
}
.mk-form-actions,
.mk-inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ---------- Dashboard: board ---------- */

.mk-board-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mk-board-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.mk-board-scroll {
  overflow-x: auto;
  padding-bottom: 6px;
}
.mk-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(230px, 1fr));
  gap: 12px;
  min-width: 1190px;
  align-items: start;
}
.mk-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--mk-radius);
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid var(--mk-border-soft);
  min-height: 220px;
}
.mk-col-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}
.mk-col-count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.mk-col-head p {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 2px;
}
.mk-col-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mk-col-owner {
  border-color: var(--mk-accent-line);
  background: rgba(245, 158, 11, 0.06);
}

.mk-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 13px;
  border-radius: var(--mk-radius-s);
  background: var(--mk-glass-strong);
  border: 1px solid var(--mk-border-soft);
  box-shadow: var(--mk-shadow);
  transition: border-color 0.15s var(--mk-ease);
}
.mk-card:hover {
  border-color: var(--mk-border);
}
.mk-card.is-editing {
  border-color: var(--mk-accent-line);
}
.mk-card-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.mk-num {
  flex: none;
  font-size: 11.5px;
  font-weight: 700;
  color: #fde68a;
  font-variant-numeric: tabular-nums;
}
.mk-card-title {
  font-size: 13.5px;
  font-weight: 650;
  color: #ffffff;
  overflow-wrap: anywhere;
}
.mk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.mk-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--mk-border-soft);
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.mk-chip-kind {
  color: #fde68a;
  border-color: var(--mk-accent-line);
}
.mk-chip-ver {
  color: var(--muted);
}
.mk-chip-claims {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.1);
}
.mk-chip-state {
  color: var(--muted);
}
.mk-card-meta {
  font-size: 12px;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}
.mk-card-brief,
.mk-card-notes {
  font-size: 12px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mk-card-notes {
  color: #fdba74;
}
.mk-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.mk-card-actions .mk-btn {
  height: 28px;
  padding: 0 11px;
  font-size: 12px;
}
.mk-inline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: var(--mk-radius-xs);
  background: var(--mk-inset);
  border: 1px solid var(--mk-border-soft);
}
.mk-result {
  padding: 8px 10px;
  border-radius: var(--mk-radius-xs);
  border: 1px solid var(--mk-border-soft);
  background: var(--mk-inset);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.mk-result strong {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
}
.mk-result-dry {
  border-color: var(--mk-accent-line);
}
.mk-result-dry strong {
  color: #fde68a;
  background: var(--mk-accent-soft);
}
.mk-result-live strong {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.14);
}
.mk-result-jobs {
  margin: 6px 0 0;
  padding-left: 18px;
}
.mk-history {
  font-size: 11.5px;
  color: var(--muted);
}
.mk-history summary {
  cursor: pointer;
}
.mk-history ul {
  margin: 6px 0 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mk-history-at {
  font-variant-numeric: tabular-nums;
  color: #94a3b8;
}
.mk-history strong {
  color: var(--text);
  font-weight: 600;
}
.mk-closed summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
.mk-closed-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

/* captions editor */
.mk-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.mk-editor-head h3 {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}
.mk-copy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.mk-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--mk-radius-s);
  background: var(--mk-inset);
  border: 1px solid var(--mk-border-soft);
}
.mk-copy-head {
  font-size: 12.5px;
  font-weight: 700;
  color: #fde68a;
}
.mk-assets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mk-gen {
  display: grid;
  grid-template-columns: 140px 120px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

/* ---------- Dashboard: tables ---------- */

.mk-table-wrap {
  overflow-x: auto;
}
.mk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.mk-table th,
.mk-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--mk-border-soft);
  vertical-align: top;
}
.mk-table th {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.mk-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}
.mk-table .mk-empty {
  text-align: center;
}
.mk-pre {
  margin: 6px 0 0;
  padding: 8px 10px;
  border-radius: var(--mk-radius-xs);
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid var(--mk-border-soft);
  font-family: Consolas, 'Cascadia Mono', 'Segoe UI Mono', ui-monospace, monospace;
  font-size: 11.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 560px;
}
.mk-table details summary {
  cursor: pointer;
  color: #fde68a;
  font-weight: 600;
}
.mk-table a {
  color: #fde68a;
}

/* ---------- Dashboard: campaigns ---------- */

.mk-camp-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.mk-camp {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 13px;
  border-radius: var(--mk-radius-s);
  background: var(--mk-glass-strong);
  border: 1px solid var(--mk-border-soft);
  box-shadow: var(--mk-shadow);
}
.mk-camp h4 {
  font-size: 13.5px;
  font-weight: 650;
  color: #ffffff;
}
.mk-camp-line {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Dashboard: connections summary ---------- */

.mk-conn-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.mk-conn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.mk-conn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--mk-radius-s);
  background: var(--mk-glass-strong);
  border: 1px solid var(--mk-border-soft);
}
.mk-conn-led {
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--status-offline);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}
.mk-conn-ok .mk-conn-led {
  background: var(--status-available);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.7);
}
.mk-conn-warn .mk-conn-led {
  background: var(--mk-accent);
  box-shadow: 0 0 10px rgba(var(--mk-accent-rgb), 0.7);
}
.mk-conn-name {
  font-weight: 700;
  color: #ffffff;
}
.mk-conn-text {
  font-size: 12px;
  color: var(--text);
}
.mk-conn-detail {
  font-size: 11.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.mk-conn-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Responsive ---------- */

/* Below 1280px the five columns share the width instead of overflowing behind a horizontal
   scrollbar that sits under the tallest column (at 1024px the Published column was clipped).
   Cards already wrap their chips, actions and text. */
@media (max-width: 1279px) {
  .mk-board {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .mk-form-grid {
    grid-template-columns: 1fr;
  }
  .mk-gen {
    grid-template-columns: 1fr 1fr;
  }
  .mk-head,
  .mk-stats,
  .mk-tabs,
  .mk-body {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .mk-tab,
  .mk-btn,
  .mk-card,
  .mk-btn-primary:hover:not(:disabled) {
    transition: none;
    transform: none;
  }
}

/* ---------- Dashboard: the Marketing Director's campaigns (CampaignsTab.tsx) ---------- */

.mk-camp h4 .mk-link {
  font: inherit;
  color: inherit;
  text-align: left;
}
.mk-camp-detail h3 {
  margin: 6px 0 2px;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}
.mk-camp-detail h4 {
  margin: 16px 0 6px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.mk-camp-controls {
  margin-top: 12px;
  padding: 12px 13px;
  border-radius: var(--mk-radius-s);
  background: var(--mk-glass-strong);
  border: 1px solid var(--mk-border-soft);
}
.mk-camp-brief {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr);
  gap: 6px 14px;
  margin: 0;
  font-size: 13px;
}
.mk-camp-brief dt {
  color: var(--muted);
}
.mk-camp-brief dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.mk-camp-tasks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
}
.mk-camp-tasks li {
  padding-left: 14px;
  position: relative;
  overflow-wrap: anywhere;
}
.mk-camp-tasks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.mk-camp-tasks li.is-done::before {
  background: #22c55e;
}
.mk-camp-tasks li.is-failed::before {
  background: #ef4444;
}
.mk-camp-tasks li.is-started::before {
  background: #38bdf8;
}
.mk-camp-tasks .mk-history-at {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* ============================================================================
   Marketing dashboard — gate M8 tabs: Plans, Calendar, Report.

   Same namespace and tokens as marketing.css (every class starts with `mk-`; the
   --mk-* tokens are defined on .mk-dash). Prefixes: mk-plan-* (Plans tab),
   mk-cal-* (Calendar tab), mk-rep-* (Report tab). State is never shown by colour
   alone: every entry carries its state as text, planned entries have a dashed
   outline and each state group has its own marker shape.
   ========================================================================== */

/* ---------- shared bits ---------- */

.mk-field-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.mk-num-col {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}
.mk-nowrap {
  white-space: nowrap;
}

/* rupee amounts typed with Indian grouping */
.mk-rupee {
  position: relative;
  display: block;
  min-width: 0;
}
.mk-rupee-sign {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}
.mk-dash .mk-rupee .mk-input {
  padding-left: 24px;
  font-variant-numeric: tabular-nums;
}

.mk-item-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mk-item-view > .mk-card {
  max-width: 640px;
}

/* ---------- Plans ---------- */

.mk-plan-wrap,
.mk-cal-wrap,
.mk-rep-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.mk-plan-h {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}
.mk-plan-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.mk-plan-fieldset:disabled {
  opacity: 0.7;
}

.mk-plan-working {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--mk-radius-s);
  border: 1px solid var(--mk-accent-line);
  background: var(--mk-accent-soft);
  color: #fef3c7;
  font-size: 12.5px;
}
.mk-plan-working p {
  flex: 1;
  min-width: 0;
}
.mk-plan-spinner {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(var(--mk-accent-rgb), 0.3);
  border-top-color: var(--mk-accent);
  animation: mk-plan-spin 0.9s linear infinite;
}
@keyframes mk-plan-spin {
  to {
    transform: rotate(360deg);
  }
}
.mk-plan-elapsed {
  flex: none;
  font-variant-numeric: tabular-nums;
  color: #fde68a;
  font-weight: 600;
}

.mk-plan-table tr.is-selected {
  background: var(--mk-accent-soft);
  box-shadow: inset 3px 0 0 var(--mk-accent);
}
.mk-plan-table tr.is-selected:hover {
  background: var(--mk-accent-soft);
}
.mk-plan-goal {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  max-width: 520px;
}

.mk-plan-detail {
  gap: 14px;
}
.mk-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.mk-plan-head-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.mk-plan-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}
.mk-plan-detail .mk-inline p {
  font-size: 12.5px;
}

.mk-plan-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 14px;
  margin: 0;
}
.mk-plan-facts > div:first-child {
  grid-column: 1 / -1;
}
.mk-plan-facts dt {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.mk-plan-facts dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.mk-plan-weeks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mk-plan-week {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 12px;
  min-width: 0;
  border-radius: var(--mk-radius-s);
  border: 1px solid var(--mk-border-soft);
  background: rgba(15, 23, 42, 0.42);
}
.mk-plan-week-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}
.mk-plan-week-no {
  color: #fde68a;
  font-variant-numeric: tabular-nums;
}
.mk-plan-theme {
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}
.mk-plan-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mk-plan-item {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--mk-radius-xs);
  border: 1px solid var(--mk-border-soft);
  background: var(--mk-glass-strong);
}
.mk-plan-item-date {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}
.mk-plan-item-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.mk-plan-item-title {
  font-size: 13px;
  font-weight: 650;
  color: #ffffff;
  overflow-wrap: anywhere;
}
.mk-plan-item-brief {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.mk-plan-split,
.mk-plan-notes-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mk-plan-split-table {
  max-width: 520px;
}
.mk-plan-split-table tfoot th,
.mk-plan-split-table tfoot td {
  color: var(--muted);
  font-weight: 600;
  border-bottom: 0;
}
.mk-plan-split-table tbody th,
.mk-rep-wrap .mk-table tbody th {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12.5px;
  color: var(--text);
}
.mk-plan-notes {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12.5px;
}

.mk-plan-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--mk-radius-s);
  border: 1px solid rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.08);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.mk-plan-result-tag {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.16);
}
.mk-plan-drafts {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mk-plan-result .mk-link {
  align-self: flex-start;
}

.mk-plan-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* floated legends sit inside the box like a heading instead of on its border */
.mk-plan-week-edit > legend,
.mk-plan-edit-item > legend {
  float: left;
  width: 100%;
}
.mk-plan-week-edit > legend + *,
.mk-plan-edit-item > legend + * {
  clear: both;
}
.mk-plan-edit-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  min-width: 0;
  border-radius: var(--mk-radius-xs);
  border: 1px solid var(--mk-border-soft);
  background: var(--mk-glass-strong);
}
.mk-plan-edit-item > legend {
  padding: 0;
  font-size: 12px;
  font-weight: 650;
  color: #cbd5e1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mk-plan-edit-grid {
  display: grid;
  grid-template-columns: 160px 150px minmax(0, 1fr);
  gap: 8px 12px;
}
.mk-plan-split-edit {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px 12px;
}
.mk-plan-problems {
  margin: 6px 0 0;
  padding-left: 18px;
}

/* ---------- Calendar ---------- */

.mk-cal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
}
.mk-cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mk-cal-month {
  min-width: 150px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.mk-cal-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--muted);
}
.mk-cal-legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.mk-cal-swatch {
  flex: none;
  width: 22px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--mk-border);
  background: var(--mk-glass-strong);
}
.mk-cal-swatch.is-planned {
  border: 1px dashed var(--mk-accent-line);
  background: transparent;
}
.mk-cal-swatch.is-owner {
  border: 2px solid var(--mk-accent);
  background: var(--mk-accent-soft);
}

.mk-cal-grid-wrap {
  min-width: 0;
}
.mk-cal-grid {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 4px;
}
.mk-cal-grid th {
  padding: 2px 6px 4px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
}
.mk-cal-day {
  height: 104px;
  padding: 6px;
  vertical-align: top;
  border-radius: 10px;
  border: 1px solid var(--mk-border-soft);
  background: rgba(15, 23, 42, 0.42);
  overflow: hidden;
}
.mk-cal-day.is-out {
  background: transparent;
  border-color: transparent;
}
.mk-cal-day.is-today {
  border-color: var(--mk-accent-line);
  box-shadow: inset 0 0 0 1px var(--mk-accent-line);
}
.mk-cal-daynum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}
.mk-cal-today {
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mk-accent-ink);
  background: var(--mk-accent);
}
.mk-cal-entries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* one entry: number + kind, title, platforms + state (text) */
.mk-cal-entry {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  min-width: 0;
  padding: 4px 6px;
  border-radius: 7px;
  border: 1px solid var(--mk-border);
  background: var(--mk-glass-strong);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s var(--mk-ease), background-color 0.15s var(--mk-ease);
}
.mk-cal-entry:hover {
  border-color: var(--mk-border-strong);
  background: rgba(30, 41, 59, 0.9);
}
.mk-cal-entry.is-selected {
  outline: 2px solid var(--mk-accent);
  outline-offset: 1px;
}
.mk-cal-entry-top {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}
.mk-cal-num {
  flex: none;
  font-weight: 700;
  color: #fde68a;
  font-variant-numeric: tabular-nums;
}
.mk-cal-kind {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #cbd5e1;
  font-weight: 600;
}
.mk-cal-entry-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ffffff;
}
.mk-cal-entry-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 6px;
  min-width: 0;
}
.mk-cal-plats {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.mk-cal-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: #cbd5e1;
}

/* the state marker: a different shape per state group */
.mk-cal-mark {
  flex: none;
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}
/* planned: dashed outline, hollow square */
.mk-cal-entry.is-planned {
  border-style: dashed;
  border-color: var(--mk-accent-line);
  background: rgba(15, 23, 42, 0.35);
}
.mk-cal-st-planned .mk-cal-mark {
  border-radius: 1px;
  background: transparent;
}
.mk-cal-st-planned .mk-cal-state {
  color: #fde68a;
}
/* draft / in review: hollow circle */
.mk-cal-st-draft .mk-cal-mark {
  background: transparent;
}
/* awaiting the owner: amber, thick outline, filled circle with a ring */
.mk-cal-entry.mk-cal-st-owner {
  border-width: 2px;
  border-color: var(--mk-accent);
  background: rgba(245, 158, 11, 0.12);
}
.mk-cal-st-owner .mk-cal-state {
  color: #fde68a;
}
.mk-cal-st-owner .mk-cal-mark {
  background: currentColor;
  box-shadow: 0 0 0 2px rgba(var(--mk-accent-rgb), 0.35);
}
/* approved / scheduled: filled circle */
.mk-cal-entry.mk-cal-st-ready {
  border-color: rgba(34, 197, 94, 0.5);
}
.mk-cal-st-ready .mk-cal-state {
  color: #bbf7d0;
}
.mk-cal-st-ready .mk-cal-mark {
  background: currentColor;
}
/* publishing / published: filled square */
.mk-cal-entry.mk-cal-st-out {
  border-color: rgba(56, 189, 248, 0.5);
}
.mk-cal-st-out .mk-cal-state {
  color: #bae6fd;
}
.mk-cal-st-out .mk-cal-mark {
  border-radius: 1px;
  background: currentColor;
}
/* failed: filled diamond */
.mk-cal-entry.mk-cal-st-bad {
  border-color: rgba(239, 68, 68, 0.6);
}
.mk-cal-st-bad .mk-cal-state {
  color: #fecaca;
}
.mk-cal-st-bad .mk-cal-mark {
  border-radius: 1px;
  background: currentColor;
  transform: rotate(45deg);
}
/* rejected / expired: struck-through title, muted */
.mk-cal-entry.mk-cal-st-closed {
  opacity: 0.75;
}
.mk-cal-st-closed .mk-cal-entry-title {
  text-decoration: line-through;
  color: var(--muted);
}
.mk-cal-st-closed .mk-cal-mark {
  border-radius: 1px;
  width: 8px;
  height: 2px;
  border: 0;
  background: currentColor;
}

/* list layout (narrow screens) */
.mk-cal-list {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-direction: column;
  gap: 10px;
}
.mk-cal-list-day {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--mk-radius-s);
  border: 1px solid var(--mk-border-soft);
  background: rgba(15, 23, 42, 0.42);
}
.mk-cal-list-day.is-today {
  border-color: var(--mk-accent-line);
}
.mk-cal-list-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}
.mk-cal-list .mk-cal-entries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
}
.mk-cal-list .mk-cal-entry {
  font-size: 12px;
  padding: 6px 8px;
}
.mk-cal-list .mk-cal-entry-title {
  white-space: normal;
  overflow-wrap: anywhere;
}

.mk-cal-detail {
  gap: 12px;
}
.mk-cal-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.mk-cal-detail-head h3 {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}
.mk-cal-planned {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 640px;
}

/* ---------- Report ---------- */

.mk-rep-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  margin: 0;
}
.mk-rep-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--mk-radius-s);
  border: 1px solid var(--mk-border-soft);
  background: var(--mk-glass-strong);
  min-width: 0;
}
.mk-rep-tile dt {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}
.mk-rep-tile dd {
  margin: 0;
}
.mk-rep-value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}
.mk-rep-hint {
  font-size: 11px;
  color: var(--muted);
}
.mk-rep-tile.is-attn {
  border-color: var(--mk-accent-line);
  background: var(--mk-accent-soft);
}
.mk-rep-tile.is-attn .mk-rep-value {
  color: #fde68a;
}
.mk-rep-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 12px;
  align-items: start;
}
.mk-rep-notes {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .mk-plan-edit-grid {
    grid-template-columns: 150px 140px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .mk-cal-grid-wrap {
    display: none;
  }
  .mk-cal-list {
    display: flex;
  }
  .mk-plan-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .mk-plan-edit-grid {
    grid-template-columns: 1fr 1fr;
  }
  .mk-plan-edit-title {
    grid-column: 1 / -1;
  }
  .mk-rep-cols {
    grid-template-columns: 1fr;
  }
  .mk-cal-month {
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .mk-plan-edit-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .mk-plan-spinner {
    animation: none;
  }
  .mk-cal-entry {
    transition: none;
  }
}
/* Video studio, Leads tab and shared studio pieces (st-, ld-). Used inside the Marketing dashboard
   (mk- tokens) and the Owner app, so every token has a fallback. */

.st-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.st-panel {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--mk-radius-s, 12px);
  border: 1px solid var(--mk-border-soft, rgba(255, 255, 255, 0.1));
  background: var(--mk-inset, rgba(15, 23, 42, 0.55));
}

.st-panel-title {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--mk-accent-strong, #fbbf24);
}

.st-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.st-fig {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.st-fig figcaption {
  font-size: 11.5px;
  color: #94a3b8;
}

.st-video-v {
  width: 180px;
  aspect-ratio: 9 / 16;
  border-radius: 10px;
  background: #000;
}

.st-video-h {
  width: 320px;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #000;
}

.st-image-p {
  width: 200px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 10px;
}

.st-preview-compact .st-video-v {
  width: 140px;
}

.st-preview-compact .st-video-h {
  width: 240px;
}

.st-media-loading {
  display: inline-block;
  width: 180px;
  aspect-ratio: 9 / 16;
  border-radius: 10px;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.04) 8%, rgba(255, 255, 255, 0.1) 18%, rgba(255, 255, 255, 0.04) 33%);
  background-size: 200% 100%;
  animation: st-shimmer 1.4s linear infinite;
}

@keyframes st-shimmer {
  to {
    background-position-x: -200%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .st-media-loading {
    animation: none;
  }
}

.st-media-missing {
  font-size: 12px;
  color: #fca5a5;
}

.st-prod {
  border: 1px solid var(--mk-border-soft, rgba(255, 255, 255, 0.1));
  border-radius: var(--mk-radius-xs, 8px);
  padding: 10px;
  margin-bottom: 10px;
  background: rgba(15, 23, 42, 0.35);
}

.st-prod-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.st-state {
  font-size: 11.5px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.st-state-running {
  border-color: rgba(56, 189, 248, 0.6);
  color: #7dd3fc;
}

.st-state-done {
  border-color: rgba(34, 197, 94, 0.6);
  color: #86efac;
}

.st-state-failed {
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
}

.st-state-paused,
.st-state-queued {
  border-color: rgba(234, 179, 8, 0.6);
  color: #fde68a;
}

.st-cost {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: #cbd5e1;
  font-size: 12.5px;
}

.st-steps {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 8px 0;
}

.st-steps li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}

.st-step-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #475569;
}

.st-steps li.is-done {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.4);
}

.st-steps li.is-done .st-step-dot {
  background: #22c55e;
}

.st-steps li.is-running {
  color: #e0f2fe;
  border-color: rgba(56, 189, 248, 0.55);
}

.st-steps li.is-running .st-step-dot {
  background: #38bdf8;
  animation: st-pulse 1.2s ease-in-out infinite;
}

.st-steps li.is-waiting .st-step-dot {
  background: #eab308;
}

.st-steps li.is-failed {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.55);
}

.st-steps li.is-failed .st-step-dot {
  background: #ef4444;
}

@keyframes st-pulse {
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .st-steps li.is-running .st-step-dot {
    animation: none;
  }
}

.st-prod-meta {
  font-size: 12px;
  color: #94a3b8;
}

.st-error {
  color: #fca5a5;
  font-size: 12.5px;
  margin: 6px 0 0;
}

.st-warn {
  color: #fde68a;
  font-size: 12.5px;
  margin: 6px 0 0;
}

.st-notes {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: #cbd5e1;
}

.st-script {
  margin-top: 8px;
  font-size: 12.5px;
}

.st-script summary {
  cursor: pointer;
  color: #cbd5e1;
}

.st-script ol {
  padding-left: 18px;
}

.st-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.st-make-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.st-make-row .mk-field {
  min-width: 160px;
}

/* ---------- Studio tab ---------- */

.st-tab {
  display: grid;
  gap: 14px;
}

.st-quick {
  padding: 14px;
  border-radius: var(--mk-radius, 16px);
  border: 1px solid var(--mk-accent-line, rgba(245, 158, 11, 0.5));
  background: var(--mk-accent-soft, rgba(245, 158, 11, 0.14));
}

.st-quick h3 {
  margin: 0 0 6px;
}

.st-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.st-pill {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.5);
}

.st-pill-bad {
  border-color: rgba(239, 68, 68, 0.6);
  color: #fecaca;
}

.st-pill-ok {
  border-color: rgba(34, 197, 94, 0.5);
  color: #bbf7d0;
}

.st-prod-list {
  display: grid;
  gap: 12px;
}

.st-prod-card {
  padding: 12px;
  border-radius: var(--mk-radius-s, 12px);
  border: 1px solid var(--mk-border-soft, rgba(255, 255, 255, 0.1));
  background: var(--mk-glass, rgba(30, 41, 59, 0.55));
}

.st-prod-card h4 {
  margin: 0 0 6px;
}

/* ---------- Leads tab ---------- */

.ld-tab {
  display: grid;
  gap: 14px;
}

.ld-search {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.ld-search .mk-field {
  min-width: 170px;
}

.ld-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ld-count {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.5);
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.ld-count[aria-pressed='true'] {
  border-color: var(--mk-accent-line, rgba(245, 158, 11, 0.5));
  background: var(--mk-accent-soft, rgba(245, 158, 11, 0.14));
}

.ld-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

@media (max-width: 980px) {
  .ld-layout {
    grid-template-columns: 1fr;
  }
}

.ld-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 70vh;
  overflow: auto;
}

.ld-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--mk-radius-xs, 8px);
  border: 1px solid var(--mk-border-soft, rgba(255, 255, 255, 0.1));
  background: var(--mk-glass, rgba(30, 41, 59, 0.55));
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
}

.ld-row[aria-current='true'] {
  border-color: var(--mk-accent-line, rgba(245, 158, 11, 0.5));
}

.ld-score {
  min-width: 34px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-radius: 8px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.06);
}

.ld-score-high {
  color: #86efac;
}

.ld-score-mid {
  color: #fde68a;
}

.ld-score-low {
  color: #94a3b8;
}

.ld-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ld-sub {
  font-size: 11.5px;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ld-detail {
  padding: 14px;
  border-radius: var(--mk-radius-s, 12px);
  border: 1px solid var(--mk-border-soft, rgba(255, 255, 255, 0.1));
  background: var(--mk-glass, rgba(30, 41, 59, 0.55));
  display: grid;
  gap: 10px;
}

.ld-detail h3 {
  margin: 0;
}

.ld-kv {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 4px 10px;
  font-size: 13px;
}

.ld-kv dt {
  color: #94a3b8;
}

.ld-kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.ld-draft {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
  white-space: pre-wrap;
  font-size: 13px;
}

.ld-lint {
  color: #fde68a;
  font-size: 12px;
  margin: 4px 0 0;
  padding-left: 18px;
}

.ld-broadcast {
  padding: 10px;
  border-radius: var(--mk-radius-xs, 8px);
  border: 1px solid var(--mk-border-soft, rgba(255, 255, 255, 0.1));
  background: rgba(15, 23, 42, 0.35);
}

.ld-check {
  display: inline-flex;
  align-items: center;
}

.ld-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--mk-accent, #f59e0b);
}

/* The video player with its fallback: the still, the reason, Open video / Re-encode / Try again. */
.st-player {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.st-player-msg {
  margin: 0;
  color: #fca5a5;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.st-player-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.st-player-actions a,
.st-player-actions button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(30, 41, 59, 0.6);
  color: inherit;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.st-player-actions button:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* "Reel from my photos": the chosen photos, each removable. */
.st-reel-photos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.st-reel-photo {
  position: relative;
  width: 72px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
}

.st-reel-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.st-reel-photo button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

/* A production waiting for the Flow bridge on the office PC. */
.st-state-waiting {
  border-color: rgba(56, 189, 248, 0.6);
  color: #bae6fd;
}
.st-review-assets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.st-review-assets figure {
  width: 8rem;
  margin: 0;
  overflow-wrap: anywhere;
}

.st-review-assets img {
  display: block;
  width: 100%;
  height: 6rem;
  object-fit: contain;
}
/* Manufacturing floor and dashboard (mf-), teal accent. */

.mf-scene,
.mf-dash {
  --mf-accent: #14b8a6;
  --mf-accent-strong: #2dd4bf;
  --mf-accent-soft: rgba(20, 184, 166, 0.14);
  --mf-line: rgba(20, 184, 166, 0.45);
  --mf-glass: rgba(30, 41, 59, 0.6);
  --mf-inset: rgba(15, 23, 42, 0.55);
  --mf-border: rgba(255, 255, 255, 0.14);
  color: var(--text, #e2e8f0);
}

.mf-scene {
  overflow: auto;
  padding: 16px 20px 24px;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(20, 184, 166, 0.12), transparent 55%),
    linear-gradient(180deg, #0b1220, #0f172a);
}

.mf-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.mf-heading {
  flex: 1;
  min-width: 260px;
}

.mf-heading h2 {
  margin: 0;
}

.mf-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #94a3b8;
}

.mf-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #475569;
}

.mf-safe {
  color: #5eead4;
}

.mf-warn {
  color: #fde68a;
}

.mf-bad {
  color: #fca5a5;
}

.mf-banner {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
  margin-bottom: 12px;
}

.mf-plant {
  margin-bottom: 16px;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-height: 46vh;
  background: #0b1f1d;
}

.mf-plant video,
.mf-plant img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mf-floor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.mf-desk {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--mf-border);
  background: var(--mf-glass);
  box-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 190px;
}

.mf-desk-thinking,
.mf-desk-working {
  border-color: var(--mf-line);
  box-shadow: 0 0 0 1px var(--mf-line), 0 24px 48px -28px rgba(0, 0, 0, 0.75);
}

.mf-desk-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mf-desk-top h3 {
  margin: 0;
  font-size: 15px;
}

.mf-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: var(--mf-accent-soft);
  border: 1px solid var(--mf-line);
  color: var(--mf-accent-strong);
}

.mf-area {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
}

.mf-led {
  margin-left: auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
}

.mf-led-thinking {
  background: #eab308;
}

.mf-led-working {
  background: #38bdf8;
}

.mf-role {
  margin: 0;
  font-size: 13px;
  color: #cbd5e1;
}

.mf-task {
  margin: 0;
  font-size: 12.5px;
  color: #94a3b8;
  flex: 1;
}

.mf-chat {
  align-self: flex-start;
  height: 32px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--mf-line);
  background: var(--mf-accent-soft);
  color: #ccfbf1;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.mf-chat:focus-visible,
.mf-btn:focus-visible,
.mf-tab-btn:focus-visible,
.mf-linklike:focus-visible {
  outline: 2px solid var(--mf-accent-strong);
  outline-offset: 2px;
}

.mf-foot {
  margin-top: 16px;
  font-size: 12.5px;
  color: #94a3b8;
}

/* ---------- dashboard ---------- */

.mf-dash {
  height: 100%;
  overflow: auto;
  padding: 16px 20px 28px;
  background: linear-gradient(180deg, #0b1220, #0f172a);
}

.mf-dash-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.mf-dash-head h2 {
  margin: 0;
}

.mf-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.mf-stats span {
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid var(--mf-border);
  background: var(--mf-glass);
  font-size: 13px;
}

.mf-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.mf-tab-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--mf-border);
  background: var(--mf-inset);
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.mf-tab-btn.is-active {
  border-color: var(--mf-line);
  background: var(--mf-accent-soft);
  color: #ccfbf1;
}

.mf-tab {
  display: grid;
  gap: 14px;
}

.mf-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  align-items: start;
}

.mf-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--mf-border);
  background: var(--mf-glass);
  display: grid;
  gap: 10px;
}

.mf-card h3 {
  margin: 0;
  font-size: 15px;
}

.mf-hint {
  margin: 0;
  font-size: 12.5px;
  color: #94a3b8;
}

.mf-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.mf-field {
  display: grid;
  gap: 4px;
  flex: 1 1 180px;
  font-size: 12.5px;
  color: #cbd5e1;
}

.mf-field-s {
  flex: 0 1 130px;
}

.mf-field input,
.mf-field select,
.mf-field textarea {
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--mf-border);
  background: var(--mf-inset);
  color: inherit;
  font: inherit;
  font-size: 13px;
}

.mf-field textarea {
  height: auto;
  padding: 8px 10px;
}

.mf-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.mf-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--mf-accent);
}

.mf-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--mf-border);
  background: rgba(30, 41, 59, 0.8);
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.mf-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mf-btn-primary {
  border-color: var(--mf-line);
  background: var(--mf-accent);
  color: #042f2e;
}

.mf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mf-error {
  margin: 0;
  color: #fca5a5;
  font-size: 12.5px;
}

.mf-warn-text {
  color: #fde68a;
  font-size: 12px;
}

.mf-empty {
  color: #64748b;
  font-size: 12.5px;
}

.mf-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  gap: 10px;
  overflow-x: auto;
}

@media (max-width: 1100px) {
  .mf-board {
    grid-template-columns: repeat(2, minmax(200px, 1fr));
  }
}

@media (max-width: 640px) {
  .mf-board {
    grid-template-columns: 1fr;
  }
}

.mf-col h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #cbd5e1;
}

.mf-count {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.mf-batch {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--mf-border);
  background: var(--mf-inset);
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.mf-batch-on_hold {
  border-color: rgba(234, 179, 8, 0.5);
}

.mf-batch-rejected {
  opacity: 0.7;
}

.mf-batch-released {
  border-color: rgba(34, 197, 94, 0.45);
}

.mf-batch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.mf-batch-title {
  font-weight: 600;
}

.mf-bno {
  font-weight: 500;
  color: #94a3b8;
  font-size: 12px;
}

.mf-chip {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--mf-border);
}

.mf-qc-passed {
  border-color: rgba(34, 197, 94, 0.5);
  color: #86efac;
}

.mf-qc-failed {
  border-color: rgba(239, 68, 68, 0.55);
  color: #fca5a5;
}

.mf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.mf-table caption {
  text-align: left;
  color: #cbd5e1;
  padding-bottom: 6px;
}

.mf-table th,
.mf-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.mf-table th {
  color: #94a3b8;
  font-weight: 600;
}

.mf-short td {
  color: #fecaca;
}

.mf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.mf-dev {
  padding: 6px 8px;
  border-radius: 8px;
  border-left: 3px solid #64748b;
  background: var(--mf-inset);
}

.mf-dev-major {
  border-left-color: #eab308;
}

.mf-dev-critical {
  border-left-color: #ef4444;
}

.mf-dev.is-closed {
  opacity: 0.65;
}

.mf-dev-body {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.mf-linklike {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.25);
}

.mf-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.owner-task-backdrop { position: fixed; inset: 0; z-index: 200; background: #020617c9; padding: 24px; display: flex; justify-content: center; align-items: center; }
.owner-task-window { width: min(1050px, 100%); max-height: calc(100dvh - 48px); overflow-y: auto; background: #142136; color: #e2e8f0; border: 1px solid #52657f; border-radius: 16px; padding: 22px; box-shadow: 0 20px 80px #0008; }
.owner-task-window header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.owner-task-window h2 { margin: 0; }
.owner-task-window button { background: #22354f; color: #f1f5f9; border: 1px solid #6c839e; border-radius: 8px; padding: 9px 12px; cursor: pointer; }
.owner-task-window button:disabled { opacity: .5; cursor: default; }
.owner-task-window button:focus-visible { outline: 3px solid #38bdf8; outline-offset: 3px; }
.owner-task-window code { font-size: 12px; overflow-wrap: anywhere; }
.owner-task-notice { background: #0b3b50; border: 1px solid #38bdf857; border-radius: 9px; padding: 12px; line-height: 1.55; }
.owner-task-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.owner-task-row { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 7px; margin: 9px 0; overflow-wrap: anywhere; }
.owner-task-verbatim { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.owner-task-detail h4 { margin-bottom: 8px; }
.owner-task-source { background: #1e2d42; padding: 10px; border-radius: 7px; overflow-wrap: anywhere; line-height: 1.5; }
.owner-task-source small { display: block; margin-top: 5px; color: #b4c4d9; }
.owner-task-events { padding-left: 25px; }
.owner-task-events li { padding: 14px 0; border-bottom: 1px solid #4b5e78; }
.owner-task-events li > small { display: block; margin-top: 6px; }
.owner-task-window details { margin-top: 12px; }
.owner-task-error { color: #fecaca; background: #450a0a; border-radius: 8px; padding: 12px; }
@media (max-width: 600px) { .owner-task-backdrop { padding: 8px; } .owner-task-window { padding: 14px; max-height: calc(100dvh - 16px); } .owner-task-window header { align-items: flex-start; } }
/* Connections dashboard (SettingsApp) — every class is prefixed `cx-`.
   Reuses the design tokens from styles.css (--bg, --panel, --border, --text, --muted, --accent,
   --status-*). Premium dark glass: translucent panels, 1px borders at 20-30% white, soft shadows,
   12-16px radii, an 8px spacing grid, one accent, restrained motion. */

/* The Settings page is longer than a screen and scrolls the page itself. The office's stylesheet
   stops the page from scrolling (styles.css, `body { overflow: hidden }`, right for its fixed layout);
   under that rule the lower part of Settings could not be reached at all (found 2026-11-11). main.tsx
   marks this window with `cx-html`. */
html.cx-html body {
  overflow: visible;
}

.cx-root {
  --cx-glass: rgba(30, 41, 59, 0.55);
  --cx-glass-strong: rgba(30, 41, 59, 0.78);
  --cx-inset: rgba(15, 23, 42, 0.55);
  --cx-border: rgba(255, 255, 255, 0.2);
  --cx-border-strong: rgba(255, 255, 255, 0.3);
  --cx-border-soft: rgba(255, 255, 255, 0.1);
  --cx-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.75), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  --cx-accent-soft: rgba(56, 189, 248, 0.14);
  --cx-accent-line: rgba(56, 189, 248, 0.45);
  --cx-radius: 16px;
  --cx-radius-s: 12px;
  --cx-radius-xs: 8px;
  --cx-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  min-height: 100%;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(56, 189, 248, 0.12), transparent 60%),
    radial-gradient(900px 480px at -10% 100%, rgba(99, 102, 241, 0.1), transparent 60%),
    var(--bg);
}

.cx-root *,
.cx-root *::before,
.cx-root *::after {
  box-sizing: border-box;
}

.cx-root :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--cx-radius-xs);
}

.cx-root h1,
.cx-root h2,
.cx-root h3,
.cx-root p {
  margin: 0;
}

.cx-root code,
.cx-code {
  font-family: Consolas, 'Cascadia Mono', 'Segoe UI Mono', ui-monospace, monospace;
  font-size: 12px;
}

.cx-code {
  background: var(--cx-inset);
  border: 1px solid var(--cx-border-soft);
  border-radius: 6px;
  padding: 1px 6px;
}

.cx-num {
  font-variant-numeric: tabular-nums;
}

.cx-dim {
  color: var(--muted);
}

.cx-nowrap {
  white-space: nowrap;
}

.cx-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.cx-error-text {
  color: #fca5a5;
  overflow-wrap: anywhere;
}

/* ---------- header ---------- */

.cx-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--cx-border-soft);
}

.cx-brand h1 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.cx-brand p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.cx-header-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* ---------- pills, badges, LEDs ---------- */

.cx-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--cx-border);
  background: var(--cx-glass);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.cx-pill strong {
  font-weight: 700;
}

.cx-pill-btn {
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  transition: border-color 0.15s var(--cx-ease), background-color 0.15s var(--cx-ease);
}

.cx-pill-btn:hover {
  border-color: var(--cx-border-strong);
  background: var(--cx-glass-strong);
}

.cx-pill-ok {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.1);
}

.cx-pill-warn {
  color: #fde68a;
  border-color: rgba(234, 179, 8, 0.5);
  background: rgba(234, 179, 8, 0.1);
}

.cx-pill-bad {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.1);
}

.cx-pill-unknown {
  color: var(--muted);
}

.cx-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--cx-border);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.cx-badge-busy {
  color: var(--accent);
  border-color: var(--cx-accent-line);
  background: var(--cx-accent-soft);
}

.cx-led {
  --led: var(--status-offline);
  --led-glow: rgba(100, 116, 139, 0.35);
  flex: none;
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--led);
  box-shadow:
    0 0 0 3px var(--led-glow),
    0 0 12px var(--led-glow);
}

.cx-led-s {
  width: 8px;
  height: 8px;
  box-shadow:
    0 0 0 2px var(--led-glow),
    0 0 8px var(--led-glow);
}

.cx-led-l {
  width: 12px;
  height: 12px;
}

.cx-led-ok {
  --led: var(--status-available);
  --led-glow: rgba(34, 197, 94, 0.35);
}

.cx-led-busy {
  --led: var(--status-working);
  --led-glow: rgba(56, 189, 248, 0.35);
}

.cx-led-warn {
  --led: var(--status-reviewing);
  --led-glow: rgba(234, 179, 8, 0.35);
}

.cx-led-bad {
  --led: var(--status-attention);
  --led-glow: rgba(239, 68, 68, 0.38);
}

.cx-led-off {
  --led: var(--status-offline);
  --led-glow: rgba(100, 116, 139, 0.3);
}

.cx-led-unknown {
  --led: #475569;
  --led-glow: rgba(71, 85, 105, 0.3);
}

.cx-led-warn,
.cx-led-bad {
  animation: cx-led-breathe 2.4s ease-in-out infinite;
}

@keyframes cx-led-breathe {
  0%,
  100% {
    box-shadow:
      0 0 0 3px var(--led-glow),
      0 0 10px var(--led-glow);
  }
  50% {
    box-shadow:
      0 0 0 5px var(--led-glow),
      0 0 18px var(--led-glow);
  }
}

.cx-yesno {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ---------- buttons ---------- */

.cx-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--cx-border);
  background: var(--cx-glass);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.15s var(--cx-ease),
    border-color 0.15s var(--cx-ease),
    transform 0.15s var(--cx-ease);
}

.cx-btn:hover:not(:disabled) {
  border-color: var(--cx-border-strong);
  background: var(--cx-glass-strong);
}

.cx-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.cx-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cx-btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: #0f172a;
  box-shadow: 0 8px 20px -12px rgba(56, 189, 248, 0.9);
}

.cx-btn-primary:hover:not(:disabled) {
  background: #5cc8f8;
  border-color: transparent;
}

.cx-btn-quiet {
  height: 28px;
  padding: 0 10px;
  background: transparent;
  border-color: var(--cx-border-soft);
  color: var(--muted);
  font-weight: 500;
}

.cx-btn-quiet:hover:not(:disabled) {
  color: var(--text);
}

.cx-btn-compact {
  height: 24px;
  padding: 0 8px;
  font-size: 11.5px;
}

.cx-btn[aria-pressed='true'] {
  border-color: var(--cx-accent-line);
  background: var(--cx-accent-soft);
  color: var(--accent);
}

.cx-refreshing .cx-icon {
  animation: cx-spin 0.9s linear infinite;
}

@keyframes cx-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- overview strip ---------- */

.cx-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 16px 24px 0;
}

.cx-tile {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px 14px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid var(--cx-border);
  background: var(--cx-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--cx-shadow);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition:
    border-color 0.15s var(--cx-ease),
    transform 0.18s var(--cx-ease),
    background-color 0.15s var(--cx-ease);
}

.cx-tile:hover {
  border-color: var(--cx-border-strong);
  transform: translateY(-1px);
}

.cx-tile[aria-pressed='true'] {
  border-color: var(--cx-accent-line);
  background: linear-gradient(180deg, var(--cx-accent-soft), var(--cx-glass));
}

.cx-tile-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.cx-tile-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cx-tile-state {
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cx-tile-sub {
  color: var(--muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cx-tile-dirty {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
}

/* ---------- body: rail + main ---------- */

.cx-body {
  flex: 1;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 24px 32px;
  align-items: start;
}

.cx-rail {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: var(--cx-radius);
  border: 1px solid var(--cx-border);
  background: var(--cx-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--cx-shadow);
}

.cx-rail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--cx-radius-s);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.15s var(--cx-ease),
    border-color 0.15s var(--cx-ease);
}

.cx-rail-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.cx-rail-item[aria-current='page'] {
  background: var(--cx-accent-soft);
  border-color: var(--cx-accent-line);
}

.cx-rail-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.cx-rail-name {
  font-size: 13px;
  font-weight: 600;
}

.cx-rail-tag {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cx-rail-dirty {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
}

.cx-main {
  min-width: 0;
}

/* ---------- window ---------- */

.cx-window {
  border-radius: var(--cx-radius);
  border: 1px solid var(--cx-border);
  background: var(--cx-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--cx-shadow);
  overflow: hidden;
  animation: cx-rise 0.22s var(--cx-ease);
}

@keyframes cx-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.cx-window-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--cx-border-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
}

.cx-window-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--cx-border);
  background: var(--cx-inset);
  color: var(--accent);
}

.cx-window-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cx-window-title h2 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.cx-window-tagline {
  color: var(--muted);
  font-size: 12px;
}

.cx-window-state {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 30px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--cx-border-soft);
  background: var(--cx-inset);
  font-size: 12.5px;
  font-weight: 600;
}

.cx-window-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.cx-save {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.cx-save-msg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.cx-save-ok {
  color: #86efac;
}

.cx-save-error {
  color: #fca5a5;
  max-width: 320px;
  overflow-wrap: anywhere;
}

.cx-window-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.cx-window-cols-single {
  grid-template-columns: minmax(0, 1fr);
}

.cx-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.cx-col-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.cx-window-wide {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- sections, key/value rows ---------- */

.cx-section {
  padding: 12px 14px 14px;
  border-radius: var(--cx-radius-s);
  border: 1px solid var(--cx-border-soft);
  background: rgba(15, 23, 42, 0.35);
}

.cx-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.cx-section-title {
  font-size: 13px;
  font-weight: 650;
}

.cx-kv {
  display: grid;
  grid-template-columns: minmax(112px, 38%) minmax(0, 1fr);
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--cx-border-soft);
}

.cx-kv:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.cx-kv-k {
  color: var(--muted);
  font-size: 12px;
  padding-top: 1px;
}

.cx-kv-v {
  min-width: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.cx-kv-hint {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
}

.cx-empty {
  padding: 16px 12px;
  border-radius: var(--cx-radius-xs);
  border: 1px dashed var(--cx-border);
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.cx-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--cx-radius-xs);
  border: 1px solid var(--cx-border-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
}

.cx-note .cx-icon {
  flex: none;
  margin-top: 2px;
}

.cx-note-warn {
  color: #fde68a;
  border-color: rgba(234, 179, 8, 0.4);
  background: rgba(234, 179, 8, 0.08);
}

.cx-note-bad {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

.cx-note-info {
  color: var(--text);
}

/* ---------- forms ---------- */

.cx-field {
  display: grid;
  gap: 6px;
}

.cx-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cx-field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.cx-field-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.cx-field-tag-ok {
  color: #86efac;
}

.cx-input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--cx-border);
  background: var(--cx-inset);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition:
    border-color 0.15s var(--cx-ease),
    box-shadow 0.15s var(--cx-ease);
}

.cx-input::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.cx-input:hover {
  border-color: var(--cx-border-strong);
}

.cx-input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.cx-input[type='password'] {
  letter-spacing: 0.12em;
}

.cx-input[type='number'] {
  font-variant-numeric: tabular-nums;
}

.cx-help {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.cx-help-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.cx-switch-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--cx-radius-s);
  border: 1px solid var(--cx-border-soft);
  background: rgba(15, 23, 42, 0.35);
}

.cx-switch {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  margin-top: 1px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--cx-border);
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background-color 0.18s var(--cx-ease), border-color 0.18s var(--cx-ease);
}

.cx-switch[aria-checked='true'] {
  background: var(--accent);
  border-color: transparent;
}

.cx-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s var(--cx-ease);
}

.cx-switch[aria-checked='true'] .cx-switch-knob {
  transform: translateX(18px);
}

.cx-switch-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cx-switch-label {
  font-size: 13px;
  font-weight: 600;
}

.cx-on {
  color: #86efac;
}

.cx-off {
  color: var(--muted);
}

.cx-prose {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
}

.cx-prose ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

/* ---------- webhook URL block, counters ---------- */

.cx-urlblock {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--cx-radius-xs);
  border: 1px solid var(--cx-border-soft);
  background: var(--cx-inset);
  display: grid;
  gap: 6px;
}

.cx-urlblock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.cx-urlblock-url {
  overflow-wrap: anywhere;
  color: var(--text);
}

.cx-counters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin: 4px 0 8px;
}

.cx-counter {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--cx-radius-xs);
  border: 1px solid var(--cx-border-soft);
  background: var(--cx-inset);
}

.cx-counter-n {
  font-size: 18px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.cx-counter-hot {
  color: #fde68a;
}

.cx-counter-l {
  color: var(--muted);
  font-size: 11px;
}

/* ---------- tables ---------- */

.cx-table-wrap {
  overflow-x: auto;
  border-radius: var(--cx-radius-xs);
  border: 1px solid var(--cx-border-soft);
}

.cx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.cx-table th {
  position: sticky;
  top: 0;
  padding: 8px 10px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.85);
  white-space: nowrap;
}

.cx-table td {
  padding: 8px 10px;
  border-top: 1px solid var(--cx-border-soft);
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}

.cx-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.cx-th-num,
.cx-td-num {
  text-align: right;
  white-space: nowrap;
}

.cx-cell-text {
  max-width: 280px;
  overflow-wrap: anywhere;
}

.cx-cell-kind {
  font-family: Consolas, 'Cascadia Mono', ui-monospace, monospace;
  font-size: 12px;
  white-space: nowrap;
}

/* Wide tables (eight-column reads, seven-column inbox) scroll sideways inside their wrapper
   below these widths instead of crushing text columns into one-character slivers. */
.cx-table {
  min-width: 680px;
}

.cx-table-reads {
  min-width: 760px;
}

.cx-cell-text {
  min-width: 150px;
}

.cx-cell-result {
  min-width: 220px;
  max-width: 340px;
}

.cx-yesno-top {
  align-items: flex-start;
}

.cx-yesno-top .cx-led {
  margin-top: 5px;
}

.cx-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cx-row-error td {
  background: rgba(239, 68, 68, 0.05);
}

.cx-status {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--cx-border-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.cx-status-replied,
.cx-status-processed {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.4);
}

.cx-status-claimed,
.cx-status-processing {
  color: var(--accent);
  border-color: var(--cx-accent-line);
}

.cx-status-delivery_uncertain {
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.45);
}

.cx-status-reply_failed,
.cx-status-failed {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

/* ---------- recent reads: bars, ladder ---------- */

.cx-reads {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.cx-reads-meta {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 16px;
  align-items: start;
}

.cx-reads-skel {
  display: grid;
  gap: 12px;
}

.cx-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 64px;
  padding: 6px 8px;
  margin-top: 8px;
  border-radius: var(--cx-radius-xs);
  border: 1px solid var(--cx-border-soft);
  background: var(--cx-inset);
}

.cx-bar {
  flex: 1 1 0;
  min-width: 3px;
  max-width: 14px;
  border-radius: 3px 3px 1px 1px;
  background: var(--accent);
  opacity: 0.9;
  transition: height 0.25s var(--cx-ease);
}

.cx-bar:hover {
  opacity: 1;
  filter: brightness(1.15);
}

.cx-bar-error {
  background: var(--status-attention);
}

.cx-bars-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 11.5px;
}

.cx-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: -1px;
}

.cx-swatch-ok {
  background: var(--accent);
}

.cx-swatch-error {
  background: var(--status-attention);
}

.cx-ladder {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.cx-ladder-row {
  display: grid;
  grid-template-columns: minmax(96px, 36%) minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.cx-ladder-muted {
  opacity: 0.55;
}

.cx-ladder-label {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cx-ladder-track {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: var(--cx-inset);
  border: 1px solid var(--cx-border-soft);
  overflow: hidden;
}

.cx-ladder-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.3s var(--cx-ease);
}

.cx-ladder-ms {
  text-align: right;
  color: var(--muted);
}

/* ---------- invoice preview (Company) ---------- */

.cx-invoice-card {
  margin: 4px 0 10px;
  padding: 12px 14px;
  border-radius: var(--cx-radius-xs);
  border: 1px solid var(--cx-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  display: grid;
  gap: 2px;
}

.cx-invoice-name {
  font-size: 15px;
  font-weight: 650;
}

.cx-invoice-line {
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- skeletons ---------- */

.cx-skel {
  display: inline-block;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 25%, rgba(255, 255, 255, 0.14) 50%, rgba(255, 255, 255, 0.06) 75%);
  background-size: 200% 100%;
  animation: cx-shimmer 1.4s linear infinite;
}

.cx-skel-rows {
  display: grid;
}

@keyframes cx-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .cx-window-cols {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .cx-reads-meta {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .cx-header {
    padding: 12px 16px;
    align-items: flex-start;
  }

  .cx-overview {
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    padding: 12px 16px 0;
  }

  .cx-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 12px 16px 24px;
  }

  .cx-rail {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding: 6px;
    gap: 4px;
    scrollbar-width: thin;
  }

  .cx-rail-item {
    flex: 1 0 auto;
    width: auto;
    padding: 8px 12px;
  }

  .cx-rail-tag {
    display: none;
  }

  .cx-window-bar {
    padding: 12px;
  }

  .cx-window-cols {
    padding: 12px;
    gap: 12px;
  }

  .cx-window-wide {
    padding: 0 12px 12px;
  }
}

@media (max-width: 560px) {
  .cx-brand p {
    display: none;
  }

  .cx-kv {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .cx-window-state {
    order: 3;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .cx-root *,
  .cx-root *::before,
  .cx-root *::after {
    animation: none !important;
    transition: none !important;
  }

  .cx-skel {
    background: rgba(255, 255, 255, 0.08);
  }

  .cx-tile:hover {
    transform: none;
  }
}
/* Marketing group of the Connections dashboard — every class is prefixed `mk-`.
   Builds on settings.css (`cx-`) and the tokens in styles.css (:root). Where an existing `cx-`
   rule has to change shape for the group (six overview tiles, rail groups) the override uses two
   classes and wins by specificity, never by source order. */

/* ---------- overview: six tiles once the Marketing tile joins ---------- */

.cx-overview.mk-overview {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

/* ---------- rail groups ---------- */

.mk-rail-group {
  padding: 10px 12px 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.mk-rail-group + .cx-rail-item {
  margin-top: 0;
}

/* ---------- gate banner ---------- */

.mk-gate {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--cx-radius-s, 12px);
  border: 1px solid rgba(234, 179, 8, 0.45);
  background: linear-gradient(180deg, rgba(234, 179, 8, 0.12), rgba(234, 179, 8, 0.05));
}

.mk-gate-title {
  font-size: 13px;
  font-weight: 700;
  color: #fde68a;
}

.mk-gate-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
}

/* ---------- chips (scopes, gates, platforms) ---------- */

.mk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mk-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 2px 9px 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--cx-border-soft, rgba(255, 255, 255, 0.1));
  background: var(--cx-inset, rgba(15, 23, 42, 0.55));
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
}

.mk-chip code {
  font-size: 11.5px;
}

.mk-chip-ok {
  border-color: rgba(34, 197, 94, 0.4);
  color: #bbf7d0;
}

.mk-chip-warn {
  border-color: rgba(234, 179, 8, 0.5);
  color: #fde68a;
}

.mk-chip-off {
  color: var(--muted);
}

/* ---------- usage meter (engine budget) ---------- */

.mk-meter {
  display: grid;
  gap: 6px;
  margin: 6px 0 4px;
}

.mk-meter-track {
  display: block;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--cx-border-soft, rgba(255, 255, 255, 0.1));
  background: var(--cx-inset, rgba(15, 23, 42, 0.55));
  overflow: hidden;
}

.mk-meter-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.3s var(--cx-ease, ease);
}

.mk-meter-full .mk-meter-fill {
  background: var(--status-reviewing);
}

.mk-meter-legend {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11.5px;
}

/* ---------- queue counters, people, commands ---------- */

.mk-counters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
  margin: 4px 0 4px;
}

.mk-counter {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--cx-radius-xs, 8px);
  border: 1px solid var(--cx-border-soft, rgba(255, 255, 255, 0.1));
  background: var(--cx-inset, rgba(15, 23, 42, 0.55));
}

.mk-counter-n {
  font-size: 18px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.mk-counter-hot {
  color: #fde68a;
}

.mk-counter-bad {
  color: #fca5a5;
}

.mk-counter-l {
  color: var(--muted);
  font-size: 11px;
}

.mk-people {
  display: grid;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.mk-person {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 2px 10px;
  font-size: 12.5px;
}

.mk-person-name {
  font-weight: 650;
  white-space: nowrap;
}

.mk-person-role {
  color: var(--muted);
}

.mk-commands {
  display: grid;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.mk-command {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mk-command code {
  overflow-wrap: anywhere;
}

/* ---------- switches laid out as a grid ---------- */

.mk-switches {
  display: grid;
  gap: 8px;
}

/* ---------- sign-in panel (gate M2: YouTube and X) ---------- */

.mk-signin {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.mk-signin .cx-urlblock {
  margin-top: 0;
}

.mk-signin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* The sign-in button stays focusable while it cannot be used (aria-disabled, not disabled), so a
   keyboard or screen-reader user reaches it and hears the reason it points to. Two classes plus
   the attribute beat the plain `cx-btn` hover/active rules by specificity. */
.mk-signin .cx-btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
}

.mk-signin .cx-btn-primary[aria-disabled='true']:hover {
  background: var(--accent);
}

.mk-signin .cx-btn[aria-disabled='true']:active {
  transform: none;
}

.mk-warn-text {
  color: #fde68a;
}

.mk-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mk-link:hover {
  color: #7dd3fc;
}

/* ---------- "Advanced" disclosure (paste a refresh token) ---------- */

.mk-advanced {
  border-radius: var(--cx-radius-xs, 8px);
  border: 1px solid var(--cx-border-soft, rgba(255, 255, 255, 0.1));
  background: var(--cx-inset, rgba(15, 23, 42, 0.55));
}

.mk-advanced-summary {
  padding: 9px 12px;
  border-radius: var(--cx-radius-xs, 8px);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.mk-advanced-summary:hover,
.mk-advanced[open] > .mk-advanced-summary {
  color: var(--text);
}

.mk-advanced[open] > .mk-advanced-summary {
  border-bottom: 1px dashed var(--cx-border-soft, rgba(255, 255, 255, 0.1));
  border-radius: var(--cx-radius-xs, 8px) var(--cx-radius-xs, 8px) 0 0;
}

.mk-advanced-body {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
}

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .cx-overview.mk-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .cx-overview.mk-overview {
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  }

  .mk-rail-group {
    display: none;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .mk-meter-fill {
    transition: none;
  }
}
/* Settings windows added on 2026-10-24: Google Calendar, Lead finder, Video studio, and the new
   Creative engines layout. Built on the cx- tokens of settings.css and the mk- pieces of
   marketing.css (meter, link). */

.mk-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}

.mk-linklike {
  background: none;
  border: none;
  padding: 0;
  color: #7dd3fc;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.mk-linklike:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
  border-radius: 4px;
}

.mk-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 640px) {
  .mk-two {
    grid-template-columns: 1fr;
  }
}

.mk-subform {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--cx-border-soft);
}

.mk-segments {
  border: 1px solid var(--cx-border-soft);
  border-radius: var(--cx-radius-xs);
  padding: 8px 10px 10px;
  margin: 8px 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.mk-segments legend {
  padding: 0 4px;
}

.mk-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.mk-check input {
  accent-color: #38bdf8;
  width: 16px;
  height: 16px;
}

.mk-template-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.mk-template-list li {
  border: 1px solid var(--cx-border-soft);
  border-radius: var(--cx-radius-xs);
  padding: 8px 10px;
  background: var(--cx-inset);
}

.mk-template-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mk-template-body {
  margin: 6px 0 8px;
  font-size: 12.5px;
  color: var(--text-secondary, #cbd5e1);
  white-space: pre-wrap;
}

.mk-chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--cx-border);
  font-size: 11px;
  text-transform: lowercase;
}

.mk-chip-ok {
  border-color: rgba(34, 197, 94, 0.5);
  color: #86efac;
}

.mk-chip-warn {
  border-color: rgba(234, 179, 8, 0.55);
  color: #fde68a;
}

.mk-chip-bad {
  border-color: rgba(239, 68, 68, 0.55);
  color: #fca5a5;
}

.mk-testsend {
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed var(--cx-accent-line);
  border-radius: var(--cx-radius-xs);
}

.mk-brandfile + .mk-brandfile {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--cx-border-soft);
}

.mk-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.mk-cmd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.mk-cmd code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 12px;
  background: var(--cx-inset);
  border: 1px solid var(--cx-border-soft);
  border-radius: 6px;
  padding: 4px 8px;
  user-select: all;
}

.mk-product-list {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* Marketing policy window, notification parts (gate M3) — every class is prefixed `mkn-`.
   Builds on settings.css (`cx-`) and marketing.css (`mk-`); colours come from the tokens in
   styles.css (:root) and repeat the green/amber/red used by the `cx-status` pills. */

/* ---------- "How to turn on phone notifications" ---------- */

.mkn-steps li {
  overflow-wrap: anywhere;
}

.mkn-steps li::marker {
  color: var(--text);
  font-weight: 650;
}

.mkn-steps code {
  color: var(--text);
}

.mkn-command {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 4px;
}

.mkn-url {
  overflow-wrap: anywhere;
}

/* ---------- recent notifications: Refresh ---------- */

/* While a refresh the owner pressed runs, the button stays focusable (aria-disabled, not disabled)
   and only looks busy. The background poll never changes it. */
.cx-btn.mkn-refresh[aria-disabled='true'] {
  opacity: 0.6;
  cursor: progress;
}

.cx-btn.mkn-refresh[aria-disabled='true']:active {
  transform: none;
}

/* ---------- recent notifications: result pills ---------- */

.mkn-result {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--cx-border-soft, rgba(255, 255, 255, 0.1));
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.mkn-result-sent {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.4);
}

.mkn-result-skipped {
  color: #fde68a;
  border-color: rgba(234, 179, 8, 0.45);
}

.mkn-result-failed {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}
/* "Connect your accounts" guide (SetupGuideWindow.tsx) and the Settings rail sections.
   Namespaced `sg-`; builds on the `cx-` blocks of settings.css and the `mk-` ones of marketing.css. */

.sg-intro {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.sg-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.sg-step {
  border-radius: var(--cx-radius-s, 12px);
  border: 1px solid var(--cx-border-soft, rgba(255, 255, 255, 0.1));
  background: rgba(15, 23, 42, 0.35);
}

.sg-step.is-next {
  border-color: var(--cx-accent-line, rgba(56, 189, 248, 0.45));
}

.sg-step-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 8px 10px;
}

.sg-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--cx-border, rgba(255, 255, 255, 0.2));
  background: var(--cx-inset, rgba(15, 23, 42, 0.55));
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sg-step.is-done .sg-num {
  border-color: rgba(34, 197, 94, 0.55);
  color: #86efac;
}

.sg-step.is-next .sg-num {
  border-color: var(--cx-accent-line, rgba(56, 189, 248, 0.45));
  color: var(--accent);
}

.sg-step-text {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sg-step-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 13.5px;
  font-weight: 650;
}

.sg-next {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--cx-accent-soft, rgba(56, 189, 248, 0.14));
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sg-step-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 12px;
}

.sg-step-what {
  color: var(--muted);
  font-size: 12px;
}

.sg-tick {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
}

.sg-tick-ok {
  color: #86efac;
}

.sg-tick-warn {
  color: #fde68a;
}

.sg-tick-bad {
  color: #fca5a5;
}

.sg-tick-off,
.sg-tick-unknown {
  color: var(--muted);
}

.sg-step-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.sg-minis {
  list-style: none;
  margin: 0;
  padding: 0 10px 8px 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.sg-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.sg-mini-name {
  font-weight: 600;
}

.sg-mini-state {
  color: var(--muted);
}

.sg-how {
  padding: 4px 14px 12px 48px;
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--cx-border-soft, rgba(255, 255, 255, 0.1));
}

.sg-how[hidden] {
  display: none;
}

.sg-list {
  margin: 6px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 7px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}

.sg-sublist {
  margin: 4px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.sg-list .cx-urlblock {
  margin: 6px 0;
}

.sg-ui {
  font-weight: 650;
  color: var(--text);
}

.sg-scopes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0;
}

.sg-subhead {
  margin: 6px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}

.sg-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}

.sg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- Settings rail: "Connect your accounts" / "Office" / "Marketing rules" ---------- */

.mk-rail-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mk-rail-section + .mk-rail-section {
  margin-top: 4px;
}

.mk-rail-heading {
  padding: 10px 12px 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.mk-rail-section-accounts .mk-rail-heading {
  color: var(--accent);
}

@media (max-width: 900px) {
  /* The rail becomes one scrolling row: the sections dissolve into it. */
  .mk-rail-section {
    display: contents;
  }

  .mk-rail-heading {
    display: none;
  }

  .sg-minis,
  .sg-how {
    padding-left: 14px;
  }
}

@media (max-width: 560px) {
  .sg-step-buttons {
    margin-left: 0;
  }
}
/* Owner app (OwnerApp and owner/*) — every class is prefixed `ow-`.
   Phone-first dark glass on the tokens from styles.css (:root). One column, max 480px, big
   tap targets (48px; 44px for the quiet/inline variants), safe-area padding, restrained motion.
   A fixed tab bar at the bottom (thumb reach) above the phone's gesture area.
   Built for 375px wide phones: nothing below may force a horizontal scroll at that width. */

.ow-root {
  --ow-glass: rgba(30, 41, 59, 0.6);
  --ow-glass-strong: rgba(30, 41, 59, 0.82);
  --ow-inset: rgba(15, 23, 42, 0.6);
  --ow-border: rgba(255, 255, 255, 0.18);
  --ow-border-soft: rgba(255, 255, 255, 0.1);
  --ow-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  --ow-radius: 16px;
  --ow-radius-s: 12px;
  --ow-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ow-tabbar-h: 64px;

  box-sizing: border-box;
  width: 100%;
  max-width: 480px;
  min-height: 100%;
  margin: 0 auto;
  /* The bottom padding clears the fixed tab bar (64px) and the phone's gesture area. */
  padding: calc(12px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) calc(var(--ow-tabbar-h) + 24px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  background:
    radial-gradient(640px 360px at 90% -10%, rgba(56, 189, 248, 0.14), transparent 60%),
    radial-gradient(520px 320px at -10% 100%, rgba(99, 102, 241, 0.12), transparent 60%),
    var(--bg);
}

.ow-root *,
.ow-root *::before,
.ow-root *::after {
  box-sizing: border-box;
}

.ow-root :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ow-root h1,
.ow-root h2,
.ow-root h3,
.ow-root h4,
.ow-root p {
  margin: 0;
}

.ow-dim {
  color: var(--muted);
}

.ow-small {
  font-size: 13px;
}

/* Paragraphs of owner text in small type (plan focus, the Lead's review notes): a long link or
   hashtag wraps instead of forcing a horizontal scroll at 375px. */
p.ow-small {
  overflow-wrap: anywhere;
}

/* ---------- header ---------- */

.ow-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: calc(-12px - env(safe-area-inset-top, 0px)) -16px 0;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ow-border-soft);
}

.ow-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ow-brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--ow-border);
  background: var(--ow-inset);
  color: var(--accent);
}

.ow-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ow-brand-text h1 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ow-brand-text span {
  color: var(--muted);
  font-size: 12px;
}

.ow-live {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 55%;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--ow-border);
  background: var(--ow-glass);
  font-size: 12px;
  font-weight: 600;
}

.ow-live-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ow-led {
  --led: #475569;
  --led-glow: rgba(71, 85, 105, 0.3);
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--led);
  box-shadow:
    0 0 0 3px var(--led-glow),
    0 0 10px var(--led-glow);
}

.ow-led-ok {
  --led: var(--status-available);
  --led-glow: rgba(34, 197, 94, 0.35);
}

.ow-led-bad {
  --led: var(--status-attention);
  --led-glow: rgba(239, 68, 68, 0.38);
  animation: ow-breathe 2.4s ease-in-out infinite;
}

@keyframes ow-breathe {
  0%,
  100% {
    box-shadow:
      0 0 0 3px var(--led-glow),
      0 0 10px var(--led-glow);
  }
  50% {
    box-shadow:
      0 0 0 5px var(--led-glow),
      0 0 18px var(--led-glow);
  }
}

/* ---------- strip, banners ---------- */

.ow-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ow-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  border-radius: var(--ow-radius-s);
  border: 1px solid var(--ow-border);
  background: var(--ow-glass);
  text-align: center;
}

.ow-stat-n {
  font-size: 20px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.ow-stat-hot {
  color: #fde68a;
}

.ow-stat-bad {
  color: #fca5a5;
}

.ow-stat-l {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.ow-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--ow-radius-s);
  border: 1px solid var(--ow-border-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
}

.ow-banner .cx-icon {
  flex: none;
  margin-top: 2px;
}

.ow-banner-warn {
  color: #fde68a;
  border-color: rgba(234, 179, 8, 0.45);
  background: rgba(234, 179, 8, 0.1);
}

.ow-banner-bad {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.1);
}

.ow-banner-ok {
  align-items: center;
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.1);
}

.ow-banner-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Every tappable control stays at least 44px high (the file's own 48px rule for .ow-btn; the
   quiet/inline variants, links and disclosures are the compact exceptions at 44px). */
.ow-btn-inline {
  flex: none;
  min-height: 44px;
  padding: 0 10px;
}

/* ---------- sections ---------- */

.ow-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ow-h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.ow-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--ow-border);
  background: var(--ow-inset);
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.ow-h4 {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.ow-empty {
  padding: 18px 14px;
  border-radius: var(--ow-radius-s);
  border: 1px dashed var(--ow-border);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.ow-note {
  padding: 10px 12px;
  border-radius: var(--ow-radius-s);
  border: 1px solid var(--ow-border-soft);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.ow-note-bad {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

/* ---------- cards ---------- */

.ow-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--ow-radius);
  border: 1px solid var(--ow-border);
  background: var(--ow-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--ow-shadow);
  animation: ow-rise 0.22s var(--ow-ease);
}

@keyframes ow-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.ow-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ow-kind {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ow-num {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.ow-card-title {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.ow-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ow-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--ow-border-soft);
  background: var(--ow-inset);
  font-size: 12px;
  font-weight: 600;
}

.ow-brief {
  color: var(--muted);
  font-size: 13px;
  /* Owner text (a brief, plan notes) can hold a long link or hashtag: it wraps instead of widening
     the page past 375px. */
  overflow-wrap: anywhere;
}

.ow-assets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ow-asset {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 84px;
  padding: 10px;
  border-radius: var(--ow-radius-s);
  border: 1px dashed var(--ow-border);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  color: var(--muted);
}

.ow-asset-id {
  font-family: Consolas, 'Cascadia Mono', ui-monospace, monospace;
  font-size: 11.5px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.ow-asset-meta {
  font-size: 11px;
}

.ow-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--ow-radius-s);
  border: 1px solid var(--ow-border-soft);
  background: var(--ow-inset);
}

.ow-copy-platform {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.ow-copy-title {
  font-size: 14px;
}

.ow-copy-caption,
.ow-copy-desc {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.ow-copy-desc {
  color: var(--muted);
  font-size: 13px;
}

.ow-copy-tags {
  color: var(--accent);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.ow-schedule {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.ow-schedule .cx-icon {
  flex: none;
  margin-top: 2px;
}

/* ---------- lists ---------- */

.ow-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ow-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--ow-radius-s);
  border: 1px solid var(--ow-border-soft);
  background: var(--ow-glass);
}

.ow-row-top {
  align-items: flex-start;
}

.ow-row > .cx-icon {
  flex: none;
  color: var(--muted);
}

.ow-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  font-size: 14px;
}

.ow-row-text strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ow-row-text > span {
  color: var(--muted);
  font-size: 12.5px;
}

.ow-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  color: var(--accent);
  font-size: 13px;
  text-decoration: none;
}

.ow-link:hover {
  text-decoration: underline;
}

.ow-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.ow-error {
  color: #fca5a5;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.ow-details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}

.ow-pre {
  margin: 4px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--ow-border-soft);
  background: var(--ow-inset);
  font-family: Consolas, 'Cascadia Mono', ui-monospace, monospace;
  font-size: 11.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ow-job {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 24px;
  margin-top: 2px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--ow-border-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ow-job-published {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.45);
}

.ow-job-dry_run {
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.45);
}

.ow-job-failed {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.45);
}

.ow-job-publishing,
.ow-job-queued {
  color: #fde68a;
  border-color: rgba(234, 179, 8, 0.45);
}

/* ---------- buttons, forms ---------- */

.ow-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.ow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--ow-border);
  background: var(--ow-glass);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.15s var(--ow-ease),
    border-color 0.15s var(--ow-ease),
    transform 0.15s var(--ow-ease);
}

.ow-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.ow-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ow-btn-approve {
  background: var(--status-available);
  border-color: transparent;
  color: #052e16;
  box-shadow: 0 10px 24px -14px rgba(34, 197, 94, 0.9);
}

.ow-btn-reject,
.ow-btn-danger {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.12);
}

.ow-btn-danger {
  background: rgba(239, 68, 68, 0.22);
}

.ow-btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: #0f172a;
}

.ow-btn-ghost {
  background: transparent;
}

.ow-btn-quiet {
  min-height: 44px;
  background: transparent;
  border-color: var(--ow-border-soft);
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
}

.ow-reject {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--ow-radius-s);
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.06);
}

.ow-label {
  font-size: 13px;
  font-weight: 600;
}

.ow-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--ow-border);
  background: var(--ow-inset);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  resize: vertical;
}

.ow-textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.ow-msg {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.ow-msg-ok {
  color: #86efac;
}

.ow-msg-bad {
  color: #fca5a5;
}

/* ---------- control panels ---------- */

.ow-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--ow-radius);
  border: 1px solid var(--ow-border);
  background: var(--ow-glass);
}

.ow-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ow-panel-head > .cx-icon {
  flex: none;
  margin-top: 2px;
  color: var(--accent);
}

.ow-confirm {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--ow-radius-s);
  border: 1px solid rgba(234, 179, 8, 0.45);
  background: rgba(234, 179, 8, 0.08);
  font-size: 14px;
}

.ow-footer {
  padding-top: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* ---------- phone notifications ---------- */

/* State pill at the right of a panel head ("On", "Off", "Blocked"…). Text, not colour, carries the
   meaning; the tone only repeats it. */
.ow-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 45%;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--ow-border-soft);
  background: var(--ow-inset);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.ow-pill-ok {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.1);
}

.ow-pill-warn {
  color: #fde68a;
  border-color: rgba(234, 179, 8, 0.5);
  background: rgba(234, 179, 8, 0.1);
}

.ow-pill-bad {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.1);
}

/* Buttons one under the other: at 375 px "Turn off on this phone" does not fit half a row. */
.ow-actions.ow-actions-stack {
  grid-template-columns: minmax(0, 1fr);
}

.ow-job.ow-res-sent {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.45);
}

.ow-job.ow-res-skipped {
  color: #fde68a;
  border-color: rgba(234, 179, 8, 0.45);
}

.ow-job.ow-res-failed {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.45);
}

/* ---------- plans ---------- */

.ow-kind.ow-kind-plan {
  border-color: rgba(129, 140, 248, 0.5);
  background: rgba(99, 102, 241, 0.16);
  color: #c7d2fe;
}

.ow-plan-goal {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.ow-weeks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ow-week {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--ow-radius-s);
  border: 1px solid var(--ow-border-soft);
  background: var(--ow-inset);
  font-size: 13px;
}

.ow-week-n {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ow-week-theme {
  overflow-wrap: anywhere;
}

.ow-week-count {
  color: var(--text);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ow-split {
  display: flex;
  flex-direction: column;
  margin: 0;
  border-radius: var(--ow-radius-s);
  border: 1px solid var(--ow-border-soft);
  background: var(--ow-inset);
  overflow: hidden;
}

.ow-split-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  font-size: 13px;
}

.ow-split-row + .ow-split-row {
  border-top: 1px solid var(--ow-border-soft);
}

.ow-split-row dt {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ow-split-row dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ow-split-total {
  font-weight: 650;
}

.ow-plan-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ow-plan-week {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ow-root .ow-plan-week-h {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  overflow-wrap: anywhere;
}

.ow-plan-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: var(--ow-radius-s);
  border: 1px solid var(--ow-border-soft);
  background: var(--ow-inset);
}

.ow-plan-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 12px;
}

.ow-plan-date {
  color: var(--text);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.ow-plan-kind {
  color: var(--accent);
  font-weight: 600;
}

.ow-flag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(234, 179, 8, 0.5);
  background: rgba(234, 179, 8, 0.1);
  color: #fde68a;
  font-size: 11px;
  font-weight: 700;
}

.ow-plan-item-title {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ow-plan-item-meta {
  color: var(--muted);
  font-size: 12px;
}

.ow-plan-item-brief {
  color: var(--muted);
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- skeletons ---------- */

.ow-skels {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ow-skel {
  display: block;
  height: 56px;
  border-radius: var(--ow-radius-s);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 25%, rgba(255, 255, 255, 0.14) 50%, rgba(255, 255, 255, 0.06) 75%);
  background-size: 200% 100%;
  animation: ow-shimmer 1.4s linear infinite;
}

.ow-skel-tall {
  height: 180px;
}

@keyframes ow-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

/* ---------- shell: tabs, screen-reader text ---------- */

/* Text for screen readers only (headings of tabs whose title the tab bar already shows, "You:"). */
.ow-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.ow-main {
  display: block;
  min-width: 0;
}

.ow-main > [hidden] {
  display: none !important;
}

.ow-tabpanel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.ow-tab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* A link styled as a button (Open Settings). */
a.ow-btn {
  text-decoration: none;
}

/* The bottom tab bar: fixed, phone-column wide, above the gesture area. */
.ow-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 calc(8px + env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) calc(8px + env(safe-area-inset-left, 0px));
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--ow-border-soft);
}

.ow-tabbar-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.ow-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  min-height: var(--ow-tabbar-h);
  padding: 6px 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ow-tab-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  transition: background-color 0.15s var(--ow-ease);
}

.ow-tab-on {
  color: var(--text);
}

.ow-tab-on .ow-tab-icon {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent);
}

.ow-tab-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ow-tab-badge {
  position: absolute;
  top: -4px;
  right: 2px;
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  border: 2px solid var(--bg);
  background: var(--status-attention);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* ---------- chat ---------- */

.ow-avatar {
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid var(--ow-accent, var(--accent));
  background: var(--ow-inset);
  color: var(--text);
  font-weight: 700;
}

.ow-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ow-avatar-m {
  width: 44px;
  height: 44px;
  font-size: 15px;
}

.ow-avatar-s {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.ow-person-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 10px;
  border-radius: var(--ow-radius);
  border: 1px solid var(--ow-border);
  background: var(--ow-glass);
}

.ow-people {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: var(--ow-radius);
  border: 1px solid var(--ow-border);
  background: var(--ow-glass-strong);
}

.ow-people-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.ow-person {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 6px 10px 6px 8px;
  border-radius: var(--ow-radius-s);
  border: 1px solid var(--ow-border-soft);
  background: var(--ow-inset);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ow-person-on {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.14);
}

.ow-person-name {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.ow-chat-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ow-chat-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ow-bubble {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--ow-border-soft);
}

.ow-bubble-agent {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  background: var(--ow-glass);
}

.ow-bubble-user {
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.16);
}

.ow-bubble-pending {
  opacity: 0.75;
}

/* Replies are plain text: line breaks kept, long words and links wrap inside the bubble. */
.ow-bubble-text {
  font-size: 15px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ow-bubble-meta {
  color: var(--muted);
  font-size: 11.5px;
}

.ow-bubble-thinking {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.ow-dots {
  display: inline-flex;
  gap: 4px;
}

.ow-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: ow-dot 1.2s ease-in-out infinite;
}

.ow-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.ow-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes ow-dot {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: none;
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.ow-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ow-quick-btn {
  min-height: 44px;
  max-width: 100%;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--ow-border);
  background: var(--ow-inset);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* The message box stays in reach, just above the tab bar, while the conversation scrolls. */
.ow-composer {
  position: sticky;
  bottom: calc(var(--ow-tabbar-h) + env(safe-area-inset-bottom, 0px));
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 -16px;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--ow-border-soft);
}

.ow-chat-input {
  min-height: 52px;
  max-height: 40vh;
  resize: none;
}

.ow-composer-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ow-mic {
  flex: none;
  width: 48px;
  padding: 0;
  border-radius: 50%;
}

.ow-mic-on {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.2);
  animation: ow-breathe-btn 1.6s ease-in-out infinite;
}

@keyframes ow-breathe-btn {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.15);
  }
}

.ow-seg {
  flex: none;
  display: inline-flex;
  padding: 2px;
  border-radius: 12px;
  border: 1px solid var(--ow-border);
  background: var(--ow-inset);
}

.ow-seg-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ow-seg-on {
  background: rgba(56, 189, 248, 0.2);
  color: var(--text);
}

.ow-send {
  flex: 1;
  min-width: 0;
}

.ow-listening {
  color: #fecaca;
}

/* ---------- office ---------- */

.ow-dot {
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--status-offline);
}

.ow-dot-busy {
  background: var(--status-reviewing);
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.25);
}

.ow-row-text > .ow-activity-text {
  color: var(--text);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

/* ---------- wider screens: the column stays phone-sized, centred ---------- */

@media (min-width: 640px) {
  .ow-root {
    padding-top: 24px;
  }

  .ow-header {
    margin-top: -24px;
    padding-top: 24px;
    border-radius: 0 0 var(--ow-radius) var(--ow-radius);
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .ow-root *,
  .ow-root *::before,
  .ow-root *::after {
    animation: none !important;
    transition: none !important;
  }

  .ow-skel {
    background: rgba(255, 255, 255, 0.08);
  }
}
/* Owner app screens (Marketing, Finance, Factory, the ask box, the test run).
   Same rules as ../owner.css: every class prefixed `ow-`, tokens from styles.css, phone-first,
   48px tap targets, nothing wider than a 375px screen. */

.ow-tabpage {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ow-prewrap {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.5;
}

.ow-bad-text {
  color: #fca5a5;
}
.ow-ok-text {
  color: #86efac;
}

.ow-actions-stack {
  grid-template-columns: minmax(0, 1fr);
}

.ow-pill-wide {
  max-width: 100%;
  justify-content: flex-start;
  text-align: left;
  padding: 6px 12px;
  font-size: 13px;
}

/* ---------- header buttons ---------- */

.ow-head-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ow-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--ow-border-soft);
  background: var(--ow-glass);
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ow-icon-btn[aria-current='page'] {
  color: var(--text);
  border-color: var(--accent);
}

/* ---------- inputs ---------- */

.ow-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--ow-border);
  background: var(--ow-inset);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.ow-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---------- segmented bar (Marketing: Posts | Studio | Leads) and filters ---------- */

.ow-segbar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--ow-border);
  background: var(--ow-inset);
}

.ow-segbar-btn {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  padding: 0 4px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ow-segbar-on {
  background: rgba(56, 189, 248, 0.22);
  color: var(--text);
}

.ow-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.ow-filter {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--ow-border);
  background: var(--ow-glass);
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.ow-filter-on {
  color: #0f172a;
  background: var(--accent);
  border-color: transparent;
}

/* ---------- post list ---------- */

.ow-posts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ow-post {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border-radius: var(--ow-radius-s);
  border: 1px solid var(--ow-border-soft);
  background: var(--ow-glass);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ow-post:active {
  transform: translateY(1px);
}

.ow-thumb {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--ow-inset);
  color: var(--muted);
}

.ow-thumb-v {
  width: 44px;
  height: 72px;
}

.ow-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ow-post-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.ow-post-text strong {
  font-size: 14.5px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.ow-post-when {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.ow-post-sub {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- one post ---------- */

.ow-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ow-back {
  align-self: flex-start;
}

.ow-post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--muted);
}

.ow-post-meta > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ow-prod,
.ow-make,
.ow-publish {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--ow-radius-s);
  border: 1px solid var(--ow-border-soft);
  background: var(--ow-inset);
}

.ow-prod-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}

/* The studio's videos, full width on a phone. */
.ow-detail .st-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ow-detail .st-preview video,
.ow-detail .st-preview img {
  width: 100%;
  max-height: 70vh;
  border-radius: 12px;
  background: #000;
}

/* ---------- test run ---------- */

.ow-test {
  border-color: rgba(56, 189, 248, 0.45);
}

.ow-test-summary {
  margin: 0;
  font-weight: 650;
  color: var(--accent);
}

.ow-test-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--ow-radius-s);
  border: 1px solid var(--ow-border-soft);
  background: var(--ow-inset);
}

.ow-test-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ow-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ow-step {
  display: flex;
  gap: 10px;
  font-size: 13.5px;
}

.ow-step-mark {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--ow-border);
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.ow-step-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ow-step-detail {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.ow-step-done .ow-step-mark {
  color: #052e16;
  background: var(--status-available);
  border-color: transparent;
}

.ow-step-now .ow-step-mark {
  color: var(--accent);
  border-color: var(--accent);
  animation: ow-pulse 1.4s ease-in-out infinite;
}

.ow-step-failed .ow-step-mark {
  color: #fff;
  background: var(--status-attention);
  border-color: transparent;
}

.ow-step-waiting,
.ow-step-optional {
  color: var(--muted);
}

@keyframes ow-pulse {
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ow-step-now .ow-step-mark {
    animation: none;
  }
}

/* ---------- studio ---------- */

.ow-kv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  font-size: 13.5px;
}

.ow-kv > span {
  color: var(--muted);
}

.ow-kv > strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ow-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--ow-border-soft);
}

.ow-switch-row > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ow-toggle {
  flex: none;
  position: relative;
  width: 56px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--ow-border);
  background: var(--ow-inset);
  cursor: pointer;
}

.ow-toggle > span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.18s var(--ow-ease);
}

.ow-toggle-on {
  background: var(--status-available);
  border-color: transparent;
}

.ow-toggle-on > span {
  transform: translateX(24px);
  background: #fff;
}

.ow-toggle:disabled {
  opacity: 0.5;
}

/* ---------- leads ---------- */

.ow-score {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
}

.ow-lead-links {
  display: flex;
  gap: 16px;
}

.ow-lead-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--accent);
  font-weight: 650;
}

/* ---------- ask box ---------- */

.ow-ask {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ow-ask-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ow-ask-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 8px;
}

.ow-ask-row .ow-btn {
  padding: 0;
}

.ow-ask-wait {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
}

.ow-answer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--ow-radius-s);
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}

.ow-answer-bad {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
}

.ow-answer-q {
  color: var(--muted);
  font-size: 12px;
}

.ow-answer-a {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14.5px;
  line-height: 1.5;
}

/* At phone width the header keeps the name, the live light and the two buttons; the "updated N s
   ago" detail and the "Owner" line give way. */
@media (max-width: 460px) {
  .ow-header .ow-live-text > span[aria-hidden='true'] {
    display: none;
  }

  .ow-header .ow-brand-text > span {
    display: none;
  }

  .ow-header .ow-brand-text h1 {
    font-size: 15px;
  }
}

.ow-input-narrow {
  width: auto;
  min-width: 120px;
  flex: none;
}

/* "Reel from my photos": up to four chosen photos, each removable, and an Add tile. */
.ow-reel-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ow-reel-photo,
.ow-reel-add {
  position: relative;
  width: 72px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
}

.ow-reel-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ow-reel-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.ow-reel-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px dashed var(--ow-border-soft);
  background: var(--ow-inset);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

/* ---------- the Marketing Director: campaigns, the review screen, the settings card ---------- */

/* Campaign, Calendar event, engines, version, intended time on a post. */
.ow-post-facts {
  padding: 8px 0 2px;
}

.ow-post-facts .ow-link {
  padding: 0;
  min-height: 0;
  font: inherit;
  text-align: left;
}

/* The product's reference photo beside the creative. */
.ow-ref {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 0;
}

.ow-ref img {
  flex: none;
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--ow-inset);
  border: 1px solid var(--ow-border-soft);
}

/* Tap-sized checkbox chips (channels, formats). */
.ow-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ow-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--ow-border);
  background: var(--ow-inset);
  font-size: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ow-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.ow-check-on {
  border-color: var(--accent);
}

.ow-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

/* ---------- the Marketing Approval application (owner/inbox) ---------- */
.ow-segbar.ow-inbox-bar { display: flex; overflow-x: auto; scrollbar-width: none; }
.ow-segbar.ow-inbox-bar .ow-segbar-btn { flex: 0 0 auto; white-space: nowrap; padding: 0 12px; }
.ow-segbar.ow-inbox-bar .ow-count { margin-left: 6px; }
.ow-post-btn { border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ow-thumb-inbox { width: 84px; flex: none; overflow: hidden; }
.ow-thumb-inbox .st-preview, .ow-thumb-inbox .st-preview-compact { width: 84px; max-width: 84px; }
.ow-thumb-inbox figcaption { display: none; }
.ow-review .ow-kv { margin-top: 12px; }
.ow-review .ow-actions-stack { margin-top: 16px; }
.ow-review .ow-back { margin-bottom: 8px; }
.ow-ref img { max-width: 140px; border-radius: 10px; display: block; }
.ow-ref figcaption { font-size: 12px; opacity: 0.7; margin-top: 4px; }
.ow-review .ow-card > .st-preview { flex-direction: column; }
.ow-review .ow-card > .st-preview .st-image-p { width: 100%; max-width: 420px; height: auto; }
.ow-review .ow-card > .st-preview .st-video-v { width: 100%; max-width: 300px; height: auto; }
.ow-review .ow-card > .st-preview .st-video-h { width: 100%; max-width: 420px; height: auto; }
.ow-thumb-inbox .st-image-p { width: 84px; }

/* ---------- a Directed Ad's storyboard ---------- */
.ow-sb-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ow-sb-scene { display: flex; gap: 10px; align-items: flex-start; }
.ow-sb-still { width: 110px; flex: none; }
.ow-sb-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13px; }
.ow-sb-line { color: var(--text); }
.ow-sb-voice { color: var(--muted); font-style: italic; }
/* The production review page (Phase 1). */
.ow-h5 { margin: 14px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.ow-rv-head { display: flex; gap: 12px; align-items: flex-start; margin-top: 8px; }
.ow-rv-score { width: 44px; height: 44px; font-size: 16px; }
.ow-link-btn { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; text-align: left; }
.ow-rv-parts { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ow-rv-part { display: flex; justify-content: space-between; font-size: 13px; }
.ow-rv-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.ow-rv-fill { height: 100%; background: var(--accent); }
.ow-rv-reasons { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12px; display: flex; flex-direction: column; gap: 2px; }
.ow-rv-gates { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ow-rv-gates li { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); }
.ow-rv-gate-ok strong { color: #86efac; }
.ow-rv-gate-bad strong { color: #fca5a5; }
.ow-rv-gate-unknown strong { color: #fcd34d; }
.ow-rv-plain { margin: 4px 0 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.ow-rv-media { width: 110px; flex: none; }
.ow-rv-rating { display: flex; align-items: center; gap: 4px; margin: 4px 0 6px; }
.ow-star { background: none; border: 0; padding: 0 2px; font-size: 26px; line-height: 1; color: rgba(255, 255, 255, 0.25); cursor: pointer; }
.ow-star-on { color: #fbbf24; }

/* ---------- Phase 2: concepts, lessons, the learning page ---------- */
.ow-cc-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ow-cc { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 12px; border: 1px solid var(--ow-border); background: rgba(255, 255, 255, 0.03); font-size: 13px; }
.ow-cc-rec { border-color: rgba(56, 189, 248, 0.5); }
.ow-cc .ow-btn { margin-top: 6px; align-self: flex-start; }
.ow-lessons-applied summary { font-weight: 650; font-size: 13px; }
.ow-lessons-applied ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.ow-lesson { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 12px; border: 1px solid var(--ow-border); background: rgba(255, 255, 255, 0.03); font-size: 13px; }
.ow-lesson-flag { border-color: rgba(252, 211, 77, 0.6); }
.ow-lesson-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); }
.ow-lesson .ow-actions { margin-top: 4px; }
.ow-lesson-history { margin: 4px 0 0; padding-left: 16px; font-size: 12px; color: var(--muted); }
.ow-keep { color: #86efac; }
.ow-avoid { color: #fca5a5; }
.ow-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.ow-table th, .ow-table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--ow-border); vertical-align: top; }
.ow-table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.ow-cc-lessons { margin: 2px 0 0; padding-left: 16px; display: flex; flex-direction: column; gap: 2px; }
/* Owner app 5.0 — the office on the phone: sign-in, the campus, the floors and Jyoti
   (owner/LoginScreen.tsx, CampusTab.tsx, FloorView.tsx, JyotiTab.tsx). Same dark glass and `ow-`
   tokens as ../owner.css; built for 375px wide phones, nothing forces a horizontal scroll. */

/* ---------- sign-in ---------- */

.ow-login {
  position: relative;
  justify-content: center;
  min-height: 100vh;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}

.ow-login-art {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.ow-login-art img,
.ow-campus-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ow-login-art::after,
.ow-campus-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.35), rgba(2, 6, 23, 0.92) 70%);
}

.ow-campus-art::after {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.05) 20%, rgba(2, 6, 23, 0.88));
}

.ow-login-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 20px;
  border-radius: var(--ow-radius);
  border: 1px solid var(--ow-border);
  background: var(--ow-glass-strong);
  backdrop-filter: blur(14px);
  box-shadow: var(--ow-shadow);
}

.ow-login-card h1 {
  margin: 4px 0 0;
  font-size: 22px;
}

.ow-login-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.3), rgba(99, 102, 241, 0.3));
  border: 1px solid var(--ow-border);
}

.ow-login-sub,
.ow-login-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ow-login-label {
  margin-top: 8px;
  font-weight: 650;
}

.ow-login-row {
  display: flex;
  gap: 8px;
}

.ow-login-row input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--ow-border);
  background: var(--ow-inset);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.ow-login-err {
  margin: 0;
  color: #fecaca;
  font-size: 13px;
}

.ow-login-go {
  margin-top: 6px;
  width: 100%;
}

/* ---------- the campus (Office tab) ---------- */

.ow-campus {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ow-campus-hero {
  position: relative;
  min-height: 210px;
  border-radius: var(--ow-radius);
  overflow: hidden;
  border: 1px solid var(--ow-border);
  box-shadow: var(--ow-shadow);
}

.ow-campus-art {
  position: absolute;
  inset: 0;
}

.ow-campus-hello {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  min-height: 210px;
  padding: 16px;
}

.ow-campus-hello h2 {
  margin: 0;
  font-size: 24px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.ow-campus-hello > span {
  color: #cbd5e1;
  font-size: 13px;
}

.ow-campus-plan {
  margin-top: 10px;
  align-self: flex-start;
}

.ow-campus-today {
  gap: 10px;
}

.ow-campus-label {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ow-buildings {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ow-building {
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  min-height: 96px;
  padding: 0;
  border-radius: var(--ow-radius);
  border: 1px solid var(--ow-border);
  background: var(--ow-glass);
  color: var(--text);
  font: inherit;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ow-building:active {
  transform: scale(0.99);
}

.ow-building-warn {
  border-color: rgba(245, 158, 11, 0.55);
}

.ow-building-bad {
  border-color: rgba(239, 68, 68, 0.55);
}

.ow-building-pic {
  flex: none;
  display: grid;
  place-items: center;
  width: 38%;
  max-width: 160px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(15, 23, 42, 0.9));
  color: var(--muted);
}

.ow-building-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ow-building-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px 10px 0;
  font-size: 13px;
  color: #cbd5e1;
}

.ow-building-text strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  font-size: 16px;
  color: var(--text);
}

.ow-campus-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ow-campus-links .ow-btn {
  flex: 1 1 140px;
}

/* ---------- a floor (Marketing, Finance, Manufacturing) ---------- */

.ow-floor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 6px;
}

.ow-floor-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ow-floor-top .ow-h2 {
  margin: 0;
}

.ow-floor-back {
  min-height: 44px;
  padding: 0 12px;
}

.ow-floor-scene {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--ow-radius);
  overflow: hidden;
  border: 1px solid var(--ow-border);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(15, 23, 42, 0.95));
  box-shadow: var(--ow-shadow);
}

.ow-floor-scene-marketing {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(15, 23, 42, 0.95));
}

.ow-floor-scene-manufacturing {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.28), rgba(15, 23, 42, 0.95));
}

.ow-floor-scene video,
.ow-floor-scene img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ow-floor-drawn {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(226, 232, 240, 0.6);
}

.ow-floor-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 26px 12px 10px;
  background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.85));
  font-size: 12px;
  color: #cbd5e1;
}

.ow-floor-caption strong {
  font-size: 14px;
  color: var(--text);
}

.ow-floor-people {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ow-person {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 12px;
  border-radius: var(--ow-radius-s);
  border: 1px solid var(--ow-border-soft);
  background: var(--ow-inset);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ow-person .ow-avatar-m {
  width: 40px;
  height: 40px;
}

.ow-person-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.ow-person-text strong {
  font-size: 14px;
}

.ow-person-doing {
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ow-person-doing::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #22c55e;
  vertical-align: 0;
}

.ow-person-thinking::before {
  background: #f59e0b;
}

.ow-person-working::before {
  background: #38bdf8;
}

/* ---------- Chat: Listen to a reply ---------- */

.ow-listen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--ow-border-soft);
  background: var(--ow-inset);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

/* ---------- Jyoti ---------- */

.ow-jyoti {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ow-jyoti-hello {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ow-jyoti-hello h2 {
  margin: 0;
  font-size: 22px;
}

.ow-jyoti-hello p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.ow-jyoti-face {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f472b6, #a78bfa 55%, #38bdf8);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 10px 28px -12px rgba(244, 114, 182, 0.8);
}

.ow-jyoti-face::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(244, 114, 182, 0.55);
  opacity: 0;
}

.ow-jyoti-face-on::after {
  animation: ow-jyoti-pulse 1.4s var(--ow-ease) infinite;
}

@keyframes ow-jyoti-pulse {
  0% {
    opacity: 0.9;
    transform: scale(0.92);
  }
  100% {
    opacity: 0;
    transform: scale(1.18);
  }
}

.ow-brief .ow-card-head {
  flex-wrap: wrap;
  gap: 8px;
}

.ow-brief-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.ow-brief-lines li {
  position: relative;
  padding-left: 16px;
}

.ow-brief-lines li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}

.ow-brief-lines .ow-brief-ok::before {
  background: #22c55e;
}

.ow-brief-lines .ow-brief-attention::before {
  background: #f59e0b;
}

.ow-brief-lines .ow-brief-info::before {
  background: #38bdf8;
}

.ow-brief-when {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.ow-jyoti-talk {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Her answers keep their lines (the plan is one point per line). */
.ow-jyoti-talk .ow-bubble {
  white-space: pre-wrap;
}

.ow-jyoti-talk:empty {
  display: none;
}

.ow-jyoti-mic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.ow-jyoti-micbtn {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 1px solid rgba(244, 114, 182, 0.6);
  background: radial-gradient(circle at 30% 30%, rgba(244, 114, 182, 0.45), rgba(167, 139, 250, 0.35));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 14px 30px -14px rgba(244, 114, 182, 0.9);
  -webkit-tap-highlight-color: transparent;
}

.ow-jyoti-micbtn:disabled {
  opacity: 0.5;
  cursor: default;
}

.ow-jyoti-micbtn-on {
  background: radial-gradient(circle at 30% 30%, rgba(239, 68, 68, 0.7), rgba(244, 114, 182, 0.4));
  animation: ow-jyoti-pulse-btn 1.2s var(--ow-ease) infinite alternate;
}

@keyframes ow-jyoti-pulse-btn {
  to {
    box-shadow: 0 0 0 12px rgba(244, 114, 182, 0.12);
  }
}

.ow-jyoti-type {
  display: flex;
  gap: 8px;
}

.ow-jyoti-type input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--ow-border);
  background: var(--ow-inset);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.ow-jyoti-prefs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ow-jyoti-note {
  margin: 0;
  font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .ow-jyoti-face-on::after,
  .ow-jyoti-micbtn-on {
    animation: none;
  }
}
/* The Owner app's look, version 6: the quiet, airy style of the phone's own apps (Apple's Human
   Interface Guidelines): a grouped light background with white cards, one tint colour, the system
   typeface, hairline separators, a translucent navigation bar and tab bar, chevrons on rows, and
   explanations hidden unless the owner turns "Explain screens" on in Settings. Dark appearance
   follows the phone. Loaded after owner.css, screens.css and office.css: it only re-skins the
   classes they define (every selector here carries .ow-root, so it wins without !important). */

.ow-root {
  /* iOS system palette, light appearance. */
  --bg: #f2f2f7;
  --panel: #ffffff;
  --panel-light: #ffffff;
  --border: rgba(60, 60, 67, 0.18);
  --text: #000000;
  --muted: #6d6d72;
  --accent: #007aff;
  --ios-fill: #e9e9eb;
  --ios-fill-2: rgba(118, 118, 128, 0.12);
  --ios-sep: rgba(60, 60, 67, 0.29);
  --ios-chevron: #c4c4c6;
  --ios-bar: rgba(249, 249, 249, 0.94);
  --ios-green: #34c759;
  --ios-green-text: #1f8a3e;
  --ios-red: #ff3b30;
  --ios-red-text: #d70015;
  --ios-orange: #ff9500;
  --ios-orange-text: #b25000;
  --ios-indigo: #5856d6;
  --ios-tint-soft: rgba(0, 122, 255, 0.12);
  --ios-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);

  --ow-glass: var(--panel);
  --ow-glass-strong: var(--panel);
  --ow-inset: var(--ios-fill-2);
  --ow-border: transparent;
  --ow-border-soft: var(--ios-sep);
  --ow-shadow: none;
  --ow-radius: 14px;
  --ow-radius-s: 12px;
  --ow-tabbar-h: 54px;

  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Devanagari', sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  gap: 18px;
}

@media (prefers-color-scheme: dark) {
  .ow-root {
    --bg: #000000;
    --panel: #1c1c1e;
    --panel-light: #2c2c2e;
    --border: rgba(84, 84, 88, 0.65);
    --text: #ffffff;
    --muted: #98989f;
    --accent: #0a84ff;
    --ios-fill: #2c2c2e;
    --ios-fill-2: rgba(118, 118, 128, 0.24);
    --ios-sep: rgba(84, 84, 88, 0.65);
    --ios-chevron: #5a5a5e;
    --ios-bar: rgba(22, 22, 24, 0.92);
    --ios-green: #30d158;
    --ios-green-text: #30d158;
    --ios-red: #ff453a;
    --ios-red-text: #ff6961;
    --ios-orange: #ff9f0a;
    --ios-orange-text: #ffb340;
    --ios-indigo: #5e5ce6;
    --ios-tint-soft: rgba(10, 132, 255, 0.2);
  }
}

html.ow-html,
html.ow-html body {
  background: #f2f2f7;
}

/* The phone app scrolls the page itself (its tab bar is fixed over the page). The desktop office's
   stylesheet stops the page from scrolling (styles.css, `body { overflow: hidden }`: right for its
   fixed layout, and it came with the finance work's stylesheet in the merge of 2026-11-09). Under
   that rule the phone app could not be scrolled by finger at all - the owner, 2026-11-11: "my app is
   not scrolling". In this window the page scrolls. */
html.ow-html body {
  overflow: visible;
}

@media (prefers-color-scheme: dark) {
  html.ow-html,
  html.ow-html body {
    background: #000;
  }
}

.ow-root :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- navigation bar ---------- */

.ow-root .ow-header {
  min-height: 48px;
  gap: 8px;
  background: var(--ios-bar);
  border-bottom: 1px solid var(--ios-sep);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.ow-root .ow-nav-title {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ow-root .ow-nav-side {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 88px;
}

.ow-root .ow-nav-side-right {
  justify-content: flex-end;
}

.ow-root .ow-icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--accent);
}

.ow-root .ow-icon-btn[aria-current='page'] {
  background: var(--ios-tint-soft);
}

.ow-root .ow-live {
  min-height: 40px;
  max-width: none;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ow-root .ow-led {
  width: 9px;
  height: 9px;
  box-shadow: none;
}

.ow-root .ow-led-ok {
  background: var(--ios-green);
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.18);
}

.ow-root .ow-led-bad {
  background: var(--ios-red);
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.18);
  animation: none;
}

.ow-root .ow-large-title {
  margin: 4px 0 -6px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.15;
}

/* ---------- type ---------- */

.ow-root .ow-h2,
.ow-root .ow-campus-label,
.ow-root .ow-h4,
.ow-root .ow-h5 {
  padding: 0 4px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--muted);
}

.ow-root .ow-h2 {
  margin-bottom: -6px;
}

.ow-root .ow-card-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ow-root .ow-small {
  font-size: 13px;
}

.ow-root .ow-footer {
  font-size: 12px;
}

/* Explanations: hidden unless Settings → Explain screens is on. */
.ow-root[data-help='off'] .ow-help {
  display: none;
}

.ow-root[data-help='on'] .ow-help {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

/* ---------- surfaces ---------- */

.ow-root .ow-card,
.ow-root .ow-panel,
.ow-root .ow-stat,
.ow-root .ow-campus-today,
.ow-root .ow-cc,
.ow-root .ow-lesson,
.ow-root .ow-answer {
  border: 0;
  border-radius: var(--ow-radius);
  background: var(--panel);
  box-shadow: var(--ios-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.ow-root .ow-card,
.ow-root .ow-panel {
  padding: 16px;
  gap: 12px;
}

.ow-root .ow-panel-head {
  align-items: center;
}

.ow-root .ow-panel-head > svg,
.ow-root .ow-panel-head > .icon {
  color: var(--accent);
}

.ow-root .ow-row-text {
  font-size: 15px;
  gap: 1px;
}

.ow-root .ow-row-text > span,
.ow-root .ow-post-sub,
.ow-root .ow-person-doing,
.ow-root .ow-building-text > span,
.ow-root .ow-floor-caption > span,
.ow-root .ow-brief-when,
.ow-root .ow-copy-platform,
.ow-root .ow-post-meta,
.ow-root .ow-num,
.ow-root .ow-bubble-meta {
  color: var(--muted);
}

/* Grouped lists: one white block, hairlines between rows. */
.ow-root .ow-list,
.ow-root .ow-posts,
.ow-root .ow-buildings,
.ow-root .ow-floor-people,
.ow-root .ow-people-grid {
  gap: 0;
  border-radius: var(--ow-radius);
  background: var(--panel);
  box-shadow: var(--ios-shadow);
  overflow: hidden;
}

.ow-root .ow-panel .ow-list,
.ow-root .ow-card .ow-list {
  background: var(--bg);
  box-shadow: none;
}

.ow-root .ow-row,
.ow-root .ow-post,
.ow-root .ow-building,
.ow-root .ow-person {
  min-height: 52px;
  padding: 12px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.ow-root .ow-list > li + li,
.ow-root .ow-posts > li + li,
.ow-root .ow-floor-people > li + li,
.ow-root .ow-buildings > .ow-building + .ow-building {
  border-top: 1px solid var(--ios-sep);
}

.ow-root .ow-list > li + li,
.ow-root .ow-posts > li + li,
.ow-root .ow-floor-people > li + li {
  border-top-width: 0.5px;
}

.ow-root .ow-post-btn:active,
.ow-root .ow-building:active,
.ow-root .ow-person:active {
  background: var(--ios-fill-2);
}

/* A chevron at the right of every row that opens something. */
.ow-root .ow-post-btn,
.ow-root .ow-building {
  position: relative;
  padding-right: 34px;
}

.ow-root .ow-post-btn::after,
.ow-root .ow-building::after {
  content: '';
  position: absolute;
  right: 18px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ios-chevron);
  border-bottom: 2px solid var(--ios-chevron);
  transform: translateY(-50%) rotate(-45deg);
}

.ow-root .ow-post-text strong {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ow-root .ow-post-when {
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

.ow-root .ow-thumb,
.ow-root .ow-thumb-inbox {
  border-radius: 10px;
  background: var(--ios-fill-2);
}

.ow-root .ow-empty {
  padding: 28px 16px;
  border: 0;
  border-radius: var(--ow-radius);
  background: var(--panel);
  color: var(--muted);
  font-size: 15px;
}

/* ---------- stats ---------- */

.ow-root .ow-strip {
  gap: 10px;
}

.ow-root .ow-stat {
  padding: 14px 8px 12px;
  gap: 4px;
}

.ow-root .ow-stat-n {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ow-root .ow-stat-l {
  font-size: 12px;
  color: var(--muted);
}

.ow-root .ow-stat-hot {
  color: var(--accent);
}

.ow-root .ow-stat-bad {
  color: var(--ios-red-text);
}

/* ---------- buttons ---------- */

.ow-root .ow-btn {
  min-height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--ios-tint-soft);
  color: var(--accent);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ow-root .ow-btn:active {
  opacity: 0.7;
}

.ow-root .ow-btn:disabled {
  opacity: 0.4;
}

.ow-root .ow-btn-primary {
  background: var(--accent);
  color: #fff;
}

.ow-root .ow-btn-approve {
  background: var(--ios-green);
  color: #fff;
  box-shadow: none;
}

.ow-root .ow-btn-reject {
  background: rgba(255, 59, 48, 0.12);
  color: var(--ios-red-text);
}

.ow-root .ow-btn-danger {
  background: var(--ios-red);
  color: #fff;
}

.ow-root .ow-btn-ghost {
  background: var(--ios-fill-2);
  color: var(--accent);
}

.ow-root .ow-btn-quiet {
  min-height: 44px;
  padding: 0 12px;
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
}

.ow-root .ow-btn-inline {
  min-height: 36px;
}

.ow-root .ow-link,
.ow-root .ow-link-btn {
  color: var(--accent);
}

/* ---------- segmented controls and filters ---------- */

.ow-root .ow-seg {
  padding: 2px;
  border: 0;
  border-radius: 9px;
  background: var(--ios-fill-2);
}

.ow-root .ow-seg-btn {
  min-height: 32px;
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.ow-root .ow-seg-on {
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.ow-root .ow-segbar {
  display: flex;
  gap: 8px;
  padding: 2px 0;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  scrollbar-width: none;
}

.ow-root .ow-segbar::-webkit-scrollbar {
  display: none;
}

.ow-root .ow-segbar-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--ios-shadow);
}

.ow-root .ow-segbar-on {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.ow-root .ow-segbar-on .ow-count {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.ow-root .ow-count {
  padding: 0 6px;
  border-radius: 9px;
  background: var(--ios-fill-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.ow-root .ow-filter {
  min-height: 36px;
  border: 0;
  background: var(--panel);
  color: var(--text);
  font-weight: 500;
  box-shadow: var(--ios-shadow);
}

.ow-root .ow-filter-on {
  background: var(--accent);
  color: #fff;
}

.ow-root .ow-chip,
.ow-root .ow-pill,
.ow-root .ow-kind,
.ow-root .ow-job {
  border: 0;
  background: var(--ios-fill-2);
  color: var(--muted);
  font-weight: 600;
}

.ow-root .ow-pill-ok,
.ow-root .ow-job-published,
.ow-root .ow-job.ow-res-sent {
  background: rgba(52, 199, 89, 0.14);
  color: var(--ios-green-text);
}

.ow-root .ow-pill-warn,
.ow-root .ow-job-queued,
.ow-root .ow-job.ow-res-skipped {
  background: rgba(255, 149, 0, 0.14);
  color: var(--ios-orange-text);
}

.ow-root .ow-pill-bad,
.ow-root .ow-job-failed,
.ow-root .ow-job.ow-res-failed {
  background: rgba(255, 59, 48, 0.12);
  color: var(--ios-red-text);
}

.ow-root .ow-kind.ow-kind-plan {
  color: var(--ios-indigo);
}

/* ---------- inputs ---------- */

.ow-root .ow-input,
.ow-root .ow-textarea,
.ow-root .ow-jyoti-type input,
.ow-root .ow-chat-input,
.ow-root .ow-composer textarea,
.ow-root .ow-login-row input {
  border: 0;
  border-radius: 10px;
  background: var(--ios-fill);
  color: var(--text);
  font-size: 17px;
}

.ow-root .ow-input:focus-visible,
.ow-root .ow-textarea:focus-visible {
  outline: 2px solid var(--accent);
  box-shadow: none;
}

.ow-root select.ow-input {
  padding-right: 28px;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
}

/* ---------- switches ---------- */

.ow-root .ow-switch-row {
  padding: 12px 0;
  border-top: 0.5px solid var(--ios-sep);
}

.ow-root .ow-toggle {
  width: 51px;
  height: 31px;
  border: 0;
  background: var(--ios-fill);
}

@media (prefers-color-scheme: dark) {
  .ow-root .ow-toggle {
    background: #39393d;
  }
}

.ow-root .ow-toggle-on {
  background: var(--ios-green);
}

.ow-root .ow-toggle > span {
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* ---------- banners, messages ---------- */

.ow-root .ow-banner,
.ow-root .ow-note {
  border: 0;
  border-radius: var(--ow-radius-s);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  box-shadow: var(--ios-shadow);
}

.ow-root .ow-banner > svg,
.ow-root .ow-banner > .icon {
  color: var(--accent);
}

.ow-root .ow-banner-warn {
  background: rgba(255, 149, 0, 0.12);
  color: var(--text);
}

.ow-root .ow-banner-warn > svg {
  color: var(--ios-orange);
}

.ow-root .ow-banner-bad,
.ow-root .ow-note-bad {
  background: rgba(255, 59, 48, 0.1);
  color: var(--text);
}

.ow-root .ow-banner-bad > svg {
  color: var(--ios-red);
}

.ow-root .ow-banner-ok {
  background: rgba(52, 199, 89, 0.12);
  color: var(--text);
}

.ow-root .ow-banner-ok > svg {
  color: var(--ios-green);
}

.ow-root .ow-msg-ok,
.ow-root .ow-ok-text,
.ow-root .ow-keep,
.ow-root .ow-rv-gate-ok strong {
  color: var(--ios-green-text);
}

.ow-root .ow-msg-bad,
.ow-root .ow-error,
.ow-root .ow-bad-text,
.ow-root .ow-avoid,
.ow-root .ow-login-err,
.ow-root .ow-rv-gate-bad strong {
  color: var(--ios-red-text);
}

.ow-root .ow-flag,
.ow-root .ow-rv-gate-unknown strong {
  color: var(--ios-orange-text);
}

.ow-root .ow-star {
  color: var(--ios-fill);
}

.ow-root .ow-star-on {
  color: var(--ios-orange);
}

.ow-root .ow-score,
.ow-root .ow-rv-score {
  border-radius: 10px;
  background: var(--ios-tint-soft);
  color: var(--accent);
}

.ow-root .ow-rv-bar {
  background: var(--ios-fill-2);
}

.ow-root .ow-table th,
.ow-root .ow-table td {
  border-bottom: 0.5px solid var(--ios-sep);
}

.ow-root .ow-rv-gates li {
  background: var(--ios-fill-2);
}

/* ---------- tab bar ---------- */

.ow-root .ow-tabbar {
  padding: 0 calc(4px + env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) calc(4px + env(safe-area-inset-left, 0px));
  background: var(--ios-bar);
  border-top: 0.5px solid var(--ios-sep);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.ow-root .ow-tab {
  gap: 3px;
  min-height: var(--ow-tabbar-h);
  padding: 7px 2px 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.ow-root .ow-tab-icon {
  width: auto;
  height: 26px;
  border-radius: 0;
  background: transparent;
}

.ow-root .ow-tab-icon svg {
  width: 25px;
  height: 25px;
}

.ow-root .ow-tab-on,
.ow-root .ow-tab-on .ow-tab-icon {
  color: var(--accent);
  background: transparent;
}

.ow-root .ow-tab-badge {
  top: -5px;
  right: -12px;
  min-width: 18px;
  height: 18px;
  border: 2px solid var(--ios-bar);
  background: var(--ios-red);
  font-size: 11px;
}

/* ---------- the Office tab ---------- */

.ow-root .ow-campus-hero {
  min-height: 190px;
  border: 0;
  border-radius: 18px;
  box-shadow: var(--ios-shadow);
}

.ow-root .ow-campus-hello {
  min-height: 190px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.62));
  color: #fff;
}

.ow-root .ow-campus-hello h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.ow-root .ow-campus-hello > span {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.ow-root .ow-campus-plan {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  color: #000;
  font-size: 15px;
}

@media (prefers-color-scheme: dark) {
  .ow-root .ow-campus-plan {
    background: rgba(255, 255, 255, 0.92);
    color: #000;
  }
}

.ow-root .ow-building {
  min-height: 76px;
  gap: 14px;
}

.ow-root .ow-building-pic {
  width: 64px;
  max-width: 64px;
  height: 64px;
  align-self: center;
  border-radius: 12px;
  overflow: hidden;
  background: var(--ios-fill-2);
}

.ow-root .ow-building-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ow-root .ow-building-text {
  padding: 0;
  gap: 3px;
  font-size: 14px;
  color: var(--muted);
}

.ow-root .ow-building-text strong {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.ow-root .ow-building-text strong svg {
  display: none;
}

.ow-root .ow-building-warn .ow-building-text > span:last-child {
  color: var(--ios-orange-text);
}

.ow-root .ow-building-bad .ow-building-text > span:last-child {
  color: var(--ios-red-text);
}

.ow-root .ow-campus-links {
  gap: 10px;
}

.ow-root .ow-campus-links .ow-btn {
  flex: 1;
  padding: 0 10px;
  background: var(--panel);
  color: var(--accent);
  font-size: 15px;
  white-space: nowrap;
  box-shadow: var(--ios-shadow);
}

.ow-root .ow-brief-lines {
  font-size: 15px;
  gap: 8px;
}

/* ---------- floors ---------- */

.ow-root .ow-floor-scene {
  border: 0;
  border-radius: 18px;
}

.ow-root .ow-floor-back {
  min-height: 40px;
  padding: 0 10px 0 4px;
  background: transparent;
  font-size: 17px;
  font-weight: 400;
}

.ow-root .ow-floor-top .ow-h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--text);
}

.ow-root .ow-person {
  min-height: 60px;
}

.ow-root .ow-person-text strong {
  font-size: 16px;
  font-weight: 600;
}

.ow-root .ow-person > svg:last-child {
  color: var(--accent);
}

/* ---------- Jyoti and chat ---------- */

.ow-root .ow-jyoti-hello h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ow-root .ow-jyoti-hello p {
  color: var(--muted);
  font-size: 15px;
}

.ow-root .ow-jyoti-face,
.ow-root .ow-jyoti-micbtn {
  box-shadow: 0 8px 24px -10px rgba(88, 86, 214, 0.5);
}

.ow-root .ow-bubble {
  max-width: 86%;
  padding: 10px 14px;
  border: 0;
  border-radius: 18px;
  font-size: 16px;
  line-height: 1.35;
  box-shadow: none;
}

.ow-root .ow-bubble-agent {
  background: var(--ios-fill);
  color: var(--text);
}

.ow-root .ow-bubble-user {
  background: var(--accent);
  color: #fff;
}

.ow-root .ow-bubble-user .ow-bubble-meta {
  color: rgba(255, 255, 255, 0.75);
}

.ow-root .ow-quick-btn {
  border: 0;
  background: var(--panel);
  color: var(--accent);
  font-weight: 500;
  box-shadow: var(--ios-shadow);
}

.ow-root .ow-mic,
.ow-root .ow-send {
  border: 0;
}

.ow-root .ow-mic-on,
.ow-root .ow-listening {
  color: var(--ios-red-text);
}

/* ---------- sign in ---------- */

.ow-root.ow-login {
  background: var(--bg);
}

.ow-root .ow-login-card {
  border: 0;
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.35);
}

.ow-root .ow-login-card h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ow-root .ow-login-mark {
  border: 0;
  background: var(--ios-tint-soft);
  color: var(--accent);
}

.ow-root .ow-login-help {
  color: var(--muted);
  font-size: 13px;
}

/* ---------- review and storyboard pages ---------- */

.ow-root .ow-cc-rec {
  box-shadow: 0 0 0 2px var(--accent);
}

.ow-root .ow-lesson-flag {
  box-shadow: 0 0 0 2px var(--ios-orange);
}

.ow-root .ow-details summary {
  color: var(--accent);
}

.ow-root .ow-pre {
  background: var(--ios-fill-2);
  border: 0;
}

/* ---------- second pass after the first look on a 375px screen ---------- */

.ow-root .ow-large-title {
  margin: 8px 0 14px;
}

.ow-root .ow-composer {
  background: var(--ios-bar);
  border-top: 0.5px solid var(--ios-sep);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.ow-root .ow-make,
.ow-root .ow-publish,
.ow-root .ow-week,
.ow-root .ow-confirm,
.ow-root .ow-reject {
  border: 0;
  border-radius: var(--ow-radius-s);
  background: var(--ios-fill-2);
}

.ow-root .ow-actions .ow-btn {
  padding: 0 10px;
  font-size: 15px;
  line-height: 1.2;
}

.ow-root .ow-reel-add {
  border: 1px dashed var(--ios-sep);
  background: var(--ios-fill-2);
}

/* Reduced motion: no card rise. */
@media (prefers-reduced-motion: reduce) {
  .ow-root .ow-card {
    animation: none;
  }
}
/*
 * Books in the Owner app (owner/books/*.tsx). Everything is built from the app's own parts - cards,
 * grouped lists, inputs, buttons, pills (cupertino.css) - and this file adds only what those do not
 * have: a row that opens something, a figure on the right of a row, the four balances of the home
 * card, the head of a screen. No box here scrolls inside itself: the page is what scrolls.
 */

.ow-books,
.ow-books-screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* A Books screen fills the Finance tab: the painted floor above it steps aside while one is open. */
.ow-root .ow-floor:has(+ .ow-books-open) {
  display: none;
}

.ow-books-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ow-books-head > p {
  margin: 0;
}
.ow-root .ow-books-head .ow-back {
  align-self: flex-start;
  gap: 2px;
  margin-left: -6px;
  padding: 0 8px 0 0;
}
.ow-root .ow-books-head .ow-card-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ow-books-company {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* The four balances asked first. */
.ow-books-figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.ow-books-fig {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: var(--ow-radius-s);
  background: var(--ios-fill-2);
}
.ow-books-fig > dt {
  color: var(--muted);
  font-size: 12px;
}
.ow-books-fig > dd {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

/* A row of a grouped list that opens something. */
.ow-root .ow-books-nav {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ow-root .ow-books-nav:active {
  background: var(--ios-fill-2);
}
.ow-books-chev {
  flex: none;
  color: var(--ios-chevron);
  font-size: 22px;
  line-height: 1;
}
.ow-books-figure {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  max-width: 52%;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.ow-books-figure > strong {
  font-size: 15px;
  font-weight: 600;
}
.ow-books-figure > span {
  color: var(--muted);
  font-size: 12px;
}

/* Where an office entry stands. */
.ow-books-mark {
  font-size: 12px;
  font-weight: 600;
}
.ow-books-mark-ok {
  color: var(--ios-green-text);
}
.ow-books-mark-bad {
  color: var(--ios-red-text);
}
.ow-books-mark-warn {
  color: var(--ios-orange-text);
}
.ow-books-mark-info {
  color: var(--muted);
}
.ow-root .ow-row-text > .ow-books-mark-ok {
  color: var(--ios-green-text);
}
.ow-root .ow-row-text > .ow-books-mark-bad {
  color: var(--ios-red-text);
}
.ow-root .ow-row-text > .ow-books-mark-warn {
  color: var(--ios-orange-text);
}

/* A list with its heading, outside a card. */
.ow-books-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ow-root .ow-books-side > .ow-label {
  margin: 0;
  padding: 0 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.ow-books-side > p,
.ow-books-count {
  margin: 0;
  padding: 0 16px;
}

/* Fields. */
.ow-books-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.ow-books-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ow-root .ow-books-chosen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}
.ow-books-chosen > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ow-books-found {
  margin-top: 2px;
}
.ow-root .ow-books-kinds {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ow-root .ow-books-kinds .ow-seg-btn {
  min-width: 0;
  min-height: 36px;
  padding: 0 4px;
}
.ow-books-reads,
.ow-books-standing {
  margin: 0;
}
.ow-books-standing {
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* Figures in a pair list stand on the right, as in a statement. */
.ow-books-kv-figures > strong {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.ow-root .ow-books-strong {
  font-size: 17px;
  font-weight: 700;
}

/* What the finance team said, line for line as it was said (the three steps of a piece of work). */
.ow-books-shown {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
}
:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-light: #273449;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;

  --status-available: #22c55e;
  --status-working: #38bdf8;
  --status-reviewing: #eab308;
  --status-waiting: #f97316;
  --status-attention: #ef4444;
  --status-offline: #64748b;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
  min-width: 0;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
}

.app {
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.status-bar {
  flex: none;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.status-badges {
  display: flex;
  gap: 10px;
}

.badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--panel-light);
  color: var(--muted);
}

.badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
}

.badge-ok .dot {
  background: #22c55e;
}

.app-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  position: relative;
  display: flex;
  overflow: hidden;
  isolation: isolate;
}

/* The scene and chat are peers, not overlapping absolute layers. Giving the main surface its
   own stacking context also prevents the animated office's internal z-indexes from painting over
   the chat. At narrow widths the chat switches back to a deliberate drawer (see media query). */
.app-surface {
  position: relative;
  z-index: 0;
  isolation: isolate;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* One bottom control dock keeps Activity and the command composer from colliding when the chat
   sidebar reduces the available room width. The empty third column keeps the composer centred. */
.office-controls {
  position: absolute;
  z-index: 10;
  right: 16px;
  bottom: 16px;
  left: 16px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 640px) minmax(260px, 1fr);
  align-items: end;
  gap: 16px;
  pointer-events: none;
}

.office-controls > * {
  pointer-events: auto;
}

.office-controls .activity-feed {
  position: relative;
  left: auto;
  bottom: auto;
  grid-column: 1;
  grid-row: 1;
}

.office-controls .command-bar-wrap {
  position: relative;
  left: auto;
  bottom: auto;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  transform: none;
}

/* ---------- Building scene ---------- */

.building-scene {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.building-svg {
  width: min(100%, 900px);
  height: 100%;
  max-height: 100%;
}

.command-center-hotspot,
.floor-hotspot-active {
  cursor: pointer;
}

.command-center-hotspot:hover circle:first-of-type {
  filter: brightness(1.3);
}

.floor-hotspot-active:hover rect {
  filter: brightness(1.15);
}

.svg-label-strong {
  fill: var(--accent);
  font-size: 15px;
  font-weight: 700;
}

.svg-label-muted {
  fill: var(--muted);
  font-size: 11px;
}

.svg-floor-label {
  fill: var(--muted);
  font-size: 14px;
}

.svg-floor-label-active {
  fill: #ecfeff;
  font-weight: 700;
  font-size: 16px;
}

/* ---------- Finance floor scene ---------- */

.floor-scene {
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.floor-scene-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.dept-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  flex: 1 1 220px;
  min-width: 0;
}

.dept-heading h2 {
  margin: 0;
  font-size: 18px;
}

.dept-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  row-gap: 4px;
  column-gap: 8px;
  font-size: 12px;
  color: var(--muted);
  max-width: 100%;
}

.dept-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
}

.dept-tally-ok,
.dept-tally-off {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dept-tally-ok i,
.dept-tally-off i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.dept-tally-ok i {
  background: var(--status-available);
}

.dept-tally-off i {
  background: var(--status-offline);
}

.dept-tally-ok {
  color: #86efac;
}

.dept-tally-off {
  color: var(--muted);
}

.floor-room {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Matches OfficeScene's own sky/ceiling tones so any letterboxed edge blends in, rather than
     the old dark "night building" navy this used to be. */
  background: #eaf4fb;
}

/* ---------- Workroom (premium floor) ---------- */

.workroom {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: auto;
  overflow: hidden;
}

.finance-hut-tally-panel {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
}

.office-scene-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.workstation {
  position: absolute;
  transform: translate(-50%, -50%);
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  transition: transform 0.2s ease;
}

.workstation:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 12px;
}

.workstation:hover {
  transform: translate(-50%, -50%) translateY(-2px);
}

.ws-svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.18));
}

@media (prefers-reduced-motion: no-preference) {
  .workstation.reviewing .ws-svg {
    animation: ws-bob 1.1s ease-in-out infinite;
  }
  .workstation.working .ws-svg {
    animation: ws-shake 0.5s ease-in-out infinite;
  }
}

@keyframes ws-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes ws-shake {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-1deg);
  }
  75% {
    transform: rotate(1deg);
  }
}

.ws-dot-html {
  position: absolute;
  top: 15%;
  left: 62%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dot-available {
  background: var(--status-available);
}
.dot-working {
  background: var(--status-working);
}
.dot-reviewing {
  background: var(--status-reviewing);
}
.dot-waiting {
  background: var(--status-waiting);
}
.dot-attention {
  background: var(--status-attention);
}
.dot-offline {
  background: var(--status-offline);
}

@media (prefers-reduced-motion: no-preference) {
  .workstation.reviewing .ws-dot-html,
  .workstation.working .ws-dot-html {
    animation: dot-pulse 1s ease-in-out infinite;
  }
}

@keyframes dot-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
}

.ws-away .ws-svg {
  opacity: 0.4;
}

.ws-away-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f6d78b;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.ws-tally-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.ws-tally-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.ws-tally-chip.ok {
  color: #bbf7d0;
}
.ws-tally-chip.ok i {
  background: #22c55e;
}
.ws-tally-chip.fail {
  color: #fecaca;
}
.ws-tally-chip.fail i {
  background: #ef4444;
}

.ws-plate {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  border-radius: 8px;
  padding: 3px 10px 4px;
}

.ws-plate strong {
  font-size: 12px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.ws-plate span {
  font-size: 10px;
  color: #e2e8f0;
}

.ws-count {
  font-weight: 700;
}

.tone-low {
  color: #6ee7b7;
}
.tone-medium {
  color: #fde68a;
}
.tone-high {
  color: #fca5a5;
}

/* ---------- Chat panel ---------- */

.chat-panel {
  position: relative;
  z-index: 20;
  isolation: isolate;
  flex: 0 0 clamp(320px, 28vw, 420px);
  width: clamp(320px, 28vw, 420px);
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.3);
}

.chat-panel-header {
  flex: none;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.chat-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-identity > div:last-child {
  min-width: 0;
}

.chat-avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f4f1ea;
  border: 2px solid var(--ws-accent, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-weight: 700;
  font-size: 12px;
  color: #0b1220;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  transform: scale(1.5);
}

.chat-identity h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-role {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
}

.chat-close {
  flex: none;
  padding: 4px 10px;
}

.chat-subheader {
  flex: none;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.chip-btn {
  background: var(--panel-light);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.finance-cards {
  flex: none;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.finance-card {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.finance-card-label {
  font-size: 10.5px;
  color: var(--muted);
}

.finance-card strong {
  font-size: 15px;
}

.chat-panel-messages {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-empty {
  color: var(--muted);
  font-size: 13px;
}

.chat-message {
  min-width: 0;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 88%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-message.user {
  align-self: flex-end;
  background: #0e7490;
  border-bottom-right-radius: 4px;
}

.chat-message.agent {
  align-self: flex-start;
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-typing {
  opacity: 0.6;
}

.chat-panel-input {
  flex: none;
  min-width: 0;
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.chat-panel-input input {
  flex: 1;
  min-width: 0;
}

/* A persistent sidebar is useful on normal desktop widths. Below 1260px it would squeeze the
   room too far, so it becomes an intentional top-layer drawer instead of partially covering the
   office through competing stacking contexts. */
@media (max-width: 1259px) {
  .app-body-chat-open::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 15;
    pointer-events: none;
    background: rgba(2, 6, 23, 0.36);
  }

  .app-body-chat-open .chat-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    flex-basis: auto;
    width: min(420px, 100%);
    height: auto;
  }
}

@media (max-width: 899px) {
  .office-controls {
    right: 10px;
    bottom: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .office-controls .activity-feed {
    width: min(260px, 100%);
  }

  .office-controls .command-bar-wrap {
    width: 100%;
  }
}

/* ---------- Dashboard ---------- */

.dashboard {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
  overflow-y: auto;
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.tab {
  background: var(--panel-light);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.tab.active {
  color: var(--text);
  border-color: var(--accent);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.item-row input {
  flex: 1;
  min-width: 90px;
}

input,
select {
  background: var(--panel-light);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

button.primary-btn {
  background: var(--accent);
  color: #0f172a;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

button.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.hint {
  color: var(--muted);
  font-size: 12px;
}

.documents-panel {
  gap: 16px;
}

.document-intro,
.document-card-head,
.document-review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.document-intro h3 {
  margin: 0 0 4px;
}

.document-intro p,
.document-card p {
  margin: 0;
}

.document-upload.primary-btn {
  flex: 0 0 auto;
  background: var(--accent);
  color: #0f172a;
  border-radius: 7px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.document-safety-strip {
  padding: 10px 12px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.08);
  color: #a7f3d0;
  font-size: 12px;
}

.document-list {
  display: grid;
  gap: 12px;
}

.virtual-tally-panel { gap: 16px; }
.virtual-tally-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.virtual-tally-overview > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-light);
}
.virtual-tally-overview strong { color: var(--accent); font-size: 20px; }
.virtual-tally-overview span { color: var(--muted); font-size: 11px; }
.virtual-tally-archives, .virtual-tally-datasets {
  display: grid;
  gap: 12px;
}
.virtual-tally-archives {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-light);
}
.virtual-tally-archives p { margin: 0; }
.virtual-tally-import {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
}
.virtual-tally-import label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.virtual-tally-import input,
.virtual-tally-import select,
.virtual-tally-import textarea {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
}
.virtual-tally-tax-bulk {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-light);
}
.virtual-tally-tax-bulk summary { cursor: pointer; font-weight: 600; }
.virtual-tally-tax-bulk label { margin-top: 8px; }
.virtual-tally-tax-bulk textarea { min-height: 100px; resize: vertical; font: inherit; }
.virtual-tally-tax-bulk button { margin-top: 8px; }
.virtual-tally-import input[type="file"] { font-size: 11px; }
.virtual-tally-import button { min-height: 34px; }
.segmented-tally-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segmented-tally-form .accounting-dropzone { grid-column: 1 / -1; }
.segmented-tally-form .primary-btn { justify-self: start; }
.segmented-release-review { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.segmented-release-review label { display: grid; gap: 6px; font-size: 12px; }
.segmented-release-review input { min-width: 0; max-width: 380px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); }
.segmented-invoice-identity { padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-light); }
.segmented-invoice-identity summary { cursor: pointer; font-weight: 600; }
.segmented-invoice-identity > p, .segmented-invoice-identity > form, .segmented-invoice-identity > section { margin-top: 12px; }
.segmented-invoice-identity-form { align-items: start; }
.segmented-invoice-identity-form label:nth-child(4) { grid-column: 1 / -1; }
.segmented-invoice-identity-form textarea { min-height: 90px; resize: vertical; }
.segmented-invoice-identity-form .segmented-invoice-identity-check { display: flex; grid-column: 1 / -1; align-items: flex-start; gap: 8px; font-weight: 400; }
.segmented-invoice-identity-form .segmented-invoice-identity-check input { width: auto; flex: none; margin-top: 2px; }
.segmented-invoice-identity-action { grid-column: 1 / -1; }
.segmented-invoice-identity section form[aria-label="Owner-entered GST calculation worksheet"] { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.segmented-invoice-identity section form[aria-label="Owner-entered GST calculation worksheet"] > h4,
.segmented-invoice-identity section form[aria-label="Owner-entered GST calculation worksheet"] > p,
.segmented-invoice-identity section form[aria-label="Owner-entered GST calculation worksheet"] > .segmented-gst-tax-lines,
.segmented-invoice-identity section form[aria-label="Owner-entered GST calculation worksheet"] > button { grid-column: 1 / -1; }
.segmented-gst-tax-lines { display: grid; gap: 10px; }
.segmented-gst-tax-lines fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; }
.segmented-gst-tax-lines legend { padding: 0 5px; font-weight: 600; }
.virtual-tally-dataset {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}
.virtual-tally-dataset > p { overflow-wrap: anywhere; }
.virtual-tally-dataset-id {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.virtual-tally-dataset-id code {
  user-select: text;
  overflow-wrap: anywhere;
  color: var(--text);
}
.virtual-tally-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.virtual-tally-preview {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.virtual-tally-source-controls {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-light);
}
.virtual-tally-source-controls > summary { cursor: pointer; font-weight: 600; }
.virtual-tally-source-controls[open] > summary { margin-bottom: 10px; }
.virtual-tally-control-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin: 12px 0;
}
.virtual-tally-control-form label { display: grid; gap: 5px; min-width: 0; font-size: 12px; }
.virtual-tally-control-form input {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
}
.virtual-tally-control-form button { justify-self: start; }
.virtual-tally-control-result { display: grid; gap: 10px; }
.virtual-tally-control-grid {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  font-size: 12px;
}
.virtual-tally-control-grid span { min-width: 0; padding: 8px; background: var(--panel); overflow-wrap: anywhere; }
.virtual-tally-control-grid span:nth-child(-n+3) { font-weight: 600; }
.virtual-tally-control-months { display: flex; flex-wrap: wrap; gap: 6px; max-height: 150px; overflow: auto; margin-top: 8px; }
.virtual-tally-control-months span { border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; font-size: 11px; }
.segmented-movement-reports { overflow-wrap: anywhere; }
.segmented-movement-reports select { min-width: 0; width: 100%; box-sizing: border-box; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); }
.segmented-movement-reports .virtual-tally-control-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segmented-report-result { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.segmented-report-totals { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented-report-totals span { display: grid; gap: 3px; min-width: 130px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.segmented-report-table-wrap { max-width: 100%; overflow-x: auto; }
.segmented-report-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.segmented-report-table th, .segmented-report-table td { padding: 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.segmented-report-table td:nth-child(4), .segmented-report-table td:nth-child(5) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.segmented-report-table small { display: block; max-width: 320px; color: var(--muted); overflow-wrap: anywhere; }
.segmented-balance-review { margin-top: 12px; }
.segmented-balance-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.segmented-balance-form > label { display: grid; gap: 5px; min-width: 0; font-size: 12px; }
.segmented-balance-form > label > input { min-width: 0; width: 100%; box-sizing: border-box; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); }
.segmented-balance-confirmations { display: grid; grid-column: 1 / -1; gap: 8px; }
.segmented-balance-confirmations label { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.45; }
.segmented-balance-confirmations input { flex: none; margin-top: 2px; }
.segmented-balance-form > button { justify-self: start; grid-column: 1 / -1; }
@media (max-width: 650px) { .segmented-balance-form { grid-template-columns: 1fr; } }
.virtual-tally-preview-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.virtual-tally-preview-search label {
  color: var(--muted);
  font-size: 12px;
}
.virtual-tally-preview-search input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
}
.virtual-tally-browse-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.virtual-tally-browse-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
}
.virtual-tally-browse-tabs button:hover, .virtual-tally-browse-tabs button:focus-visible {
  border-color: var(--accent);
}
.virtual-tally-browse-tabs button.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, var(--panel));
}
.virtual-tally-browse-tabs button span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.virtual-tally-workflow {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-light);
}
.virtual-tally-workflow h3, .virtual-tally-workflow p { margin: 0; }
.virtual-tally-workflow ol {
  display: grid;
  gap: 7px;
  margin: 10px 0;
  padding-left: 22px;
  font-size: 12px;
  line-height: 1.5;
}
.virtual-tally-books {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-light);
}
.virtual-tally-journal {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-light);
}
.virtual-tally-journal h4, .virtual-tally-journal p { margin: 0; }
.virtual-tally-journal-form, .virtual-tally-journal-lines, .virtual-tally-journal-list, .virtual-tally-journal-review, .virtual-tally-confirm {
  display: grid;
  gap: 10px;
}
.virtual-tally-journal-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.virtual-tally-journal label, .virtual-tally-confirm label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}
.virtual-tally-journal input, .virtual-tally-journal select {
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
}
.virtual-tally-wide { grid-column: 1 / -1; }
.virtual-tally-journal-line {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(110px, 1fr) minmax(120px, 1fr) auto;
  align-items: end;
  gap: 8px;
}
.virtual-tally-journal .virtual-tally-actions { align-items: center; }
.virtual-tally-journal .virtual-tally-actions .primary-btn { margin-left: auto; }
.virtual-tally-voucher-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}
.virtual-tally-journal-review {
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.virtual-tally-journal-review p { overflow-wrap: anywhere; }
.virtual-tally-confirm {
  justify-items: start;
}
.virtual-tally-confirm label { width: min(100%, 480px); }
.virtual-tally-confirm code { color: var(--text); }
.virtual-tally-books h4, .virtual-tally-books p { margin: 0; }
.virtual-tally-books-form {
  display: grid;
  grid-template-columns: minmax(125px, 1fr) minmax(125px, 1fr) minmax(180px, 2fr) auto;
  align-items: end;
  gap: 8px;
}
.virtual-tally-books-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}
.virtual-tally-books-form input, .virtual-tally-books-form select {
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
}
.virtual-tally-voucher {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px;
  background: var(--panel);
}
.virtual-tally-voucher summary { cursor: pointer; font-size: 12px; font-weight: 600; }
.virtual-tally-voucher p { margin: 8px 0; font-size: 11px; }
.virtual-tally-voucher .virtual-tally-table-wrap { margin-top: 8px; }
.virtual-tally-preview-group {
  display: grid;
  gap: 6px;
}
.virtual-tally-preview-group h4 { margin: 0; }
.virtual-tally-page-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}
.virtual-tally-page-controls .hint { margin-right: auto; }
.virtual-tally-page-controls .ghost-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.virtual-tally-head, .virtual-tally-scenario-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.virtual-tally-head h3, .virtual-tally-panel h3 { margin: 0; }
.virtual-tally-scenario-head > div { display: grid; gap: 4px; min-width: 0; }
.virtual-tally-source, .virtual-tally-scenario {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-light);
}
.virtual-tally-source { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.virtual-tally-source strong, .virtual-tally-source p { grid-column: 1 / -1; margin: 0; }
.virtual-tally-source span { font-size: 12px; overflow-wrap: anywhere; }
.virtual-tally-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.virtual-tally-facts span { display: grid; gap: 3px; font-size: 12px; overflow-wrap: anywhere; }
.virtual-tally-facts b { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.virtual-tally-table-wrap { overflow-x: auto; }
.virtual-tally-table-wrap table { min-width: 650px; }
.virtual-tally-table-wrap small { display: block; color: var(--muted); margin-top: 3px; }
.virtual-tally-total { font-size: 12px; line-height: 1.6; }
.virtual-tally-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.virtual-tally-summary-grid > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}
.virtual-tally-summary-grid span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.virtual-tally-summary-grid strong { overflow-wrap: anywhere; font-size: 15px; }
.virtual-tally-download { justify-self: start; }
@media (max-width: 750px) {
  .virtual-tally-source, .virtual-tally-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .virtual-tally-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .virtual-tally-import { grid-template-columns: 1fr; }
  .virtual-tally-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .virtual-tally-books-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .virtual-tally-books-form label:nth-child(3), .virtual-tally-books-form button { grid-column: 1 / -1; }
  .virtual-tally-journal-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .virtual-tally-journal-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .virtual-tally-journal-line label:first-child { grid-column: 1 / -1; }
  .virtual-tally-journal .virtual-tally-actions .primary-btn { margin-left: 0; }
}
@media (max-width: 420px) {
  .virtual-tally-summary-grid { grid-template-columns: 1fr; }
}

.document-card {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-light);
}

.document-status {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  font-size: 11px;
  text-transform: capitalize;
  white-space: nowrap;
}

.document-status.status-reviewed {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.45);
}

.document-status.status-invalid,
.document-status.status-needs_ocr {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.45);
}

.document-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.document-facts span {
  display: grid;
  gap: 3px;
  color: var(--text);
  font-size: 12px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.document-facts b {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.document-callout {
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 12px;
}

.document-callout.warn {
  background: rgba(245, 158, 11, 0.09);
  color: #fcd34d;
}

.document-callout.error {
  background: rgba(239, 68, 68, 0.09);
  color: #fca5a5;
}

.document-review-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.document-review-row select {
  min-width: 230px;
}

.document-empty {
  padding: 28px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

.document-draft-panel { min-width: 0; border-top: 1px solid var(--border); padding-top: 14px; }
.document-draft-panel input[type="checkbox"] { width: auto; margin-right: 6px; vertical-align: middle; }
.document-draft-panel label span { line-height: 1.5; }
.document-draft-preview { display: grid; gap: 10px; min-width: 0; }
.document-draft-preview .hint { overflow-wrap: anywhere; }
.document-draft-preview .primary-btn { justify-self: start; }
.document-command-review { display: grid; gap: 8px; min-width: 0; }
.document-command-review label { display: grid; gap: 7px; }
.document-command-review textarea { width: 100%; min-width: 0; box-sizing: border-box; resize: vertical; border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: var(--bg-panel, #142033); color: inherit; font: inherit; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.document-command-review .ghost-btn { justify-self: start; }

@media (max-width: 800px) {
  .document-intro,
  .document-review-row {
    align-items: stretch;
    flex-direction: column;
  }

  .document-facts {
    grid-template-columns: repeat(2, minmax(100px, 1fr));
  }

  .document-review-row select {
    width: 100%;
    min-width: 0;
  }
}

.settings-btn {
  background: var(--panel-light);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

/* ---------- Settings window ---------- */

.settings-app {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 24px 100px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-header h1 {
  margin: 0 0 4px;
}

.settings-header p {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}

.settings-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-section-title h2 {
  margin: 0;
  font-size: 15px;
}

.settings-section label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.settings-section input {
  font-size: 14px;
  color: var(--text);
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-footer {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-app a {
  color: var(--accent);
}

/* ---------- Campus scene ---------- */

.campus-scene {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.campus-hud {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 16px;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 8px 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  font-size: 13px;
  font-weight: 600;
  color: #263025;
  white-space: nowrap;
}

.campus-hud-brand {
  font-weight: 800;
  letter-spacing: 0.04em;
}

.campus-hud-stat.ok {
  color: #1e7a3c;
}

.campus-hud-stat.warn {
  color: #b45309;
}

.campus-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.campus-hut-active {
  cursor: pointer;
}

.campus-hut-active:hover {
  filter: brightness(1.04);
}

.campus-hut-muted {
  opacity: 0.65;
}

.campus-hut-label {
  font: 700 15px system-ui, sans-serif;
  fill: #1f2a1f;
}

.campus-hut-label.muted {
  fill: #5a6558;
}

.campus-hut-sublabel {
  font: 500 11px system-ui, sans-serif;
  fill: #55605a;
}

.campus-prop text {
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .campus-tree-canopy {
    transform-origin: center bottom;
    animation: campus-sway 4.5s ease-in-out infinite;
  }
  .campus-fern {
    transform-origin: bottom center;
    animation: campus-sway 3.6s ease-in-out infinite;
  }
  .campus-stream {
    animation: campus-stream-shift 6s ease-in-out infinite;
  }
  .campus-stream-glint {
    animation: campus-glint 2.4s ease-in-out infinite;
  }
  .campus-butterfly {
    animation: campus-flutter 5s ease-in-out infinite;
  }
  .campus-bird {
    animation: campus-fly 16s linear infinite;
    opacity: 0;
  }
  .campus-lantern circle {
    animation: campus-glow 2.6s ease-in-out infinite;
  }

  .campus-paused .campus-tree-canopy,
  .campus-paused .campus-fern,
  .campus-paused .campus-stream,
  .campus-paused .campus-stream-glint,
  .campus-paused .campus-butterfly,
  .campus-paused .campus-bird,
  .campus-paused .campus-lantern circle {
    animation-play-state: paused;
  }
}

@keyframes campus-sway {
  0%,
  100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(2deg);
  }
}
@keyframes campus-stream-shift {
  0%,
  100% {
    opacity: 0.9;
  }
  50% {
    opacity: 1;
  }
}
@keyframes campus-glint {
  0%,
  100% {
    transform: translateX(0);
    opacity: 0.3;
  }
  50% {
    transform: translateX(30px);
    opacity: 0.6;
  }
}
@keyframes campus-flutter {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(6px, -8px) rotate(8deg);
  }
  50% {
    transform: translate(-4px, -14px) rotate(-6deg);
  }
  75% {
    transform: translate(4px, -6px) rotate(6deg);
  }
}
@keyframes campus-fly {
  0% {
    transform: translate(-60px, 0);
    opacity: 0;
  }
  5% {
    opacity: 0.8;
  }
  45% {
    transform: translate(620px, -40px);
    opacity: 0.8;
  }
  50% {
    opacity: 0;
  }
  100% {
    transform: translate(1300px, -40px);
    opacity: 0;
  }
}
@keyframes campus-glow {
  0%,
  100% {
    opacity: 0.8;
    filter: drop-shadow(0 0 2px #ffd77a);
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 8px #ffd77a);
  }
}

/* ---------- Tally panel ---------- */

.tally-panel {
  background: #ffffff;
  border: 1px solid var(--border, #e3e5e8);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px;
  min-width: 200px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.tally-panel-title {
  font-weight: 700;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #333;
}

.tally-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.tally-dot-ok {
  background: #22c55e;
}

.tally-dot-fail {
  background: #ef4444;
}

.tally-dot-unknown {
  background: #9ca3af;
}

.tally-panel-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
  color: #444;
}

.tally-panel-muted {
  color: #888;
  font-style: italic;
}

.tally-panel-label {
  color: #888;
}

.tally-panel-value {
  font-weight: 600;
  text-align: right;
}

/* ---------- Employee panel ---------- */

.employee-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 6;
  background: #ffffff;
  border: 1px solid var(--border, #e3e5e8);
  border-radius: 12px;
  padding: 14px 16px;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.employee-panel-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  color: #888;
  line-height: 1;
}

.employee-panel-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.employee-panel-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #444;
  margin-bottom: 6px;
}

.employee-panel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.employee-panel-dot.dot-ok {
  background: #22c55e;
}

.employee-panel-dot.dot-busy {
  background: #f59e0b;
}

.employee-panel-dot.dot-off {
  background: #9ca3af;
}

.employee-panel-activity {
  font-size: 12px;
  color: #666;
  margin-bottom: 10px;
}

.employee-panel-actions {
  display: flex;
  gap: 8px;
}

.employee-panel-btn {
  flex: 1;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border, #e3e5e8);
  background: #f5f6f7;
  font-size: 12px;
  cursor: pointer;
}

.employee-panel-btn.primary {
  background: var(--accent, #3949ab);
  color: #fff;
  border-color: transparent;
}

.employee-panel-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* ---------- Command bar ---------- */

.command-bar-wrap {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 6;
  width: min(640px, 90%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.command-bar-reply {
  background: #ffffff;
  border: 1px solid var(--border, #e3e5e8);
  border-radius: 10px;
  padding: 10px 14px;
  max-height: 160px;
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.command-bar-reply pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 12.5px;
  color: #333;
}

.command-bar {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--border, #e3e5e8);
  border-radius: 999px;
  padding: 6px 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
}

.command-bar-target {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 40%;
  border: none;
  background: #f2f3f4;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}

.command-bar-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 13.5px;
  padding: 6px 4px;
}

.command-bar-mic {
  flex: none;
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: not-allowed;
  opacity: 0.5;
}

.command-bar-send {
  flex: none;
  border: none;
  background: var(--accent, #3949ab);
  color: #fff;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.command-bar-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Activity feed ---------- */

.activity-feed {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 6;
  width: 260px;
}

.activity-feed-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--border, #e3e5e8);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.activity-feed-count {
  background: #eef0f1;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
}

.activity-feed-caret {
  margin-left: auto;
  color: #888;
}

.activity-feed-list {
  margin-top: 6px;
  background: #ffffff;
  border: 1px solid var(--border, #e3e5e8);
  border-radius: 10px;
  padding: 8px 10px;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.activity-feed-empty {
  font-size: 12px;
  color: #888;
  padding: 6px 2px;
}

.activity-feed-item {
  font-size: 12px;
  color: #444;
  padding: 5px 2px;
  border-bottom: 1px solid #f0f1f2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.activity-feed-item:last-child {
  border-bottom: none;
}

.activity-feed-item strong {
  color: #222;
}

.activity-feed-time {
  margin-left: auto;
  color: #999;
  font-size: 11px;
}

/* ---------- Finance hut transition ---------- */

.finance-hut-enter {
  animation: hut-enter 0.5s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .finance-hut-enter {
    animation: none;
  }
}

@keyframes hut-enter {
  0% {
    opacity: 0;
    transform: scale(1.06);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
.virtual-tally-source-options { grid-column: 1 / -1; max-height: 260px; overflow: auto; border: 1px solid #536278; border-radius: 8px; padding: 12px; }
.virtual-tally-source-options label { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; }
.virtual-tally-source-options input[type="checkbox"] { width: auto; flex: 0 0 auto; margin-top: 3px; }

/* Owner's daily accounting workspace. Scoped: the animated office retains its theme. */
.accounting-dashboard {
  --bg: #f4f7fa; --panel: #ffffff; --panel-light: #f4f7fa; --border: #dce4eb;
  --text: #192d3d; --muted: #596f80; --accent: #087f82;
  display: grid; grid-template-columns: 224px minmax(0, 1fr);
  gap: 0; padding: 0; min-height: 0; min-width: 0; overflow: hidden;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.accounting-sidebar { display: flex; flex-direction: column; min-height: 0; padding: 28px 16px 18px; background: #142b3b; color: #eaf3f8; overflow-y: auto; }
.accounting-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.accounting-brand > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #15a6a0; color: white; font-size: 23px; font-weight: 800; }
.accounting-brand strong { display: block; font-size: 17px; letter-spacing: -.3px; }
.accounting-brand small { display: block; color: #a7becb; font-size: 12px; margin-top: 4px; }
.accounting-nav { display: grid; gap: 8px; }
.accounting-nav-item { display: flex; align-items: center; gap: 12px; padding: 13px 12px; width: 100%; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #c3d5df; text-align: left; cursor: pointer; }
.accounting-nav-item:hover { background: #203e51; }
.accounting-nav-item.active { background: #245364; border-color: #367588; color: #fff; }
.accounting-nav-item strong { display: block; font-size: 14px; font-weight: 600; }
.accounting-nav-item small { display: block; margin-top: 4px; font-size: 11px; color: #b4cbd5; line-height: 1.5; }
.accounting-nav-icon { font-size: 21px; width: 24px; text-align: center; flex: none; }
.accounting-secondary-nav { margin: 20px 8px; color: #b4cbd5; font-size: 12px; }
.accounting-secondary-nav summary { cursor: pointer; padding: 6px 0; }
.accounting-secondary-nav button { display: block; border: 0; background: transparent; color: #c3d5df; text-align: left; padding: 9px 0; cursor: pointer; font: inherit; }
.accounting-sidebar-note { margin-top: auto; padding: 16px 10px; font-size: 12px; line-height: 1.6; color: #a7becb; }
.accounting-sidebar-note strong { color: #cfe6e9; }
.accounting-sidebar-note p { margin: 5px 0 0; }
.accounting-sidebar .accounting-back { color: #eaf3f8; border-color: #3c5667; }
.accounting-main { min-width: 0; min-height: 0; overflow-y: auto; padding: 28px 32px 48px; scrollbar-gutter: stable; }
.accounting-page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 auto 25px; max-width: 1320px; }
.accounting-page-header h2 { margin: 5px 0 0; font-size: 27px; letter-spacing: -.6px; }
.accounting-eyebrow { margin: 0; font-size: 10px; font-weight: 750; letter-spacing: 1.6px; color: #567481; }
.accounting-mode { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #516b7a; background: #e9f1f4; padding: 9px 12px; border-radius: 999px; }
.accounting-mode i { width: 6px; height: 6px; background: #477f90; border-radius: 50%; }
.accounting-main > .panel, .accounting-overview { max-width: 1320px; margin: 0 auto; }
.accounting-overview { display: grid; gap: 24px; }
.accounting-welcome { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 5px 0 0; }
.accounting-welcome h1 { margin: 12px 0; font-size: clamp(25px, 2.7vw, 36px); letter-spacing: -1.1px; line-height: 1.2; }
.accounting-welcome p:not(.accounting-eyebrow) { color: #5c7381; max-width: 650px; line-height: 1.7; margin: 0; font-size: 14px; }
.accounting-welcome-mark { flex: none; position: relative; width: 90px; height: 90px; display: grid; place-items: center; border-radius: 24px; background: #e1eeed; color: #087f82; font-size: 60px; }
.accounting-welcome-mark span { position: absolute; right: -7px; bottom: 0; width: 30px; height: 30px; border: 4px solid #f4f7fa; border-radius: 50%; background: #142b3b; color: white; font-size: 20px; display: grid; place-items: center; }
.accounting-dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 28px 20px; border: 2px dashed #a5cecf; border-radius: 16px; background: #f9fdfd; min-width: 0; }
.accounting-dropzone--dragging { background: #e0f5f1; border-color: #087f82; box-shadow: 0 0 0 4px #d4ebe9; }
.accounting-dropzone--disabled { opacity: .72; }
.accounting-dropzone-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: #e5f3f1; color: #087f82; font-size: 29px; font-weight: 700; }
.accounting-dropzone-title { margin: 3px 0 0; color: #223d4a; font-size: 20px; letter-spacing: -.4px; }
.accounting-dropzone-description { margin: 0; color: #607884; font-size: 12px; line-height: 1.7; max-width: 720px; }
.accounting-dropzone-hint { margin: 0; color: #637b86; font-size: 12px; }
.accounting-dropzone-button { background: #087f82; border: 0; color: white; border-radius: 8px; padding: 10px 22px; cursor: pointer; font-weight: 650; margin-top: 6px; font-size: 13px; }
.accounting-dropzone-button:disabled { opacity: .55; cursor: not-allowed; }
.accounting-dropzone-selected, .accounting-dropzone-status { font-size: 13px; margin: 5px 0 0; color: #275f68; overflow-wrap: anywhere; max-width: 100%; }
.accounting-dropzone-error { font-size: 13px; margin: 8px 0 0; color: #a12d3b; background: #fff1f3; border-radius: 6px; padding: 8px 12px; overflow-wrap: anywhere; max-width: 100%; }
.accounting-upload-result { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 16px; border: 1px solid #c3e2d8; border-radius: 10px; background: #edf8f3; color: #2b6654; line-height: 1.6; }
.accounting-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.accounting-metrics button { border: 1px solid #e0e7ec; border-radius: 12px; padding: 18px 20px; background: white; text-align: left; cursor: pointer; min-width: 0; }
.accounting-metrics span { display: block; color: #4b6575; font-size: 13px; }
.accounting-metrics strong { display: block; font-size: 29px; color: #203747; margin: 9px 0; }
.accounting-metrics small { display: block; color: #67808f; font-size: 11px; line-height: 1.5; }
.accounting-section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.accounting-section-heading h3 { margin: 0; font-size: 17px; }
.accounting-section-heading h3 small { font-size: 12px; font-weight: 400; color: var(--muted); }
.accounting-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.accounting-action-grid button { padding: 22px; background: white; border: 1px solid #e0e7ec; border-radius: 12px; text-align: left; cursor: pointer; color: #253d4e; min-width: 0; transition: border-color .15s, transform .15s; }
.accounting-action-grid button:hover { border-color: #77b3b4; transform: translateY(-2px); }
.accounting-action-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #087f82; background: #eaf5f2; font-size: 24px; margin-bottom: 16px; }
.accounting-action-grid strong { display: block; font-size: 15px; }
.accounting-action-grid p { font-size: 12px; line-height: 1.75; color: #647c8a; margin: 8px 0 14px; }
.accounting-action-grid button > span:last-child { font-size: 12px; color: #087f82; font-weight: 650; }
.accounting-simple-note { color: #5d7482; font-size: 12px; line-height: 1.7; margin: 0; }
.accounting-dashboard .panel { border-radius: 14px; padding: 22px; border-color: #e0e7ec; }
.accounting-dashboard .hint { font-size: 12px; line-height: 1.6; }
.accounting-dashboard input, .accounting-dashboard select { min-width: 0; font-size: 13px; }
.accounting-dashboard textarea { background: var(--panel); color: var(--text); border-color: var(--border); }
.accounting-dashboard .document-command-review textarea { background: var(--panel); color: var(--text); }
.accounting-dashboard textarea:focus-visible { outline: 2px solid #0f898b; outline-offset: 2px; }
.accounting-dashboard input:focus-visible, .accounting-dashboard select:focus-visible { outline: 2px solid #0f898b; outline-offset: 2px; }
.accounting-dashboard button:focus-visible, .accounting-dashboard summary:focus-visible { outline: 2px solid #0f898b; outline-offset: 3px; }
.accounting-dashboard button.primary-btn { color: white; border-radius: 8px; }
.accounting-dashboard button.ghost-btn { border-color: #d3dfe6; background: white; font-size: 12px; }
.accounting-dashboard .accounting-sidebar button.ghost-btn { background: transparent; border-color: #3c5667; }
.accounting-dashboard .document-safety-strip { background: #edf8f3; color: #2a6454; border-color: #c7e2d7; line-height: 1.7; }
.accounting-tally-pilot { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 15px 0 20px; padding: 19px 21px; border: 1px solid #c7e2d7; border-radius: 12px; background: #f4faf7; color: #294e46; }
.accounting-tally-pilot h4 { margin: 6px 0; font-size: 17px; color: #21483c; }
.accounting-tally-pilot p { margin: 0 0 7px; max-width: 850px; line-height: 1.6; font-size: 13px; }
.accounting-tally-pilot small { display: block; color: #49695d; line-height: 1.5; font-size: 11px; }
.accounting-tally-pilot-link { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 13px; border: 1px solid #8dc8af; border-radius: 8px; color: #1f644b; background: #fff; text-decoration: none; font-size: 12px; font-weight: 650; }
.accounting-tally-pilot-link:hover { background: #e7f5ec; }
.accounting-tally-pilot-link:focus-visible { outline: 2px solid #0f898b; outline-offset: 3px; }
.accounting-dashboard .document-callout { background: #f2f7fa; border-color: #d8e4eb; color: #39576a; line-height: 1.7; }
.accounting-dashboard .document-callout.warn { background: #fff7e6; border-color: #ead6a8; color: #80601f; }
.accounting-dashboard .document-callout.error, .accounting-dashboard .error-msg { background: #fff1f3; border-color: #f0c9d1; color: #a12d3b; }
.accounting-dashboard .document-card { background: white; border-color: #dce4eb; padding: 17px 20px; border-radius: 10px; }
.accounting-dashboard .document-card-head { flex-wrap: wrap; }
.accounting-dashboard .document-status { font-size: 11px; }
.accounting-dashboard .document-status.status-reviewed { color: #246248; background: #edf8f2; border-color: #bedfcb; }
.accounting-dashboard .document-status.status-invalid,
.accounting-dashboard .document-status.status-needs_ocr { color: #a12d3b; background: #fff1f3; border-color: #edc3cb; }
.accounting-document-review { margin-top: 13px; border-top: 1px solid #e5ebf0; padding-top: 10px; }
.accounting-document-review > summary { color: #087f82; font-size: 13px; font-weight: 650; cursor: pointer; }
.accounting-document-review > summary span { float: right; }
.accounting-document-review[open] > summary { margin-bottom: 16px; }
.accounting-document-review > *:not(summary) { margin-bottom: 12px; }
.accounting-advanced, .accounting-dashboard .virtual-tally-dataset > details { border: 1px solid #dfe7ed; border-radius: 9px; padding: 12px 15px; background: #fbfcfd; color: #31495f; }
.accounting-advanced > summary, .accounting-dashboard .virtual-tally-dataset > details > summary { color: #496877; font-size: 13px; font-weight: 600; cursor: pointer; }
.accounting-advanced[open] > summary, .accounting-dashboard .virtual-tally-dataset > details[open] > summary { margin-bottom: 16px; }
.accounting-dashboard .virtual-tally-preview-group, .accounting-dashboard .virtual-tally-journal, .accounting-dashboard .virtual-tally-books { background: #f9fbfc; border-color: #dce4eb; color: var(--text); }
.accounting-dashboard .virtual-tally-table-wrap { max-width: 100%; overflow-x: auto; }
.accounting-dashboard .data-table { font-size: 13px; }
.accounting-dashboard .data-table th { background: #f2f6f8; color: #496674; font-weight: 600; padding: 12px; }
.accounting-dashboard .data-table td { padding: 11px 12px; }
.accounting-dashboard .data-table tbody tr:hover { background: #f8fbfc; }
.accounting-dashboard .virtual-tally-dataset { border-color: #dce4eb; background: white; border-radius: 12px; padding: 18px; }
.segmented-source-evidence { min-width: 0; margin-top: 6px; }
.segmented-source-evidence > summary { cursor: pointer; }
.segmented-source-evidence > .hint { margin: 12px 0; }
.segmented-source-evidence-page { min-width: 0; margin-top: 14px; border-top: 1px solid #dfe7ed; padding-top: 12px; }
.segmented-source-evidence-page code { overflow-wrap: anywhere; }
.segmented-source-evidence-page ol { margin: 12px 0; padding-left: 28px; }
.segmented-source-evidence-page ol > li { margin: 0 0 16px; overflow-wrap: anywhere; }
.segmented-source-evidence-page ul { margin: 8px 0; padding-left: 22px; }
.segmented-source-evidence-page .virtual-tally-actions { margin-top: 10px; }
.accounting-dashboard .virtual-tally-overview > div { background: #f4f8fa; }
.accounting-dashboard .virtual-tally-badge { background: #eaf3f4; color: #426874; border-color: #c8dce1; }
.accounting-dashboard .virtual-tally-import { gap: 14px; }
.accounting-dashboard .virtual-tally-import label { font-size: 12px; }
.accounting-dashboard .virtual-tally-import .accounting-dropzone { grid-column: 1 / -1; }
.accounting-dashboard .document-empty { border: 1px dashed #cfdae3; border-radius: 10px; color: #627b8a; padding: 34px; text-align: center; }
@media (max-width: 1100px) {
  .accounting-dashboard { grid-template-columns: 196px minmax(0, 1fr); }
  .accounting-main { padding: 24px 20px 40px; }
  .accounting-mode { max-width: 195px; border-radius: 9px; line-height: 1.5; }
  .accounting-action-grid button { padding: 17px; }
}
@media (max-width: 760px) {
  .accounting-tally-pilot { flex-direction: column; align-items: stretch; padding: 16px; }
  .virtual-tally-control-form { grid-template-columns: minmax(0, 1fr); }
  .segmented-movement-reports .virtual-tally-control-form { grid-template-columns: minmax(0, 1fr); }
  .accounting-dashboard { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .accounting-sidebar { padding: 10px 12px; overflow: visible; }
  .accounting-brand, .accounting-sidebar-note { display: none; }
  .accounting-nav { display: flex; overflow-x: auto; gap: 5px; padding: 3px; }
  .accounting-nav-item { width: auto; white-space: nowrap; padding: 10px; flex: none; }
  .accounting-nav-item small, .accounting-nav-icon { display: none; }
  .accounting-nav-item strong { font-size: 12px; }
  .accounting-secondary-nav { margin: 5px; }
  .accounting-secondary-nav button { display: inline-block; margin-right: 16px; }
  .accounting-back { align-self: flex-start; padding: 5px 8px !important; font-size: 11px !important; }
  .accounting-main { padding: 20px 14px 36px; }
  .accounting-page-header { align-items: flex-start; margin-bottom: 20px; }
  .accounting-page-header h2 { font-size: 23px; }
  .accounting-mode { max-width: 150px; font-size: 10px; padding: 7px 9px; }
  .accounting-welcome-mark { display: none; }
  .accounting-overview { gap: 18px; }
  .accounting-dropzone { padding: 24px 14px; }
  .accounting-dropzone-title { font-size: 18px; }
  .accounting-metrics, .accounting-action-grid { grid-template-columns: 1fr; gap: 12px; }
  .accounting-metrics button { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 16px; }
  .accounting-metrics strong { grid-column: 2; grid-row: 1 / 3; margin: 0; align-self: center; }
  .accounting-upload-result { flex-direction: column; align-items: flex-start; }
  .accounting-dashboard .panel { padding: 16px; }
  .accounting-section-heading input { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .accounting-action-grid button { transition: none; }
  .accounting-action-grid button:hover { transform: none; }
}

.browser-office-access-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 24px;
  background: rgba(5, 12, 24, .92);
}
.browser-office-access-panel {
  width: min(100%, 620px);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: 28px;
  border: 1px solid #3b526e;
  border-radius: 16px;
  background: #142033;
  color: #ecf2fa;
  box-shadow: 0 16px 64px #0008;
}
.browser-office-access-panel h1 { margin-top: 0; font-size: 24px; }
.browser-office-access-panel p { line-height: 1.6; }
