:root {
  --brand-ai-top: #4AA3E6;
  --brand-ai-mid: #1F7FD4;
  --brand-ai-deep: #1A4F9C;
  --brand-globe: #2BB0E0;
  --accent: #1A74C7;
  --accent-hover: #155FA3;
  --accent-press: #124E86;
  --accent-soft: #E7F2FB;
  --ai: #0E9BB8;
  --ai-hover: #0B829B;
  --ai-soft: #E6F7FB;
  --ink: #152033;
  --ink-2: #3C4A5C;
  --muted: #667085;
  --line: #E4E8EF;
  --line-strong: #CDD5E0;
  --bg: #F2F4F8;
  --surface: #FFFFFF;
  --surface-alt: #F7F9FC;
  --ok: #0F7A3F;
  --ok-soft: #E5F6EC;
  --warn: #B54708;
  --warn-soft: #FEF4E6;
  --danger: #C42B1C;
  --danger-hover: #A32418;
  --danger-soft: #FDECEA;
  --info-soft: #E7F2FB;
  --neutral-soft: #EEF1F5;
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(21, 32, 51, 0.06);
  --shadow-2: 0 4px 14px rgba(21, 32, 51, 0.08);
  --shadow-3: 0 12px 32px rgba(21, 32, 51, 0.12);
  --focus: 0 0 0 2px #fff, 0 0 0 4px var(--accent);
  --rail: 232px;
  --dock-h: 64px;
  --topbar-h: 56px;
  --blue: var(--accent);
  --blue-dark: var(--accent-hover);
  --navy: var(--ink);
  --panel: var(--surface);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
}
a { color: var(--accent); }
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.rail .nav a.active:focus-visible { box-shadow: inset 3px 0 0 var(--accent), var(--focus); }

body:has(#chrome:not([hidden])) {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100dvh;
}
#chrome:not([hidden]) { display: contents; }
.rail {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 14px 16px;
  z-index: 6;
}
.rail .brand { padding: 0 8px 20px; }
.rail .brand img { height: 36px; }
.rail .nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.rail-foot { padding-top: 12px; border-top: 1px solid var(--line); }
.signed-in {
  margin: 0 0 8px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-foot .link { width: 100%; }
.rail-foot .link:hover { background: var(--accent-soft); color: var(--accent); }
.topbar, .dock, .more-sheet { display: none; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { height: 36px; display: block; }
.nav a, .nav button.link, .rail-foot .link, .dock a, .more-sheet button, .more-sheet a {
  color: var(--ink-2);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav a[data-nav="setup"][hidden],
.more-sheet a[data-nav="setup"][hidden] {
  display: none !important;
}
.nav a.active, .nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.rail .nav a.active { box-shadow: inset 3px 0 0 var(--accent); }

.page {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 28px 56px;
  min-width: 0;
}
body:has(#chrome:not([hidden])) .page { grid-column: 2; }

.hero, .panel, .card, .form-card, .stat, .login, .cockpit {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.page-head h1, .page-head h2, .setup-head h2, .workspace-head h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
}
.page-head .meta, .setup-head p, .workspace-head .meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  padding: 16px 18px;
  border-top: 3px solid var(--accent);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
  width: 100%;
}
.stat.warn { border-top-color: var(--warn); }
.stat.ai { border-top-color: var(--ai); }
.stat.ok { border-top-color: var(--ok); }
.stat:hover { box-shadow: var(--shadow-2); }
.stat .k { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.stat .n { display: block; font-size: 28px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }

.cockpit {
  padding: 14px 16px 8px;
  margin-bottom: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.cockpit.live {
  border-top: 3px solid var(--ai);
  background: linear-gradient(180deg, var(--ai-soft) 0%, var(--surface) 48%);
  box-shadow: var(--shadow-2);
}
.cockpit.problem {
  border-top: 3px solid var(--warn);
  background: linear-gradient(180deg, var(--warn-soft) 0%, var(--surface) 48%);
  box-shadow: var(--shadow-2);
}
.cockpit .eyebrow {
  margin: 0 4px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.cockpit .now-next { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.ops-list { display: flex; flex-direction: column; }
.ops-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 12px 4px 14px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.ops-row:last-child { border-bottom: none; }
.ops-row:hover { background: var(--accent-soft); }
.ops-row.live { cursor: default; align-items: center; }
.ops-row.live:hover { background: none; }
.ops-body { flex: 1; min-width: 0; }
.ops-body strong { display: block; }
.ops-body .sub { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.ops-row.live .page-actions { flex-shrink: 0; margin: 0; }
.event-card strong .chip { margin-left: 8px; vertical-align: middle; }
.hero { display: flex; align-items: center; gap: 18px; padding: 18px 20px; margin-bottom: 16px; }
.hero img { height: 48px; }
.hero h1 { margin: 0 0 6px; font-size: 20px; color: var(--ink); }
.hero p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.45; }

.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.card { padding: 14px 16px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.card:hover { border-color: var(--accent); box-shadow: var(--shadow-2); }
.card strong { display: block; color: var(--ink); margin-bottom: 4px; }
.card span { font-size: 12px; color: var(--muted); }

.event-card {
  display: block;
  position: relative;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.event-card:last-of-type,
.event-card:only-of-type { border-bottom: none; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.event-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
}
.event-card strong { display: block; font-size: 16px; margin-bottom: 4px; }
.event-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
@media (hover: hover) and (pointer: fine) {
  .event-card:hover { background: var(--accent-soft); }
  .event-card:hover::before { opacity: 1; }
}
.event-card:active { background: var(--accent-soft); }
.event-card:focus-visible {
  z-index: 1;
  box-shadow: var(--focus);
}
.event-card:focus-visible::before { opacity: 1; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.home-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 16px; }
.panel { overflow: hidden; }
.panel h2, .toolbar, .panel-head {
  margin: 0;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.panel h2 span { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.day-link { color: inherit; text-decoration: none; font-weight: 600; }
.day-link:hover { color: var(--accent); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-alt);
}
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--accent-soft); }
tr.clickable.on td { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
td.name { color: var(--ink); font-weight: 600; }
.team-email { font-weight: 400; font-size: 13px; margin-top: 2px; }
.table-wrap.team-table {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  overflow: hidden;
}
.table-wrap.team-table table { margin: 0; }
td input[type="checkbox"] {
  width: auto;
  height: 16px;
  margin: 0;
  pointer-events: none;
  accent-color: var(--accent);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-info { background: var(--info-soft); color: var(--accent); }
.chip-ai { background: var(--ai-soft); color: var(--ai); }
.chip-neutral { background: var(--neutral-soft); color: var(--ink-2); }

.empty, .status { padding: 20px 16px; color: var(--muted); font-size: 14px; }
.empty-state { padding: 28px 20px; text-align: center; }
.empty-state h3 { margin: 0 0 6px; font-size: 16px; }
.empty-state p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border: none; border-radius: var(--r-md);
  padding: 8px 14px; font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: none; min-height: 36px; gap: 6px;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { background: var(--accent-press); }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line-strong); }
.btn.secondary:hover { background: var(--surface-alt); }
.btn.ghost { background: transparent; color: var(--ink-2); border: none; }
.btn.ghost:hover { background: var(--surface-alt); color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: var(--danger-hover); }
.btn.ai { background: var(--ai); color: #fff; }
.btn.ai:hover { background: var(--ai-hover); }
.btn.recording { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.recording:hover { background: var(--danger-hover); }
.btn.icon {
  width: 44px;
  min-width: 44px;
  padding: 8px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn.icon:hover { background: var(--accent-soft); color: var(--accent); }
.btn.icon.recording { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.icon svg { width: 22px; height: 22px; display: block; }
.eva-actions { flex-wrap: nowrap; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.list-search {
  width: 100%;
  margin: 0;
  border-radius: var(--r-md);
}
.confirm-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(21, 32, 51, 0.45);
}
.confirm-sheet[hidden] { display: none; }
.confirm-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-3);
}
.confirm-card h3 { margin: 0 0 10px; font-size: 18px; }
.confirm-card p { margin: 0 0 10px; }
.form-card { padding: 20px 22px; margin-bottom: 16px; }
.form-card h3, .add-block h3 {
  margin: 18px 0 4px;
  font-size: 15px;
  color: var(--ink);
}
.form-card h3:first-child { margin-top: 0; }
.add-block {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding: 16px 18px 8px;
  background: var(--surface-alt);
}
.add-block .muted { margin: 0 0 10px; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; letter-spacing: 0.01em; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--r-md);
  font: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--focus); outline: none; }

.dd { position: relative; width: 100%; }
.dd-native {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
}
.dd-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 9px 10px 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}
.dd-trigger:hover { background: var(--surface-alt); }
.dd-trigger:focus-visible,
.dd.open .dd-trigger {
  border-color: var(--accent);
  box-shadow: var(--focus);
}
.dd-trigger:disabled {
  background: var(--surface-alt);
  color: var(--muted);
  opacity: 0.7;
  cursor: not-allowed;
}
.dd-trigger.is-placeholder .dd-value { color: var(--muted); }
.dd-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dd-value .chip { vertical-align: middle; }
.dd-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.dd.open .dd-chevron { transform: rotate(180deg); }
.dd-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  padding: 6px;
  max-height: 280px;
  overflow-y: auto;
}
.dd-panel.dd-tall { max-height: 320px; }
.dd-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 8px 10px;
  border-radius: var(--r-md);
  min-height: 36px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  white-space: normal;
  line-height: 1.35;
}
.dd-option:hover,
.dd-option:focus-visible,
.dd-option.is-active { background: var(--accent-soft); }
.dd-option.is-current {
  background: var(--accent-soft);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.dd-option.is-placeholder { color: var(--muted); font-weight: 400; }
textarea { min-height: 90px; resize: vertical; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; color: var(--ink); }
.check input { width: auto; accent-color: var(--accent); }

.workspace-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  margin-bottom: 8px;
}
.workspace-head > .btn.ghost {
  align-self: flex-start;
  margin-left: -8px;
}
.workspace-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.workspace-title-row > div { min-width: 0; }
.workspace-head .kpis { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  margin: 8px 0 18px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  border: none;
  background: none;
  border-radius: 0;
  padding: 12px 14px;
  min-height: 44px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button:hover { color: var(--accent); background: var(--accent-soft); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }

.flash { padding: 10px 14px; border-radius: var(--r-md); margin-bottom: 12px; font-size: 14px; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--danger-soft); color: var(--danger); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.credit-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin: 0 0 16px;
}
.credit-panel { margin-bottom: 16px; }
.band-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 12px 0 20px;
}
.confirm-card .band-grid { margin-bottom: 20px; }
.confirm-card .form-actions { margin-top: 8px; margin-bottom: 0; }
.band-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 12px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
button.band-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.band-card .btn { margin-top: 6px; }
.band-card[disabled] { opacity: 0.6; cursor: not-allowed; }
@media (max-width: 720px) {
  .credit-bar { flex-direction: column; }
}
.muted { color: var(--muted); font-size: 13px; }
.chart-panel { margin-bottom: 16px; }
.chart-panel h2 .muted { font-weight: 400; }
.q-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.q-filter {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  border-radius: var(--r-pill);
  padding: 8px 12px;
  min-height: 36px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.q-filter:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.q-filter.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.bars { padding: 14px 16px 16px; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 150px) 1fr 36px;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}
button.bar-row {
  width: 100%;
  margin: 0 0 8px;
  padding: 6px 8px;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--r-md);
}
button.bar-row:hover { background: var(--accent-soft); }
button.bar-row.on {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.bar-label {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-track {
  background: var(--accent-soft);
  height: 10px;
  border-radius: var(--r-pill);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-pill);
  min-width: 2px;
}
.bar-n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
label .req { color: var(--danger); }
.setup-head { margin-bottom: 16px; }
.panel .body { padding: 16px 18px 12px; }
.photo-preview {
  height: 72px;
  width: 72px;
  object-fit: cover;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  display: block;
  margin: 8px 0;
}
.file-field { margin-bottom: 12px; }
.file-current { margin: 6px 0 8px; font-size: 14px; }
.file-current a { font-weight: 600; }
.file-chosen { margin: 6px 0 0; color: var(--ink-2); font-size: 13px; }
button.link-inline {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  min-height: 0;
}
button.link-inline:hover { text-decoration: underline; }
.upload-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.upload-progress { margin: 8px 0 0; font-weight: 600; color: var(--ink-2); }

.run { padding: 8px 0; }
.run-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding: 12px 18px;
  border-left: 3px solid var(--line);
  margin-left: 18px;
  color: inherit;
  text-decoration: none;
}
a.run-item:hover { background: var(--accent-soft); }
.run-item.past { opacity: 0.55; }
.run-item.now { border-left-color: var(--ai); background: var(--ai-soft); }
.run-item.next { border-left-color: var(--accent); }
.run-time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); font-size: 13px; }
.run-item.now .run-time { color: var(--ai); }
.run-body strong { display: block; }
.run-body p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.run-mark { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ai); }

.attention { padding: 8px 0; }
.attention a, .attention button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 18px;
  min-height: 44px;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.attention a:last-child, .attention button:last-child { border-bottom: none; }
.attention a:hover, .attention button:hover { background: var(--accent-soft); }

.eva-wrap { margin-top: 4px; }
.eva-stage { position: relative; margin-bottom: 12px; }
.eva-messages {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  min-height: 320px;
  max-height: 420px;
  overflow-y: auto;
  padding: 16px;
  box-shadow: var(--shadow-1);
}
.eva-idle,
.eva-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  border-radius: var(--r-xl);
  overflow: hidden;
  padding: 12px 16px;
  box-sizing: border-box;
}
.eva-idle[hidden],
.eva-loading[hidden] { display: none; }
.eva-idle p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  max-width: 100%;
  line-height: 1.4;
}
.eva-loading { background: rgba(255, 255, 255, 0.55); }
.eva-idle img,
.eva-loading img {
  width: 140px;
  max-width: 70%;
  max-height: 58%;
  height: auto;
  object-fit: contain;
  background: transparent;
  flex: 0 1 auto;
}
.eva-bubble {
  padding: 10px 12px;
  border-radius: var(--r-lg);
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}
.eva-bubble strong { display: block; font-size: 12px; margin-bottom: 4px; }
.eva-bubble.you { background: var(--accent-soft); border-bottom-right-radius: 4px; }
.eva-bubble.eva { background: var(--surface-alt); border-bottom-left-radius: 4px; }
.eva-bubble.eva strong { color: var(--ai); }
.eva-hear {
  display: inline-block;
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  color: var(--ai);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.eva-compose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px 10px;
  box-shadow: var(--shadow-1);
}
.suggest-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.suggest-row button, .chip-suggest {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: var(--r-pill);
  padding: 8px 12px;
  min-height: 44px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink-2);
}
.suggest-row button:hover, .chip-suggest:hover { background: var(--ai-soft); color: var(--ai); border-color: var(--ai); }
.eva-talk-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.eva-talk-bubble {
  position: relative;
  border: none;
  cursor: pointer;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, var(--brand-ai-top), var(--brand-ai-deep));
  padding: 12px 18px 13px;
  min-height: 44px;
  border-radius: 22px 22px 8px 22px;
  box-shadow: 0 10px 22px rgba(26, 79, 156, 0.28);
}
.eva-talk-bubble::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: var(--brand-ai-deep);
  transform: rotate(45deg);
  border-radius: 2px;
}
.eva-talk-bubble:hover { filter: brightness(1.06); }
.eva-talk-bubble:disabled { opacity: 0.7; cursor: wait; filter: none; }
.eva-talk-bubble.live {
  background: var(--danger);
  border-radius: 22px;
  box-shadow: 0 8px 18px rgba(196, 43, 28, 0.28);
}
.eva-talk-bubble.live::after { display: none; }
.eva-talk-bubble.live:hover { background: var(--danger-hover); filter: none; }
.eva-talk-bubble-status {
  margin: 0;
  max-width: 220px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
@media (min-width: 801px) {
  .eva-talk-bubble {
    font-size: 16px;
    padding: 14px 24px 16px;
    min-height: 52px;
    border-radius: 26px 26px 10px 26px;
  }
  .eva-talk-bubble::after {
    right: 18px;
    bottom: -7px;
    width: 14px;
    height: 14px;
  }
  .eva-talk-bubble.live { border-radius: 26px; }
}

.login {
  max-width: 420px;
  margin: 12vh auto;
  padding: 36px 32px;
  text-align: center;
  box-shadow: var(--shadow-3);
}
.login img { height: 52px; margin-bottom: 16px; }
.login h1 { margin: 0 0 8px; font-size: 24px; }
.login .btn { width: 100%; min-height: 44px; margin-top: 8px; }

iframe[id*="msal"], iframe[name*="msal"] {
  pointer-events: none !important;
}

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

@media (max-width: 800px) {
  body:has(#chrome:not([hidden])) {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  }
  .rail { display: none; }
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: 8;
    height: var(--topbar-h);
    padding: 0 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .topbar .brand img { height: 28px; }
  .dock {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8;
    background: var(--surface-alt);
    border-top: 1px solid var(--line);
    padding: 8px 10px max(10px, env(safe-area-inset-bottom));
    justify-content: space-between;
    gap: 8px;
  }
  .dock a {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    position: relative;
    min-height: 48px;
    height: 48px;
    padding: 0;
    text-align: center;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #fff;
    color: var(--accent);
    box-shadow: var(--shadow-1);
  }
  .dock a span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .dock a svg {
    width: 24px;
    height: 24px;
    display: block;
  }
  .dock a:hover {
    background: var(--accent-soft);
    color: var(--accent);
  }
  .dock a.active {
    background: var(--accent-press);
    border-color: var(--accent-press);
    color: #fff;
    box-shadow: none;
  }
  .dock a.active:hover {
    background: var(--accent-press);
    color: #fff;
  }
  .more-sheet {
    display: none;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 12px);
    z-index: 9;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-3);
    padding: 8px;
  }
  .more-sheet.open { display: block; }
  .more-sheet a, .more-sheet button { min-height: 44px; width: 100%; }
  .grid-2, .row-2 { grid-template-columns: 1fr; }
  .home-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .hero { flex-direction: column; align-items: flex-start; }
  body:has(#chrome:not([hidden])) .page {
    grid-column: 1;
    grid-row: 2;
    padding: 14px 14px max(96px, calc(env(safe-area-inset-bottom) + 80px));
    overflow-x: hidden;
  }
  .hero { padding: 14px; gap: 10px; margin-bottom: 12px; }
  .hero img { height: 40px; }
  .hero h1, .page-head h1, .workspace-head h1, .setup-head h2 { font-size: 20px; }
  .page-head, .workspace-head { flex-direction: column; }
  .workspace-title-row { flex-direction: column; align-items: stretch; }
  .page-actions, .workspace-head .page-actions { width: 100%; }
  .page-actions .btn, .workspace-head .page-actions .btn { flex: 1; }
  .workspace-head .eva-talk-actions { width: 100%; align-items: stretch; }
  .eva-talk-bubble { width: 100%; border-radius: 18px; }
  .eva-talk-bubble::after { display: none; }
  .eva-talk-bubble-status { text-align: left; max-width: none; }
  .actions { grid-template-columns: 1fr; }
  .card { padding: 14px; }
  .toolbar, .panel h2, .panel-head {
    flex-wrap: wrap;
    padding: 12px 14px;
    gap: 10px;
  }
  .form-card, .panel .body, .add-block { padding-left: 14px; padding-right: 14px; }
  .form-card { padding-top: 12px; padding-bottom: 14px; overflow-x: hidden; }
  .row-2 > *,
  .grid-2 > * {
    min-width: 0;
    max-width: 100%;
  }
  input, select, textarea {
    padding: 12px;
    font-size: 16px;
    max-width: 100%;
  }
  .dd-native {
    position: static;
    opacity: 1;
    pointer-events: auto;
    height: auto;
    inset: auto;
  }
  .dd-trigger,
  .dd-panel { display: none !important; }
  input[type="date"],
  input[type="time"],
  input[type="datetime-local"] {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    -webkit-appearance: none;
    appearance: none;
    display: block;
  }
  .btn { padding: 12px 16px; min-height: 44px; }
  .check { min-height: 44px; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { width: 100%; }
  .form-actions.eva-actions { flex-direction: row; align-items: center; }
  .form-actions.eva-actions .btn { width: auto; flex: 1; }
  .form-actions .btn.icon { width: 44px; min-width: 44px; flex: 0 0 44px; }

  .tabs { margin: 10px 0 14px; }
  .tabs button { padding: 10px 14px; }
  .bar-row { grid-template-columns: 1fr 36px; gap: 6px 10px; }
  .bar-label { grid-column: 1 / -1; }
  .login { margin: 8vh 14px; padding: 22px 18px; }
  .table-wrap { overflow: visible; }
  table { font-size: 14px; }
  thead { display: none; }
  tbody tr {
    display: block;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }
  tbody td {
    display: block;
    padding: 2px 0;
    border: none;
  }
  tbody td.name { font-size: 15px; margin-bottom: 2px; }
  tbody td:not(.name) { color: var(--muted); font-size: 13px; }
  tbody td:not(.name):not(.actions)::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 72px;
    margin-right: 8px;
    font-weight: 600;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  tbody td.actions {
    margin-top: 8px;
  }
  tbody td.actions .btn {
    width: 100%;
  }
  .table-wrap.team-table {
    overflow-x: auto;
  }
  .table-wrap.team-table thead {
    display: table-header-group;
  }
  .table-wrap.team-table tbody tr {
    display: table-row;
    padding: 0;
  }
  .table-wrap.team-table tbody td {
    display: table-cell;
    padding: 12px 10px;
    border: none;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    color: inherit;
    font-size: 14px;
  }
  .table-wrap.team-table tbody td::before {
    display: none;
  }
  .table-wrap.team-table tbody td.actions {
    margin-top: 0;
    width: 1%;
    white-space: nowrap;
  }
  .table-wrap.team-table tbody td.actions .btn {
    width: auto;
    min-height: 40px;
    padding: 8px 12px;
  }
  .table-wrap.team-table tbody tr:last-child td {
    border-bottom: none;
  }
  td input[type="checkbox"] { height: 18px; width: 18px; }
  textarea.faq-text { min-height: 240px; }
  .eva-messages { min-height: 260px; max-height: 46vh; }
  .eva-idle img,
  .eva-loading img { width: 120px; max-height: 48%; }
  .eva-idle p { font-size: 12px; }
  #evaInput { min-height: 88px; }
  .run-item { grid-template-columns: 72px 1fr; margin-left: 8px; padding: 10px 12px; }
  .cockpit { flex-direction: column; }
  .ops-row.live { flex-direction: column; align-items: stretch; }
  .ops-row.live .page-actions { flex-direction: row; width: 100%; }
  .ops-row.live .page-actions .btn { flex: 1; }
  .stats { grid-template-columns: 1fr 1fr; }
}

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