@font-face {
  font-family: "Noto Kufi Arabic";
  src: url("/fonts/NotoKufiArabic-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Noto Kufi Arabic";
  src: url("/fonts/NotoKufiArabic-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Montserrat;
  src: url("/fonts/Montserrat-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Montserrat;
  src: url("/fonts/Montserrat-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #0b3d91;
  --navy-deep: #071833;
  --navy-mid: #0a2f6e;
  --sky: #38bdf8;
  --sky-soft: #7dd3fc;
  --ink: #0c2347;
  --muted: #5c6b82;
  --line: #d7e0ee;
  --paper: #f4f7fb;
  --surface: #ffffff;
  --idle: #788291;
  --queued: #6b5ce0;
  --working: #0b5ed7;
  --waiting: #e39b09;
  --done: #148f45;
  --error: #d12b3a;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 12px 40px rgba(7, 24, 51, 0.18);
  --font-ui: Montserrat, "Noto Kufi Arabic", system-ui, sans-serif;
  --font-body: "Noto Kufi Arabic", Montserrat, system-ui, sans-serif;
  --stage-scale: 1;
  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--navy-deep);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
}

.btn {
  border: 0;
  border-radius: 10px;
  background: var(--navy);
  color: white;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 10px 16px;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn:hover:not(:disabled) { background: var(--navy-mid); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-block { width: 100%; }
.btn-primary { background: var(--navy); box-shadow: 0 4px 14px rgba(11, 61, 145, 0.28); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn-ghost {
  background: white;
  color: var(--navy);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn-ghost:hover:not(:disabled) { background: #eef4fc; }

.approve { background: var(--done); }
.approve:hover:not(:disabled) { background: #0f7a3a; }

.reject {
  background: white;
  color: var(--error);
  border: 2px solid var(--error);
}
.reject:hover:not(:disabled) { background: #fff5f5; }

.empty-state {
  margin: 8px 0 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #f8fafc;
  text-align: center;
  font-size: 13px;
}

kbd {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 6px;
  background: #fff;
  color: var(--ink);
}

.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
}

.login-scene {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(56, 189, 248, 0.18), transparent 45%),
    radial-gradient(ellipse at 70% 70%, rgba(124, 58, 237, 0.16), transparent 50%),
    linear-gradient(160deg, #0b1529, #13284f 55%, #0b3d91);
}

.login-card {
  position: relative;
  width: min(440px, 100%);
  background: rgba(255, 255, 255, 0.97);
  border-radius: 22px;
  padding: 28px 24px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.login-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.login-logo {
  height: 56px;
  width: auto;
  display: block;
  max-width: 120px;
  object-fit: contain;
}

.login-mark {
  height: 36px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

.login-brand {
  margin: 4px 0 0;
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 13px;
  color: var(--navy);
}

.login-tagline,
.brand-tag {
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: #0284c7;
}

.login-card h1 {
  margin: 16px 0 6px;
  font-family: var(--font-ui);
  font-size: 28px;
  line-height: 1.2;
  color: var(--ink);
}

.login-lead { margin: 0 0 16px; color: var(--muted); }

.login-card label { display: block; font-weight: 700; margin-bottom: 6px; }

.login-card input {
  width: 100%;
  border: 1px solid #c5d2e6;
  border-radius: 12px;
  padding: 12px;
  background: white;
  margin-bottom: 8px;
}

.form-error { color: var(--error); margin: 0 0 8px; font-weight: 700; }

.app {
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--navy-deep);
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px;
  background: var(--navy);
  color: white;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.brand img,
.brand-logo {
  height: 34px;
  width: auto;
  max-width: 148px;
  display: block;
  object-fit: contain;
}

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

.brand-text .brand-tag { color: #7dd3fc; letter-spacing: 0.14em; font-size: 10px; }

.wordmark {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 13px;
  white-space: nowrap;
}

.spacer { flex: 1; }

.topbar-title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0.9;
  white-space: nowrap;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
}

.demo-chip {
  font-family: Montserrat, sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  background: #f59e0b;
  color: #1f1300;
  border-radius: 999px;
  padding: 3px 8px;
  flex: none;
}

.stage-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #0b1529;
  touch-action: none;
}

.office-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.office-canvas:active {
  cursor: grabbing;
}

.veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  z-index: 5;
  background: rgba(7, 24, 51, 0.35);
  font-weight: 700;
  pointer-events: none;
}

.scene-logo {
  position: absolute;
  pointer-events: none;
  user-select: none;
}

.leaders {
  position: absolute;
  inset: 0;
  width: 1800px;
  height: 1000px;
  pointer-events: none;
}

.steam {
  position: absolute;
  left: 1120px;
  top: 640px;
  width: 36px;
  height: 46px;
  pointer-events: none;
}

.steam i {
  position: absolute;
  bottom: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  filter: blur(1.5px);
  animation: steam 2.6s ease-in infinite;
}

.steam i:nth-child(1) { left: 4px; animation-delay: 0s; }
.steam i:nth-child(2) { left: 14px; animation-delay: 0.6s; }
.steam i:nth-child(3) { left: 24px; animation-delay: 1.1s; }

@keyframes steam {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  20% { opacity: 0.7; }
  100% { transform: translateY(-36px) scale(1.5); opacity: 0; }
}

.hotspot {
  position: absolute;
  width: 72px;
  height: 72px;
  border: 0;
  padding: 0;
  background: transparent;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.hotspot span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c, var(--working));
  border: 2px solid white;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--c, var(--working)) 55%, transparent);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 50%, transparent); }
  100% { box-shadow: 0 0 0 14px transparent; }
}

.bubble {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 276px;
  height: 86px;
  padding: 7px 10px 8px;
  border: 3px solid var(--c);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 22px rgba(8, 24, 58, 0.18);
  text-align: left;
  direction: ltr;
  overflow: hidden;
}

.bubble.pop { animation: pop 0.45s ease; }

.bubble.waiting { animation: waitpulse 1.8s ease-in-out infinite; }

.bubble.pop.waiting { animation: pop 0.45s ease; }

@keyframes pop {
  0% { transform: scale(0.96); }
  45% { transform: scale(1.045); }
  100% { transform: scale(1); }
}

@keyframes waitpulse {
  0%, 100% { box-shadow: 0 10px 22px rgba(8, 24, 58, 0.18); }
  50% { box-shadow: 0 0 0 4px rgba(227, 155, 9, 0.35), 0 10px 22px rgba(8, 24, 58, 0.18); }
}

.b-name {
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.b-task {
  font-size: 12px;
  line-height: 1.35;
  color: #3c465a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.b-foot {
  margin-top: auto;
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 20px;
}

.b-client {
  direction: ltr;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--c);
  color: white;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.b-progress {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 5px;
  height: 4px;
  border-radius: 99px;
  background: rgba(11, 94, 215, 0.16);
  overflow: hidden;
}

.b-progress span, .progress span {
  display: block;
  height: 100%;
  background: var(--working);
  border-radius: inherit;
  width: 0;
  transition: width 0.45s ease;
}

.idle { --c: var(--idle); }
.queued { --c: var(--queued); }
.working { --c: var(--working); }
.waiting { --c: var(--waiting); }
.cancelled { --c: var(--idle); }

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.task-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.task-item-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.task-item p {
  margin: 0 0 8px;
}

.task-cancel {
  padding: 6px 10px;
  font-size: 13px;
}

#panel-task-text {
  width: 100%;
  min-height: 72px;
  resize: vertical;
}
.done { --c: var(--done); }
.error { --c: var(--error); }

.agent-list {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: #e7eef8;
}

.agent-card {
  width: 100%;
  text-align: left;
  background: white;
  border: 2px solid var(--c);
  border-radius: 14px;
  padding: 10px 12px;
}

.agent-card .b-name { font-size: 15px; white-space: normal; }
.agent-card .b-task { white-space: normal; }

.ticker {
  min-height: 42px;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
}

.ticker-viewport { flex: 1; min-width: 0; }

.ticker-text {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
}

.ticker-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; opacity: 0.95; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #86efac;
}

.dot.off { background: #fbbf24; }

.logout {
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 3px 10px;
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 20, 48, 0.4);
  z-index: 20;
}

.panel {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: min(460px, 100%);
  background: var(--paper);
  color: var(--ink);
  z-index: 30;
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.28);
  transform: translateX(104%);
  transition: transform 0.22s ease;
}

.panel.open { transform: translateX(0); }

.panel-scroll {
  height: 100%;
  overflow: auto;
  padding-bottom: 28px;
}

.panel-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  background: white;
  border-bottom: 1px solid var(--line);
}

.kicker { margin: 0; color: var(--muted); font-size: 12px; }

.panel-head h2 { margin: 2px 0; font-size: 22px; line-height: 1.35; }

.client-line { margin: 0; }

.chip {
  display: inline-block;
  background: #e7eefb;
  color: var(--navy);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.panel-head-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.icon-btn {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
}

.panel-section { padding: 14px 16px 0; }

.panel-section h3 { margin: 0 0 8px; font-size: 15px; }

.task-copy { margin: 0 0 8px; font-size: 16px; }

.muted { color: var(--muted); margin: 6px 0 0; font-size: 13px; }

.progress {
  height: 8px;
  border-radius: 99px;
  background: rgba(11, 94, 215, 0.15);
  overflow: hidden;
}

.note {
  background: #fff6e4;
  border: 1px solid #f3d48a;
  color: #6b4300;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 16px;
  line-height: 1.7;
}

.panel-banners { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }

.panel-banners:empty { display: none; }

.callout {
  margin: 0 16px;
  background: #fff6e4;
  border: 1px solid #f3d48a;
  border-radius: 14px;
  padding: 12px;
}

.callout strong { display: block; margin-bottom: 8px; }

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

.jump-row button {
  border: 1px solid #c5d2e6;
  background: #f7faff;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
}

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.timeline li {
  background: white;
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
}

.timeline .when { display: block; color: var(--muted); font-size: 12px; }

.output {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}

.output p { margin: 0 0 8px; line-height: 1.75; }
.output p:last-child { margin-bottom: 0; }

.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 4px 0;
  line-height: 1.6;
}

.check::before { font-weight: 700; flex: none; }
.check.ok::before { content: "✓"; color: var(--done); }
.check.bad::before { content: "✗"; color: var(--error); }

.post-card {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #c9d6ea;
  margin-bottom: 12px;
  background: white;
}

.post-brand {
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
}

.post-brand img { height: 26px; width: auto; }

.post-brand span { font-size: 12px; }

.post-bar {
  background: var(--working);
  color: white;
  font-weight: 700;
  padding: 12px;
  font-size: 18px;
  line-height: 1.55;
}

.post-body { padding: 12px; line-height: 1.7; }

.post-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 12px;
}

label[for="panel-editor"] { display: block; font-weight: 700; margin: 8px 0; }

textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  border: 1px solid #c5d2e6;
  border-radius: 12px;
  padding: 12px;
  background: white;
  direction: ltr;
  unicode-bidi: plaintext;
  line-height: 1.75;
}

.save-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

.stale { margin: 0 0 12px; }
.stale p { margin: 0 0 8px; }

.edits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.edits li {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 8px 10px;
}

.edit-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }

.edits pre {
  white-space: pre-wrap;
  font: inherit;
  margin: 8px 0 0;
  direction: ltr;
  unicode-bidi: plaintext;
}

.decision { padding-bottom: 8px; }
.decision .note { margin: 0 0 10px; }
.decision-row { display: flex; gap: 8px; }
.decision-row .btn { flex: 1; }

.link-line {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
}

.toast {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  border-radius: 999px;
  padding: 10px 16px;
  z-index: 50;
  max-width: min(520px, calc(100% - 24px));
  text-align: center;
}

.sprites {
  position: absolute;
  inset: 0;
  width: 1280px;
  height: 720px;
  pointer-events: none;
  z-index: 4;
}

.sprite-anchor {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

.agent-sprite {
  position: absolute;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.stage.sprites-live .hotspot {
  opacity: 0;
  pointer-events: none;
}

.bubble { z-index: 40; }

.agent-sprite img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.zzz {
  position: absolute;
  top: -6px;
  left: 58%;
  color: #12315f;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  animation: floatz 1.6s ease-in-out infinite;
}

.coffee-cup {
  position: absolute;
  right: 6px;
  bottom: 16px;
  width: 12px;
  height: 9px;
  border: 2px solid #6b3a22;
  border-top: 0;
  border-radius: 0 0 5px 5px;
  background: #f4e4cc;
}

.coffee-cup::before {
  content: "";
  position: absolute;
  right: -6px;
  top: 0;
  width: 4px;
  height: 5px;
  border: 2px solid #6b3a22;
  border-left: 0;
  border-radius: 0 6px 6px 0;
}

.coffee-cup::after {
  content: "";
  position: absolute;
  left: 2px;
  top: -6px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  box-shadow: 4px -2px 0 #dedede, 8px 0 0 #f2f2f2;
}

.sprite-flag {
  position: absolute;
  left: 14px;
  top: -78px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid white;
}

.sprite-flag.waiting { background: var(--waiting); }
.sprite-flag.done { background: var(--done); }
.sprite-flag.error { background: var(--error); }

@keyframes floatz {
  0%, 100% { transform: translateY(0); opacity: 0.45; }
  50% { transform: translateY(-8px); opacity: 1; }
}

.output p, .task-copy, .b-task {
  unicode-bidi: plaintext;
}

@media (max-width: 900px) {
  .wordmark { display: none; }
  .topbar h1 { font-size: 16px; }
}

@media (max-width: 760px) {
  .app { height: auto; min-height: 100dvh; }
  .topbar { gap: 8px; padding: 8px 10px; }
  .brand img { height: 28px; }
  .topbar h1 { font-size: 14px; line-height: 1.35; text-wrap: balance; }
  .stage-wrap {
    flex: none;
    height: min(58vw, 360px);
    min-height: 240px;
  }
  .agent-list { display: flex; }
  .ticker-text { font-size: 13px; }
  .conn span:last-child { display: none; }
  .panel { width: 100%; }
}

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

/* —— Moonbase chrome —— */
body.moon {
  background: #050816;
}
body.moon .topbar {
  background: linear-gradient(90deg, #07101f, #0b3d91 55%, #071833);
}
body.moon .stage-wrap {
  background:
    radial-gradient(ellipse at 70% 20%, rgba(59,130,246,0.18), transparent 40%),
    radial-gradient(circle at 20% 10%, rgba(255,255,255,0.08), transparent 25%),
    #050816;
}
body.moon .login-scene {
  background:
    radial-gradient(circle at 80% 20%, #3b82f6 0 2%, transparent 18%),
    radial-gradient(ellipse at 50% 120%, #6b7280 0 35%, transparent 55%),
    #050816;
}
.view-chip, .demo-chip {
  font-family: Montserrat, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: #e2e8f0;
}
.demo-chip { background: #e39b09; color: #111; }
.top-nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.nav-btn {
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,0.85);
  border-radius: 8px;
  padding: 7px 12px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.nav-btn.is-active {
  background: rgba(56, 189, 248, 0.22);
  color: #fff;
  border-color: rgba(56, 189, 248, 0.45);
}
.scene-hud {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  color: #e2e8f0;
  font-size: 12px;
  background: rgba(7,16,31,0.82);
  padding: 10px 12px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  backdrop-filter: blur(8px);
}
.hud-hint {
  margin: 0 0 4px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  color: var(--sky-soft);
}
.follow-toggle { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.fun-toggle input { accent-color: var(--sky); }
.settings-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.settings-logo { height: 48px; width: auto; max-width: 48px; object-fit: contain; }
.settings-fun { margin-bottom: 16px; }
.settings-fun-label { display: flex; gap: 8px; align-items: center; font-weight: 700; color: #0b3d91; }

.sheet {
  position: fixed;
  top: 0;
  right: 0;
  width: min(440px, 100%);
  height: 100%;
  background: var(--paper);
  z-index: 40;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  animation: sheet-in 0.2s ease;
}
@keyframes sheet-in {
  from { transform: translateX(12px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(120deg, #071833, #0b3d91 70%);
  color: #fff;
}
.sheet-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sheet-brand img { height: 28px; width: auto; object-fit: contain; }
.sheet-head h2 { margin: 0; font-family: var(--font-ui); font-size: 17px; font-weight: 700; }
.sheet-body {
  overflow: auto;
  padding: 16px;
  display: grid;
  gap: 16px;
}
.sheet-body > section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
}
.sheet-body h3 {
  margin: 0 0 8px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--navy);
}
.sheet-body label { display: block; font-weight: 600; margin: 8px 0 4px; font-size: 13px; }
.sheet-body input, .sheet-body textarea, .sheet-body select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sheet-body input:focus, .sheet-body textarea:focus, .sheet-body select:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
  outline: none;
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.control-agents { display: grid; gap: 8px; }
.control-agent {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.control-agent:hover {
  border-color: var(--sky);
  box-shadow: 0 4px 14px rgba(11, 61, 145, 0.1);
}
.big-card, .mail-card, .user-row {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}
.mail-card header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.subtask-list { padding-left: 18px; margin: 8px 0; font-size: 13px; }
.attendee-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.attendee { font-size: 13px; }
.inbox-list { display: grid; gap: 10px; }
.users-list { display: grid; gap: 8px; }
.user-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.login-reset-hint { margin-top: 12px; text-align: center; }
.login-reset-hint a { color: var(--navy); }

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 14px;
  font-weight: 600;
  cursor: pointer;
}
.remember-row input { width: auto; margin: 0; }

.security-block {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 40, 80, 0.12);
}
.security-block h3 { margin: 0 0 8px; }
.totp-qr {
  width: 180px;
  height: 180px;
  margin: 12px 0;
  background: #fff;
  display: grid;
  place-items: center;
}
.totp-qr img { width: 180px; height: 180px; }
.totp-secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  word-break: break-all;
}
.passkey-list, .recovery-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.passkey-row, .recovery-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(15, 40, 80, 0.08);
}
.btn-danger {
  background: #8b1e2d;
  color: #fff;
  border: none;
}
.btn-danger:hover:not(:disabled) { background: #6e1623; }

.icon-btn-light {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
  color: #fff;
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
}
.icon-btn-light:hover { background: rgba(255,255,255,0.22); }

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 0;
}
.panel-actions .btn { flex: 0 0 auto; }

.quick-bar {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 4;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
  max-width: min(420px, calc(100% - 180px));
}
.quick-btn {
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(7, 24, 51, 0.88);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 9px 14px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
}
.quick-btn:hover:not(:disabled) { background: rgba(11, 61, 145, 0.95); border-color: var(--sky); }
.quick-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.onboarding {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 8, 22, 0.55);
  backdrop-filter: blur(4px);
}
.onboarding-card {
  width: min(420px, 100%);
  background: #fff;
  color: var(--ink);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.onboarding-logo { height: 36px; width: auto; object-fit: contain; margin-bottom: 8px; }
.onboarding-card h2 {
  margin: 0 0 12px;
  font-family: var(--font-ui);
  font-size: 22px;
  color: var(--navy);
}
.onboarding-steps {
  margin: 0 0 18px;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: #334155;
  font-size: 14px;
  line-height: 1.5;
}

.shortcuts-help {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(7, 20, 48, 0.45);
  padding: 16px;
}
.shortcuts-card {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.shortcuts-card h2 {
  margin: 0 0 12px;
  font-family: var(--font-ui);
  color: var(--navy);
  font-size: 18px;
}
.shortcuts-card ul {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 14px;
}
.shortcuts-card li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.toast {
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
}
.toast.toast-error { background: var(--error); }

@media (max-width: 900px) {
  .topbar-title { display: none; }
  .brand-text .brand-tag { display: none; }
}

@media (max-width: 760px) {
  .top-nav { width: 100%; order: 5; }
  .topbar-title { order: 4; width: 100%; }
  .quick-bar { bottom: 70px; left: 12px; right: 12px; transform: none; }
  .scene-hud { bottom: auto; top: 10px; right: 10px; }
  .login-mark { max-width: 140px; }
}
