:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #18202f;
  --muted: #667085;
  --line: #dde3ea;
  --blue: #2563eb;
  --green: #17803d;
  --amber: #b35b00;
  --red: #c83333;
  --shadow: 0 14px 40px rgba(25, 35, 55, 0.08);
}

.action-required-inputs,
.action-ready-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.55;
}

.action-required-inputs {
  display: grid;
  gap: 3px;
  color: #8a4b08;
  background: #fff8e8;
  border: 1px solid #f3d397;
}

.action-required-inputs span {
  color: #72522a;
}

.action-ready-note {
  color: #14733b;
  background: #edf9f1;
  border: 1px solid #bce5ca;
}

.detail-required-card {
  border-color: #f0cf8d !important;
  background: #fffaf0;
}

.detail-required-card p {
  margin: 0 0 10px;
  color: var(--muted);
}

.detail-required-card ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 7px;
}

.detail-ready-card {
  border-color: #bde2c8 !important;
  background: #f1faf4;
}

.detail-ready-card p {
  margin: 0;
  color: #24633b;
}

.ads-mode { padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.ads-mode.mock { background: #fff4d6; color: #8a5b00; }
.ads-mode.live { background: #dcfce7; color: #166534; }
.ads-query-grid { grid-template-columns: 1.2fr 1fr 1fr auto; align-items: end; }
.ads-json, .ads-proposal pre { max-height: 360px; overflow: auto; padding: 14px; border-radius: 10px; background: #0f172a; color: #dbeafe; white-space: pre-wrap; }
.ads-findings, .ads-proposals { display: grid; gap: 12px; }
.ads-finding, .ads-proposal { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.ads-finding p { margin: 8px 0 12px; }
@media (max-width: 900px) { .ads-query-grid { grid-template-columns: 1fr; } }
.analysis-compare { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin: 12px 0; }
.analysis-compare article { display: grid; gap: 5px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.analysis-compare article b { font-size: 24px; color: #175cd3; }
.analysis-compare article span { color: #667085; font-size: 12px; line-height: 1.5; }
.sync-status-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 14px; }
.sync-status-grid span { display: grid; gap: 4px; padding: 10px; border-radius: 10px; background: #f8fafc; font-size: 12px; }
.snapshot-list { display: grid; gap: 5px; margin-top: 10px; font-size: 12px; color: #667085; }
@media (max-width: 900px) { .analysis-compare, .sync-status-grid { grid-template-columns: 1fr; } }

/* Customer-first Google Ads workspace */
.analyze-flow-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(620px, 1.42fr);
  gap: 20px;
  align-items: start;
}

.customer-workspace-bar {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(420px, 1.3fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid #cfe0ff;
  border-radius: 14px;
  background: linear-gradient(110deg, #f7faff, #fff);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.06);
}

.customer-workspace-bar > div {
  display: grid;
  gap: 3px;
}

.customer-workspace-bar > div span,
.customer-workspace-bar small {
  color: var(--muted);
  font-size: 12px;
}

.customer-workspace-bar > div strong {
  font-size: 18px;
}

.customer-workspace-bar nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: #edf2f8;
}

.customer-workspace-bar nav button {
  min-height: 38px;
  background: transparent;
  color: #526174;
  box-shadow: none;
}

.customer-workspace-bar nav button:hover:not(:disabled) {
  transform: none;
  background: rgba(255,255,255,.7);
  box-shadow: none;
}

.customer-workspace-bar nav button.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 4px 12px rgba(31,42,61,.1);
}

.workspace-picker {
  display: grid;
  gap: 22px;
}

.account-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.refresh-running {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #b8d4ff;
  border-radius: 12px;
  background: #f4f8ff;
  color: #234a83;
}

.refresh-running div {
  display: grid;
  gap: 3px;
}

.refresh-running p {
  margin: 0;
  color: #5d7394;
  font-size: 13px;
}

.refresh-spinner {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 3px solid #cbdcff;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: account-refresh-spin .8s linear infinite;
}

@keyframes account-refresh-spin { to { transform: rotate(360deg); } }

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.source-explainer,
.demo-notice {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid #f1d795;
  border-radius: 10px;
  background: #fffaf0;
  color: #714a00;
}

.source-explainer span,
.demo-notice span {
  font-size: 13px;
  line-height: 1.55;
}

.demo-notice {
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.toggle-stack {
  display: grid;
  gap: 8px;
}

.toggle-row {
  display: grid !important;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  cursor: pointer;
}

.toggle-row input[type="checkbox"] {
  appearance: none;
  width: 36px !important;
  min-height: 22px !important;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background .18s ease;
}

.toggle-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15,23,42,.22);
  transition: transform .18s ease;
}

.toggle-row input[type="checkbox"]:checked { background: var(--blue); }
.toggle-row input[type="checkbox"]:checked::after { transform: translateX(14px); }
.toggle-row input[type="checkbox"]:focus-visible { outline: 3px solid rgba(37,99,235,.22); outline-offset: 2px; }

.toggle-row > span {
  display: grid;
  gap: 3px;
}

.toggle-row small {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.45;
}

.snapshot-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.snapshot-details summary {
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.analysis-next-step {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin: 14px 0 18px;
  padding: 15px 16px;
  border: 1px solid #bce2c9;
  border-radius: 12px;
  background: #f0fbf4;
}

.analysis-next-step > div {
  display: grid;
  gap: 4px;
}

.analysis-next-step span {
  color: #49705a;
  font-size: 13px;
}

.metric-strip,
.review-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.metric-strip article,
.review-summary article,
.review-summary-card {
  display: grid;
  gap: 6px;
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color:inherit;
  text-align:left;
}

.metric-strip span,
.review-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-strip strong,
.review-summary strong {
  font-size: 24px;
  line-height: 1;
}

.metric-strip small {
  margin-top: auto;
  color: #98a2b3;
  font-size: 10px;
}

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

.review-summary small { color: var(--muted); }
.review-summary .attention { border-color: #f1d795; background: #fffaf0; }
.review-summary .attention strong { color: #a05a00; }
.review-summary-card { cursor:pointer; transition:border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.review-summary-card:hover { transform:translateY(-1px); border-color:#9eb8ef; box-shadow:0 8px 22px rgba(37,99,235,.09); }
.review-summary-card.active { border-color:var(--blue); box-shadow:0 0 0 2px rgba(37,99,235,.13); background:#f6f9ff; }
.review-summary-card.attention.active { border-color:#d89220; box-shadow:0 0 0 2px rgba(216,146,32,.14); }
.review-grid.single { grid-template-columns:1fr; }
.approval-batch-panel { margin-bottom:18px; padding:16px; border:1px solid #cfdcf3; border-radius:14px; background:linear-gradient(135deg,#f8fbff,#f5f8ff); }
.approval-batch-head { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; margin-bottom:12px; }
.approval-batch-head span { color:var(--blue); font-size:11px; font-weight:800; }
.approval-batch-head h2 { margin:3px 0; font-size:18px; }
.approval-batch-head p { margin:0; color:var(--muted); font-size:12px; }
.approval-batch-head-actions { display:flex; align-items:center; gap:8px; }
.approval-batch-head-actions > b { padding:6px 10px; border-radius:999px; background:#e8f0ff; color:#2457a6; font-size:12px; white-space:nowrap; }
.approval-batch-list { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.approval-batch-card { display:grid; gap:5px; min-height:118px; padding:14px; border:1px solid var(--line); border-radius:12px; background:#fff; color:var(--ink); text-align:left; scroll-snap-align:start; cursor:pointer; }
.approval-batch-card:hover { border-color:#9eb8ef; box-shadow:0 7px 20px rgba(37,99,235,.08); }
.approval-batch-card.active { border-color:var(--blue); box-shadow:0 0 0 2px rgba(37,99,235,.13); background:#f7faff; }
.approval-batch-card span { color:var(--blue); font-size:11px; font-weight:800; }
.approval-batch-card strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
.approval-batch-card small { color:var(--muted); }
.approval-batch-card em { margin-top:auto; color:#475467; font-size:11px; font-style:normal; }
.approval-batch-picker-modal { width:min(1080px,100%); max-height:calc(100vh - 32px); overflow:hidden; display:grid; grid-template-rows:auto minmax(0,1fr) auto; padding:20px; }
.approval-batch-picker-modal > .history-detail-head { margin:0 0 14px; }
.approval-batch-picker-list { min-height:0; overflow-y:auto; display:grid; gap:8px; padding:2px; }
.approval-batch-picker-row { display:grid; grid-template-columns:90px minmax(250px,1fr) 170px minmax(260px,.8fr); gap:14px; align-items:center; min-height:62px; padding:11px 14px; border:1px solid var(--line); border-radius:10px; background:#fff; color:var(--ink); text-align:left; }
.approval-batch-picker-row:hover { border-color:#9eb8ef; background:#f8fbff; }
.approval-batch-picker-row.active { border-color:var(--blue); box-shadow:0 0 0 2px rgba(37,99,235,.12); background:#f5f9ff; }
.approval-batch-picker-row > span:first-child { display:flex; align-items:center; gap:7px; }
.approval-batch-picker-row > span:first-child b { display:grid; place-items:center; width:26px; height:26px; border-radius:50%; background:#edf2f7; font-size:11px; }
.approval-batch-picker-row > span:first-child em { padding:3px 6px; border-radius:999px; background:#eef5ff; color:#2457a6; font-size:10px; font-style:normal; font-weight:800; }
.approval-batch-picker-row strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.approval-batch-picker-row small,.batch-picker-counts { color:var(--muted); font-size:11px; }
.batch-picker-counts { text-align:right; }
.approval-batch-picker-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; padding-top:14px; margin-top:12px; border-top:1px solid var(--line); color:var(--muted); font-size:12px; }
.approval-batch-picker-footer div { display:flex; gap:8px; }
.customer-policy-summary { display:flex; align-items:center; gap:10px; margin:-6px 0 18px; padding:10px 14px; border:1px solid var(--line); border-radius:10px; background:#f8fafc; color:var(--muted); font-size:12px; }
.customer-policy-summary b { color:var(--ink); }
.customer-policy-summary button { margin-left:auto; }

.customer-mapping-panel,.customer-risk-panel { margin:18px 0; padding:16px; border:1px solid var(--line); border-radius:12px; background:#f8fafc; }
.customer-mapping-panel > div:first-child span,.customer-risk-panel > div:first-child span,.form-section-title span { color:var(--blue); font-size:11px; font-weight:800; }
.customer-mapping-panel h3,.customer-risk-panel h3 { margin:4px 0; }
.customer-risk-panel p,.form-section-title p { margin:0; color:var(--muted); font-size:12px; }
.customer-mapping-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:12px; }
.customer-mapping-grid .profile-field { margin:0; background:#fff; }
.customer-risk-panel .risk-policy-grid { margin-top:14px; }
.form-section-title { margin:10px 0 0; padding-top:8px; border-top:1px solid var(--line); }
.form-section-title:first-of-type { border-top:0; }
.form-grid.three-cols { grid-template-columns:repeat(3,minmax(0,1fr)); }
.customer-form-risk { margin-bottom:8px; }

.account-explorer { padding: 0; overflow: hidden; }
.account-explorer-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  padding: 20px;
}
.account-explorer-head h2 { margin: 0 0 5px; }
.account-explorer-head p { margin: 0; color: var(--muted); font-size: 13px; }
.account-explorer-head > div > small { display: block; margin-top: 4px; color: #98a2b3; font-size: 11px; }
.compact-search { width: min(320px, 42%); font-size: 12px; }
.compact-search input { margin-top: 5px; }

.account-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 20px 12px;
  border-bottom: 1px solid var(--line);
}

.account-tabs button {
  flex: 0 0 auto;
  min-height: 36px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.account-tabs button span {
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #edf2f7;
  font-size: 11px;
}

.account-tabs button.active { background: #eef5ff; color: var(--blue); }
.account-tabs button:hover:not(:disabled) { transform: none; box-shadow: none; background: #f4f7fb; }

.account-records { display: grid; }
.account-record-card {
  display: grid;
  grid-template-columns: minmax(260px, 32%) minmax(0, 1fr) minmax(300px, 320px);
  gap: 18px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #edf0f4;
}
.account-record-card:last-child { border-bottom: 0; }
.account-record-card:hover { background: #fbfcfe; }
.record-main { display: grid; gap: 3px; min-width: 0; }
.record-main > span { color: var(--blue); font-size: 11px; font-weight: 800; }
.record-main strong { overflow-wrap: anywhere; }
.record-main small { color: var(--muted); }
.record-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(64px, 1fr));
  gap: 8px;
  min-width: 0;
}
.record-metrics span { display: grid; align-content: start; gap: 2px; min-width: 0; color: #344054; font-size: 13px; }
.record-metrics b { color: var(--muted); font-size: 11px; }
.record-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }

.empty-workspace,
.empty-inline {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 220px;
  text-align: center;
}
.empty-workspace h2, .empty-workspace p { margin: 0; }
.empty-workspace p, .empty-inline { color: var(--muted); }
.empty-workspace button { margin-top: 8px; }
.empty-inline { min-height: 160px; padding: 24px; }

.safety-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: #eaf7ef;
  color: #16723b;
  font-size: 12px;
  font-weight: 800;
}

.review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.review-column {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  overflow: hidden;
}

.action-column { background: #f7faff; border-color: #cfe0ff; }
.column-head { display: flex; justify-content: space-between; gap: 14px; padding: 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.82); }
.column-head h2, .column-head p { margin: 0; }
.column-head h2 { font-size: 18px; }
.column-head p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.column-head > span { align-self: start; padding: 4px 8px; border-radius: 999px; background: #edf2f7; color: var(--muted); font-size: 12px; font-weight: 800; }
.review-card-list { display: grid; gap: 10px; padding: 12px; max-height: calc(100vh - 320px); overflow-y: auto; }
.review-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(31,42,61,.04);
}
.review-card h3 { margin: 12px 0 6px; font-size: 16px; }
.review-card p { margin: 0; color: #475467; line-height: 1.6; }
.review-card-head, .card-foot, .proposal-meta, .card-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.source-chip, .status-chip, .risk-chip, .action-kind-chip, .category-chip { padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.source-chip { background: #eef5ff; color: #2457a6; }
.action-kind-chip.system { background:#e8f7ee; color:#18794e; }
.action-kind-chip.manual { background:#fff4e5; color:#9a5b00; }
.category-chip { background:#f1f5f9; color:#475569; }
.status-chip.pending { background: #fff3d6; color: #8b5600; }
.status-chip.approved { background: #e5f0ff; color: #1754a0; }
.status-chip.executed { background: #e5f7ec; color: #16723b; }
.status-chip.ignored { background: #f2f4f7; color: #667085; }
.status-chip.failed { background: #fff0f0; color: #b42318; }
.risk-chip { background: #f2f4f7; color: #667085; }
.risk-chip.high { background: #fff0f0; color: #b42318; }
.card-foot, .proposal-meta { margin-top: 13px; padding-top: 11px; border-top: 1px solid #edf0f4; color: var(--muted); font-size: 11px; }
.card-actions { justify-content: flex-end; margin-top: 14px; }

.unified-conclusions {
  margin: 16px 0 22px;
  padding: 20px;
  border: 1px solid #cfe0ff;
  border-radius: 14px;
  background: #f7faff;
}
.unified-conclusions-head { display:flex; justify-content:space-between; gap:16px; align-items:start; margin-bottom:14px; }
.unified-conclusions-head span { color:var(--blue); font-size:11px; font-weight:800; }
.unified-conclusions-head h3 { margin:4px 0; font-size:20px; }
.unified-conclusions-head p { margin:0; color:var(--muted); }
.unified-conclusions-head b { padding:7px 10px; border-radius:999px; background:#fff; color:var(--blue); }
.unified-conclusion-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.unified-conclusion-grid article { padding:14px; border:1px solid var(--line); border-radius:11px; background:#fff; }
.unified-conclusion-grid h4 { margin:10px 0 5px; }
.unified-conclusion-grid p { margin:0; color:#475467; line-height:1.55; }

.clickable { cursor:pointer; }
.clickable:hover { border-color:#9fc0f8; box-shadow:0 9px 24px rgba(37,99,235,.09); }
.approval-controls { display:grid; grid-template-columns:minmax(200px,.7fr) minmax(480px,1.3fr); gap:16px; align-items:end; margin-bottom:18px; }
.approval-controls h2,.approval-controls p { margin:0; }
.approval-controls p { margin-top:5px; color:var(--muted); font-size:13px; }
.risk-policy-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.risk-policy-grid label,.risk-filter,.log-filter-bar label { font-size:12px; color:var(--muted); }
.risk-policy-grid select,.risk-filter select,.log-filter-bar select { margin-top:5px; min-height:38px; }
.policy-safety-note { grid-column:1/-1; padding:9px 11px; border-radius:8px; background:#fff8e8; color:#805500; font-size:12px; }
.risk-filter { width:160px; }
.column-head:has(.risk-filter) { align-items:end; }
.approval-list-filters { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.action-mode-switch { display:flex; align-items:flex-end; gap:4px; }
.action-mode-switch button.active { background:#e8f0ff; color:#155eef; border-color:#9db8ff; }

.ads-detail-modal { width:min(1180px,calc(100vw - 32px)); height:min(880px,calc(100vh - 32px)); max-height:calc(100vh - 32px); display:grid; grid-template-rows:auto minmax(0,1fr) auto; overflow:hidden; padding:0; }
.ads-detail-modal header { position:relative; z-index:3; display:flex; justify-content:space-between; gap:16px; align-items:start; padding:20px 24px; border-bottom:1px solid var(--line); background:#fff; box-shadow:0 8px 20px rgba(15,23,42,.05); }
.ads-detail-modal header span { color:var(--blue); font-size:11px; font-weight:800; }
.ads-detail-modal header h2 { margin:5px 0 0; }
.ads-detail-body { min-height:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-content:start; gap:14px; padding:20px 24px; overflow-y:auto; overscroll-behavior:contain; }
.ads-detail-body section { padding:15px; border:1px solid var(--line); border-radius:10px; background:#fbfcfe; }
.ads-detail-body h3 { margin:0 0 8px; font-size:15px; }
.ads-detail-body p { margin:0; color:#475467; line-height:1.65; }
.ads-detail-modal footer { position:relative; z-index:3; display:flex; justify-content:flex-end; gap:8px; padding:14px 24px; border-top:1px solid var(--line); background:#fff; box-shadow:0 -8px 20px rgba(15,23,42,.05); }
.detail-data-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:0; }
.ads-detail-modal .detail-data-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.detail-data-grid div { padding:9px 10px; border-radius:8px; background:#fff; }
.detail-data-grid dt { color:var(--muted); font-size:11px; font-weight:700; }
.detail-data-grid dd { margin:4px 0 0; overflow-wrap:anywhere; }
.detail-note { margin-top:10px; color:var(--muted); font-size:12px; }
.business-detail-body { grid-template-columns:minmax(0,1fr); align-items:start; gap:12px; background:#f7f9fc; }
.business-detail-body section { padding:18px; background:#fff; }
.business-detail-body .detail-hero { grid-column:1/-1; padding:20px; border-color:#bed2f7; background:linear-gradient(135deg,#f7faff,#fff); }
.detail-status-row { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:14px; }
.business-detail-body .detail-hero h3 { color:#667085; font-size:12px; }
.detail-action-lead { color:#172033 !important; font-size:19px; font-weight:750; line-height:1.55 !important; }
.detail-hero small { display:block; margin-top:8px; color:#667085; line-height:1.5; }
.business-detail-list { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:0; }
.business-detail-list > div { min-width:0; padding:11px 12px; border:1px solid #edf0f4; border-radius:9px; background:#f8fafc; }
.business-detail-list dt { color:#7a8699; font-size:11px; font-weight:700; }
.business-detail-list dd { margin:5px 0 0; color:#1f2937; font-weight:650; line-height:1.45; overflow-wrap:anywhere; }
.detail-evidence-card .business-detail-list { grid-template-columns:repeat(4,minmax(0,1fr)); }
.detail-reason-card p { color:#344054; font-size:15px; line-height:1.75; }
.risk-explanation { margin-top:12px; padding:12px 13px; border-radius:9px; background:#fff8e8; }
.risk-explanation b { color:#925f00; font-size:12px; }
.risk-explanation p { margin-top:5px; color:#694b13; font-size:12px; line-height:1.6; }
.customer-context-details { margin-top:12px; border:1px solid #e3e9f2; border-radius:9px; background:#fbfcfe; }
.customer-context-details summary { padding:11px 13px; color:#475569; font-size:12px; font-weight:750; cursor:pointer; }
.customer-context-details p { padding:0 13px 13px; color:#64748b; font-size:12px; line-height:1.65; }
.detail-result-card { grid-column:1/-1; border-color:#bfe3ca !important; background:#f5fcf7 !important; }

.log-filter-bar { display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end; margin-bottom:14px; }
.log-filter-bar label { min-width:180px; }
.log-filter-custom { display:flex; flex-wrap:wrap; gap:12px; }
.log-filter-custom label { min-width:150px; }
.log-filter-bar input[type="date"] { width:100%; min-height:38px; margin-top:5px; }
.log-filter-count { margin-left:auto; padding:10px 12px; border-radius:9px; background:#f1f5f9; color:#475569; font-size:12px; font-weight:750; white-space:nowrap; }
.operation-log-list { display:grid; gap:10px; }
.operation-log-card { display:grid; grid-template-columns:150px minmax(0,1fr) auto; gap:18px; align-items:center; padding:16px 18px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.operation-log-card h3 { margin:5px 0; font-size:16px; }
.operation-log-card p { margin:0; color:var(--muted); }
.log-time { color:var(--muted); font-size:12px; }
.log-meta { display:flex; gap:8px; align-items:center; color:var(--muted); font-size:12px; }

@media (max-width: 1180px) {
  .analyze-flow-grid, .review-grid { grid-template-columns: 1fr; }
  .customer-workspace-bar { grid-template-columns: 1fr auto; }
  .customer-workspace-bar nav { grid-row: 2; grid-column: 1 / -1; }
  .account-record-card { grid-template-columns: minmax(220px, 34%) minmax(0, 1fr); }
  .record-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .approval-controls { grid-template-columns:1fr; }
  .approval-batch-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .approval-batch-picker-row { grid-template-columns:80px minmax(220px,1fr) 150px; }
  .batch-picker-counts { grid-column:2/-1; text-align:left; }
}

@media (max-width: 760px) {
  .approval-batch-list { grid-template-columns:1fr; }
  .approval-batch-head-actions { align-items:flex-start; }
  .approval-batch-picker-row { grid-template-columns:1fr; gap:5px; }
  .batch-picker-counts { grid-column:auto; }
  .customer-workspace-bar { grid-template-columns: 1fr; }
  .customer-workspace-bar nav { grid-row: auto; grid-column: auto; grid-template-columns: 1fr; }
  .metric-strip, .review-summary { grid-template-columns: repeat(2, 1fr); }
  .account-explorer-head { align-items: stretch; flex-direction: column; }
  .compact-search { width: 100%; }
  .demo-notice, .analysis-next-step { grid-template-columns: 1fr; display: grid; }
  .account-page-actions { justify-content: flex-start; }
  .unified-conclusion-grid,.risk-policy-grid,.detail-data-grid,.customer-mapping-grid,.form-grid.three-cols { grid-template-columns:1fr; }
  .operation-log-card { grid-template-columns:1fr; }
  .customer-policy-summary { align-items:flex-start; flex-wrap:wrap; }
  .customer-policy-summary button { margin-left:0; }
  .log-meta,.log-filter-bar { align-items:flex-start; flex-direction:column; }
  .log-filter-custom { width:100%; flex-direction:column; }
  .log-filter-bar label,.log-filter-custom label { width:100%; min-width:0; }
  .log-filter-count { margin-left:0; }
  .account-record-card { grid-template-columns: 1fr; }
  .record-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-actions { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .refresh-spinner { animation: none; }
}

* {
  box-sizing: border-box;
}

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

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

button {
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 650;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  word-break: keep-all;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
  background: #1d4ed8;
}

button.secondary {
  background: #eef2f7;
  color: var(--ink);
}

button.secondary:hover:not(:disabled) {
  background: #e1e8f0;
  box-shadow: 0 8px 18px rgba(31, 42, 61, 0.12);
}

button.danger {
  background: #fff1f1;
  color: var(--red);
}

button.danger:hover:not(:disabled) {
  background: #ffe3e3;
  box-shadow: 0 8px 18px rgba(200, 51, 51, 0.13);
}

button.mini {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.toast {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid #bfe5ce;
  border-radius: 8px;
  background: #eefaf3;
  color: #17663a;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.toast.error {
  border-color: #ffd0d0;
  background: #fff1f1;
  color: var(--red);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  padding: 8px 10px;
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

.shell {
  min-height: 100vh;
}

.topbar {
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: conic-gradient(from 180deg, #2563eb, #16a34a, #f59e0b, #e11d48, #2563eb);
}

.userbar {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 64px);
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 24px 16px;
  background: #fff;
}

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

.nav-group {
  margin: 12px 8px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.nav button {
  background: transparent;
  color: var(--muted);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav button.active {
  background: #eef5ff;
  color: var(--blue);
}

.content {
  padding: 28px;
  max-width: 1680px;
  width: 100%;
}

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 520px) 1fr;
  background: #fff;
}

.login-panel {
  padding: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}

.login-panel h1 {
  font-size: 34px;
  line-height: 1.1;
  margin: 28px 0 10px;
  letter-spacing: 0;
}

.login-visual {
  min-height: 100vh;
  background:
    linear-gradient(rgba(16, 24, 40, 0.24), rgba(16, 24, 40, 0.1)),
    url("https://images.unsplash.com/photo-1551288049-bebda4e38f71?auto=format&fit=crop&w=1800&q=80") center/cover;
  display: flex;
  align-items: flex-end;
  padding: 56px;
  color: #fff;
}

.visual-copy {
  max-width: 640px;
}

.visual-copy h2 {
  font-size: 52px;
  line-height: 1;
  margin: 0 0 16px;
  letter-spacing: 0;
}

.visual-copy p,
.muted {
  color: var(--muted);
}

.login-visual p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
}

.form {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

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

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

.tabs button {
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
}

.tabs button.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.return-banner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid #b8d4ff;
  border-radius: 8px;
  background: #f7fbff;
  padding: 13px 16px;
  margin-bottom: 18px;
}

.return-banner strong,
.return-banner span {
  display: block;
}

.return-banner strong {
  margin-bottom: 4px;
}

.return-banner span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.analysis-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
  min-width: 0;
}

.analysis-title h2 {
  margin: 0 0 6px;
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.18;
  font-size: clamp(20px, 2vw, 28px);
}

.analysis-title p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.analysis-title-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 460px;
}

.analysis-workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 0.55fr);
  gap: 14px;
  align-items: start;
  margin-top: 16px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: minmax(360px, 470px) minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

.analyze-source-panel {
  position: sticky;
  top: 88px;
  max-height: calc(100dvh - 104px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.analyze-sticky-head {
  position: sticky;
  top: 64px;
  z-index: 12;
  display: grid;
  gap: 12px;
  margin: -24px -24px 18px;
  padding: 24px 24px 12px;
  border-bottom: 1px solid rgba(221, 227, 234, 0.9);
  background: rgba(246, 247, 249, 0.96);
  backdrop-filter: blur(12px);
}

.analyze-sticky-head .analysis-title,
.analyze-sticky-head .report-toolbar {
  margin-bottom: 0;
}

.analyze-sticky-head .analysis-title {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.analyze-sticky-head .report-toolbar {
  border-color: #c7d8f5;
  box-shadow: 0 10px 28px rgba(25, 35, 55, 0.12);
}

.upload-box {
  border: 1px dashed #9fb1c7;
  border-radius: 8px;
  min-height: 210px;
  display: grid;
  place-items: center;
  padding: 26px;
  text-align: center;
  background: #fbfcfe;
}

.upload-box.dragging {
  border-color: var(--blue);
  background: #eef5ff;
}

.upload-box.compact {
  min-height: 156px;
  padding: 20px;
}

.report-source-panel {
  display: grid;
  gap: 14px;
  text-align: left;
}

.source-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  min-width: 0;
}

.source-head > div {
  min-width: 0;
}

.source-head h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.source-head p {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.source-head button {
  flex: 0 0 auto;
  width: 52px;
  padding: 0;
  white-space: nowrap;
}

.source-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f6f9;
  padding: 4px;
}

.source-tabs button {
  min-height: 36px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.source-tabs button:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: #fff;
}

.source-tabs button.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 6px 16px rgba(25, 35, 55, 0.08);
}

.analysis-source-form {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 16px;
  min-width: 0;
}

.analysis-source-form .upload-note {
  margin-top: 0;
}

.analysis-source-form .form-row {
  grid-template-columns: 1fr;
  gap: 10px;
}

.analysis-source-form .actions {
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.analysis-source-form.is-analyzing {
  gap: 12px;
  padding: 14px;
}

.analysis-running-summary {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.analysis-running-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.analysis-running-title > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.analysis-running-title strong {
  font-size: 16px;
}

.analysis-running-title small {
  color: var(--muted);
  line-height: 1.4;
}

.analysis-running-indicator {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.12);
}

.analysis-running-context {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.analysis-running-context span {
  min-width: 0;
  border: 1px solid #dce5f2;
  border-radius: 7px;
  background: #f8fbff;
  padding: 8px 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.analysis-running-context b {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 12px;
}

.upload-progress-host {
  height: clamp(220px, 31vh, 300px);
  min-height: 220px;
}

.upload-progress-host .progress-box {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin-top: 0;
  overflow: hidden;
}

.upload-progress-host .progress-box > p {
  min-height: 38px;
  line-height: 1.45;
}

.upload-progress-host .agent-progress-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.continuous-analysis-field {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid #dce5f2;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px 12px;
  color: var(--ink);
}

.continuous-analysis-field input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--blue);
}

.continuous-analysis-field span {
  display: grid;
  gap: 3px;
}

.continuous-analysis-field strong {
  font-size: 14px;
}

.continuous-analysis-field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.file-name {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--blue);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.upload-note {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  text-align: left;
  color: var(--ink);
  font-weight: 650;
}

.field-help {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
}

.customer-reference-card {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px;
  color: var(--ink);
}

.customer-reference-card strong {
  display: block;
  margin-bottom: 3px;
  font-size: 15px;
}

.customer-reference-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.customer-reference-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.customer-reference-card dl div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.customer-reference-card dt,
.customer-reference-card dd {
  margin: 0;
  min-width: 0;
  font-size: 12px;
  line-height: 1.55;
}

.customer-reference-card dt {
  color: var(--blue);
  font-weight: 800;
}

.customer-reference-card dd {
  color: #334155;
  overflow-wrap: anywhere;
}

.upload-note textarea {
  min-height: 132px;
  font-weight: 400;
  max-height: 280px;
}

.analyze-customer-step {
  display: grid;
  gap: 18px;
}

.step-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-head > span,
.step-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.step-head h2 {
  margin: 0 0 5px;
}

.step-head p {
  margin: 0;
}

.analyze-customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.analyze-customer-card {
  width: 100%;
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 15px;
  text-align: left;
  box-shadow: none;
  transform: none;
}

.analyze-customer-card:hover {
  border-color: var(--blue);
  background: #f7fbff;
  box-shadow: 0 10px 24px rgba(25, 35, 55, 0.08);
}

.analyze-customer-card strong {
  font-size: 17px;
  overflow-wrap: anywhere;
}

.analyze-customer-card span,
.analyze-customer-card p,
.analyze-customer-card em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
}

.analyze-customer-card em {
  margin-top: auto;
  color: var(--blue);
  font-weight: 750;
}

.active-customer-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(360px, 1.25fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid #b8d4ff;
  border-radius: 8px;
  background: #f7fbff;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.08);
}

.active-customer-panel h2 {
  margin: 8px 0 5px;
  font-size: 22px;
}

.active-customer-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.step-pill {
  width: auto;
  padding: 0 10px;
  background: var(--blue);
}

.active-customer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.active-customer-chips span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border: 1px solid #dbe7ff;
  border-radius: 999px;
  background: #fff;
  color: #344054;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  min-width: 0;
}

.active-customer-chips b {
  color: var(--blue);
  white-space: nowrap;
}

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

.active-customer-panel .actions button {
  white-space: nowrap;
}

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

.uploading-file {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px 14px;
  margin-top: 14px;
  text-align: left;
}

.uploading-file span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.uploading-file strong {
  display: block;
  color: var(--blue);
  overflow-wrap: anywhere;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
}

.overview-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.overview-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.overview-head h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.overview-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.overview-metrics {
  grid-template-columns: repeat(7, minmax(112px, 1fr));
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
  min-width: 0;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px;
}

.metric strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.metric em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.metric.status-good {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.metric.status-watch {
  border-color: #fde68a;
  background: #fffbeb;
}

.metric.status-risk {
  border-color: #fecaca;
  background: #fff1f2;
}

.b2b-diagnostics {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}

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

.diagnostic-head h4 {
  margin: 0;
  font-size: 15px;
}

.diagnostic-head span {
  color: var(--muted);
  font-size: 12px;
}

.priority-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.priority-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  min-width: 0;
}

.priority-action span {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 11px;
}

.priority-action.p0 span {
  background: #fee2e2;
  color: #b91c1c;
}

.priority-action.p1 span {
  background: #fef3c7;
  color: #92400e;
}

.priority-action.p2 span {
  background: #dcfce7;
  color: #166534;
}

.priority-action strong {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.priority-action p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.metric-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.report-toolbar {
  display: grid;
  grid-template-columns: minmax(150px, 0.28fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  margin-bottom: 16px;
}

.report-toolbar strong,
.report-toolbar span {
  display: block;
}

.report-toolbar-copy {
  min-width: 0;
  display: grid;
  align-content: center;
}

.report-toolbar span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  line-height: 1.35;
}

.report-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: center;
  gap: 8px;
  min-width: 0;
}

.report-toolbar-actions button {
  min-height: 36px;
  padding: 0 13px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.report-toolbar-actions button[title*="生成完整详细分析报告"],
.report-toolbar-actions button[title*="详细报告已生成"],
.report-toolbar-actions button[title*="正在生成详细分析报告"] {
  min-width: 128px;
}

.report-toolbar-actions .approval-toolbar-action {
  min-width: 108px;
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.2);
}

.report-toolbar-actions .approval-toolbar-action:hover {
  border-color: #173ea9;
  background: #173ea9;
}

.weekly-brief-before-report {
  margin-bottom: 18px;
  min-width: 0;
}

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

.weekly-brief-head h3 {
  margin: 0;
  font-size: 18px;
}

.weekly-brief-head span {
  color: var(--muted);
  font-size: 12px;
}

.wb-report {
  width: 100%;
  max-width: none;
  margin: 0;
  color: #1a202c;
  min-width: 0;
}

.wb-report-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: #fff;
  padding: 28px 30px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 12px 34px rgba(37, 99, 235, 0.14);
  min-width: 0;
}

.wb-report-header h1 {
  margin: 0 0 8px;
  font-size: clamp(23px, 2.2vw, 30px);
  line-height: 1.15;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.wb-report-header p {
  margin: 0;
  opacity: 0.92;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.wb-report-meta {
  display: flex;
  gap: 10px 22px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.wb-report-meta span {
  font-size: 13px;
  opacity: 0.92;
  overflow-wrap: anywhere;
}

.wb-section {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  min-width: 0;
}

.wb-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
  font-size: 19px;
}

.wb-section-title span {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 15px;
}

.wb-subheading {
  margin: 20px 0 10px;
  font-size: 15px;
}

.wb-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.wb-kpi {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 16px 12px;
  text-align: center;
  min-width: 0;
}

.wb-kpi span,
.wb-kpi em {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}

.wb-kpi strong {
  display: block;
  margin: 5px 0 3px;
  font-size: 23px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.wb-kpi.danger strong {
  color: #dc2626;
}

.wb-kpi.warning strong {
  color: #d97706;
}

.wb-kpi.success strong {
  color: #16a34a;
}

.wb-diagnostic-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 4px 0 16px;
}

.wb-diagnostic-strip div {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.wb-diagnostic-strip div.good {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.wb-diagnostic-strip div.watch {
  border-color: #fde68a;
  background: #fffbeb;
}

.wb-diagnostic-strip div.risk {
  border-color: #fecaca;
  background: #fff1f2;
}

.wb-diagnostic-strip span,
.wb-diagnostic-strip em {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}

.wb-diagnostic-strip strong {
  display: block;
  margin: 4px 0;
  font-size: 17px;
}

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

.trend-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  min-width: 0;
}

.trend-card.good {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.trend-card.watch {
  border-color: #fde68a;
  background: #fffbeb;
}

.trend-card.risk {
  border-color: #fecaca;
  background: #fff1f2;
}

.trend-card span,
.trend-card em {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.trend-card strong {
  display: block;
  margin: 5px 0;
  color: #18202f;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.trend-card.good strong {
  color: #16a34a;
}

.trend-card.watch strong {
  color: #d97706;
}

.trend-card.risk strong {
  color: #dc2626;
}

.trend-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 12px 0 16px;
}

.trend-chart {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.trend-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.trend-chart-head strong {
  font-size: 14px;
}

.trend-chart-head span {
  color: #64748b;
  font-size: 12px;
}

.trend-chart svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 180px;
}

.trend-legend {
  display: flex;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.trend-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.trend-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.wb-alert {
  border-left: 4px solid #0891b2;
  border-radius: 8px;
  background: #ecfeff;
  padding: 14px 16px;
  margin: 12px 0;
}

.wb-alert strong,
.wb-alert p {
  display: block;
  margin: 0;
}

.wb-alert strong {
  color: #0e7490;
  margin-bottom: 5px;
}

.wb-alert p {
  color: #334155;
  font-size: 13.5px;
  line-height: 1.65;
}

.wb-alert.danger {
  border-color: #dc2626;
  background: #fee2e2;
}

.wb-alert.danger strong {
  color: #b91c1c;
}

.wb-alert.warning {
  border-color: #d97706;
  background: #fef3c7;
}

.wb-alert.warning strong {
  color: #92400e;
}

.wb-table-wrap {
  overflow-x: auto;
  margin: 10px 0;
}

.wb-search-term-scroll,
.wb-keyword-scroll {
  max-height: 560px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.wb-search-term-scroll .wb-table-wrap,
.wb-keyword-scroll .wb-table-wrap {
  margin: 0;
}

.wb-search-term-scroll .wb-table th,
.wb-keyword-scroll .wb-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.wb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.wb-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  text-align: left;
  padding: 9px 10px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.wb-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}

.wb-table tr:hover td {
  background: #f8fafc;
}

.wb-row-danger td {
  background: #fff1f2;
}

.wb-row-warning td {
  background: #fffbeb;
}

.wb-row-success td {
  background: #f0fdf4;
}

.wb-neg-list,
.wb-suggestion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 9px;
  margin: 10px 0;
}

.wb-neg-list div,
.wb-suggestion-grid div {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}

.wb-neg-list strong,
.wb-neg-list span,
.wb-suggestion-grid strong,
.wb-suggestion-grid span {
  display: block;
  overflow-wrap: anywhere;
}

.wb-neg-list span,
.wb-suggestion-grid span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.wb-suggestion {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.wb-summary-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.wb-summary-counts span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dbe4ef;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.wb-summary-counts .p0 {
  color: #b91c1c;
  background: #fff1f2;
}

.wb-summary-counts .p1 {
  color: #9a5800;
  background: #fffbeb;
}

.wb-summary-counts .p2 {
  color: #0e7490;
  background: #ecfeff;
}

.wb-customer-report {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.wb-customer-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid #dbe4ef;
  background: #fff;
}

.wb-customer-report-head strong,
.wb-customer-report-head span {
  display: block;
}

.wb-customer-report-head span {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
}

.wb-customer-report pre {
  max-height: 520px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  color: #1e293b;
  font: inherit;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.wb-suggestion div {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.wb-suggestion span,
.wb-priority {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 9px;
  border-radius: 6px;
  background: #0891b2;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.wb-suggestion.p0 span,
.wb-priority.p0 {
  background: #dc2626;
}

.wb-suggestion.p1 span,
.wb-priority.p1 {
  background: #d97706;
}

.wb-suggestion.p2 span,
.wb-priority.p2 {
  background: #0891b2;
}

.trend-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 96px;
  border-radius: 999px;
  padding: 0 8px;
  background: #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.trend-tag.good {
  background: #dcfce7;
  color: #166534;
}

.trend-tag.watch {
  background: #fef3c7;
  color: #92400e;
}

.trend-tag.risk {
  background: #fee2e2;
  color: #b91c1c;
}

.trend-tag.neutral {
  background: #eaf2ff;
  color: #1d4ed8;
}

.wb-suggestion strong {
  overflow-wrap: anywhere;
}

.wb-suggestion p {
  margin: 5px 0 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.6;
}

.wb-muted {
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.wb-report-footer {
  text-align: center;
  color: #64748b;
  font-size: 13px;
  padding: 20px 0 8px;
}

.wb-report-footer p {
  margin: 4px 0;
}

.ai-panel {
  border: 1px solid #b8d4ff;
  border-radius: 8px;
  background: #f4f8ff;
  padding: 16px;
  margin-bottom: 2px;
  min-width: 0;
  overflow: visible;
}

.ai-panel.warning {
  border-color: #ffd89c;
  background: #fff8eb;
}

.report-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.report-tabs.detail-title {
  margin-top: 16px;
}

.report-tab {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.customer-context {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.customer-context h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.customer-context p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-wrap;
}

.ai-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  min-width: 0;
}

.ai-head h3 {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ai-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 9px;
}

.ai-text {
  line-height: 1.7;
  color: #233047;
  overflow-wrap: anywhere;
}

.ai-sections {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.ai-section {
  border-top: 1px solid rgba(37, 99, 235, 0.16);
  padding-top: 12px;
}

.ai-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.ai-section h4 {
  margin: 0 0 8px;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.ai-section p {
  margin: 6px 0;
  color: #273549;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.ai-bullet {
  position: relative;
  padding-left: 18px;
}

.ai-bullet::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.progress-box {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  text-align: left;
}

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

.progress-head span {
  color: var(--blue);
  font-weight: 800;
}

.progress-track {
  height: 9px;
  background: #e8eef7;
  border-radius: 999px;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: inherit;
  transition: width 0.3s ease;
}

.progress-box p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.agent-progress-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.agent-progress-item {
  display: grid;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px 10px;
  text-align: left;
}

.agent-progress-item.ok {
  border-color: #bfe5ce;
  background: #f2fbf6;
}

.agent-progress-item.error {
  border-color: #ffd0d0;
  background: #fff6f6;
}

.agent-progress-item strong {
  font-size: 13px;
}

.agent-progress-item span,
.agent-progress-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.report-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  margin-top: 16px;
}

.analysis-workspace .report-grid {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.top-analysis {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

.top-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px 16px;
}

.top-card.muted-card {
  background: #fbfcfe;
}

.top-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.top-card h3 {
  margin: 0;
  font-size: 16px;
}

.top-card-head span {
  flex: 0 0 auto;
  max-width: 48%;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  overflow-wrap: anywhere;
}

.top-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.top-card-body {
  display: grid;
  grid-template-columns: minmax(220px, 0.36fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.chart-panel {
  min-height: 178px;
  border: 1px solid #edf1f6;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
}

.pie-chart {
  width: 150px;
  aspect-ratio: 1;
  overflow: visible;
}

.pie-slice {
  cursor: pointer;
  opacity: 0.82;
  transition: opacity 0.16s ease, transform 0.16s ease, filter 0.16s ease;
  transform-origin: 70px 70px;
}

.pie-slice:hover,
.pie-slice.active {
  opacity: 1;
  filter: drop-shadow(0 6px 10px rgba(15, 23, 42, 0.16));
}

.pie-center {
  max-width: 74px;
  fill: var(--ink);
  font-size: 9px;
  font-weight: 800;
}

.pie-sub {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.chart-legend {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}

.chart-legend button {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  min-height: 24px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: none;
  transform: none;
}

.chart-legend button:hover,
.chart-legend button.active {
  background: #eef5ff;
  border-color: #b8d4ff;
  color: var(--blue);
  box-shadow: none;
  transform: none;
}

.chart-legend i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.keyword-chart {
  align-content: start;
  justify-items: stretch;
  gap: 8px;
}

.keyword-bar {
  width: 100%;
  min-height: 24px;
  display: grid;
  grid-template-columns: minmax(62px, 0.8fr) minmax(80px, 1.2fr) minmax(48px, auto);
  gap: 8px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 3px 5px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: none;
  transform: none;
}

.keyword-bar:hover,
.keyword-bar.active {
  background: #eef5ff;
  border-color: #b8d4ff;
  box-shadow: none;
  transform: none;
}

.keyword-bar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #253043;
  font-weight: 700;
}

.keyword-bar div {
  height: 8px;
  border-radius: 999px;
  background: #e8eef7;
  overflow: hidden;
}

.keyword-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.keyword-bar em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

.chart-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfe;
}

.mini-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  align-self: start;
}

.mini-table th,
.mini-table td {
  border-bottom: 1px solid #edf1f6;
  padding: 9px 7px;
  font-size: 12px;
  text-align: right;
  vertical-align: middle;
}

.mini-table th:first-child,
.mini-table td:first-child {
  text-align: left;
  width: 26%;
}

.mini-table th {
  color: var(--muted);
  font-weight: 700;
}

.mini-table td {
  color: #253043;
}

.mini-table td:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.mini-table tbody tr {
  cursor: pointer;
}

.mini-table tbody tr:hover,
.mini-table tbody tr.active-row {
  background: #eef5ff;
}

.keyword-table th:first-child,
.keyword-table td:first-child {
  width: 30%;
}

.keyword-table td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rating {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid #d7dee8;
  background: #f3f6f9;
  color: var(--muted);
  padding: 0 8px;
  font-weight: 800;
}

.rating.good {
  border-color: #bfe5ce;
  background: #eefaf3;
  color: var(--green);
}

.rating.ok {
  border-color: #b8d4ff;
  background: #f4f8ff;
  color: var(--blue);
}

.rating.weak {
  border-color: #ffd89c;
  background: #fff8eb;
  color: var(--amber);
}

.selected-insight {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  border: 1px solid #dbe7ff;
  border-radius: 8px;
  background: #f7fbff;
  padding: 10px 12px;
  color: #344054;
  font-size: 12px;
}

.selected-insight strong {
  color: var(--ink);
  font-size: 13px;
}

.selected-insight span {
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e1e8f0;
  padding: 4px 8px;
}

.top-risk {
  margin-top: 10px !important;
  border-left: 3px solid var(--amber);
  background: #fff8eb;
  padding: 8px 10px;
  color: #614100 !important;
  font-size: 12px;
}

.translation-note {
  margin: 8px 0 0;
  border: 1px solid #ffd89c;
  border-radius: 8px;
  background: #fff8eb;
  color: #614100;
  padding: 9px 11px;
  font-size: 12px;
}

.report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.report-card h3 {
  margin: 0 0 12px;
}

.bars {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.9fr) 1.2fr minmax(88px, auto);
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.bar-label {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 9px;
  background: #e8eef7;
  border-radius: 999px;
  overflow: hidden;
}

.bar-track span {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
}

.bar-track.green span {
  background: var(--green);
}

.bar-value {
  color: var(--muted);
  white-space: nowrap;
}

.decision-list {
  display: grid;
  gap: 12px;
}

.decision-list strong {
  display: block;
  margin-bottom: 4px;
}

.decision-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.sheet {
  border-top: 1px solid var(--line);
  padding: 18px 0 2px;
}

.sheet:first-child {
  border-top: 0;
  padding-top: 0;
}

.sheet h3 {
  margin: 0 0 12px;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}

.chip {
  border-radius: 999px;
  background: #eef2f7;
  color: #344054;
  padding: 6px 10px;
  font-size: 12px;
}

.list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.list li {
  border-left: 3px solid var(--blue);
  padding: 8px 10px;
  background: #f8fbff;
}

.list.recommend li {
  border-left-color: var(--green);
  background: #f5fbf7;
}

.history-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) 1fr;
  gap: 18px;
  align-items: start;
}

.history-list {
  padding: 10px;
  display: grid;
  gap: 8px;
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 104px);
  overflow: auto;
  overscroll-behavior: contain;
}

.history-list-head {
  padding: 8px 8px 10px;
}

.history-list-head h2,
.history-list-head p {
  margin: 0;
}

.history-list-head h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.history-context-panel {
  margin-bottom: 16px;
}

.analysis-result-panel {
  min-width: 0;
  overflow: visible;
  padding: 24px;
}

.analyze-history-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.data-chain-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #dbe7ff;
  border-radius: 8px;
  background: #f7fbff;
  padding: 13px 14px;
}

.data-chain-summary strong,
.data-chain-summary span {
  display: block;
}

.data-chain-summary strong {
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.data-chain-summary span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.data-chain-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.data-chain-stats span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #344054;
  padding: 0 9px;
  font-weight: 750;
  white-space: nowrap;
}

.data-chain-stats span.success {
  border-color: #bfe5ce;
  background: #eefaf3;
  color: var(--green);
}

.data-chain-stats span.warning {
  border-color: #ffd89c;
  background: #fff8eb;
  color: var(--amber);
}

.data-period-list {
  position: relative;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.data-period-group {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.data-period-row {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: 84px 176px minmax(0, 1fr) 132px;
  gap: 14px;
  align-items: center;
  border: 1px solid #e0e7ef;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
  text-align: left;
  box-shadow: none;
  transform: none;
}

.data-period-row:hover {
  transform: none;
  box-shadow: none;
}

.data-period-row.filled {
  border-color: #d9ebe0;
  background: #f4faf6;
}

.data-period-row.filled:hover {
  background: #edf7f1;
}

.data-period-row.empty {
  background: #f5f6f8;
  border-style: dashed;
  color: #596579;
}

.data-period-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.data-period-status span {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #cbd5e1;
}

.data-period-row.filled .data-period-status span {
  background: var(--green);
  box-shadow: 0 0 0 4px #e3f4e8;
}

.data-period-status strong {
  color: #475569;
  font-size: 12px;
  white-space: nowrap;
}

.data-period-row.filled .data-period-status strong {
  color: var(--green);
}

.data-period-range,
.data-period-main {
  min-width: 0;
}

.data-period-range strong,
.data-period-range span,
.data-period-main strong,
.data-period-main span,
.data-period-row em {
  display: block;
}

.data-period-range strong {
  color: #172033;
  font-size: 15px;
  white-space: nowrap;
}

.data-period-range span,
.data-period-main span,
.data-period-row em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.data-period-main strong {
  color: #18202f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-period-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-period-row em {
  justify-self: end;
  max-width: 132px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

.data-period-toggle {
  justify-self: start;
  min-height: 30px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  border: 1px solid #d8e2ee;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 4px 12px;
  box-shadow: none;
}

.data-period-toggle:hover {
  transform: none;
  background: #f6f9fd;
  box-shadow: none;
}

.data-period-toggle strong {
  color: var(--blue);
  font-size: 12px;
}

.data-period-children {
  display: grid;
  gap: 6px;
  margin-left: 98px;
}

.upload-calendar-axis {
  position: relative;
  display: grid;
  gap: 12px;
  padding-left: 30px;
  min-width: 0;
}

.upload-calendar-axis::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 8px;
  width: 2px;
  background: #e3e8ef;
}

.calendar-axis-item {
  position: relative;
  width: 100%;
  min-height: 96px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  column-gap: 18px;
  border: 0;
  border-radius: 8px;
  background: #f3f5f7;
  color: var(--ink);
  padding: 14px 16px 14px 14px;
  text-align: left;
  box-shadow: none;
  min-width: 0;
}

.calendar-axis-item::before {
  content: "";
  position: absolute;
  top: 20px;
  left: -29px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #cbd5e1;
  box-shadow: 0 0 0 4px #f6f8fb;
}

.calendar-axis-item.filled {
  background: #f2f7f3;
}

.calendar-axis-item.filled::before {
  background: var(--green);
  box-shadow: 0 0 0 4px #e3f4e8;
}

.calendar-axis-item.empty {
  background: #f2f3f5;
}

.calendar-axis-item.empty::before {
  background: #cbd5e1;
}

.calendar-date-block {
  display: grid;
  justify-items: center;
  align-content: center;
  line-height: 1.1;
  width: 96px;
  min-width: 96px;
  border-right: 1px solid rgba(203, 213, 225, 0.7);
  padding-right: 12px;
}

.calendar-date-block b,
.calendar-date-block span,
.calendar-date-block small,
.calendar-card-main strong,
.calendar-card-main span,
.calendar-card-main small,
.calendar-axis-item em {
  display: block;
}

.calendar-date-block b {
  color: #1f2937;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: 0;
  white-space: nowrap;
}

.calendar-date-block span {
  color: #4b5563;
  font-size: 12px;
  white-space: nowrap;
}

.calendar-date-block small {
  max-width: 100%;
  margin-top: 8px;
  border: 1px solid #d6dce4;
  border-radius: 999px;
  background: #fff;
  color: #6b7280;
  padding: 2px 7px;
  font-size: 10px;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.calendar-card-main {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding-right: 118px;
}

.calendar-card-main strong {
  color: #1f2937;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-card-main span,
.calendar-card-main small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-axis-item em {
  position: absolute;
  top: 13px;
  right: 14px;
  max-width: 112px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-axis-item.filled:hover {
  background: #eaf5ee;
}

.calendar-group {
  display: grid;
  gap: 8px;
}

.calendar-group-toggle {
  justify-self: start;
  margin-left: 118px;
  min-height: 30px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  border: 1px solid #d8e2ee;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 4px 12px;
  box-shadow: none;
}

.calendar-group-toggle:hover {
  transform: none;
  background: #f6f9fd;
  box-shadow: none;
}

.calendar-group-toggle strong {
  color: var(--blue);
  font-size: 12px;
}

.calendar-group-children {
  display: grid;
  gap: 6px;
  margin-left: 118px;
}

.calendar-child-item {
  min-height: 38px;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #e0e7ef;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
  box-shadow: none;
}

.calendar-child-item:hover {
  transform: none;
  background: #f8fafc;
  box-shadow: none;
}

.calendar-child-item span,
.calendar-child-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.calendar-child-item strong {
  min-width: 0;
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-history-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.upload-history-row {
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.upload-history-row strong,
.upload-history-row span,
.upload-history-row em {
  display: block;
}

.upload-history-row strong {
  overflow-wrap: anywhere;
}

.upload-history-row span,
.upload-history-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.upload-history-row:hover {
  border-color: #bdd0f8;
  background: #f7fbff;
}

.history-row {
  width: 100%;
  min-height: 74px;
  min-width: 0;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  display: grid;
  gap: 5px;
  text-align: left;
  align-content: center;
  font-weight: 500;
}

.history-row.active {
  border-color: var(--blue);
  background: #eef5ff;
}

.history-row strong,
.history-row span,
.history-row em,
.history-row small {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.history-row strong {
  line-height: 1.25;
}

.history-row span,
.history-row em,
.history-row small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.history-row small {
  color: var(--blue);
  font-weight: 700;
}

.customer-switch {
  min-width: 220px;
}

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

.customer-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.customer-row:hover {
  border-color: #bdd0f8;
  box-shadow: 0 10px 24px rgba(25, 35, 55, 0.08);
  transform: translateY(-1px);
}

.customer-row.active {
  border-color: var(--blue);
  background: #f6f9ff;
}

.customer-row strong {
  display: block;
  margin-bottom: 4px;
}

.customer-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.customer-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.profile-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.profile-field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 6px;
}

.profile-field p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.history-detail {
  min-width: 0;
}

.history-sticky-head {
  position: sticky;
  top: 64px;
  z-index: 6;
  display: grid;
  gap: 12px;
  margin: -10px -10px 18px;
  padding: 10px 10px 12px;
  border-bottom: 1px solid rgba(221, 227, 234, 0.9);
  background: rgba(246, 247, 249, 0.96);
  backdrop-filter: blur(12px);
}

.history-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.history-detail-head h2 {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
}

.history-sticky-head .report-toolbar {
  margin-bottom: 0;
  box-shadow: 0 8px 22px rgba(25, 35, 55, 0.06);
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  font-size: 14px;
}

.table th {
  color: var(--muted);
  font-weight: 650;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f7faff;
}

.active-row {
  background: #eef5ff;
}

.admin-usage-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.admin-customer-overview {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.owner-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.owner-stat-card {
  min-height: 118px;
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 13px;
  text-align: left;
  box-shadow: none;
  transform: none;
}

.owner-stat-card:hover,
.owner-stat-card.active {
  border-color: var(--blue);
  background: #f7fbff;
  box-shadow: 0 10px 24px rgba(25, 35, 55, 0.08);
}

.owner-stat-card strong,
.owner-stat-card span,
.owner-stat-card em {
  display: block;
}

.owner-stat-card strong {
  margin-bottom: 3px;
  overflow-wrap: anywhere;
}

.owner-stat-card span,
.owner-stat-card em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-style: normal;
  overflow-wrap: anywhere;
}

.owner-stat-metrics {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.owner-stat-metrics span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  border: 1px solid #edf1f6;
  border-radius: 999px;
  background: #fbfcfe;
  padding: 4px 8px;
}

.owner-stat-metrics b {
  color: var(--blue);
}

.usage-chart-panel {
  overflow: hidden;
}

.usage-summary-panel {
  display: grid;
  gap: 16px;
}

.usage-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.usage-summary-head h2,
.usage-summary-head p {
  margin: 0;
}

.usage-summary-head p {
  margin-top: 5px;
}

.usage-summary-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.usage-summary-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.usage-summary-controls input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 7px 10px;
}

.summary-range-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 3px;
}

.summary-range-nav span {
  min-width: 150px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
}

.usage-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.usage-chart-head h2,
.usage-chart-head p {
  margin: 0;
}

.usage-chart-head p {
  margin-top: 5px;
}

.usage-chart-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.usage-chart-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.usage-chart-controls select,
.usage-chart-controls input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 7px 10px;
}

.period-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}

.period-switch button {
  min-height: 34px;
  border: 0;
  border-radius: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 0 13px;
}

.period-switch button:last-child {
  border-right: 0;
}

.period-switch button:hover,
.period-switch button.active {
  background: #eef5ff;
  color: var(--blue);
}

.usage-chart-legend {
  display: flex;
  gap: 8px 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
  min-height: 30px;
}

.usage-chart-legend button,
.usage-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 0;
  font-size: 12px;
}

.usage-chart-legend button:hover {
  color: var(--ink);
}

.usage-chart-legend button.muted {
  opacity: 0.35;
}

.usage-chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.usage-chart-legend .total-legend i {
  border-radius: 2px;
  background: #cbd5e1;
}

.usage-user-filter {
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #edf1f6;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
  margin-bottom: 12px;
}

.usage-user-filter strong,
.usage-user-filter span {
  display: block;
}

.usage-user-filter strong {
  margin-bottom: 3px;
}

.usage-user-filter span {
  color: var(--muted);
  font-size: 12px;
}

.usage-user-checks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.usage-user-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 6px 9px;
}

.usage-user-checks input {
  width: 14px;
  min-height: 14px;
}

.usage-user-checks span {
  color: var(--ink);
  font-weight: 650;
}

.usage-chart-wrap {
  position: relative;
  overflow-x: auto;
}

.usage-chart {
  display: block;
  width: 100%;
  min-width: 760px;
  height: auto;
}

.usage-grid-line {
  stroke: #e8edf3;
  stroke-width: 1;
}

.usage-axis-label,
.usage-x-label,
.usage-axis-title {
  fill: #738095;
  font-size: 11px;
}

.usage-axis-title {
  font-weight: 700;
}

.usage-axis-title.right {
  text-anchor: end;
}

.usage-axis-label.left {
  text-anchor: end;
}

.usage-axis-label.right {
  text-anchor: start;
}

.usage-x-label {
  text-anchor: middle;
}

.usage-total-bar {
  fill: #dbe4ee;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

.usage-total-bar:hover {
  opacity: 1;
}

.usage-user-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  pointer-events: none;
}

.usage-user-point {
  stroke: #fff;
  stroke-width: 1.5;
  pointer-events: none;
}

.usage-chart-hit {
  fill: transparent;
  cursor: crosshair;
}

.usage-hover-guide {
  stroke: #94a3b8;
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0;
  pointer-events: none;
}

.usage-hover-guide.visible {
  opacity: 1;
}

.usage-chart-tooltip {
  display: none;
  position: absolute;
  z-index: 3;
  min-width: 190px;
  max-width: 240px;
  border: 1px solid #d7dee8;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  padding: 10px;
  pointer-events: none;
}

.usage-chart-tooltip.visible {
  display: grid;
  gap: 5px;
}

.usage-chart-tooltip b {
  color: var(--ink);
  font-size: 12px;
}

.usage-chart-tooltip span {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.usage-chart-tooltip .tooltip-total {
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  padding-bottom: 5px;
  margin-bottom: 2px;
}

.usage-chart-tooltip strong {
  font-weight: 600;
}

.settings-form {
  display: grid;
  gap: 14px;
}

.settings-block {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.settings-block h2,
.settings-block p {
  margin: 0;
}

.settings-block h2 {
  font-size: 17px;
}

.settings-form.narrow {
  max-width: 520px;
}

.settings-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  resize: vertical;
  line-height: 1.6;
  color: var(--ink);
}

.settings-form textarea:disabled {
  background: #f3f6f9;
  color: var(--muted);
  cursor: not-allowed;
}

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

.agent-setting-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.agent-setting-card summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  cursor: pointer;
  padding: 12px 14px;
}

.agent-setting-card summary span,
.agent-setting-card summary strong,
.agent-setting-card summary em {
  display: block;
}

.agent-setting-card summary em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}

.agent-setting-body {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 14px;
  background: #fbfcfe;
}

.setting-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.setting-row h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.policy-explain {
  border: 1px solid #dbe7ff;
  border-radius: 8px;
  background: #f7fbff;
  padding: 12px 14px;
}

.policy-explain strong,
.policy-explain p {
  display: block;
  margin: 0;
}

.policy-explain strong {
  margin-bottom: 5px;
  color: #1d4ed8;
}

.policy-explain p {
  color: #475569;
  font-size: 13px;
  line-height: 1.65;
}

.policy-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.policy-checks label {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 7px 10px;
  color: #344054;
  font-weight: 650;
}

.policy-checks input {
  width: 15px;
  min-height: 15px;
  accent-color: var(--blue);
}

.policy-checks span {
  font-size: 13px;
  white-space: nowrap;
}

.toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-width: 92px;
  font-weight: 750;
  color: var(--ink);
}

.toggle-field input {
  width: 18px;
  min-height: 18px;
}

.prompt-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid #d7dee8;
  border-radius: 999px;
  background: #f3f6f9;
  color: var(--muted);
  padding: 0 9px;
  margin-right: 8px;
  font-size: 12px;
  font-weight: 750;
}

.prompt-status.enabled {
  border-color: #bfe5ce;
  background: #eefaf3;
  color: var(--green);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.38);
}

.modal {
  width: min(980px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.24);
  padding: 22px;
}

.modal > .history-detail-head,
.modal > form > .history-detail-head {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -2px 18px;
  padding: 10px 2px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(12px);
}

.customer-supplement-modal {
  width: min(920px, 100%);
}

.customer-editor-modal {
  width: min(1180px, 100%);
  height: min(900px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  padding: 0;
}

.customer-modal-form {
  height: 100%;
  max-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
}

.customer-modal-head,
.customer-modal-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  background: #fff;
  padding: 18px 22px;
}

.customer-modal-head {
  border-bottom: 1px solid var(--line);
}

.customer-modal-head h2,
.customer-modal-head p {
  margin: 0;
}

.customer-modal-head p {
  margin-top: 5px;
}

.customer-modal-body {
  min-height: 0;
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 18px 22px;
}

.customer-modal-footer {
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.05);
  flex-shrink: 0;
}

.customer-logs-modal {
  width: min(1180px, 100%);
}

.supplement-hints {
  border: 1px solid #dbe7ff;
  border-radius: 8px;
  background: #f7fbff;
  color: #344054;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
}

.customer-log-list {
  display: grid;
  gap: 12px;
}

.customer-log-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.customer-log-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.customer-log-head strong,
.customer-log-head span,
.customer-log-head em {
  display: block;
}

.customer-log-head strong {
  margin-bottom: 4px;
}

.customer-log-head span,
.customer-log-head em,
.customer-log-actor {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.customer-log-head em {
  flex: 0 0 auto;
  font-style: normal;
  text-align: right;
}

.customer-log-actor {
  margin: 8px 0 0;
}

.customer-log-input {
  margin: 10px 0 0;
  border: 1px solid #edf1f6;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  color: #344054;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  line-height: 1.6;
}

.customer-log-diff {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.upload-duplicate-modal {
  width: min(1040px, 100%);
}

.duplicate-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 16px;
}

.duplicate-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 11px 12px;
}

.duplicate-item strong,
.duplicate-item span {
  display: block;
}

.duplicate-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.duplicate-actions {
  display: grid;
  gap: 14px;
}

.duplicate-manual-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.customer-log-diff details {
  border: 1px solid #edf1f6;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.customer-log-diff summary {
  cursor: pointer;
  padding: 9px 10px;
  color: var(--ink);
  font-weight: 750;
}

.log-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid #edf1f6;
}

.log-compare div {
  min-width: 0;
  padding: 10px;
}

.log-compare div + div {
  border-left: 1px solid #edf1f6;
}

.log-compare span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.log-compare p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.prompt-preview {
  margin: 16px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  padding: 16px;
  line-height: 1.75;
  font-family: inherit;
}

.deep-chat-modal {
  width: min(1320px, 100%);
  height: min(900px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding: 0;
}

.deep-chat-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding: 20px 22px 16px;
  background: #fff;
}

.deep-chat-head h2 {
  margin: 0 0 5px;
}

.deep-chat-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  word-break: break-word;
}

.deep-chat-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.deep-chat-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 750;
}

.deep-chat-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  background: #f6f8fb;
}

.deep-chat-guide {
  border-right: 1px solid var(--line);
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.deep-chat-guide strong {
  display: block;
  margin: 0 0 5px;
  color: var(--ink);
}

.deep-chat-guide p {
  margin: 0 0 16px;
}

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

.deep-chat-body {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: auto;
  padding: 18px;
  scroll-behavior: auto;
  overscroll-behavior: contain;
}

.deep-chat-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(25, 35, 55, 0.04);
}

.deep-chat-role {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.deep-chat-role span {
  color: var(--ink);
  font-weight: 800;
}

.deep-chat-role em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.deep-chat-message.user {
  background: #f8fafc;
  max-width: 78%;
  justify-self: end;
  border-color: #d7dee8;
}

.deep-chat-message.ai {
  border-color: #b8d4ff;
  background: #f8fbff;
  max-width: 92%;
  justify-self: start;
}

.deep-chat-message.ai.applied {
  border-color: #bfe5ce;
  background: #eefaf3;
}

.revision-preview {
  display: grid;
  gap: 10px;
  color: var(--ink);
  line-height: 1.7;
}

.revision-preview strong {
  display: block;
  font-size: 15px;
}

.revision-preview p {
  margin: 0;
  color: #334155;
  overflow-wrap: anywhere;
}

.revision-preview span {
  display: inline-flex;
  margin-right: 8px;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--blue);
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
}

.deep-chat-message.streaming pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  line-height: 1.75;
  color: var(--ink);
}

.deep-chat-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

.deep-chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding: 14px 18px 18px;
  background: #fff;
}

.deep-chat-input textarea {
  min-height: 94px;
  max-height: 180px;
}

.settings-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.system-settings-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.system-settings-nav { display: grid; gap: 8px; position: sticky; top: 18px; }
.system-settings-nav button { display: grid; gap: 5px; width: 100%; padding: 15px 16px; text-align: left; color: #475569; background: #fff; border: 1px solid #dce4ee; box-shadow: none; }
.system-settings-nav button:hover { transform: none; background: #f8fafc; box-shadow: none; }
.system-settings-nav button.active { color: #1259c3; border-color: #9cc1fb; background: #eef5ff; }
.system-settings-nav strong { font-size: 15px; }
.system-settings-nav span { font-size: 12px; line-height: 1.45; font-weight: 400; color: #718096; }
.system-settings-content { min-height: 560px; }
.settings-page-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; padding-bottom: 20px; margin-bottom: 22px; border-bottom: 1px solid #e7edf4; }
.settings-page-head > div { display: grid; gap: 5px; }
.settings-page-head span:first-child { color: #2563eb; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.settings-page-head h2, .settings-page-head p { margin: 0; }
.settings-page-head p { color: #64748b; line-height: 1.6; }
.write-status { flex: 0 0 auto; padding: 8px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0; }
.write-status.disabled { color: #166534; background: #dcfce7; }
.write-status.enabled { color: #991b1b; background: #fee2e2; }
.write-safety-callout { display: grid; gap: 5px; padding: 15px 17px; border: 1px solid; border-radius: 12px; }
.write-safety-callout strong { font-size: 14px; }
.write-safety-callout span { font-size: 13px; line-height: 1.55; }
.write-safety-callout.safe { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.write-safety-callout.danger { color: #991b1b; border-color: #fecaca; background: #fff1f2; }
.mode-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.mode-choice { display: flex; gap: 12px; padding: 18px; border: 1px solid #dce4ee; border-radius: 12px; cursor: pointer; }
.mode-choice.selected, .mode-choice:has(input:checked) { border-color: #76a9fa; background: #f2f7ff; box-shadow: 0 0 0 2px rgba(37,99,235,.08); }
.mode-choice input { width: auto; margin-top: 3px; }
.mode-choice span { display: grid; gap: 6px; }
.mode-choice small { color: #64748b; line-height: 1.55; }
.readiness-card, .safety-callout { display: flex; gap: 10px; align-items: center; padding: 13px 15px; border-radius: 10px; }
.readiness-card.ready { color: #166534; background: #ecfdf3; }
.readiness-card.warning { color: #92400e; background: #fff7e6; }
.readiness-card span, .safety-callout span { font-size: 13px; }
.safety-callout { color: #334155; background: #f1f5f9; }
.automation-switch-list { display: grid; gap: 10px; }
.setting-switch { display: flex; gap: 13px; align-items: flex-start; padding: 16px; border: 1px solid #dce4ee; border-radius: 11px; }
.setting-switch input { width: auto; margin-top: 4px; }
.setting-switch span { display: grid; gap: 4px; }
.setting-switch small { color: #64748b; line-height: 1.5; }
.setting-switch.locked { background: #f8fafc; opacity: .75; }
.account-pagination { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; border-top: 1px solid #e7edf4; color: #64748b; font-size: 13px; }
.account-pagination > div { display: flex; align-items: center; gap: 8px; }
.account-pagination label { display: flex; align-items: center; gap: 7px; }
.account-pagination select { width: auto; min-width: 70px; padding: 7px 28px 7px 9px; }
.account-edit-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.account-object-modal .detail-data-grid dd { overflow-wrap: anywhere; }
.account-list-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; padding: 13px 20px; background: #f8fafc; border-bottom: 1px solid #e7edf4; }
.account-filter-fields { display: flex; flex-wrap: wrap; gap: 10px; }
.account-list-toolbar label { display: grid; gap: 5px; color: #64748b; font-size: 12px; }
.account-list-toolbar select { min-width: 140px; max-width: 240px; padding: 8px 30px 8px 10px; background-color: #fff; }
.account-sort-field { margin-left: auto; }

.unified-action-panel { overflow:hidden; border:1px solid #d5deeb; border-radius:16px; background:#fff; box-shadow:0 10px 30px rgba(15,23,42,.04); }
.unified-action-head { display:flex; justify-content:space-between; align-items:center; gap:24px; padding:22px 24px; border-bottom:1px solid #e7edf4; }
.unified-action-head > div:first-child { display:grid; gap:4px; }
.unified-action-head span { color:#2563eb; font-size:12px; font-weight:800; }
.unified-action-head h2,.unified-action-head p { margin:0; }
.unified-action-head h2 { font-size:21px; }
.unified-action-head p { color:#64748b; font-size:13px; }
.action-count-summary { display:grid; grid-template-columns:auto auto auto auto; align-items:baseline; gap:5px 9px; padding:11px 14px; border-radius:11px; background:#f5f8fc; white-space:nowrap; }
.action-count-summary b { color:#172033; font-size:19px; }
.action-count-summary span { color:#64748b; font-weight:600; }
.action-filter-toolbar { position:sticky; top:0; z-index:4; display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:16px; align-items:end; padding:14px 24px; border-bottom:1px solid #e7edf4; background:rgba(248,250,252,.96); backdrop-filter:blur(10px); }
.action-mode-switch { align-self:end; padding:3px; border:1px solid #dce4ee; border-radius:10px; background:#fff; }
.action-mode-switch button { min-height:36px; border:0; box-shadow:none; }
.action-mode-switch button:hover { transform:none; box-shadow:none; }
.action-mode-switch button.active { background:#e8f0ff; color:#155eef; }
.action-select-filters { display:flex; justify-content:flex-end; gap:10px; }
.action-select-filters label { display:grid; gap:5px; min-width:145px; color:#64748b; font-size:11px; font-weight:700; }
.action-select-filters select { min-height:38px; padding:7px 30px 7px 10px; background:#fff; }
.filter-result-count { align-self:center; color:#475569; font-size:12px; font-weight:700; white-space:nowrap; }
.task-group-list { display:grid; gap:12px; padding:16px; background:#f4f7fb; }
.task-group-card { overflow:hidden; border:1px solid #d8e2ef; border-radius:14px; background:#fff; box-shadow:0 5px 16px rgba(15,23,42,.035); transition:border-color .18s ease,box-shadow .18s ease,background-color .18s ease; }
.task-group-card.expanded { border-color:#aac5f4; box-shadow:0 10px 28px rgba(37,99,235,.08); }
.task-group-card.task-group-updated { border-color:#76a9fa; background:#f8fbff; box-shadow:0 0 0 3px rgba(37,99,235,.08),0 10px 24px rgba(37,99,235,.08); }
.task-group-head { display:grid; grid-template-columns:minmax(320px,1.4fr) minmax(150px,.42fr) minmax(190px,.55fr) minmax(210px,.58fr); gap:18px; align-items:center; min-height:116px; padding:18px 20px; cursor:pointer; }
.task-group-head:hover { background:#fbfdff; }
.task-group-main,.task-group-meta,.task-group-summary,.task-group-actions { min-width:0; }
.task-group-eyebrow { display:flex; align-items:center; gap:9px; color:#64748b; font-size:11px; font-weight:750; }
.task-group-status { padding:4px 8px; border-radius:999px; background:#fff2cf; color:#8a5900; }
.task-group-status.in_progress { background:#e9f2ff; color:#1f5ea8; }
.task-group-status.completed { background:#e8f8ee; color:#16723b; }
.task-group-status.failed { background:#fff0f0; color:#b42318; }
.task-group-status.analysis_only { background:#f1f5f9; color:#64748b; }
.task-group-main h3 { margin:8px 0 5px; color:#172033; font-size:18px; line-height:1.4; }
.task-group-main p { margin:0; color:#64748b; font-size:12px; }
.task-group-meta { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.task-group-summary { display:grid; gap:7px; align-content:center; }
.task-group-summary b { color:#344054; font-size:12px; }
.task-group-summary small { color:#7a8699; font-size:11px; line-height:1.55; }
.task-group-categories { overflow:hidden; max-width:100%; color:#64748b; font-size:11px; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
.task-group-actions { display:grid; justify-self:end; gap:8px; width:min(100%,240px); }
.task-group-actions button { width:100%; min-height:40px; white-space:nowrap; }
.task-group-children { display:grid; gap:10px; padding:14px; border-top:1px solid #dce6f2; background:#f7f9fc; }
.task-group-child-summary { display:flex; flex-wrap:wrap; gap:8px; padding:0 2px 2px; color:#64748b; font-size:11px; font-weight:750; }
.task-group-child-summary span { padding:5px 8px; border-radius:999px; background:#eaf0f7; }
.task-group-children .unified-action-card { box-shadow:none; }
.unified-action-list { display:grid; gap:10px; padding:16px; background:#f7f9fc; }
.unified-action-card { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(260px,.9fr) minmax(210px,.55fr); gap:0; overflow:hidden; border:1px solid #dce4ee; border-radius:13px; background:#fff; transition:border-color .16s ease,box-shadow .16s ease; }
.unified-action-card:hover { border-color:#9fc0f8; box-shadow:0 8px 22px rgba(37,99,235,.08); }
.unified-action-card > div { min-width:0; padding:16px 18px; }
.unified-action-card > div + div { border-left:1px solid #edf0f4; }
.action-card-content h3 { margin:11px 0 10px; font-size:16px; line-height:1.45; }
.action-card-reason > span,.action-card-plan > span,.action-card-next > span { display:block; margin-bottom:5px; color:#7a8699; font-size:11px; font-weight:800; }
.action-card-reason p,.action-card-plan p { margin:0; color:#475467; line-height:1.55; }
.action-card-plan { background:#fbfcfe; }
.action-card-plan strong { display:block; margin-bottom:5px; color:#172033; font-size:14px; }
.action-card-plan small,.action-card-content small { display:block; margin-top:10px; color:#8a96a8; }
.action-card-next { display:flex; flex-direction:column; align-items:flex-start; background:#fff; }
.action-card-next strong { color:#344054; font-size:13px; line-height:1.5; }
.action-card-next .card-actions { width:100%; margin-top:auto; padding-top:14px; }
.status-chip.analysis_only { background:#f1f5f9; color:#64748b; }
.analysis-reference { grid-template-columns:minmax(0,1fr) minmax(260px,.45fr); }
.analysis-reference .action-card-next { justify-content:center; }
.action-pagination { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:14px 20px; border-top:1px solid #e7edf4; color:#64748b; font-size:13px; }
.action-pagination > div { display:flex; gap:8px; }
.manual-completion-modal { width:min(720px,calc(100vw - 32px)); padding:0; overflow:hidden; }
.manual-completion-modal header { display:flex; justify-content:space-between; gap:18px; padding:20px 22px; border-bottom:1px solid #e7edf4; }
.manual-completion-modal header span { color:#b36a00; font-size:11px; font-weight:800; }
.manual-completion-modal header h2 { margin:4px 0; font-size:20px; }
.manual-completion-modal header p { margin:0; color:#64748b; }
.manual-completion-modal form { display:grid; gap:16px; padding:20px 22px; }
.manual-completion-modal form label { display:grid; gap:7px; color:#475569; font-size:13px; font-weight:700; }
.manual-completion-modal textarea { resize:vertical; min-height:150px; }
.manual-completion-modal footer { display:flex; justify-content:flex-end; gap:8px; padding-top:4px; }

@media (max-width: 850px) {
  .system-settings-layout { grid-template-columns: 1fr; }
  .system-settings-nav { position: static; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .mode-choice-grid { grid-template-columns: 1fr; }
  .account-pagination { align-items: flex-start; flex-direction: column; }
  .account-list-toolbar { align-items: stretch; flex-direction: column; }
  .account-sort-field { margin-left: 0; }
  .unified-action-head { align-items:flex-start; flex-direction:column; }
  .action-filter-toolbar { position:static; grid-template-columns:1fr; align-items:stretch; }
  .action-mode-switch { display:grid; grid-template-columns:repeat(3,1fr); }
  .action-select-filters { display:grid; grid-template-columns:1fr; }
  .action-select-filters label { min-width:0; }
  .filter-result-count { justify-self:start; }
  .task-group-head { grid-template-columns:1fr; gap:14px; }
  .task-group-actions { justify-self:stretch; width:100%; }
  .unified-action-card,.analysis-reference { grid-template-columns:1fr; }
  .unified-action-card > div + div { border-left:0; border-top:1px solid #edf0f4; }
}

@media (min-width: 851px) and (max-width: 1180px) {
  .task-group-head { grid-template-columns:minmax(0,1fr) minmax(220px,.48fr); gap:14px 20px; }
  .task-group-summary { grid-column:1; }
  .task-group-actions { grid-column:2; grid-row:2; align-self:end; }
}

.notice {
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff8eb;
  color: var(--amber);
  margin: 12px 0;
}

.error {
  background: #fff1f1;
  color: var(--red);
}

.success {
  background: #eefaf3;
  color: #17663a;
}

.hidden {
  display: none;
}

@media (max-width: 1280px) {
  .grid.two {
    grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
    gap: 16px;
  }

  .report-toolbar {
    grid-template-columns: 1fr;
  }

  .report-toolbar-actions {
    justify-content: flex-start;
  }

  .active-customer-panel {
    grid-template-columns: minmax(240px, 0.8fr) minmax(280px, 1fr);
  }

  .active-customer-panel .actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .data-chain-summary {
    grid-template-columns: 1fr;
  }

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

  .trend-chart-grid {
    grid-template-columns: 1fr;
  }

  .data-chain-stats {
    justify-content: flex-start;
  }

  .data-period-row {
    grid-template-columns: 78px 160px minmax(0, 1fr);
  }

  .data-period-row em {
    grid-column: 3;
    justify-self: start;
    max-width: 100%;
    text-align: left;
  }
}

@media (max-width: 900px) {
  .approval-batch-head {
    display: grid;
  }

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

  .login-visual {
    display: none;
  }

  .layout,
  .grid.two,
  .report-grid,
  .analysis-workspace,
  .history-layout,
  .admin-usage-layout,
  .deep-chat-layout,
  .active-customer-panel {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 8px;
  }

  .modal {
    max-height: calc(100vh - 16px);
  }

  .ads-detail-modal {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    max-height: calc(100vh - 16px);
  }

  .ads-detail-body {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .ads-detail-modal .detail-data-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .business-detail-body,
  .business-detail-body .detail-hero,
  .detail-result-card {
    grid-template-columns:1fr;
    grid-column:auto;
  }

  .business-detail-list,
  .detail-evidence-card .business-detail-list {
    grid-template-columns:1fr;
  }

  .customer-editor-modal,
  .customer-modal-form {
    height: calc(100vh - 16px);
    max-height: calc(100vh - 16px);
  }

  .deep-chat-modal {
    height: calc(100vh - 20px);
  }

  .deep-chat-head {
    flex-direction: column;
  }

  .deep-chat-guide {
    display: none;
  }

  .deep-chat-message.user,
  .deep-chat-message.ai {
    max-width: 100%;
  }

  .history-list,
  .history-sticky-head,
  .analyze-source-panel,
  .analyze-sticky-head {
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    margin: 0 0 18px;
    padding: 0;
    border-bottom: 0;
    background: transparent;
    backdrop-filter: none;
  }

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

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

  .analysis-title {
    flex-direction: column;
  }

  .report-toolbar-actions button {
    flex: 1 1 92px;
  }

  .data-period-row {
    grid-template-columns: 1fr;
    gap: 7px;
    align-items: start;
  }

  .data-period-row em {
    grid-column: auto;
  }

  .data-period-main strong,
  .data-period-main span {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .data-period-children {
    margin-left: 0;
  }

  .calendar-axis-item {
    grid-template-columns: 86px minmax(0, 1fr);
    column-gap: 12px;
  }

  .calendar-date-block {
    width: 86px;
    min-width: 86px;
  }

  .calendar-card-main {
    padding-right: 0;
  }

  .calendar-axis-item em {
    position: static;
    justify-self: start;
    max-width: 100%;
    grid-column: 2;
  }

  .calendar-group-toggle,
  .calendar-group-children {
    margin-left: 0;
  }

  .usage-chart-head {
    flex-direction: column;
  }

  .usage-summary-head,
  .usage-user-filter {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .usage-summary-controls {
    justify-content: flex-start;
    width: 100%;
  }

  .usage-chart-controls {
    justify-content: flex-start;
    width: 100%;
  }

  .return-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .report-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .wb-report-header {
    padding: 24px 18px;
  }

  .wb-report-header h1 {
    font-size: 21px;
  }

  .wb-section {
    padding: 18px 14px;
  }

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

  .trend-card-grid {
    grid-template-columns: 1fr;
  }

  .analysis-title-actions {
    justify-content: flex-start;
    max-width: none;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .overview-metrics,
  .diagnostic-grid,
  .priority-actions,
  .top-analysis {
    grid-template-columns: 1fr;
  }

  .top-card-body {
    grid-template-columns: 1fr;
  }

  .form-row,
  .form-grid.two-cols,
  .history-detail-head {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .customer-row,
  .customer-profile-grid {
    grid-template-columns: 1fr;
  }

  .customer-stats {
    align-items: flex-start;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }
}
.async-progress-track {
  width: min(360px, 100%);
  height: 5px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7f2;
}

.async-progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
  transition: width 220ms ease;
}
