:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f0efe9;
  --border: #e6e4dd;
  --border-subtle: #efede7;
  --text: #111315;
  --muted: #6b6a65;
  --accent: #1d4ed8;
  --accent-soft: #eff4ff;
  --focus: #2563eb;
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.18);
  --blue: #2563eb;
  --purple: #6d28d9;
  --teal: #0f766e;
  --orange: #c2410c;
  --green: #15803d;
  --green-soft: #e7f6ec;
  --red: #b91c1c;
  --red-soft: #fdecec;
  --amber: #a16207;
  --amber-soft: #fef5df;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: 13px; }
.num-font { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-radius: 6px;
  border: 1px solid #dcd9cf;
  background: linear-gradient(180deg, #ffffff 0%, #f5f4ef 100%);
  color: var(--text);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1.5px 0 rgba(17, 19, 21, 0.07), 0 1px 1.5px rgba(17, 19, 21, 0.04);
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.06s;
}
.btn:hover {
  background: linear-gradient(180deg, #ffffff 0%, #eeece5 100%);
  border-color: #cbc7bb;
  text-decoration: none;
}
.btn:active {
  transform: translateY(0.5px);
  box-shadow: inset 0 1px 2px rgba(17, 19, 21, 0.1);
}
.btn-primary {
  background: linear-gradient(180deg, #2a2e35 0%, #111315 100%);
  border-color: #0d0f11;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -2px 0 rgba(0, 0, 0, 0.42), 0 1px 2px rgba(17, 19, 21, 0.14);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #343942 0%, #191c20 100%);
  border-color: #0d0f11;
  color: #fff;
}
.btn-sm { height: 28px; padding: 0 9px; font-size: 12px; }
.btn-danger {
  color: var(--red);
  border-color: #efc4c4;
  background: linear-gradient(180deg, #fffbfb 0%, #fceeee 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 -1.5px 0 rgba(185, 28, 28, 0.09);
}
.btn-danger:hover {
  background: linear-gradient(180deg, #fff5f5 0%, #f9e2e2 100%);
  border-color: #e4a9a9;
}

.input, .select {
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid #dcd9cf;
  background-color: var(--surface);
  color: var(--text);
  line-height: 1.2;
  outline: none;
  box-shadow: inset 0 1px 1.5px rgba(17, 19, 21, 0.03);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 256 256' fill='%236b6a65'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 11px 11px;
  cursor: pointer;
}
.input:focus,
.select:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: var(--focus-ring);
}
.btn:focus-visible,
.portfolio-pill:focus-visible,
.seg-btn:focus-visible,
.top-link:focus-visible,
.subnav-tab:focus-visible,
.icon-btn:focus-visible,
.card-prt-dots:focus-visible,
.popover-item:focus-visible,
.report-card:focus-visible,
.report-nav-item:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: var(--focus-ring);
}
input[type="checkbox"] {
  accent-color: var(--focus);
}
input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
}
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 16px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(17, 19, 21, 0.06);
  border: 1px solid rgba(17, 19, 21, 0.1);
  color: var(--muted);
}
.cnt-keycap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  border-radius: 3px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #dcd9cf;
  box-shadow: inset 0 -1px 0 rgba(17, 19, 21, 0.06);
  color: var(--muted);
}
.seg-btn.active .cnt-keycap,
.subnav-tab.active .cnt-keycap {
  background: #f5f4ef;
  border-color: #cfccc2;
  color: var(--text);
}
.portfolio-pill.active .cnt-keycap {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: none;
  color: rgba(255, 255, 255, 0.9);
}

/* Landing / Auth */
.landing { max-width: 740px; margin: 64px auto; padding: 0 20px; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.03em;
  color: var(--text);
  cursor: pointer;
}
.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--text);
  display: inline-block;
}

.lp-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.lp-grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(ellipse 68% 48% at 50% -6%, rgba(37, 99, 235, 0.085), transparent 70%),
    radial-gradient(circle, rgba(17, 19, 21, 0.11) 1px, transparent 1px);
  background-size: 100% 100%, 24px 24px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 25%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 25%, #000 30%, transparent 100%);
}
.lp-nav {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lp-nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12.5px;
}
.lp-nav-links a {
  color: var(--muted);
  transition: color 0.12s;
}
.lp-nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.lp-hero {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 44px 24px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.lp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(17, 19, 21, 0.04);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.01em;
  color: var(--muted);
  margin-bottom: 24px;
}
.lp-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
  flex-shrink: 0;
}
.lp-title {
  margin: 0 0 18px;
  font-size: clamp(38px, 6.2vw, 60px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.045em;
  color: var(--text);
}
.lp-title-accent {
  background: linear-gradient(180deg, #2a2e35 0%, #57554e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lp-sub {
  margin: 0 0 32px;
  max-width: 520px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
  font-weight: 400;
}

.lp-auth-box {
  width: 100%;
  max-width: 440px;
}
.lp-form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid #dbd8ce;
  box-shadow:
    0 10px 30px -10px rgba(17, 19, 21, 0.12),
    0 2px 6px rgba(17, 19, 21, 0.04);
  transition: border-color 0.14s, box-shadow 0.14s;
}
.lp-form:focus-within {
  border-color: var(--focus);
  box-shadow:
    var(--focus-ring),
    0 12px 32px -10px rgba(37, 99, 235, 0.16);
}
.lp-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.lp-input::placeholder { color: #9c9a92; }
.lp-submit {
  height: 38px;
  padding: 0 15px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.lp-notice {
  margin: 12px 0 0;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(29, 78, 216, 0.16);
}

.lp-meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: #8a8880;
}
.lp-sep { opacity: 0.5; }

.lp-pillars {
  width: 100%;
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  text-align: left;
}
.lp-pillar {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 16px 15px;
  box-shadow: 0 1px 2px rgba(17, 19, 21, 0.03);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.lp-pillar:hover {
  transform: translateY(-1.5px);
  border-color: #d5d2c7;
  box-shadow: 0 8px 20px -12px rgba(17, 19, 21, 0.14);
}
.lp-pillar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.lp-pillar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--surface-2);
  flex-shrink: 0;
}
.lp-pillar strong {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--text);
}
.lp-pillar p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.lp-pillar code {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
}

.lp-footer {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #8a8880;
  border-top: 1px solid rgba(230, 228, 221, 0.7);
}

@media (max-width: 820px) {
  .lp-pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .lp-hero { padding: 28px 16px 40px; }
  .lp-form { flex-direction: column; align-items: stretch; padding: 8px; }
  .lp-submit { width: 100%; }
  .lp-pillars { grid-template-columns: 1fr; margin-top: 38px; }
  .lp-footer { flex-direction: column; gap: 10px; text-align: center; }
}

/* Minimal Nordic Top Bar */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(247, 246, 242, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: 48px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.header-left, .header-right { display: flex; align-items: center; gap: 8px; }
.header-left { gap: 14px; }

.top-links { display: flex; align-items: center; gap: 4px; }
.top-link {
  display: inline-flex;
  align-items: center;
  height: 28px;
  border: 1px solid transparent;
  background: transparent;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.top-link:hover { color: var(--text); background: var(--surface-2); }
.top-link.active {
  color: var(--text);
  font-weight: 600;
  background: linear-gradient(180deg, #ffffff 0%, #f6f5f1 100%);
  border-color: #dcd9cf;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 1px rgba(17, 19, 21, 0.04);
}

.subnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  overflow-x: auto;
}
.subnav-tabs { display: flex; align-items: center; gap: 2px; }
.subnav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  padding: 12px 10px;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.subnav-tab:hover { color: var(--text); }
.subnav-tab.active { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 22px 72px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 12px; }

.kpi-label { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.kpi-value { font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0; }

/* Single Command Strip + 1-Line Portfolio Pulse */
.command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.command-bar .input,
.command-bar .select,
.command-bar .btn,
.command-bar .seg-group {
  height: 30px;
}
.command-bar .seg-btn {
  height: 24px;
  padding: 0 8px;
}
/* Portfolio Aggregate Hero Card */
.agg-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 12px;
  margin-bottom: 14px;
}
.agg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.agg-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.agg-legend {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--muted);
}
.agg-kpis {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.agg-kpi-hero {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: 6px;
  transition: background 0.1s, opacity 0.12s;
}
.agg-kpi-hero:hover { background: var(--surface-2); }
.agg-kpi-hero.dimmed,
.agg-kpi-sub.dimmed { opacity: 0.45; }
.agg-kpi-lbl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
}
.agg-kpi-hero-row {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
}
.agg-kpi-hero-val {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.agg-kpi-prev {
  font-size: 12px;
  color: var(--muted);
}
.agg-kpis-right {
  display: flex;
  align-items: flex-end;
  gap: 22px;
  flex-wrap: wrap;
}
.agg-kpi-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  padding: 2px 5px;
  margin: -2px -5px;
  border-radius: 6px;
  transition: background 0.1s, opacity 0.12s;
}
.agg-kpi-sub:hover { background: var(--surface-2); }
.agg-kpi-sub.static { cursor: default; }
.agg-kpi-sub.static:hover { background: transparent; }
.agg-kpi-sub-row {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.agg-kpi-sub-val {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.agg-card.collapsed {
  padding: 10px 14px;
}
.agg-card.collapsed .agg-head {
  margin-bottom: 0;
}

.pulse-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  margin-bottom: 14px;
  font-size: 12.5px;
}
.pulse-metrics {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.pulse-item { display: inline-flex; align-items: baseline; gap: 6px; }
.pulse-item .lbl { color: var(--muted); font-size: 11.5px; }
.pulse-item strong { font-family: var(--mono); font-size: 13.5px; font-weight: 700; }

/* Segmented Controls */
.seg-group {
  display: inline-flex;
  background: var(--surface-2);
  padding: 2px;
  border-radius: 7px;
  border: 1px solid var(--border);
  gap: 2px;
}
.seg-btn {
  border: none;
  background: transparent;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 1px rgba(17, 19, 21, 0.06);
}
.seg-sep {
  width: 1px;
  height: 15px;
  background: var(--border);
  margin: 0 2px;
  align-self: center;
}
.metric-icon-btn {
  width: 28px;
  padding: 0 !important;
  justify-content: center;
  position: relative;
}
.metric-icon-btn::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(-2px);
  background: rgba(17, 19, 21, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 7px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease, transform 0.1s ease;
  z-index: 40;
}
.metric-icon-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Blik 3-Column Site Instrument Grid */
.blik-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.pinned-divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}
@media (max-width: 1080px) { .blik-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .blik-grid { grid-template-columns: 1fr; } }

.site-tile {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 14px 9px;
  cursor: pointer;
  transition: transform 0.08s ease-out, border-color 0.08s ease-out, box-shadow 0.08s ease-out;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.site-tile.menu-open {
  z-index: 35;
  transition: none;
  transform: translateY(-1.5px);
  border-color: #cfccc2;
  box-shadow: 0 3px 10px rgba(17, 19, 21, 0.05);
}
.drag-handle {
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: #c8c5ba;
  margin: 0 auto 2px;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.08s ease-out, width 0.08s ease-out;
}
.site-tile:hover .drag-handle {
  opacity: 1;
  width: 34px;
}
.site-tile:hover {
  transform: translateY(-1.5px);
  border-color: #cfccc2;
  box-shadow: 0 3px 10px rgba(17, 19, 21, 0.05);
}
.site-tile.dragging {
  opacity: 0.32;
  border-style: dashed;
  border-color: #a8a29e;
  box-shadow: none;
  transform: none;
  cursor: grabbing;
}
.site-tile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
}
.site-tile-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-favicon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
  object-fit: contain;
}
.site-metrics {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 2px 10px;
  justify-content: end;
  font-family: var(--mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.site-metric-item { display: inline-flex; align-items: center; gap: 4px; }
.site-tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2px;
  font-size: 11px;
  color: var(--muted);
}
.card-prt-dots {
  position: relative;
}
.folder-badges {
  position: absolute;
  bottom: 2px;
  right: 1px;
  display: inline-flex;
  align-items: center;
  pointer-events: none;
}
.folder-badge-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--surface);
  margin-left: -2px;
}
.card-prt-dots:hover .folder-badge-dot {
  box-shadow: 0 0 0 2px var(--surface-2);
}
.folder-badge-dot:first-child { margin-left: 0; }

.metric-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.sync-ok { background: #16a34a; }
.sync-busy { background: #2563eb; }
.sync-err { background: #dc2626; }
.sync-idle { background: #a8a29e; }

.delta-up { color: var(--green); font-size: 11px; font-weight: 600; }
.delta-down { color: var(--red); font-size: 11px; font-weight: 600; }
.delta-flat { color: var(--muted); font-size: 11px; }

.icon-btn,
.card-prt-dots {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  border-radius: 5px;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: background 0.1s, color 0.1s, opacity 0.1s;
}
.icon-btn:hover,
.card-prt-dots:hover { background: var(--surface-2); color: var(--text); }
.pin-btn,
.hide-btn {
  opacity: 0;
  flex-shrink: 0;
}
.site-tile:hover .pin-btn,
.site-tile:hover .hide-btn,
.pin-btn.pinned,
.site-tile.is-hidden-card .hide-btn {
  opacity: 1;
}
.pin-btn.pinned {
  color: var(--text);
}
.site-tile.is-hidden-card {
  opacity: 0.48;
  border-style: dashed;
}

/* Tables + Proportional Magnitude Bars */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 8px 11px; border-bottom: 1px solid var(--border-subtle); text-align: left; }
th {
  background: #faf9f6;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; }

.bar-cell { position: relative; overflow: hidden; }
.bar-fill {
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  border-radius: 3px;
  background: rgba(37, 99, 235, 0.11);
  pointer-events: none;
}
.bar-text { position: relative; z-index: 1; }

/* Site Metric Toggle Strip */
.metric-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.metric-check {
  background: var(--surface);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  user-select: none;
}
.metric-check:hover { background: #faf9f6; }
.metric-check-top { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.metric-check-val { font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }

/* Indexing Coverage Bar */
.coverage-bar { height: 8px; border-radius: 999px; background: var(--red-soft); overflow: hidden; display: flex; margin: 10px 0 4px; }
.coverage-pass { background: #16a34a; height: 100%; }
.coverage-warn { background: #d97706; height: 100%; }
.coverage-fail { background: #dc2626; height: 100%; }

/* Opportunity Reports Workspace */
.reports-layout {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.reports-rail {
  position: sticky;
  top: 64px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.reports-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.reports-group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.report-nav-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  padding: 6px 8px;
  text-align: left;
  font-size: 12.5px;
  font-weight: 500;
  color: #3f3e3a;
  cursor: pointer;
  line-height: 1.3;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.report-nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.report-nav-item.active {
  background: var(--accent-soft);
  border-color: rgba(37, 99, 235, 0.22);
  color: var(--accent);
  font-weight: 600;
}
.reports-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.report-head {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.report-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.report-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.report-title-row h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.report-desc {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.report-toolbar .input,
.report-toolbar .btn {
  height: 30px;
}
.report-table tbody tr:hover td {
  background: #faf9f6;
}
.report-query {
  font-weight: 500;
  color: var(--text);
}
.report-path {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  display: inline-block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.report-path:hover {
  color: var(--accent);
  text-decoration: underline;
}
.report-path-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pos-pill {
  display: inline-block;
  min-width: 38px;
  text-align: center;
  padding: 1px 6px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pos-top { background: var(--green-soft); color: var(--green); }
.pos-near { background: var(--accent-soft); color: var(--accent); }
.pos-mid { background: var(--amber-soft); color: var(--amber); }
.pos-far { background: var(--surface-2); color: var(--muted); }
.bar-fill-green {
  position: absolute;
  right: 0;
  top: 4px;
  bottom: 4px;
  border-radius: 3px;
  background: rgba(21, 128, 61, 0.11);
  pointer-events: none;
}

@media (max-width: 960px) {
  .reports-layout {
    grid-template-columns: 1fr;
  }
  .reports-rail {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }
}

pre.code {
  background: #141619;
  color: #e5e7eb;
  padding: 12px 14px;
  border-radius: 6px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  margin: 8px 0;
}

/* Chat Drawer */
.chat-drawer {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 400px;
  max-width: calc(100vw - 36px);
  height: 520px;
  max-height: calc(100vh - 70px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(17, 19, 21, 0.16);
  display: flex;
  flex-direction: column;
  z-index: 50;
}
.chat-head { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.chat-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 8px 11px; border-radius: 8px; font-size: 13px; white-space: pre-wrap; max-width: 92%; }
.msg-user { align-self: flex-end; background: var(--text); color: #fff; }
.msg-assistant { align-self: flex-start; background: var(--surface-2); color: var(--text); }
.chat-foot { padding: 9px; border-top: 1px solid var(--border); display: flex; gap: 6px; }

.popover-wrap { position: relative; display: inline-flex; }
.popover-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  min-width: 215px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: 0 10px 28px rgba(17, 19, 21, 0.12);
  padding: 5px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.popover-item {
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 6px 9px;
  border-radius: 6px;
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.popover-item:hover { background: var(--surface-2); }
.popover-item.active { background: var(--surface-2); font-weight: 600; }
.popover-sep { height: 1px; background: var(--border-subtle); margin: 4px 2px; }

/* Portfolio Pill Strip & Color Dots */
.portfolio-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.portfolio-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
}
.portfolio-pill:hover { border-color: #c8c5ba; color: var(--text); }
.portfolio-pill.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}
.portfolio-pill.active .num-font { color: rgba(255, 255, 255, 0.72) !important; }
.prt-more {
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.4;
  cursor: pointer;
  padding: 0 2px;
  margin-left: 1px;
  font-size: 12px;
  line-height: 1;
  border-radius: 4px;
}
.portfolio-pill:hover .prt-more,
.portfolio-pill.active .prt-more { opacity: 0.85; }
.prt-more:hover { opacity: 1 !important; background: rgba(128, 128, 128, 0.2); }
.color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.color-swatch.selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--text);
}
.site-checklist {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.site-check-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12.5px;
}
.site-check-row:hover { background: var(--surface-2); }

.spark-wrap,
.chart-wrap {
  position: relative;
}
.spark-empty {
  height: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #b4b1a8;
  font-size: 11px;
  letter-spacing: 0.01em;
}
.chart-crosshair {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(17, 19, 21, 0.28);
  pointer-events: none;
  display: none;
}
.chart-tooltip {
  position: absolute;
  top: 4px;
  background: rgba(17, 19, 21, 0.92);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  z-index: 25;
  display: none;
  box-shadow: 0 4px 12px rgba(17, 19, 21, 0.2);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalPopIn {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 19, 21, 0.42);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 65;
  padding: 16px;
}
.modal-backdrop.animate-in {
  animation: modalFadeIn 130ms ease-out;
}
.modal-dialog {
  width: 100%;
  box-shadow: 0 20px 50px rgba(17, 19, 21, 0.18);
}
.modal-backdrop.animate-in .modal-dialog {
  animation: modalPopIn 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.notice { padding: 10px 12px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; margin-bottom: 12px; }

@keyframes blikSpin {
  to { transform: rotate(360deg); }
}
.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1.8px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: blikSpin 0.65s linear infinite;
  vertical-align: -1.5px;
  flex-shrink: 0;
}
.btn:disabled {
  opacity: 0.72;
  cursor: wait;
}

@media (max-width: 720px) {
  .header { padding: 0 12px; }
  .container { padding: 12px 12px 64px; }
}
