:root {
  color-scheme: dark;
  --bg: #151416;
  --panel: #211f24;
  --panel-2: #2d2930;
  --text: #f8fafc;
  --muted: #b7adb9;
  --line: #463f49;
  --green: #68d279;
  --cyan: #7dd3fc;
  --rose: #f0a6c8;
  --danger: #fb7185;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
}

.topbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-ready .topbar {
  display: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--rose);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1, h2, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 34px;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.panel, .card, .chat {
  margin-top: 18px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.workspace {
  margin-top: 0;
  position: relative;
}

.view-nav {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.tab {
  min-height: 40px;
  background: #302a32;
  color: var(--text);
  border: 1px solid var(--line);
}

.tab.active {
  background: var(--green);
  color: #052e12;
  border-color: transparent;
}

.view {
  margin-top: 0;
}

.nav-icon {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(240, 166, 200, 0.28);
  border-radius: 50%;
  background: rgba(33, 31, 36, 0.86);
  color: var(--text);
  backdrop-filter: blur(12px);
}

.nav-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ops-switch {
  position: fixed;
  z-index: 10;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #141216;
  color: var(--text);
  font: inherit;
}

textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #141216;
  color: var(--text);
  font: inherit;
  line-height: 1.45;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--green);
  color: #052e12;
  font: inherit;
  font-weight: 800;
}

.spotlight {
  border-color: rgba(240, 166, 200, 0.34);
  background: linear-gradient(135deg, #211f24 0%, #252127 52%, #17241c 100%);
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding-top: 8px;
}

.status-grid span {
  color: var(--muted);
}

.status-grid strong {
  color: var(--cyan);
}

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

.card-head h2 {
  margin-bottom: 0;
}

.hero-chat {
  min-height: calc(100vh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto 1fr auto;
  margin-top: 0;
  padding: 14px;
}

.amanda-face {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.amanda-photo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(240, 166, 200, 0.72);
  background: #141216;
}

.amanda-face h2,
.amanda-face p {
  margin-bottom: 0;
}

.voice-state {
  min-width: 72px;
  justify-self: end;
  padding: 7px 10px;
  border: 1px solid rgba(240, 166, 200, 0.22);
  border-radius: 999px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

.mail-status {
  display: grid;
  gap: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.mail-top {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metric {
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: #141216;
}

.metric strong {
  display: block;
  color: var(--text);
  font-size: 22px;
}

.mail-item {
  padding: 10px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.mail-item strong {
  display: block;
  color: var(--text);
  overflow-wrap: anywhere;
}

.mail-item span {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}

.audit {
  display: grid;
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  color: var(--muted);
  font-size: 13px;
}

.audit-item {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.briefing {
  display: grid;
  gap: 14px;
  color: var(--muted);
}

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

.briefing-head strong {
  color: var(--text);
  font-size: 18px;
}

.briefing-head span {
  font-size: 13px;
}

.priority-list {
  display: grid;
  gap: 10px;
}

.priority {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(20, 18, 22, 0.74);
}

.priority span {
  color: var(--rose);
  font-size: 13px;
  font-weight: 800;
}

.priority strong {
  color: var(--text);
  font-weight: 650;
}

.priority.high {
  border-color: rgba(251, 113, 133, 0.48);
}

.priority.good {
  border-color: rgba(104, 210, 121, 0.42);
}

.suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.suggestion {
  min-height: 38px;
  max-width: 100%;
  background: #302a32;
  color: var(--text);
  border: 1px solid rgba(240, 166, 200, 0.28);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.memory-form {
  display: grid;
  gap: 10px;
}

.messages {
  min-height: 0;
  max-height: none;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px 0;
}

.message {
  width: fit-content;
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--panel-2);
  line-height: 1.45;
}

.message.me {
  margin-left: auto;
  background: #163924;
}

.composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  margin-top: 14px;
}

.voice-button {
  background: var(--rose);
  color: #321222;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.voice-button.active {
  background: #f3bdd7;
}

.voice-button.recording .voice-dot {
  background: var(--danger);
  box-shadow: 0 0 0 7px rgba(251, 113, 133, 0.16);
}

.voice-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #321222;
}

.ops-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
}

.ops-head h2,
.ops-head p {
  margin-bottom: 0;
}

.amanda-switch {
  width: 54px;
  height: 54px;
  min-height: 54px;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
  border: 2px solid rgba(104, 210, 121, 0.62);
}

.amanda-switch img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.hidden {
  display: none;
}

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

  .topbar {
    padding-right: 50px;
  }

  .composer {
    grid-template-columns: auto 1fr;
  }

  .amanda-face {
    grid-template-columns: auto 1fr auto;
  }

  .composer button[type="submit"] {
    grid-column: 1 / -1;
  }

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