:root {
  --navy: #1b2440;
  --ink: #1f2a44;
  --ink-soft: #5b6782;
  --line: #d9e2ee;
  --paper: #ffffff;
  --paper-2: #f4f7fb;
  --blue: #2f8cff;
  --blue-deep: #1f6fd6;
  --yellow: #ffcc33;
  --yellow-deep: #e0a800;
  --st-pending: #f5a524;
  --st-in_progress: #2f8cff;
  --st-waiting: #9b6bff;
  --st-done: #22b45f;
  --st-cancelled: #7a8496;
  --st-overdue: #ef4444;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 48, 0.08), 0 8px 24px rgba(16, 24, 48, 0.14);
  --pixel: 'Nunito', system-ui, 'Segoe UI', sans-serif;
  --ui: 'Nunito', system-ui, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--navy); }
body { font-family: var(--ui); color: var(--ink); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
kbd {
  font-family: var(--pixel);
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* ------------------------------------------------------------ game + overlay */
#game { position: fixed; inset: 0; overflow: hidden; }
#game::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(ellipse at 50% 45%, transparent 58%, rgba(12, 18, 40, 0.26) 100%);
}
#game canvas { display: block; image-rendering: crisp-edges; }
#world-overlay {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  pointer-events: none; z-index: 2; will-change: transform;
}
.ov-room > *, .ov-people > * { position: absolute; }

.wall-sign {
  display: flex; align-items: baseline; gap: 10px;
  font-family: var(--pixel); color: #2b3a67; white-space: nowrap;
}
.wall-sign b { font-size: 34px; font-weight: 700; letter-spacing: 3px; color: #1f6fd6; text-shadow: 3px 3px 0 #bfe1ff; }
.wall-sign span { font-size: 18px; color: #6a5a3f; }

.floor-label {
  transform: translateX(-50%);
  font-family: var(--pixel); font-size: 18px; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(80, 48, 18, 0.45);
}

/* Desk name tags */
.desk-tag {
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  pointer-events: auto; min-width: 150px;
}
.desk-name {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-family: var(--pixel); font-size: 15px; font-weight: 600; line-height: 1;
  padding: 5px 10px 6px 8px; border-radius: 999px; cursor: pointer;
  color: var(--ink); background: #fff; border: 1px solid #1f2a44;
  box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14);
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.desk-name::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--st-done); box-shadow: 0 0 0 2px rgba(34, 180, 95, 0.25);
}
.desk-pts { color: #b07d00; font-weight: 700; }
.desk-role {
  font-size: 12px; padding: 2px 7px; border-radius: 999px; color: #fff;
  background: linear-gradient(90deg, #6c4bd6, #ff4fd8);
}
.desk-tag.hover .desk-name, .desk-name:hover { transform: translateY(-3px); border-color: var(--blue-deep); box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14); }
.desk-tag[data-level="1"] .desk-name { background: #fff4dc; border-color: #b06a00; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14); }
.desk-tag[data-level="1"] .desk-name::before { background: var(--st-pending); box-shadow: 0 0 0 2px rgba(245, 165, 36, 0.3); }
.desk-tag[data-level="2"] .desk-name {
  color: #fff; background: #d62f2f; border-color: #6e1010; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14);
  animation: alarm 0.9s steps(2, jump-none) infinite;
}
.desk-tag[data-level="2"] .desk-name::before { background: #fff; box-shadow: none; }
.desk-tag[data-level="2"] .desk-pts { color: #ffe58a; }

/* Developer's gamer desk */
.desk-tag.dev .desk-name {
  color: #e9f6ff; background: #1a1430; border-color: #6c4bd6;
  box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14), 0 0 14px rgba(108, 75, 214, 0.55);
}
.desk-tag.dev .desk-name::before { display: none; }
.desk-tag.dev.empty .desk-role { background: #4a4366; }
.desk-tag.dev .desk-pts { color: #25e3c4; }
.desk-tag.dev.hover .desk-name, .desk-tag.dev .desk-name:hover { border-color: #25e3c4; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14), 0 0 18px rgba(37, 227, 196, 0.6); }
.neon-sign {
  transform: translateX(-50%); display: flex; align-items: baseline; gap: 10px; white-space: nowrap;
  font-family: var(--pixel); font-weight: 700; padding: 4px 12px 6px; border-radius: 8px;
  background: #140f26; border: 1px solid #3b2a63; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14);
}
.neon-sign .n1 { font-size: 18px; color: #25e3c4; text-shadow: 0 0 6px #25e3c4, 0 0 14px #25e3c4; }
.neon-sign .n2 { font-size: 18px; letter-spacing: 3px; color: #ff9cf0; text-shadow: 0 0 6px #ff4fd8, 0 0 16px #ff4fd8; animation: neon 6s infinite; }
@keyframes neon { 0%, 92%, 96%, 100% { opacity: 1; } 94% { opacity: 0.35; } }
.seat-prompt {
  transform: translateX(-50%); pointer-events: auto; cursor: default; white-space: nowrap;
  font-family: var(--pixel); font-size: 15px; font-weight: 700; padding: 6px 12px 7px; border-radius: 10px;
  color: #fff; background: rgba(20, 28, 56, 0.88); border: 1px solid #3b4a78;
}
.seat-prompt.can-sit {
  cursor: pointer; color: #1a1430; background: #25e3c4; border-color: #0f8f7b; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14);
  animation: bob 1s ease-in-out infinite;
}
@keyframes bob { 50% { translate: 0 -4px; } }
@keyframes alarm { 50% { background: #ff5a47; } }

.desk-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 230px; cursor: pointer; }
.chip {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--pixel); font-size: 13px; font-weight: 600; line-height: 1;
  padding: 3px 6px 4px; border-radius: 6px; color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.25);
}
.chip i { font-style: normal; font-size: 11px; opacity: 0.95; }
.st-pending.chip { background: var(--st-pending); color: #3a2400; }
.st-in_progress.chip { background: var(--st-in_progress); }
.st-waiting.chip { background: var(--st-waiting); }
.st-done.chip { background: var(--st-done); }
.st-cancelled.chip { background: var(--st-cancelled); }
.st-overdue.chip { background: var(--st-overdue); }
.st-free.chip { background: #e7f6ff; color: #23608f; border-color: #a9d3ef; }

/* Central board screen (inside the pixel-art TV) */
.board-screen {
  pointer-events: auto; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 7px; padding: 8px 10px;
  background: transparent; border: 0; border-radius: 2px;
  color: #dbe7ff; font-family: var(--pixel);
}
.board-screen:hover { background: rgba(47, 140, 255, 0.12); }
.board-screen:focus-visible { outline: 3px solid var(--yellow); }
.bs-head { display: flex; justify-content: space-between; align-items: center; }
.bs-title { font-size: 14px; font-weight: 700; letter-spacing: 1.5px; color: #8fc3ff; }
.bs-alarm { font-size: 12px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: #1d6b3f; color: #c9ffdd; }
.board-screen[data-level="1"] .bs-alarm { background: #8a5a12; color: #ffe4b0; }
.board-screen[data-level="2"] .bs-alarm { background: #c62828; color: #fff; animation: alarm 0.9s steps(2, jump-none) infinite; }
.bs-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kpi { display: flex; flex-direction: column; align-items: center; background: #13213d; border-radius: 4px; padding: 4px 0 3px; }
.kpi b { font-size: 26px; line-height: 1; color: #fff; }
.kpi span { font-size: 11px; color: #9fb3d9; }
.kpi.warn b { color: var(--st-pending); }
.kpi.bad b { color: #ff6b6b; }
.bs-bar { display: flex; height: 9px; border-radius: 2px; overflow: hidden; background: #22314f; }
.bs-bar i { display: block; min-width: 3px; }
.bs-foot { font-size: 11px; color: #7f93bb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Ranking whiteboard */
.ranking-board {
  pointer-events: auto; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 2px; padding: 6px 9px;
  background: transparent; border: 0; font-family: var(--pixel); color: #23304f;
}
.ranking-board:hover { background: rgba(47, 140, 255, 0.07); }
.ranking-board:focus-visible { outline: 3px solid var(--blue); }
.rk-title { font-size: 13px; font-weight: 700; letter-spacing: 1px; color: #e8459b; margin-bottom: 2px; }
.rk-row { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 6px; font-size: 14px; line-height: 1.15; }
.rk-pos { font-weight: 700; color: #fff; background: #9aa6b8; border-radius: 4px; text-align: center; font-size: 12px; }
.rk-1 .rk-pos { background: #e0a800; }
.rk-2 .rk-pos { background: #8f9bb0; }
.rk-3 .rk-pos { background: #c07a3e; }
.rk-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-pts { font-weight: 700; color: #1f6fd6; }
.rk-empty { font-size: 13px; color: #8a96aa; }

/* Visitors */
.player-tag { left: 0; top: 0; display: flex; flex-direction: column; align-items: center; width: 0; overflow: visible; }
.player-name {
  transform: translateX(0); white-space: nowrap;
  font-family: var(--pixel); font-size: 14px; font-weight: 600; line-height: 1;
  padding: 3px 7px 4px; border-radius: 7px; color: #fff; background: rgba(20, 28, 56, 0.82);
}
.player-tag.me .player-name { background: var(--blue-deep); box-shadow: 0 0 0 2px #fff; }
.bubble {
  position: absolute; bottom: 26px; white-space: normal; width: max-content; max-width: 220px;
  font-family: var(--ui); font-weight: 700; font-size: 14px; line-height: 1.25;
  padding: 7px 11px; border-radius: 14px; background: #fff; color: var(--ink);
  border: 1px solid #1f2a44; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14);
}
.bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -8px; margin-left: -6px;
  border: 6px solid transparent; border-top-color: #1f2a44; border-bottom: 0;
}

.float-points {
  transform: translateX(-50%);
  font-family: var(--pixel); font-size: 26px; font-weight: 700; color: var(--yellow);
  text-shadow: 2px 2px 0 #6b3f00, -2px -2px 0 #6b3f00, 2px -2px 0 #6b3f00, -2px 2px 0 #6b3f00;
  animation: floatUp 1.8s ease-out forwards;
}
@keyframes floatUp {
  0% { opacity: 0; translate: 0 10px; }
  15% { opacity: 1; translate: 0 0; }
  100% { opacity: 0; translate: 0 -70px; }
}

/* ------------------------------------------------------------ HUD */
.hud-top {
  position: fixed; top: 12px; left: 12px; right: 12px; z-index: 10;
  display: flex; align-items: center; gap: 12px; pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.brand {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  background: var(--paper); border-radius: var(--radius); padding: 8px 12px 8px 10px;
  box-shadow: var(--shadow); border: 1px solid #c8d6ea;
}
.logo {
  width: 32px; height: 32px; flex: none; border-radius: 8px;
  background:
    linear-gradient(#ffcc33, #ffcc33) 9px 9px / 6px 10px no-repeat,
    linear-gradient(#22b45f, #22b45f) 18px 14px / 5px 5px no-repeat,
    linear-gradient(#2f8cff, #2f8cff) 5px 5px / 22px 18px no-repeat,
    linear-gradient(#30364f, #30364f) 13px 24px / 6px 5px no-repeat,
    #30364f;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { font-family: var(--pixel); font-size: 19px; font-weight: 700; line-height: 1.05; color: var(--ink); }
.brand-text small { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.live {
  flex: none; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.6px;
  padding: 4px 8px 4px 20px; border-radius: 999px; position: relative; color: #fff; background: var(--st-cancelled);
}
.live::before {
  content: ''; position: absolute; left: 8px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 50%; background: #fff;
}
.live[data-state="live"] { background: var(--st-done); }
.live[data-state="live"]::before { animation: pulse 1.6s ease-in-out infinite; }
.live[data-state="demo"] { background: var(--st-waiting); }
.live[data-state="error"] { background: var(--st-pending); color: #3a2400; }
.live[data-state="error"]::before { background: #3a2400; }
.live[data-state="offline"] { background: var(--st-overdue); }
@keyframes pulse { 50% { opacity: 0.25; } }

.kpis { display: flex; gap: 8px; margin: 0 auto; }
.kpi-pill {
  display: flex; align-items: baseline; gap: 6px; padding: 7px 12px; border-radius: 12px;
  background: var(--paper); box-shadow: var(--shadow); border: 1px solid #c8d6ea; white-space: nowrap;
}
.kpi-pill b { font-family: var(--pixel); font-size: 22px; line-height: 1; color: var(--ink); }
.kpi-pill span { font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.kpi-pill.warn { border-color: var(--st-pending); }
.kpi-pill.warn b { color: #c47d00; }
.kpi-pill.bad { border-color: var(--st-overdue); }
.kpi-pill.bad b { color: #d62f2f; }
.kpi-pill.good b { color: #178a47; }

.hud-actions { display: flex; align-items: center; gap: 8px; }
.online {
  display: flex; align-items: center; gap: 2px; padding: 5px 10px 5px 6px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.95); box-shadow: var(--shadow); font-size: 12px; font-weight: 800; color: var(--ink-soft);
  white-space: nowrap;
}
.online:empty { display: none; }
.online .mini { width: auto; height: 21px; margin-right: 1px; }
.online span { margin-left: 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap;
  font-weight: 900; font-size: 14px; padding: 9px 14px; border-radius: 12px;
  color: #fff; background: var(--blue); border: 1px solid #1553a8; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:hover { background: #4a9dff; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14); }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.btn-yellow { color: #3d2a00; background: var(--yellow); border-color: #a87b00; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14); }
.btn-yellow:hover { background: #ffd95c; }
.btn-yellow:active { box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14); }
.btn-ghost { color: var(--ink); background: #fff; border-color: #b9c6da; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14); }
.btn-ghost:hover { background: #f1f6fd; }
.join-btn { display: none; }
body:not(.joined) .join-btn { display: inline-flex; }

.legend {
  position: fixed; left: 12px; bottom: 12px; z-index: 10;
  display: flex; flex-wrap: wrap; gap: 6px; max-width: min(760px, calc(100vw - 24px));
  padding: 8px 10px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.95); box-shadow: var(--shadow);
}
.lg { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; color: var(--ink); }
.lg i {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px;
  font-style: normal; font-size: 10px; color: #fff; background: var(--c, #999);
}
.lg.st-pending i { --c: var(--st-pending); color: #3a2400; }
.lg.st-in_progress i { --c: var(--st-in_progress); }
.lg.st-waiting i { --c: var(--st-waiting); }
.lg.st-done i { --c: var(--st-done); }
.lg.st-cancelled i { --c: var(--st-cancelled); }
.lg.st-overdue i { --c: var(--st-overdue); }
.lg.lg-fire i { --c: #ffe3cf; font-size: 12px; }
.lg + .lg { padding-left: 6px; border-left: 1px solid var(--line); }

.hint {
  position: fixed; right: 12px; bottom: 12px; z-index: 9; max-width: 460px;
  font-size: 12px; font-weight: 700; color: #dfe8ff; text-align: right; line-height: 1.7;
  padding: 6px 12px; border-radius: 12px; background: rgba(20, 28, 56, 0.72);
}

/* ------------------------------------------------------------ Toasts */
.toasts {
  position: fixed; left: 12px; top: 80px; z-index: 20;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start; pointer-events: none;
}
.toast {
  max-width: 380px; padding: 10px 14px; border-radius: 12px;
  font-size: 14px; font-weight: 800; line-height: 1.3;
  background: #fff; color: var(--ink); border-left: 6px solid var(--blue); box-shadow: var(--shadow);
  animation: toastIn 0.25s ease-out;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.toast-good { border-left-color: var(--st-done); }
.toast-warn { border-left-color: var(--st-pending); }
.toast.out { opacity: 0; transform: translateX(-20px); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-30px); } }

/* ------------------------------------------------------------ Chat */
.chat { position: fixed; left: 50%; bottom: 70px; z-index: 30; transform: translateX(-50%); width: min(520px, calc(100vw - 32px)); }
.chat input {
  width: 100%; font: inherit; font-size: 16px; font-weight: 700; padding: 12px 16px;
  border-radius: 14px; border: 3px solid var(--blue); background: #fff; box-shadow: var(--shadow); outline: none;
}

/* ------------------------------------------------------------ Side panel */
.panel {
  position: fixed; top: 76px; right: 12px; bottom: 64px; z-index: 15;
  width: min(480px, calc(100vw - 24px));
  display: flex; flex-direction: column;
  background: var(--paper); border-radius: 18px; border: 3px solid #1f3d6e;
  box-shadow: var(--shadow); overflow: hidden;
  transform: translateX(calc(100% + 30px)); transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.panel.open { transform: none; }
.panel-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px;
  background: linear-gradient(180deg, #3aa0ff, #1f6fd6); color: #fff;
  border-bottom: 3px solid #1f3d6e;
}
.panel-head .avatar { width: auto; height: 64px; flex: none; background: rgba(255, 255, 255, 0.18); border-radius: 10px; padding: 4px; }
.ph-icon { width: 52px; height: 52px; flex: none; display: grid; place-items: center; font-size: 30px; background: rgba(255, 255, 255, 0.2); border-radius: 12px; }
.ph-text { flex: 1; min-width: 0; }
.ph-text h2 { margin: 0; font-family: var(--pixel); font-size: 24px; font-weight: 700; line-height: 1.1;  }
.ph-sub { margin: 3px 0 0; font-size: 13px; font-weight: 700; opacity: 0.92; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.badge { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: #fff3c4; color: #6b4b00; white-space: nowrap; }
.panel-head .badge { background: rgba(255, 255, 255, 0.95); }
.close {
  flex: none; align-self: flex-start; width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  font-size: 16px; font-weight: 900; background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.4); color: #fff;
}
.close:hover { background: rgba(255, 255, 255, 0.35); }

.pressure { padding: 12px 16px 10px; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.pr-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.pr-top b { font-weight: 900; }
.pr-top span { color: var(--ink-soft); font-weight: 700; }
.pressure.lvl-0 .pr-top b { color: #178a47; }
.pressure.lvl-1 .pr-top b { color: #b06a00; }
.pressure.lvl-2 .pr-top b { color: #d62f2f; }
.pr-bar { position: relative; height: 10px; margin: 7px 0 4px; border-radius: 999px; background: #e3e9f2; overflow: visible; }
.pr-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #22b45f, #f5a524 60%, #ef4444); }
.pr-bar em { position: absolute; top: -3px; width: 2px; height: 16px; background: #8a96aa; }
.pr-bar em.fire { background: #ef4444; }
.pr-legend { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: var(--ink-soft); }

.toolbar { display: flex; gap: 8px; padding: 12px 16px 8px; align-items: center; }
.seg { display: flex; background: #e9eef6; border-radius: 10px; padding: 3px; flex: none; }
.seg button { border: 0; background: transparent; cursor: pointer; font-size: 13px; font-weight: 800; padding: 6px 10px; border-radius: 8px; color: var(--ink-soft); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }
.search {
  flex: 1; min-width: 0; font: inherit; font-size: 14px; font-weight: 600; padding: 8px 12px;
  border-radius: 10px; border: 1px solid var(--line); outline: none; background: #fff;
}
.search:focus { border-color: var(--blue); }

.filters { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 16px 10px; border-bottom: 1px solid var(--line); }
.fchip {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  font-size: 12px; font-weight: 800; padding: 5px 9px; border-radius: 999px;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
}
.fchip i { font-style: normal; font-size: 10px; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; color: #fff; background: var(--c, #8a96aa); }
.fchip small { font-size: 11px; font-weight: 900; color: var(--ink-soft); background: #eef2f8; padding: 0 6px; border-radius: 999px; }
.fchip:hover { border-color: #aebdd3; }
.fchip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.fchip.on small { background: rgba(255, 255, 255, 0.2); color: #fff; }
.fchip.st-pending { --c: var(--st-pending); }
.fchip.st-in_progress { --c: var(--st-in_progress); }
.fchip.st-waiting { --c: var(--st-waiting); }
.fchip.st-done { --c: var(--st-done); }
.fchip.st-cancelled { --c: var(--st-cancelled); }
.fchip.st-overdue { --c: var(--st-overdue); }

.items { list-style: none; margin: 0; padding: 8px 10px 14px; overflow-y: auto; flex: 1; }
.item {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: start;
  padding: 10px 10px 10px 8px; margin-bottom: 6px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--c, #8a96aa);
}
.item:hover { border-color: #b8c7dc; border-left-color: var(--c); background: #fbfdff; }
.item.st-pending { --c: var(--st-pending); }
.item.st-in_progress { --c: var(--st-in_progress); }
.item.st-waiting { --c: var(--st-waiting); }
.item.st-done { --c: var(--st-done); }
.item.st-cancelled { --c: var(--st-cancelled); }
.item.st-done .item-title, .item.st-cancelled .item-title { color: #56627a; }
.item.st-cancelled .item-title { text-decoration: line-through; text-decoration-color: rgba(86, 98, 122, 0.5); }
.item.is-overdue { background: #fff6f6; }
.item-icon {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  font-size: 13px; font-weight: 900; color: #fff; background: var(--c);
}
.item.st-pending .item-icon { color: #3a2400; }
.item-main { min-width: 0; }
.item-top { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-bottom: 2px; }
.ref { font-family: var(--pixel); font-size: 14px; font-weight: 700; color: var(--ink); }
.stage { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 13%, #fff); }
.item.st-pending .stage { color: #9a6200; }
.late-pill { font-size: 11px; font-weight: 900; padding: 1px 7px; border-radius: 999px; color: #fff; background: var(--st-overdue); }
.free-pill { font-size: 11px; font-weight: 900; padding: 1px 7px; border-radius: 999px; color: #7a4a00; background: #ffe7b3; }
.prio { font-size: 12px; color: #e0a800; letter-spacing: -1px; }
.item-title {
  display: block; font-size: 15px; font-weight: 800; line-height: 1.3; color: var(--ink); text-decoration: none;
  overflow-wrap: anywhere;
}
.item-title:hover { color: var(--blue-deep); text-decoration: underline; }
.item-meta { margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--ink-soft); line-height: 1.4; }
.deadline { margin-left: 6px; white-space: nowrap; font-weight: 800; }
.deadline.late { color: #d62f2f; }
.open-btn {
  align-self: center; white-space: nowrap; text-decoration: none;
  font-size: 12px; font-weight: 900; padding: 6px 10px; border-radius: 9px;
  color: var(--blue-deep); background: #eaf3ff; border: 1px solid #c5dcfb;
}
.open-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.empty { padding: 30px 10px; text-align: center; color: var(--ink-soft); font-weight: 700; }

.ranking .rank-row {
  display: grid; grid-template-columns: 30px 32px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 12px; margin-bottom: 6px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
}
.rank-pos { font-family: var(--pixel); font-size: 18px; font-weight: 700; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: #e9eef6; }
.r1 .rank-pos { background: #ffcc33; color: #5a3d00; }
.r2 .rank-pos { background: #d4dbe6; }
.r3 .rank-pos { background: #e7b07e; color: #4d2a0a; }
.r1 { border-color: #ffd95c !important; background: #fffbea !important; }
.avatar.small { width: auto; max-width: 40px; height: 40px; }
.rank-main { min-width: 0; }
.rank-name { border: 0; background: none; padding: 0; cursor: pointer; font-size: 15px; font-weight: 900; color: var(--ink); text-align: left; }
.rank-name:hover { color: var(--blue-deep); text-decoration: underline; }
.rank-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-top: 2px; }
.rank-pts { font-family: var(--pixel); font-size: 24px; color: var(--blue-deep); }
.rank-pts small { font-family: var(--ui); font-size: 12px; color: var(--ink-soft); }
.rules { padding: 12px 18px 16px; border-top: 1px solid var(--line); background: var(--paper-2); font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.rules h3 { margin: 0 0 6px; font-size: 14px; color: var(--ink); }
.rules ul { margin: 0 0 6px; padding-left: 18px; columns: 2; }
.rules p { margin: 0; line-height: 1.5; }

/* ------------------------------------------------------------ Join modal */
.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(16, 24, 48, 0.55); backdrop-filter: blur(3px);
}
.modal[hidden] { display: none; }
.join-card {
  width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: #fff; border-radius: 22px; border: 3px solid #1f3d6e; box-shadow: var(--shadow);
}
.join-head { padding: 18px 22px 14px; color: #fff; background: linear-gradient(180deg, #3aa0ff, #1f6fd6); border-bottom: 3px solid #1f3d6e; }
.join-head h1 { margin: 0; font-family: var(--pixel); font-size: 30px; font-weight: 700;  }
.join-head p { margin: 4px 0 0; font-size: 14px; font-weight: 700; opacity: 0.95; }
.join-body { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 20px 22px 22px; }
.join-preview {
  display: grid; place-items: center; border-radius: 16px; align-self: start; padding: 16px 0;
  background: repeating-conic-gradient(#a9d9e8 0 25%, #9fd1e2 0 50%) 0 0 / 24px 24px;
  border: 3px solid #7fb9cc;
}
.join-preview canvas { width: auto; height: 140px; }
.join-fields { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 900; color: var(--ink); }
.field input {
  font: inherit; font-size: 16px; font-weight: 700; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); outline: none;
}
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 140, 255, 0.2); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sw {
  width: 30px; height: 30px; border-radius: 9px; cursor: pointer; background: var(--c);
  border: 3px solid #fff; box-shadow: 0 0 0 2px #c9d4e4;
}
.sw.on { box-shadow: 0 0 0 3px var(--ink); transform: translateY(-1px); }
.join-error { margin: 0; min-height: 18px; color: #d62f2f; font-size: 13px; font-weight: 800; }
.join-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------ Small screens */
@media (max-width: 1100px) {
  .kpis { display: none; }
  .hint { display: none; }
}
@media (max-width: 720px) {
  .hud-top { flex-wrap: wrap; }
  .brand-text small { max-width: 160px; }
  .online { display: none; }
  .legend { display: none; }
  .panel { top: auto; bottom: 0; right: 0; left: 0; width: 100%; height: 72vh; border-radius: 18px 18px 0 0; transform: translateY(105%); }
  .join-body { grid-template-columns: 1fr; }
  .join-preview { justify-self: center; padding: 10px 24px; }
}

/* ------------------------------------------------------------ v2: new pieces */
.btn-round { width: 40px; justify-content: center; padding: 9px 0; font-size: 16px; }
.btn:disabled { opacity: 0.6; cursor: progress; }

.minimap {
  position: fixed; right: 12px; bottom: 12px; z-index: 9; width: 236px;
  padding: 8px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow); border: 1px solid #c8d6ea;
}
.mm-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px 6px; }
.mm-head b { font-family: var(--pixel); font-size: 15px; }
.mm-head span { font-size: 11px; font-weight: 800; color: var(--ink-soft); }
#minimap { display: block; width: 100%; border-radius: 8px; cursor: pointer; background: #b3dfec; }

.help-card {
  position: fixed; left: 50%; bottom: 76px; z-index: 40; transform: translateX(-50%);
  width: min(460px, calc(100vw - 32px)); padding: 18px 20px;
  background: #fff; border-radius: 20px; border: 3px solid #1f3d6e; box-shadow: var(--shadow);
  animation: pop 0.25s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, 14px) scale(0.97); } }
.help-card h2 { margin: 0 0 10px; font-family: var(--pixel); font-size: 22px; color: var(--blue-deep); }
.help-card ul { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.help-card li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; line-height: 1.35; }
.help-card .hk { width: 34px; height: 34px; display: grid; place-items: center; font-size: 18px; border-radius: 10px; background: #eef5ff; }
.help-card kbd { background: #eef2f8; border-color: #c9d4e4; color: var(--ink); }

.kinds { display: flex; gap: 8px; }
.kind {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  padding: 10px 12px; border-radius: 12px; font-weight: 900; font-size: 14px;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14);
}
.kind span { font-size: 20px; }
.kind.on { border-color: var(--blue); box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14); background: #eef5ff; }
.join-colors { display: flex; flex-direction: column; gap: 12px; }

.head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.head-row .badges { margin-top: 0; }
.goto-btn {
  cursor: pointer; font-size: 12px; font-weight: 900; padding: 3px 10px; border-radius: 999px;
  color: var(--blue-deep); background: #fff; border: 0; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14);
}
.goto-btn:hover { background: var(--yellow); color: #3d2a00; }

.team .team-card {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px; margin-bottom: 7px; border-radius: 14px; background: #fff;
  border: 1px solid var(--line); border-left: 6px solid var(--st-done);
}
.team .team-card.lvl-1 { border-left-color: var(--st-pending); background: #fffaf0; }
.team .team-card.lvl-2 { border-left-color: var(--st-overdue); background: #fff4f4; }
.team-main { min-width: 0; }
.team-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.team-name { border: 0; background: none; padding: 0; cursor: pointer; font-size: 15px; font-weight: 900; color: var(--ink); text-align: left; }
.team-name:hover { color: var(--blue-deep); text-decoration: underline; }
.dev-pill { font-size: 11px; font-weight: 900; padding: 1px 7px; border-radius: 999px; color: #fff; background: linear-gradient(90deg, #6c4bd6, #ff4fd8); }
.lvl-dot { font-size: 11px; font-weight: 900; padding: 1px 8px; border-radius: 999px; color: #fff; background: var(--st-done); }
.team-top .lvl-dot { margin-left: auto; }
.lvl-dot.lvl-1 { background: var(--st-pending); color: #3a2400; }
.lvl-dot.lvl-2 { background: var(--st-overdue); }
.mini-bar { display: flex; height: 8px; margin: 6px 0 4px; border-radius: 999px; overflow: hidden; background: #e3e9f2; }
.mini-bar i { display: block; min-width: 4px; }
.team-meta { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.team-meta .late { color: #d62f2f; }
.team-meta .pts { color: #b07d00; font-weight: 900; }
.team-actions { display: flex; gap: 6px; }
.mini-btn {
  cursor: pointer; white-space: nowrap; font-size: 12px; font-weight: 900; padding: 6px 10px; border-radius: 9px;
  color: var(--blue-deep); background: #eaf3ff; border: 1px solid #c5dcfb;
}
.mini-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.mini-btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }

/* Developer console */
.admin { flex: 1; overflow-y: auto; padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 10px; background: #f4f2fb; }
.ad-card { background: #fff; border-radius: 14px; border: 1px solid #ddd6f3; padding: 12px 14px; }
.ad-card.muted { background: #faf9fe; }
.ad-card h3 { margin: 0 0 8px; font-size: 14px; font-weight: 900; color: #3b2a63; }
.ad-card p { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-soft); line-height: 1.45; }
.ad-row { display: flex; gap: 10px; align-items: center; }
.ad-row b { display: block; font-size: 14px; }
.ad-row small { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.ad-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--st-overdue); }
.ad-dot.ok { background: var(--st-done); box-shadow: 0 0 0 4px rgba(34, 180, 95, 0.2); }
.ad-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ad-actions.end { justify-content: flex-end; margin-top: 0; }
.ad-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ad-kpi { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 10px; background: #f4f2fb; }
.ad-kpi b { font-family: var(--pixel); font-size: 24px; line-height: 1; }
.ad-kpi span { font-size: 11px; font-weight: 800; color: var(--ink-soft); }
.ad-kpi.warn b { color: #c47d00; }
.ad-kpi.bad b { color: #d62f2f; }
.ad-kpi.good b { color: #178a47; }
.ad-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.ad-list li { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; }
.ad-list small { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.ad-ok { margin-top: 10px !important; }
.ad-people { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-person { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px; background: #f4f2fb; font-size: 13px; font-weight: 800; }
.ad-person .mini { height: 21px; width: auto; }

@media (max-width: 1100px) { .minimap { width: 180px; } }
@media (max-width: 720px) { .minimap { display: none; } .help-card { bottom: 12px; } }

/* Collapsible legend */
.legend { padding: 6px; gap: 0; align-items: center; }
.lg-toggle {
  cursor: pointer; border: 0; background: none; font-size: 13px; font-weight: 900; color: var(--ink);
  padding: 4px 8px; border-radius: 9px;
}
.lg-toggle:hover { background: #eef2f8; }
.lg-items { display: none; flex-wrap: wrap; gap: 6px; padding: 2px 6px 2px 4px; }
.legend.open .lg-items { display: flex; }
.lg-items .lg:first-child { padding-left: 6px; border-left: 1px solid var(--line); }

/* Meetings */
.meet-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #fbfcff; }
.meet-btn {
  cursor: pointer; font-weight: 900; font-size: 13px; padding: 7px 12px; border-radius: 10px;
  color: #fff; background: #1a73e8; border: 1px solid #1557b0; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14);
}
.meet-btn:hover { background: #2b82f0; }
.meet-btn:disabled { cursor: not-allowed; color: #7a8496; background: #e9eef6; border-color: #d3dbe7; box-shadow: none; }
.meet-hint { flex: 1; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.meet-form { padding: 12px 16px 14px; border-bottom: 1px solid var(--line); background: #f3f8ff; display: grid; gap: 8px; }
.meet-head { display: flex; justify-content: space-between; align-items: center; }
.meet-head b { font-size: 14px; }
.meet-x { cursor: pointer; border: 0; background: none; font-size: 14px; font-weight: 900; color: var(--ink-soft); }
.meet-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.meet-field { display: grid; gap: 3px; font-size: 11px; font-weight: 900; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.3px; }
.meet-field input, .meet-field select, .meet-field textarea {
  font: inherit; font-size: 14px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--ink);
  padding: 7px 9px; border-radius: 9px; border: 1px solid var(--line); background: #fff; outline: none; min-width: 0;
}
.meet-field textarea { resize: vertical; }
.meet-field input:focus, .meet-field select:focus, .meet-field textarea:focus { border-color: #1a73e8; }
.meet-note { margin: 0; font-size: 12px; font-weight: 600; color: var(--ink-soft); line-height: 1.4; }
.meet-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* CEO office */
.desk-tag.ceo .desk-name {
  color: #fff8e1; background: #3a2416; border-color: #d4a637;
  box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14), 0 0 12px rgba(212, 166, 55, 0.45);
}
.desk-tag.ceo .desk-name::before { display: none; }
.desk-tag.ceo .desk-role { background: linear-gradient(90deg, #b8860b, #e6c35c); color: #2e1a10; }
.desk-tag.ceo.empty .desk-role { background: #6b5a45; color: #fff; }
.desk-tag.ceo .desk-pts { color: #ffd76a; }
.desk-tag.ceo.hover .desk-name, .desk-tag.ceo .desk-name:hover { border-color: #ffe08a; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14), 0 0 16px rgba(255, 224, 138, 0.6); }
.desk-tag.dev .desk-name { color: #e9f6ff; background: #1a1430; border-color: #6c4bd6; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14), 0 0 14px rgba(108, 75, 214, 0.55); }
.desk-tag.dev .desk-name::before { display: none; }
.ceo-plate {
  transform: translateX(-50%); display: flex; align-items: baseline; gap: 8px; white-space: nowrap;
  padding: 3px 12px 5px; border-radius: 6px; font-family: var(--pixel);
  background: linear-gradient(180deg, #e6c35c, #b8860b); border: 1px solid #7a5a1c; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14);
}
.ceo-plate b { font-size: 18px; letter-spacing: 3px; color: #2e1a10; }
.ceo-plate span { font-size: 12px; color: #4a3010; }
.ceo-screen {
  pointer-events: auto; cursor: pointer; display: flex; flex-direction: column; gap: 1px; text-align: left;
  width: 116px; padding: 4px 7px 5px; border-radius: 4px; font-family: var(--pixel);
  color: #dbe7ff; background: #0b1529; border: 3px solid #30364f; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14);
}
.ceo-screen:hover { border-color: #4a9dff; }
.ceo-screen[data-level="2"] { border-color: #ef4444; }
.ceo-screen[data-level="1"] { border-color: #f5a524; }
.cs-title { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: #8fc3ff; }
.cs-row { font-size: 11px; white-space: nowrap; }
.dev-pill.ceo { background: linear-gradient(90deg, #b8860b, #e6c35c); color: #2e1a10; }
.ad-podium { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ad-podium li { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; }
.rank-pos.small { width: 26px; height: 26px; font-size: 14px; }

/* Entered from Factory */
body.via-factory .join-btn { display: inline-flex; }
.factory-link { display: block; margin-top: 10px; font-size: 13px; font-weight: 800; color: var(--blue-deep); }

/* Zone labels on the floor */
.zone-label {
  transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font-family: var(--pixel); font-size: 14px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 2px 10px 3px; border-radius: 6px; background: rgba(255, 255, 255, 0.55); color: #23304f;
}
.zone-tech { background: rgba(12, 26, 43, 0.75); color: #8ff0de; }
.zone-mkt { background: rgba(255, 255, 255, 0.7); color: #c4472b; }
.zone-pm { background: rgba(31, 127, 109, 0.85); color: #e9fff9; }
.zone-dev { background: rgba(26, 20, 48, 0.8); color: #ff9cf0; }
.zone-ceo { background: rgba(58, 36, 22, 0.8); color: #ffe08a; }

/* Neon variants */
.neon-sign.tech { background: #07131f; border-color: #1f8f7f; }
.neon-sign.tech .n1 { color: #8ff0de; text-shadow: 0 0 6px #25e3c4, 0 0 14px #25e3c4; }
.neon-sign.tech .n2 { color: #b9fff1; text-shadow: 0 0 6px #25e3c4, 0 0 16px #2a6fdb; }
.neon-sign.mkt { background: #2a0f1f; border-color: #ff7a59; }
.neon-sign.mkt .n1 { color: #ffd166; text-shadow: 0 0 6px #ffb020, 0 0 14px #ffb020; }
.neon-sign.mkt .n2 { color: #ffb4a0; text-shadow: 0 0 6px #ff7a59, 0 0 16px #ff4fd8; }

/* Support screen in the tech office, kanban title in the hub */
.ops-screen {
  pointer-events: auto; cursor: pointer; display: flex; flex-direction: column; gap: 1px; text-align: left;
  width: 132px; padding: 4px 7px 5px; border-radius: 4px; font-family: var(--pixel);
  color: #c9fff4; background: #06121d; border: 3px solid #1f3b52; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14);
}
.ops-screen:hover { border-color: #25e3c4; }
.ops-screen[data-level="1"] { border-color: #f5a524; }
.ops-screen[data-level="2"] { border-color: #ef4444; }
.kanban-title {
  transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font-family: var(--pixel); font-size: 14px; font-weight: 700; padding: 3px 10px 4px; border-radius: 7px;
  color: #fff; background: #1f7f6d; border: 1px solid #135447; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14);
}

/* Owner tags of the new offices */
.desk-tag.tech .desk-name { color: #d6fff7; background: #0c1a2b; border-color: #25e3c4; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14); }
.desk-tag.mkt .desk-name { color: #4a1606; background: #fff1ea; border-color: #ff7a59; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14); }
.desk-tag.pm .desk-name { color: #eafff9; background: #1f7f6d; border-color: #0f4f43; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14); }
.desk-tag.tech .desk-name::before, .desk-tag.mkt .desk-name::before, .desk-tag.pm .desk-name::before { display: none; }
.desk-tag.tech .desk-role { background: #1f8f7f; }
.desk-tag.mkt .desk-role { background: linear-gradient(90deg, #ff7a59, #ff4fd8); }
.desk-tag.pm .desk-role { background: #0f4f43; }
.desk-tag.empty .desk-role { filter: saturate(0.4) brightness(0.9); }
.dev-pill.tech { background: #1f8f7f; }
.dev-pill.mkt { background: linear-gradient(90deg, #ff7a59, #ff4fd8); }
.dev-pill.pm { background: #1f7f6d; }

/* Role sections in the owners' panels */
.ad-tickets, .ad-clients, .ad-load { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ad-ticket { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; font-size: 13px; }
.ad-ticket a { font-family: var(--pixel); font-weight: 700; color: var(--blue-deep); }
.ad-ticket-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-ticket small { grid-column: 2; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.ad-clients li { display: grid; grid-template-columns: 1fr 90px; gap: 2px 10px; align-items: center; font-size: 13px; }
.ad-clients li small { grid-column: 1 / -1; color: var(--ink-soft); font-weight: 700; font-size: 11px; }
.ad-clients .mini-bar { margin: 0; }
.ad-load li { display: grid; grid-template-columns: 1fr 110px; gap: 2px 10px; align-items: center; }
.ad-load li small { grid-column: 1 / -1; color: var(--ink-soft); font-weight: 700; font-size: 11px; }
.load-bar { height: 8px; border-radius: 999px; background: #e3e9f2; overflow: hidden; }
.load-bar i { display: block; height: 100%; border-radius: 999px; background: var(--st-done); }
.load-bar i.lvl-1 { background: var(--st-pending); }
.load-bar i.lvl-2 { background: var(--st-overdue); }

/* Changes in Odoo from the panel */
.item-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; align-self: center; }
.edit-btn {
  cursor: pointer; white-space: nowrap; font-size: 12px; font-weight: 900; padding: 6px 10px; border-radius: 9px;
  color: #6b4b00; background: #fff6d6; border: 1px solid #f1d27a;
}
.edit-btn:hover, .edit-btn.on { background: var(--yellow); border-color: #a87b00; color: #3d2a00; }
.editor {
  grid-column: 1 / -1; display: grid; gap: 8px; margin-top: 4px; padding: 10px 12px;
  border-radius: 10px; background: #f6f9ff; border: 2px dashed #c5dcfb;
}
.ed-title { margin: 0; font-weight: 900; font-size: 14px; }
.ed-help { margin: 0; font-size: 12px; font-weight: 600; color: var(--ink-soft); line-height: 1.45; }
.ed-row { display: flex; gap: 8px; align-items: center; }
.ed-row.end { justify-content: flex-end; }
.ed-row input { flex: 1; }
.editor input, .editor textarea {
  font: inherit; font-size: 14px; font-weight: 600; padding: 7px 9px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; outline: none; min-width: 0; width: 100%;
}
.editor input:focus, .editor textarea:focus { border-color: var(--blue); }
.ed-tabs { display: flex; gap: 4px; }
.ed-tabs button { cursor: pointer; border: 0; padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 900; background: #e9eef6; color: var(--ink-soft); }
.ed-tabs button.on { background: var(--ink); color: #fff; }
.ed-states { display: flex; flex-wrap: wrap; gap: 5px; }
.ed-state { cursor: pointer; font-size: 12px; font-weight: 800; padding: 6px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.ed-state.current { border-style: dashed; }
.ed-state.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.ed-state small { font-weight: 700; opacity: 0.8; }
.ed-grid { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
.ed-grid label { display: grid; gap: 3px; font-size: 11px; font-weight: 900; color: var(--ink-soft); text-transform: uppercase; }
.ed-grid label.wide { grid-column: 1 / -1; }
.ed-foot { margin: 0; font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.link-btn { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: var(--blue-deep); text-decoration: underline; }

/* Panel: the whole body scrolls and the search + filters stay on top */
.panel { overflow-y: auto; overscroll-behavior: contain; }
.panel .items { flex: none; overflow: visible; }
.panel .toolbar { position: sticky; top: 0; z-index: 3; background: var(--paper); padding-top: 10px; }
.panel .filters { position: sticky; top: 56px; z-index: 3; background: var(--paper); padding-top: 4px; box-shadow: 0 6px 8px -8px rgba(16, 24, 48, 0.35); }
.panel .admin { overflow: visible; flex: none; }

/* Editing window */
.edit-modal { z-index: 60; }
.edit-card {
  width: min(760px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  background: #fff; border-radius: 20px; border: 3px solid #1f3d6e; box-shadow: var(--shadow);
  border-top: 10px solid var(--c, #8a96aa);
}
.edit-card.st-pending { --c: var(--st-pending); }
.edit-card.st-in_progress { --c: var(--st-in_progress); }
.edit-card.st-waiting { --c: var(--st-waiting); }
.edit-card.st-done { --c: var(--st-done); }
.edit-card.st-cancelled { --c: var(--st-cancelled); }
.edit-head { display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center; padding: 18px 20px 12px; }
.item-icon.big { width: 46px; height: 46px; font-size: 20px; border-radius: 12px; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 900; }
.edit-titles h2 { margin: 4px 0 0; font-size: 21px; line-height: 1.25; font-weight: 900; color: var(--ink); }
.close.dark { color: var(--ink-soft); background: #eef2f8; border-color: #dde4ee; }
.close.dark:hover { background: #e2e8f2; }
.edit-info { margin: 0 20px 6px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.edit-info div { background: #f4f7fb; border-radius: 10px; padding: 8px 12px; }
.edit-info dt { font-size: 11px; font-weight: 900; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.4px; }
.edit-info dd { margin: 2px 0 0; font-size: 14px; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; }
.edit-card .editor { margin: 10px 20px 20px; padding: 14px 16px; border-style: solid; gap: 12px; }
.edit-card .ed-tabs button { font-size: 14px; padding: 8px 16px; }
.edit-card .ed-state { font-size: 14px; padding: 9px 14px; }
.edit-card .editor input, .edit-card .editor textarea { font-size: 16px; padding: 10px 12px; }
.edit-card .ed-grid { grid-template-columns: 140px 1fr; }
.quick-hours { display: flex; flex-wrap: wrap; gap: 6px; }
.edit-card .btn { font-size: 15px; padding: 11px 18px; }
@media (max-width: 720px) { .edit-head { grid-template-columns: auto 1fr auto; } .edit-head .open-btn { grid-column: 1 / -1; } }

/* Calls */
.call-prompt {
  left: 0; top: 0; pointer-events: auto; cursor: pointer; white-space: nowrap;
  font-family: var(--pixel); font-size: 15px; font-weight: 700; padding: 7px 14px 8px; border-radius: 999px;
  color: #fff; background: #22b45f; border: 1px solid #137a3e; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14);
  animation: bob 1.2s ease-in-out infinite;
}
.call-prompt:hover { background: #2bc96b; }
.call-prompt.offline { cursor: default; color: #5b6782; background: #ffffff; border-color: #c9d4e4; box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14); animation: none; }
.goto-btn.call { color: #137a3e; }
.call-box {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 70;
  width: min(440px, calc(100vw - 24px)); padding: 12px 14px; border-radius: 18px;
  background: #121a2e; color: #eef3fa; border: 1px solid #2b3a5e; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  display: grid; gap: 10px;
}
.call-box[data-state="ringing"] { border-color: #22b45f; animation: ringPulse 1.2s ease-in-out infinite; }
@keyframes ringPulse { 50% { box-shadow: 0 0 0 6px rgba(34, 180, 95, 0.35), 0 12px 34px rgba(0, 0, 0, 0.45); } }
.call-head { display: flex; align-items: center; gap: 12px; }
.call-avatar { height: 52px; width: auto; background: #1e2a46; border-radius: 12px; padding: 4px; }
.call-title { display: grid; }
.call-title b { font-size: 16px; }
.call-sub { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #9fb3d9; }
.call-dot { width: 8px; height: 8px; border-radius: 50%; background: #22b45f; animation: pulse 1.4s infinite; }
.call-buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.call-btn { cursor: pointer; border: 0; border-radius: 12px; padding: 9px 14px; font-weight: 900; font-size: 14px; color: #fff; }
.call-btn.accept { background: #22b45f; }
.call-btn.hang { background: #ef4444; }
.call-btn.ghost { background: #263453; color: #dbe7ff; }
.call-videos { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.call-remote { width: 100%; height: 100%; object-fit: cover; }
.call-local { position: absolute; right: 8px; bottom: 8px; width: 30%; border-radius: 8px; border: 1px solid #fff; object-fit: cover; }

.ed-grid .wide { grid-column: 1 / -1; }

/* Room name plates on the dividers */
.room-plaque {
  transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none;
  font-family: var(--pixel); font-size: 13px; font-weight: 700; letter-spacing: 1px;
  padding: 3px 10px 4px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.35); box-shadow: 0 2px 8px rgba(16, 24, 48, 0.14);
}
.room-plaque.tech { color: #b9fff1; background: #0c1a2b; border-color: #1f8f7f; }
.room-plaque.mkt { color: #fff; background: #e2603e; border-color: #a63c20; }

/* Collapsible minimap */
.minimap .mm-head { width: 100%; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.minimap.collapsed { width: auto; padding: 6px; }
.minimap.collapsed #minimap, .minimap.collapsed .mm-head span { display: none; }
.minimap.collapsed .mm-head { padding: 4px 8px; }

/* Corner rooms touch the bottom edge: keep the floating buttons up top, over the wall */
.legend { top: 76px; bottom: auto; }
.minimap { top: 76px; bottom: auto; }
.toasts { top: 124px; }

/* SOINTEM sign with relief */
.wall-sign b { text-shadow: 1px 1px 0 #8fc3ff, 2px 2px 0 #6aa6e8, 3px 3px 0 #4a86c8, 5px 6px 6px rgba(20, 40, 80, 0.35); }
.wall-sign span {  }

/* ======================================================================
   Professional theme: glass surfaces, line icons, soft depth and motion
   ====================================================================== */
:root {
  --glass: rgba(255, 255, 255, 0.82);
  --glass-line: rgba(255, 255, 255, 0.65);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}
.ic { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.btn .ic + span { margin-left: 6px; }
.btn-round .ic { width: 19px; height: 19px; }
.mm-head b { display: inline-flex; align-items: center; gap: 6px; }

/* Surfaces */
.brand, .kpi-pill, .legend, .minimap, .online, .toast {
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid var(--glass-line);
  box-shadow: 0 1px 2px rgba(16, 24, 48, 0.08), 0 10px 30px rgba(16, 24, 48, 0.16);
}
.brand { border-radius: 16px; }
.kpi-pill { border-radius: 14px; transition: transform 0.25s var(--ease-out), box-shadow 0.25s; }
.kpi-pill:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16, 24, 48, 0.1), 0 14px 34px rgba(16, 24, 48, 0.2); }
.kpi-pill b, .brand-text b, .rank-pts, .ad-kpi b { font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-pill.warn, .kpi-pill.bad { border-color: var(--glass-line); }
.kpi-pill.warn { box-shadow: inset 0 -3px 0 var(--st-pending), 0 10px 30px rgba(16, 24, 48, 0.16); }
.kpi-pill.bad { box-shadow: inset 0 -3px 0 var(--st-overdue), 0 10px 30px rgba(16, 24, 48, 0.16); }
.logo { border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15), 0 4px 10px rgba(31, 111, 214, 0.35); }

/* Buttons */
.btn {
  font-weight: 800; letter-spacing: 0.01em; border-radius: 12px;
  background: linear-gradient(180deg, #4a9dff, #1f78ec);
  border: 1px solid rgba(10, 60, 140, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 14px rgba(31, 111, 214, 0.35);
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s, filter 0.18s, background 0.18s;
}
.btn:hover { background: linear-gradient(180deg, #5aa7ff, #2a82f2); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 20px rgba(31, 111, 214, 0.4); }
.btn:active { transform: translateY(1px) scale(0.98); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 6px rgba(31, 111, 214, 0.3); }
.btn-yellow { color: #3d2a00; background: linear-gradient(180deg, #ffd95c, #ffbf1f); border-color: rgba(150, 100, 0, 0.3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 4px 14px rgba(224, 168, 0, 0.35); }
.btn-yellow:hover { background: linear-gradient(180deg, #ffe17a, #ffc93a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 20px rgba(224, 168, 0, 0.4); }
.btn-yellow:active { box-shadow: 0 2px 6px rgba(224, 168, 0, 0.3); }
.btn-ghost { color: var(--ink); background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-color: var(--glass-line); box-shadow: 0 1px 2px rgba(16, 24, 48, 0.08), 0 6px 18px rgba(16, 24, 48, 0.14); }
.btn-ghost:hover { background: #fff; box-shadow: 0 2px 4px rgba(16, 24, 48, 0.1), 0 10px 24px rgba(16, 24, 48, 0.18); }
.btn-ghost:active { box-shadow: 0 1px 3px rgba(16, 24, 48, 0.12); }

/* Desk name tags: clean pills */
.desk-name { border-width: 1px; border-radius: 999px; transition: transform 0.2s var(--ease-out), box-shadow 0.2s, border-color 0.2s; }
.desk-tag.hover .desk-name, .desk-name:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(31, 111, 214, 0.35); }
.chip { border: 0; border-radius: 999px; font-weight: 800; box-shadow: 0 1px 3px rgba(16, 24, 48, 0.2); }
.seat-prompt { border-width: 1px; border-radius: 999px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* Panels and dialogs */
.panel { border-left: 1px solid var(--line); box-shadow: -20px 0 60px rgba(16, 24, 48, 0.22); transition: transform 0.38s var(--ease-out); }
.panel-head { background: linear-gradient(135deg, #3aa0ff 0%, #1f6fd6 60%, #3b5fd6 100%); border-bottom: 0; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12); }
.panel-head:has(.agent-icon) { background: linear-gradient(135deg, #1b2240 0%, #2a3360 100%); }
.join-card, .help-card { border-radius: 20px; overflow: hidden; box-shadow: 0 30px 80px rgba(10, 16, 40, 0.45); animation: pop-in 0.4s var(--ease-out) both; }
.join-head { background: linear-gradient(135deg, #3aa0ff 0%, #1f6fd6 55%, #5b4bd6 100%); border-bottom: 0; }
.join-head h1 { font-weight: 900; letter-spacing: -0.02em; }
.toast { border-radius: 12px; animation: toast-in 0.35s var(--ease-out) both; }

/* Entrance motion */
.hud-top > * { animation: drop-in 0.55s var(--ease-out) both; }
.hud-top > *:nth-child(2) { animation-delay: 0.06s; }
.hud-top > *:nth-child(3) { animation-delay: 0.12s; }
.legend, .minimap { animation: fade-up 0.6s 0.15s var(--ease-out) both; }
.desk-tag { animation: fade-up 0.5s var(--ease-out) both; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-14px); } }
@keyframes fade-up { from { opacity: 0; transform: translate(var(--tx, 0), 10px); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(-16px); } }
.kpi-pill b.bump { animation: bump 0.5s var(--ease-out); }
@keyframes bump { 40% { transform: scale(1.18); color: var(--blue-deep); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.desk-tag, .neon-sign, .seat-prompt { --tx: -50%; }

/* ======================================================================
   Basement: Factory agents room
   ====================================================================== */
body.in-basement .minimap, body.in-basement .legend { display: none; }
.stairs-sign {
  transform: translateX(-50%); pointer-events: auto; cursor: pointer; white-space: nowrap; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 14px 7px; border-radius: 12px;
  color: #fff; background: linear-gradient(180deg, #2a3555, #151b30); border: 1px solid rgba(120, 170, 255, 0.45);
  box-shadow: 0 8px 22px rgba(10, 16, 40, 0.45), 0 0 18px rgba(90, 160, 255, 0.35);
  animation: bob 2.2s ease-in-out infinite;
}
.stairs-sign b { font-size: 14px; font-weight: 900; letter-spacing: 0.04em; }
.stairs-sign b::before { content: "↓ "; color: #7cc0ff; }
.stairs-sign.up b::before { content: "↑ "; }
.stairs-sign span { font-size: 11px; font-weight: 700; color: #b9c8ea; }

.agents-neon {
  transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; white-space: nowrap;
  padding: 10px 18px; border-radius: 12px; background: #0d1020; border: 1px solid #2b335a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.agents-neon .n1 { font-size: 26px; font-weight: 900; letter-spacing: 0.3em; color: #7cf5ff; text-shadow: 0 0 8px #31d8ff, 0 0 20px #31d8ff; }
.agents-neon .n2 { font-size: 13px; font-weight: 800; letter-spacing: 0.25em; text-transform: uppercase; color: #ffb7f0; text-shadow: 0 0 8px #ff4fd8; animation: neon 7s infinite; }
.agents-zone {
  transform: translateX(-50%); font-size: 12px; font-weight: 900; letter-spacing: 0.22em; text-transform: uppercase;
  padding: 3px 12px; border-radius: 999px; color: #e9ddff; background: rgba(60, 40, 120, 0.75); border: 1px solid rgba(155, 123, 255, 0.6);
}
.agents-zone.projects { color: #d6fff4; background: rgba(20, 80, 70, 0.8); border-color: rgba(63, 209, 176, 0.6); }
.agents-exit { transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 900; color: #0d1f1b; background: #3fd1b0; padding: 4px 10px; border-radius: 8px; }

.agents-board {
  pointer-events: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; border-radius: 14px;
  color: #e7ecff; background: linear-gradient(180deg, rgba(16, 22, 44, 0.96), rgba(9, 12, 26, 0.96));
  border: 1px solid #2f3a66; box-shadow: inset 0 0 0 4px #1a2140, 0 18px 40px rgba(0, 0, 0, 0.5);
}
.ab-head { display: flex; align-items: center; gap: 10px; }
.ab-head b { font-size: 17px; font-weight: 900; letter-spacing: -0.01em; }
.ab-head span { font-size: 12px; color: #9fb0da; }
.ab-flag { margin-left: auto; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 999px; background: #6c4bd6; color: #fff; }
.ab-flag.live { background: #1f9d55; }
.ab-flag.warn { background: #f5a524; color: #3a2400; }
.ab-line { display: flex; align-items: center; gap: 6px; }
.ab-stage { flex: 1; display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 9px; background: #182042; font-size: 12px; font-weight: 800; position: relative; }
.ab-stage i { width: 9px; height: 9px; border-radius: 50%; background: #56628f; flex: none; }
.ab-stage.st-working i { background: #2fd47a; box-shadow: 0 0 10px #2fd47a; animation: pulse 1.2s infinite; }
.ab-stage.st-blocked i { background: #ff4d4f; box-shadow: 0 0 10px #ff4d4f; }
.ab-stage.st-waiting i { background: #ffb020; }
.ab-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.ab-tasks li { display: flex; gap: 8px; align-items: baseline; }
.ab-tasks b { color: #9fd3ff; white-space: nowrap; }
.ab-tasks span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-tasks em { font-style: normal; color: #ffcf6e; font-weight: 800; white-space: nowrap; }
.ab-tasks .empty { color: #8190b8; }

.agent-tag {
  transform: translateX(-50%); pointer-events: auto; cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px;
  color: #fff; background: rgba(14, 18, 36, 0.88); border: 1px solid var(--agent, #56628f);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform 0.2s var(--ease-out);
}
.agent-tag:hover { transform: translate(-50%, -3px); }
.agent-tag b { font-size: 13px; font-weight: 900; }
.agent-state { font-size: 10.5px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 999px; background: #56628f; }
.agent-tag.st-working .agent-state { background: #1f9d55; }
.agent-tag.st-blocked .agent-state { background: #d62f2f; }
.agent-tag.st-waiting .agent-state { background: #e09400; color: #2a1b00; }
.agent-bubble {
  --tx: -50%; transform: translateX(-50%); max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 10px; color: #1f2a44; background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); animation: fade-up 0.4s var(--ease-out) both;
}
.agent-bubble.st-blocked { color: #fff; background: #d62f2f; }
.agent-bubble.st-waiting { background: #ffe1a3; }

/* Agent panel */
.agent-icon { color: #fff; font-weight: 900; font-size: 26px; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35); }
.agent-pill { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.9); color: #1f2a44; }
.agent-pill.st-working { background: #2fd47a; color: #06301a; }
.agent-pill.st-blocked { background: #ff6b6b; color: #fff; }
.agent-pill.st-waiting { background: #ffcf6e; color: #3a2400; }
.agent-note { margin: 12px 16px 0; padding: 8px 12px; border-radius: 10px; font-size: 12.5px; font-weight: 700; color: #4a2fb0; background: #efe9ff; }
.agent-note.warn { color: #7a4b00; background: #fff3d6; }
.agent-role, .agent-now, .agent-recent, .agent-execs { margin: 12px 16px; }
.agent-role > p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.45; color: var(--ink-soft); }
.agent-track { display: flex; gap: 4px; margin-bottom: 10px; }
.at-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 800; color: #8a95ad; }
.at-step i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #e9eef6; color: #6b7690; font-size: 11px; }
.at-step.done i { background: #cfe9da; color: #1f7a45; }
.at-step.on { color: var(--ink); }
.at-step.on i { background: var(--blue); color: #fff; box-shadow: 0 0 0 4px rgba(47, 140, 255, 0.2); }
.agent-stats { display: flex; gap: 10px; }
.agent-stats > div { flex: 1; padding: 8px 12px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--line); }
.agent-stats b { display: block; font-size: 22px; font-weight: 900; }
.agent-stats span { font-size: 11.5px; color: var(--ink-soft); font-weight: 700; }
.agent-now { padding: 12px 14px; border-radius: 14px; background: linear-gradient(180deg, #f3f8ff, #ffffff); border: 1px solid #cfe0f7; }
.agent-now.idle { background: var(--paper-2); border-color: var(--line); }
.agent-now h3, .agent-recent h3, .agent-execs h3 { margin: 0 0 6px; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.agent-title { margin: 0 0 8px; font-size: 16px; font-weight: 900; line-height: 1.25; }
.agent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.agent-kv { display: flex; flex-direction: column; min-width: 0; }
.agent-kv span { font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.agent-kv b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-msg { margin: 8px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink); }
.agent-recent ol { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.agent-recent li { position: relative; }
.agent-recent li::before { content: ""; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #b9c6da; border: 2px solid #fff; }
.agent-recent li.ar-result::before { background: #7e57c2; }
.agent-recent li.ar-tool::before { background: #2f8cff; }
.agent-recent li.ar-progress::before { background: #2fd47a; }
.ar-top { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; }
.ar-top b { font-weight: 900; }
.ar-top span { color: var(--ink-soft); }
.agent-recent p { margin: 2px 0 0; font-size: 13px; line-height: 1.35; }
.agent-recent code { display: block; margin-top: 3px; padding: 5px 8px; border-radius: 8px; background: #0f1530; color: #b8f0c8; font-size: 11.5px; white-space: pre-wrap; word-break: break-all; }
.agent-recent small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 11px; }
.agent-execs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.agent-execs li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.agent-execs i { width: 9px; height: 9px; border-radius: 50%; background: #c0c8d8; }
.agent-execs li.on i { background: #2fd47a; box-shadow: 0 0 8px #2fd47a; }
.agent-execs span { color: var(--ink-soft); }

/* Basement: the viewer's tasks per agent */
.agent-tasks { margin: 12px 16px; }
.agent-tasks h3 { margin: 0 0 6px; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.agent-tasks ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.agent-task { display: block; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; border-left: 4px solid #b9c6da; transition: transform 0.18s var(--ease-out), box-shadow 0.18s; }
a.agent-task:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(16, 24, 48, 0.14); }
.agent-task.st-working { border-left-color: #2fd47a; }
.agent-task.st-blocked, .agent-task.st-reject { border-left-color: #ff4d4f; }
.agent-task.st-waiting { border-left-color: #ffb020; }
.agent-task.st-pass, .agent-task.st-done { border-left-color: #2f8cff; }
.atk-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.atk-top b { font-size: 14px; font-weight: 900; }
.atk-state { flex: none; font-size: 10.5px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 999px; background: #e9eef6; color: #4a5570; }
.st-working .atk-state { background: #d7f7e5; color: #11683a; }
.st-blocked .atk-state, .st-reject .atk-state { background: #ffe0e0; color: #a12020; }
.st-waiting .atk-state { background: #fff0cf; color: #7a4b00; }
.agent-task p { margin: 4px 0; font-size: 12.5px; line-height: 1.35; color: var(--ink-soft); }
.atk-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--ink-soft); }
.atk-meta em { margin-left: auto; font-style: normal; font-weight: 800; color: var(--blue-deep); }
.agent-open { margin-top: 10px; text-decoration: none; display: inline-flex; }
.muted.small { font-size: 11.5px; margin-top: 6px; }
.ab-tasks a { display: flex; gap: 8px; align-items: baseline; color: inherit; text-decoration: none; width: 100%; }
.ab-tasks a:hover span { text-decoration: underline; }
.ab-tasks em.on { color: #2fd47a; }

/* Editor: real Odoo stages */
.ed-label { margin: 10px 0 6px; font-size: 11.5px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.ed-states.stages .ed-state { flex: 1 1 calc(50% - 6px); text-align: left; }
