:root {
  color-scheme: dark;
  --bg: #080706;
  --bg-2: #100d0b;
  --bg-3: #191210;
  --surface: rgba(28, 22, 19, 0.78);
  --surface-2: rgba(38, 29, 25, 0.72);
  --surface-3: rgba(245, 230, 214, 0.055);
  --surface-4: rgba(245, 230, 214, 0.09);
  --line: rgba(245, 230, 214, 0.105);
  --line-strong: rgba(245, 230, 214, 0.18);
  --text: #f6eee5;
  --text-strong: #fff8ef;
  --soft: #d4c5b6;
  --muted: #9a8a7b;
  --faint: #726459;
  --clay: #c78372;
  --rose: #d19a9c;
  --bronze: #c9a06c;
  --sage: #9ebb98;
  --amber: #dfb764;
  --red: #df8a82;
  --mist: #9fb5ba;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 14px 42px rgba(0, 0, 0, 0.32);
  --r: 8px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
}

body {
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(199, 131, 114, 0.08), transparent 32%),
    linear-gradient(210deg, rgba(158, 187, 152, 0.055), transparent 38%),
    linear-gradient(180deg, #080706 0%, #120d0b 48%, #090807 100%);
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 76%);
  opacity: 0.45;
}

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

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(246, 238, 229, 0.055);
  color: var(--text);
  padding: 9px 13px;
  cursor: pointer;
  transition:
    transform 170ms ease,
    border-color 170ms ease,
    background 170ms ease,
    color 170ms ease,
    box-shadow 170ms ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(201, 160, 108, 0.36);
  background: rgba(246, 238, 229, 0.09);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.primary {
  border-color: rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(145deg, rgba(232, 204, 160, 0.98), rgba(193, 128, 107, 0.95)),
    var(--bronze);
  color: #17110e;
  font-weight: 760;
  box-shadow: 0 16px 38px rgba(199, 131, 114, 0.18);
}

button.primary:hover {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 20px 46px rgba(199, 131, 114, 0.22);
}

button.icon {
  width: 40px;
  padding: 0;
  display: grid;
  place-items: center;
}

input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(246, 238, 229, 0.052);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  transition: border-color 170ms ease, box-shadow 170ms ease, background 170ms ease;
}

textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.45;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 18px,
    calc(100% - 12px) 18px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

select option {
  color: var(--text);
  background: #18120f;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(201, 160, 108, 0.56);
  background: rgba(246, 238, 229, 0.074);
  box-shadow: 0 0 0 4px rgba(201, 160, 108, 0.11);
}

label {
  display: grid;
  gap: 7px;
  color: var(--soft);
  font-size: 13px;
}

a {
  color: inherit;
}

.shell {
  position: relative;
  display: grid;
  grid-template-columns: 294px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 294px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 14px;
  background:
    linear-gradient(180deg, rgba(24, 17, 14, 0.94), rgba(13, 10, 9, 0.9)),
    rgba(12, 9, 8, 0.92);
  border-right: 1px solid rgba(245, 230, 214, 0.11);
  box-shadow: 18px 0 70px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(24px) saturate(1.25);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 4px 14px;
  border-bottom: 1px solid var(--line);
}

.mark {
  width: 43px;
  height: 43px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: var(--r);
  border-color: rgba(201, 160, 108, 0.28);
  background:
    linear-gradient(150deg, rgba(246, 238, 229, 0.16), rgba(199, 131, 114, 0.17)),
    #1b1210;
  color: var(--text-strong);
  font-weight: 820;
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong {
  display: block;
  color: var(--text-strong);
  font-size: 22px;
  font-weight: 790;
  line-height: 1;
}

.brand-copy span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.nav {
  display: grid;
  gap: 4px;
  overflow: auto;
  padding: 2px 2px 4px 0;
  scrollbar-width: thin;
}

.nav button {
  width: 100%;
  min-width: 0;
  min-height: 39px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  text-align: left;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.nav button span:first-child {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--r);
  color: var(--soft);
  background: rgba(246, 238, 229, 0.045);
}

.nav button b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 650;
}

.nav button i {
  color: var(--faint);
  font-style: normal;
}

.nav button:hover {
  transform: none;
  border-color: rgba(245, 230, 214, 0.07);
  background: rgba(245, 230, 214, 0.055);
  box-shadow: none;
  color: var(--soft);
}

.nav button.active {
  border-color: rgba(201, 160, 108, 0.24);
  background:
    linear-gradient(90deg, rgba(199, 131, 114, 0.18), rgba(201, 160, 108, 0.08)),
    rgba(246, 238, 229, 0.064);
  color: var(--text);
}

.nav button.active span:first-child {
  background: rgba(201, 160, 108, 0.17);
  color: var(--text-strong);
}

.nav-parent.active {
  box-shadow: inset 3px 0 0 rgba(201, 160, 108, 0.62);
}

.children {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding-left: 38px;
  transform: translateY(-4px);
  transition: max-height 260ms ease, opacity 220ms ease, transform 220ms ease, padding-bottom 220ms ease;
}

.children.open {
  max-height: 390px;
  opacity: 1;
  padding-bottom: 8px;
  transform: translateY(0);
}

.children .child {
  min-height: 32px;
  margin-top: 4px;
  grid-template-columns: minmax(0, 1fr);
  color: var(--faint);
  font-size: 13px;
  padding-left: 10px;
}

.children .child.active {
  color: var(--text);
  background: rgba(158, 187, 152, 0.08);
  border-color: rgba(158, 187, 152, 0.16);
}

.sidebar-note {
  margin-top: auto;
  padding: 13px 11px 2px;
  color: var(--faint);
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.45;
}

body.sidebar-collapsed .shell {
  grid-template-columns: 80px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  width: 80px;
  align-items: center;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav b,
body.sidebar-collapsed .nav i,
body.sidebar-collapsed .children,
body.sidebar-collapsed .sidebar-note {
  display: none;
}

body.sidebar-collapsed .brand-row {
  border-bottom: 0;
  padding-left: 0;
  padding-right: 0;
}

body.sidebar-collapsed .nav button {
  grid-template-columns: 1fr;
  place-items: center;
  padding-left: 6px;
  padding-right: 6px;
}

.main {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 22px;
  background: rgba(8, 7, 6, 0.72);
  border-bottom: 1px solid rgba(245, 230, 214, 0.09);
  backdrop-filter: blur(24px) saturate(1.2);
}

.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 680px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(245, 230, 214, 0.047);
}

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

.search input {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.search input:focus {
  box-shadow: none;
}

.status {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.avatar {
  width: 40px;
  height: 40px;
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
  border-color: rgba(201, 160, 108, 0.24);
  background: linear-gradient(145deg, #281a16, #17100e);
  color: var(--bronze);
  font-weight: 820;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content {
  position: relative;
  z-index: 1;
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 30px 28px 44px;
  animation: pageIn 260ms ease both;
}

.page-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 20px;
}

.page-title > div:first-child {
  min-width: 0;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  color: var(--bronze);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.page-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--clay);
  box-shadow: 0 0 22px rgba(199, 131, 114, 0.58);
}

.page-title h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(27px, 3.1vw, 46px);
  line-height: 1.02;
  font-weight: 790;
}

.page-title p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.55;
}

.page-actions {
  justify-content: flex-end;
  margin-bottom: 0;
}

.grid {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.42fr) minmax(300px, 0.78fr);
}

.bottom-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background:
    linear-gradient(180deg, rgba(245, 230, 214, 0.078), rgba(245, 230, 214, 0.036)),
    rgba(18, 14, 12, 0.78);
  box-shadow: var(--shadow-soft);
  padding: 17px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 230, 214, 0.25), transparent);
  opacity: 0.62;
}

.panel:hover {
  border-color: rgba(245, 230, 214, 0.16);
  background:
    linear-gradient(180deg, rgba(245, 230, 214, 0.088), rgba(245, 230, 214, 0.044)),
    rgba(20, 15, 13, 0.82);
}

.panel.flat {
  box-shadow: none;
  background: rgba(245, 230, 214, 0.035);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 13px;
}

.panel-head > div:first-child {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.panel-lens {
  width: 8px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--clay), var(--bronze));
  opacity: 0.86;
}

.panel h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 735;
}

.panel h3,
.list-row h3 {
  margin: 0 0 6px;
  color: var(--text-strong);
  font-size: 14px;
  line-height: 1.25;
}

.panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.soft {
  color: var(--soft);
}

.hero {
  min-height: 352px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(145deg, rgba(92, 48, 38, 0.64), rgba(20, 14, 12, 0.86) 49%, rgba(43, 64, 47, 0.34)),
    rgba(18, 14, 12, 0.92);
}

.hero::after {
  content: "AuroraOS Beta";
  position: absolute;
  right: 18px;
  bottom: 16px;
  color: rgba(246, 238, 229, 0.08);
  font-size: clamp(38px, 8vw, 112px);
  font-weight: 820;
  line-height: 0.8;
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  max-width: 650px;
  margin: 7px 0 10px;
  color: var(--text-strong);
  font-size: clamp(32px, 5vw, 64px);
  line-height: 0.98;
  font-weight: 820;
}

.hero .date {
  color: var(--bronze);
  font-size: 13px;
  font-weight: 760;
}

.metric-row,
.money-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background:
    linear-gradient(180deg, rgba(245, 230, 214, 0.072), rgba(245, 230, 214, 0.03)),
    rgba(18, 14, 12, 0.64);
  padding: 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.metric strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: var(--text-strong);
  font-size: clamp(21px, 2.3vw, 31px);
  line-height: 1.02;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
}

.stat-card.ok {
  border-color: rgba(158, 187, 152, 0.24);
  background: linear-gradient(180deg, rgba(158, 187, 152, 0.12), rgba(245, 230, 214, 0.035));
}

.stat-card.warn {
  border-color: rgba(223, 183, 100, 0.28);
  background: linear-gradient(180deg, rgba(223, 183, 100, 0.12), rgba(245, 230, 214, 0.035));
}

.stat-card.danger {
  border-color: rgba(223, 138, 130, 0.28);
  background: linear-gradient(180deg, rgba(223, 138, 130, 0.11), rgba(245, 230, 214, 0.035));
}

.dashboard-command-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
}

.command-hero {
  min-height: 430px;
}

.hero-actions,
.card-actions,
.switchboard-head,
.mail-toolbar,
.review-top,
.review-actions,
.notification-tabs,
.context-rail,
.prompt-grid,
.calendar-brief,
.review-summary,
.list-command-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-actions {
  margin-top: 22px;
}

.command-grid {
  align-items: start;
}

.brief-stack {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.action-card,
.notification-card,
.review-card,
.email-row,
.activity-feed article {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background:
    linear-gradient(180deg, rgba(245, 230, 214, 0.06), rgba(245, 230, 214, 0.028)),
    rgba(18, 14, 12, 0.58);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.action-card:hover,
.notification-card:hover,
.review-card:hover,
.email-row:hover {
  transform: translateY(-1px);
  border-color: rgba(201, 160, 108, 0.24);
  background:
    linear-gradient(180deg, rgba(245, 230, 214, 0.078), rgba(245, 230, 214, 0.036)),
    rgba(22, 16, 13, 0.68);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
}

.action-card h3,
.notification-card h3,
.review-card h3,
.email-row h3,
.activity-feed h3 {
  margin: 0 0 7px;
  color: var(--text-strong);
  font-size: 14px;
  line-height: 1.25;
}

.action-card p,
.notification-card p,
.review-card p,
.email-row p,
.activity-feed p {
  margin: 0;
  color: var(--soft);
  line-height: 1.45;
  font-size: 13px;
}

.card-actions {
  justify-content: flex-end;
}

.event-card {
  border-color: rgba(159, 181, 186, 0.16);
}

.premium-chat {
  height: auto;
  min-height: calc(100vh - 128px);
  grid-template-rows: auto auto auto minmax(320px, 1fr) auto auto auto;
}

.assistant-status {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(245, 230, 214, 0.045);
}

.assistant-status p {
  margin: 10px 0 0;
  color: var(--soft);
  line-height: 1.5;
}

.context-rail .context-chip,
.prompt-grid button,
.notification-tabs button,
.mail-toolbar button {
  background: rgba(245, 230, 214, 0.045);
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.premium-composer {
  border: 1px solid rgba(201, 160, 108, 0.2);
  border-radius: var(--r);
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(201, 160, 108, 0.08), rgba(245, 230, 214, 0.025)),
    rgba(12, 9, 8, 0.78);
}

.premium-composer textarea {
  min-height: 86px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.timeline-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(82px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.day-strip {
  display: grid;
  justify-items: start;
  min-height: 76px;
  background: rgba(245, 230, 214, 0.043);
}

.day-strip strong {
  color: var(--text-strong);
  font-size: 24px;
}

.day-strip em {
  color: var(--sage);
  font-style: normal;
  font-size: 12px;
}

.calendar-brief,
.review-summary,
.list-command-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.phone-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.65fr);
  gap: 16px;
  margin-bottom: 16px;
}

.switchboard-panel h2 {
  margin: 4px 0 8px;
  font-size: 28px;
}

.switchboard-head {
  justify-content: space-between;
  margin-bottom: 16px;
}

.dialer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.mail-toolbar {
  justify-content: space-between;
  margin-bottom: 16px;
}

.mail-toolbar label {
  width: min(360px, 100%);
}

.mail-toolbar button.active,
.notification-tabs button.active {
  border-color: rgba(159, 181, 186, 0.28);
  background: rgba(159, 181, 186, 0.11);
  color: var(--text-strong);
}

.email-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}

.email-row > div:first-child span,
.notification-card > div:first-child span,
.review-top span,
.activity-feed article > span {
  display: inline-flex;
  margin-bottom: 7px;
  color: var(--bronze);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.email-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.notification-card.open {
  border-color: rgba(201, 160, 108, 0.28);
}

.notification-detail {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(245, 230, 214, 0.1);
  border-radius: var(--r);
  color: var(--soft);
  background: rgba(0, 0, 0, 0.14);
}

.review-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.review-card {
  display: block;
  padding: 16px;
}

.review-top {
  justify-content: flex-start;
  margin-bottom: 10px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.review-grid div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(245, 230, 214, 0.035);
}

.review-grid b,
.review-grid span {
  display: block;
}

.review-grid b {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.review-grid span {
  margin-top: 5px;
  color: var(--soft);
  font-size: 13px;
}

.setup-progress {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(245, 230, 214, 0.045);
}

.setup-progress strong,
.setup-progress span {
  display: block;
}

.setup-progress strong {
  color: var(--text-strong);
  font-size: 26px;
}

.setup-progress progress {
  width: 100%;
  accent-color: var(--bronze);
}

.activity-feed {
  display: grid;
  gap: 10px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid rgba(245, 230, 214, 0.072);
}

.row:last-child {
  border-bottom: 0;
}

.row > div:first-child {
  min-width: 0;
}

.row strong {
  color: var(--text);
  line-height: 1.25;
}

.row .muted {
  margin-top: 5px;
  line-height: 1.42;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  margin-top: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(245, 230, 214, 0.057);
  color: var(--soft);
  font-size: 12px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.chip.ok {
  color: var(--sage);
  border-color: rgba(158, 187, 152, 0.3);
  background: rgba(158, 187, 152, 0.075);
}

.chip.warn {
  color: var(--amber);
  border-color: rgba(223, 183, 100, 0.3);
  background: rgba(223, 183, 100, 0.075);
}

.chip.danger {
  color: var(--red);
  border-color: rgba(223, 138, 130, 0.32);
  background: rgba(223, 138, 130, 0.075);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tabs button.active {
  border-color: rgba(159, 181, 186, 0.3);
  background: rgba(159, 181, 186, 0.11);
  color: var(--text-strong);
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  min-width: 0;
  padding: 13px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(245, 230, 214, 0.042);
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease;
}

.list-row:hover {
  transform: translateY(-1px);
  border-color: rgba(201, 160, 108, 0.2);
  background: rgba(245, 230, 214, 0.06);
}

.list-row > div:first-child {
  min-width: 0;
}

.list-row p {
  margin: 0;
  line-height: 1.45;
}

.review-item {
  align-items: start;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.review-warning {
  margin: 12px 0 0;
  color: var(--amber);
  line-height: 1.45;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 170px;
  padding: 28px 20px;
  text-align: center;
  border: 1px dashed rgba(245, 230, 214, 0.18);
  border-radius: var(--r);
  background:
    linear-gradient(180deg, rgba(245, 230, 214, 0.042), rgba(245, 230, 214, 0.02)),
    rgba(18, 14, 12, 0.45);
  color: var(--muted);
}

.empty-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border: 1px solid rgba(201, 160, 108, 0.22);
  border-radius: var(--r);
  background: rgba(201, 160, 108, 0.09);
  color: var(--bronze);
  font-weight: 820;
}

.empty strong {
  max-width: 440px;
  color: var(--soft);
  line-height: 1.4;
}

.empty-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chat {
  height: calc(100vh - 128px);
  min-height: 560px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto auto;
  gap: 12px;
}

.chat-log {
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background:
    linear-gradient(180deg, rgba(245, 230, 214, 0.04), rgba(245, 230, 214, 0.022)),
    rgba(16, 12, 10, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.bubble {
  max-width: min(760px, 92%);
  margin: 0 0 12px;
  padding: 13px 14px;
  border: 1px solid rgba(245, 230, 214, 0.095);
  border-radius: var(--r);
  background: rgba(245, 230, 214, 0.055);
  color: var(--soft);
  line-height: 1.48;
}

.bubble strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-strong);
  font-size: 13px;
}

.bubble.user {
  margin-left: auto;
  border-color: rgba(159, 181, 186, 0.22);
  background: rgba(159, 181, 186, 0.095);
}

.mode-dock {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(201, 160, 108, 0.15);
  border-radius: var(--r);
  background:
    linear-gradient(90deg, rgba(199, 131, 114, 0.08), rgba(158, 187, 152, 0.052)),
    rgba(18, 14, 12, 0.82);
  box-shadow: var(--shadow-soft);
}

.mode-pill {
  min-width: 118px;
  font-weight: 760;
}

.mode-pill.safe {
  border-color: rgba(223, 183, 100, 0.38);
  color: var(--amber);
  background: rgba(223, 183, 100, 0.075);
}

.mode-dock select {
  width: auto;
  min-width: 158px;
}

.mode-popover {
  position: absolute;
  left: 10px;
  bottom: 62px;
  z-index: 8;
  width: min(430px, calc(100vw - 50px));
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(201, 160, 108, 0.22);
  border-radius: var(--r);
  background:
    linear-gradient(180deg, rgba(42, 31, 27, 0.98), rgba(19, 14, 12, 0.98));
  box-shadow: var(--shadow);
  animation: popIn 180ms ease both;
}

.mode-popover button {
  display: block;
  text-align: left;
  min-height: 52px;
}

.mode-popover button.active {
  border-color: rgba(158, 187, 152, 0.25);
  background: rgba(158, 187, 152, 0.08);
}

.mode-popover button span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.chat-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.chat-input textarea {
  min-height: 74px;
}

.chat-history {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  gap: 13px;
}

.integration-grid {
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
}

.app-tile {
  position: relative;
  min-width: 0;
  min-height: 166px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background:
    linear-gradient(180deg, rgba(245, 230, 214, 0.072), rgba(245, 230, 214, 0.032)),
    rgba(18, 14, 12, 0.72);
  color: var(--text);
  text-align: center;
  text-decoration: none;
  transition: transform 190ms ease, border-color 190ms ease, background 190ms ease, box-shadow 190ms ease;
}

.app-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(201, 160, 108, 0.28);
  background:
    linear-gradient(180deg, rgba(245, 230, 214, 0.094), rgba(245, 230, 214, 0.04)),
    rgba(22, 16, 14, 0.82);
  box-shadow: var(--shadow-soft);
}

.app-tile strong {
  max-width: 100%;
  color: var(--text-strong);
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.app-tile .muted {
  max-width: 100%;
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.integration-tile {
  min-height: 188px;
}

.app-icon {
  position: relative;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(245, 230, 214, 0.11);
  border-radius: var(--r);
  background:
    linear-gradient(145deg, rgba(201, 160, 108, 0.17), rgba(159, 181, 186, 0.09)),
    rgba(245, 230, 214, 0.035);
  color: var(--bronze);
  font-weight: 820;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.app-icon img {
  position: relative;
  z-index: 2;
  width: 31px;
  height: 31px;
  object-fit: contain;
}

.app-icon img + span {
  position: absolute;
  opacity: 0;
}

.app-icon span {
  position: relative;
  z-index: 1;
}

.app-icon.large {
  width: 72px;
  height: 72px;
}

.app-icon.large img {
  width: 40px;
  height: 40px;
}

.catalog-grid {
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
}

.catalog-tile {
  min-height: 190px;
  aspect-ratio: auto;
}

.edit-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.add-menu {
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding-right: 4px;
}

.provider-detail-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(245, 230, 214, 0.045);
}

.provider-detail-head h2 {
  margin: 0 0 8px;
  color: var(--text-strong);
}

.detail-list {
  margin: 0;
  padding-left: 19px;
  color: var(--soft);
  line-height: 1.45;
}

.detail-list li {
  margin: 4px 0;
}

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

.form-grid .full {
  grid-column: 1 / -1;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.day {
  min-height: 104px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(245, 230, 214, 0.038);
  transition: border-color 170ms ease, background 170ms ease;
}

.day:hover {
  border-color: rgba(201, 160, 108, 0.2);
  background: rgba(245, 230, 214, 0.055);
}

.day.today {
  border-color: rgba(201, 160, 108, 0.38);
  background: rgba(201, 160, 108, 0.075);
}

.day strong {
  display: block;
  margin-bottom: 7px;
  color: var(--text-strong);
}

.day .chip {
  width: 100%;
  justify-content: flex-start;
  margin: 3px 0;
  white-space: normal;
}

.dialpad {
  display: grid;
  grid-template-columns: repeat(3, minmax(58px, 72px));
  justify-content: center;
  gap: 9px;
}

.dialpad button {
  height: 56px;
  font-size: 19px;
  font-weight: 720;
  background: rgba(245, 230, 214, 0.065);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.disabled-action,
.provider-action {
  color: var(--soft);
}

.drawer-layer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
}

.drawer-layer.open {
  display: block;
}

.drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(7px);
}

.drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(610px, 100%);
  height: 100%;
  overflow: auto;
  padding: 20px;
  border-left: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(31, 23, 20, 0.99), rgba(13, 10, 9, 0.99));
  box-shadow: var(--shadow);
  animation: drawerIn 220ms ease both;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(23px, 4vw, 34px);
  line-height: 1.05;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: grid;
  gap: 8px;
  width: min(390px, calc(100vw - 36px));
}

.toast {
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background:
    linear-gradient(180deg, rgba(245, 230, 214, 0.1), rgba(245, 230, 214, 0.052)),
    #17110f;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: popIn 170ms ease both;
}

.mobile-only {
  display: none;
}

body[data-page="chat"] .content {
  max-width: 1280px;
}

body[data-page="call_leads"] .panel:first-of-type,
body[data-page="call_number"] .panel:first-of-type {
  background:
    linear-gradient(150deg, rgba(159, 181, 186, 0.12), rgba(199, 131, 114, 0.08)),
    rgba(18, 14, 12, 0.78);
}

body[data-page="review"] .review-item {
  border-color: rgba(223, 183, 100, 0.18);
}

body[data-page="providers"] .panel:first-of-type,
body[data-page="settings"] .panel:first-of-type,
body[data-page="account"] .panel:first-of-type {
  background:
    linear-gradient(150deg, rgba(201, 160, 108, 0.1), rgba(158, 187, 152, 0.055)),
    rgba(18, 14, 12, 0.78);
}

body[data-density="compact"] .content {
  padding-top: 22px;
}

body[data-density="compact"] .panel,
body[data-density="compact"] .list-row,
body[data-density="compact"] .metric {
  padding: 12px;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.auth-only {
  min-height: 100vh;
}

body.auth-only .shell,
body.auth-only.sidebar-collapsed .shell {
  display: grid;
  grid-template-columns: 1fr !important;
  min-height: 100vh;
}

body.auth-only .sidebar,
body.auth-only .topbar,
body.auth-only .mobile-scrim {
  display: none !important;
}

body.auth-only .main {
  grid-column: 1 !important;
  min-height: 100vh;
}

body.auth-only .content {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-screen {
  display: grid;
  width: 100%;
  min-height: 100vh;
  place-items: center;
}

.auth-card {
  display: grid;
  width: min(390px, 100%);
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0;
  font-size: 24px;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.auth-brand strong {
  color: var(--text);
  font-size: 16px;
}

.auth-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.auth-card input {
  width: 100%;
}

.auth-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes drawerIn {
  from {
    opacity: 0.9;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 1180px) {
  .bottom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

  .main {
    grid-column: 1;
  }

  .sidebar {
    width: min(310px, 86vw);
    transform: translateX(-100%);
    transition: transform 220ms ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .mobile-scrim.open {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(6px);
  }

  .mobile-only {
    display: grid;
  }

  .topbar {
    padding: 11px 14px;
  }

  .content {
    width: 100%;
    padding: 22px 16px 34px;
  }

  .metric-row,
  .money-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .chat {
    height: calc(100vh - 102px);
    min-height: 520px;
  }

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .day {
    min-height: 92px;
  }

  .status {
    display: none;
  }
}

@media (max-width: 680px) {
  .topbar {
    gap: 8px;
  }

  .search {
    max-width: none;
  }

  .page-title {
    display: block;
  }

  .page-title h1 {
    font-size: clamp(26px, 10vw, 38px);
  }

  .page-actions {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .bottom-grid,
  .metric-row,
  .money-grid,
  .dashboard-command-grid,
  .calendar-brief,
  .review-summary,
  .list-command-strip,
  .phone-stage,
  .review-grid {
    grid-template-columns: 1fr;
  }

  .tile-grid,
  .integration-grid,
  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .app-tile {
    min-height: 150px;
    padding: 12px;
  }

  .row,
  .list-row,
  .action-card,
  .notification-card,
  .email-row,
  .dialer-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .chips,
  .review-actions {
    justify-content: flex-start;
  }

  .chat-input {
    grid-template-columns: 1fr;
  }

  .chat-input button {
    width: 100%;
  }

  .mode-dock select,
  .mode-pill,
  .prompt-grid button,
  .context-chip {
    width: 100%;
  }

  .prompt-grid {
    grid-template-columns: 1fr;
  }

  .timeline-strip {
    grid-template-columns: repeat(7, 86px);
  }

  .card-actions,
  .email-meta,
  .switchboard-head,
  .mail-toolbar {
    justify-content: flex-start;
  }

  .mode-popover {
    left: 0;
    right: 0;
    width: 100%;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .dialpad {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .drawer {
    padding: 16px;
  }
}

@media (max-width: 430px) {
  .content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .tile-grid,
  .integration-grid,
  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .app-tile {
    aspect-ratio: auto;
    min-height: 132px;
  }

  .search input::placeholder {
    color: transparent;
  }

  .hero {
    min-height: 300px;
  }
}

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

/* Browser-tested Aurea experience fixes. Kept at the end so these rules win
   over the older dashboard/chat/mobile rules above. */
body {
  background:
    radial-gradient(circle at 22% 0%, rgba(232, 184, 124, 0.14), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(138, 184, 196, 0.11), transparent 30%),
    linear-gradient(180deg, #070707 0%, #11100e 44%, #090908 100%);
}

.main::before {
  opacity: 0.18;
}

.topbar {
  background: rgba(9, 9, 8, 0.72);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.panel,
.stat-card,
.action-card,
.notification-card,
.review-card,
.email-row {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.032)),
    rgba(17, 16, 14, 0.78);
  border-color: rgba(255, 255, 255, 0.105);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(22px);
}

.dashboard-command-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: stretch;
}

.command-hero {
  min-height: 470px;
  overflow: hidden;
  background:
    linear-gradient(140deg, rgba(236, 174, 122, 0.2), rgba(22, 18, 16, 0.9) 44%, rgba(96, 128, 108, 0.18)),
    rgba(16, 14, 12, 0.86);
}

.command-hero h1 {
  max-width: 560px;
  font-size: clamp(46px, 5.4vw, 78px);
  line-height: 0.92;
}

.command-hero .metric-row {
  margin-top: auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.command-hero .stat-card {
  min-height: 118px;
}

.command-hero::after {
  opacity: 0.08;
  right: 18px;
  bottom: -14px;
}

body[data-page="chat"] .content {
  max-width: 1180px;
}

.premium-chat.chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  height: calc(100vh - 212px);
  min-height: 650px;
}

.assistant-status {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.assistant-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.assistant-status .chip {
  white-space: nowrap;
}

.chat-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 14px;
}

.context-rail {
  align-content: start;
  display: grid;
  gap: 8px;
}

.context-rail .context-chip {
  width: 100%;
  justify-content: flex-start;
  min-height: 40px;
  text-align: left;
}

.chat-main {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto auto auto;
  gap: 12px;
}

.prompt-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.prompt-grid button {
  min-height: 42px;
  padding: 9px 10px;
}

.premium-chat .chat-log {
  min-height: 260px;
  overflow: auto;
  scroll-behavior: smooth;
}

.bubble {
  border-radius: 16px;
}

.bubble.mira,
.bubble:not(.user) {
  background: rgba(255, 255, 255, 0.06);
}

.bubble.user {
  background: rgba(149, 180, 190, 0.14);
}

.bubble.thinking div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bubble.thinking span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--amber);
  animation: thinkingPulse 900ms ease-in-out infinite;
}

.bubble.thinking span:nth-child(2) {
  animation-delay: 120ms;
}

.bubble.thinking span:nth-child(3) {
  animation-delay: 240ms;
}

.mode-dock {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
}

.mode-dock select,
.mode-pill {
  flex: 0 0 auto;
}

.premium-composer {
  grid-template-columns: minmax(0, 1fr) 118px;
  align-items: end;
}

.premium-composer textarea {
  min-height: 76px;
  resize: vertical;
}

.premium-composer button {
  min-height: 50px;
}

.premium-composer button:disabled,
.premium-composer textarea:disabled {
  opacity: 0.62;
  cursor: wait;
}

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

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

  .premium-chat.chat {
    height: auto;
    min-height: calc(100vh - 118px);
  }

  .chat-workspace {
    grid-template-columns: 1fr;
  }

  .context-rail {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .context-rail .context-chip {
    width: auto;
    flex: 0 0 auto;
    justify-content: center;
  }
}

@media (max-width: 680px) {
  .command-hero {
    min-height: auto;
  }

  .command-hero h1 {
    font-size: clamp(38px, 12vw, 54px);
  }

  .command-hero .metric-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assistant-status-chips {
    align-items: flex-start;
  }

  .assistant-status .chip {
    white-space: normal;
  }

  .prompt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-dock {
    flex-wrap: wrap;
  }

  .mode-dock select,
  .mode-pill {
    width: auto;
    min-width: min(100%, 168px);
  }

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

  .premium-composer button {
    width: 100%;
  }
}

/* Full product recovery layer: navigation, core surfaces, and responsive polish. */
:root {
  --surface: rgba(15, 16, 16, 0.78);
  --surface-2: rgba(24, 24, 23, 0.74);
  --hairline: rgba(255, 255, 255, 0.11);
  --focus: rgba(245, 186, 121, 0.72);
}

.shell {
  grid-template-columns: 282px minmax(0, 1fr);
}

.sidebar {
  width: 282px;
  padding: 16px 12px;
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(13, 14, 14, 0.94), rgba(9, 9, 8, 0.92)),
    rgba(9, 9, 8, 0.92);
  border-right-color: rgba(255, 255, 255, 0.085);
}

.brand-row {
  min-height: 58px;
  padding: 4px 6px 13px;
}

.mark {
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(245, 186, 121, 0.2)),
    #141414;
}

.nav {
  gap: 3px;
  padding-right: 0;
}

.nav button {
  min-height: 42px;
  border-radius: 13px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav button:hover {
  color: var(--text-strong);
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav button.active {
  color: var(--text-strong);
  border-color: rgba(245, 186, 121, 0.24);
  background:
    linear-gradient(90deg, rgba(245, 186, 121, 0.22), rgba(255, 255, 255, 0.07)),
    rgba(255, 255, 255, 0.08);
}

.nav button.active span:first-child {
  background: rgba(245, 186, 121, 0.22);
}

.children {
  padding-left: 36px;
}

.children .child {
  min-height: 34px;
  border-radius: 11px;
}

.children.open {
  max-height: 520px;
}

.sidebar-note {
  margin-top: auto;
  border-top-color: rgba(255, 255, 255, 0.08);
}

body.sidebar-collapsed .shell {
  grid-template-columns: 78px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  width: 78px;
}

.content {
  max-width: 1320px;
}

.page-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
}

.page-title h1 {
  font-size: clamp(36px, 4vw, 58px);
  line-height: 0.96;
}

.page-title p {
  max-width: 760px;
  color: rgba(245, 241, 234, 0.72);
}

button,
input,
select,
textarea {
  border-radius: 13px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

button.primary {
  background:
    linear-gradient(180deg, rgba(255, 237, 205, 0.96), rgba(235, 157, 122, 0.94));
  color: #21110c;
  border-color: rgba(255, 229, 194, 0.55);
  box-shadow: 0 14px 34px rgba(221, 138, 92, 0.2);
}

button.primary:hover {
  filter: brightness(1.04);
  box-shadow: 0 18px 42px rgba(221, 138, 92, 0.28);
}

.panel,
.stat-card,
.action-card,
.notification-card,
.review-card,
.email-row,
.row,
.list-row {
  border-radius: 18px;
}

.panel {
  padding: 18px;
}

.panel-head h2 {
  font-size: 15px;
  letter-spacing: 0;
}

.dashboard-command-grid {
  gap: 18px;
}

.bottom-grid.command-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.action-card {
  min-height: 92px;
}

.command-hero {
  padding: clamp(22px, 3vw, 34px);
}

.command-hero .hero-actions {
  margin-top: 24px;
}

.command-hero .metric-row {
  gap: 10px;
}

.stat-card strong {
  font-size: clamp(24px, 2.3vw, 34px);
}

.integration-grid .app-tile,
.catalog-grid .app-tile,
.tile-grid .app-tile {
  border: 1px solid var(--hairline);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.072), rgba(255, 255, 255, 0.032)),
    rgba(16, 16, 15, 0.74);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.24);
}

.integration-tile:hover,
.catalog-tile:hover,
.app-tile:hover {
  border-color: rgba(245, 186, 121, 0.26);
  transform: translateY(-2px);
}

body[data-page="integrations"] .integration-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

body[data-page="integrations"] .app-tile {
  min-height: 178px;
}

.chat-log::-webkit-scrollbar,
.nav::-webkit-scrollbar {
  width: 10px;
}

.chat-log::-webkit-scrollbar-thumb,
.nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

@media (max-width: 1180px) {
  .bottom-grid.command-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar {
    width: min(318px, 86vw);
    max-width: 86vw;
    transform: translateX(-104%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  body.sidebar-collapsed .shell {
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed .sidebar {
    width: min(318px, 86vw);
    align-items: stretch;
  }

  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .nav b,
  body.sidebar-collapsed .nav i,
  body.sidebar-collapsed .sidebar-note {
    display: block;
  }

  body.sidebar-collapsed .children {
    display: block;
  }

  body.sidebar-collapsed .nav button {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    place-items: stretch;
  }

  .content {
    padding-top: 24px;
  }

  .page-title {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 680px) {
  .content {
    padding: 22px 12px 34px;
  }

  .page-title h1 {
    font-size: clamp(34px, 12vw, 48px);
  }

  .bottom-grid.command-grid {
    grid-template-columns: 1fr;
  }

  .command-hero .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .command-hero .metric-row {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card {
    min-height: 116px;
  }

  body[data-page="integrations"] .integration-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Aurea product redesign: graphite cockpit, grouped navigation, CRM-ready surfaces */
:root {
  --bg: #05070b;
  --bg-2: #091019;
  --bg-3: #0d1621;
  --surface: rgba(12, 19, 29, 0.82);
  --surface-2: rgba(18, 28, 41, 0.72);
  --surface-3: rgba(227, 236, 247, 0.055);
  --surface-4: rgba(227, 236, 247, 0.095);
  --line: rgba(210, 226, 244, 0.12);
  --line-strong: rgba(210, 226, 244, 0.22);
  --text: #eaf1f8;
  --text-strong: #ffffff;
  --soft: #b9c7d4;
  --muted: #7f90a2;
  --faint: #536476;
  --clay: #7dd3fc;
  --rose: #f0a6ca;
  --bronze: #a7f3d0;
  --sage: #8be9c7;
  --amber: #f5c76b;
  --red: #ff8a8a;
  --mist: #9cb7ff;
  --focus: rgba(125, 211, 252, 0.52);
  --hairline: rgba(210, 226, 244, 0.14);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.52);
  --shadow-soft: 0 18px 54px rgba(0, 0, 0, 0.36);
}

body {
  background:
    radial-gradient(circle at 18% 0%, rgba(125, 211, 252, 0.12), transparent 27%),
    radial-gradient(circle at 92% 12%, rgba(167, 243, 208, 0.1), transparent 30%),
    radial-gradient(circle at 55% 92%, rgba(240, 166, 202, 0.08), transparent 36%),
    linear-gradient(180deg, #05070b 0%, #08101a 48%, #05070b 100%);
}

body::before {
  background-image:
    linear-gradient(rgba(125, 211, 252, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 243, 208, 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.36;
}

.shell {
  grid-template-columns: 306px minmax(0, 1fr);
}

.sidebar {
  width: 306px;
  padding: 14px;
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(8, 13, 20, 0.96), rgba(5, 8, 13, 0.94)),
    rgba(5, 8, 13, 0.92);
  border-right: 1px solid rgba(125, 211, 252, 0.14);
  box-shadow: 22px 0 80px rgba(0, 0, 0, 0.38);
}

.brand-row {
  padding: 7px 6px 13px;
  border-bottom-color: rgba(125, 211, 252, 0.13);
}

.mark,
.avatar {
  border-color: rgba(125, 211, 252, 0.34);
  background:
    linear-gradient(145deg, rgba(125, 211, 252, 0.22), rgba(167, 243, 208, 0.14)),
    #0a121b;
  color: #e7fcff;
}

.brand-copy strong {
  font-weight: 820;
}

.brand-copy span,
.sidebar-note {
  color: rgba(185, 199, 212, 0.7);
}

.nav {
  gap: 12px;
  padding: 3px 1px 8px;
}

.nav-section {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(210, 226, 244, 0.08);
  border-radius: 18px;
  background: rgba(210, 226, 244, 0.025);
}

.nav-section-title {
  padding: 2px 8px 6px;
  color: rgba(185, 199, 212, 0.58);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-family {
  display: grid;
  gap: 2px;
}

.nav button {
  min-height: 42px;
  border-radius: 14px;
  color: rgba(185, 199, 212, 0.82);
}

.nav button span:first-child {
  border: 1px solid rgba(210, 226, 244, 0.08);
  border-radius: 12px;
  background: rgba(210, 226, 244, 0.055);
  color: rgba(234, 241, 248, 0.9);
}

.nav button:hover {
  background: rgba(125, 211, 252, 0.08);
  border-color: rgba(125, 211, 252, 0.15);
  color: #ffffff;
}

.nav button.active {
  background:
    linear-gradient(90deg, rgba(125, 211, 252, 0.22), rgba(167, 243, 208, 0.12)),
    rgba(210, 226, 244, 0.08);
  border-color: rgba(125, 211, 252, 0.36);
  color: #ffffff;
  box-shadow: inset 3px 0 0 rgba(167, 243, 208, 0.86), 0 12px 30px rgba(0, 0, 0, 0.16);
}

.nav button.active span:first-child {
  background: rgba(125, 211, 252, 0.18);
  color: #ffffff;
}

.children {
  padding-left: 14px;
  border-left: 1px solid rgba(125, 211, 252, 0.13);
  margin-left: 15px;
}

.children.open {
  max-height: 520px;
}

.children .child {
  min-height: 34px;
  margin-top: 3px;
  padding-left: 12px;
  color: rgba(185, 199, 212, 0.72);
}

.children .child.active {
  color: #ffffff;
  background: rgba(167, 243, 208, 0.09);
  border-color: rgba(167, 243, 208, 0.2);
}

.topbar {
  background: rgba(5, 9, 14, 0.75);
  border-bottom-color: rgba(125, 211, 252, 0.12);
}

.search {
  background: rgba(210, 226, 244, 0.055);
  border-color: rgba(210, 226, 244, 0.12);
}

.page-kicker {
  color: var(--bronze);
}

.page-kicker::before {
  background: var(--clay);
  box-shadow: 0 0 24px rgba(125, 211, 252, 0.62);
}

.panel,
.stat-card,
.action-card,
.notification-card,
.review-card,
.email-row,
.row,
.list-row {
  border-color: rgba(210, 226, 244, 0.12);
  background:
    linear-gradient(180deg, rgba(210, 226, 244, 0.072), rgba(210, 226, 244, 0.032)),
    rgba(9, 15, 23, 0.76);
}

.panel-lens {
  background: linear-gradient(180deg, var(--clay), var(--bronze));
}

button.primary {
  background:
    linear-gradient(135deg, rgba(167, 243, 208, 0.98), rgba(125, 211, 252, 0.96));
  color: #041014;
  border-color: rgba(203, 251, 239, 0.58);
  box-shadow: 0 18px 44px rgba(34, 211, 238, 0.18);
}

button.primary:hover {
  box-shadow: 0 22px 52px rgba(34, 211, 238, 0.26);
}

.command-hero {
  background:
    linear-gradient(135deg, rgba(125, 211, 252, 0.13), rgba(167, 243, 208, 0.08) 44%, rgba(240, 166, 202, 0.08)),
    rgba(7, 12, 19, 0.82);
}

.command-hero .metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr));
}

.command-hero .stat-card {
  min-width: 0;
}

.command-hero .stat-card strong {
  font-size: clamp(22px, 1.7vw, 30px);
  line-height: 1.02;
  overflow-wrap: normal;
  word-break: normal;
}

.premium-chat.chat {
  background: transparent;
}

.assistant-status,
.chat-workspace,
.premium-composer {
  border-color: rgba(125, 211, 252, 0.14);
  background:
    linear-gradient(180deg, rgba(210, 226, 244, 0.07), rgba(210, 226, 244, 0.03)),
    rgba(9, 15, 23, 0.82);
}

.prompt-grid button,
.context-rail button {
  background: rgba(210, 226, 244, 0.055);
  border-color: rgba(210, 226, 244, 0.1);
}

.prompt-grid button:hover,
.context-rail button:hover {
  background: rgba(125, 211, 252, 0.09);
  border-color: rgba(125, 211, 252, 0.2);
}

.bubble.user {
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.18), rgba(167, 243, 208, 0.1));
  border-color: rgba(125, 211, 252, 0.24);
}

.bubble.mira {
  background: rgba(210, 226, 244, 0.065);
  border-color: rgba(210, 226, 244, 0.12);
}

.crm-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 18px;
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(167, 243, 208, 0.12), rgba(125, 211, 252, 0.08) 54%, rgba(240, 166, 202, 0.08)),
    rgba(7, 12, 19, 0.82);
}

.crm-hero h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 44px);
  line-height: 1;
}

.crm-hero p {
  max-width: 760px;
  color: var(--soft);
  line-height: 1.55;
}

.crm-health,
.crm-provider-grid {
  display: grid;
  gap: 12px;
}

.crm-provider-card {
  min-height: 140px;
}

.integration-spotlight {
  margin-bottom: 16px;
}

.crm-integration {
  border-color: rgba(167, 243, 208, 0.18) !important;
}

body[data-page="call_leads"] .page-title h1,
body[data-page="chat"] .page-title h1,
body[data-page="integrations"] .page-title h1 {
  background: linear-gradient(90deg, #ffffff, #bcefff 42%, #c8f7dd);
  -webkit-background-clip: text;
  color: transparent;
}

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

  .sidebar,
  body.sidebar-collapsed .sidebar {
    width: min(326px, 88vw);
    max-width: 88vw;
  }

  .nav-section {
    padding: 7px;
  }

  body.sidebar-collapsed .nav-section-title {
    display: block;
  }

  .crm-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  body[data-page="integrations"] .integration-grid {
    grid-template-columns: 1fr;
  }

  .crm-hero h2 {
    font-size: 32px;
  }

  .prompt-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Aurea build pass: semantic executive command system */
:root {
  --bg-app: #030711;
  --bg-sidebar: #060b13;
  --bg-topbar: rgba(5, 10, 17, 0.82);
  --surface-base: rgba(11, 18, 28, 0.84);
  --surface-panel: rgba(14, 23, 35, 0.78);
  --surface-raised: rgba(19, 31, 45, 0.86);
  --surface-hover: rgba(31, 48, 66, 0.74);
  --border-muted: rgba(171, 196, 222, 0.12);
  --border-strong: rgba(125, 211, 252, 0.34);
  --text-primary: #f5f9ff;
  --text-secondary: #c5d3e2;
  --text-muted: #8295aa;
  --accent-primary: #67e8f9;
  --accent-primary-hover: #a5f3fc;
  --accent-secondary: #a7f3d0;
  --status-success: #86efac;
  --status-warning: #facc15;
  --status-danger: #fb7185;
  --status-info: #93c5fd;
  --mira-accent: #c4b5fd;
  --focus-ring: rgba(103, 232, 249, 0.34);
  --bg: var(--bg-app);
  --bg-2: #07101b;
  --bg-3: #0d1826;
  --surface: var(--surface-base);
  --surface-2: var(--surface-panel);
  --surface-3: rgba(197, 211, 226, 0.06);
  --surface-4: rgba(197, 211, 226, 0.1);
  --line: var(--border-muted);
  --line-strong: var(--border-strong);
  --text: var(--text-primary);
  --text-strong: #ffffff;
  --soft: var(--text-secondary);
  --muted: var(--text-muted);
  --faint: #5f7185;
  --clay: var(--accent-primary);
  --rose: var(--mira-accent);
  --bronze: var(--accent-secondary);
  --sage: var(--status-success);
  --amber: var(--status-warning);
  --red: var(--status-danger);
  --mist: var(--status-info);
  --primary: var(--accent-primary);
  --primary-hover: var(--accent-primary-hover);
  --success: var(--status-success);
  --warning: var(--status-warning);
  --danger: var(--status-danger);
  --shadow: 0 32px 100px rgba(0, 0, 0, 0.58);
  --shadow-soft: 0 18px 56px rgba(0, 0, 0, 0.38);
}

body {
  background:
    radial-gradient(circle at 16% -4%, rgba(103, 232, 249, 0.16), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(167, 243, 208, 0.11), transparent 30%),
    linear-gradient(180deg, var(--bg-app) 0%, #07111d 46%, #030711 100%);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--focus-ring);
}

.shell {
  grid-template-columns: 320px minmax(0, 1fr);
}

.sidebar {
  width: 320px;
  padding: 16px;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(9, 16, 26, 0.98), rgba(3, 7, 17, 0.96)),
    var(--bg-sidebar);
  border-right: 1px solid rgba(103, 232, 249, 0.18);
}

.brand-row {
  position: relative;
  padding: 8px 7px 15px;
}

.brand-row::after {
  content: "Private command center";
  position: absolute;
  right: 6px;
  bottom: -8px;
  padding: 3px 7px;
  border: 1px solid rgba(134, 239, 172, 0.2);
  border-radius: 999px;
  background: rgba(134, 239, 172, 0.08);
  color: rgba(199, 255, 220, 0.76);
  font-size: 10px;
  font-weight: 720;
}

.mark {
  border-radius: 15px;
  background:
    linear-gradient(140deg, rgba(103, 232, 249, 0.28), rgba(167, 243, 208, 0.14)),
    #091422;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 14px 34px rgba(0, 0, 0, 0.28);
}

.nav {
  gap: 10px;
  padding: 8px 2px 10px 0;
}

.nav-section {
  position: relative;
  padding: 10px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(197, 211, 226, 0.052), rgba(197, 211, 226, 0.018)),
    rgba(6, 12, 21, 0.54);
  border: 1px solid rgba(171, 196, 222, 0.1);
}

.nav-section::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 2px;
  border-radius: 99px;
  background: linear-gradient(180deg, rgba(103, 232, 249, 0.52), rgba(167, 243, 208, 0.1));
  opacity: 0.36;
}

.nav-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px 8px 11px;
  color: rgba(197, 211, 226, 0.62);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.nav button {
  position: relative;
  min-height: 44px;
  grid-template-columns: 32px minmax(0, 1fr) auto auto;
  border-radius: 15px;
  padding: 7px 9px;
}

.nav button::after {
  content: "";
  position: absolute;
  inset: 9px auto 9px -10px;
  width: 3px;
  border-radius: 99px;
  background: transparent;
}

.nav button span:first-child {
  width: 31px;
  height: 31px;
  border-radius: 12px;
  background: rgba(197, 211, 226, 0.06);
}

.nav button:hover {
  background: rgba(103, 232, 249, 0.075);
  border-color: rgba(103, 232, 249, 0.2);
}

.nav button.active {
  background:
    linear-gradient(90deg, rgba(103, 232, 249, 0.24), rgba(167, 243, 208, 0.12)),
    rgba(197, 211, 226, 0.075);
  border-color: rgba(103, 232, 249, 0.42);
}

.nav button.active::after {
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
  box-shadow: 0 0 18px rgba(103, 232, 249, 0.62);
}

.nav button.active span:first-child {
  background: rgba(103, 232, 249, 0.2);
  border-color: rgba(103, 232, 249, 0.24);
}

.nav-meta {
  min-width: max-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(197, 211, 226, 0.075);
  color: rgba(197, 211, 226, 0.72);
  font-size: 10px;
  line-height: 1;
  font-style: normal;
  font-weight: 720;
}

.nav button.active .nav-meta {
  background: rgba(167, 243, 208, 0.13);
  color: #d9ffe9;
}

.nav-family {
  border-radius: 16px;
}

.nav-family.active {
  background: rgba(103, 232, 249, 0.035);
}

.children {
  margin: 4px 0 2px 16px;
  padding: 1px 0 1px 12px;
  border-left: 1px solid rgba(103, 232, 249, 0.17);
}

.children.open {
  max-height: 560px;
}

.children .child {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 34px;
  margin-top: 4px;
  padding: 6px 9px;
  font-size: 12px;
}

.children .child .nav-meta {
  font-size: 9px;
}

.sidebar-note {
  border-top-color: rgba(103, 232, 249, 0.12);
  color: rgba(197, 211, 226, 0.62);
}

.topbar {
  background: var(--bg-topbar);
  border-bottom-color: rgba(103, 232, 249, 0.14);
}

.search {
  max-width: 760px;
  background: rgba(197, 211, 226, 0.058);
  border-color: rgba(171, 196, 222, 0.13);
}

.panel,
.stat-card,
.action-card,
.notification-card,
.review-card,
.email-row,
.row,
.list-row {
  background:
    linear-gradient(180deg, rgba(197, 211, 226, 0.076), rgba(197, 211, 226, 0.032)),
    var(--surface-panel);
  border-color: var(--border-muted);
}

.chip.ok {
  color: #d9ffe9;
  border-color: rgba(134, 239, 172, 0.3);
  background: rgba(134, 239, 172, 0.1);
}

.chip.warn {
  color: #fff0a8;
  border-color: rgba(250, 204, 21, 0.3);
  background: rgba(250, 204, 21, 0.1);
}

.chip.danger,
.bubble.error {
  color: #ffe1e7;
  border-color: rgba(251, 113, 133, 0.32);
  background: rgba(251, 113, 133, 0.1);
}

.premium-chat.chat {
  min-height: calc(100vh - 170px);
  display: grid;
  gap: 14px;
}

.assistant-status {
  padding: 16px;
  border-radius: 18px;
}

.chat-workspace {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(160px, 210px) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border-radius: 22px;
}

.context-rail {
  align-content: start;
  align-items: stretch;
  display: grid;
  gap: 8px;
}

.context-rail button {
  justify-content: flex-start;
}

.chat-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr) auto auto auto;
  gap: 12px;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 9px;
}

.chat-log {
  min-height: 320px;
  max-height: min(52vh, 560px);
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(171, 196, 222, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(3, 7, 17, 0.2), rgba(3, 7, 17, 0.58)),
    rgba(3, 7, 17, 0.42);
}

.bubble {
  max-width: 88%;
  border-radius: 18px;
}

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

.bubble.thinking span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 3px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: pulseDot 900ms ease-in-out infinite alternate;
}

.bubble.thinking span:nth-child(2) {
  animation-delay: 120ms;
}

.bubble.thinking span:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes pulseDot {
  from { opacity: 0.35; transform: translateY(0); }
  to { opacity: 1; transform: translateY(-2px); }
}

.mode-dock {
  position: relative;
  display: grid;
  grid-template-columns: minmax(115px, auto) minmax(150px, 1fr) minmax(120px, 0.7fr) minmax(190px, 1.2fr);
  gap: 8px;
  align-items: center;
}

.premium-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border-radius: 20px;
}

.premium-composer textarea {
  min-height: 82px;
  max-height: 220px;
  resize: vertical;
}

.premium-composer button {
  min-width: 116px;
  min-height: 58px;
}

.bubble.error strong {
  color: #ffc7d2;
}

.crm-hero {
  border-color: rgba(167, 243, 208, 0.16);
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 292px minmax(0, 1fr);
  }

  .sidebar {
    width: 292px;
  }

  .prompt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-workspace {
    grid-template-columns: 1fr;
  }

  .context-rail {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .context-rail button {
    min-width: max-content;
  }
}

@media (max-width: 980px) {
  .shell,
  body.sidebar-collapsed .shell {
    grid-template-columns: 1fr;
  }

  .sidebar,
  body.sidebar-collapsed .sidebar {
    width: min(338px, 90vw);
    max-width: 90vw;
  }

  .brand-row::after {
    display: none;
  }
}

@media (max-width: 680px) {
  .content {
    padding: 22px 14px 34px;
  }

  .page-title {
    align-items: flex-start;
  }

  .page-title h1 {
    font-size: 36px;
  }

  .prompt-grid,
  .mode-dock,
  .premium-composer {
    grid-template-columns: 1fr;
  }

  .chat-workspace {
    min-height: 0;
    padding: 10px;
  }

  .chat-log {
    max-height: 52vh;
  }

  .bubble {
    max-width: 100%;
  }
}

/* Immediate cleanup: logo-only brand, real sidebar toggle, and full-page Mira AI. */
.brand-row {
  min-height: 144px;
  justify-content: center;
  padding: 8px 0 12px;
}

.brand-row::after {
  display: none !important;
}

.brand-logo {
  display: block;
  width: min(172px, 72%);
  height: auto;
  max-height: 128px;
  object-fit: contain;
  filter: drop-shadow(0 12px 34px rgba(103, 232, 249, 0.16));
}

body.sidebar-collapsed .brand-row {
  min-height: 54px;
  padding: 6px 0 10px;
}

body.sidebar-collapsed .brand-logo {
  width: 42px;
  max-width: 42px;
  max-height: 42px;
}

#menuBtn {
  display: grid;
}

body[data-page="chat"] .content {
  max-width: none;
  min-height: calc(100vh - 74px);
  padding: 0;
}

body[data-page="chat"] .page-title,
body[data-page="chat"] .assistant-status,
body[data-page="chat"] .context-rail,
body[data-page="chat"] .prompt-grid,
body[data-page="chat"] .mode-dock,
body[data-page="chat"] .chat-history {
  display: none !important;
}

.mira-fullscreen {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(103, 232, 249, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(6, 12, 21, 0.82), rgba(3, 7, 17, 0.98));
}

.mira-fullscreen-head {
  padding: clamp(22px, 4vw, 46px) clamp(18px, 5vw, 72px) 14px;
}

.mira-fullscreen-head h1 {
  margin: 0;
  color: var(--text-primary, #f8fafc);
  font-size: clamp(52px, 9vw, 118px);
  line-height: 0.92;
  font-weight: 860;
  letter-spacing: 0;
}

.mira-fullscreen .chat-log {
  min-height: 0;
  max-height: none;
  height: auto;
  margin: 0 auto;
  width: min(980px, calc(100% - 34px));
  padding: 18px 0 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.mira-fullscreen .bubble {
  max-width: min(760px, 92%);
  margin-bottom: 14px;
  border-radius: 18px;
}

.mira-fullscreen .bubble.user {
  margin-left: auto;
}

.mira-composer {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 10px;
  width: min(980px, calc(100% - 34px));
  margin: 0 auto;
  padding: 14px 0 22px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, transparent, rgba(3, 7, 17, 0.94) 22%);
  box-shadow: none;
}

.mira-composer textarea {
  min-height: 58px;
  max-height: 170px;
  resize: vertical;
  border: 1px solid rgba(171, 196, 222, 0.16);
  border-radius: 16px;
  background: rgba(8, 13, 20, 0.9);
  padding: 17px 18px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.2);
}

.mira-composer button {
  min-height: 58px;
  border-radius: 16px;
}

@media (max-width: 860px) {
  .brand-row {
    min-height: 130px;
  }

  .brand-logo {
    width: min(162px, 64vw);
    max-height: 118px;
  }
}

@media (max-width: 680px) {
  .mira-fullscreen-head {
    padding: 22px 18px 10px;
  }

  .mira-fullscreen .chat-log,
  .mira-composer {
    width: calc(100% - 28px);
  }

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

/* Simple usable Calendar page. */
body[data-page="calendar"] .content {
  max-width: 1220px;
}

.simple-calendar {
  display: grid;
  gap: 14px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(245, 230, 214, 0.1);
  border-radius: 12px;
  background: rgba(12, 15, 18, 0.62);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2);
}

.calendar-toolbar h2 {
  margin: 2px 0 0;
  font-size: clamp(24px, 4vw, 38px);
  letter-spacing: 0;
}

.calendar-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.calendar-toolbar-actions button.active {
  border-color: rgba(103, 232, 249, 0.38);
  background: rgba(103, 232, 249, 0.12);
  color: #dffcff;
}

.calendar-status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid rgba(245, 230, 214, 0.09);
  border-radius: 10px;
  background: rgba(245, 230, 214, 0.04);
  color: var(--soft);
}

.calendar-provider-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calendar-provider-actions button {
  min-height: 40px;
}

.calendar-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 14px;
  align-items: start;
}

.calendar-month-card,
.calendar-day-panel,
.calendar-list {
  border: 1px solid rgba(245, 230, 214, 0.105);
  border-radius: 12px;
  background: rgba(8, 11, 15, 0.72);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.calendar-weekdays,
.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekday {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(245, 230, 214, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 124px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 8px;
  padding: 10px;
  border: 0;
  border-right: 1px solid rgba(245, 230, 214, 0.075);
  border-bottom: 1px solid rgba(245, 230, 214, 0.075);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.015);
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.calendar-day:hover {
  transform: none;
  border-color: rgba(103, 232, 249, 0.25);
  background: rgba(103, 232, 249, 0.055);
}

.calendar-day.outside {
  color: rgba(246, 238, 229, 0.42);
  background: rgba(255, 255, 255, 0.008);
}

.calendar-day.today .day-number {
  color: #101417;
  background: #67e8f9;
}

.calendar-day.selected {
  outline: 2px solid rgba(103, 232, 249, 0.44);
  outline-offset: -2px;
  background: rgba(103, 232, 249, 0.085);
}

.day-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--text-strong);
  font-weight: 780;
}

.day-events {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.day-events em,
.day-events strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 6px;
  border-radius: 7px;
  background: rgba(103, 232, 249, 0.105);
  color: #ddfbff;
  font-size: 11px;
  font-style: normal;
  font-weight: 650;
}

.day-events strong {
  background: rgba(245, 230, 214, 0.075);
  color: var(--soft);
}

.calendar-day-panel {
  display: grid;
  gap: 0;
}

.calendar-day-panel-head {
  padding: 16px;
  border-bottom: 1px solid rgba(245, 230, 214, 0.09);
}

.calendar-day-panel-head span,
.calendar-day-panel-head p {
  color: var(--muted);
  font-size: 13px;
}

.calendar-day-panel-head h2 {
  margin: 4px 0;
  font-size: 28px;
  letter-spacing: 0;
}

.calendar-agenda-list,
.calendar-list {
  display: grid;
  gap: 0;
}

.calendar-agenda-item,
.calendar-list-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(245, 230, 214, 0.075);
}

.calendar-agenda-item time {
  color: #67e8f9;
  font-size: 12px;
  font-weight: 760;
}

.calendar-agenda-item h3,
.calendar-list-item h3 {
  margin: 0 0 4px;
  font-size: 15px;
  letter-spacing: 0;
}

.calendar-agenda-item p,
.calendar-list-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.date-badge {
  display: grid;
  gap: 4px;
}

.date-badge strong {
  color: var(--text-strong);
  font-size: 13px;
}

.date-badge span {
  color: #67e8f9;
  font-size: 12px;
  font-weight: 720;
}

.calendar-footer-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.calendar-footer-strip span {
  padding: 7px 9px;
  border: 1px solid rgba(245, 230, 214, 0.085);
  border-radius: 999px;
  background: rgba(245, 230, 214, 0.035);
}

.calendar-day-panel .empty,
.calendar-list .empty {
  min-height: 160px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.calendar-day-panel .empty .empty-mark,
.calendar-list .empty .empty-mark {
  display: none;
}

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

@media (max-width: 680px) {
  .calendar-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-toolbar-actions {
    justify-content: stretch;
  }

  .calendar-toolbar-actions button {
    flex: 1 1 auto;
  }

  .calendar-status-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-provider-actions button {
    flex: 1 1 100%;
  }

  .calendar-weekday {
    padding: 9px 4px;
    text-align: center;
  }

  .calendar-day {
    min-height: 78px;
    padding: 7px;
  }

  .day-number {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .day-events em:nth-child(n+2),
  .day-events strong {
    display: none;
  }

  .calendar-agenda-item,
  .calendar-list-item {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

/* Final content resilience: keep dense cards readable when the app viewport is narrow. */
.action-card,
.notification-card,
.review-card,
.email-row,
.list-row {
  grid-template-columns: minmax(180px, 1fr) auto;
}

.action-card > div:first-child,
.notification-card > div:first-child,
.review-card > div:first-child,
.email-row > div:first-child,
.list-row > div:first-child,
.row > div:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

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

.row .muted,
.panel p,
.activity-feed p {
  overflow-wrap: anywhere;
}

body[data-page="dashboard"] .bottom-grid.command-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

body[data-page="dashboard"] .panel .action-card {
  grid-template-columns: 1fr;
}

body[data-page="dashboard"] .panel .action-card .card-actions {
  justify-content: flex-start;
}

.inbox-panel .email-row,
.contacts-panel .action-card,
.provider-dashboard-card .row,
.diagnostics-panel .row {
  min-width: 0;
}

.accounts-panel .action-card,
.provider-dashboard-card {
  gap: 14px;
}

.provider-dashboard-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.provider-dashboard-card details {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0;
  background: rgba(255,255,255,.03);
}

.provider-dashboard-card summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
}

.provider-dashboard-card .action-grid {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.mail-toolbar {
  gap: 10px;
}

.mail-toolbar > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contacts-panel .action-card {
  grid-template-columns: 1fr auto;
}

.review-card.prepared-draft {
  border-color: rgba(116, 199, 236, .32);
}

.review-card.prepared-draft .review-top span:first-child {
  color: #9bdaf3;
}

.review-card.sent-item {
  border-color: rgba(116, 209, 135, .34);
}

body[data-page="diagnostics"] .content {
  max-width: 1180px;
}

@media (max-width: 760px) {
  .action-card,
  .notification-card,
  .review-card,
  .email-row,
  .list-row {
    grid-template-columns: 1fr;
  }

  .provider-dashboard-grid,
  .contacts-panel .action-card {
    grid-template-columns: 1fr;
  }

  .card-actions,
  .review-actions {
    justify-content: flex-start;
  }
}

/* Final responsive drawer guard: keep the sidebar offscreen on mobile until the menu opens. */
@media (max-width: 980px) {
  .shell,
  body.sidebar-collapsed .shell {
    grid-template-columns: 1fr !important;
  }

  .main {
    grid-column: 1 !important;
  }

  .sidebar,
  body.sidebar-collapsed .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(338px, 90vw);
    max-width: 90vw;
    transform: translateX(-104%) !important;
    transition: transform 220ms ease;
    z-index: 30;
  }

  .sidebar.mobile-open,
  body.sidebar-collapsed .sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  #sidebar.sidebar.mobile-open,
  body.sidebar-collapsed #sidebar.sidebar.mobile-open {
    transform: none !important;
  }

  .mobile-scrim.open {
    position: fixed;
    inset: 0;
    opacity: 1;
    pointer-events: auto;
    z-index: 25;
  }
}
