@font-face {
  font-family: "Lexend";
  src: url("../assets/lexend.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Lexend Giga";
  src: url("../assets/lexend-giga.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --purple: #eab308;
  --purple-2: #facc15;
  --purple-3: #fde047;
  --purple-soft: #fef9c3;
  --navy: #070d1a;
  --navy-2: #0d1627;
  --navy-3: #17223a;
  --page: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --surface-3: #eef2f8;
  --text: #18172a;
  --muted: #6b6678;
  --line: #e1e6ef;
  --green: #17a673;
  --green-soft: #e2f8ef;
  --orange: #ee8b2d;
  --orange-soft: #fff0de;
  --red: #ef4b64;
  --red-soft: #ffe7eb;
  --blue: #356df3;
  --blue-soft: #e8efff;
  --shadow: 0 14px 40px rgba(28, 24, 62, .09);
  --shadow-soft: 0 8px 24px rgba(28, 24, 62, .07);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --topbar-h: 76px;
  --sidebar-w: 276px;
  --rail-w: 318px;
  --dock-h: 150px;
  font-family: "Lexend", Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--page); color: var(--text); }
body { overflow: hidden; }
button, input, select { font: inherit; }
h1, h2, h3, h4, strong, button, .nav-group > p { font-family: "Lexend Giga", "Lexend", sans-serif; }
button { cursor: pointer; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb,var(--purple) 24%,transparent);
  outline-offset: 2px;
}

.app-shell {
  height: var(--cc-visible-height, 100dvh);
  min-height: var(--cc-visible-height, 100dvh);
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--rail-w);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) auto auto;
  background: var(--page);
}

.topbar {
  grid-column: 2 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 1fr;
  align-items: center;
  height: var(--topbar-h);
  background:
    radial-gradient(circle at 64% -80%, rgba(234, 179, 8, .24), transparent 46%),
    linear-gradient(180deg, #0b1426 0%, #070d1a 100%);
  color: #fff;
  padding: 0 20px;
  border-bottom: 1px solid #24324d;
  box-shadow: 0 7px 24px rgba(3, 7, 15, .2);
  position: relative;
  z-index: 30;
}

.brand-button {
  display: none;
  height: 100%;
  align-items: center;
  padding: 5px 20px 4px;
  color: #fff;
  text-decoration: none;
  border-right: 1px solid #24324d;
  transition: background .2s ease;
}
.brand-button:hover { background: rgba(234,179,8,.08); }
.brand-stack { display: grid; align-content: center; justify-items: start; gap: 0; }
.brand-logo { width: 154px; height: 52px; object-fit: contain; object-position: left center; }
.brand-stack small { margin-top: -4px; padding-left: 3px; color: #8d9ab1; font-size: 9px; letter-spacing: .04em; }

.topbar-center { grid-column: 1; grid-row: 1; display: flex; justify-content: flex-start; align-items: center; gap: 12px; }
.demo-chip, .refresh-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px; border-radius: 999px;
  background: rgba(17,29,50,.86); border: 1px solid #24324d;
  font-size: 11px; font-weight: 800; letter-spacing: .05em;
}
.demo-chip span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(23,166,115,.15); }
.refresh-chip { color: #8d9ab1; font-weight: 600; letter-spacing: 0; }

.topbar-actions { grid-column: 2; grid-row: 1; justify-self: end; display: flex; align-items: center; gap: 8px; }
.icon-button.mobile-menu-button { display: none; }
.mobile-menu-button svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.language-picker { position: relative; }
.language-toggle {
  width: 62px; min-width: 62px; height: 40px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 0 9px;
  border: 1px solid #24324d; border-radius: 12px; background: #111d32; color: #8d9ab1;
}
.language-toggle strong { min-width: 25px; color: #fde68a; font-size: 10px; font-weight: 900; letter-spacing: .04em; text-align: center; }
.language-toggle svg { width: 14px; fill: none; stroke: #8d9ab1; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease; }
.language-toggle[aria-expanded="true"] { border-color: rgba(253,224,71,.52); box-shadow: 0 0 0 3px rgba(234,179,8,.08); }
.language-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.language-menu {
  position: absolute; z-index: 220; top: calc(100% + 8px); right: 0; width: 190px; padding: 6px;
  border: 1px solid #2b3952; border-radius: 13px; background: rgba(8,14,28,.985);
  box-shadow: 0 22px 54px rgba(0,0,0,.48); backdrop-filter: blur(20px);
}
.language-menu[hidden] { display: none; }
.language-menu button { width: 100%; min-height: 43px; display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 8px; padding: 6px 9px; color: #e7ecf5; text-align: left; background: transparent; border: 0; border-radius: 9px; }
.language-menu button:hover, .language-menu button.selected { background: rgba(234,179,8,.14); }
.language-menu button strong { color: #fde047; font-size: 9px; }
.language-menu button span { color: #8d9ab1; font-size: 10px; }
.voice-mode-toggle { height: 40px; display: flex; align-items: center; gap: 7px; padding: 5px 9px 5px 6px; border: 1px solid rgba(23,166,115,.4); border-radius: 12px; background: rgba(23,166,115,.08); color: #f5f7fb; }
.voice-mode-toggle:hover { transform: translateY(-1px); }
.voice-mode-toggle:not(.active) { border-color: rgba(239,75,100,.42); background: rgba(239,75,100,.08); }
.voice-mode-icon { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; background: rgba(23,166,115,.14); color: #4ade80; font-size: 11px; font-weight: 900; }
.voice-mode-toggle:not(.active) .voice-mode-icon { background: rgba(239,75,100,.14); color: #fb7185; }
.voice-mode-copy { display: grid; gap: 1px; text-align: left; }
.voice-mode-copy b { font-size: 10px; }
.voice-mode-copy small { color: #8d9ab1; font-size: 8px; }
.icon-button {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  border: 1px solid #24324d; color: #f5f7fb;
  background: #111d32;
  transition: transform .2s ease, background .2s ease;
}
.icon-button:hover { transform: translateY(-1px); border-color: var(--purple); background: #17223a; }
.icon-button svg { width: 19px; height: 19px; }
.notification-button { position: relative; }
.notification-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--purple); border: 2px solid #111d32; top: 8px; right: 8px; }
.profile-menu-wrap { position: relative; }
.user-mini { display: flex; align-items: center; gap: 10px; margin-left: 8px; padding: 3px 6px 3px 12px; color: #fff; text-align: left; border: 0; border-left: 1px solid rgba(255,255,255,.18); border-radius: 11px; background: transparent; }
.user-mini:hover { background: rgba(255,255,255,.055); }
.user-mini img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid color-mix(in srgb, var(--purple) 62%, white); }
.user-mini > span { display: grid; gap: 2px; min-width: 0; }
.user-mini strong { font-size: 13px; }
.user-mini small { font-size: 11px; opacity: .75; }
.profile-menu {
  position: absolute; z-index: 220; top: calc(100% + 9px); right: 0; width: 350px; padding: 8px;
  border: 1px solid #2b3952; border-radius: 18px; background: rgba(8,14,28,.985);
  box-shadow: 0 24px 58px rgba(0,0,0,.5); backdrop-filter: blur(20px);
}
.profile-menu[hidden] { display: none; }
.profile-menu-head { display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 11px; padding: 9px 10px 14px; color: #fff; border-bottom: 1px solid rgba(141,154,177,.16); }
.profile-menu-head img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(250,204,21,.72); }
.profile-menu-head span { display: grid; gap: 4px; min-width: 0; }
.profile-menu-head strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu-head small { color: #9aa6bb; font-size: 13px; }
.profile-menu-group { display: grid; gap: 3px; padding-top: 7px; }
.profile-menu button, .profile-menu a { width: 100%; min-height: 50px; display: flex; align-items: center; gap: 10px; padding: 0 11px; color: #d6deec; text-align: left; text-decoration: none; border: 0; border-radius: 11px; background: transparent; font-size: 14px; font-weight: 700; }
.profile-menu button:hover, .profile-menu a:hover { color: #fff; background: rgba(255,255,255,.06); }
.profile-menu-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; color: #fde047; border-radius: 10px; background: rgba(234,179,8,.12); }
.profile-menu-icon svg { width: 18px; height: 18px; }
.profile-menu button > span:nth-child(2) { min-width: 0; flex: 1; }
.profile-menu button em { flex: 0 0 auto; padding: 4px 7px; color: #fbbf24; border-radius: 999px; background: rgba(245,158,11,.12); font-family: "Lexend",sans-serif; font-size: 10px; font-style: normal; font-weight: 700; }
.profile-menu button em.is-secure { color: #4ade80; background: rgba(34,197,94,.12); }
.profile-menu-separator { height: 1px; margin: 7px 8px; background: rgba(141,154,177,.16); }
.profile-menu .danger { color: #fda4af; }
.profile-menu .danger:hover { color: #fff; background: rgba(239,75,100,.13); }

.sidebar {
  grid-column: 1;
  grid-row: 1 / 5;
  min-height: 0;
  background: linear-gradient(180deg, var(--navy) 0%, #0d0d20 100%);
  color: #fff;
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.main-nav { flex: 1; overflow-y: auto; padding: 12px 12px 20px; scrollbar-width: thin; scrollbar-color: #393851 transparent; }
.nav-home { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.07); }
.nav-item-home { min-height: 54px; }
.nav-group { margin-bottom: 16px; }
.nav-label { color: #77768d; font-size: 11px; font-weight: 700; letter-spacing: .13em; padding: 0 10px 8px; }
.nav-item {
  width: 100%; border: 0; background: transparent; color: #b7b6c9;
  display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 12px; text-align: left; margin: 2px 0;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; transform: translateX(2px); }
.nav-item.active { background: linear-gradient(90deg, rgba(234,179,8,.28), rgba(234,179,8,.09)); color: #fff; box-shadow: inset 3px 0 0 var(--purple); }
.nav-item-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.05); color: #facc15; }
.nav-item.active .nav-item-icon { background: rgba(234,179,8,.17); color: #fde68a; }
.nav-item-icon svg { width: 18px; height: 18px; }
.nav-item-copy { min-width: 0; }
.nav-item-copy strong { display: block; font-size: 12.5px; line-height: 1.2; }
.nav-item-copy small { display: block; font-size: 10px; color: #76758c; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item.active small { color: #aaa2c7; }
.nav-badge { font-size: 9px; color: #fde68a; padding: 3px 6px; border-radius: 999px; background: rgba(234,179,8,.16); }
.sidebar-footer { padding: 10px 12px 14px; border-top: 1px solid rgba(255,255,255,.07); display: grid; gap: 8px; }
.sidebar-action, .sidebar-help { border: 0; color: #fff; border-radius: 12px; padding: 11px 12px; display: flex; align-items: center; gap: 10px; text-align: left; }
.sidebar-action { background: linear-gradient(90deg, #a16207, #ca8a04); }
.sidebar-help { background: rgba(255,255,255,.05); color: #aaa9bc; }
.sidebar-action svg, .sidebar-help svg { width: 17px; height: 17px; flex: 0 0 auto; }
.sidebar-action strong, .sidebar-help strong { display: block; font-size: 13px; }
.sidebar-action small, .sidebar-help small { display: block; font-size: 11px; opacity: .7; margin-top: 2px; }

.workspace {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  overflow-x: clip;
  overflow-y: auto;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: #c8c8d6 transparent;
}
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.eyebrow { margin: 0 0 5px; color: var(--purple); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.page-head h1 { margin: 0; font-size: 28px; letter-spacing: -.035em; }
.page-head p:not(.eyebrow) { margin: 6px 0 0; color: var(--muted); font-size: 13px; max-width: 660px; }
.page-actions { display: flex; align-items: center; gap: 8px; }
.select-button, .secondary-button, .primary-button {
  height: 42px; border-radius: 12px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; white-space: nowrap; flex: 0 0 auto;
}
.select-button, .secondary-button { border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.primary-button { border: 0; background: linear-gradient(90deg, #ca8a04, #eab308); color: #171208; box-shadow: 0 9px 24px rgba(234,179,8,.22); }
.select-button svg, .secondary-button svg, .primary-button svg { width: 16px; height: 16px; }
.content { display: grid; gap: 16px; }

.right-rail {
  grid-column: 3;
  grid-row: 2;
  min-height: 0;
  overflow-y: auto;
  background: var(--surface-2);
  border-left: 1px solid var(--line);
  padding: 20px 16px;
  display: grid;
  align-content: start;
  gap: 12px;
  scrollbar-width: thin;
}
.rail-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow-soft); }
.rail-heading { display: flex; gap: 11px; align-items: center; }
.rail-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--purple-soft); color: var(--purple); display: grid; place-items: center; }
.rail-icon svg { width: 18px; height: 18px; }
.rail-heading div { display: grid; gap: 3px; }
.rail-heading span:not(.rail-icon) { font-size: 10px; color: var(--muted); font-weight: 800; letter-spacing: .08em; }
.rail-heading strong { font-size: 13px; }
.meeting-time { margin-top: 13px; font-size: 20px; font-weight: 800; }
.next-meeting-card p { font-size: 11px; color: var(--muted); }
.rail-title-row { display: flex; align-items: center; justify-content: space-between; }
.rail-title-row h3 { margin: 0; font-size: 13px; }
.count-badge { min-width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; background: var(--purple-soft); color: var(--purple); font-size: 10px; font-weight: 800; }
.priority-list, .source-list { display: grid; gap: 7px; margin-top: 13px; }
.priority-item, .source-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.priority-item:last-child, .source-item:last-child { border-bottom: 0; }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; }
.priority-item strong, .source-item strong { font-size: 11.5px; display: block; }
.priority-item small, .source-item small { font-size: 10.5px; color: var(--muted); display: block; margin-top: 2px; }
.priority-level { font-size: 10px; font-weight: 800; padding: 4px 6px; border-radius: 999px; }
.source-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--purple); background: var(--purple-soft); }
.source-icon svg { width: 14px; height: 14px; }
.source-state { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.status-live { font-size: 10px; font-weight: 900; color: var(--green); background: var(--green-soft); padding: 4px 7px; border-radius: 999px; }
.rail-link { width: 100%; border: 0; background: transparent; color: var(--purple); padding: 11px 0 0; text-align: left; font-size: 11px; font-weight: 800; }
.control-card { background: linear-gradient(145deg, #0d1627, #17223a); color: #fff; border-color: #24324d; }
.control-title { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.control-title svg { width: 17px; height: 17px; color: #b99cff; }
.control-card p { margin: 9px 0 0; color: #aaa8bd; font-size: 11px; line-height: 1.5; }

/* shared cards */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.card-header { padding: 16px 18px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-header h3 { margin: 0; font-size: 14px; }
.card-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 16px 18px 18px; }
.hero-brief {
  background: linear-gradient(118deg, #0d1627 0%, #17223a 70%, #713f12 145%);
  color: #fff; border-radius: 22px; padding: 22px; position: relative; overflow: hidden;
  box-shadow: 0 20px 45px rgba(26,20,67,.2);
}
.hero-brief::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(234,179,8,.22), transparent 67%); right: -80px; top: -120px; }
.hero-brief-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; position: relative; z-index: 1; }
.hero-brief-label { display: flex; align-items: center; gap: 9px; font-size: 10px; font-weight: 900; letter-spacing: .1em; color: #fde68a; }
.hero-brief-label span { width: 30px; height: 30px; border-radius: 9px; background: rgba(234,179,8,.20); display: grid; place-items: center; color: #fde047; }
.hero-brief h2 { margin: 14px 0 8px; max-width: 780px; font-size: 22px; line-height: 1.28; letter-spacing: -.025em; position: relative; z-index: 1; }
.hero-brief p { margin: 0; color: #bbb8cb; font-size: 12px; max-width: 760px; line-height: 1.55; position: relative; z-index: 1; }
.hero-actions { display: flex; gap: 8px; margin-top: 16px; position: relative; z-index: 1; }
.hero-actions button { height: 36px; border-radius: 10px; padding: 0 12px; font-size: 11px; font-weight: 800; }
.hero-primary { border: 0; background: #fff; color: #312069; }
.hero-secondary { border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: #fff; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 9px; font-size: 10px; font-weight: 900; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.status-good { color: #0d9161; background: var(--green-soft); }
.status-warn { color: #c46a16; background: var(--orange-soft); }
.status-risk { color: #d63b53; background: var(--red-soft); }
.status-info { color: #315fd8; background: var(--blue-soft); }
.status-purple { color: var(--purple); background: var(--purple-soft); }
.kpi-card { padding: 15px; position: relative; overflow: hidden; }
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.kpi-label { color: var(--muted); font-size: 10.5px; font-weight: 900; letter-spacing: .06em; }
.kpi-icon { width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; }
.kpi-icon svg { width: 15px; height: 15px; }
.kpi-value { margin-top: 12px; font-size: 23px; font-weight: 850; letter-spacing: -.035em; }
.kpi-meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; color: var(--muted); font-size: 10.5px; }
.kpi-trend { font-weight: 800; }
.kpi-bar { height: 3px; background: var(--surface-3); border-radius: 999px; margin-top: 14px; overflow: hidden; }
.kpi-bar span { display: block; height: 100%; border-radius: inherit; }

.chart-card { padding-bottom: 8px; }
.chart-wrap { position: relative; min-height: 250px; padding: 8px 4px 0; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); font-size: 10.5px; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.svg-chart { width: 100%; height: 235px; overflow: visible; }
.chart-grid line { stroke: var(--line); stroke-width: 1; }
.chart-axis-text { fill: var(--muted); font-size: 10px; }
.chart-tooltip { position: absolute; opacity: 0; pointer-events: none; padding: 9px 10px; border-radius: 10px; background: #17162d; color: #fff; font-size: 10px; box-shadow: var(--shadow); transform: translate(-50%, -115%); transition: opacity .15s ease; z-index: 5; min-width: 122px; }
.chart-point { cursor: pointer; }

.alert-list { display: grid; gap: 9px; }
.alert-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.alert-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.alert-icon svg { width: 16px; height: 16px; }
.alert-row strong { display: block; font-size: 12px; }
.alert-row p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.cfo-search-result { width: 100%; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.cfo-search-result:hover { border-color: color-mix(in srgb, var(--purple) 52%, var(--line)); transform: translateY(-1px); }
.alert-action { border: 0; background: transparent; color: var(--purple); font-size: 11px; font-weight: 800; }

/* CFO anomaly investigation: signal -> evidence -> impact -> action */
.anomaly-workbench { overflow: hidden; }
.anomaly-workbench-head { align-items: center; padding-bottom: 16px; }
.anomaly-workbench-head h3 { margin-top: 5px; font-size: 18px; }
.workbench-kicker { color: #a16207; font-size: 9px; font-weight: 900; letter-spacing: .1em; }
body.dark .workbench-kicker { color: #fde047; }
.anomaly-stepper { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; padding: 9px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.anomaly-step { position: relative; min-height: 38px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.anomaly-step:not(:last-child)::after { content: ""; position: absolute; right: 8px; width: calc(100% - 82px); height: 1px; background: var(--line); transform: translateX(100%); }
.anomaly-step > span { position: relative; z-index: 1; width: 25px; height: 25px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-family: "Lexend Giga",sans-serif; font-size: 9px; font-weight: 900; }
.anomaly-step svg { width: 13px; height: 13px; }
.anomaly-step.is-current { color: var(--text); }
.anomaly-step.is-current > span { color: #171208; border-color: var(--purple); background: var(--purple); box-shadow: 0 0 0 5px var(--purple-soft); }
.anomaly-step.is-done { color: var(--green); }
.anomaly-step.is-done > span { color: #fff; border-color: var(--green); background: var(--green); }
.anomaly-workbench-body { display: grid; grid-template-columns: 260px minmax(0,1fr); min-width: 0; }
.anomaly-queue { min-width: 0; padding: 14px; border-right: 1px solid var(--line); background: var(--surface-2); }
.anomaly-queue-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 4px 12px; }
.anomaly-queue-title strong, .anomaly-queue-title small { display: block; }
.anomaly-queue-title strong { font-size: 12px; }
.anomaly-queue-title small { margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.anomaly-queue-title > span { min-width: 25px; height: 25px; display: grid; place-items: center; color: #854d0e; border-radius: 999px; background: var(--purple-soft); font-size: 10px; font-weight: 900; }
.anomaly-queue-item { width: 100%; min-height: 74px; display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 9px; margin-bottom: 7px; padding: 10px; color: var(--text); text-align: left; border: 1px solid transparent; border-radius: 13px; background: transparent; }
.anomaly-queue-item:hover { border-color: var(--line); background: var(--surface); }
.anomaly-queue-item.active { border-color: color-mix(in srgb,var(--purple) 58%,var(--line)); background: var(--surface); box-shadow: 0 8px 20px rgba(28,24,62,.07); }
.anomaly-severity { width: 7px; height: 34px; border-radius: 999px; background: var(--orange); }
.anomaly-severity-high { background: var(--red); }
.anomaly-queue-item strong, .anomaly-queue-item small { display: block; min-width: 0; }
.anomaly-queue-item strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.anomaly-queue-item small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.anomaly-queue-meta { display: grid; justify-items: end; gap: 6px; }
.anomaly-queue-meta b { color: var(--red); font-size: 10px; }
.anomaly-queue-meta em { font-style: normal; }
.anomaly-detail { min-width: 0; padding: 18px; }
.anomaly-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.anomaly-detail-head h3 { margin: 4px 0 5px; font-size: 21px; }
.anomaly-detail-head p { margin: 0; color: var(--muted); font-size: 11px; }
.anomaly-signal-label { color: var(--red); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.anomaly-head-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.confidence-badge { display: inline-flex; padding: 5px 7px; color: #315fd8; border-radius: 999px; background: var(--blue-soft); font-size: 9.5px; font-weight: 800; white-space: nowrap; }
.anomaly-lineage-grid { display: grid; grid-template-columns: 1.15fr .8fr 1.5fr .65fr 1fr; gap: 7px; margin-top: 15px; }
.anomaly-lineage-grid > div { min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.anomaly-lineage-grid span, .anomaly-lineage-grid strong { display: block; }
.anomaly-lineage-grid span { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.anomaly-lineage-grid strong { margin-top: 5px; overflow-wrap: anywhere; font-size: 9.5px; line-height: 1.35; }
.anomaly-hypothesis { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 11px; margin-top: 12px; padding: 13px; color: #713f12; border: 1px solid color-mix(in srgb,var(--purple) 42%,var(--line)); border-radius: 13px; background: linear-gradient(120deg,var(--purple-soft),color-mix(in srgb,var(--surface) 82%,var(--purple-soft))); }
body.dark .anomaly-hypothesis { color: #fef3c7; }
.anomaly-hypothesis > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb,var(--purple) 24%,transparent); }
.anomaly-hypothesis svg { width: 17px; height: 17px; }
.anomaly-hypothesis strong { font-size: 9px; letter-spacing: .08em; }
.anomaly-hypothesis p { margin: 5px 0 0; font-size: 10.5px; line-height: 1.5; }
.anomaly-analysis-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.anomaly-panel { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.anomaly-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.anomaly-panel-title > div { display: flex; align-items: center; gap: 8px; }
.anomaly-panel-title span, .anomaly-decision-copy > span { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; color: #171208; border-radius: 8px; background: var(--purple); font-size: 9px; font-weight: 900; }
.anomaly-panel-title h4 { margin: 0; font-size: 11px; }
.anomaly-panel-title small { color: var(--muted); font-size: 8.5px; }
.evidence-list { display: grid; gap: 8px; }
.evidence-list > div { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.evidence-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.evidence-list strong, .evidence-list small { display: block; }
.evidence-list strong { font-size: 10px; }
.evidence-list small { margin-top: 3px; color: var(--muted); font-size: 8.8px; }
.evidence-list b { color: var(--red); font-size: 9.5px; white-space: nowrap; }
.impact-list { display: grid; gap: 7px; }
.impact-list > div { padding: 8px 9px; border-left: 3px solid var(--orange); border-radius: 8px; background: var(--surface-2); }
.impact-list span, .impact-list strong { display: block; }
.impact-list span { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .06em; }
.impact-list strong { margin-top: 4px; font-size: 9.5px; line-height: 1.35; }
.anomaly-decision { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 14px; margin-top: 12px; padding: 13px; border: 1px solid color-mix(in srgb,var(--green) 35%,var(--line)); border-radius: 13px; background: color-mix(in srgb,var(--green-soft) 58%,var(--surface)); }
.anomaly-decision-copy { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 9px; }
.anomaly-decision-copy > span { color: #fff; background: var(--green); }
.anomaly-decision-copy strong { font-size: 11px; }
.anomaly-decision-copy p { margin: 4px 0; font-size: 10px; line-height: 1.45; }
.anomaly-decision-copy small { color: var(--muted); font-size: 8.7px; line-height: 1.4; }
.anomaly-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.anomaly-actions .secondary-button, .anomaly-actions .primary-button { height: 34px; padding: 0 9px; font-size: 9px; }
.anomaly-audit { margin-top: 10px; border-top: 1px solid var(--line); }
.anomaly-audit summary { padding: 11px 2px 3px; color: var(--muted); cursor: pointer; font-size: 9.5px; font-weight: 800; }
.anomaly-audit > div { display: grid; gap: 7px; margin-top: 8px; }
.anomaly-audit p { display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 8px; margin: 0; padding: 8px; border-radius: 9px; background: var(--surface-2); }
.anomaly-audit p > span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.anomaly-audit p strong { font-family: "Lexend",sans-serif; font-size: 9.5px; font-weight: 700; }
.anomaly-audit p small { color: var(--muted); font-size: 8.5px; white-space: nowrap; }
.confirmation-check { display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 8px; align-items: start; margin-top: 14px; padding: 12px; color: var(--text); border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); font-size: 11px; line-height: 1.45; }
.confirmation-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--green); }

.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.data-table th { text-align: left; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; }
.data-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 11px; vertical-align: middle; }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: var(--purple-soft); }
.data-table .number { text-align: right; font-variant-numeric: tabular-nums; }
.table-status { display: inline-flex; align-items: center; padding: 5px 7px; border-radius: 999px; font-size: 10px; font-weight: 900; white-space: nowrap; }
.table-action { border: 0; background: transparent; color: var(--purple); padding: 0; font-weight: 800; font-size: 11px; }

.segmented { display: inline-flex; background: var(--surface-3); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.segmented button { border: 0; background: transparent; border-radius: 9px; padding: 8px 10px; color: var(--muted); font-size: 11px; font-weight: 800; }
.segmented button.active { background: var(--surface); color: var(--purple); box-shadow: 0 4px 12px rgba(27,24,58,.08); }

.formula-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.formula-card { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.formula-card span { color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .05em; }
.formula-card strong { display: block; margin-top: 6px; font-size: 11.5px; line-height: 1.4; }

.gauge-card { padding: 20px; }
.gauge-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 20px; align-items: center; }
.gauge-score-label { font-size: 11px; color: var(--muted); font-weight: 900; letter-spacing: .06em; }
.gauge-score { font-size: 43px; color: var(--purple); font-weight: 900; letter-spacing: -.05em; margin-top: 8px; }
.gauge-copy { font-size: 11px; color: var(--muted); line-height: 1.55; max-width: 360px; }
.gauge { width: 100%; max-width: 460px; margin: 0 auto; }
.gauge-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: -4px; }

.scenario-toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.scenario-button { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 800; }
.scenario-button.active { color: #171208; background: linear-gradient(90deg, #ca8a04, #eab308); border-color: transparent; box-shadow: 0 8px 18px rgba(234,179,8,.2); }
.scenario-button svg { width: 15px; height: 15px; }
.range-row { display: grid; grid-template-columns: 160px 1fr 70px; align-items: center; gap: 12px; padding: 9px 0; }
.range-row label { font-size: 11px; font-weight: 800; }
.range-row input[type=range] { accent-color: var(--purple); width: 100%; }
.range-value { font-size: 11px; text-align: right; color: var(--purple); font-weight: 900; }
.ai-recommendations { display: grid; gap: 9px; }
.recommendation { display: grid; grid-template-columns: 28px 1fr; gap: 9px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.recommendation-number { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--purple-soft); color: var(--purple); font-size: 10px; font-weight: 900; }
.recommendation strong { display: block; font-size: 11.5px; }
.recommendation small { display: inline-flex; margin-top: 5px; padding: 4px 6px; border-radius: 999px; font-size: 10px; font-weight: 900; }

.brief-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.brief-paper { padding: 22px; position: relative; }
.brief-paper::before { content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 4px; border-radius: 999px; background: linear-gradient(#eab308,#fde047); }
.brief-paper h2 { margin: 0; font-size: 21px; }
.brief-paper .brief-date { color: var(--muted); font-size: 11px; margin-top: 5px; }
.brief-summary { margin: 18px 0; padding: 14px; border-radius: 14px; background: var(--purple-soft); color: #713f12; font-size: 12px; font-weight: 700; line-height: 1.55; }
.brief-section { padding: 13px 0; border-bottom: 1px solid var(--line); }
.brief-section:last-child { border-bottom: 0; }
.brief-section h4 { margin: 0 0 7px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.brief-section p { margin: 0; font-size: 12px; line-height: 1.55; }
.brief-list { display: grid; gap: 8px; }
.brief-list-item { display: grid; grid-template-columns: 8px 1fr; gap: 9px; font-size: 11.5px; line-height: 1.45; }
.brief-list-item span { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; }
.brief-settings { padding: 16px; }
.brief-settings h3 { margin: 0; font-size: 13px; }
.setting-block { padding: 13px 0; border-bottom: 1px solid var(--line); }
.setting-block:last-child { border-bottom: 0; }
.setting-block label { display: block; font-size: 11px; color: var(--muted); font-weight: 900; margin-bottom: 8px; }
.setting-block select, .setting-block input { width: 100%; height: 38px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 10px; padding: 0 10px; font-size: 12px; }
.setting-block textarea { width: 100%; min-height: 104px; resize: vertical; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 10px; padding: 10px; font: inherit; font-size: 12px; line-height: 1.5; }
.setting-block input:focus, .setting-block textarea:focus { outline: 0; border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.empty-state { padding: 24px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); text-align: center; font-size: 11px; }
.full-button { width: 100%; height: 40px; border-radius: 11px; border: 0; background: linear-gradient(90deg,#ca8a04,#eab308); color: #171208; font-size: 11.5px; font-weight: 900; margin-top: 12px; }

.assistant-dock {
  grid-column: 2 / 4;
  grid-row: 3;
  position: relative;
  z-index: 20;
  left: auto;
  right: auto;
  bottom: auto;
  margin: 0;
  min-height: 124px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 32px;
  gap: 11px;
  padding: 11px 18px 12px;
  background: color-mix(in srgb, var(--surface) 97%, var(--purple-soft));
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 36px rgba(20,18,50,.08);
  transition: min-height .25s ease, height .25s ease, background .25s ease;
}
.assistant-dock::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(var(--purple), var(--purple-2)); }
.assistant-dock.minimized { min-height: 58px; height: 58px; overflow: hidden; }
.assistant-dock.minimized .assistant-body { display: flex; align-items: center; }
.assistant-dock.minimized .assistant-topline { width: 100%; margin: 0; }
.assistant-dock.minimized .assistant-messages,
.assistant-dock.minimized .assistant-form,
.assistant-dock.minimized .suggestion-row,
.assistant-dock.minimized #voiceToggle { display: none; }
.assistant-orb { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(145deg, #facc15, #a16207); box-shadow: inset 0 0 0 1px rgba(255,255,255,.28), 0 8px 18px rgba(234,179,8,.22); }
.assistant-orb span { font-size: 9px; font-weight: 900; letter-spacing: .08em; color: #fff; }
.assistant-body { min-width: 0; }
.assistant-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.assistant-topline div { display: flex; gap: 8px; align-items: center; }
.assistant-topline strong { font-size: 11px; }
.assistant-topline span { color: var(--green); font-size: 9px; }
.text-button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 4px 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}
.text-button:hover { border-color: var(--purple-3); background: var(--purple-soft); }
.text-button svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--purple); }
.text-button .voice-label { color: var(--muted); }
.text-button .voice-state { font-weight: 900; }
.text-button.voice-off .voice-state { color: var(--red); }
.text-button.voice-on .voice-state { color: var(--green); }
.text-button.voice-on { border-color: color-mix(in srgb, var(--green) 35%, var(--line)); }
.assistant-messages { max-height: 62px; overflow: auto; margin-bottom: 7px; padding-right: 6px; scrollbar-width: thin; scrollbar-color: var(--purple-3) transparent; }
.assistant-message { font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.assistant-message strong { color: var(--text); }
.assistant-form { display: grid; grid-template-columns: 1fr 38px 38px; gap: 7px; }
.assistant-form input { height: 40px; min-width: 0; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); padding: 0 13px; outline: none; font-size: 11px; }
.assistant-form input:focus { border-color: var(--purple-3); box-shadow: 0 0 0 3px var(--purple-soft); }
.composer-button, .send-button, .dock-minimize { border: 0; border-radius: 11px; display: grid; place-items: center; }
.composer-button { background: var(--surface-3); color: var(--purple); }
.send-button { background: var(--purple); color: #171208; }
.composer-button svg, .send-button svg, .dock-minimize svg { width: 16px; height: 16px; }
.suggestion-row { display: flex; gap: 6px; margin-top: 7px; overflow-x: auto; scrollbar-width: none; }
.suggestion-chip { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 5px 8px; font-size: 8.5px; white-space: nowrap; }
.suggestion-chip:hover { color: var(--purple); border-color: var(--purple-3); }
.dock-minimize { background: transparent; color: var(--muted); align-self: start; width: 30px; height: 30px; }

.platform-signature {
  grid-column: 2 / 4;
  grid-row: 4;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 7px 16px 9px;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.platform-signature a { display: flex; align-items: center; color: inherit; text-decoration: none; }
.signature-positive { gap: 7px; }
.signature-positive span { font-size: 7px; letter-spacing: .02em; white-space: nowrap; }
.signature-positive img { width: 94px; height: auto; object-fit: contain; }
.positive-logo-dark { display: none; }
.platform-signature > i { width: 1px; height: 22px; background: var(--line); }
.signature-cc-logo { width: 108px; height: 30px; object-fit: contain; filter: brightness(.22); transition: filter .2s ease; }
.signature-cc-logo:hover { filter: brightness(.34) drop-shadow(0 0 9px rgba(234,179,8,.25)); }
body.dark .positive-logo-light { display: none; }
body.dark .positive-logo-dark { display: block; }
body.dark .signature-cc-logo { filter: brightness(1.08); }

.sidebar-scrim { display: none; position: fixed; inset: 0; z-index: 65; border: 0; background: rgba(3,7,15,.62); backdrop-filter: blur(3px); }
.mobile-bottom-nav { display: none; }

.cc-native-select { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; }
.cc-select { position: relative; width: 100%; }
.cc-select-trigger {
  width: 100%; min-height: 38px; display: grid; grid-template-columns: minmax(0,1fr) 16px; align-items: center; gap: 8px;
  padding: 0 10px; color: var(--text); text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
}
.cc-select-trigger svg { width: 15px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease; }
.cc-select.is-open .cc-select-trigger { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.cc-select.is-open .cc-select-trigger svg { transform: rotate(180deg); }
.cc-select-value { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.cc-select-menu {
  position: absolute; z-index: 250; top: calc(100% + 6px); left: 0; width: 100%; max-height: 248px; overflow-y: auto;
  padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 20px 48px rgba(15,23,42,.24);
}
.cc-select-menu[hidden] { display: none; }
.cc-select.opens-up .cc-select-menu { top: auto; bottom: calc(100% + 6px); }
.cc-select-option { width: 100%; min-height: 38px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 7px 9px; color: var(--text); text-align: left; border: 0; border-radius: 8px; background: transparent; font-size: 12px; }
.cc-select-option:hover, .cc-select-option.selected { background: var(--purple-soft); }
.cc-select-option b { color: var(--purple); opacity: 0; }
.cc-select-option.selected b { opacity: 1; }

.mobile-shortcut-help { margin: 0 0 14px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.mobile-shortcut-slots { display: grid; gap: 9px; }
.mobile-shortcut-slot { position: relative; }
.mobile-slot-trigger {
  width: 100%; min-height: 50px; display: grid; grid-template-columns: 26px 34px minmax(0,1fr) 18px; align-items: center; gap: 8px;
  padding: 7px 10px; color: var(--text); text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
}
.mobile-slot-trigger[aria-expanded="true"] { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.slot-number { width: 24px; height: 24px; display: grid; place-items: center; color: #171208; border-radius: 8px; background: var(--purple); font-size: 9px; font-weight: 900; }
.slot-icon { width: 32px; height: 32px; display: grid; place-items: center; color: var(--purple); border-radius: 9px; background: var(--purple-soft); }
.slot-icon svg { width: 16px; height: 16px; }
.mobile-slot-trigger strong { min-width: 0; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.slot-chevron { color: var(--muted); }
.mobile-slot-options {
  position: relative; z-index: 5; max-height: 300px; overflow-y: auto; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px;
  margin-top: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow);
}
.mobile-slot-options button { min-width: 0; min-height: 48px; display: grid; grid-template-columns: 30px minmax(0,1fr); align-items: center; gap: 7px; padding: 7px; color: var(--text); text-align: left; border: 1px solid transparent; border-radius: 9px; background: var(--surface-2); }
.mobile-slot-options button:hover, .mobile-slot-options button.selected { border-color: var(--purple); background: var(--purple-soft); }
.mobile-slot-options button > span:first-child { width: 28px; height: 28px; display: grid; place-items: center; color: var(--purple); }
.mobile-slot-options svg { width: 16px; height: 16px; }
.mobile-slot-options strong, .mobile-slot-options small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-slot-options strong { font-size: 11px; }
.mobile-slot-options small { margin-top: 2px; color: var(--muted); font-size: 10px; }

.toast { position: fixed; z-index: 100; right: 24px; top: 92px; min-width: 260px; max-width: 380px; padding: 13px 15px; border-radius: 13px; background: #17162c; color: #fff; box-shadow: var(--shadow); font-size: 11px; opacity: 0; transform: translateY(-8px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.modal-root { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; background: rgba(13,12,31,.48); backdrop-filter: blur(7px); padding: 20px; }
.modal-root.open { display: grid; }
.modal { width: min(720px, 100%); max-height: min(720px, 88vh); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 90px rgba(18,14,50,.28); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 17px; }
.modal-close { border: 0; background: var(--surface-3); color: var(--text); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.modal-body { padding: 20px; }

/* CyberCompany user account standard, CFO pilot */
.visually-hidden { 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; }
.modal-root { z-index: 300; }
.user-settings-modal { width: min(980px,100%); height: min(780px,90vh); max-height: min(780px,90vh); display: flex; flex-direction: column; overflow: hidden; }
.user-settings-modal .modal-header { flex: 0 0 auto; padding: 20px 22px; }
.user-settings-modal .modal-header h2 { font-size: 20px; }
.user-settings-modal .modal-body { flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 0; }
.user-settings-modal #userSettingsCenter { width: 100%; height: 100%; min-height: 0; overflow: hidden; }
.user-settings-shell { height: 100%; min-height: 0; display: grid; grid-template-columns: 245px minmax(0,1fr); }
.user-settings-tabs { min-width: 0; min-height: 0; border-right: 1px solid var(--line); background: var(--surface-2); }
.user-settings-tabs-edge { display: none; }
.user-settings-nav { height: 100%; display: flex; flex-direction: column; gap: 5px; padding: 18px 12px; background: var(--surface-2); }
.user-settings-nav button { min-height: 54px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 7px 10px; color: var(--muted); text-align: left; border: 1px solid transparent; border-radius: 13px; background: transparent; }
.user-settings-nav button:hover { color: var(--text); background: var(--surface); }
.user-settings-nav button.active { color: var(--text); border-color: color-mix(in srgb,var(--purple) 36%,var(--line)); background: var(--surface); box-shadow: inset 3px 0 0 var(--purple); }
.user-settings-nav button > span { width: 36px; height: 36px; display: grid; place-items: center; color: var(--purple); border-radius: 10px; background: var(--purple-soft); }
.user-settings-nav svg { width: 18px; height: 18px; }
.user-settings-nav strong { min-width: 0; font-size: 13px; line-height: 1.25; }
.user-settings-nav em { width: 22px; height: 22px; display: grid; place-items: center; color: #92400e; border-radius: 50%; background: #fef3c7; font-size: 12px; font-style: normal; font-weight: 900; }
.user-settings-content { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.user-settings-panel { width: 100%; height: 100%; min-width: 0; min-height: 0; overflow-y: scroll; padding: 24px 30px 32px 24px; scrollbar-width: auto; scrollbar-color: #eab308 var(--surface-3); scrollbar-gutter: stable; overscroll-behavior: contain; }
.user-settings-panel::-webkit-scrollbar { width: 10px; }
.user-settings-panel::-webkit-scrollbar-track { margin-block: 12px; border-radius: 999px; background: var(--surface-3); }
.user-settings-panel::-webkit-scrollbar-thumb { border: 2px solid var(--surface-3); border-radius: 999px; background: #eab308; }
.user-settings-section { display: grid; gap: 15px; }
.settings-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 3px; }
.settings-section-heading > div { min-width: 0; }
.settings-section-heading span { color: #a16207; font-size: 12px; font-weight: 900; letter-spacing: .1em; }
.settings-section-heading h3 { margin: 5px 0 0; font-size: 24px; }
.settings-section-heading > p { max-width: 330px; margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.settings-card, .profile-photo-card { padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow-soft); }
.settings-card { display: grid; gap: 13px; }
.settings-card-title { display: grid; grid-template-columns: 40px minmax(0,1fr); align-items: center; gap: 11px; }
.settings-card-title > span { width: 40px; height: 40px; display: grid; place-items: center; color: #a16207; border-radius: 12px; background: var(--purple-soft); }
.settings-card-title svg { width: 19px; height: 19px; }
.settings-card h4, .profile-photo-card h4 { margin: 0; font-size: 16px; }
.settings-card-title p, .profile-photo-card p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.profile-photo-card { display: grid; grid-template-columns: 126px minmax(0,1fr); align-items: center; gap: 20px; background: linear-gradient(135deg,var(--surface),color-mix(in srgb,var(--purple-soft) 36%,var(--surface))); }
.profile-photo-preview { position: relative; width: 126px; height: 126px; border-radius: 50%; padding: 5px; background: linear-gradient(135deg,var(--purple),#fde047); box-shadow: 0 14px 30px rgba(161,98,7,.18); }
.profile-photo-preview img { width: 100%; height: 100%; display: block; object-fit: cover; border: 4px solid var(--surface); border-radius: 50%; }
.profile-photo-content { min-width: 0; }
.profile-photo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.settings-primary, .settings-secondary, .settings-quiet { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 13px; border-radius: 11px; font-size: 13px; font-weight: 800; }
.settings-primary { color: #171208; border: 1px solid #ca8a04; background: linear-gradient(135deg,#fde047,#eab308); }
.settings-primary:hover { filter: brightness(1.04); transform: translateY(-1px); }
.settings-primary:disabled { cursor: not-allowed; opacity: .42; filter: grayscale(.35); transform: none; }
.settings-secondary { color: var(--text); border: 1px solid var(--line); background: var(--surface-2); }
.settings-secondary:hover { border-color: var(--purple); background: var(--purple-soft); }
.settings-quiet { color: var(--muted); border: 0; background: transparent; }
.settings-quiet:hover { color: var(--red); background: var(--red-soft); }
.settings-primary svg, .settings-secondary svg { width: 17px; height: 17px; }
.camera-capture-action { display: none; }
.profile-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.profile-fields label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.profile-fields input { width: 100%; min-height: 44px; padding: 0 12px; color: var(--text); border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); font-size: 14px; }
.profile-fields input[readonly] { cursor: default; }
.access-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.access-grid div { min-height: 68px; display: grid; align-content: center; gap: 5px; padding: 11px 13px; border-radius: 12px; background: var(--surface-2); }
.access-grid span { color: var(--muted); font-size: 12px; }
.access-grid strong { font-size: 14px; }
.settings-segmented { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.settings-segmented button { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-size: 13px; font-weight: 800; }
.settings-segmented button:hover { color: var(--text); border-color: var(--purple); }
.settings-segmented button.active { color: #713f12; border-color: #eab308; background: #fef9c3; box-shadow: inset 0 0 0 1px rgba(234,179,8,.18); }
body.dark .settings-segmented button.active { color: #fde68a; background: #3f3214; }
.settings-segmented svg { width: 18px; height: 18px; }
.settings-toggle-row, .settings-action-row { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.settings-card-title + .settings-toggle-row, .settings-card-title + .settings-action-row { border-top: 0; }
.settings-toggle-row > span, .settings-action-row > span { min-width: 0; display: grid; gap: 4px; }
.settings-toggle-row strong, .settings-action-row strong { font-size: 14px; }
.settings-toggle-row small, .settings-action-row small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.settings-toggle-row { position: relative; cursor: pointer; }
.settings-toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.settings-toggle-row i { position: relative; width: 48px; height: 28px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-3); transition: .2s ease; }
.settings-toggle-row i::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: var(--muted); transition: .2s ease; }
.settings-toggle-row input:checked + i { border-color: #ca8a04; background: #fef3c7; }
.settings-toggle-row input:checked + i::after { left: 23px; background: #ca8a04; }
.settings-toggle-row input:focus-visible + i { outline: 3px solid color-mix(in srgb,var(--purple) 24%,transparent); outline-offset: 2px; }
.settings-toggle-row input:disabled + i { opacity: .58; }
.settings-save { justify-self: end; min-width: 190px; }
.security-status { min-height: 92px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 16px; border: 1px solid; border-radius: 17px; }
.security-status > span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; }
.security-status svg { width: 23px; height: 23px; }
.security-status strong { font-size: 16px; }
.security-status p { margin: 5px 0 0; font-size: 13px; line-height: 1.4; }
.security-status button { min-height: 40px; padding: 8px 12px; border-radius: 10px; font-size: 12px; font-weight: 850; }
.security-status.attention { color: #92400e; border-color: #fcd34d; background: #fffbeb; }
.security-status.attention > span { background: #fef3c7; }
.security-status.attention button { color: #fff; border: 1px solid #b45309; background: #b45309; }
.security-status.secure { color: #065f46; border-color: #6ee7b7; background: #ecfdf5; }
.security-status.secure > span { background: #d1fae5; }
.security-status.secure button { color: #065f46; border: 1px solid #6ee7b7; background: #fff; }
body.dark .security-status.attention { color: #fde68a; border-color: #713f12; background: #2b2110; }
body.dark .security-status.secure { color: #a7f3d0; border-color: #065f46; background: #102b24; }
.security-method, .session-row, .recent-login { min-height: 62px; display: grid; align-items: center; gap: 11px; padding: 10px 0; border-top: 1px solid var(--line); }
.settings-card-title + .security-method, .settings-card-title + .session-row, .settings-card-title + .recent-login { border-top: 0; }
.security-method { grid-template-columns: 42px minmax(0,1fr) auto; }
.provider-mark { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; border-radius: 11px; background: linear-gradient(135deg,#2563eb,#7c3aed); font-size: 15px; font-weight: 900; }
.security-method div, .session-row div, .recent-login div { min-width: 0; display: grid; gap: 4px; }
.security-method strong, .session-row strong, .recent-login strong { font-size: 14px; }
.security-method small, .session-row small, .recent-login small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.security-method em { padding: 5px 8px; color: #047857; border-radius: 999px; background: var(--green-soft); font-size: 11px; font-style: normal; font-weight: 800; }
.security-note { min-height: 45px; display: flex; align-items: center; gap: 9px; padding: 10px 12px; color: var(--muted); border-radius: 11px; background: var(--surface-2); font-size: 12px; }
.security-note svg { width: 17px; height: 17px; }
.session-row { grid-template-columns: 38px minmax(0,1fr) auto; }
.session-row > span { width: 36px; height: 36px; display: grid; place-items: center; color: var(--purple); border-radius: 10px; background: var(--purple-soft); }
.session-row svg { width: 18px; height: 18px; }
.session-row button { min-height: 36px; padding: 7px 10px; color: var(--red); border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); font-size: 12px; font-weight: 800; }
.session-current { padding: 5px 8px; color: #047857; border-radius: 999px; background: var(--green-soft); font-size: 11px; font-style: normal; font-weight: 800; }
.session-all { justify-self: end; margin-top: 3px; }
.settings-empty { padding: 16px; color: var(--muted); border-radius: 12px; background: var(--surface-2); font-size: 13px; text-align: center; }
.recent-login { grid-template-columns: 12px minmax(0,1fr); }
.recent-login > span { width: 10px; height: 10px; border: 2px solid var(--surface); border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

/* dark theme */
body.dark {
  --page: #0e0e1a;
  --surface: #171724;
  --surface-2: #12121f;
  --surface-3: #202033;
  --text: #f5f4fb;
  --muted: #aaa8bd;
  --line: #2e2e43;
  --purple-soft: #3f3214;
  --green-soft: #18372d;
  --orange-soft: #3b2a1b;
  --red-soft: #402029;
  --blue-soft: #1c2948;
  --shadow: 0 14px 40px rgba(0,0,0,.28);
  --shadow-soft: 0 8px 24px rgba(0,0,0,.2);
}
body.dark .right-rail { background: #10101c; }
body.dark .hero-primary { background: #fff; color: #713f12; }
body.dark .brief-summary { color: #fde68a; }
body.dark .chart-axis-text { fill: #85839a; }
body.dark .assistant-dock { background: color-mix(in srgb, var(--surface) 96%, #3f3214); }

@media (max-width: 1250px) {
  :root { --sidebar-w: 236px; --rail-w: 278px; }
  .brand-logo { width: 144px; }
  .user-mini > span { display: none; }
  .voice-mode-copy { display: none; }
  .grid-5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 1100px) and (min-width: 1001px) {
  .refresh-chip { display: none; }
}

@media (max-width: 1000px) {
  body { overflow: auto; }
  .app-shell {
    display: block;
    height: auto;
    min-height: var(--cc-visible-height, 100dvh);
    overflow: visible;
  }
  .topbar { position: sticky; top: 0; grid-template-columns: minmax(0, 1fr) auto; padding: 0 10px; }
  .topbar-actions { grid-column: 2; }
  .icon-button.mobile-menu-button { display: grid; grid-column: 1; grid-row: 1; justify-self: start; width: 44px; height: 44px; }
  .brand-button { width: auto; padding: 0 14px; }
  .brand-stack small, .topbar-center { display: none; }
  .user-mini { display: flex; margin-left: 0; padding: 2px 3px; border-left: 0; }
  .user-mini img { width: 38px; height: 38px; }
  .sidebar { position: fixed; left: 0; top: var(--topbar-h); bottom: 0; width: 270px; z-index: 70; transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-scrim.open { display: block; }
  .workspace { padding: 18px 14px calc(110px + env(safe-area-inset-bottom)); overflow-x: clip; overflow-y: visible; }
  .right-rail { display: none; }
  .assistant-dock { margin: 0; border-radius: 0; }
  .platform-signature { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .brief-layout, .gauge-layout { grid-template-columns: 1fr; }
  .grid-3, .grid-5 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .mobile-bottom-nav {
    position: fixed; z-index: 90; left: 12px; right: 12px; bottom: calc(18px + env(safe-area-inset-bottom));
    min-height: 66px; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); padding: 6px;
    border: 1px solid color-mix(in srgb,var(--line) 84%,transparent); border-radius: 20px;
    background: color-mix(in srgb,var(--surface) 92%,transparent); box-shadow: 0 18px 45px rgba(3,7,15,.32); backdrop-filter: blur(18px);
  }
  .mobile-nav-item {
    position: relative; min-width: 0; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 6px 3px; color: var(--muted); border: 0; border-radius: 14px; background: transparent;
  }
  .mobile-nav-item > span { display: grid; place-items: center; }
  .mobile-nav-item svg { width: 20px; height: 20px; }
  .mobile-nav-item small { display: block; max-width: 100%; overflow: hidden; color: inherit; font-size: 8px; font-weight: 700; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-nav-item.active { color: #a16207; background: var(--purple-soft); }
  body.dark .mobile-nav-item.active { color: #fde047; }
  .mobile-nav-home::after, .mobile-nav-chat::before { content: ""; position: absolute; top: 9px; bottom: 9px; width: 1px; background: var(--line); }
  .mobile-nav-home::after { right: -1px; }
  .mobile-nav-chat::before { left: -1px; }
}

@media (max-width: 650px) {
  :root { --topbar-h: 64px; }
  .brand-logo { width: 130px; height: 48px; }
  .page-head { display: grid; }
  .page-actions { flex-wrap: wrap; }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .formula-grid { grid-template-columns: 1fr; }
  .assistant-dock { grid-template-columns: 42px 1fr 26px; padding: 9px; }
  .assistant-orb { width: 40px; height: 40px; border-radius: 14px; }
  .suggestion-row { display: none; }
  .assistant-form { grid-template-columns: 1fr 36px; }
  .composer-button { display: none; }
  .page-head h1 { font-size: 23px; }
  .icon-button { width: 36px; height: 36px; }
  #globalSearchBtn, #voiceModeTop, #notificationsBtn { display: none; }
  .mobile-menu-button { width: 44px; height: 44px; }
  .mobile-menu-button svg { width: 27px; height: 27px; }
  .language-toggle { width: 54px; min-width: 54px; height: 38px; padding: 0 6px; gap: 3px; }
  .theme-toggle { width: 36px; }
  .user-mini img { width: 36px; height: 36px; }
  .topbar-actions { gap: 5px; }
  .workspace { padding-inline: 11px; }
  .page-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; }
  .page-actions .primary-button { grid-column: 1 / -1; justify-content: center; }
  .select-button, .secondary-button, .primary-button { min-width: 0; justify-content: center; overflow: hidden; }
  .select-button span { overflow: hidden; text-overflow: ellipsis; }
  .mobile-slot-options { grid-template-columns: 1fr; }
  .modal-root { align-items: start; overflow-y: auto; padding: 8px; }
  .modal { max-height: calc(var(--cc-visible-height,100dvh) - 16px); }
  .profile-menu { position: fixed; top: 62px; right: 8px; width: min(360px,calc(100vw - 16px)); max-height: calc(100dvh - 76px); overflow-y: auto; }
  .profile-menu button { min-height: 52px; font-size: 14px; }
  .profile-menu button em { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-settings-modal { width: 100%; height: calc(var(--cc-visible-height,100dvh) - 16px); max-height: none; border-radius: 18px; }
  .user-settings-modal .modal-header { min-height: 64px; padding: 14px 16px; }
  .user-settings-modal .modal-header h2 { font-size: 18px; }
  .user-settings-shell { height: 100%; min-height: 0; display: flex; flex-direction: column; }
  .user-settings-tabs { position: relative; z-index: 4; flex: 0 0 auto; width: 100%; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); background: var(--surface); box-shadow: 0 8px 20px rgba(28,24,62,.08); }
  .user-settings-nav { height: auto; flex-direction: row; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 9px 34px 10px 10px; background: var(--surface); scrollbar-width: none; scroll-snap-type: x proximity; overscroll-behavior-inline: contain; touch-action: pan-x; -webkit-overflow-scrolling: touch; }
  .user-settings-nav::-webkit-scrollbar { display: none; }
  .user-settings-nav button { flex: 0 0 164px; min-width: 164px; min-height: 52px; grid-template-columns: 34px minmax(0,1fr) auto; padding: 6px 9px; border-color: var(--line); border-radius: 14px 14px 7px 7px; background: var(--surface-2); box-shadow: 0 3px 12px rgba(28,24,62,.06); scroll-snap-align: center; }
  .user-settings-nav button.active { border-color: var(--purple); background: var(--purple-soft); box-shadow: inset 0 -3px 0 var(--purple),0 4px 14px rgba(161,98,7,.12); }
  .user-settings-nav button > span { width: 32px; height: 32px; }
  .user-settings-nav strong { font-size: 12px; }
  .user-settings-tabs-edge { position: absolute; z-index: 5; top: 0; right: 0; bottom: 0; width: 34px; display: grid; place-items: center; color: #a16207; background: linear-gradient(90deg,transparent,var(--surface) 58%); pointer-events: none; font-size: 25px; font-weight: 900; }
  body.dark .user-settings-nav button.active { color: #fff; background: color-mix(in srgb,var(--purple) 22%,var(--surface)); }
  body.dark .user-settings-tabs-edge { color: #fde047; }
  .user-settings-content { flex: 1 1 auto; min-height: 0; }
  .user-settings-panel { height: 100%; max-height: none; padding: 16px 20px 28px 12px; }
  .settings-section-heading { display: grid; gap: 7px; }
  .settings-section-heading h3 { font-size: 22px; }
  .settings-section-heading > p { max-width: none; font-size: 13px; }
  .profile-photo-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .profile-photo-preview { width: 138px; height: 138px; }
  .profile-photo-actions { justify-content: center; }
  .camera-capture-action { display: inline-flex; }
  .profile-fields, .access-grid { grid-template-columns: 1fr; }
  .settings-action-row { align-items: stretch; flex-direction: column; }
  .settings-action-row button { width: 100%; }
  .security-status { grid-template-columns: 44px minmax(0,1fr); }
  .security-status button { grid-column: 1 / -1; width: 100%; }
  .settings-save, .session-all { width: 100%; justify-self: stretch; }
  input, textarea { font-size: 16px !important; }
}

@media (max-width: 420px) {
  #themeToggle { display: none; }
  .language-menu { right: -54px; }
  .profile-menu { position: fixed; top: 58px; right: 7px; }
  .assistant-dock { grid-template-columns: 38px minmax(0,1fr) 24px; padding: 8px 7px; gap: 7px; }
  .assistant-orb { width: 36px; height: 36px; }
}

@media (max-width: 760px) {
  html.mobile-keyboard-open,
  html.mobile-keyboard-open body { width: 100%; height: var(--cc-visible-height); min-height: var(--cc-visible-height); overflow-x: hidden; }
  html.mobile-keyboard-open .app-shell { min-height: var(--cc-visible-height); }
  html.mobile-keyboard-open .mobile-bottom-nav { display: none; }
  html.mobile-keyboard-open .workspace { padding-bottom: 18px; }
  html.mobile-keyboard-open .platform-signature { padding-bottom: 10px; }
  html.mobile-keyboard-open .modal-root { inset: 0 auto auto 0; width: 100%; height: var(--cc-visible-height); }
  html.mobile-keyboard-open .modal { max-height: calc(var(--cc-visible-height) - 16px); }
}

/* Stable card density inside the real workspace width. */
.workspace { container-type: inline-size; }
@container (max-width: 900px) {
  .page-head { display: grid; grid-template-columns: minmax(0,1fr); }
  .page-actions { width: 100%; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .select-button, .secondary-button, .primary-button { min-width: 0; justify-content: center; overflow: hidden; }
  .select-button span, .secondary-button span, .primary-button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .grid-5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .anomaly-workbench-body { grid-template-columns: 1fr; }
  .anomaly-queue { display: grid; grid-template-columns: repeat(4,minmax(190px,1fr)); gap: 7px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .anomaly-queue-title { grid-column: 1 / -1; position: sticky; left: 0; }
  .anomaly-queue-item { margin-bottom: 0; }
  .anomaly-decision { grid-template-columns: 1fr; }
  .anomaly-actions { justify-content: flex-start; }
}
@container (max-width: 700px) {
  .brief-layout, .gauge-layout, .formula-grid { grid-template-columns: 1fr; }
  .range-row { grid-template-columns: minmax(0,1fr) 70px; }
  .range-row > :first-child { grid-column: 1 / -1; }
  .anomaly-analysis-grid { grid-template-columns: 1fr; }
  .anomaly-lineage-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .anomaly-lineage-grid > div:nth-child(3) { grid-column: 1 / -1; }
  .anomaly-detail-head { display: grid; }
  .anomaly-head-badges { justify-content: flex-start; }
}
@container (max-width: 560px) {
  .page-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .page-actions .primary-button { grid-column: 1 / -1; }
  .grid-3,.grid-4,.grid-5 { grid-template-columns: 1fr; }
  .anomaly-stepper { padding-inline: 12px; }
  .anomaly-step { justify-content: center; }
  .anomaly-step strong { display: none; }
  .anomaly-step:not(:last-child)::after { right: -50%; width: 100%; transform: none; }
  .anomaly-detail { padding: 13px; }
  .anomaly-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .anomaly-actions .primary-button { grid-column: 1 / -1; }
  .anomaly-audit p { grid-template-columns: 8px minmax(0,1fr); }
  .anomaly-audit p small { grid-column: 2; }
}

:root {
  --cc-card-hover-surface: #111827;
  --cc-card-hover-ink: #f8fafc;
  --cc-card-hover-muted: #cbd5e1;
  --cc-card-hover-border: color-mix(in srgb, var(--purple) 72%, #475569);
}
body.dark {
  --cc-card-hover-surface: #f8fafc;
  --cc-card-hover-ink: #111827;
  --cc-card-hover-muted: #667085;
  --cc-card-hover-border: color-mix(in srgb, var(--purple) 60%, #cbd5e1);
}
.kpi-card,.recommendation,.formula-card,.admin-correction-card,.alert-row {
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
@media (hover:hover) and (pointer:fine) {
  :is(.kpi-card,.recommendation,.formula-card,.admin-correction-card,.alert-row):hover {
    color: var(--cc-card-hover-ink);
    background: var(--cc-card-hover-surface);
    border-color: var(--cc-card-hover-border);
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(15,23,42,.18);
  }
  :is(.kpi-card,.recommendation,.formula-card,.admin-correction-card,.alert-row):hover :is(.kpi-label,.kpi-meta,.recommendation small,.formula-card span,.alert-row p) { color: var(--cc-card-hover-muted); }
}
:is(.kpi-card,.recommendation,.formula-card,.admin-correction-card,.alert-row):focus-visible {
  color: var(--cc-card-hover-ink);
  background: var(--cc-card-hover-surface);
  border-color: var(--cc-card-hover-border);
}

/* Overflow guards shared by desktop and mobile layouts. */
:is(.topbar,.topbar-actions,.page-head,.page-actions,.card,.card-header,.card-body,.rail-card,.alert-row,.priority-item,.source-item) { min-width: 0; }
:is(.page-head,.card,.rail-card,.alert-row,.priority-item,.source-item,.assistant-message) :is(h1,h2,h3,h4,p,strong,small,span) { overflow-wrap: anywhere; }
.topbar-actions > * { flex: 0 0 auto; }
.nav-item-copy strong,
.nav-item-copy small,
.user-mini strong,
.user-mini small { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* CEO shell standard, adapted to the CFO accent. */
.topbar-center { grid-column:1; grid-row:1; min-width:0; display:grid; align-content:center; justify-items:start; gap:4px; }
.shell-greeting h1 { margin:0; color:#fff; font-size:22px; line-height:1.15; letter-spacing:-.02em; }
.shell-greeting p { margin:0; color:#aeb8c9; font-size:13px; line-height:1.25; }
.voice-mode-toggle { width:40px; min-width:40px; height:40px; display:grid; place-items:center; padding:0; border:1px solid rgba(23,166,115,.46); border-radius:12px; background:rgba(23,166,115,.09); color:#4ade80; }
.voice-mode-toggle:not(.active) { color:#fb7185; border-color:rgba(239,75,100,.48); background:rgba(239,75,100,.09); }
.voice-mode-icon { width:100%; height:100%; display:grid; place-items:center; color:inherit; background:transparent; }
.voice-mode-icon svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.notification-count { position:absolute; top:-6px; right:-6px; min-width:18px; height:18px; display:grid; place-items:center; padding:0 5px; color:#fff; border:2px solid #0b1426; border-radius:999px; background:#ef4444; font:800 9px/1 "Lexend",sans-serif; }
.nav-label { display:flex; min-width:0; align-items:center; gap:10px; padding:16px 10px 7px; color:#77768d; font-size:11px; font-weight:700; line-height:1.2; letter-spacing:.13em; }
.nav-label::after { content:""; flex:1 1 auto; min-width:16px; height:1px; background:linear-gradient(90deg,rgba(141,154,177,.34),rgba(141,154,177,.04)); }
.sidebar .nav-group + .nav-group { margin-top:3px; padding-top:2px; border-top:0; }
.nav-item { min-height:44px; grid-template-columns:27px minmax(0,1fr) auto; gap:12px; padding:8px 10px; border-radius:12px; color:#b7b6c9; font-size:14px; font-weight:500; }
.nav-item:hover { color:#fff; background:rgba(234,179,8,.11); transform:none; }
.nav-item.active { color:#fff; background:linear-gradient(135deg,#854d0e,#eab308); box-shadow:0 8px 24px rgba(161,98,7,.28); }
.sidebar .nav-item>.nav-item-icon,
.sidebar .nav-item>.nav-item-icon.cc-icon-shell { --cc-icon-size:27px; width:27px !important; min-width:27px !important; height:27px !important; overflow:visible; color:#a7a6ba; border:0 !important; border-radius:8px; background:rgba(255,255,255,.035) !important; box-shadow:none !important; }
.sidebar .nav-item:hover>.nav-item-icon { color:#fde68a; background:rgba(234,179,8,.17) !important; box-shadow:0 0 15px rgba(234,179,8,.13) !important; }
.sidebar .nav-item.active>.nav-item-icon { color:#fff; background:rgba(255,255,255,.12) !important; box-shadow:inset 0 1px rgba(255,255,255,.10),0 0 16px rgba(253,224,71,.16) !important; }
.sidebar .nav-item>.nav-item-icon::before { display:none; }
.sidebar .nav-item>.nav-item-icon .nav-svg,
.sidebar .nav-item>.nav-item-icon .cc-power-icon { width:18px !important; height:18px !important; padding:0; stroke-width:1.7 !important; filter:none; }
.nav-item-copy strong { font-size:14px; font-weight:600; line-height:1.2; }
.nav-item-home { min-height:46px; }
.nav-home { margin-bottom:4px; padding-bottom:7px; }

.assistant-launch { position:fixed; z-index:95; right:22px; bottom:22px; width:66px; height:66px; display:grid; place-items:center; overflow:hidden; padding:0; border:1px solid rgba(253,224,71,.52); border-radius:22px; background:radial-gradient(circle at 50% 42%,rgba(250,204,21,.30),rgba(161,98,7,.92)); box-shadow:0 18px 42px rgba(2,6,23,.38),0 0 28px rgba(234,179,8,.25); transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease; }
.assistant-launch:hover,.assistant-launch:focus-visible { transform:translateY(-3px); border-color:#fef3c7; box-shadow:0 22px 48px rgba(2,6,23,.45),0 0 38px rgba(234,179,8,.36); }
.assistant-launch img { width:56px; max-width:100%; height:56px; object-fit:contain; transform:scale(1.1); filter:drop-shadow(0 8px 12px rgba(0,0,0,.34)); }
.assistant-launch>span { position:absolute; right:8px; bottom:8px; width:11px; height:11px; border:2px solid #3b2b07; border-radius:50%; background:var(--green); box-shadow:0 0 12px rgba(23,166,115,.72); }
.assistant-dock { position:fixed; z-index:95; right:22px; bottom:100px; width:min(390px,calc(100vw - 28px)); max-height:min(610px,calc(100dvh - 130px)); min-height:0; display:block; overflow:hidden; margin:0; padding:0; color:#18172a; border:1px solid color-mix(in srgb,var(--purple) 46%,var(--line)); border-radius:20px; background:rgba(255,255,255,.985); box-shadow:0 28px 70px rgba(2,6,23,.48); backdrop-filter:blur(16px); }
body:not(.dark) .assistant-dock { color:#18172a; background:#fff; border-color:#d6c76a; }
body.dark .assistant-dock { color:#f5f4fb; background:#171724; border-color:#766b37; }
.assistant-dock[hidden] { display:none; }
.assistant-dock::before { content:none; }
.assistant-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 15px; color:#fff; border-bottom:1px solid rgba(253,224,71,.38); background:linear-gradient(135deg,#713f12,#182235); }
.assistant-identity { min-width:0; display:flex; align-items:center; gap:10px; }
.assistant-orb { flex:0 0 auto; width:44px; height:44px; overflow:hidden; border:1px solid rgba(253,224,71,.30); border-radius:13px; display:grid; place-items:center; background:rgba(202,138,4,.18); box-shadow:none; }
.assistant-orb img { width:40px; max-width:100%; height:40px; object-fit:contain; transform:scale(1.08); }
.assistant-identity>div { min-width:0; display:grid; gap:4px; }
.assistant-identity strong { color:#fff; font-size:12px; }
.assistant-identity small { overflow:hidden; color:#fef3c7; font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.assistant-close { flex:0 0 auto; width:34px; height:34px; display:grid; place-items:center; padding:0; color:#fef3c7; border:1px solid rgba(255,255,255,.24); border-radius:10px; background:rgba(255,255,255,.06); font-size:20px; line-height:1; }
.assistant-close:hover { color:#fff; border-color:#fde68a; background:rgba(255,255,255,.13); }
.assistant-body { min-width:0; max-height:calc(min(610px,100dvh - 130px) - 72px); display:grid; gap:12px; overflow:auto; padding:15px; }
.assistant-intro { margin:0; color:var(--muted); font-size:12px; line-height:1.55; }
.suggestion-row { display:grid; gap:7px; margin:0; overflow:visible; }
.suggestion-chip { min-height:42px; padding:9px 11px; color:var(--text); text-align:left; white-space:normal; border:1px solid var(--line); border-radius:11px; background:var(--surface-2); font-size:11px; }
.suggestion-chip:hover { color:var(--text); border-color:var(--purple); background:var(--purple-soft); transform:translateX(2px); }
.assistant-messages { max-height:150px; min-height:62px; overflow:auto; margin:0; padding:11px 12px; color:#18172a; border:1px solid #ddd8b8; border-left:3px solid var(--purple); border-radius:10px; background:#fffdf3; font-size:11px; line-height:1.55; scrollbar-width:thin; scrollbar-color:var(--purple-3) transparent; }
body.dark .assistant-messages { color:#f5f4fb; border-color:#4f492e; border-left-color:var(--purple); background:#202033; }
.assistant-message { color:var(--text); font-size:11px; line-height:1.55; }
.assistant-message+.assistant-message { margin-top:8px; padding-top:8px; border-top:1px solid var(--line); }
.assistant-form { min-width:0; display:grid; grid-template-columns:minmax(0,1fr) 40px; gap:8px; }
.assistant-form input { min-width:0; width:100%; height:42px; padding:0 12px; outline:0; color:var(--text); border:1px solid var(--line); border-radius:11px; background:var(--surface-2); font-size:12px; }
.assistant-form input:focus { border-color:var(--purple); box-shadow:0 0 0 3px var(--purple-soft); }
.composer-button,.send-button { width:40px; height:42px; display:grid; place-items:center; border:0; border-radius:11px; }
.assistant-support { min-height:42px; display:flex; align-items:center; justify-content:center; gap:8px; padding:8px 12px; color:#854d0e; border:1px solid #b79a23; border-radius:11px; background:transparent; font-size:11px; font-weight:700; }
body.dark .assistant-support { color:#fde047; }
.assistant-support:hover { color:#171208; border-color:var(--purple); background:var(--purple); }
.assistant-support svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.mobile-chat-avatar { width:31px !important; height:31px !important; overflow:hidden; border:1px solid color-mix(in srgb,var(--purple) 42%,var(--line)); border-radius:9px; background:var(--purple-soft); }
.mobile-chat-avatar img { width:29px; max-width:100%; height:29px; object-fit:contain; transform:scale(1.06); }
.toast.success { color:#dcfce7; background:#0d2d20; border-color:rgba(59,214,128,.52); }
.toast.danger { color:#ffe4e6; background:#35131a; border-color:rgba(255,100,111,.56); }

@media (max-width:760px) {
  .shell-greeting { display:none !important; }
  .assistant-launch { display:none; }
  .assistant-dock { left:10px; right:10px; bottom:calc(88px + env(safe-area-inset-bottom)); width:auto; max-height:calc(var(--cc-visible-height,100dvh) - 108px); border-radius:18px; }
  .assistant-body { max-height:calc(var(--cc-visible-height,100dvh) - 180px); }
  .suggestion-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .assistant-form { grid-template-columns:minmax(0,1fr) 40px; }
  .composer-button { display:none; }
}

/* Match the application theme throughout the CFO top bar. */
body:not(.dark) .topbar { background:var(--surface); color:var(--text); border-bottom-color:var(--line); box-shadow:0 7px 24px rgba(28,24,62,.06); }
body:not(.dark) .topbar .shell-greeting h1,body:not(.dark) .topbar .user-mini { color:var(--text); }
body:not(.dark) .topbar .shell-greeting p,body:not(.dark) .topbar .user-mini small { color:var(--muted); }
body:not(.dark) .topbar :is(.icon-button,.language-toggle) { background:var(--surface-2); color:var(--text); border-color:var(--line); }
body:not(.dark) .topbar .language-toggle strong { color:var(--text); }
body:not(.dark) .topbar .language-toggle svg { stroke:var(--muted); }
body:not(.dark) .topbar .user-mini { border-left-color:var(--line); }
body:not(.dark) .topbar .user-mini:hover { background:var(--surface-3); }
body:not(.dark) .topbar .voice-mode-toggle { color:var(--text); }
body:not(.dark) .topbar .voice-mode-icon { color:#087d51; }
body:not(.dark) .topbar .voice-mode-toggle:not(.active) .voice-mode-icon { color:#c62c43; }
