:root {
  --bg: #ffffff;
  --surface: #f6f8f9;
  --surface-strong: #eef4f5;
  --text: #101827;
  --muted: #677182;
  --line: #dfe5e8;
  --line-strong: #cdd6da;
  --teal: #007f8e;
  --teal-dark: #006774;
  --teal-soft: #e6f3f4;
  --green: #14804a;
  --amber: #d97706;
  --amber-soft: #fff7e8;
  --red: #d92d20;
  --red-soft: #fff1f0;
  --blue: #1769c2;
  --sidebar: 206px;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(16, 24, 39, 0.12);
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { background: var(--bg); color: var(--text); font-family: var(--font); }

body { margin: 0; min-width: 320px; min-height: 100vh; font-size: 14px; }

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

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fff;
  z-index: 20;
}

.brand {
  height: 98px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 30px;
  color: var(--text);
  text-decoration: none;
  font-size: 26px;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.brand--large { height: auto; padding: 0; margin-bottom: 32px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 3px solid var(--teal);
  border-radius: 50%;
  color: var(--teal);
  font-size: 15px;
  letter-spacing: 0;
  font-weight: 800;
}

.nav { display: grid; gap: 4px; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 54px;
  padding: 0 28px;
  border: 0;
  background: transparent;
  color: #172132;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  font-weight: 560;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 10px;
  width: 4px;
  height: 0;
  background: var(--teal);
  border-radius: 2px;
  transition: height 150ms ease;
}

.nav-item:hover { background: var(--surface); }
.nav-item.is-active { color: var(--teal-dark); background: linear-gradient(90deg, var(--teal-soft), #fff 88%); }
.nav-item.is-active::before { height: 42px; }
.nav-icon { width: 20px; color: currentColor; font-size: 20px; line-height: 1; text-align: center; }

.sidebar-footer {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: auto;
  padding: 24px 30px 40px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.lock-icon { color: var(--text); font-size: 16px; }

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

.topbar {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 32px 20px 36px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.topbar h1 { margin: 0; font-size: clamp(28px, 3vw, 36px); line-height: 1.1; letter-spacing: -0.04em; }
.topbar p { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-account { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 10px; min-width: 0; }
.topbar-account:has(#owner-logout[hidden]) { display: contents; }
.topbar--sources .topbar-actions { display: grid; justify-items: end; gap: 6px; }
.source-topbar-note { color: var(--muted); font-size: 9px; line-height: 1.35; text-align: right; }
.source-topbar-buttons { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.topbar--sources .source-topbar-buttons .button { min-height: 38px; padding-inline: 13px; font-size: 11px; white-space: nowrap; }
.help-button.is-active { border-color: var(--teal); color: var(--teal-dark); background: var(--teal-soft); }

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 680;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.button--primary { color: #fff; background: var(--teal); box-shadow: 0 4px 12px rgba(0, 127, 142, .16); }
.button--primary:hover { background: var(--teal-dark); }
.button--secondary { border-color: var(--line-strong); background: #fff; color: var(--text); box-shadow: none; }
.button--danger { border-color: #efc5c2; background: #fff; color: var(--red); }
.button--danger-strong { color: #fff; background: var(--red); box-shadow: 0 4px 12px rgba(217, 45, 32, .16); }
.button--danger-strong:hover { background: #b42318; }
.button--quiet { min-height: 34px; padding: 0 11px; border-color: transparent; background: transparent; color: var(--teal-dark); }
.button--wide { width: 100%; }

#content { min-height: calc(100vh - 120px); }
#content:focus { outline: none; }
.page { padding: 30px 36px 56px; }
.page--flush { padding: 0; }

.status-rail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: 112px;
  border-bottom: 1px solid var(--line);
}

.status-cell { position: relative; display: flex; align-items: center; gap: 18px; padding: 24px 36px; }
.status-cell + .status-cell { border-left: 1px solid var(--line); }
.status-cell::before { content: ""; width: 3px; height: 58px; background: var(--teal); }
.status-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-size: 22px; }
.status-label { color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.status-value { font-size: 16px; font-weight: 680; }
.progress { width: 100%; height: 5px; margin-top: 10px; border-radius: 3px; overflow: hidden; background: var(--line); }
.progress > span { display: block; height: 100%; background: var(--teal); }

.overview-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, .9fr); border-bottom: 1px solid var(--line); }
.panel { min-width: 0; padding: 26px 36px 30px; }
.panel + .panel { border-left: 1px solid var(--line); }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.panel-title h2, .section-title { margin: 0; font-size: 19px; letter-spacing: -.025em; }

.attention-table, .data-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.attention-table th, .data-table th { padding: 10px 12px; color: #374151; font-size: 11px; text-align: left; font-weight: 650; white-space: nowrap; }
.attention-table td, .data-table td { padding: 15px 12px; border-top: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
.attention-table th:first-child, .attention-table td:first-child, .data-table th:first-child, .data-table td:first-child { padding-left: 0; }
.attention-table th:last-child, .attention-table td:last-child, .data-table th:last-child, .data-table td:last-child { padding-right: 0; }
.data-table tbody tr { transition: background 120ms ease; }
.data-table tbody tr:hover { background: var(--surface); }
.data-table tbody tr.is-selected, .data-table tbody tr.is-included { box-shadow: inset 3px 0 var(--teal); background: #f4fbfb; }
.data-table tbody tr.is-checked { background: #eaf7f8; box-shadow: inset 3px 0 var(--teal-dark); }
.cell-primary { font-weight: 650; }
.cell-muted { color: var(--muted); }
.cell-danger { color: var(--red); }
.cell-success { color: var(--green); }
.deadline { color: var(--amber); font-weight: 650; }
.priority-dot, .status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.priority-dot.high, .status-dot.amber { background: #f59e0b; }
.priority-dot.normal { background: #b8c0c5; }
.priority-dot.low { background: var(--teal); }
.status-dot.green { background: var(--green); }
.status-dot.red { background: var(--red); }
.status-inline { display: inline-flex; gap: 7px; align-items: center; }

.timeline { list-style: none; padding: 0; margin: 0 0 26px; }
.timeline li { position: relative; display: grid; grid-template-columns: 50px 16px 1fr; gap: 8px; min-height: 58px; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 57px; top: 22px; bottom: -3px; width: 1px; background: var(--line-strong); }
.timeline-time { padding-top: 2px; font-weight: 700; }
.timeline-dot { position: relative; z-index: 1; margin-top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--teal); }
.timeline-label strong { display: block; font-size: 13px; }
.timeline-label small { display: block; margin-top: 4px; color: var(--muted); }

.error-mini { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.error-symbol { display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--red); border-radius: 50%; color: var(--red); font-weight: 800; }
.error-mini strong { display: block; color: var(--red); font-size: 12px; }
.error-mini p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.error-mini time { color: var(--muted); font-size: 11px; }

.sources-section { padding: 24px 36px 36px; }

.dashboard-page { display: grid; gap: 0; padding: 0; background: #fff; }
.dashboard-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.dashboard-toolbar h2 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.dashboard-toolbar p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.dashboard-periods { display: inline-flex; align-items: center; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.dashboard-topbar-controls { display: grid; justify-items: end; gap: 10px; }
.dashboard-topbar-controls > span { color: var(--muted); font-size: 10px; }
.dashboard-period-button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; font-weight: 670; white-space: nowrap; }
.dashboard-period-button:hover { color: var(--teal-dark); background: var(--surface); }
.dashboard-period-button.is-active { color: #fff; background: var(--teal); box-shadow: 0 3px 9px rgba(0, 127, 142, .18); }
.dashboard-grid { display: grid; gap: 0; border-bottom: 1px solid var(--line); }
.dashboard-grid--top { grid-template-columns: minmax(350px, .78fr) minmax(530px, 1.5fr); }
.dashboard-grid--bottom { grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr); }
.dashboard-card { min-width: 0; overflow: hidden; padding: 28px 36px; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
.dashboard-card + .dashboard-card { border-left: 1px solid var(--line); }
.dashboard-grid--top .dashboard-card { min-height: 382px; }
.dashboard-grid--bottom .dashboard-card { min-height: 455px; }
.dashboard-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 41px; }
.dashboard-card-heading h3 { margin: 4px 0 0; font-size: 17px; letter-spacing: -.025em; }
.dashboard-kicker { color: var(--teal); font-size: 8px; font-weight: 800; letter-spacing: .16em; }
.dashboard-card-note { color: var(--muted); font-size: 10px; }
.dashboard-dialogs-body { display: grid; grid-template-columns: minmax(190px, .92fr) minmax(155px, .7fr); align-items: center; gap: 15px; margin-top: 6px; }
.dashboard-donut-wrap { min-width: 0; height: 260px; overflow: hidden; }
.dashboard-donut-wrap canvas, .dashboard-bars-wrap canvas { display: block; }
.dashboard-dialog-legend { display: grid; gap: 4px; }
.dashboard-legend-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 35px; padding: 0 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; }
.dashboard-legend-row:last-child { border-bottom: 0; }
.dashboard-legend-row:hover span:nth-child(2) { color: var(--teal-dark); }
.dashboard-legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.dashboard-legend-row span:nth-child(2) { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-legend-row strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.dashboard-message-metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0 2px; border-block: 1px solid var(--line); }
.dashboard-message-metrics > div { display: grid; align-content: center; min-height: 70px; padding: 11px 18px; }
.dashboard-message-metrics > div + div { border-left: 1px solid var(--line); }
.dashboard-message-metrics span { color: var(--muted); font-size: 9px; }
.dashboard-message-metrics strong { margin-top: 4px; font-size: 23px; letter-spacing: -.035em; }
.dashboard-message-metrics small { color: var(--muted); font-size: 9px; }
.dashboard-bars-wrap { position: relative; width: 100%; height: 210px; margin-top: 3px; overflow: hidden; }
.dashboard-bars-wrap canvas { cursor: crosshair; outline: none; }
.dashboard-bars-wrap canvas:focus-visible { border-radius: 4px; box-shadow: inset 0 0 0 2px rgba(0, 127, 142, .28); }
.dashboard-chart-tooltip { position: absolute; z-index: 2; min-width: 124px; padding: 8px 11px; border-radius: 7px; color: #fff; background: #101827; box-shadow: 0 8px 22px rgba(16, 24, 39, .22); pointer-events: none; transform: translate(-50%, -100%); }
.dashboard-chart-tooltip.is-below { transform: translate(-50%, 0); }
.dashboard-chart-tooltip span, .dashboard-chart-tooltip strong { display: block; white-space: nowrap; }
.dashboard-chart-tooltip span { color: #cbd5df; font-size: 9px; }
.dashboard-chart-tooltip strong { margin-top: 3px; font-size: 12px; font-variant-numeric: tabular-nums; }
.dashboard-freshness { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.dashboard-freshness small { color: #88919e; text-align: right; }
.dashboard-chat-list { display: grid; margin-top: 12px; }
.dashboard-chat-row { display: grid; grid-template-columns: 23px 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 53px; padding: 5px 2px; border: 0; border-top: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; }
.dashboard-chat-row:hover { background: #f8fbfb; }
.dashboard-chat-rank { color: #98a0aa; font-size: 10px; text-align: center; }
.dashboard-chat-name { min-width: 0; }
.dashboard-chat-name strong, .dashboard-chat-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-chat-name strong { font-size: 11px; }
.dashboard-chat-name small, .dashboard-chat-share small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.dashboard-chat-share { text-align: right; }
.dashboard-chat-share strong, .dashboard-chat-share small { display: block; font-variant-numeric: tabular-nums; }
.dashboard-chat-share strong { font-size: 12px; }
.dashboard-created-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 12px; }
.dashboard-created-grid > section { min-width: 0; }
.dashboard-created-grid header { display: flex; align-items: center; justify-content: space-between; min-height: 30px; padding: 0 2px; border-bottom: 1px solid var(--line); }
.dashboard-created-grid header span { color: var(--muted); font-size: 10px; font-weight: 680; }
.dashboard-created-grid header strong { color: var(--teal-dark); font-size: 11px; }
.dashboard-created-row { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 7px 2px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; }
.dashboard-created-row:hover { background: #f8fbfb; }
.dashboard-created-row > span:last-child { min-width: 0; }
.dashboard-created-row strong, .dashboard-created-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-created-row strong { font-size: 10px; }
.dashboard-created-row small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.dashboard-empty { padding: 18px 6px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.created-sources-page { max-width: 1180px; margin: 0 auto; }
.created-sources-page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.created-sources-page-heading p { max-width: 720px; margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.created-sources-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 18px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.created-sources-summary > div { display: grid; gap: 5px; min-height: 68px; align-content: center; padding: 11px 16px; }
.created-sources-summary > div + div { border-left: 1px solid var(--line); }
.created-sources-summary span { color: var(--muted); font-size: 9px; }
.created-sources-summary strong { font-size: 21px; font-variant-numeric: tabular-nums; }
.created-sources-controls { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 10px; }
.created-sources-controls .search, .created-sources-controls .select { width: 100%; min-width: 0; }
.created-sources-tabs { display: flex; gap: 4px; margin-top: 12px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.created-sources-tabs button { min-height: 32px; padding: 0 13px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; }
.created-sources-tabs button strong { margin-left: 5px; font-variant-numeric: tabular-nums; }
.created-sources-tabs button.is-active { color: var(--teal-dark); background: #fff; box-shadow: 0 1px 4px rgba(16, 24, 39, .08); }
.created-sources-result-line { min-height: 28px; padding: 9px 2px 5px; color: var(--muted); font-size: 9px; }
.created-sources-list { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.created-sources-list-head { position: sticky; top: 0; z-index: 1; display: grid; grid-template-columns: minmax(210px, 1fr) 70px 78px 128px; gap: 10px; min-height: 32px; align-items: center; padding: 0 36px 0 14px; border-bottom: 1px solid var(--line); color: var(--muted); background: #f8fafb; font-size: 8px; text-transform: uppercase; letter-spacing: .05em; }
.created-source-row { width: 100%; display: grid; grid-template-columns: 38px minmax(240px, 1fr) 90px 110px 155px 14px; align-items: center; gap: 14px; min-height: 68px; padding: 9px 16px; border: 0; border-bottom: 1px solid var(--line); background: #fff; cursor: pointer; text-align: left; }
.created-source-row:last-child { border-bottom: 0; }
.created-source-row:hover { background: #f7fbfb; }
.created-source-name { min-width: 0; }
.created-source-name strong, .created-source-name small, .created-source-members strong, .created-source-members small, .created-source-activity strong, .created-source-activity small { display: block; }
.created-source-name strong, .created-source-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.created-source-name strong { font-size: 13px; }
.created-source-name small, .created-source-members small, .created-source-activity small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.created-source-type { color: var(--muted); font-size: 11px; }
.created-source-members strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.created-source-activity strong { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 680; }
.created-source-activity i { width: 7px; height: 7px; border-radius: 50%; background: #98a2b3; }
.created-source-activity.is-recent strong { color: #18794e; }
.created-source-activity.is-recent i { background: #25a66a; }
.created-source-activity.is-current strong { color: var(--teal-dark); }
.created-source-activity.is-current i { background: var(--teal); }
.created-source-activity.is-stale strong { color: #9a6700; }
.created-source-activity.is-stale i { background: #d99a19; }
.created-source-activity.is-muted strong { color: var(--muted); }
.created-source-arrow { color: var(--teal); font-size: 20px; text-align: right; }
.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 16px; }
.toolbar-controls { display: flex; flex-wrap: wrap; gap: 10px; }
.source-filter-toolbar {
  display: block;
  justify-content: start;
  align-items: start;
  margin: 10px 0;
}
.source-filter-toolbar .toolbar-controls {
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 150px 96px 124px 114px 128px 136px 132px auto;
  justify-content: start;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.source-filter-toolbar .search, .source-filter-toolbar .select, .source-reset-filters { min-width: 0; min-height: 34px; padding-inline: 9px; font-size: 10px; }
.source-filter-toolbar .search { width: 100%; max-width: none; }
.source-filter-toolbar .select { flex: 0 1 auto; padding-left: 7px; padding-right: 20px; }
#source-type-filter, #source-account-filter, #source-category-filter, #source-access-filter, #source-activity-filter, #source-filter { width: 100%; }
.source-filter-toolbar .search, .source-filter-toolbar .select, .source-reset-filters { transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease; }
.source-filter-toolbar .is-filter-active { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-dark); box-shadow: inset 0 0 0 1px rgba(0, 127, 142, .18); font-weight: 680; }
.source-reset-filters { flex: 0 0 auto; min-height: 34px; padding-inline: 11px; white-space: nowrap; }
.source-reset-filters.is-active { border-color: var(--teal); color: var(--teal-dark); background: #fff; }
.source-result-count { grid-column: 1 / -1; min-width: 0; min-height: 14px; align-self: center; padding: 0 2px; color: var(--muted); font-size: 10px; line-height: 1.35; text-align: left; font-variant-numeric: tabular-nums; }
.sources-page { padding-top: 14px; }
.source-freshness { display: flex; align-items: center; justify-content: flex-end; gap: 9px; min-height: 44px; margin: 0 0 10px; padding: 8px 12px; border: 1px solid #cfe3e5; border-radius: 8px; background: #f6fbfb; }
.source-freshness-icon { display: grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; color: var(--teal-dark); background: var(--teal-soft); font-size: 14px; }
.source-freshness > div { display: flex; align-items: baseline; justify-content: flex-end; flex-wrap: wrap; gap: 2px 10px; min-width: 0; text-align: right; }
.source-freshness strong { font-size: 10px; }
.source-freshness span { color: var(--muted); font-size: 9px; line-height: 1.4; }
.source-freshness b { color: var(--text); font-weight: 700; }
.source-insights { width: 100%; max-width: none; display: grid; gap: 0; margin: 14px 0 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 39, .03); }
.source-metric-group { display: grid; grid-template-columns: 146px minmax(0, 1fr); align-items: stretch; min-height: 54px; border-top: 1px solid var(--line); }
.source-metric-group:first-child { border-top: 0; }
.source-metric-heading { display: grid; align-content: center; gap: 2px; padding: 7px 12px; }
.source-metric-heading h3 { margin: 0; font-size: 11px; line-height: 1.25; }
.source-metric-heading span { display: none; }
.source-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 165px)); justify-content: start; gap: 0; }
.source-stats--activity { grid-template-columns: repeat(7, minmax(0, 148px)); }
.source-stats--modes { grid-template-columns: repeat(auto-fit, 126px); }
.source-stat {
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin: 6px 0;
  padding: 5px 11px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.source-stat:first-child { border-left: 0; }
.source-stat:hover { background: #f6fafb; color: var(--teal-dark); }
.source-stat.is-active { margin: 5px 3px; border: 1px solid var(--teal); border-radius: 6px; background: var(--teal-soft); box-shadow: none; }
.source-stat.is-active + .source-stat { border-left-color: transparent; }
.source-stat span { min-width: 0; color: var(--muted); font-size: 9px; line-height: 1.2; white-space: normal; overflow: visible; text-overflow: clip; }
.source-stat strong { flex: 0 0 auto; font-size: 14px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.source-report-line { display: flex; flex-wrap: wrap; gap: 5px 20px; min-height: 32px; align-items: center; padding: 6px 12px; border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 10px; }
.source-report-line strong { color: var(--text); }
.source-results-callout { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 50px; margin: 9px 0 0; padding: 7px 10px 7px 12px; border: 1px solid #b9dfe3; border-radius: 7px; background: linear-gradient(90deg, #f0fafb, #fff); }
.source-results-callout > div:first-child { display: grid; gap: 2px; }
.source-results-callout strong { font-size: 11px; }
.source-results-callout span { color: var(--muted); font-size: 10px; line-height: 1.35; }
.source-results-callout > div:last-child { display: flex; flex: 0 0 auto; gap: 8px; }
.source-results-callout .button { min-height: 34px; padding-inline: 13px; font-size: 11px; }
.source-safety-note { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 7px 10px; border: 1px solid #cfe3e5; border-radius: 7px; color: var(--muted); background: #f5fbfb; font-size: 10px; line-height: 1.35; }
.source-safety-note > span:first-child { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; color: var(--teal); background: var(--teal-soft); font-size: 13px; }
.source-safety-note strong { color: var(--text); }
.source-bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin: 0 0 9px; padding: 6px 9px 6px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); transition: border-color 140ms ease, background 140ms ease; }
.source-bulk-bar.has-selection { border-color: #a9d7dc; background: #eff9fa; }
.source-bulk-bar > span { min-width: 66px; font-size: 11px; }
.source-bulk-bar > span strong { font-size: 15px; }
.source-bulk-actions { min-width: 0; display: flex; flex-wrap: nowrap; justify-content: flex-end; align-items: center; gap: 5px; }
.source-bulk-actions .button, .source-bulk-actions .select { min-width: 0; min-height: 32px; padding-inline: 8px; font-size: 10px; }
#source-bulk-mode { width: 154px; }
#source-bulk-category { width: 112px; }
.table-scroll { width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; }
.source-table td:nth-child(4), .source-table td:nth-child(5), .source-table td:nth-child(8) { font-size: 11px; line-height: 1.25; }
.source-table td:nth-child(5) .mode-select { width: 100%; min-width: 0; height: 29px; font-size: 10px; }
.checkbox-cell { width: 42px; text-align: center !important; padding-left: 8px !important; padding-right: 8px !important; }
.source-checkbox { width: 17px; height: 17px; margin: 0; accent-color: var(--teal); cursor: pointer; }
.source-table { width: 100%; min-width: 0; table-layout: fixed; }
.source-table th, .source-table td { min-width: 0; padding-left: 7px; padding-right: 7px; overflow: hidden; }
.source-table th:nth-child(1) { width: 40px; }
.source-table th:nth-child(2) { width: calc(26% - 40px); }
.source-table th:nth-child(3) { width: 7%; }
.source-table th:nth-child(4) { width: 6%; }
.source-table th:nth-child(5) { width: 11%; }
.source-table th:nth-child(6) { width: 13%; }
.source-table th:nth-child(7) { width: 9%; }
.source-table th:nth-child(8) { width: 11%; }
.source-table th:nth-child(9) { width: 11%; }
.source-table th:nth-child(10) { width: 6%; }
.source-table th.source-last-message-cell { white-space: normal; }
.source-table th.source-last-message-cell .table-sort-button { white-space: normal; line-height: 1.15; font-size: 9px; }
.source-participants-cell { min-width: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.source-participants-cell strong { font-weight: 760; }
.source-last-message-cell { min-width: 0; white-space: normal; font-variant-numeric: tabular-nums; }
.source-last-message { display: grid; gap: 2px; line-height: 1.1; }
.source-last-message span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.source-last-message small { color: var(--muted); font-size: 8px; }
.table-sort-button { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; font-weight: inherit; cursor: pointer; }
.table-sort-button:hover { color: var(--teal-dark); }
.table-sort-button:focus-visible { outline: 2px solid rgba(0, 127, 142, .35); outline-offset: 4px; border-radius: 3px; }
.table-sort-button span { min-width: 11px; color: #a0a9ae; font-size: 10px; }
.source-table th[aria-sort="ascending"] .table-sort-button,
.source-table th[aria-sort="descending"] .table-sort-button { color: var(--teal-dark); }
.source-table th[aria-sort="ascending"] .table-sort-button span,
.source-table th[aria-sort="descending"] .table-sort-button span { color: var(--teal); }
.source-category { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.source-category--business { color: #076574; background: #e1f4f5; }
.source-category--business_club { color: #5d4b92; background: #eeeafb; }
.source-category--personal { color: #8a4d16; background: #fff1d9; }
.source-category--finance { color: #3655a5; background: #e8eeff; }
.source-category--social { color: #8b3f78; background: #f9e8f4; }
.source-category--neural { color: #6052a8; background: #eeecff; }
.source-category--unclassified { color: var(--muted); background: var(--surface); }
.source-category-select { width: 100%; min-width: 0; min-height: 29px; padding: 4px 22px 4px 8px; border: 1px solid transparent; border-radius: 999px; font: inherit; font-size: 9px; font-weight: 700; cursor: pointer; }
.source-category-select:hover { border-color: rgba(0, 127, 142, .24); }
.source-category-select:focus-visible { outline: 2px solid rgba(0, 127, 142, .32); outline-offset: 2px; }
.source-open-link { width: 100%; min-height: 28px; padding-inline: 1px; text-align: right; text-decoration: none; font-size: 9px; white-space: nowrap; }
.source-identity { width: 100%; min-width: 0; display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 0; border: 0; color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.source-identity:hover strong { color: var(--teal-dark); text-decoration: underline; text-underline-offset: 3px; }
.source-identity > span:last-child { min-width: 0; }
.source-identity strong, .source-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-identity strong { font-size: 12px; }
.source-identity small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.source-avatar, .source-preview-avatar { display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border-radius: 50%; color: var(--teal-dark); background: var(--teal-soft); font-weight: 760; object-fit: cover; }
.source-avatar { width: 31px; height: 31px; font-size: 9px; }
.source-preview-avatar { width: 58px; height: 58px; font-size: 16px; }
.source-preview-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.source-preview-title h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-preview-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; color: var(--muted); font-size: 11px; }
.source-preview-actions > div { display: flex; align-items: center; gap: 8px; }
.query-textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.query-privacy-note { display: grid; gap: 5px; padding: 13px 14px; border: 1px solid #b9dde2; border-radius: 10px; background: #f2fbfc; color: var(--muted); font-size: 12px; line-height: 1.45; }
.query-privacy-note strong { color: var(--text); }
.source-preview-warning { margin-bottom: 14px; padding: 11px 13px; border: 1px solid #f0d6a5; border-radius: 6px; color: #875d17; background: #fff9ed; font-size: 11px; line-height: 1.5; }
.chat-stream { display: grid; gap: 8px; max-height: min(520px, 58vh); padding: 16px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; background: #f4f7f8; }
.chat-message { justify-self: start; width: min(82%, 540px); padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; background: #fff; box-shadow: 0 2px 8px rgba(18, 52, 60, .04); font-size: 12px; line-height: 1.52; }
.chat-message.is-outgoing { justify-self: end; border-color: #badde0; border-radius: 12px 4px 12px 12px; background: #eaf7f8; }
.chat-message header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.chat-message header strong { color: var(--teal-dark); font-size: 10px; }
.chat-message time { color: var(--muted); font-size: 9px; white-space: nowrap; }
.chat-message em { color: var(--muted); }
.chat-message footer { display: flex; justify-content: flex-end; gap: 10px; min-height: 12px; margin-top: 5px; color: var(--muted); font-size: 8px; }
.chat-message footer a { color: var(--teal-dark); font-size: 9px; }
.source-leave-note { display: grid; gap: 4px; margin-top: 14px; padding: 12px 14px; border-radius: 7px; color: var(--muted); background: var(--surface); font-size: 10px; line-height: 1.5; }
.source-leave-note strong { color: var(--text); font-size: 11px; }
.leave-warning { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid #efc5c2; border-radius: 8px; color: #8f251d; background: var(--red-soft); font-size: 12px; line-height: 1.5; }
.leave-warning strong { color: var(--red); font-size: 13px; }
.leave-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin: 16px 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.leave-summary > div { display: grid; gap: 4px; padding: 12px 14px; background: #fff; }
.leave-summary > div + div { border-left: 1px solid var(--line); }
.leave-summary span { color: var(--muted); font-size: 10px; }
.leave-summary strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.leave-list-section { margin-top: 18px; }
.leave-list-section h3 { margin: 0 0 8px; font-size: 13px; }
.leave-list { display: grid; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.leave-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 11px 12px; background: #fff; }
.leave-row + .leave-row { border-top: 1px solid var(--line); }
.leave-row > span { min-width: 0; }
.leave-row strong, .leave-row small { display: block; }
.leave-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.leave-row small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.leave-row.is-blocked { grid-template-columns: minmax(0, 1fr); background: #fafbfb; }
.leave-private-note { color: var(--amber) !important; }
.leave-alternatives { display: grid; gap: 5px; margin-top: 18px; padding: 13px 15px; border-radius: 8px; color: var(--muted); background: var(--surface); font-size: 11px; line-height: 1.5; }
.leave-alternatives strong { color: var(--text); font-size: 12px; }
.leave-confirmation { display: grid; gap: 10px; margin-top: 18px; }
.leave-confirmation .field span { line-height: 1.5; }
.leave-confirmation code { color: var(--red); font-weight: 750; }
.leave-ack { display: flex; align-items: flex-start; gap: 9px; color: var(--text); font-size: 11px; line-height: 1.5; }
.leave-ack input { flex: 0 0 auto; width: 17px; height: 17px; margin: 0; accent-color: var(--red); }
.leave-progress { min-height: 18px; margin: 12px 0 0; color: var(--muted); font-size: 11px; }
.leave-result-list .leave-row { grid-template-columns: 20px minmax(0, 1fr); }
.leave-result-icon { font-weight: 800; }
.leave-result-icon.is-success { color: var(--green); }
.leave-result-icon.is-error { color: var(--red); }
.leave-result-icon.is-blocked { color: var(--amber); }
.search, .select, .input, .textarea {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  outline: none;
}
.search, .input { padding: 0 12px; min-width: 240px; }
.select { padding: 0 32px 0 12px; }
.textarea { min-height: 110px; padding: 10px 12px; resize: vertical; }
.bulk-source-input { width: 100%; min-height: 190px; line-height: 1.6; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.search:focus, .select:focus, .input:focus, .textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0, 127, 142, .11); }
.mode-select { min-width: 118px; height: 34px; border: 1px solid transparent; background: transparent; color: var(--text); }
.mode-select:focus, .mode-select:hover { border-color: var(--line-strong); }

.empty-state { padding: 70px 24px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }
.empty-state strong { display: block; margin-bottom: 8px; color: var(--text); font-size: 16px; }
.loading { display: grid; place-items: center; min-height: 300px; color: var(--muted); }
.spinner { width: 26px; height: 26px; margin-bottom: 12px; border: 3px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

.list-view { border-top: 1px solid var(--line); }
.list-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 2fr) minmax(110px, .7fr) auto; gap: 20px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.list-row h3 { margin: 0 0 5px; font-size: 14px; }
.list-row p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.list-row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.digest-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 560px; border: 1px solid var(--line); }
.digest-list { border-right: 1px solid var(--line); }
.digest-button { display: block; width: 100%; padding: 16px; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; cursor: pointer; }
.digest-button:hover, .digest-button.is-active { background: var(--surface); box-shadow: inset 3px 0 var(--teal); }
.digest-button strong { display: block; margin-bottom: 5px; font-size: 13px; }
.digest-button span { color: var(--muted); font-size: 11px; }
.digest-body { padding: 28px 34px; overflow: auto; }
.digest-body pre { margin: 0; white-space: pre-wrap; font: 14px/1.7 var(--font); color: #273244; }
.digest-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.digest-meta span { padding: 6px 9px; border-radius: 5px; color: var(--muted); background: var(--surface); font-size: 10px; }
.digest-markdown { max-width: 920px; color: #273244; font-size: 14px; line-height: 1.7; }
.digest-markdown h2 { margin: 0 0 12px; color: var(--text); font-size: 25px; letter-spacing: -.035em; }
.digest-markdown h3 { margin: 28px 0 10px; color: var(--text); font-size: 17px; }
.digest-markdown h4 { margin: 22px 0 8px; color: var(--text); font-size: 15px; }
.digest-markdown p { margin: 8px 0; }
.digest-markdown ul { display: grid; gap: 9px; margin: 10px 0 20px; padding-left: 21px; }
.digest-markdown a { color: var(--teal-dark); text-underline-offset: 2px; }

.job-live-note { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.job-live-note i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(20, 128, 74, .1); }
.job-summary { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.job-summary > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; padding: 15px 18px; background: #fff; }
.job-summary > div + div { border-left: 1px solid var(--line); }
.job-summary span { color: var(--muted); font-size: 11px; }
.job-summary strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.job-summary .has-error strong { color: var(--red); }
.job-layout { display: grid; grid-template-columns: minmax(290px, 350px) minmax(0, 1fr); min-height: 650px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.job-list-panel { max-height: 820px; overflow: auto; border-right: 1px solid var(--line); background: var(--surface); }
.job-card { border-bottom: 1px solid var(--line); background: #fff; }
.job-card.is-active { box-shadow: inset 4px 0 var(--teal); background: #f3fbfb; }
.job-card-main { width: 100%; display: grid; gap: 10px; padding: 17px 18px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.job-card-main:hover { background: rgba(0, 127, 142, .035); }
.job-card-top, .job-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.job-card-top > strong { font-size: 12px; }
.job-card-period, .job-card-bottom { color: var(--muted); font-size: 10px; }
.job-card-bottom > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-status { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 8px; border-radius: 999px; color: #475467; background: var(--surface-strong); font-size: 9px; font-weight: 750; white-space: nowrap; }
.job-status--syncing, .job-status--analyzing, .job-status--formatting { color: var(--teal-dark); background: var(--teal-soft); }
.job-status--ready { color: var(--green); background: #eaf8f0; }
.job-status--error { color: var(--red); background: var(--red-soft); }
.job-status--cancelled { color: var(--muted); background: #edf0f2; }
.job-progress { display: block; width: 100%; height: 5px; overflow: hidden; border-radius: 999px; background: #e4eaec; }
.job-progress i { display: block; height: 100%; border-radius: inherit; background: var(--teal); transition: width 280ms ease; }
.job-progress--large { height: 8px; margin-top: 22px; }
.job-detail { min-width: 0; padding: 28px 30px 40px; background: #fff; }
.job-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.job-detail-header h2 { margin: 5px 0 6px; font-size: 25px; letter-spacing: -.035em; }
.job-detail-header p { margin: 0; color: var(--muted); font-size: 11px; }
.job-stage-line { display: grid; grid-template-columns: repeat(5, 1fr); margin: 34px 0 0; padding: 0; list-style: none; }
.job-stage-line li { position: relative; display: grid; justify-items: center; gap: 7px; color: var(--muted); font-size: 9px; text-align: center; }
.job-stage-line li:not(:last-child)::after { content: ""; position: absolute; z-index: 0; left: calc(50% + 14px); right: calc(-50% + 14px); top: 12px; height: 2px; background: var(--line); }
.job-stage-line li.is-done:not(:last-child)::after { background: var(--teal); }
.job-stage-line i { position: relative; z-index: 1; display: grid; place-items: center; width: 25px; height: 25px; border: 2px solid var(--line-strong); border-radius: 50%; color: var(--muted); background: #fff; font-style: normal; font-size: 9px; font-weight: 750; }
.job-stage-line .is-current i { border-color: var(--teal); color: #fff; background: var(--teal); box-shadow: 0 0 0 5px var(--teal-soft); }
.job-stage-line .is-done i { border-color: var(--teal); color: #fff; background: var(--teal); }
.job-stage-line .is-current span, .job-stage-line .is-done span { color: var(--text); font-weight: 650; }
.job-progress-copy { display: flex; justify-content: space-between; gap: 14px; margin: 9px 0 22px; font-size: 11px; }
.job-progress-copy span { color: var(--muted); font-variant-numeric: tabular-nums; }
.job-facts { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.job-facts > div { display: grid; align-content: start; gap: 6px; min-height: 78px; padding: 14px; }
.job-facts > div + div { border-left: 1px solid var(--line); }
.job-facts span { color: var(--muted); font-size: 9px; }
.job-facts strong { font-size: 11px; line-height: 1.4; }
.job-detail-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.job-waiting-result, .job-terminal { display: grid; justify-items: center; margin-top: 28px; padding: 54px 24px; border: 1px dashed var(--line-strong); border-radius: 9px; color: var(--muted); text-align: center; }
.job-waiting-result .spinner { width: 24px; height: 24px; }
.job-waiting-result strong, .job-terminal strong { color: var(--text); }
.job-waiting-result p, .job-terminal p { margin: 7px 0 0; font-size: 11px; }
.job-terminal--error { border-color: #efc5c2; color: var(--red); background: var(--red-soft); }
.job-result { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
.job-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.job-result-heading h3 { margin: 5px 0 0; font-size: 20px; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.settings-section { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); }
.settings-section h2 { margin: 0 0 8px; font-size: 17px; }
.settings-section > p { margin: 0 0 22px; color: var(--muted); line-height: 1.5; }
.form-stack { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field > span { font-size: 12px; color: #374151; font-weight: 620; }
.form-row { display: flex; gap: 10px; align-items: end; }
.form-row .field { flex: 1; }
.form-error { min-height: 18px; margin: 8px 0; color: var(--red); font-size: 12px; }
.help { color: var(--muted); font-size: 11px; line-height: 1.5; }
code { padding: 2px 5px; background: var(--surface); border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }

.modal { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 12px; box-shadow: var(--shadow); overflow: auto; }
.modal.modal--wide { width: min(720px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(16, 24, 39, .42); backdrop-filter: blur(2px); }
.modal-inner { padding: 28px; }
.modal-header { display: flex; justify-content: space-between; gap: 20px; align-items: start; margin-bottom: 24px; }
.modal-header h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.modal-header p { margin: 7px 0 0; color: var(--muted); line-height: 1.5; }
.modal-header .modal-close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--surface); cursor: pointer; font-size: 20px; }
.modal-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.modal-actions .button { flex: 0 0 auto; min-width: 108px; white-space: nowrap; }

.help-page { max-width: 1320px; margin: 0 auto; }
.guide-hero { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 32px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #053e46, #007f8e 70%, #22a1ad); box-shadow: 0 14px 38px rgba(0, 87, 99, .16); }
.guide-hero h2, .guide-metrics-roadmap h2 { margin: 7px 0 10px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.045em; }
.guide-hero p { max-width: 760px; margin: 0; color: rgba(255,255,255,.82); font-size: 15px; line-height: 1.65; }
.guide-hero .button { background: #fff; color: var(--teal-dark); box-shadow: none; white-space: nowrap; }
.guide-kicker { font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.guide-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 44px; }
.guide-steps a { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: #fff; text-decoration: none; }
.guide-steps a:hover { border-color: var(--teal); background: var(--teal-soft); }
.guide-steps strong { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; background: var(--teal); }
.guide-steps span { font-size: 12px; font-weight: 650; }
.guide-section { scroll-margin-top: 24px; display: grid; grid-template-columns: minmax(280px, .8fr) minmax(480px, 1.25fr); gap: clamp(36px, 7vw, 96px); align-items: center; padding: 54px 0; border-top: 1px solid var(--line); }
.guide-section--reverse .guide-copy { order: 2; }
.guide-section--reverse .guide-shot { order: 1; }
.guide-step-number { display: inline-flex; color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.guide-copy h2 { margin: 8px 0 12px; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.04em; }
.guide-copy > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.guide-notes { display: grid; gap: 14px; margin: 26px 0 0; padding: 0; list-style: none; counter-reset: note; }
.guide-notes li { position: relative; padding-left: 36px; color: var(--muted); font-size: 12px; line-height: 1.55; counter-increment: note; }
.guide-notes li::before { content: counter(note); position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; background: var(--teal); font-weight: 800; }
.guide-notes strong { display: block; margin-bottom: 2px; color: var(--text); font-size: 13px; }
.guide-shot { position: relative; min-width: 0; padding: 24px; border: 1px solid #cadcdf; border-radius: 13px; background: #fff; box-shadow: 0 18px 44px rgba(16, 70, 80, .12); }
.guide-shot::before { content: "СХЕМА ЭКРАНА"; position: absolute; left: 18px; top: -11px; padding: 4px 8px; border-radius: 4px; color: var(--teal-dark); background: var(--teal-soft); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.guide-shot-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 22px; font-size: 17px; font-weight: 750; }
.guide-shot-header i { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: var(--surface); font-style: normal; font-weight: 400; }
.guide-shot label { display: block; margin: 11px 0 6px; color: #374151; font-size: 10px; font-weight: 700; }
.guide-textarea, .guide-select { position: relative; border: 1px solid var(--line-strong); border-radius: 6px; color: #495465; background: #fff; }
.guide-textarea { min-height: 122px; padding: 13px; font: 11px/1.8 ui-monospace, SFMono-Regular, Menlo, monospace; }
.guide-select { display: flex; justify-content: space-between; align-items: center; min-height: 38px; padding: 0 12px; font-size: 11px; }
.guide-shot-actions { position: relative; display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.guide-shot-actions > span, .guide-shot-actions > strong { min-width: 86px; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: 6px; text-align: center; font-size: 10px; }
.guide-shot-actions > strong { border-color: var(--teal); color: #fff; background: var(--teal); }
.guide-pin { position: absolute; z-index: 3; right: -11px; top: -11px; display: grid; place-items: center; width: 25px; height: 25px; border: 3px solid #fff; border-radius: 50%; color: #fff; background: #f15b3d; box-shadow: 0 2px 8px rgba(150, 35, 18, .25); font-size: 10px; font-style: normal; }
.guide-metrics-mini { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.guide-metrics-mini div { display: grid; gap: 5px; padding: 11px; border: 1px solid var(--line); border-radius: 6px; }
.guide-metrics-mini div.active { border-color: var(--teal); background: var(--teal-soft); }
.guide-metrics-mini small { color: var(--muted); font-size: 8px; }
.guide-metrics-mini strong { font-size: 16px; }
.guide-bulk-mini { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 13px 0; padding: 8px; border: 1px solid #a9d7dc; border-radius: 6px; background: #eff9fa; font-size: 9px; }
.guide-bulk-mini > span:first-child { margin-right: auto; }
.guide-bulk-mini > span:nth-child(2) { padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.guide-bulk-mini > strong { padding: 8px 10px; border-radius: 4px; color: #fff; background: var(--teal); }
.guide-table-mini { border-top: 1px solid var(--line); font-size: 9px; }
.guide-table-mini > div { display: grid; grid-template-columns: 34px 1.4fr 1fr .8fr; gap: 8px; align-items: center; min-height: 43px; border-bottom: 1px solid var(--line); }
.guide-table-mini .head { min-height: 32px; color: var(--muted); font-size: 8px; font-weight: 700; }
.guide-table-mini span { position: relative; }
.guide-table-mini .ok { color: var(--green); }
.guide-shot--run > p { color: var(--muted); font-size: 9px; }
.guide-section--results { display: block; }
.guide-section--results .guide-copy { max-width: 650px; margin-bottom: 26px; }
.guide-result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.guide-result-grid article { padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.guide-result-grid article > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--teal); background: var(--teal-soft); font-size: 17px; }
.guide-result-grid h3 { margin: 16px 0 7px; font-size: 14px; }
.guide-result-grid p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.guide-metrics-roadmap { display: grid; grid-template-columns: minmax(260px, .8fr) 1.4fr; gap: 48px; margin-top: 24px; padding: 34px; border-radius: 14px; background: var(--surface); }
.guide-metrics-roadmap h2 { font-size: 28px; }
.guide-metrics-roadmap p { color: var(--muted); line-height: 1.6; }
.guide-metrics-roadmap ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
.guide-metrics-roadmap li { padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.guide-metrics-roadmap li strong, .guide-metrics-roadmap li span { display: block; }
.guide-metrics-roadmap li strong { margin-bottom: 5px; font-size: 12px; }
.guide-metrics-roadmap li span { color: var(--muted); font-size: 10px; line-height: 1.45; }

.participant-page { width: 100%; max-width: 1480px; margin: 0 auto; }
.participant-search-card { padding: 24px; border: 1px solid #cfe3e5; border-radius: 11px; background: linear-gradient(135deg, #f7fcfc 0%, #fff 58%); }
.participant-search-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 22px; }
.participant-kicker, .participant-card-heading span { color: var(--teal-dark); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.participant-search-intro h2 { margin: 5px 0 7px; font-size: 22px; letter-spacing: -.035em; }
.participant-search-intro p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.participant-search-intro p strong { color: var(--text); }
.participant-privacy { display: flex; align-items: center; flex: 0 0 auto; gap: 10px; max-width: 290px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.participant-privacy > span:first-child { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--green); background: #eaf8f0; }
.participant-privacy strong, .participant-privacy small { display: block; }
.participant-privacy strong { font-size: 11px; }
.participant-privacy small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.participant-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.participant-form .field { flex: 0 0 166px; }
.participant-form .participant-account-field { flex: 1 1 320px; }
.participant-form .participant-mode-field { flex-basis: 230px; }
.participant-form .participant-date-field { flex-basis: 148px; }
.participant-form .input, .participant-form .select { width: 100%; min-width: 0; }
.participant-form-actions { display: flex; align-items: center; gap: 5px; min-height: 38px; }
.participant-form-note { flex: 1 0 100%; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.participant-saved { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.participant-saved-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.participant-saved-heading h2 { margin: 3px 0 0; font-size: 14px; }
.participant-saved-heading > span { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; color: var(--teal-dark); background: var(--teal-soft); font-size: 9px; font-weight: 800; }
.participant-saved-empty { margin: 0; color: var(--muted); font-size: 9px; }
.participant-saved-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.participant-saved-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-width: 0; min-height: 50px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-align: left; cursor: pointer; }
.participant-saved-row:hover, .participant-saved-row.is-active { border-color: var(--teal); background: var(--teal-soft); }
.participant-saved-row .participant-avatar { width: 30px; height: 30px; font-size: 10px; }
.participant-saved-row strong, .participant-saved-row small { display: block; }
.participant-saved-row > span:nth-child(2) { min-width: 0; }
.participant-saved-row > span:nth-child(2) strong, .participant-saved-row > span:nth-child(2) small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.participant-saved-row strong { font-size: 9px; }
.participant-saved-row small, .participant-saved-row time { color: var(--muted); font-size: 7px; }
.participant-saved-row > span:nth-child(3) { text-align: right; }
.participant-results { display: grid; gap: 14px; margin-top: 14px; }
.participant-loading, .participant-welcome { display: grid; justify-items: center; place-content: center; min-height: 270px; padding: 36px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); text-align: center; }
.participant-loading { display: flex; align-items: center; justify-content: center; gap: 13px; }
.participant-loading .spinner { margin: 0; }
.participant-welcome > div { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px; border-radius: 50%; color: var(--teal); background: var(--teal-soft); font-size: 24px; }
.participant-welcome strong { color: var(--text); font-size: 15px; }
.participant-welcome p { max-width: 520px; margin: 7px 0 0; font-size: 11px; line-height: 1.55; }
.participant-coverage { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.participant-coverage--warning { border-color: #efd3a5; background: var(--amber-soft); }
.participant-coverage--success { border-color: #bfe2ce; background: #f4fbf7; }
.participant-coverage-icon { display: grid; place-items: center; flex: 0 0 27px; width: 27px; height: 27px; border-radius: 50%; color: #fff; background: var(--green); font-size: 12px; font-weight: 800; }
.participant-coverage--warning .participant-coverage-icon { background: var(--amber); }
.participant-coverage strong { font-size: 11px; }
.participant-coverage p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.participant-inline-warning { padding: 10px 13px; border: 1px solid #efd3a5; border-radius: 8px; color: #8a4b08; background: var(--amber-soft); font-size: 10px; line-height: 1.5; }
.participant-state { padding: 28px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.participant-state > strong { font-size: 17px; }
.participant-state > p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.participant-state > small { display: block; margin-top: 12px; color: #8a4b08; }
.participant-state--error { border-color: #efc5c2; background: var(--red-soft); }
.participant-candidates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 20px; }
.participant-candidate { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 58px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: left; cursor: pointer; }
.participant-candidate:hover { border-color: var(--teal); background: var(--teal-soft); }
.participant-candidate strong, .participant-candidate small { display: block; }
.participant-candidate strong { font-size: 12px; }
.participant-candidate small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.participant-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--teal-dark); background: var(--teal-soft); font-size: 12px; font-weight: 800; }
.participant-avatar--large { width: 44px; height: 44px; font-size: 16px; }
.participant-profile { display: grid; grid-template-columns: minmax(220px, .65fr) minmax(520px, 1.8fr) auto; gap: 16px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.participant-profile-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.participant-profile-person strong, .participant-profile-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.participant-profile-person strong { font-size: 14px; }
.participant-profile-person small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.participant-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-left: 1px solid var(--line); }
.participant-summary > div { display: grid; gap: 5px; min-width: 0; padding: 4px 13px; }
.participant-summary > div + div { border-left: 1px solid var(--line); }
.participant-summary span { color: var(--muted); font-size: 8px; }
.participant-summary strong { overflow: hidden; font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.participant-refresh-button { white-space: nowrap; }
.participant-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.participant-tabs button { min-height: 38px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.participant-tabs button.is-active { border-color: var(--teal); color: var(--teal-dark); }
.participant-tabs span { margin-left: 4px; padding: 2px 5px; border-radius: 9px; background: var(--surface); font-size: 8px; }
.participant-message-list { display: grid; gap: 5px; }
.participant-message { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, auto); align-items: center; gap: 14px; min-width: 0; min-height: 42px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.participant-message-text { min-width: 0; overflow: hidden; padding: 3px 4px; border: 0; color: #273244; background: transparent; font-size: 10px; line-height: 1.45; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.participant-message-text:hover { color: var(--teal-dark); }
.participant-message.is-expanded { align-items: start; }
.participant-message.is-expanded .participant-message-text { overflow: visible; white-space: pre-wrap; overflow-wrap: anywhere; }
.participant-message-meta { display: flex; align-items: center; justify-content: flex-end; gap: 9px; min-width: 0; }
.participant-message-meta button { max-width: 150px; overflow: hidden; padding: 0; border: 0; color: var(--teal-dark); background: transparent; font-size: 8px; font-weight: 750; text-align: right; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.participant-message-meta time { flex: 0 0 auto; color: var(--muted); font-size: 8px; white-space: nowrap; }
.participant-message-meta a { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; color: var(--teal-dark); background: var(--teal-soft); font-size: 10px; font-weight: 800; text-decoration: none; }
.participant-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 16px 0 0; }
.participant-pagination span { color: var(--muted); font-size: 10px; }
.participant-analysis-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.participant-analysis-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.participant-analysis-card--wide { grid-column: 1 / -1; }
.participant-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.participant-card-heading h3 { margin: 4px 0 0; font-size: 15px; }
.participant-card-heading > small { color: var(--muted); font-size: 9px; }
.participant-daily-bars { display: flex; align-items: flex-end; gap: 3px; height: 105px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.participant-daily-bars > span { flex: 1 1 6px; min-width: 3px; max-width: 18px; border-radius: 3px 3px 0 0; background: var(--teal); opacity: .8; }
.participant-daily-bars > span:hover { opacity: 1; }
.participant-analysis-card--activity > p { margin: 8px 0 0; color: var(--muted); font-size: 8px; }
.participant-ranked-list { border-top: 1px solid var(--line); }
.participant-ranked-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; width: 100%; gap: 12px; min-height: 45px; padding: 7px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.participant-ranked-row:hover strong { color: var(--teal-dark); }
.participant-ranked-row strong, .participant-ranked-row small { display: block; }
.participant-ranked-row strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.participant-ranked-row small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.participant-ranked-row > span:last-child { color: var(--text); font-size: 12px; font-weight: 750; text-align: right; }
.participant-theme { display: grid; gap: 6px; margin-bottom: 11px; }
.participant-theme > div:first-child { display: flex; justify-content: space-between; gap: 14px; }
.participant-theme strong { font-size: 10px; }
.participant-theme span { color: var(--muted); font-size: 8px; }
.participant-theme > div:last-child { height: 4px; overflow: hidden; border-radius: 3px; background: var(--surface-strong); }
.participant-theme i { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: var(--teal); }
.participant-terms { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.participant-terms span { padding: 5px 7px; border-radius: 13px; color: var(--muted); background: var(--surface); font-size: 8px; }
.participant-terms b { color: var(--text); }
.participant-question-grid { display: grid; grid-template-columns: 1fr; gap: 5px; }
.participant-question-grid .participant-message { background: var(--surface); }
.participant-muted { color: var(--muted); font-size: 10px; line-height: 1.5; }

.participant-refresh-form { padding-bottom: 22px; }
.participant-refresh-period { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.participant-refresh-source-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 16px; margin-top: 18px; }
.participant-refresh-source-heading > strong { padding-bottom: 11px; color: var(--teal-dark); font-size: 10px; }
.participant-refresh-source-list { max-height: 350px; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; overflow: auto; }
.participant-refresh-source { display: grid; grid-template-columns: 18px 30px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 48px; padding: 6px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.participant-refresh-source:last-child { border-bottom: 0; }
.participant-refresh-source:hover, .participant-refresh-source.is-selected { background: var(--teal-soft); }
.participant-refresh-source .participant-avatar { width: 30px; height: 30px; font-size: 10px; }
.participant-refresh-source strong, .participant-refresh-source small { display: block; }
.participant-refresh-source strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.participant-refresh-source small, .participant-refresh-source time { color: var(--muted); font-size: 8px; }
.participant-refresh-source time { white-space: nowrap; }
.participant-refresh-note { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 10px; }
.toast { width: min(360px, calc(100vw - 44px)); padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--teal); background: #fff; box-shadow: var(--shadow); border-radius: 7px; font-size: 13px; animation: toast-in 180ms ease both; }
.toast.error { border-left-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--surface); }
.login-panel { width: min(420px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 16px 50px rgba(16, 24, 39, .08); }
.login-panel h1 { margin: 0 0 10px; font-size: 26px; letter-spacing: -.035em; }
.login-panel > p { color: var(--muted); line-height: 1.6; }
.login-panel .field + .field { margin-top: 12px; }
.login-panel .field > input { width: 100%; }
.login-panel .field > input:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.login-panel > .form-error { color: var(--red); }

@media (max-width: 1240px) {
  .source-filter-toolbar .toolbar-controls { max-width: 820px; display: flex; flex-wrap: wrap; }
  .source-filter-toolbar .search { flex: 1 1 170px; width: 170px; max-width: 210px; }
  #source-type-filter { width: 96px; }
  #source-account-filter { width: 124px; }
  #source-category-filter { width: 118px; }
  #source-access-filter { width: 138px; }
  #source-activity-filter { width: 148px; }
  #source-filter { width: 150px; }
  .source-result-count { flex: 1 0 100%; width: 100%; }
  .source-bulk-actions { flex-wrap: wrap; }
}

@media (max-width: 1100px) {
  :root { --sidebar: 76px; }
  .brand { justify-content: center; padding: 0; }
  .brand > span:last-child, .nav-item > span:last-child, .sidebar-footer span:last-child { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item::before { left: 6px; }
  .sidebar-footer { justify-content: center; padding: 20px 0 34px; }
  .overview-grid { grid-template-columns: 1fr; }
  .dashboard-grid--top, .dashboard-grid--bottom { grid-template-columns: 1fr; }
  .dashboard-card + .dashboard-card { border-left: 0; border-top: 1px solid var(--line); }
  .panel + .panel { border-left: 0; border-top: 1px solid var(--line); }
  .attention-table th:nth-child(4), .attention-table td:nth-child(4) { display: none; }
  .source-metric-group { grid-template-columns: 1fr; padding: 7px 0; }
  .source-metric-heading { display: flex; align-items: baseline; justify-content: space-between; padding: 0 12px 5px; }
  .source-stats, .source-stats--activity, .source-stats--modes { grid-template-columns: repeat(4, minmax(105px, 1fr)); }
  .job-layout { grid-template-columns: 300px minmax(0, 1fr); }
  .job-facts { grid-template-columns: repeat(2, 1fr); }
  .job-facts > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .job-facts > div:nth-child(4) { border-top: 1px solid var(--line); }
  .guide-section { grid-template-columns: 1fr; gap: 34px; }
  .participant-saved-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .participant-profile { grid-template-columns: 1fr; }
  .participant-summary { border-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
  .guide-section--reverse .guide-copy, .guide-section--reverse .guide-shot { order: initial; }
}

@media (max-width: 980px) {
  .topbar--sources { align-items: stretch; flex-direction: column; gap: 12px; padding-block: 18px; }
  .topbar--sources .topbar-actions { justify-items: start; }
  .source-topbar-note { text-align: left; }
  .source-topbar-buttons { flex-wrap: wrap; justify-content: flex-start; }
}

@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  .app-shell { display: block; padding-bottom: 68px; }
  .sidebar { position: fixed; inset: auto 0 0; width: 100%; height: 64px; border: 1px solid var(--line); }
  .brand, .sidebar-footer { display: none; }
  .nav { grid-template-columns: repeat(9, 1fr); height: 100%; gap: 0; }
  .nav-item { min-height: 62px; padding: 0; }
  .nav-item::before { left: 25%; right: 25%; top: 0; width: auto; height: 3px; }
  .nav-item.is-active::before { height: 3px; }
  .nav-icon { font-size: 18px; }
  .workspace { width: 100%; }
  .topbar { min-height: 104px; padding: 18px 18px; }
  .topbar--dashboard { align-items: stretch; flex-direction: column; }
  .topbar--dashboard .dashboard-topbar-controls { justify-items: stretch; }
  .topbar--dashboard .dashboard-topbar-controls > span { display: none; }
  .topbar-actions .button--secondary:not(.help-button):not(.results-button) { display: none; }
  .topbar--sources .source-topbar-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .topbar--sources .source-topbar-buttons .button,
  .topbar--sources .source-topbar-buttons .button.button--secondary { display: inline-flex; width: 100%; }
  .topbar--sources .source-topbar-buttons #run-analysis { grid-column: 1 / -1; }
  .source-freshness { align-items: flex-start; }
  .source-freshness > div { display: grid; justify-items: end; }
  .topbar h1 { font-size: 27px; }
  .topbar p { font-size: 12px; }
  .button { padding: 0 12px; }
  .status-rail { grid-template-columns: 1fr; }
  .status-cell { padding: 18px; }
  .status-cell + .status-cell { border-left: 0; border-top: 1px solid var(--line); }
  .panel, .sources-section, .page { padding-left: 18px; padding-right: 18px; }
  .overview-grid { display: block; }
  .dashboard-page { padding: 0 0 24px; }
  .dashboard-toolbar { align-items: stretch; flex-direction: column; gap: 14px; }
  .dashboard-periods { width: 100%; overflow-x: auto; }
  .dashboard-period-button { flex: 1 0 auto; }
  .dashboard-card { padding: 22px 18px; }
  .dashboard-grid--top .dashboard-card, .dashboard-grid--bottom .dashboard-card { min-height: 0; }
  .dashboard-dialogs-body { grid-template-columns: 1fr; }
  .dashboard-donut-wrap { width: 100%; }
  .dashboard-message-metrics { grid-template-columns: 1fr; }
  .dashboard-message-metrics > div { min-height: 62px; }
  .dashboard-message-metrics > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .dashboard-freshness { align-items: flex-start; flex-direction: column; }
  .dashboard-freshness small { text-align: left; }
  .dashboard-created-grid { grid-template-columns: 1fr; }
  .created-sources-summary { grid-template-columns: 1fr; }
  .created-sources-summary > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .created-sources-controls { grid-template-columns: 1fr; }
  .created-sources-tabs { overflow-x: auto; }
  .created-sources-tabs button { flex: 1 0 auto; }
  .created-sources-list-head { display: none; }
  .created-sources-page-heading { align-items: stretch; flex-direction: column; }
  .created-source-row { grid-template-columns: 32px minmax(0, 1fr) 115px 10px; padding-inline: 10px; }
  .created-source-type, .created-source-members { display: none; }
  .table-scroll { overflow-x: auto; margin-right: -18px; }
  .attention-table, .data-table { min-width: 720px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-controls { flex-direction: column; }
  .source-filter-toolbar { display: flex; align-items: stretch; flex-direction: column; }
  .source-filter-toolbar .toolbar-controls { display: flex; }
  .source-result-count { width: 100%; min-width: 0; margin-left: 0; text-align: left; }
  .search, .select, .input { width: 100%; min-width: 0; }
  .source-stats, .source-stats--activity, .source-stats--modes { grid-template-columns: repeat(2, 1fr); }
  .source-metric-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .source-results-callout { align-items: stretch; flex-direction: column; }
  .source-results-callout > div:last-child { display: grid; grid-template-columns: 1fr 1fr; }
  .source-bulk-bar, .source-bulk-actions { align-items: stretch; flex-direction: column; }
  .source-bulk-actions .button, .source-bulk-actions .select { width: 100%; }
  .list-row { grid-template-columns: 1fr; gap: 10px; }
  .list-row-actions { justify-content: flex-start; }
  .digest-grid { grid-template-columns: 1fr; }
  .digest-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; overflow: auto; }
  .job-summary { grid-template-columns: repeat(2, 1fr); }
  .job-summary > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .job-summary > div:nth-child(4) { border-top: 1px solid var(--line); }
  .job-layout { grid-template-columns: 1fr; }
  .job-list-panel { max-height: 330px; border-right: 0; border-bottom: 1px solid var(--line); }
  .job-detail { padding: 24px 18px 34px; }
  .job-stage-line span { font-size: 8px; }
  .job-result-heading { align-items: flex-start; flex-direction: column; }
  .settings-grid { grid-template-columns: 1fr; }
  .participant-search-card { padding: 18px; }
  .participant-search-intro { flex-direction: column; }
  .participant-privacy { max-width: none; width: 100%; }
  .participant-form .field, .participant-form .participant-account-field, .participant-form .participant-mode-field, .participant-form .participant-date-field { flex: 1 0 100%; }
  .participant-form-actions { width: 100%; }
  .participant-form-actions .button--primary { flex: 1; }
  .participant-saved-list { grid-template-columns: 1fr; }
  .participant-saved-row { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .participant-saved-row > time { display: none; }
  .participant-candidates { grid-template-columns: 1fr; }
  .participant-summary { grid-template-columns: repeat(2, 1fr); }
  .participant-summary > div { min-height: 48px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
  .participant-summary > div:nth-child(odd) { border-left: 0; }
  .participant-analysis-grid, .participant-question-grid { grid-template-columns: 1fr; }
  .participant-analysis-card--wide { grid-column: auto; }
  .participant-refresh-button { width: 100%; }
  .participant-message { grid-template-columns: 1fr; gap: 3px; }
  .participant-message-meta { flex-flow: row wrap; justify-content: flex-start; gap: 7px; padding: 0 4px 2px; }
  .participant-message-meta button { max-width: 46vw; text-align: left; }
  .participant-refresh-period { grid-template-columns: 1fr; }
  .participant-refresh-source { grid-template-columns: 18px 30px minmax(0, 1fr); }
  .participant-refresh-source > time { display: none; }
  .modal-actions { flex-direction: column-reverse; align-items: stretch; }
  .modal-actions .button { width: 100%; }
  .source-preview-actions { align-items: stretch; flex-direction: column; }
  .source-preview-actions > div { align-items: stretch; flex-direction: column; }
  .source-preview-actions .button { width: 100%; }
  .chat-message { width: 92%; }
  .leave-summary { grid-template-columns: 1fr; }
  .leave-summary > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .guide-hero { align-items: flex-start; flex-direction: column; padding: 24px; }
  .guide-steps { grid-template-columns: repeat(2, 1fr); }
  .guide-section { padding: 40px 0; }
  .guide-shot { padding: 18px; }
  .guide-result-grid { grid-template-columns: repeat(2, 1fr); }
  .guide-metrics-roadmap { grid-template-columns: 1fr; padding: 24px; }
}

@media (max-width: 460px) {
  .topbar-actions { gap: 6px; }
  .help-button { width: 42px; padding: 0; font-size: 0; }
  .help-button span { font-size: 14px; }
  .results-button { width: 42px; padding: 0; font-size: 0; }
  .results-button span { font-size: 14px; }
  #run-analysis { padding: 0 10px; font-size: 11px; }
  .dashboard-card-heading { align-items: flex-start; flex-direction: column; }
  .dashboard-card-heading .button { width: 100%; }
  .guide-steps, .guide-result-grid, .guide-metrics-roadmap ul { grid-template-columns: 1fr; }
}

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