:root {
  --ink: #152038;
  --muted: #657087;
  --line: #dfe4ec;
  --soft: #f4f7fb;
  --card: #ffffff;
  --navy: #142b55;
  --blue: #1e63d6;
  --cyan: #02a9c8;
  --green: #12805c;
  --amber: #9a6500;
  --red: #b42318;
  --shadow: 0 18px 48px rgba(19, 39, 75, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #eef2f7;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 15% -10%, #d7f4f8 0, transparent 30rem), #eef2f7; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.center-card { width: min(520px, calc(100% - 32px)); margin: 15vh auto; padding: 48px; text-align: center; background: rgba(255,255,255,.94); border: 1px solid rgba(255,255,255,.9); border-radius: 24px; box-shadow: var(--shadow); }
.spinner { width: 36px; height: 36px; margin: 0 auto 16px; border: 3px solid #dce6f5; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 16px; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; font-weight: 800; letter-spacing: -.04em; box-shadow: 0 8px 24px rgba(30,99,214,.25); }
.brand-mark.small { width: 40px; height: 40px; margin: 0; border-radius: 12px; font-size: .9rem; }
.eyebrow { margin: 0 0 7px; color: var(--blue); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.02; letter-spacing: -.045em; }
h2 { margin-bottom: 0; font-size: 1.45rem; letter-spacing: -.025em; }
h3 { margin-bottom: 6px; }
.lead { color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 14px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; text-decoration: none; font-weight: 700; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.primary { background: linear-gradient(135deg, var(--blue), #174ca6); color: #fff; box-shadow: 0 8px 20px rgba(30,99,214,.2); }
.button.secondary { background: #fff; border-color: #ccd5e2; color: var(--navy); }
.button.quiet { background: transparent; border-color: #dbe2ec; color: var(--navy); }
.app-shell { min-height: 100vh; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; justify-content: space-between; align-items: center; min-height: 68px; padding: 0 32px; border-bottom: 1px solid rgba(207,216,228,.9); background: rgba(255,255,255,.91); backdrop-filter: blur(18px); }
.brand { display: flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .74rem; }
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.view-tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #f6f8fb; }
.view-tab { min-height: 34px; padding: 6px 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 800; }
.view-tab.active { background: #fff; color: var(--blue); box-shadow: 0 2px 8px rgba(25,51,87,.10); }
.user-name { max-width: 180px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.live-indicator { display: inline-flex; gap: 7px; align-items: center; padding: 6px 10px; border-radius: 999px; background: #e9f8f2; color: var(--green); font-size: .78rem; font-weight: 800; }
.live-indicator i { width: 7px; height: 7px; border-radius: 50%; background: #16a276; box-shadow: 0 0 0 4px rgba(22,162,118,.12); }
.page { width: min(1480px, calc(100% - 48px)); margin: 0 auto; padding: 50px 0 80px; }
.hero { display: flex; justify-content: space-between; gap: 40px; align-items: end; padding: 28px 6px 42px; }
.hero .lead { max-width: 790px; margin-bottom: 10px; }
.timestamp { margin: 0; color: var(--muted); font-size: .84rem; }
.hero-actions { flex: 0 0 auto; }
.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin: 0 2px 16px; }
.job-status { margin: 0; color: var(--blue); font-size: .86rem; font-weight: 700; }
.source-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 42px; }
.source-card { min-height: 196px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.95); box-shadow: 0 8px 24px rgba(30,52,86,.05); }
.source-card header { display: flex; justify-content: space-between; gap: 8px; align-items: start; margin-bottom: 20px; }
.source-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #eaf1fd; color: var(--blue); font-size: .76rem; font-weight: 900; }
.status-pill, .pill { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; background: #edf1f6; color: #59657a; font-size: .69rem; font-weight: 800; }
.status-pill.connected { background: #e4f7ef; color: var(--green); }
.status-pill.failed { background: #fdecea; color: var(--red); }
.status-pill.pending { background: #fff3d8; color: var(--amber); }
.source-card h3 { font-size: 1rem; }
.source-count { margin: 0 0 4px; font-size: 1.35rem; font-weight: 800; letter-spacing: -.025em; }
.source-meta { min-height: 36px; margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.source-actions { display: flex; gap: 7px; margin-top: 16px; }
.source-actions .button { flex: 1; min-height: 34px; padding: 7px 8px; font-size: .73rem; }
.catalog-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.catalog-heading { margin: 0; padding: 24px 26px 18px; }
.catalog-actions { display: flex; gap: 9px; }
.filter-grid { display: grid; grid-template-columns: minmax(320px, 2fr) repeat(3, minmax(160px, .7fr)); gap: 12px; padding: 16px 26px 20px; border-top: 1px solid #edf0f4; border-bottom: 1px solid #e6eaf0; background: #f8fafc; }
label span { display: block; margin-bottom: 6px; color: #526077; font-size: .72rem; font-weight: 800; letter-spacing: .02em; }
input, select { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #cfd7e3; border-radius: 9px; outline: none; background: #fff; color: var(--ink); }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30,99,214,.12); }
.result-meta { display: flex; justify-content: space-between; align-items: center; padding: 13px 26px; color: var(--muted); font-size: .82rem; }
.result-meta p { margin: 0; }
.result-meta label { display: flex; gap: 8px; align-items: center; }
.result-meta label span { margin: 0; }
.result-meta select { min-height: 32px; padding: 4px 28px 4px 8px; }
.table-wrap { overflow-x: auto; border-top: 1px solid #edf0f4; border-bottom: 1px solid #edf0f4; }
table { width: 100%; min-width: 1160px; border-collapse: collapse; table-layout: fixed; }
th { padding: 11px 14px; background: #f4f7fa; color: #556176; font-size: .67rem; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
th:nth-child(1) { width: 110px; } th:nth-child(2) { width: 170px; } th:nth-child(3) { width: 230px; } th:nth-child(4) { width: 210px; } th:nth-child(5) { width: 135px; } th:nth-child(6) { width: 180px; }
td { padding: 13px 14px; border-top: 1px solid #edf0f4; vertical-align: top; font-size: .78rem; line-height: 1.45; }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: #f7fbff; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; color: #173f78; overflow-wrap: anywhere; }
.subtext { display: block; margin-top: 3px; color: var(--muted); font-size: .7rem; }
.attribute-list { display: flex; flex-wrap: wrap; gap: 4px; }
.pill.required { background: #fff0ed; color: #a43829; }
.pill.searchable { background: #e8f3ff; color: #17599f; }
.pill.readonly { background: #f0edf9; color: #604995; }
.source-tag { display: inline-block; padding: 5px 8px; border-radius: 7px; background: #edf3ff; color: #2259a7; font-weight: 800; }
.source-tag.zoom { background: #e8f9fc; color: #007991; }
.investigate-hero { padding-bottom: 30px; }
.investigate-layout { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); gap: 20px; align-items: start; }
.comparison-controls, .comparison-panel { border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.comparison-controls { position: sticky; top: 88px; padding: 24px; }
.comparison-controls h2 { margin-bottom: 22px; }
.comparison-controls label { display: block; margin-bottom: 16px; }
.comparison-controls select[multiple] { min-height: 280px; padding: 7px; }
.comparison-controls select[multiple] option { padding: 7px 8px; border-radius: 6px; }
.check-row { display: flex !important; gap: 9px; align-items: center; padding: 10px 0; }
.check-row input { width: 18px; min-height: 18px; }
.check-row span { margin: 0; color: var(--ink); }
.help-text { margin: -5px 0 18px; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.full-width { width: 100%; }
.comparison-panel { overflow: hidden; }
.comparison-heading { margin: 0; padding: 24px 26px 18px; }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; padding: 0 26px 22px; }
.metric-card { padding: 14px; border: 1px solid #e2e7ef; border-radius: 12px; background: #f8fafc; }
.metric-card span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.metric-card strong { font-size: 1.25rem; }
.comparison-filter-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; padding: 16px 26px 20px; border-top: 1px solid #edf0f4; border-bottom: 1px solid #e6eaf0; background: #f8fafc; }
.comparison-table { min-width: 1180px; }
.comparison-table th:nth-child(1) { width: 180px; }
.comparison-table th:nth-child(2) { width: 220px; }
.comparison-table th:nth-child(3) { width: 115px; }
.comparison-table th:nth-child(4) { width: 280px; }
.comparison-table th:nth-child(5) { width: 220px; }
.comparison-table th:nth-child(6) { width: 170px; }
.mono.compact { display: block; margin-bottom: 4px; font-size: .7rem; }
.preline { white-space: pre-line; }
.empty-state { padding: 58px 20px; text-align: center; color: var(--muted); }
.pagination { display: flex; justify-content: center; gap: 16px; align-items: center; padding: 16px; }
.detail-panel { position: fixed; z-index: 40; top: 0; right: 0; width: min(520px, 100%); height: 100vh; overflow-y: auto; padding: 28px; border-left: 1px solid var(--line); background: #fff; box-shadow: -20px 0 60px rgba(15,32,58,.18); }
.detail-header { display: flex; justify-content: space-between; gap: 20px; align-items: start; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); cursor: pointer; font-size: 1.5rem; }
.detail-list { display: grid; grid-template-columns: 140px 1fr; gap: 0; margin: 18px 0; }
.detail-list dt, .detail-list dd { margin: 0; padding: 10px 0; border-bottom: 1px solid #eef1f5; overflow-wrap: anywhere; }
.detail-list dt { color: var(--muted); font-size: .75rem; font-weight: 700; }
.detail-list dd { font-size: .82rem; }
.toast { position: fixed; z-index: 60; right: 24px; bottom: 24px; max-width: 420px; padding: 13px 16px; border-radius: 12px; background: #15284b; color: #fff; box-shadow: var(--shadow); font-size: .84rem; }

@media (max-width: 1200px) { .source-grid { grid-template-columns: repeat(3, 1fr); } .filter-grid { grid-template-columns: 2fr 1fr; } .metric-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) {
  .topbar { padding: 0 16px; } .live-indicator, .user-name { display: none; } .brand small { display: none; } .view-tabs { margin-left: auto; }
  .page { width: min(100% - 24px, 1480px); padding-top: 28px; }
  .hero, .section-heading { align-items: stretch; flex-direction: column; }
  .source-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr; padding: 16px; }
  .investigate-layout { grid-template-columns: 1fr; } .comparison-controls { position: static; } .comparison-filter-grid, .metric-grid { grid-template-columns: 1fr; padding: 16px; }
  .catalog-heading { padding: 20px 18px; }
  .catalog-actions { flex-wrap: wrap; }
  .center-card { margin-top: 8vh; padding: 34px 24px; }
}
