:root {
  color-scheme: light;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #172422;
  background: #e9efed;
  --ink: #172422;
  --muted: #5f6e6b;
  --tertiary: #879490;
  --line: rgba(22, 55, 50, .11);
  --line-strong: rgba(22, 55, 50, .2);
  --soft: #f3f7f5;
  --soft-hover: #e8f0ed;
  --navy: #0d2d29;
  --blue: #0f766e;
  --blue-strong: #0a5c56;
  --blue-soft: #e5f5f1;
  --green: #18794e;
  --amber: #a16207;
  --red: #c2414c;
  --canvas: #fff;
  --surface: #f7faf9;
  --sidebar-width: 264px;
  --content-max-width: 1500px;
  --content-gutter: clamp(24px, 2.8vw, 48px);
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(20, 47, 43, .05), 0 8px 22px rgba(20, 47, 43, .045);
  --shadow-lg: 0 24px 64px rgba(7, 34, 30, .15);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; height: 100vh; height: 100dvh; overflow: hidden;
  display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background: #e9efed;
}
button, input, select, textarea { font: inherit; }
button, summary, label:has(input) { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid rgba(15,118,110,.24); outline-offset: 2px;
}

.skip-link {
  position: fixed; z-index: 100; top: 8px; left: 12px; padding: 8px 12px;
  border-radius: 7px; background: var(--ink); color: white; font-size: 12px;
  transform: translateY(-160%); transition: transform .15s;
}
.skip-link:focus { transform: translateY(0); }

.sidebar {
  min-width: 0; height: 100%; padding: 27px 16px 16px;
  background: var(--navy); color: rgba(255,255,255,.92);
  display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; margin: 0 9px 28px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: #d9f7e9; color: var(--navy); font-size: 11px; font-weight: 850;
  letter-spacing: -.02em; box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.brand-copy, .nav-copy { min-width: 0; display: grid; }
.brand-copy strong { color: white; font-size: 15px; letter-spacing: -.01em; }
.brand-copy small { margin-top: 2px; color: rgba(225,241,236,.52); font-size: 10px; font-weight: 500; }
.sidebar-section { flex: 0 0 auto; margin-top: 0; }
.sidebar-section + .sidebar-section { margin-top: 17px; }
.sidebar-label {
  display: block; margin: 0 10px 8px; color: rgba(225,241,236,.4);
  font-size: 10px; font-weight: 750; letter-spacing: .1em;
}
.sidebar nav { display: grid; gap: 5px; }
.nav {
  width: 100%; min-height: 48px; border: 1px solid transparent; border-radius: 10px; padding: 8px 9px;
  background: transparent; color: rgba(232,244,240,.67); text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 9px; transition: background .15s, color .15s;
}
.nav:hover { color: white; background: rgba(255,255,255,.055); }
.nav.on { color: white; border-color: rgba(205,244,230,.1); background: rgba(205,244,230,.11); }
.nav-module { min-height: 43px; padding-block: 6px; }
.nav-symbol {
  width: 25px; height: 25px; flex: 0 0 25px; border-radius: 7px;
  display: grid; place-items: center; background: rgba(255,255,255,.065);
  color: currentColor; font-size: 11px; font-weight: 750; line-height: 1;
}
.nav.on .nav-symbol { background: rgba(255,255,255,.12); color: inherit; }
.nav-copy strong { overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 700; }
.nav-copy small { margin-top: 2px; color: rgba(224,240,235,.44); font-size: 10px; }
.sidebar-capability { margin-top: auto; padding: 18px 2px 14px; }
.capability-card {
  display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 9px;
  padding: 11px 12px; border: 1px solid rgba(215,242,233,.08); border-radius: 9px;
  background: rgba(255,255,255,.045);
}
.capability-card > div { min-width: 0; display: grid; gap: 3px; }
.capability-card strong { color: rgba(255,255,255,.86); font-size: 11px; }
.capability-pulse {
  width: 7px; height: 7px; margin-top: 4px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 3px rgba(36,138,61,.1);
}
.capability-card[data-state="loading"] .capability-pulse {
  background: var(--amber); box-shadow: 0 0 0 3px rgba(169,91,5,.1);
}
.capability-card[data-state="idle"] .capability-pulse {
  background: var(--tertiary); box-shadow: none;
}
.capability-card[data-state="error"] .capability-pulse {
  background: var(--red); box-shadow: 0 0 0 3px rgba(201,48,67,.1);
}
.catalog-state {
  color: rgba(225,241,236,.51); font-size: 10px; line-height: 1.4; overflow-wrap: anywhere;
}
.sidebar-capability > p {
  margin: 9px 10px 0; color: rgba(225,241,236,.4); font-size: 10px; line-height: 1.55;
}
.sidebar-foot {
  padding: 13px 4px 2px; border-top: 1px solid rgba(215,242,233,.09);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.user-summary { min-width: 0; display: flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(255,255,255,.09); color: rgba(255,255,255,.68); font-size: 10px;
}
.user-summary > div { min-width: 0; display: grid; gap: 1px; }
.user-summary small { color: rgba(225,241,236,.43); font-size: 9px; }
#user-chip {
  max-width: 105px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: rgba(255,255,255,.82); font-size: 10px; font-weight: 600;
}
.session-actions { flex: 0 0 auto; }
.sidebar .btn { border-color: #d9f7e9; background: #d9f7e9; color: var(--navy); }
.sidebar .btn:hover { border-color: white; background: white; }
.sidebar .btn.secondary {
  border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.055); color: rgba(255,255,255,.74);
}

.main {
  width: calc(100vw - var(--sidebar-width) - 12px);
  min-width: 0; max-width: none; min-height: 0; margin: 8px 8px 8px 4px; overflow: auto;
  justify-self: stretch;
  border: 1px solid rgba(21,62,56,.09); border-radius: 18px;
  background: var(--canvas); outline: none;
  box-shadow: var(--shadow-sm);
}
.topbar {
  width: 100%; max-width: var(--content-max-width); margin: 0 auto;
  padding: 31px var(--content-gutter) 22px;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  border-bottom: 1px solid var(--line);
}
.eyebrow, .section-kicker {
  display: block; font-size: 11px; font-weight: 750;
  letter-spacing: .09em; text-transform: uppercase; margin-bottom: 6px;
}
.eyebrow { color: var(--blue); }
.section-kicker { color: var(--tertiary); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(26px, 3vw, 33px); letter-spacing: -.04em; }
h2 { margin-bottom: 6px; font-size: 23px; letter-spacing: -.025em; }
h3 { margin: 0; font-size: 17px; }
p { color: var(--muted); font-size: 14px; line-height: 1.55; margin-bottom: 0; }
.topbar > div { min-width: 0; }
.topbar-action { flex: 0 0 auto; min-height: 38px; }
.tab-panel, .notice {
  width: 100%; max-width: var(--content-max-width); margin-left: auto; margin-right: auto;
}
.tab-panel { padding: 24px var(--content-gutter) 56px; }
.workspace { width: 100%; }
.notice {
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
  border: 1px solid #ead29a; border-radius: var(--radius);
  background: #fff9eb; margin-top: 20px; margin-bottom: 0;
}
.notice div { display: grid; gap: 3px; }
.notice span { color: #7a591d; font-size: 13px; }

/* Overview: business questions first, data-source detail second. */
.overview-panel { padding-top: 28px; }
.overview-hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 390px; padding: clamp(30px, 4vw, 56px);
  border-radius: 18px; background: #103b36; color: white;
  display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .72fr);
  gap: clamp(28px, 5vw, 72px); align-items: center;
  box-shadow: var(--shadow-lg);
}
.overview-hero::after {
  content: ""; position: absolute; z-index: -1; right: -100px; bottom: -170px;
  width: 430px; height: 430px; border: 74px solid rgba(216,247,233,.055); border-radius: 50%;
}
.overview-hero-copy { max-width: 780px; }
.hero-kicker {
  display: block; margin-bottom: 16px; color: #9fe3ca;
  font-size: 10px; font-weight: 800; letter-spacing: .17em;
}
.overview-hero h2 {
  max-width: 720px; margin: 0 0 16px; color: white;
  font-size: clamp(32px, 4.2vw, 52px); line-height: 1.17; letter-spacing: -.055em;
}
.overview-hero-copy > p {
  max-width: 690px; color: rgba(235,248,244,.7); font-size: 14px; line-height: 1.75;
}
.overview-search { max-width: 680px; margin-top: 27px; }
.overview-search > label {
  display: block; margin-bottom: 8px; color: rgba(236,248,244,.63);
  font-size: 11px; font-weight: 700;
}
.overview-search > div {
  padding: 5px; border: 1px solid rgba(255,255,255,.13); border-radius: 12px;
  background: white; display: flex; align-items: center; gap: 6px;
  box-shadow: 0 15px 32px rgba(2,22,19,.18);
}
.overview-search input {
  min-width: 0; flex: 1; min-height: 45px; padding-inline: 13px;
  border: 0; border-radius: 9px; box-shadow: none; font-size: 14px;
}
.overview-search input:focus { box-shadow: inset 0 0 0 2px rgba(15,118,110,.17); }
.overview-search .btn { flex: 0 0 auto; min-height: 43px; border-radius: 9px; }
.hero-trust-row {
  margin-top: 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
  color: rgba(228,244,239,.56); font-size: 10px;
}
.hero-trust-row span { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust-row i {
  width: 6px; height: 6px; border-radius: 50%; background: #78d6b5;
  box-shadow: 0 0 0 3px rgba(120,214,181,.11);
}
.hero-trust-row strong { color: #d9f7e9; font-size: 11px; }
.hero-proof-card {
  position: relative; padding: 19px 20px 17px; border: 1px solid rgba(223,247,239,.12);
  border-radius: 14px; background: rgba(255,255,255,.065);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.proof-card-head {
  padding-bottom: 13px; border-bottom: 1px solid rgba(232,248,243,.1);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.proof-card-head span { color: rgba(232,248,243,.48); font-size: 10px; }
.proof-card-head strong { color: #b8efd9; font-size: 10px; letter-spacing: .04em; }
.hero-proof-card ol { list-style: none; margin: 5px 0 0; padding: 0; }
.hero-proof-card li {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start;
  padding: 13px 0; border-bottom: 1px solid rgba(232,248,243,.08);
}
.hero-proof-card li > span { padding-top: 2px; color: #7fd6b7; font-size: 9px; font-weight: 800; }
.hero-proof-card li div { display: grid; gap: 3px; }
.hero-proof-card li strong { color: rgba(255,255,255,.93); font-size: 12px; }
.hero-proof-card li small { color: rgba(230,247,241,.5); font-size: 10px; line-height: 1.45; }
.hero-proof-card > p { margin-top: 13px; color: rgba(230,247,241,.45); font-size: 9px; line-height: 1.55; }

.module-section { padding: 42px 0 12px; }
.module-heading { margin-bottom: 21px; align-items: flex-end; }
.catalog-summary {
  flex: 0 0 auto; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted); font-size: 10px; white-space: nowrap;
}
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.module-card {
  position: relative; min-width: 0; min-height: 272px; padding: 21px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--canvas);
  display: flex; flex-direction: column; gap: 17px;
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.module-card:hover {
  transform: translateY(-3px); border-color: rgba(15,118,110,.26);
  box-shadow: 0 14px 34px rgba(13,50,45,.09);
}
.module-card-top { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 9px; align-items: center; }
.module-source-count { color: var(--tertiary); font-size: 9px; font-weight: 650; }
.module-icon {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: #e7f6f0; color: #12634d; font-size: 12px; font-weight: 800;
}
.module-index { color: #c4cecb; font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.module-card h3 { margin-bottom: 8px; font-size: 18px; letter-spacing: -.025em; }
.module-card p { font-size: 12px; line-height: 1.65; }
.module-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.module-tags span {
  padding: 4px 7px; border-radius: 5px; background: var(--soft);
  color: var(--muted); font-size: 9px; font-weight: 650;
}
.module-link {
  width: 100%; margin-top: auto; padding: 13px 0 0; border: 0; border-top: 1px solid var(--line);
  background: transparent; color: var(--ink); text-align: left; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 11px; font-weight: 750;
}
.module-link span { color: var(--blue); font-size: 16px; transition: transform .15s; }
.module-card:hover .module-link span { transform: translateX(3px); }
.module-compliance .module-icon { background: #fff2df; color: #9a5b08; }
.module-qualification .module-icon { background: #edf0fb; color: #5261a8; }
.module-shareholder .module-icon { background: #f2ecf8; color: #765399; }
.module-assets .module-icon { background: #e9f1fb; color: #356c9b; }
.module-patent .module-icon { background: #fbeceb; color: #a34848; }

.overview-activity {
  margin-top: 34px; padding: 27px 28px; border: 1px solid var(--line);
  border-radius: 16px; background: var(--surface);
  display: grid; grid-template-columns: minmax(260px, .7fr) minmax(420px, 1.3fr); gap: 42px;
}
.activity-summary > p { max-width: 500px; font-size: 12px; }
.overview-metrics {
  margin-top: 22px; display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line); border-radius: 10px; background: white; overflow: hidden;
}
.overview-metrics > div { padding: 13px; display: grid; gap: 4px; border-right: 1px solid var(--line); }
.overview-metrics > div:last-child { border-right: 0; }
.overview-metrics span { color: var(--muted); font-size: 9px; }
.overview-metrics strong { font-size: 20px; }
.recent-work { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: white; overflow: hidden; }
.recent-work-head {
  min-height: 47px; padding: 12px 15px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.recent-work-head strong { font-size: 12px; }
.overview-recent-jobs { min-height: 150px; }
.recent-job {
  width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line);
  background: white; color: var(--ink); text-align: left; cursor: pointer;
  display: grid; grid-template-columns: 7px minmax(0, 1fr) auto 14px; gap: 10px; align-items: center;
}
.recent-job:last-child { border-bottom: 0; }
.recent-job:hover { background: var(--soft); }
.recent-job-status { width: 7px; height: 7px; border-radius: 50%; background: var(--tertiary); }
.recent-job-status.status-running, .recent-job-status.status-queued { background: var(--blue); }
.recent-job-status.status-completed { background: var(--green); }
.recent-job-status.status-completed_with_issues,
.recent-job-status.status-failed, .recent-job-status.status-cancelled { background: var(--amber); }
.recent-job-main { min-width: 0; display: grid; gap: 3px; }
.recent-job-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.recent-job-main small { color: var(--tertiary); font-size: 9px; }
.recent-job-state { color: var(--muted); font-size: 9px; }
.recent-job-arrow { color: var(--blue); font-size: 14px; }
.overview-empty { padding: 30px 18px; text-align: center; }
.overview-empty > span { font-size: 12px; font-weight: 700; }
.overview-empty p { margin: 4px auto 11px; font-size: 10px; }

.query-module-banner {
  margin-bottom: 20px; padding: 14px 16px; border: 1px solid rgba(15,118,110,.16);
  border-radius: 12px; background: var(--blue-soft);
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center;
}
.query-module-banner > span {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--blue); color: white; font-size: 12px; font-weight: 800;
}
.query-module-banner > div { min-width: 0; display: grid; gap: 2px; }
.query-module-banner small { color: var(--blue); font-size: 9px; font-weight: 750; }
.query-module-banner strong { font-size: 13px; }
.query-module-banner p { font-size: 10px; }

.stepper {
  list-style: none; margin: 0 0 30px; padding: 0 0 24px; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.stepper li { display: flex; align-items: center; gap: 10px; color: var(--tertiary); }
.stepper li > span {
  width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.stepper li div { display: grid; }
.stepper strong { font-size: 13px; }
.stepper small { margin-top: 2px; font-size: 11px; }
.stepper li.active, .stepper li.done { color: var(--ink); }
.stepper li.active > span { color: white; border-color: var(--blue); background: var(--blue); }
.stepper li.done > span { color: var(--green); border-color: #9ad6bd; background: #eaf8f1; }

.query-snapshot {
  margin: -13px 0 27px;
  padding: 12px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 0;
  border: 1px solid var(--line);
  border-width: 1px 0;
}
.query-snapshot > div {
  min-width: 0;
  padding: 0 16px;
  display: grid;
  gap: 4px;
  border-right: 1px solid var(--line);
}
.query-snapshot > div:first-child { padding-left: 2px; }
.query-snapshot > div:last-child { border-right: 0; padding-right: 2px; }
.query-snapshot span { color: var(--muted); font-size: 10px; }
.query-snapshot strong {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px;
}
.query-snapshot .snapshot-actions {
  min-width: 118px; align-content: center; justify-items: end;
}

.section-heading {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; margin-bottom: 22px;
}
.service-selector {
  min-width: 0; margin: 0 0 26px; padding: 0 0 24px;
  border: 0; border-bottom: 1px solid var(--line);
}
.service-selector legend {
  margin-bottom: 10px; padding: 0; color: var(--muted); font-size: 12px; font-weight: 700;
}
.option-grid.service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.option-grid.service-grid:has(> [hidden]) { grid-template-columns: 1fr; }
.penetration-settings { display: grid; gap: 18px; }
.service-callout {
  padding: 14px 16px; border: 0; border-left: 3px solid var(--blue);
  border-radius: 0; background: var(--soft);
}
.service-callout strong { display: block; margin-bottom: 4px; color: var(--ink); }
.accuracy-note {
  padding: 11px 13px; border-left: 3px solid var(--green);
  background: #eef9f4; color: #315e4e;
}
.button-row, .wizard-actions, .job-actions, .export-create { display: flex; align-items: center; gap: 8px; }
.subject-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.subject-row {
  display: grid; grid-template-columns: 105px minmax(220px, 1.4fr) minmax(190px, 1fr) minmax(170px, .8fr) auto;
  gap: 10px; align-items: end; padding: 14px 2px;
  border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; background: transparent;
}
.subject-row:has(label:nth-of-type(2):last-of-type) { grid-template-columns: 105px minmax(240px, 1.5fr) minmax(220px, 1fr) auto; }
.subject-row label, .field { display: grid; gap: 5px; }
.subject-row label span, .field span, .search-field span { color: var(--muted); font-size: 11px; font-weight: 650; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 7px;
  background: var(--canvas);
  color: var(--ink); min-height: 39px; padding: 8px 10px; outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(15,118,110,.13);
}
textarea { resize: vertical; line-height: 1.5; }
.icon-button {
  min-height: 39px; padding: 7px 9px; border: 0; background: transparent;
  color: var(--red); font-size: 12px; cursor: pointer;
}
.icon-button:disabled { color: #b4bbc6; cursor: not-allowed; }

.import-box, .metadata-box, .advanced-output {
  margin-top: 18px; border: 0; border-top: 1px solid var(--line);
  border-radius: 0; background: transparent;
}
.import-box summary, .metadata-box summary, .advanced-output summary {
  padding: 14px 2px; cursor: pointer; font-size: 13px; font-weight: 700;
}
.import-grid { padding: 0 0 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.upload-zone, .paste-box {
  min-height: 136px; padding: 16px; border: 1px dashed rgba(87,73,60,.23);
  border-radius: 9px; display: grid; align-content: center; gap: 7px; background: var(--soft);
}
.upload-zone { cursor: pointer; }
.upload-zone span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.paste-box { align-content: stretch; }
.inline-feedback { margin: 0 0 15px; padding: 10px 12px; border-radius: 7px; background: var(--blue-soft); font-size: 12px; }
.inline-feedback.success { color: var(--green); background: #eaf8f1; }
.inline-feedback.warning { color: var(--amber); background: #fff7e8; }
.inline-feedback.error { color: var(--red); background: #fff0f0; }

.mode-tabs { display: flex; gap: 7px; padding: 5px; border-radius: 10px; background: var(--soft); margin-bottom: 18px; }
.mode-tabs label { flex: 1; cursor: pointer; }
.mode-tabs input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode-tabs span {
  min-height: 40px; display: grid; place-items: center; border-radius: 7px;
  color: var(--muted); font-size: 13px; font-weight: 650;
}
.mode-tabs input:checked + span { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(48,43,40,.08); }
.option-grid, .profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.option-card, .profile-card, .choice-card {
  position: relative; display: flex; gap: 11px; padding: 15px; border: 1px solid var(--line);
  border-radius: 11px; cursor: pointer; background: var(--canvas); box-shadow: 0 1px 2px rgba(20,47,43,.025);
}
.option-card:hover, .profile-card:hover, .choice-card:hover { border-color: rgba(15,118,110,.3); }
.option-card:has(input:checked), .profile-card:has(input:checked), .choice-card:has(input:checked) {
  border-color: rgba(15,118,110,.62); background: rgba(15,118,110,.07);
}
.option-card input, .profile-card input, .choice-card input { width: 16px; min-height: 16px; flex: 0 0 auto; }
.option-card > span:not(.scope-info, .site-popover), .profile-card > span:last-child,
.choice-card > span:not(.scope-info, .site-popover) { display: grid; gap: 5px; }
.option-card small, .profile-card small, .choice-card small { color: var(--muted); line-height: 1.45; font-size: 11px; }
.profile-card em { color: var(--blue); font-size: 10px; font-style: normal; font-weight: 700; }
.choice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.scope-info {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--canvas); color: var(--blue); font-size: 9px; font-weight: 700;
  cursor: help; outline: none;
}
.scope-info:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(15,118,110,.13); }
.site-popover {
  position: absolute; z-index: 20; top: calc(100% + 7px); right: 0;
  width: min(370px, calc(100vw - 60px)); max-height: 360px; overflow: hidden;
  padding: 12px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--canvas); box-shadow: 0 14px 35px rgba(48,43,40,.18);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .12s, transform .12s, visibility .12s;
  cursor: default;
}
.option-card:hover .site-popover, .choice-card:hover .site-popover,
.scope-info:focus + .site-popover, .site-popover:hover {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.site-popover-head {
  display: flex; justify-content: space-between; gap: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line); font-size: 11px;
}
.site-popover-head em, .site-popover-list em {
  color: var(--red); font-style: normal; font-size: 9px;
}
.site-popover-list {
  max-height: 305px; overflow: auto; display: grid; gap: 0;
}
.site-popover-list > span {
  display: grid; gap: 2px; padding: 7px 2px; border-bottom: 1px solid var(--line);
  color: var(--ink); font-size: 10px;
}
.site-popover-list > span.unavailable { color: var(--tertiary); background: #fff8f8; }
.compact-field, .region-field { max-width: 280px; margin-top: 15px; }
.search-field { display: grid; gap: 6px; min-width: 220px; max-width: 560px; }
.site-toolbar, .jobs-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.site-toolbar .search-field { flex: 1 1 360px; }
.filter-pills {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
}
.filter-pill {
  min-height: 31px; padding: 5px 9px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--canvas); color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 700;
}
.filter-pill:hover { border-color: rgba(15,118,110,.35); color: var(--ink); }
.filter-pill.active {
  border-color: rgba(15,118,110,.45); background: var(--blue-soft); color: var(--blue-strong);
}
.selection-note {
  min-height: 24px; color: var(--muted); font-size: 11px; margin: 10px 0 8px;
  display: flex; align-items: center; gap: 9px;
}
.selection-note span + span { padding-left: 9px; border-left: 1px solid var(--line); }
.selection-note .text-button { margin-left: auto; }
.site-list {
  max-height: 380px; overflow: auto; display: grid;
  grid-template-columns: repeat(3, 1fr); gap: 7px;
}
.site-item {
  padding: 10px; border: 1px solid var(--line); border-radius: 8px;
  display: flex; gap: 8px; cursor: pointer;
}
.site-item:has(input:checked) { border-color: rgba(15,118,110,.35); background: var(--blue-soft); }
.site-item.unavailable { background: #faf8f7; color: var(--tertiary); }
.site-item input { width: 15px; min-height: 15px; }
.site-item span { display: grid; gap: 3px; min-width: 0; }
.site-item strong { font-size: 12px; }
.site-item small { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.site-item .unavailable-note { color: var(--red); }
.all-scope {
  position: relative; padding: 14px 16px; border: 0; border-left: 3px solid var(--blue);
  background: var(--soft); border-radius: 0; display: flex; justify-content: space-between; gap: 14px;
}
.all-scope-site-list { position: relative; min-width: 64px; }
.all-scope-site-list .scope-info { position: static; display: inline-block; }
.all-scope-site-list .site-popover { top: calc(100% + 7px); right: 0; }
.all-scope-site-list:hover .site-popover,
.all-scope-site-list .scope-info:focus + .site-popover {
  opacity: 1; visibility: visible; transform: translateY(0);
}

.field-grid { padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.advanced-output-body { padding: 0 2px 16px; }
.toggle-line {
  display: flex; align-items: flex-start; gap: 9px; padding: 2px 0 14px;
  border-radius: 0; background: transparent;
}
.toggle-line input { width: 16px; min-height: 16px; margin-top: 2px; }
.toggle-line span { display: grid; gap: 3px; }
.toggle-line small, .template-hint { color: var(--muted); font-size: 11px; line-height: 1.5; }
.advanced-output-panel { margin-top: 14px; }
.advanced-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.advanced-columns section { min-width: 0; padding: 0 14px 0 0; border: 0; border-radius: 0; }
.advanced-columns section + section { padding: 0 0 0 14px; border-left: 1px solid var(--line); }
.advanced-columns h4 { margin: 0 0 9px; font-size: 12px; }
.mini-choice-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.mini-choice {
  display: flex; align-items: center; gap: 5px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 6px; font-size: 11px; cursor: pointer;
}
.mini-choice:has(input:checked) {
  border-color: rgba(15,118,110,.5); background: rgba(15,118,110,.07); color: var(--ink);
}
.mini-choice input { width: 14px; min-height: 14px; }
.advanced-fields { padding: 0; margin-bottom: 14px; }
.compact-toggle { margin-bottom: 14px; }
.template-hint { margin: 0; }
.check-field { display: flex; gap: 8px; align-items: center; padding-top: 20px; color: var(--muted); font-size: 12px; }
.check-field input { width: 16px; min-height: 16px; }
.plan-summary {
  margin-top: 22px; padding: 16px 0; border: 1px solid var(--line);
  border-width: 1px 0; border-radius: 0; background: transparent;
  color: var(--ink); display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
}
.plan-summary > div { display: grid; gap: 4px; padding: 0 16px; }
.plan-summary > div:first-child { padding-left: 2px; }
.plan-summary > div + div { border-left: 1px solid var(--line); }
.plan-summary span { color: var(--muted); font-size: 11px; }
.plan-summary strong { font-size: 21px; }
.plan-summary p { grid-column: 1 / -1; margin-top: 12px; padding: 0 2px; color: var(--muted); font-size: 11px; }
.summary-loading, .summary-error {
  grid-column: 1 / -1; border-left: 0 !important; color: var(--muted); font-size: 13px;
}
.summary-error { color: var(--red); }
.wizard-actions { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); justify-content: flex-end; }
.form-error { margin-right: auto; color: var(--red); font-size: 12px; }

.btn {
  border: 1px solid var(--blue); border-radius: 9px; background: var(--blue); color: white;
  min-height: 40px; padding: 8px 15px; font-weight: 750; cursor: pointer;
  box-shadow: 0 1px 2px rgba(9,66,61,.1); transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { background: var(--blue-strong); border-color: var(--blue-strong); transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.secondary { border-color: var(--line); background: var(--canvas); color: var(--ink); }
.btn.secondary:hover { border-color: rgba(15,118,110,.28); background: var(--soft); }
.btn.compact { min-height: 33px; padding: 6px 11px; font-size: 12px; }
.btn.danger { color: var(--red); }
.text-button { padding: 0; border: 0; background: transparent; color: var(--blue); cursor: pointer; }

.progress-track {
  display: block; width: 100%; height: 9px; overflow: hidden; border: 0;
  border-radius: 9px; background: var(--soft-hover); accent-color: var(--blue);
}
.progress-track::-webkit-progress-bar { border-radius: 9px; background: var(--soft-hover); }
.progress-track::-webkit-progress-value { border-radius: 9px; background: var(--blue); }
.progress-track::-moz-progress-bar { border-radius: 9px; background: var(--blue); }
.progress-meta { display: flex; justify-content: space-between; margin: 8px 0 16px; color: var(--muted); font-size: 12px; }
.work-list {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px;
  max-height: 400px; overflow: auto; border-top: 1px solid var(--line);
}
.work-item {
  display: grid; grid-template-columns: 9px minmax(140px, 1fr) minmax(100px, 1fr) auto;
  gap: 8px; align-items: center; padding: 10px 2px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 11px;
}
.work-item > span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.work-item em { color: var(--muted); font-style: normal; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #b5bdc8; }
.status-running .status-dot { background: var(--blue); animation: pulse 1.2s infinite; }
.status-verified_hit .status-dot, .status-verified_empty .status-dot { background: var(--green); }
.status-partial .status-dot, .status-unverified .status-dot, .status-mismatch .status-dot { background: var(--amber); }
.status-blocked .status-dot, .status-failed .status-dot, .status-error_page .status-dot { background: var(--red); }
@keyframes pulse { 50% { opacity: .35; } }

.active-context, .jobs-overview {
  margin: 0 0 18px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line); border-width: 1px 0;
}
.active-context > div, .jobs-overview > div {
  min-width: 0; padding: 11px 14px; display: grid; gap: 4px;
  border-right: 1px solid var(--line);
}
.active-context > div:first-child, .jobs-overview > div:first-child { padding-left: 2px; }
.active-context > div:last-child, .jobs-overview > div:last-child { border-right: 0; }
.active-context span, .jobs-overview span { color: var(--muted); font-size: 10px; }
.active-context strong, .jobs-overview strong {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px;
}
.jobs-overview { grid-template-columns: repeat(4, 1fr); }
.jobs-overview strong { font-size: 20px; }
.jobs-toolbar {
  margin-bottom: 14px; padding: 12px 14px;
  border-radius: 9px; background: var(--soft);
  justify-content: flex-start;
}
.jobs-toolbar .search-field { flex: 1 1 420px; max-width: none; }
.jobs-toolbar .compact-field { flex: 0 0 180px; max-width: none; margin: 0; }
.refresh-state { margin-left: auto; padding-bottom: 10px; color: var(--tertiary); font-size: 10px; white-space: nowrap; }

.jobs-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.job-card {
  display: grid; grid-template-columns: minmax(270px, 1.5fr) minmax(160px, .7fr) auto;
  align-items: center; gap: 18px; padding: 16px 2px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; transition: background .15s;
}
.job-card:hover { background: var(--soft); }
.job-title-line, .result-title-line { display: flex; align-items: center; gap: 10px; }
.job-main p { margin: 4px 0; font-size: 12px; }
.job-main small { color: var(--tertiary); font-size: 10px; }
.job-progress progress {
  display: block; width: 100%; height: 6px; overflow: hidden; border: 0;
  border-radius: 6px; background: var(--soft-hover); accent-color: var(--blue);
}
.job-progress progress::-webkit-progress-bar { border-radius: 6px; background: var(--soft-hover); }
.job-progress progress::-webkit-progress-value { border-radius: 6px; background: var(--blue); }
.job-progress progress::-moz-progress-bar { border-radius: 6px; background: var(--blue); }
.job-progress small { display: block; margin-top: 5px; color: var(--muted); text-align: right; }
.status-badge, .work-status {
  display: inline-block; padding: 3px 7px; border-radius: 999px;
  background: var(--soft-hover); color: var(--muted); font-size: 10px; font-weight: 700;
}
.status-completed, .status-verified_hit, .status-verified_empty { background: #e5f6ed; color: var(--green); }
.status-running { background: var(--blue-soft); color: var(--blue); }
.status-completed_with_issues, .status-partial, .status-unverified, .status-mismatch { background: #fff3db; color: var(--amber); }
.status-failed, .status-blocked, .status-error_page { background: #ffeded; color: var(--red); }

.result-header { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.result-title-line { justify-content: space-between; margin-top: 18px; }
.result-header p { font-size: 11px; display: flex; align-items: center; gap: 9px; }
.copy-job-id { font-size: 10px; }
.result-alert {
  margin-top: 18px; padding: 13px 15px;
  border-left: 3px solid var(--amber); background: #fff8ea;
}
.result-alert strong { color: #75420a; font-size: 13px; }
.result-alert p { margin-top: 4px; color: #7a591d; font-size: 11px; }
.result-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 0; border-left: 3px solid var(--blue);
  border-radius: 0; background: var(--soft);
}
.result-guide h3 { margin: 3px 0 5px; }
.result-guide p, .section-help { margin: 0; color: var(--muted); font-size: 12px; }
.result-guide-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.business-lenses { margin: 20px 0 0; }
.business-lens-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 9px; }
.business-lens-head .section-kicker { margin: 0; }
.business-lens-head h3 { font-size: 13px; }
.business-lens-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface); overflow: hidden;
}
.business-lens-grid.single-lens { grid-template-columns: minmax(260px, 420px); }
.business-lens {
  min-width: 0; padding: 13px 14px; border-right: 1px solid var(--line);
  display: grid; grid-template-columns: 29px minmax(0, 1fr); gap: 4px 9px; align-items: center;
}
.business-lens:last-child { border-right: 0; }
.lens-icon {
  grid-row: 1 / 3; width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center;
  background: var(--blue-soft); color: var(--blue); font-size: 10px; font-weight: 800;
}
.business-lens > div { min-width: 0; display: grid; gap: 1px; }
.business-lens strong { font-size: 14px; }
.business-lens small { color: var(--muted); font-size: 9px; }
.business-lens em { grid-column: 2; color: var(--green); font-size: 8px; font-style: normal; }
.business-lens em.has-issues { color: var(--amber); }
.metric-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0;
  margin: 20px 0; border: 1px solid var(--line); border-width: 1px 0;
}
.metric-grid > div {
  padding: 14px 16px; background: transparent; border: 0;
  border-right: 1px solid var(--line); border-radius: 0; display: grid; gap: 5px;
}
.metric-grid > div:first-child { padding-left: 2px; }
.metric-grid > div:last-child { border-right: 0; }
.metric-grid span { color: var(--muted); font-size: 10px; }
.metric-grid strong { font-size: 22px; }
.result-section { margin-top: 22px; }
.result-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.result-section-head > div { min-width: 0; }
.result-filters { justify-content: flex-end; }
.delivery-section {
  padding: 20px 0;
  border: 1px solid var(--line); border-width: 1px 0;
  border-radius: 0; background: transparent;
}
.subject-results { display: grid; gap: 8px; }
.export-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.subject-result { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.subject-result summary { padding: 12px 14px; display: flex; justify-content: space-between; cursor: pointer; background: var(--soft); }
.subject-result summary span { color: var(--muted); font-size: 11px; }
.result-table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { background: var(--soft); color: var(--muted); text-align: left; font-weight: 700; }
th, td { padding: 9px 11px; border-top: 1px solid var(--line); vertical-align: top; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: var(--muted); }
.export-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px;
  padding: 12px 2px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
}
.export-row div { display: grid; gap: 3px; }
.export-row small, .export-row > span { color: var(--muted); font-size: 10px; }
.export-create select { min-height: 33px; }
.record-tools { display: flex; align-items: flex-end; gap: 10px; }
.compact-search { display: grid; gap: 4px; min-width: min(300px, 55vw); }
.compact-search span { color: var(--muted); font-size: 10px; }
.compact-search input { min-height: 33px; padding-block: 6px; }
.record-count { padding-bottom: 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.record-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.record-card { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 2px; }
.record-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.record-card-head span { color: var(--muted); font-size: 10px; }
.record-card-head h4 { margin: 3px 0 0; font-size: 14px; }
.record-card-head a { white-space: nowrap; color: var(--blue); font-size: 11px; }
.record-card > p { margin: 10px 0; color: var(--muted); font-size: 12px; }
.record-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px 14px; margin: 0; }
.record-card dl div { min-width: 0; }
.record-card dt { color: var(--muted); font-size: 9px; }
.record-card dd { margin: 1px 0 0; overflow-wrap: anywhere; font-size: 11px; }

.account-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 28px;
  border-top: 1px solid var(--line);
}
.account-grid > div {
  padding: 15px 2px; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; display: grid; gap: 5px;
}
.account-grid span { color: var(--muted); font-size: 11px; }
code { overflow-wrap: anywhere; font-size: 11px; }
.credential-dialog {
  width: min(500px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-strong);
  border-radius: 14px; background: var(--canvas); color: var(--ink);
  box-shadow: 0 24px 80px rgba(35, 31, 29, .24);
}
.credential-dialog::backdrop { background: rgba(35, 31, 29, .52); backdrop-filter: blur(3px); }
.credential-dialog form { display: grid; gap: 16px; padding: 28px; }
.credential-dialog h2 { margin: -6px 0 0; font-size: 24px; }
.credential-dialog p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.credential-dialog .field { display: grid; gap: 7px; }
.credential-dialog .field span { color: var(--muted); font-size: 11px; }
.credential-dialog input { width: 100%; }
.credential-dialog .credential-error { min-height: 18px; color: var(--red); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
.account-auth-shell { display: grid; gap: 15px; padding: 28px; }
.account-auth-shell h2 { margin: -5px 0 0; font-size: 24px; }
.account-auth-shell > p { margin: 0; }
.account-auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.account-auth-tabs button { padding: 9px; border-bottom: 2px solid transparent; font-weight: 750; }
.account-auth-tabs button.on { border-bottom-color: var(--blue); color: var(--blue); }
.account-auth-shell form { display: grid; gap: 13px; padding: 0; }
.account-auth-shell form[hidden] { display: none; }
.account-auth-shell .field { display: grid; gap: 7px; }
.billing-account-grid code { color: var(--ink); font-weight: 650; }
.billing-commerce {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 320px);
  gap: 18px; align-items: start; margin-top: 24px;
}
.billing-offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.billing-offer {
  min-width: 0; display: grid; gap: 10px; padding: 16px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--canvas);
}
.billing-offer h4, .billing-checkout h3 { margin: 0; font-size: 15px; }
.billing-offer-price { color: var(--ink); font-size: 22px; font-weight: 800; }
.billing-offer-meta { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.billing-offer .btn { justify-self: start; }
.billing-checkout {
  display: grid; justify-items: center; gap: 10px; padding: 18px;
  border: 1px solid rgba(15,118,110,.24); border-radius: 12px; background: var(--blue-soft);
  text-align: center;
}
.billing-checkout img {
  width: min(220px, 100%); aspect-ratio: 1; padding: 8px; border-radius: 8px;
  background: white; image-rendering: crisp-edges;
}
.billing-checkout > strong { font-size: 18px; }
.billing-checkout > p { margin: 0; color: var(--muted); font-size: 12px; }
.billing-checkout > code { max-width: 100%; color: var(--tertiary); }
.checkout-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.account-directory {
  display: grid; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--canvas);
}
.account-directory-row {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.account-directory-row:last-child { border-bottom: 0; }
.account-directory-row > div { min-width: 0; display: grid; gap: 3px; }
.account-directory-row span { color: var(--muted); font-size: 10px; }
.account-directory-row strong, .account-directory-row code {
  overflow-wrap: anywhere; color: var(--ink); font-size: 11px;
}
.member-add-form {
  display: grid; grid-template-columns: minmax(220px, 1fr) minmax(160px, .45fr) auto;
  gap: 10px; align-items: end; margin-bottom: 8px;
}
.member-add-form .field { display: grid; gap: 6px; }
.member-add-form .btn { align-self: end; }
.member-directory-row { grid-template-columns: minmax(0, .7fr) minmax(0, 1fr) auto; }
.member-controls { display: flex !important; flex-wrap: wrap; align-items: end; gap: 7px; }
.member-controls select { min-width: 128px; }
.password-change-form {
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
}
.empty { grid-column: 1 / -1; padding: 32px 12px; color: var(--muted); text-align: center; font-size: 13px; }
.empty.slim { padding: 15px; }
.error-text { color: var(--red); }
.empty .btn, .empty .text-button { margin-top: 12px; }

.toast-region {
  position: fixed; z-index: 1000; right: 22px; bottom: 22px;
  max-width: min(420px, calc(100vw - 32px)); padding: 11px 14px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--ink); color: white; box-shadow: 0 12px 34px rgba(48,43,40,.2);
  font-size: 12px; line-height: 1.5;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .16s, transform .16s, visibility .16s;
}
.toast-region.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.toast-region[data-tone="success"] { background: #1f6f39; }
.toast-region[data-tone="error"] { background: #9f2837; }

.patent-analysis-workspace { display: grid; gap: 22px; }
.analysis-boundary {
  display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 14px;
  padding: 17px 19px; border: 1px solid #c9daf6; border-left: 4px solid var(--blue);
  border-radius: var(--radius); background: var(--blue-soft);
}
.analysis-boundary strong { color: var(--blue); white-space: nowrap; }
.analysis-boundary p { margin: 0; color: var(--ink); }
.analysis-form { display: grid; gap: 18px; }
.analysis-section {
  display: grid; gap: 17px; padding: 22px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--canvas);
}
.analysis-section .section-heading { margin-bottom: 0; }
.analysis-section .compact-heading h2 { font-size: 20px; }
.analysis-field-grid, .analysis-two-column {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
}
.analysis-section .field { display: grid; gap: 7px; }
.analysis-section .field > span, .implementation-actions legend {
  color: var(--muted); font-size: 12px; font-weight: 700;
}
.analysis-import-box {
  padding: 0; border: 1px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--surface);
}
.analysis-import-box summary {
  padding: 14px 16px; color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer;
}
.analysis-import-content {
  display: flex; align-items: center; gap: 12px; padding: 0 16px 16px;
}
.analysis-import-content .upload-zone { min-width: 0; flex: 1; }
.automatic-drawing-note {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 15px;
  border: 1px solid #b9d5c2; border-radius: 8px; background: #eef8f1;
  color: var(--ink); font-size: 13px; line-height: 1.55;
}
.automatic-drawing-note strong { flex: 0 0 auto; color: var(--green); }
.implementation-actions {
  display: flex; flex-wrap: wrap; gap: 9px 16px; margin: 0; padding: 0; border: 0;
}
.implementation-actions legend { width: 100%; margin-bottom: 2px; }
.implementation-actions label {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 7px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px;
}
.implementation-actions input { accent-color: var(--blue); }
.analysis-submit-row {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 21px 22px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface);
}
.analysis-submit-row p { margin-top: 4px; }
.analysis-result {
  display: grid; gap: 20px; padding: 23px;
  border: 1px solid #b9d5c2; border-radius: var(--radius); background: #fbfefc;
}
.analysis-result-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  padding-bottom: 17px; border-bottom: 1px solid #d8e7dc;
}
.analysis-result-header h2 { margin-top: 3px; }
.analysis-result-header p { max-width: 820px; color: var(--ink); }
.analysis-metrics {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px;
}
.analysis-metrics > div {
  display: grid; gap: 4px; padding: 15px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--canvas);
}
.analysis-metrics span, .analysis-metrics small { color: var(--muted); font-size: 11px; }
.analysis-metrics strong { font-size: 24px; }
.analysis-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.analysis-result-grid section {
  padding: 17px; border: 1px solid var(--line); border-radius: 9px; background: var(--canvas);
}
.analysis-result-grid h3 { margin-bottom: 10px; }
.analysis-result-grid ul, .analysis-result-grid ol {
  display: grid; gap: 8px; margin: 0; padding-left: 21px; color: var(--ink); font-size: 13px; line-height: 1.55;
}
.markdown-preview { border-top: 1px solid #d8e7dc; padding-top: 15px; }
.markdown-preview summary { color: var(--blue); font-size: 13px; font-weight: 700; cursor: pointer; }
.markdown-preview pre {
  max-height: 560px; margin: 14px 0 0; padding: 17px; overflow: auto;
  border: 1px solid var(--line); border-radius: 8px; background: #f7f8fa;
  color: var(--ink); font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

@media (min-width: 1600px) {
  :root {
    --sidebar-width: clamp(264px, 14vw, 288px);
    --content-gutter: clamp(36px, 2.5vw, 44px);
  }
  .sidebar { padding-left: clamp(14px, 1vw, 18px); padding-right: clamp(14px, 1vw, 18px); }
  .brand-copy strong { font-size: 15px; }
  .brand-copy small, .nav-copy small { font-size: 11px; }
  .sidebar-label { font-size: 11px; }
  .nav-copy strong { font-size: 13px; }
  .capability-card strong { font-size: 12px; }
  .catalog-state, .sidebar-capability > p, #user-chip { font-size: 11px; }
  .topbar { padding-top: clamp(36px, 2.5vw, 46px); padding-bottom: 26px; }
  .eyebrow, .section-kicker { font-size: 12px; }
  h1 { font-size: clamp(34px, 2vw, 38px); }
  h2 { font-size: 24px; }
  h3 { font-size: 18px; }
  p { font-size: 15px; }
  .tab-panel { padding-top: 28px; }
  .subject-row label span, .field span, .search-field span { font-size: 12px; }
  .btn.compact { font-size: 13px; }
  .jobs-overview span, .active-context span, .refresh-state { font-size: 11px; }
  .jobs-overview strong { font-size: 22px; }
  .job-main p { font-size: 13px; }
  .job-main small, .status-badge, .work-status { font-size: 11px; }
  .site-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .record-card dl { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1000px) {
  body { --sidebar-width: 226px; }
  .subject-row { grid-template-columns: 100px 1fr 1fr; }
  .subject-row .icon-button { grid-column: -2 / -1; }
  .option-grid, .profile-grid, .site-list { grid-template-columns: repeat(2, 1fr); }
  .choice-grid { grid-template-columns: repeat(3, 1fr); }
  .job-card { grid-template-columns: 1fr auto; }
  .job-progress { grid-column: 1 / -1; grid-row: 2; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .metric-grid > div:nth-child(3) { border-right: 0; }
  .metric-grid > div:nth-child(n+4) { border-top: 1px solid var(--line); }
  .query-snapshot { grid-template-columns: repeat(3, 1fr); }
  .query-snapshot .snapshot-actions {
    grid-column: 1 / -1; margin-top: 10px; padding: 10px 2px 0;
    border-top: 1px solid var(--line); border-right: 0;
    display: flex; justify-content: space-between;
  }
  .analysis-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-hero { grid-template-columns: minmax(0, 1fr) minmax(250px, .7fr); gap: 28px; }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-activity { grid-template-columns: 1fr; gap: 24px; }
  .billing-commerce { grid-template-columns: 1fr; }
  .billing-checkout { justify-self: stretch; }
}

@media (max-width: 760px) {
  body { display: block; height: auto; min-height: 100vh; overflow: auto; }
  .sidebar {
    position: sticky; z-index: 20; top: 0; width: 100%; height: auto; padding: 9px 12px;
    display: flex; flex-direction: row; flex-wrap: nowrap;
    align-items: center; gap: 8px; overflow-x: auto; overflow-y: hidden;
    border-bottom: 1px solid var(--line); box-shadow: 0 4px 16px rgba(72,59,47,.04);
  }
  .brand { flex: 0 0 auto; margin: 0 8px 0 0; }
  .brand-mark { width: 28px; height: 28px; border-radius: 7px; font-size: 15px; }
  .brand-copy small, .nav-copy small, .sidebar-label { display: none; }
  .nav { min-height: 36px; width: auto; white-space: nowrap; padding: 5px 8px; }
  .nav-module { flex: 0 0 auto; min-height: 36px; }
  .nav-symbol { width: 22px; height: 22px; flex-basis: 22px; }
  .sidebar-section, .sidebar-section + .sidebar-section { flex: 0 0 auto; margin: 0; }
  .sidebar-section nav { display: flex; }
  .sidebar-capability { display: none; }
  .sidebar-foot { flex: 0 0 auto; margin-left: auto; padding: 0; border: 0; }
  .user-summary { display: none; }
  .main {
    width: 100%; min-height: calc(100vh - 57px); margin: 0; overflow: visible;
    border-width: 0; border-radius: 0;
  }
  .topbar { padding: 28px 16px 19px; align-items: flex-start; }
  .tab-panel { padding: 20px 16px 46px; }
  .notice { margin: 16px 16px 0; }
  .stepper small { display: none; }
  .stepper li div { display: grid; }
  .stepper li { justify-content: center; gap: 6px; }
  .stepper strong { font-size: 10px; white-space: nowrap; }
  .section-heading, .result-section-head, .result-guide { display: grid; }
  .subject-row, .subject-row:has(label:nth-of-type(2):last-of-type) { grid-template-columns: 1fr; }
  .subject-row .icon-button { grid-column: auto; justify-self: start; }
  .import-grid, .option-grid, .profile-grid, .site-list, .field-grid, .work-list { grid-template-columns: 1fr; }
  .option-grid.service-grid { grid-template-columns: 1fr; }
  .advanced-columns { grid-template-columns: 1fr; }
  .advanced-columns section,
  .advanced-columns section + section { padding: 0; border-left: 0; }
  .advanced-columns section + section { margin-top: 16px; }
  .choice-grid { grid-template-columns: repeat(2, 1fr); }
  .mode-tabs { overflow-x: auto; }
  .mode-tabs label { min-width: 94px; }
  .plan-summary { grid-template-columns: repeat(2, 1fr); }
  .plan-summary > div { padding: 0 12px; border-left: 0; }
  .plan-summary > div:nth-child(even) { border-left: 1px solid var(--line); }
  .plan-summary > div:nth-child(n+3) { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
  .job-card { grid-template-columns: 1fr; }
  .job-progress { grid-column: auto; grid-row: auto; }
  .job-actions { justify-content: flex-start; }
  .result-guide-actions { align-items: stretch; display: grid; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid > div,
  .metric-grid > div:nth-child(3) { border-right: 0; }
  .metric-grid > div:nth-child(odd) { border-right: 1px solid var(--line); }
  .metric-grid > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .export-row { grid-template-columns: 1fr auto; }
  .export-row .btn { grid-column: 1 / -1; }
  .account-grid { grid-template-columns: 1fr; }
  .account-directory-row, .member-add-form, .password-change-form { grid-template-columns: 1fr; }
  .member-controls { align-items: stretch; }
  .member-add-form .btn { justify-self: start; }
  .record-card dl { grid-template-columns: 1fr; }
  .query-snapshot { grid-template-columns: 1fr; margin-top: -12px; }
  .query-snapshot > div {
    padding: 8px 2px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .query-snapshot > div:last-child { border-bottom: 0; }
  .query-snapshot .snapshot-actions {
    grid-column: auto; margin-top: 0; padding-top: 8px; border-top: 0;
  }
  .site-toolbar, .jobs-toolbar { display: grid; align-items: stretch; }
  .site-toolbar .search-field, .jobs-toolbar .search-field,
  .jobs-toolbar .compact-field { min-width: 0; width: 100%; max-width: none; }
  .filter-pills { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .filter-pill { flex: 0 0 auto; }
  .refresh-state { margin-left: 0; padding-bottom: 0; }
  .active-context, .jobs-overview { grid-template-columns: repeat(2, 1fr); }
  .active-context > div:nth-child(2), .jobs-overview > div:nth-child(2) { border-right: 0; }
  .active-context > div:nth-child(n+3), .jobs-overview > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .result-filters { justify-content: flex-start; }
  .record-tools { display: grid; align-items: stretch; }
  .compact-search { min-width: 0; width: 100%; }
  .record-count { padding-bottom: 0; }
  .toast-region { right: 16px; bottom: 16px; }
  .analysis-boundary { grid-template-columns: 1fr; }
  .analysis-field-grid, .analysis-two-column, .analysis-result-grid { grid-template-columns: 1fr; }
  .analysis-submit-row, .analysis-result-header { align-items: stretch; flex-direction: column; }
  .analysis-submit-row .button-row { width: 100%; }
  .analysis-submit-row .btn { flex: 1; }
  .analysis-import-content { align-items: stretch; flex-direction: column; }
  .overview-panel { padding-top: 16px; }
  .overview-hero {
    min-height: 0; padding: 29px 22px; grid-template-columns: 1fr; gap: 24px;
    border-radius: 14px;
  }
  .overview-hero h2 { font-size: clamp(31px, 9vw, 43px); }
  .hero-proof-card { display: none; }
  .module-section { padding-top: 34px; }
  .module-heading { display: grid; align-items: start; }
  .catalog-summary { justify-self: start; white-space: normal; }
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 0; }
  .overview-activity { padding: 22px 18px; grid-template-columns: 1fr; }
  .query-module-banner { grid-template-columns: 34px minmax(0, 1fr); }
  .query-module-banner > .text-button { grid-column: 2; justify-self: start; }
}

@media (max-width: 520px) {
  .brand-copy { display: none; }
  .nav-copy strong { font-size: 11px; }
  .nav-symbol { display: none; }
  .sidebar { gap: 4px; }
  .sidebar-foot .btn { min-height: 32px; padding-inline: 8px; }
  .topbar p { font-size: 12px; }
  .notice { align-items: flex-start; gap: 10px; }
  .topbar { display: grid; }
  .topbar-action { display: none; }
  .overview-search > div { display: grid; }
  .overview-search .btn { width: 100%; }
  .hero-trust-row span:nth-child(n+3) { display: none; }
  .overview-metrics > div { padding: 11px 9px; }
  .recent-job { grid-template-columns: 7px minmax(0, 1fr) 14px; }
  .recent-job-state { display: none; }
}

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