:root {
  --bg: #030712;
  --panel: rgba(8, 18, 35, 0.72);
  --panel-strong: rgba(11, 24, 45, 0.92);
  --line: rgba(114, 202, 255, 0.16);
  --line-strong: rgba(91, 207, 255, 0.38);
  --text: #e9f7ff;
  --muted: #7891a7;
  --cyan: #55d8ff;
  --cyan-bright: #a8edff;
  --blue: #1877ff;
  --green: #55e6a5;
  --danger: #ff758f;
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

.auth-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 32%, rgba(20, 132, 206, 0.2), transparent 32rem),
    rgba(2, 6, 14, 0.94);
  backdrop-filter: blur(18px);
}

.auth-card {
  width: min(430px, 100%);
  padding: 34px;
  border: 1px solid rgba(85, 216, 255, 0.26);
  border-radius: 24px;
  background: linear-gradient(155deg, rgba(12, 28, 51, 0.97), rgba(4, 12, 25, 0.98));
  box-shadow: 0 32px 110px rgba(0, 0, 0, 0.52), inset 0 1px rgba(255, 255, 255, 0.04);
}

.auth-emblem {
  width: 68px;
  height: 68px;
  margin-bottom: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(85, 216, 255, 0.5);
  border-radius: 22px;
  background: radial-gradient(circle, rgba(70, 220, 255, 0.3), rgba(18, 76, 139, 0.13));
  box-shadow: 0 0 36px rgba(52, 181, 255, 0.22), inset 0 0 24px rgba(85, 216, 255, 0.1);
  color: #c7f5ff;
  font-size: 26px;
  font-weight: 800;
}

.auth-kicker {
  margin: 0 0 7px;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.auth-card h1,
.account-dialog h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 680;
}

.auth-copy {
  min-height: 36px;
  margin: 10px 0 22px;
  color: #91aabe;
  font-size: 12px;
  line-height: 1.5;
}

.auth-form,
.account-create-form {
  display: grid;
  gap: 14px;
}

.owner-password-form {
  margin-top: 0;
  margin-bottom: 16px;
  border-color: rgba(76, 227, 187, 0.25);
}

.auth-form label,
.account-create-form label {
  display: grid;
  gap: 6px;
  color: #92acbf;
  font-size: 10px;
}

.auth-form input,
.account-create-form input,
.account-create-form select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(114, 202, 255, 0.2);
  border-radius: 10px;
  outline: none;
  background: rgba(3, 12, 25, 0.82);
  color: #e9f7ff;
}

.auth-form input:focus,
.account-create-form input:focus,
.account-create-form select:focus {
  border-color: rgba(85, 216, 255, 0.66);
  box-shadow: 0 0 0 3px rgba(85, 216, 255, 0.08);
}

.auth-remember {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px !important;
}

.auth-remember input {
  width: auto;
  min-height: auto;
  accent-color: var(--cyan);
}

.auth-submit {
  min-height: 43px;
  border: 1px solid rgba(86, 219, 255, 0.68);
  border-radius: 11px;
  cursor: pointer;
  background: linear-gradient(135deg, #087fc3, #1268c8);
  color: white;
  font-weight: 720;
  box-shadow: 0 10px 28px rgba(11, 112, 202, 0.24);
}

.auth-submit:disabled {
  opacity: 0.5;
  cursor: wait;
}

.auth-secondary {
  min-height: 39px;
  border: 1px solid rgba(114, 202, 255, 0.22);
  border-radius: 10px;
  cursor: pointer;
  background: rgba(8, 27, 48, 0.72);
  color: #9dc9dd;
  font-weight: 650;
}

.auth-secondary:hover {
  border-color: rgba(85, 216, 255, 0.48);
  color: #d5f5ff;
}

.compact-auth-button {
  min-height: 32px;
  margin-top: 8px;
  font-size: 10px;
}

.registration-status {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(85, 230, 165, 0.24);
  border-radius: 11px;
  background: rgba(15, 70, 54, 0.18);
  color: #91b7a8;
  font-size: 10px;
  line-height: 1.45;
}

.registration-status strong {
  color: #82e7ba;
}

.auth-error {
  min-height: 14px;
  margin: 0;
  color: #ff9aac;
  font-size: 10px;
}

.auth-footnote {
  margin: 18px 0 0;
  color: #607a8f;
  font-size: 9px;
  line-height: 1.5;
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(18, 89, 143, 0.19), transparent 36rem),
    linear-gradient(145deg, #02050d 0%, #050b16 45%, #020610 100%);
}

button,
textarea,
select {
  font: inherit;
}

button,
select {
  color: inherit;
}

.ambient {
  position: fixed;
  width: 32rem;
  height: 32rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(110px);
  opacity: 0.13;
}

.ambient-one {
  top: -18rem;
  left: -12rem;
  background: #008cff;
}

.ambient-two {
  right: -18rem;
  bottom: -16rem;
  background: #00d5ff;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 76px;
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 8, 18, 0.85);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--cyan-bright);
  font-weight: 800;
  background: linear-gradient(145deg, rgba(65, 207, 255, 0.18), rgba(17, 78, 150, 0.08));
  box-shadow: inset 0 0 18px rgba(84, 216, 255, 0.12), 0 0 24px rgba(32, 150, 255, 0.11);
}

.brand-name {
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.15em;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.mobile-app-link {
  border: 1px solid rgba(98, 211, 255, 0.24);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--cyan);
  background: rgba(26, 127, 178, 0.1);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
}

.mobile-app-link:hover {
  border-color: rgba(98, 211, 255, 0.52);
  background: rgba(26, 127, 178, 0.18);
}

.account-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 31px;
  padding: 4px 9px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  background: rgba(10, 28, 48, 0.72);
  color: #b8d5e5;
  font-size: 10px;
}

.account-avatar {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #1487b9, #1756aa);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.account-request-badge {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #ffb649;
  color: #201100;
  font-size: 8px;
  font-weight: 850;
}

.account-dialog {
  width: min(660px, calc(100vw - 32px));
  max-height: calc(100vh - 42px);
  padding: 24px;
  overflow: auto;
  border: 1px solid rgba(85, 216, 255, 0.28);
  border-radius: 20px;
  background: linear-gradient(155deg, #0b1b31, #050d1c);
  color: var(--text);
  box-shadow: 0 32px 110px rgba(0, 0, 0, 0.7);
}

.account-dialog::backdrop {
  background: rgba(1, 5, 12, 0.78);
  backdrop-filter: blur(8px);
}

.dialog-title-row,
.account-form-actions,
.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  background: rgba(12, 31, 53, 0.8);
  color: #9db9ca;
  font-size: 21px;
}

.current-account {
  margin: 20px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #a9c8d9;
  background: rgba(9, 25, 45, 0.64);
  font-size: 11px;
  line-height: 1.5;
}

.dialog-section-title {
  margin: 22px 0 10px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.account-list {
  display: grid;
  gap: 8px;
}

.account-row {
  padding: 11px 12px;
  border: 1px solid rgba(114, 202, 255, 0.13);
  border-radius: 11px;
  background: rgba(5, 17, 33, 0.72);
  color: #bdd6e4;
  font-size: 10px;
}

.account-row small {
  display: block;
  margin-top: 3px;
  color: #617c91;
}

.account-state {
  color: #75e5b6;
  font-size: 9px;
}

.account-state.disabled {
  color: #ff91a4;
}

.account-row-controls {
  display: flex;
  align-items: center;
  gap: 9px;
}

.registration-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pending-count {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 182, 73, 0.16);
  color: #ffc66f;
  font-size: 9px;
}

.registration-request-row {
  align-items: flex-start;
}

.registration-request-controls {
  display: grid;
  grid-template-columns: minmax(108px, 1fr) auto auto;
  gap: 7px;
  align-items: center;
}

.registration-role {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(114, 202, 255, 0.2);
  border-radius: 7px;
  background: rgba(3, 12, 25, 0.82);
  color: #b9d8e8;
  font-size: 9px;
}

.request-decision {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 8px;
  font-weight: 750;
}

.request-approve {
  border: 1px solid rgba(85, 230, 165, 0.38);
  background: rgba(26, 108, 77, 0.24);
  color: #8af0bd;
}

.request-reject {
  border: 1px solid rgba(255, 117, 143, 0.3);
  background: rgba(82, 22, 42, 0.2);
  color: #ffadbc;
}

.request-decision:disabled,
.registration-role:disabled {
  opacity: 0.45;
  cursor: wait;
}

.account-toggle {
  padding: 5px 7px;
  border: 1px solid rgba(114, 202, 255, 0.18);
  border-radius: 7px;
  cursor: pointer;
  background: rgba(13, 36, 59, 0.7);
  color: #8fabbc;
  font-size: 8px;
}

.account-toggle:disabled {
  opacity: 0.45;
  cursor: wait;
}

.account-create-form {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(85, 216, 255, 0.17);
  border-radius: 14px;
  background: rgba(6, 19, 36, 0.66);
}

.account-create-form h3 {
  margin: 0;
  font-size: 13px;
}

.account-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.compact-submit {
  min-width: 112px;
  min-height: 36px;
}

.logout-button {
  margin-top: 18px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 117, 143, 0.3);
  border-radius: 9px;
  cursor: pointer;
  background: rgba(82, 22, 42, 0.2);
  color: #ffadbc;
  font-size: 10px;
}

.status-pill,
.safety-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 28, 48, 0.72);
}

.status-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f8bd5c;
  box-shadow: 0 0 10px currentColor;
}

.status-pill.online i {
  background: var(--green);
}

.status-pill.offline i {
  background: var(--danger);
}

.safety-pill {
  color: var(--cyan);
  border-color: rgba(85, 216, 255, 0.24);
  font-weight: 700;
  letter-spacing: 0.08em;
}

#clock {
  min-width: 42px;
  color: #bdd9e9;
  font-variant-numeric: tabular-nums;
}

.workspace {
  position: relative;
  z-index: 1;
  height: calc(100vh - 112px);
  min-height: 550px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(420px, 1fr) minmax(260px, 320px);
  gap: 16px;
}

.panel {
  min-height: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(10, 22, 40, 0.78), rgba(4, 12, 25, 0.74));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.02), 0 20px 70px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(16px);
  overflow-y: auto;
}

.panel-heading {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #cfefff;
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-heading small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
}

.panel-heading-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.integration-pill {
  padding: 4px 7px;
  border: 1px solid rgba(248, 189, 92, 0.28);
  border-radius: 999px;
  color: #f8bd5c;
  background: rgba(68, 48, 14, 0.22);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.integration-pill.online {
  border-color: rgba(74, 255, 194, 0.32);
  color: var(--green);
  background: rgba(25, 131, 104, 0.14);
}

.integration-pill.offline {
  border-color: rgba(255, 115, 115, 0.32);
  color: #ffaaaa;
  background: rgba(108, 25, 39, 0.18);
}

.bitrix-refresh {
  width: 24px;
  height: 24px;
  padding: 0;
}

.bitrix-refresh:disabled {
  cursor: wait;
  opacity: 0.58;
}

.metrics-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.metric-card {
  min-height: 78px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(106, 187, 232, 0.13);
  border-radius: 13px;
  background: rgba(9, 25, 44, 0.64);
}

.metric-card.accent {
  border-color: rgba(85, 216, 255, 0.3);
  background: linear-gradient(145deg, rgba(15, 67, 104, 0.44), rgba(7, 29, 54, 0.62));
}

.metric-card span {
  color: var(--muted);
  font-size: 10px;
}

.metric-card strong {
  color: var(--cyan-bright);
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.mini-section {
  margin-top: 22px;
}

.section-title {
  margin-bottom: 10px;
  color: #a9c3d4;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.progress-row {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(106, 187, 232, 0.09);
  color: var(--muted);
  font-size: 11px;
}

.progress-row b {
  color: #d7f3ff;
  font-weight: 620;
}

.knowledge-value {
  color: var(--cyan-bright);
  font-size: 28px;
  font-weight: 650;
}

.muted {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.muted.compact {
  margin: 4px 0 12px;
}

.privacy-card {
  margin-top: 24px;
  padding: 13px;
  display: flex;
  gap: 11px;
  border: 1px solid rgba(85, 216, 255, 0.18);
  border-radius: 13px;
  background: rgba(12, 48, 67, 0.24);
}

.privacy-icon {
  color: var(--green);
  font-size: 18px;
}

.privacy-card strong {
  color: #ccefff;
  font-size: 11px;
}

.privacy-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.center-stage {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(220px, 36%) minmax(0, 1fr);
  gap: 14px;
}

.orb-zone {
  position: relative;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(85, 216, 255, 0.16);
  border-radius: 50%;
  pointer-events: none;
}

.orbit::before,
.orbit::after {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
  content: "";
}

.orbit::before {
  top: -3px;
  left: calc(50% - 3px);
}

.orbit::after {
  right: -3px;
  bottom: calc(50% - 3px);
}

.orbit-one {
  width: 194px;
  height: 194px;
  animation: spin 16s linear infinite;
}

.orbit-two {
  width: 242px;
  height: 242px;
  border-style: dashed;
  opacity: 0.65;
  animation: spin-reverse 28s linear infinite;
}

.orbit-three {
  width: 306px;
  height: 306px;
  opacity: 0.27;
  animation: spin 40s linear infinite;
}

.jarvis-orb {
  position: relative;
  z-index: 2;
  width: 138px;
  height: 138px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(157, 236, 255, 0.7);
  border-radius: 50%;
  cursor: pointer;
  background:
    radial-gradient(circle at 40% 35%, rgba(229, 251, 255, 0.95) 0, rgba(91, 220, 255, 0.88) 8%, transparent 18%),
    radial-gradient(circle at 50% 55%, #1bb9ff 0, #0762c5 40%, #041d50 72%, #02091a 100%);
  box-shadow:
    inset 0 0 22px rgba(215, 249, 255, 0.86),
    inset 0 -34px 55px rgba(0, 19, 75, 0.75),
    0 0 24px rgba(85, 216, 255, 0.62),
    0 0 74px rgba(22, 119, 255, 0.36);
  transition: transform 180ms ease, filter 180ms ease;
}

.jarvis-orb:hover {
  transform: scale(1.035);
  filter: brightness(1.12);
}

.jarvis-orb:active {
  transform: scale(0.98);
}

.orb-core {
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(207, 248, 255, 0.48);
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 20deg, rgba(210, 248, 255, 0.2) 0 4deg, transparent 4deg 12deg),
    radial-gradient(circle, rgba(202, 246, 255, 0.36), rgba(11, 106, 219, 0.14) 45%, transparent 70%);
  animation: spin 14s linear infinite;
}

.orb-shimmer {
  position: absolute;
  inset: -30%;
  background: linear-gradient(120deg, transparent 34%, rgba(255, 255, 255, 0.42) 48%, transparent 58%);
  animation: shimmer 4.5s ease-in-out infinite;
}

.orb-zone.listening .jarvis-orb {
  animation: listen-pulse 1.1s ease-in-out infinite;
  box-shadow:
    inset 0 0 30px rgba(229, 253, 255, 0.96),
    0 0 28px rgba(85, 216, 255, 0.92),
    0 0 100px rgba(23, 133, 255, 0.58);
}

.orb-zone.thinking .jarvis-orb {
  animation: thinking-pulse 1.8s ease-in-out infinite;
}

.orb-state {
  z-index: 2;
  margin-top: 25px;
  color: #ccefff;
  font-size: 13px;
  font-weight: 620;
  letter-spacing: 0.06em;
}

.orb-hint {
  z-index: 2;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.chat-shell {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(5, 14, 27, 0.76);
  backdrop-filter: blur(18px);
}

.chat-toolbar {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.mode-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.mode-switch select {
  padding: 6px 27px 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #0b1a2d;
  color: #ccefff;
  font-size: 10px;
}

.voice-switch select {
  max-width: 155px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.toggle input {
  accent-color: var(--cyan);
}

.ghost-button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  background: rgba(14, 39, 64, 0.54);
  color: #9fc2d5;
}

.ghost-button {
  padding: 6px 9px;
  font-size: 9px;
}

.voice-test-button {
  border-color: rgba(56, 211, 255, 0.42);
  color: #bdefff;
  white-space: nowrap;
}

.voice-test-button:hover {
  border-color: rgba(56, 211, 255, 0.8);
  background: rgba(20, 111, 153, 0.32);
  color: #ffffff;
}

.voice-test-button[data-state="preparing"] {
  border-color: rgba(255, 200, 91, 0.55);
  color: #ffe2a4;
}

.voice-test-button[data-state="speaking"] {
  border-color: rgba(74, 255, 194, 0.62);
  background: rgba(25, 131, 104, 0.24);
  color: #baffea;
}

.voice-test-button[data-state="error"] {
  border-color: rgba(255, 115, 115, 0.58);
  color: #ffc0c0;
}

.live-dialog-button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid rgba(74, 255, 194, 0.42);
  border-radius: 9px;
  background: rgba(14, 76, 84, 0.22);
  color: #baffea;
  font: inherit;
  font-size: 9px;
  font-weight: 680;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.live-dialog-button:hover {
  border-color: rgba(74, 255, 194, 0.82);
  background: rgba(20, 112, 112, 0.34);
  transform: translateY(-1px);
}

.live-dialog-button:focus-visible {
  outline: 2px solid rgba(85, 216, 255, 0.78);
  outline-offset: 2px;
}

.live-dialog-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #63ffd0;
  box-shadow: 0 0 10px rgba(99, 255, 208, 0.72);
}

.live-dialog-button.active {
  border-color: rgba(99, 255, 208, 0.88);
  background: linear-gradient(135deg, rgba(12, 116, 111, 0.58), rgba(16, 73, 112, 0.5));
  box-shadow:
    inset 0 0 16px rgba(99, 255, 208, 0.08),
    0 0 18px rgba(50, 225, 196, 0.17);
  color: #effffa;
}

.live-dialog-button.active .live-dialog-dot {
  animation: live-dialog-pulse 1.2s ease-in-out infinite;
}

.orb-zone.live-dialog .orbit-one,
.orb-zone.live-dialog .orbit-two {
  border-color: rgba(74, 255, 194, 0.24);
}

.orb-zone.live-dialog .jarvis-orb {
  box-shadow:
    inset 0 0 32px rgba(221, 255, 250, 0.82),
    0 0 34px rgba(74, 255, 194, 0.46),
    0 0 94px rgba(35, 151, 255, 0.42);
}

@keyframes live-dialog-pulse {
  0%,
  100% {
    opacity: 0.58;
    transform: scale(0.88);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

.icon-button {
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--cyan);
  font-size: 18px;
}

.messages {
  min-width: 0;
  min-height: 0;
  padding: 15px;
  overflow-y: auto;
  scrollbar-color: rgba(85, 216, 255, 0.28) transparent;
}

.message {
  max-width: 86%;
  margin-bottom: 13px;
}

.message.user {
  margin-left: auto;
}

.message-author {
  margin: 0 7px 5px;
  color: var(--cyan);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.message.user .message-author {
  color: #8ca5b7;
  text-align: right;
}

.message-body {
  padding: 11px 13px;
  border: 1px solid rgba(85, 216, 255, 0.14);
  border-radius: 5px 14px 14px 14px;
  background: rgba(12, 35, 58, 0.66);
  color: #d9edf7;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.message.user .message-body {
  border-color: rgba(105, 139, 181, 0.18);
  border-radius: 14px 5px 14px 14px;
  background: rgba(22, 43, 67, 0.76);
}

.message-image {
  display: block;
  width: min(520px, 100%);
  max-height: 340px;
  margin-top: 7px;
  object-fit: contain;
  border: 1px solid rgba(114, 202, 255, 0.2);
  border-radius: 12px;
  background: rgba(2, 8, 17, 0.82);
}

.message-meta {
  margin-top: 5px;
  padding: 0 7px;
  color: #61798d;
  font-size: 8px;
}

.feedback-controls {
  display: flex;
  gap: 7px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.feedback-controls button {
  border: 1px solid rgba(83, 198, 255, 0.24);
  border-radius: 7px;
  padding: 4px 8px;
  background: rgba(14, 49, 76, 0.55);
  color: #b9d7e8;
  cursor: pointer;
  font-size: 10px;
}

.message.loading .message-body::after {
  display: inline-block;
  width: 16px;
  content: "•••";
  animation: blink 1.2s steps(3) infinite;
}

.composer {
  width: 100%;
  min-width: 0;
  min-height: 62px;
  padding: 9px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: end;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.image-attachment-preview {
  min-height: 64px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: rgba(5, 20, 37, 0.9);
  color: #a9c8d9;
  font-size: 10px;
}

.image-attachment-preview img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 1px solid rgba(114, 202, 255, 0.22);
  border-radius: 9px;
}

.image-attachment-preview strong,
.image-attachment-preview span {
  display: block;
}

.image-attachment-preview span {
  margin-top: 3px;
  color: #658096;
  font-size: 9px;
}

.image-attachment-preview button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 117, 143, 0.26);
  border-radius: 8px;
  cursor: pointer;
  background: rgba(82, 22, 42, 0.18);
  color: #ffadbc;
  font-size: 18px;
}

.composer textarea {
  min-width: 0;
  min-height: 42px;
  max-height: 130px;
  padding: 11px 12px;
  resize: none;
  border: 1px solid rgba(106, 187, 232, 0.17);
  border-radius: 11px;
  outline: none;
  background: rgba(8, 24, 42, 0.82);
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

.composer textarea:focus {
  border-color: rgba(85, 216, 255, 0.46);
  box-shadow: 0 0 0 3px rgba(85, 216, 255, 0.06);
}

.attach-button,
.mic-small,
.send-button {
  height: 42px;
  border-radius: 10px;
  cursor: pointer;
}

.attach-button {
  width: 42px;
  border: 1px solid rgba(114, 202, 255, 0.24);
  background: rgba(9, 39, 62, 0.7);
  color: #9fdcf2;
  font-size: 20px;
}

.mic-small {
  width: 42px;
  border: 1px solid var(--line-strong);
  background: rgba(11, 58, 87, 0.68);
  color: var(--cyan);
}

.send-button {
  padding: 0 17px;
  border: 1px solid rgba(109, 220, 255, 0.45);
  background: linear-gradient(145deg, #0877c5, #0756a5);
  color: white;
  font-size: 11px;
  font-weight: 650;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.action-list,
.task-list,
.memory-list,
.insight-list,
.draft-list {
  display: grid;
  gap: 9px;
}

.action-card,
.task-card,
.memory-card,
.insight-card,
.draft-card {
  padding: 11px;
  border: 1px solid rgba(106, 187, 232, 0.13);
  border-radius: 12px;
  background: rgba(7, 22, 39, 0.66);
}

.action-list {
  max-height: 300px;
  overflow-y: auto;
  scrollbar-color: rgba(85, 216, 255, 0.28) transparent;
}

.action-card.pending,
.action-card.approved {
  border-color: rgba(255, 201, 92, 0.35);
  box-shadow: inset 3px 0 0 rgba(255, 201, 92, 0.72);
}

.action-card.completed {
  border-color: rgba(74, 255, 194, 0.25);
}

.action-card.failed {
  border-color: rgba(255, 115, 115, 0.36);
}

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

.action-id {
  color: var(--cyan);
  font-size: 8px;
  font-weight: 740;
  letter-spacing: 0.09em;
}

.action-state {
  padding: 3px 6px;
  border: 1px solid rgba(120, 183, 216, 0.2);
  border-radius: 999px;
  color: var(--muted);
  font-size: 7px;
  white-space: nowrap;
}

.action-state.pending,
.action-state.approved {
  border-color: rgba(255, 201, 92, 0.35);
  color: #ffd98f;
}

.action-state.completed {
  border-color: rgba(74, 255, 194, 0.3);
  color: var(--green);
}

.action-state.failed,
.action-state.rejected,
.action-state.expired {
  border-color: rgba(255, 115, 115, 0.28);
  color: #ffaaaa;
}

.action-summary {
  margin-top: 7px;
  color: #d9edf7;
  font-size: 10px;
  line-height: 1.4;
}

.action-requested-by {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
}

.action-error {
  margin-top: 7px;
  color: #ffaaaa;
  font-size: 8px;
  line-height: 1.35;
}

.action-controls {
  margin-top: 9px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.action-approve,
.action-reject,
.action-pause-button {
  border: 1px solid rgba(85, 216, 255, 0.28);
  border-radius: 7px;
  cursor: pointer;
  background: rgba(10, 71, 103, 0.42);
  color: #b9eaff;
  font-size: 8px;
}

.action-approve,
.action-reject {
  padding: 6px 7px;
}

.action-reject {
  border-color: rgba(255, 115, 115, 0.25);
  background: rgba(108, 25, 39, 0.18);
  color: #ffc0c0;
}

.action-pause-button {
  padding: 5px 7px;
  border-color: rgba(255, 115, 115, 0.32);
  background: rgba(108, 25, 39, 0.18);
  color: #ffc0c0;
  text-transform: none;
}

.action-pause-button.paused {
  border-color: rgba(74, 255, 194, 0.32);
  background: rgba(25, 131, 104, 0.14);
  color: var(--green);
}

.memory-list {
  max-height: 310px;
  overflow-y: auto;
  scrollbar-color: rgba(85, 216, 255, 0.28) transparent;
}

.memory-card {
  position: relative;
}

.memory-card.due {
  border-color: rgba(255, 201, 92, 0.42);
  background: rgba(54, 38, 13, 0.38);
  box-shadow: inset 3px 0 0 rgba(255, 201, 92, 0.7);
}

.memory-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.memory-kind {
  color: var(--cyan);
  font-size: 8px;
  font-weight: 740;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.memory-due {
  color: #ffd98f;
  font-size: 8px;
}

.memory-title {
  margin-top: 7px;
  color: #d9edf7;
  font-size: 10px;
  font-weight: 680;
  line-height: 1.35;
}

.memory-content {
  margin-top: 5px;
  display: -webkit-box;
  overflow: hidden;
  color: #9eb9c9;
  font-size: 9px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.memory-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
}

.memory-action {
  flex: 1;
  padding: 5px 7px;
  border: 1px solid rgba(83, 198, 255, 0.22);
  border-radius: 7px;
  background: rgba(14, 49, 76, 0.48);
  color: #b9ddea;
  cursor: pointer;
  font-size: 8px;
}

.memory-action:hover {
  border-color: rgba(83, 198, 255, 0.52);
  color: #effbff;
}

.memory-notification.enabled {
  border-color: rgba(74, 255, 194, 0.52);
  color: var(--green);
}

.draft-top {
  display: flex;
  justify-content: space-between;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 700;
}

.draft-incoming,
.draft-answer {
  margin-top: 8px;
  white-space: pre-wrap;
  font-size: 10px;
  line-height: 1.45;
}

.draft-incoming {
  color: var(--muted);
}

.draft-answer {
  color: #d7ebf6;
}

.draft-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 9px;
}

.draft-copy,
.draft-correct {
  border: 1px solid rgba(83, 198, 255, 0.24);
  border-radius: 7px;
  padding: 6px;
  background: rgba(14, 49, 76, 0.55);
  color: #bfe8fb;
  cursor: pointer;
  font-size: 9px;
}

.draft-correct {
  background: rgba(24, 74, 68, 0.55);
  color: #bff8e6;
}

.task-top,
.insight-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-id,
.manager-id {
  color: var(--cyan);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.08em;
}

.task-status {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 8px;
}

.task-status.running {
  color: var(--cyan);
}

.task-status.completed {
  color: var(--green);
}

.task-objective,
.insight-summary {
  margin-top: 8px;
  color: #c5dce8;
  font-size: 10px;
  line-height: 1.45;
}

.task-notes {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.task-report {
  margin-top: 10px;
  border-top: 1px solid rgba(83, 198, 255, 0.18);
  padding-top: 8px;
}

.task-report summary {
  color: var(--cyan);
  cursor: pointer;
  font-size: 11px;
}

.task-report-body {
  margin-top: 8px;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  color: #d9ebf7;
  font-size: 11px;
  line-height: 1.55;
}

.agent-chips {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.agent-chip {
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(33, 91, 128, 0.3);
  color: #93b8ca;
  font-size: 8px;
}

.run-task {
  width: 100%;
  margin-top: 9px;
  padding: 6px;
  border: 1px solid rgba(85, 216, 255, 0.25);
  border-radius: 7px;
  cursor: pointer;
  background: rgba(10, 71, 103, 0.42);
  color: #b9eaff;
  font-size: 9px;
}

.score-row {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.score {
  padding: 5px;
  border-radius: 6px;
  background: rgba(18, 54, 79, 0.42);
  text-align: center;
}

.score b {
  display: block;
  color: var(--cyan-bright);
  font-size: 12px;
}

.score span {
  color: var(--muted);
  font-size: 7px;
}

.empty-state {
  padding: 18px 8px;
  color: #5f788c;
  font-size: 10px;
  text-align: center;
}

.panel-divider {
  height: 1px;
  margin: 20px 0 14px;
  background: var(--line);
}

.footer {
  min-height: 36px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(114, 202, 255, 0.1);
  color: #4f687c;
  font-size: 9px;
  letter-spacing: 0.04em;
}

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

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

@keyframes shimmer {
  0%, 30% { transform: translateX(-65%) rotate(0deg); }
  70%, 100% { transform: translateX(65%) rotate(15deg); }
}

@keyframes listen-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

@keyframes thinking-pulse {
  0%, 100% { filter: hue-rotate(0deg) brightness(1); }
  50% { filter: hue-rotate(24deg) brightness(1.25); }
}

@keyframes blink {
  50% { opacity: 0.25; }
}

@media (max-width: 1120px) {
  .workspace {
    height: auto;
    min-height: calc(100vh - 112px);
    grid-template-columns: 240px minmax(420px, 1fr);
  }

  .right-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .right-panel .panel-divider {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    min-height: 68px;
    padding: 12px 14px;
  }

  .safety-pill,
  #clock {
    display: none;
  }

  .workspace {
    padding: 10px;
    display: flex;
    flex-direction: column;
    height: auto;
  }

  .left-panel {
    order: 2;
  }

  .center-stage {
    order: 1;
    grid-template-rows: 260px minmax(430px, 70vh);
  }

  .right-panel {
    order: 3;
    display: block;
  }

  .chat-toolbar {
    flex-wrap: wrap;
  }

  .ghost-button {
    display: none;
  }

  .voice-test-button {
    display: inline-flex;
  }

  .message {
    max-width: 95%;
  }

  .account-form-grid {
    grid-template-columns: 1fr;
  }

  .registration-request-row {
    align-items: stretch;
    flex-direction: column;
  }

  .registration-request-controls {
    grid-template-columns: 1fr 1fr;
  }

  .registration-role {
    grid-column: 1 / -1;
  }
}
