:root {
  color-scheme: dark;
  --ink: #f4fff9;
  --muted: #91aaa0;
  --muted-strong: #b9ccc4;
  --surface: rgba(10, 27, 22, 0.82);
  --surface-strong: rgba(8, 22, 18, 0.96);
  --surface-soft: rgba(20, 48, 39, 0.5);
  --line: rgba(184, 255, 219, 0.12);
  --line-bright: rgba(77, 255, 156, 0.34);
  --green: #2fff85;
  --green-soft: #69f5a6;
  --lime: #aaff4b;
  --teal: #35edc3;
  --blue: #73cfff;
  --amber: #ffcb69;
  --red: #ff6678;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.38);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, Aptos, "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #06100d;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% -10%, rgba(47, 255, 133, 0.1), transparent 32rem),
    radial-gradient(circle at 95% 15%, rgba(45, 222, 255, 0.08), transparent 31rem),
    #06100d;
  overflow-x: hidden;
}

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

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:not(:disabled),
a,
label[for] {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

button.is-busy {
  position: relative;
  color: transparent !important;
}

button.is-busy > * {
  visibility: hidden !important;
}

button.is-busy::after {
  content: attr(data-busy-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: inherit;
  color: var(--ink);
  white-space: nowrap;
}

.primary-button.is-busy::after,
.send-button.is-busy::after {
  color: #02110a;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--green);
  color: #021009;
  font-weight: 800;
  transform: translateY(-140%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(108, 255, 173, 0.9);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.ambient__grid {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(99, 255, 168, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 255, 168, 0.07) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.ambient__grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(85, 155, 255, 0.08), transparent 52%);
  opacity: 0.018;
  filter: grayscale(1);
}

.ambient__glow {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.1;
}

.ambient__glow--one {
  top: 16%;
  left: -260px;
  background: var(--green);
}

.ambient__glow--two {
  right: -260px;
  bottom: -120px;
  background: var(--teal);
}

.ambient__scan {
  position: absolute;
  inset: -30%;
  background: linear-gradient(110deg, transparent 46%, rgba(89, 255, 171, 0.028) 50%, transparent 54%);
  animation: ambient-scan 14s linear infinite;
}

@keyframes ambient-scan {
  to { transform: translateX(28%); }
}

.eyebrow,
.kicker {
  margin: 0;
  color: var(--green-soft);
  font-size: 0.69rem;
  font-weight: 850;
  letter-spacing: 0.18em;
  line-height: 1.3;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 9px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(47, 255, 133, 0.1), 0 0 22px var(--green);
  animation: dot-breathe 2s ease-in-out infinite;
}

@keyframes dot-breathe {
  50% { opacity: 0.55; transform: scale(0.82); }
}

.glass-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(21, 52, 42, 0.72), rgba(6, 18, 15, 0.9)),
    var(--surface);
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(22px);
}

.login-screen {
  min-height: 100vh;
  padding: max(34px, var(--safe-top)) 32px max(34px, var(--safe-bottom));
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(1180px, 100%);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 42px;
}

.login-brand__name {
  margin: 3px 0 0;
  font-size: 1.16rem;
  font-weight: 850;
  letter-spacing: 0.09em;
}

.login-brand__name span {
  color: var(--green);
}

.wt-mark {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 1px solid rgba(84, 255, 157, 0.34);
  border-radius: 15px 15px 15px 5px;
  color: var(--green);
  background: linear-gradient(145deg, rgba(47, 255, 133, 0.16), rgba(47, 255, 133, 0.025));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 0 26px rgba(47, 255, 133, 0.12);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.18em;
  padding-right: 0.18em;
  text-transform: lowercase;
}

.wt-mark--large {
  width: 58px;
  height: 58px;
  border-radius: 19px 19px 19px 6px;
  font-size: 1.55rem;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(390px, 0.72fr);
  align-items: center;
  gap: clamp(46px, 8vw, 110px);
}

.login-intro {
  position: relative;
  padding: 40px 0 48px;
}

.login-intro h1 {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 21px 0 22px;
  font-size: clamp(3.2rem, 7vw, 6.7rem);
  font-weight: 760;
  letter-spacing: -0.065em;
  line-height: 0.91;
}

.login-intro h1 span {
  color: transparent;
  background: linear-gradient(110deg, var(--green), var(--teal) 60%, #d5ffe5);
  background-clip: text;
  -webkit-background-clip: text;
}

.login-intro .lead {
  position: relative;
  z-index: 1;
  max-width: 610px;
  margin: 0;
  color: var(--muted-strong);
  font-size: clamp(1.03rem, 1.7vw, 1.23rem);
  line-height: 1.75;
}

.trust-strip {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 32px;
}

.trust-strip span {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(10, 30, 24, 0.6);
  font-size: 0.79rem;
  font-weight: 700;
}

.trust-strip span::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.neural-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
}

.neural-orb--login {
  position: absolute;
  z-index: 0;
  top: -54px;
  right: 9%;
  width: 330px;
  height: 330px;
  opacity: 0.4;
  transform: rotate(-8deg);
}

.neural-orb__ring {
  position: absolute;
  inset: 11%;
  border: 1px solid rgba(89, 255, 164, 0.32);
  border-radius: 44% 56% 58% 42% / 45% 38% 62% 55%;
  box-shadow: 0 0 30px rgba(47, 255, 133, 0.08);
}

.neural-orb__ring--a { animation: orbit-a 9s linear infinite; }
.neural-orb__ring--b { inset: 20%; border-color: rgba(68, 234, 255, 0.3); animation: orbit-b 7s linear infinite; }
.neural-orb__ring--c { inset: 30%; border-color: rgba(178, 255, 86, 0.32); animation: orbit-a 5s linear infinite reverse; }

.neural-orb__core {
  position: relative;
  display: grid;
  place-items: center;
  width: 42%;
  height: 42%;
  border: 1px solid rgba(114, 255, 175, 0.64);
  border-radius: 50%;
  color: #dfffea;
  background: radial-gradient(circle at 35% 30%, rgba(193, 255, 218, 0.42), rgba(47, 255, 133, 0.18) 25%, rgba(5, 29, 20, 0.94) 66%);
  box-shadow: 0 0 50px rgba(47, 255, 133, 0.26), inset 0 0 25px rgba(47, 255, 133, 0.19);
  font-weight: 900;
}

.neural-orb--login .neural-orb__core span {
  font-size: 2.7rem;
}

@keyframes orbit-a { to { transform: rotate(360deg); } }
@keyframes orbit-b { to { transform: rotate(-360deg) scale(1.04); } }

.login-card {
  position: relative;
  z-index: 2;
  padding: clamp(26px, 4vw, 42px);
}

.card-head,
.panel-header,
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.card-head h2,
.card-head h3,
.list-toolbar h3,
.panel-header h2 {
  margin: 5px 0 0;
  font-size: 1.44rem;
  letter-spacing: -0.025em;
}

.secure-chip,
.status-chip,
.control-badge,
.privacy-badge,
.count-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid rgba(67, 255, 146, 0.22);
  border-radius: 999px;
  color: var(--green-soft);
  background: rgba(47, 255, 133, 0.07);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.form-intro,
.help-text {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.form-intro {
  margin: 18px 0 25px;
}

.field {
  display: grid;
  gap: 9px;
  margin-bottom: 18px;
}

.field__label,
.tone-picker legend {
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.01em;
}

.field__control {
  min-height: 54px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(193, 255, 220, 0.13);
  border-radius: 15px;
  background: rgba(1, 12, 8, 0.53);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field__control:focus-within {
  border-color: rgba(47, 255, 133, 0.6);
  background: rgba(4, 20, 14, 0.78);
  box-shadow: 0 0 0 4px rgba(47, 255, 133, 0.08), 0 0 24px rgba(47, 255, 133, 0.07);
}

.field__control--prominent {
  min-height: 64px;
  border-color: rgba(47, 255, 133, 0.28);
  background: rgba(17, 48, 35, 0.5);
}

.field__icon {
  width: 48px;
  flex: 0 0 auto;
  color: var(--green-soft);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 900;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.field input,
.field select {
  min-height: 52px;
  padding: 0 15px;
}

.field__icon + input {
  padding-left: 0;
}

.field textarea {
  min-height: 112px;
  resize: vertical;
  padding: 15px;
  line-height: 1.55;
}

.field select {
  color-scheme: dark;
}

/* Native iPhone/Windows option menus may force a light popup even in a dark page. */
.field select option,
.field select optgroup {
  color: #07140d;
  background: #ffffff;
}

.field input::placeholder,
.field textarea::placeholder,
.chat-composer textarea::placeholder,
.search-box input::placeholder {
  color: #667c73;
}

.icon-button {
  min-width: 48px;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  color: var(--muted-strong);
  background: transparent;
}

.icon-button--inside {
  margin-right: 3px;
  font-size: 0.72rem;
  font-weight: 780;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button,
.send-button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 15px;
  font-weight: 820;
  transition: transform 150ms ease, filter 150ms ease, border-color 150ms ease, background 150ms ease;
}

.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled),
.danger-button:hover:not(:disabled),
.send-button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.primary-button {
  padding: 0 20px;
  border: 1px solid #75ffae;
  color: #02110a;
  background: linear-gradient(110deg, var(--green), #7bffa9 62%, var(--teal));
  box-shadow: 0 12px 32px rgba(47, 255, 133, 0.16), inset 0 1px rgba(255, 255, 255, 0.55);
}

.primary-button--wide {
  width: 100%;
  margin-top: 5px;
}

.button-arrow {
  font-size: 1.25rem;
}

.secondary-button {
  padding: 0 19px;
  border: 1px solid rgba(94, 255, 163, 0.24);
  color: var(--green-soft);
  background: rgba(47, 255, 133, 0.07);
}

.danger-button {
  padding: 0 19px;
  border: 1px solid rgba(255, 102, 120, 0.42);
  color: #fff;
  background: rgba(255, 79, 100, 0.2);
}

.text-button {
  min-height: 48px;
  padding: 0;
  border: 0;
  color: var(--green-soft);
  background: none;
  font-size: 0.79rem;
}

.privacy-note {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 0;
  color: #748b81;
  font-size: 0.74rem;
  line-height: 1.5;
  text-align: center;
}

.form-error {
  margin: -4px 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 102, 120, 0.3);
  border-radius: 12px;
  color: #ffc2c9;
  background: rgba(255, 70, 92, 0.09);
  font-size: 0.82rem;
  line-height: 1.5;
}

.workspace {
  min-height: 100vh;
  padding-bottom: var(--safe-bottom);
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  min-height: 78px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: max(12px, var(--safe-top)) clamp(18px, 3vw, 42px) 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 15, 12, 0.82);
  backdrop-filter: blur(24px) saturate(1.2);
}

.brand-button,
.profile-button,
.brain-pill,
.logout-button {
  min-height: 48px;
  border: 0;
  text-decoration: none;
}

.brand-button {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-button__text,
.profile-button__text,
.brain-pill > span:last-child {
  display: grid;
}

.brand-button__text strong {
  font-size: 0.92rem;
  letter-spacing: 0.11em;
}

.brand-button__text small {
  margin-top: 2px;
  color: var(--green-soft);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.brain-pill {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 43, 35, 0.6);
}

.brain-pill small {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.brain-pill strong {
  max-width: 230px;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brain-pulse {
  position: relative;
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 15px rgba(255, 203, 105, 0.62);
}

.brain-pulse.is-ready {
  background: var(--green);
  box-shadow: 0 0 15px rgba(47, 255, 133, 0.7);
}

.topbar__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 5px;
  border-radius: 14px;
  background: transparent;
}

.profile-button:hover {
  background: rgba(255, 255, 255, 0.035);
}

.avatar,
.assistant-avatar,
.settings-avatar {
  display: grid;
  place-items: center;
  border: 1px solid rgba(89, 255, 163, 0.3);
  border-radius: 50%;
  color: var(--green-soft);
  background: linear-gradient(145deg, rgba(47, 255, 133, 0.16), rgba(3, 22, 15, 0.9));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), 0 0 18px rgba(47, 255, 133, 0.08);
  font-weight: 850;
}

.avatar {
  width: 39px;
  height: 39px;
  font-size: 0.8rem;
}

.profile-button__text {
  text-align: left;
}

.profile-button__text strong {
  font-size: 0.77rem;
}

.profile-button__text small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.65rem;
}

.logout-button {
  min-width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.025);
}

.logout-button span:first-child {
  transform: rotate(180deg);
}

.logout-button__label {
  font-size: 0.72rem;
  font-weight: 760;
}

.main-content {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 26px clamp(16px, 3vw, 42px) 54px;
}

.command-hero {
  position: relative;
  min-height: 250px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(180px, 0.38fr);
  align-items: center;
  gap: clamp(28px, 5vw, 80px);
  overflow: hidden;
  margin-bottom: 21px;
  padding: clamp(27px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(100deg, rgba(6, 23, 17, 0.98), rgba(17, 48, 37, 0.73) 52%, rgba(5, 21, 17, 0.94)),
    radial-gradient(circle at 55% 40%, rgba(47, 255, 133, 0.19), transparent 38%);
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.025);
}

.command-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(83, 255, 159, 0.04), transparent),
    repeating-linear-gradient(90deg, transparent 0 74px, rgba(117, 255, 178, 0.035) 75px 76px);
  mask-image: linear-gradient(90deg, transparent, black 45%, black 70%, transparent);
}

.command-hero__copy,
.core-button,
.time-orbit {
  position: relative;
  z-index: 1;
}

.command-hero h1 {
  margin: 9px 0 8px;
  font-size: clamp(1.85rem, 3.2vw, 3.25rem);
  letter-spacing: -0.045em;
}

.command-hero__copy > p:last-of-type {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.96rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 25px;
}

.hero-stats button {
  min-width: 118px;
  min-height: 57px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  text-align: left;
  background: rgba(1, 16, 10, 0.35);
}

.hero-stats button:hover {
  border-color: var(--line-bright);
  background: rgba(47, 255, 133, 0.06);
}

.hero-stats strong {
  color: var(--green-soft);
  font-size: 1.18rem;
}

.hero-stats span {
  max-width: 76px;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.2;
}

.core-button {
  min-width: 186px;
  min-height: 186px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.core-button__halo {
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(89, 255, 164, 0.16);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 255, 133, 0.08), transparent 65%);
  box-shadow: 0 0 54px rgba(47, 255, 133, 0.11);
  transition: transform 200ms ease, border-color 200ms ease;
}

.core-button:hover .core-button__halo {
  transform: scale(1.06);
  border-color: rgba(89, 255, 164, 0.42);
}

.core-button .neural-orb {
  width: 150px;
  height: 150px;
  transition: transform 200ms ease;
}

.core-button:hover .neural-orb {
  transform: scale(1.04);
}

.core-button__label {
  position: absolute;
  bottom: -3px;
  display: grid;
  min-width: 132px;
  padding: 7px 14px;
  border: 1px solid rgba(83, 255, 157, 0.22);
  border-radius: 999px;
  background: rgba(4, 19, 13, 0.9);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.core-button__label small {
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.core-button__label strong {
  max-width: 155px;
  margin-top: 1px;
  overflow: hidden;
  color: var(--green-soft);
  font-size: 0.77rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-orbit {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 18px;
}

.analog-clock {
  position: relative;
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  border: 1px solid rgba(103, 255, 168, 0.28);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(48, 114, 81, 0.16), rgba(1, 13, 8, 0.74));
  box-shadow: inset 0 0 24px rgba(47, 255, 133, 0.08), 0 0 28px rgba(47, 255, 133, 0.06);
}

.clock-mark {
  position: absolute;
  background: var(--green-soft);
  opacity: 0.55;
}

.clock-mark--12,
.clock-mark--6 { left: calc(50% - 1px); width: 2px; height: 6px; }
.clock-mark--12 { top: 7px; }
.clock-mark--6 { bottom: 7px; }
.clock-mark--3,
.clock-mark--9 { top: calc(50% - 1px); width: 6px; height: 2px; }
.clock-mark--3 { right: 7px; }
.clock-mark--9 { left: 7px; }

.clock-hand {
  position: absolute;
  z-index: 2;
  left: calc(50% - 1px);
  bottom: 50%;
  width: 2px;
  border-radius: 2px;
  background: #dfffea;
  transform-origin: 50% 100%;
}

.clock-hand--hour { height: 23px; }
.clock-hand--minute { height: 32px; background: var(--green-soft); }
.clock-hand--second { width: 1px; height: 35px; background: var(--amber); }

.clock-pin {
  position: absolute;
  z-index: 3;
  top: calc(50% - 3px);
  left: calc(50% - 3px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 8px var(--green);
}

.time-orbit > div:last-child {
  display: grid;
  min-width: 112px;
}

.time-orbit strong {
  font-size: clamp(1.25rem, 2vw, 1.72rem);
  letter-spacing: -0.03em;
}

.time-orbit span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.3;
}

.module-menu {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 21px;
}

.module-menu.has-team-access {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.module-button {
  position: relative;
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 19px;
  text-align: left;
  background: rgba(9, 28, 22, 0.65);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.02);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.module-button:hover {
  transform: translateY(-2px);
  border-color: rgba(91, 255, 160, 0.28);
}

.module-button.is-active {
  border-color: rgba(77, 255, 156, 0.45);
  background: linear-gradient(135deg, rgba(47, 255, 133, 0.14), rgba(11, 38, 28, 0.82));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.03), 0 12px 30px rgba(47, 255, 133, 0.07);
}

.module-button.is-active::after {
  content: "";
  position: absolute;
  right: 13px;
  bottom: 8px;
  left: 13px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
}

.module-button__icon {
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(77, 255, 156, 0.2);
  border-radius: 14px;
  color: var(--green-soft);
  background: rgba(47, 255, 133, 0.07);
  font-size: 0.82rem;
  font-weight: 900;
}

.module-button > span:last-child {
  min-width: 0;
  display: grid;
}

.module-button strong {
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-button small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.63rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-panel {
  animation: view-enter 260ms ease both;
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(8px); }
}

.conversation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 0.31fr);
  gap: 18px;
}

.chat-panel {
  min-height: 690px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  min-height: 92px;
  padding: 18px clamp(18px, 3vw, 30px);
  border-bottom: 1px solid var(--line);
  background: rgba(6, 24, 17, 0.62);
}

.assistant-identity {
  display: flex;
  align-items: center;
  gap: 13px;
}

.assistant-avatar {
  width: 50px;
  height: 50px;
}

.status-chip > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.status-chip--ready {
  color: var(--green-soft);
}

.status-chip--warning {
  border-color: rgba(255, 203, 105, 0.25);
  color: var(--amber);
  background: rgba(255, 188, 58, 0.07);
}

.chat-messages {
  min-height: 360px;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 27px clamp(17px, 3vw, 32px) 18px;
  scroll-behavior: smooth;
  scrollbar-color: rgba(74, 255, 153, 0.26) transparent;
}

.message {
  max-width: min(760px, 86%);
  display: grid;
  gap: 7px;
  margin: 0 0 20px;
}

.message--user {
  justify-items: end;
  margin-left: auto;
}

.message__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 5px;
  color: var(--muted);
  font-size: 0.65rem;
}

.message__bubble {
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: 18px 18px 18px 5px;
  color: #dcebe4;
  background: rgba(21, 50, 40, 0.7);
  font-size: 0.93rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.message--user .message__bubble {
  border-color: rgba(62, 255, 146, 0.25);
  border-radius: 18px 18px 5px 18px;
  color: #eafff1;
  background: linear-gradient(135deg, rgba(47, 255, 133, 0.18), rgba(12, 50, 34, 0.82));
}

.message__engine {
  color: var(--amber);
}

.message__citations {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}

.message__citations a,
.message__citations span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--green-soft);
  background: rgba(47, 255, 133, 0.05);
  font-size: 0.68rem;
  font-weight: 750;
  text-decoration: none;
}

.empty-conversation {
  min-height: 300px;
  display: grid;
  place-items: center;
  padding: 34px;
  text-align: center;
}

.empty-conversation__inner {
  max-width: 480px;
}

.empty-conversation .mini-orb {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
}

.empty-conversation h3 {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.empty-conversation p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px clamp(18px, 3vw, 32px) 13px;
  color: var(--muted);
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-soft);
  animation: typing 1s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 150ms; }
.typing-indicator span:nth-child(3) { animation-delay: 300ms; }

.typing-indicator em {
  margin-left: 8px;
  font-size: 0.7rem;
  font-style: normal;
}

@keyframes typing { 50% { opacity: 0.25; transform: translateY(-3px); } }

.quick-prompts {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px clamp(17px, 3vw, 30px) 13px;
  scrollbar-width: none;
}

.quick-prompts::-webkit-scrollbar { display: none; }

.quick-prompts button {
  min-height: 44px;
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.72rem;
  font-weight: 700;
}

.quick-prompts button:hover {
  border-color: var(--line-bright);
  color: var(--green-soft);
}

.chat-composer {
  margin: 0 clamp(14px, 2vw, 25px) 21px;
  overflow: hidden;
  border: 1px solid rgba(89, 255, 164, 0.2);
  border-radius: 20px;
  background: rgba(2, 15, 10, 0.76);
  box-shadow: 0 0 0 5px rgba(47, 255, 133, 0.025);
}

.chat-composer:focus-within {
  border-color: rgba(89, 255, 164, 0.5);
  box-shadow: 0 0 0 5px rgba(47, 255, 133, 0.06), 0 0 28px rgba(47, 255, 133, 0.07);
}

.chat-composer textarea {
  width: 100%;
  min-height: 66px;
  max-height: 180px;
  display: block;
  resize: none;
  padding: 18px 18px 9px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  line-height: 1.5;
}

.composer-actions {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 7px 7px 10px;
}

.voice-button {
  min-width: 48px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 0;
  border-radius: 12px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.7rem;
  font-weight: 750;
}

.voice-button.is-listening {
  color: #07140d;
  background: var(--green);
  box-shadow: 0 0 20px rgba(47, 255, 133, 0.26);
}

.voice-button.is-coming-soon {
  border: 1px dashed rgba(145, 170, 160, 0.28);
  opacity: 0.72;
}

.voice-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.voice-preview-row span {
  color: var(--muted-strong);
  font-size: 0.72rem;
}

.composer-hint {
  flex: 1 1 auto;
  color: #657b72;
  font-size: 0.66rem;
}

.send-button {
  min-width: 88px;
  min-height: 43px;
  padding: 0 12px 0 16px;
  border: 1px solid #75ffad;
  color: #02110a;
  background: linear-gradient(110deg, var(--green), var(--teal));
}

.send-button span:last-child {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
}

.conversation-aside {
  display: grid;
  align-content: start;
  gap: 18px;
}

.brain-card,
.privacy-card,
.production-card,
.isolation-card {
  padding: 25px;
}

.brain-card__visual {
  position: relative;
  width: 102px;
  height: 102px;
  display: grid;
  place-items: center;
  margin: 0 0 24px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 255, 133, 0.16), transparent 68%);
}

.brain-card__visual span {
  position: absolute;
  inset: 6%;
  border: 1px solid rgba(75, 255, 155, 0.3);
  border-radius: 45% 55% 38% 62%;
  animation: orbit-a 8s linear infinite;
}

.brain-card__visual span:nth-child(2) { inset: 17%; border-color: rgba(66, 226, 255, 0.35); animation-direction: reverse; animation-duration: 6s; }
.brain-card__visual span:nth-child(3) { inset: 29%; animation-duration: 4s; }
.brain-card__visual strong { color: var(--green-soft); font-size: 0.85rem; }

.brain-card h3,
.privacy-card h3,
.production-card h3,
.isolation-card h3,
.guard-banner h3,
.research-card h3 {
  margin: 6px 0 9px;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.brain-card > p:not(.eyebrow),
.privacy-card p:last-child,
.production-card > p,
.isolation-card > p:last-child,
.guard-banner p,
.research-card > div > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

.readiness {
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 203, 105, 0.2);
  border-radius: 13px;
  color: var(--amber);
  background: rgba(255, 188, 58, 0.06);
  font-size: 0.72rem;
}

.readiness span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.readiness--ready {
  border-color: rgba(47, 255, 133, 0.22);
  color: var(--green-soft);
  background: rgba(47, 255, 133, 0.06);
}

.privacy-card {
  display: flex;
  gap: 15px;
}

.privacy-card__icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(47, 255, 133, 0.2);
  border-radius: 13px;
  color: var(--green-soft);
  background: rgba(47, 255, 133, 0.07);
}

.section-heading {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 20px clamp(7px, 2vw, 22px);
}

.section-heading h2 {
  margin: 7px 0 7px;
  font-size: clamp(1.8rem, 3vw, 2.75rem);
  letter-spacing: -0.045em;
}

.section-heading p:last-child {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.privacy-badge {
  color: var(--blue);
  border-color: rgba(115, 207, 255, 0.22);
  background: rgba(68, 184, 255, 0.07);
}

.privacy-badge strong {
  margin-left: -3px;
}

.control-badge {
  color: var(--green-soft);
}

.content-grid {
  display: grid;
  gap: 18px;
}

.content-grid--memory,
.content-grid--training {
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.28fr);
}

.content-grid--training.is-read-only {
  grid-template-columns: 1fr;
}

.form-card,
.list-card,
.queue-panel,
.research-card,
.personality-card {
  padding: clamp(20px, 3vw, 30px);
}

.form-card .card-head {
  margin-bottom: 24px;
}

.mini-orb {
  width: 38px;
  height: 38px;
  display: block;
  border: 1px solid rgba(87, 255, 163, 0.4);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b9ffd4, rgba(47, 255, 133, 0.3) 20%, rgba(2, 18, 11, 0.9) 65%);
  box-shadow: 0 0 24px rgba(47, 255, 133, 0.18);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.list-toolbar {
  min-height: 58px;
  margin-bottom: 18px;
}

.search-box {
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.18);
}

.search-box:focus-within {
  border-color: var(--line-bright);
}

.search-box input {
  width: 160px;
  min-height: 42px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.card-list,
.learning-list {
  display: grid;
  gap: 10px;
}

.list-item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(2, 15, 10, 0.36);
}

.list-item__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(73, 255, 153, 0.18);
  border-radius: 13px;
  color: var(--green-soft);
  background: rgba(47, 255, 133, 0.055);
  font-size: 0.72rem;
  font-weight: 850;
}

.list-item__body {
  min-width: 0;
}

.list-item__body h4 {
  margin: 1px 0 6px;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.list-item__body p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.list-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.meta-chip {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.6rem;
  font-weight: 730;
  text-transform: capitalize;
}

.item-action {
  min-width: 48px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.7rem;
  font-weight: 750;
}

.item-action:hover {
  border-color: rgba(255, 102, 120, 0.35);
  color: #ff9eaa;
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 34px;
  border: 1px dashed rgba(175, 255, 210, 0.13);
  border-radius: 19px;
  color: var(--muted);
  text-align: center;
}

.empty-state div {
  max-width: 390px;
}

.empty-state strong {
  display: block;
  margin-bottom: 7px;
  color: var(--muted-strong);
}

.empty-state span {
  font-size: 0.79rem;
  line-height: 1.6;
}

.upload-zone {
  min-height: 170px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  margin: 0 0 20px;
  padding: 22px;
  border: 1px dashed rgba(77, 255, 155, 0.34);
  border-radius: 19px;
  text-align: center;
  background: rgba(47, 255, 133, 0.035);
  transition: border-color 160ms ease, background 160ms ease;
}

.upload-zone:hover,
.upload-zone:focus-within {
  border-color: rgba(77, 255, 155, 0.7);
  background: rgba(47, 255, 133, 0.065);
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-zone__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 5px;
  border: 1px solid rgba(76, 255, 155, 0.28);
  border-radius: 15px;
  color: var(--green-soft);
  background: rgba(47, 255, 133, 0.08);
  font-size: 1.1rem;
}

.upload-zone strong {
  font-size: 0.9rem;
}

.upload-zone > span:not(.upload-zone__icon) {
  color: var(--muted);
  font-size: 0.69rem;
}

.upload-zone em {
  max-width: 100%;
  margin-top: 5px;
  overflow: hidden;
  color: var(--green-soft);
  font-size: 0.71rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress {
  display: grid;
  gap: 8px;
  margin: -2px 0 16px;
}

.upload-progress > span {
  height: 6px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.upload-progress i {
  width: 20%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--teal));
  box-shadow: 0 0 12px rgba(47, 255, 133, 0.4);
  transition: width 250ms ease;
}

.upload-progress strong {
  color: var(--muted);
  font-size: 0.68rem;
}

.locked-state {
  min-height: 130px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 24px;
}

.locked-state__icon {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(115, 207, 255, 0.23);
  border-radius: 16px;
  color: var(--blue);
  background: rgba(73, 183, 255, 0.07);
}

.locked-state h3 {
  margin: 0 0 6px;
}

.locked-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.learning-compose {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(280px, 0.82fr);
  gap: 18px;
  margin-bottom: 18px;
}

.research-card {
  align-self: start;
  border-color: rgba(115, 207, 255, 0.17);
  background: linear-gradient(145deg, rgba(18, 47, 48, 0.65), rgba(5, 20, 19, 0.93));
}

.research-card > div:first-child {
  margin-bottom: 24px;
}

.queue-panel {
  min-height: 280px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.filter-pills button {
  min-height: 38px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.66rem;
  font-weight: 750;
}

.filter-pills button.is-active {
  border-color: rgba(47, 255, 133, 0.32);
  color: var(--green-soft);
  background: rgba(47, 255, 133, 0.08);
}

.learning-item {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(3, 16, 11, 0.4);
}

.learning-item__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.learning-item h4 {
  margin: 0 0 6px;
  font-size: 0.94rem;
}

.learning-item p {
  max-width: 1000px;
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.status-label {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.61rem;
  font-weight: 850;
  text-transform: uppercase;
}

.status-label--pending { color: var(--amber); border-color: rgba(255, 203, 105, 0.22); background: rgba(255, 203, 105, 0.06); }
.status-label--approved { color: var(--green-soft); border-color: rgba(47, 255, 133, 0.22); background: rgba(47, 255, 133, 0.06); }
.status-label--rejected { color: #ff98a4; border-color: rgba(255, 102, 120, 0.22); background: rgba(255, 102, 120, 0.06); }

.learning-item__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  margin-top: 14px;
}

.learning-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.review-actions {
  display: flex;
  gap: 7px;
}

.review-actions button {
  min-height: 44px;
  padding: 7px 13px;
  border-radius: 12px;
  font-size: 0.69rem;
  font-weight: 800;
}

.review-approve {
  border: 1px solid rgba(47, 255, 133, 0.3);
  color: var(--green-soft);
  background: rgba(47, 255, 133, 0.08);
}

.review-reject {
  border: 1px solid rgba(255, 102, 120, 0.25);
  color: #ff9ca7;
  background: rgba(255, 102, 120, 0.06);
}

.za-badge {
  min-width: 93px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.74rem;
  font-weight: 850;
}

.za-badge i {
  width: 12px;
  height: 4px;
  background: #e64350;
}

.za-badge i:nth-child(2) { background: #f3ca42; }
.za-badge i:nth-child(3) { background: #2baa67; margin-right: 5px; }

.guard-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 25px;
  margin-bottom: 18px;
  padding: clamp(23px, 3vw, 34px);
  border-color: rgba(115, 207, 255, 0.17);
  background: linear-gradient(125deg, rgba(17, 46, 48, 0.75), rgba(7, 22, 20, 0.94));
}

.guard-shield {
  width: 72px;
  height: 80px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(115, 207, 255, 0.4);
  border-radius: 24px 24px 35px 35px;
  color: var(--blue);
  background: rgba(56, 184, 255, 0.07);
  box-shadow: inset 0 0 28px rgba(73, 183, 255, 0.07), 0 0 25px rgba(73, 183, 255, 0.07);
  font-weight: 900;
}

.guard-rules {
  display: grid;
  gap: 7px;
}

.guard-rules span {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(115, 207, 255, 0.14);
  border-radius: 10px;
  color: #addcf3;
  background: rgba(83, 184, 239, 0.045);
  font-size: 0.67rem;
  font-weight: 740;
}

.guard-rules span::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--blue);
}

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

.legal-card {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: linear-gradient(145deg, rgba(18, 45, 38, 0.65), rgba(4, 17, 13, 0.88));
}

.legal-card--withdrawn {
  border-color: rgba(255, 203, 105, 0.22);
  background: linear-gradient(145deg, rgba(51, 41, 19, 0.45), rgba(18, 17, 10, 0.88));
}

.legal-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.legal-card h3 {
  margin: 17px 0 9px;
  font-size: 0.98rem;
  line-height: 1.35;
}

.legal-card p {
  flex: 1 1 auto;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.58;
}

.legal-card a {
  min-height: 45px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  color: var(--green-soft);
  font-size: 0.7rem;
  font-weight: 780;
  text-decoration: none;
}

.legal-card a:hover { text-decoration: underline; }

.source-status {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid rgba(47, 255, 133, 0.22);
  border-radius: 999px;
  color: var(--green-soft);
  background: rgba(47, 255, 133, 0.06);
  font-size: 0.57rem;
  font-weight: 850;
  text-transform: uppercase;
}

.source-status--withdrawn {
  border-color: rgba(255, 203, 105, 0.24);
  color: var(--amber);
  background: rgba(255, 203, 105, 0.06);
}

.legal-card__date {
  color: var(--muted);
  font-size: 0.61rem;
}

.assistant-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(290px, 0.68fr);
  gap: 18px;
}

.personality-preview {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-bottom: 28px;
  padding: 18px;
  border: 1px solid rgba(47, 255, 133, 0.15);
  border-radius: 20px;
  background: linear-gradient(110deg, rgba(47, 255, 133, 0.09), rgba(2, 17, 11, 0.4));
}

.settings-avatar {
  width: 67px;
  height: 67px;
  flex: 0 0 auto;
  font-size: 1.2rem;
  box-shadow: 0 0 32px rgba(47, 255, 133, 0.13);
}

.personality-preview > div {
  min-width: 0;
  display: grid;
}

.personality-preview small {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.personality-preview strong {
  margin: 4px 0;
  overflow: hidden;
  color: var(--green-soft);
  font-size: 1.4rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personality-preview span {
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tone-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.tone-picker legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
}

.tone-picker button {
  min-height: 75px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  text-align: left;
  background: rgba(255, 255, 255, 0.023);
}

.tone-picker button:hover,
.tone-picker button.is-selected {
  border-color: rgba(47, 255, 133, 0.35);
  background: rgba(47, 255, 133, 0.07);
}

.tone-picker strong {
  font-size: 0.76rem;
}

.tone-picker span {
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.3;
}

.switch-row {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 21px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.023);
}

.switch-row > span {
  display: grid;
}

.switch-row strong {
  font-size: 0.81rem;
}

.switch-row small {
  max-width: 500px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.4;
}

.switch-row input {
  position: absolute;
  opacity: 0;
}

.switch-row i {
  position: relative;
  width: 54px;
  height: 31px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  transition: background 160ms ease, border-color 160ms ease;
}

.switch-row i::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--muted-strong);
  transition: transform 180ms ease, background 180ms ease;
}

.switch-row input:checked + i {
  border-color: rgba(47, 255, 133, 0.52);
  background: rgba(47, 255, 133, 0.22);
}

.switch-row input:checked + i::after {
  background: var(--green);
  box-shadow: 0 0 14px rgba(47, 255, 133, 0.5);
  transform: translateX(23px);
}

.switch-row input:focus-visible + i {
  outline: 3px solid rgba(108, 255, 173, 0.9);
  outline-offset: 3px;
}

.settings-aside {
  display: grid;
  align-content: start;
  gap: 18px;
}

.production-card__head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 15px;
}

.brain-specs {
  margin: 21px 0;
  border-top: 1px solid var(--line);
}

.brain-specs div {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.brain-specs dt {
  color: var(--muted);
  font-size: 0.7rem;
}

.brain-specs dd {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.7rem;
  font-weight: 780;
  text-align: right;
}

.production-note {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid rgba(255, 203, 105, 0.18);
  border-radius: 14px;
  color: var(--amber);
  background: rgba(255, 203, 105, 0.05);
}

.production-note strong { font-size: 0.75rem; }
.production-note span { color: #c9b787; font-size: 0.67rem; line-height: 1.5; }

.people-row {
  display: flex;
  margin: 20px 0 17px 8px;
}

.people-row span {
  width: 47px;
  height: 47px;
  display: grid;
  place-items: center;
  margin-left: -8px;
  border: 3px solid #091b15;
  border-radius: 50%;
  color: var(--green-soft);
  background: linear-gradient(145deg, #194d35, #0b2419);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
  font-size: 0.74rem;
  font-weight: 850;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(2, 15, 10, 0.38);
}

.account-card__avatar {
  width: 49px;
  height: 49px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(47, 255, 133, 0.24);
  border-radius: 15px;
  color: var(--green-soft);
  background: rgba(47, 255, 133, 0.07);
  font-weight: 850;
}

.account-card__details {
  min-width: 0;
  display: grid;
}

.account-card__details strong { font-size: 0.88rem; }

.account-card__details span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
}

.account-card__state {
  width: fit-content;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  margin-top: 7px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 203, 105, 0.2);
  border-radius: 999px;
  color: var(--amber);
  background: rgba(255, 203, 105, 0.05);
  font-size: 0.56rem !important;
  font-weight: 850;
  text-transform: uppercase;
}

.account-card__state.is-active {
  border-color: rgba(47, 255, 133, 0.22);
  color: var(--green-soft);
  background: rgba(47, 255, 133, 0.06);
}

.account-card__state.is-inactive {
  border-color: rgba(255, 102, 120, 0.22);
  color: #ff9eaa;
  background: rgba(255, 102, 120, 0.06);
}

.account-card > button,
.account-card__actions button,
.credential-editor button {
  min-width: 104px;
  min-height: 48px;
  padding: 7px 12px;
  border: 1px solid rgba(47, 255, 133, 0.25);
  border-radius: 13px;
  color: var(--green-soft);
  background: rgba(47, 255, 133, 0.06);
  font-size: 0.68rem;
  font-weight: 780;
}

.account-card__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.account-card__actions .account-disable {
  min-width: 76px;
  border-color: rgba(255, 102, 120, 0.25);
  color: #ff9eaa;
  background: rgba(255, 102, 120, 0.06);
}

.credential-editor {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 9px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.credential-editor .field { margin: 0; }
.credential-editor .field__control { min-height: 48px; }
.credential-editor .field input { min-height: 46px; }
.credential-editor button { min-width: 112px; }

.app-footer {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(18px, 3vw, 42px);
  border-top: 1px solid var(--line);
  color: #60766c;
  font-size: 0.61rem;
  font-weight: 760;
  letter-spacing: 0.09em;
}

.toast-region {
  position: fixed;
  z-index: 200;
  top: calc(92px + var(--safe-top));
  right: 20px;
  width: min(390px, calc(100vw - 40px));
  display: grid;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid rgba(47, 255, 133, 0.25);
  border-radius: 16px;
  background: rgba(7, 27, 19, 0.96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  pointer-events: auto;
  animation: toast-in 200ms ease both;
}

.toast--error { border-color: rgba(255, 102, 120, 0.36); }
.toast--warning { border-color: rgba(255, 203, 105, 0.3); }

.toast__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px currentColor;
}

.toast--error .toast__dot { color: var(--red); background: var(--red); }
.toast--warning .toast__dot { color: var(--amber); background: var(--amber); }

.toast strong {
  display: block;
  font-size: 0.76rem;
}

.toast span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.toast button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
}

.dialog-backdrop {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 8, 5, 0.72);
  backdrop-filter: blur(12px);
}

.confirm-dialog {
  width: min(450px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(20, 50, 39, 0.98), rgba(5, 19, 14, 0.99));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.confirm-dialog__icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 17px;
  border: 1px solid rgba(255, 102, 120, 0.25);
  border-radius: 17px;
  color: #ff9ca8;
  background: rgba(255, 102, 120, 0.07);
}

.confirm-dialog h2 {
  margin: 0 0 9px;
}

.confirm-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}

@media (max-width: 1500px) {
  .module-menu { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .module-menu.has-team-access { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1220px) {
  .command-hero { grid-template-columns: minmax(0, 1fr) auto; }
  .time-orbit { display: none; }
  .legal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .login-layout { grid-template-columns: 1fr 390px; gap: 40px; }
  .login-intro h1 { font-size: clamp(3rem, 7vw, 4.7rem); }
  .conversation-layout,
  .assistant-settings-grid { grid-template-columns: 1fr; }
  .conversation-aside { grid-template-columns: 1fr 1fr; }
  .content-grid--memory,
  .content-grid--training { grid-template-columns: 1fr; }
  .learning-compose { grid-template-columns: 1fr; }
  .settings-aside { grid-template-columns: 1fr 1fr; }
  .brain-pill { display: none; }
  .topbar { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .login-screen { padding: max(22px, var(--safe-top)) 16px max(22px, var(--safe-bottom)); }
  .login-brand { margin-bottom: 20px; }
  .login-layout { grid-template-columns: 1fr; gap: 22px; }
  .login-intro { padding: 17px 5px 8px; }
  .login-intro h1 { margin-top: 15px; font-size: clamp(2.8rem, 14vw, 4.7rem); }
  .login-intro .lead { font-size: 0.98rem; line-height: 1.6; }
  .neural-orb--login { width: 210px; height: 210px; top: -40px; right: -20px; opacity: 0.25; }
  .login-card { border-radius: 24px; }

  .topbar { min-height: 70px; padding-right: 12px; padding-left: 12px; }
  .brand-button__text,
  .profile-button__text,
  .logout-button__label { display: none; }
  .wt-mark { width: 44px; height: 44px; }
  .profile-button { padding-right: 2px; }
  .topbar__actions { gap: 3px; }

  .main-content { padding: 14px 12px 38px; }
  .command-hero { min-height: 220px; grid-template-columns: 1fr auto; gap: 8px; padding: 22px 17px; border-radius: 24px; }
  .command-hero h1 { font-size: clamp(1.55rem, 7vw, 2.2rem); }
  .command-hero__copy > p:last-of-type { font-size: 0.82rem; }
  .hero-stats { gap: 6px; margin-top: 18px; }
  .hero-stats button { min-width: 86px; min-height: 49px; grid-template-columns: 1fr; gap: 0; padding: 6px 9px; }
  .hero-stats strong { font-size: 1rem; }
  .hero-stats span { max-width: none; font-size: 0.55rem; }
  .core-button { min-width: 122px; min-height: 150px; }
  .core-button .neural-orb { width: 116px; height: 116px; }
  .core-button__label { min-width: 105px; padding: 6px 9px; }
  .core-button__label strong { max-width: 105px; font-size: 0.67rem; }

  .module-menu { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .module-menu.has-team-access { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .module-button { min-height: 92px; flex-direction: column; justify-content: center; gap: 5px; padding: 9px 6px; border-radius: 16px; text-align: center; }
  .module-button__icon { width: 36px; height: 36px; border-radius: 11px; }
  .module-button > span:last-child { display: none; }
  .module-button::before { content: attr(data-mobile-label); max-width: 100%; font-size: 0.68rem; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }

  .chat-panel { min-height: calc(100vh - 250px); border-radius: 23px; }
  .chat-header { min-height: 78px; padding: 13px; }
  .assistant-avatar { width: 44px; height: 44px; }
  .panel-header h2 { max-width: 180px; overflow: hidden; font-size: 1.05rem; text-overflow: ellipsis; white-space: nowrap; }
  .status-chip { max-width: 105px; white-space: normal; text-align: center; line-height: 1.25; }
  .chat-messages { padding: 20px 13px 12px; }
  .message { max-width: 92%; }
  .message__bubble { font-size: 0.88rem; }
  .quick-prompts { padding-right: 13px; padding-left: 13px; }
  .chat-composer { margin-right: 10px; margin-bottom: 11px; margin-left: 10px; }
  .composer-hint { display: none; }
  .composer-actions { padding-left: 6px; }
  .voice-button__text { display: none; }
  .send-button { margin-left: auto; }
  .conversation-aside,
  .settings-aside { grid-template-columns: 1fr; }

  .section-heading { min-height: 105px; align-items: flex-start; padding: 18px 8px; }
  .section-heading h2 { font-size: 1.9rem; }
  .section-heading p:last-child { font-size: 0.82rem; }
  .section-heading > span { display: none; }
  .form-card,
  .list-card,
  .queue-panel,
  .research-card,
  .personality-card { padding: 18px; border-radius: 23px; }
  .list-toolbar { align-items: flex-start; }
  .search-box input { width: 116px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .filter-pills { max-width: 200px; justify-content: flex-end; }
  .filter-pills button { min-width: 48px; padding-right: 8px; padding-left: 8px; }
  .learning-item__head,
  .learning-item__footer { align-items: flex-start; }
  .learning-item__footer { flex-direction: column; }
  .review-actions { width: 100%; }
  .review-actions button { flex: 1 1 0; }

  .guard-banner { grid-template-columns: auto 1fr; gap: 15px; }
  .guard-rules { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
  .legal-grid { grid-template-columns: 1fr; }
  .legal-card { min-height: 205px; }
  .tone-picker { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .account-card { grid-template-columns: auto minmax(0, 1fr); }
  .account-card__actions { grid-column: 1 / -1; justify-content: stretch; }
  .account-card__actions button { flex: 1 1 120px; }
  .credential-editor { grid-template-columns: 1fr; }
  .credential-editor button { width: 100%; }
  .app-footer { flex-direction: column; justify-content: center; gap: 4px; text-align: center; }
  .toast-region { top: calc(78px + var(--safe-top)); right: 12px; width: calc(100vw - 24px); }
}

@media (max-width: 430px) {
  .login-brand .eyebrow { display: none; }
  .login-brand { gap: 10px; }
  .trust-strip span { font-size: 0.68rem; }
  .module-menu.has-team-access { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .command-hero { min-height: 210px; }
  .command-hero .kicker { font-size: 0.56rem; }
  .core-button { min-width: 105px; }
  .core-button .neural-orb { width: 100px; height: 100px; }
  .hero-stats button:nth-child(3) { display: none; }
  .chat-header .eyebrow { font-size: 0.55rem; }
  .status-chip { font-size: 0.58rem; }
  .list-item { grid-template-columns: auto 1fr; }
  .list-item .item-action { grid-column: 1 / -1; width: 100%; }
  .guard-shield { width: 58px; height: 66px; border-radius: 18px 18px 27px 27px; }
  .guard-rules { grid-template-columns: 1fr; }
  .personality-preview { padding: 13px; }
  .settings-avatar { width: 56px; height: 56px; }
}

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