:root {
  --primary: #062746;
  --ink: #0f172a;
  --blue: #0b63ce;
  --blue-deep: #05628f;
  --green: #0f9f6e;
  --violet: #6d28d9;
  --amber: #d4a017;
  --orange: #e07a2f;
  --red: #d92d20;
  --line: #d5deea;
  --muted: #5b6b7c;
  --paper: #eef3f8;
  --surface: #ffffff;
  --soft: #f6f9fc;
  --shadow: 0 18px 50px rgba(6, 39, 70, 0.08);
  --radius: 16px;
  --sidebar: 248px;
  --font: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
/* Keep native HTML hidden attribute effective against author display rules */
[hidden] {
  display: none !important;
}
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(11, 99, 206, 0.08), transparent 55%),
    linear-gradient(180deg, #f5f8fb 0%, var(--paper) 40%, #e9eef5 100%);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.55;
  font-feature-settings: "ss01" on;
}
:focus-visible {
  outline: 3px solid rgba(11, 99, 206, 0.45);
  outline-offset: 2px;
}
.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 1000;
  background: #fff;
  color: var(--primary);
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 800;
}
.skip-link:focus { left: 12px; }

/* Mobile nav toggle + drawer */
.nav-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 60;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 28px rgba(6, 39, 70, 0.28);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .18s var(--ease), opacity .18s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(6, 20, 40, 0.48);
  backdrop-filter: blur(2px);
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 22px 16px 18px;
  background:
    linear-gradient(165deg, #0a8bc9 0%, #05628f 48%, #04486b 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 8px 0 40px rgba(4, 40, 64, 0.18);
}
.brand-mark { display: flex; align-items: center; gap: 12px; }
.brand-mark span {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: #fff;
  color: #0b7fbd;
  font-weight: 900;
  font-size: 18px;
}
.brand-mark strong, .brand-mark small { display: block; }
.brand-mark small { opacity: .72; font-weight: 600; }
.sidebar-lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  opacity: .9;
  font-weight: 600;
}
.sidebar nav { display: grid; gap: 6px; }
.nav-cluster {
  display: grid;
  gap: 4px;
}
.nav-submenu {
  display: grid;
  gap: 4px;
  padding-left: 12px;
}
.sidebar a {
  color: #fff;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  opacity: .92;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.sidebar a:hover { background: rgba(255,255,255,.14); }
.sidebar a.active {
  background: rgba(255,255,255,.2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
  opacity: 1;
}
.sidebar a.subnav-link {
  position: relative;
  padding: 8px 10px 8px 22px;
  border-radius: 10px;
  font-size: 13px;
  opacity: .82;
}
.sidebar a.subnav-link::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.62);
  transform: translateY(-50%);
}
.sidebar a.subnav-link.active {
  opacity: 1;
  background: rgba(255,255,255,.26);
}
.sidebar-foot { margin-top: auto; }
#healthButton {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  color: var(--blue-deep);
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}
#healthButton:hover { filter: brightness(.98); }

/* Main */
main { margin-left: var(--sidebar); padding: 28px 28px 56px; max-width: 1440px; }
.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 4px 22px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(13, 50, 84, 0.08);
}
.kicker {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.top h1 {
  margin: 0;
  color: var(--primary);
  font-size: clamp(32px, 4vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.top-sub {
  margin: 10px 0 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}
.step-rail {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.step-rail li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.step-rail li span {
  width: 22px; height: 22px;
  border-radius: 999px;
  display: grid; place-items: center;
  background: #e8eef7;
  color: var(--primary);
  font-size: 12px;
}
.step-rail li.is-current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.step-rail li.is-current span { background: rgba(255,255,255,.2); color: #fff; }
.step-rail li.is-done { border-color: rgba(15,159,110,.35); color: var(--green); }

.loading-bar {
  height: 3px;
  margin: 0 0 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.toast {
  position: sticky;
  top: 12px;
  z-index: 30;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #062746;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.panel h2 {
  margin: 4px 0 0;
  color: var(--primary);
  font-size: clamp(22px, 2.4vw, 28px);
  letter-spacing: -0.02em;
}
.section-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  max-width: 62ch;
}
.eyebrow {
  color: var(--blue);
  font-weight: 800;
  letter-spacing: .04em;
  font-size: 12px;
  text-transform: uppercase;
}

.hint { color: var(--muted); font-size: 13px; font-weight: 600; margin: 12px 0 0; }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}
.pill.subtle { background: rgba(255,255,255,.65); color: var(--muted); }
.pill.excellent { background: rgba(15,159,110,.14); color: #0b6b49; border-color: transparent; }
.pill.compliant { background: rgba(95,173,116,.16); color: #1f6b3a; border-color: transparent; }
.pill.improve { background: rgba(212,160,23,.16); color: #7a5800; border-color: transparent; }
.pill.warning { background: rgba(224,122,47,.16); color: #8a4b00; border-color: transparent; }
.pill.critical { background: rgba(217,45,32,.14); color: #9f1d1d; border-color: transparent; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .span-2 { grid-column: 1 / -1; }
.input-form label {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  color: var(--primary);
  font-weight: 800;
  font-size: 13px;
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  font: inherit;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover, textarea:hover, select:hover { border-color: #b8c7d9; }
input:focus, textarea:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(11,99,206,.12);
  outline: none;
}
textarea { min-height: 160px; resize: vertical; }
select { cursor: pointer; }
.mini-grid.compact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.form-actions { margin-top: 16px; }
.primary {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 15px 18px;
  background: linear-gradient(180deg, #122c45, #061f36);
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: transform .15s var(--ease), filter .15s ease;
}
.primary:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.primary:disabled { opacity: .55; cursor: wait; }
.error { color: var(--red); font-weight: 700; min-height: 20px; margin: 10px 0 0; }
.empty, .result-empty {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 28px 18px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: var(--soft);
  text-align: center;
}

.export-bar button,
.panel-head button,
#clearHistoryButton {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: var(--primary);
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}
.export-bar button:disabled { opacity: .4; cursor: not-allowed; }
.export-bar button.is-accent {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.bands {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
}
.bands span {
  flex: 1;
  min-width: 108px;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.excellent { background: var(--green) !important; }
.compliant { background: #5fad74 !important; }
.improve { background: var(--amber) !important; color: #2b2100 !important; }
.warning { background: var(--orange) !important; color: #2b1700 !important; }
.critical { background: var(--red) !important; }

.result-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(120deg, #062746, #0b63ce 70%, #0f9f6e);
  color: #fff;
}
.result-hero .eyebrow { color: rgba(255,255,255,.8); }
.result-hero strong {
  display: block;
  font-size: clamp(36px, 5vw, 48px);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-top: 4px;
}
.result-hero p { margin: 0; max-width: 40ch; font-weight: 700; opacity: .92; }

.openai-status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--line);
}
.openai-status.ok { background: rgba(15,159,110,.1); color: #0b6b49; }
.openai-status.warn { background: rgba(224,122,47,.12); color: #8a4b00; }
.openai-status.muted { background: #eef2f7; color: #475569; }

#resultSummary { margin-top: 4px; }
.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.score-card, .intel-card, .brief-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: var(--soft);
}
.score-card {
  position: relative;
  overflow: hidden;
  transition: transform .18s var(--ease);
}
.score-card:hover { transform: translateY(-2px); }
.score-card small { color: var(--blue); font-weight: 900; }
.score-card strong {
  display: block;
  margin: 6px 0 8px;
  font-size: 40px;
  letter-spacing: -0.04em;
  color: var(--primary);
  line-height: 1;
}
.score-card p { margin: 10px 0 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.delta-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  margin: 6px 0 8px; font-size: 12px; font-weight: 800; color: var(--muted);
}
.delta-badge { border-radius: 999px; padding: 3px 8px; background: #e8eef7; color: var(--primary); }
.delta-row.improved .delta-badge { background: rgba(15,159,110,.16); color: #0b6b49; }
.delta-row.regressed .delta-badge { background: rgba(217,45,32,.14); color: #9f1d1d; }
.delta-row.unchanged .delta-badge { background: #eef2f7; color: #475569; }
.delta-line.improved { color: #0b6b49; }
.delta-line.regressed { color: #9f1d1d; }
.page-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.page-link-row button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  background: #fff;
  color: var(--primary);
  font-weight: 850;
  font-family: inherit;
  cursor: pointer;
}
.page-link-row button:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11,99,206,.1);
}

.briefing-hero {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  background: linear-gradient(135deg, #f7fbff, #eff6fb);
  margin-bottom: 14px;
}
.briefing-hero small,
.briefing-list-card small {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.briefing-hero h3 {
  margin: 4px 0 8px;
  color: var(--primary);
  font-size: 20px;
}
.briefing-hero p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}
.briefing-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.briefing-list-card {
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
}
.briefing-list-card.AEO { border-top-color: var(--green); }
.briefing-list-card.GEO { border-top-color: var(--violet); }
.briefing-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.briefing-card-head h3 {
  margin: 4px 0 0;
  color: var(--primary);
}
.briefing-card-head strong {
  color: var(--primary);
  font-size: 30px;
  line-height: 1;
}
.briefing-list-card p {
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.briefing-list-card ol {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}
.briefing-list-card li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: var(--soft);
}
.briefing-list-card li b {
  grid-row: span 2;
  align-self: start;
  border-radius: 999px;
  padding: 2px 7px;
  background: #e8eef7;
  color: var(--primary);
  font-size: 11px;
}
.briefing-list-card li span {
  color: var(--primary);
  font-weight: 850;
}
.briefing-list-card li em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 650;
}
.briefing-list-card button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  background: #fff;
  color: var(--primary);
  font-weight: 850;
  font-family: inherit;
  cursor: pointer;
}
.briefing-list-card button:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11,99,206,.1);
}
.briefing-support-grid {
  margin-top: 14px;
}
.comparison-briefing {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.comparison-brief-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}
.comparison-brief-head small,
.comparison-method small {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.comparison-brief-head h3 {
  margin: 4px 0 6px;
  color: var(--primary);
  font-size: 18px;
}
.comparison-brief-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.comparison-score-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 12px;
  background: #e8eef7;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.comparison-method {
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: 12px;
  padding: 14px;
  background: var(--soft);
}
.comparison-method.AEO { border-top-color: var(--green); }
.comparison-method.GEO { border-top-color: var(--violet); }
.comparison-method h3 {
  margin: 4px 0 10px;
  color: var(--primary);
  font-size: 16px;
}
.comparison-method dl {
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
}
.comparison-method dl div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.comparison-method dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.comparison-method dd {
  margin: 0;
  color: var(--primary);
  font-size: 13px;
  font-weight: 750;
}
.comparison-method ul {
  display: grid;
  gap: 7px;
  margin: 10px 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.comparison-method p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.comparison-result {
  background: #fff;
}
.competitor-brief-table {
  overflow-x: auto;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.competitor-brief-table table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  background: #fff;
}
.competitor-brief-table th,
.competitor-brief-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}
.competitor-brief-table th {
  color: var(--primary);
  background: #edf4fb;
  font-weight: 900;
}
.competitor-brief-table td {
  color: var(--muted);
  font-weight: 650;
}
.competitor-brief-table td strong {
  display: block;
  color: var(--primary);
}
.competitor-brief-table td span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.competitor-brief-table tr:last-child td {
  border-bottom: 0;
}
.own-brand-row td {
  background: #f1fff8;
}
.method-note {
  margin: 12px 0 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff7ed;
  color: #8a4b08;
  font-size: 12px;
  font-weight: 750;
}

.snapshot-compare, .action-checklist, .score-evidence {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.engine-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}
.engine-score-badge {
  min-width: 240px;
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(135deg, #0b63ce, #0f9f6e);
  color: #fff;
}
.engine-score-badge small,
.engine-score-badge span {
  display: block;
  font-weight: 850;
  opacity: .9;
}
.engine-score-badge strong {
  display: block;
  margin: 4px 0;
  font-size: 42px;
  line-height: 1;
}
.engine-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.engine-guide-grid article,
.engine-task-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--soft);
}
.engine-guide-grid small,
.engine-list-head small,
.engine-task-card small {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.engine-guide-grid h3,
.engine-task-card h3 {
  margin: 4px 0 8px;
  color: var(--primary);
}
.engine-guide-grid p,
.engine-task-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.engine-guide-grid ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
/* Capture column removed — workbench is now a single full-width checklist */
.engine-workbench {
  display: block;
}
.engine-work-list {
  display: grid;
  gap: 0;
  align-content: start;
  max-height: none;
  overflow: visible;
  width: 100%;
}
.engine-list-head {
  display: grid;
  gap: 2px;
  padding: 4px 2px;
}
.engine-list-head.compact {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.engine-list-head strong {
  color: var(--primary);
  font-size: 16px;
}
/* engine-preview-panel removed */

/* Full-width checklist table */
.engine-task-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.engine-task-table thead th {
  padding: 10px 12px;
  background: var(--soft);
  border-bottom: 2px solid var(--line);
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
}
.engine-task-table tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.engine-task-table tbody tr:last-child { border-bottom: 0; }
.engine-task-table tbody tr:hover { background: var(--soft); }
.engine-task-table td {
  padding: 12px 12px;
  vertical-align: top;
}
.engine-task-table .td-priority { width: 64px; }
.engine-task-table .td-task { width: 220px; font-weight: 700; color: var(--primary); }
.engine-task-table .td-do { color: var(--ink); line-height: 1.5; }
.engine-task-table .td-owner { width: 120px; font-size: 12px; color: var(--muted); white-space: nowrap; }

.citation-panel, .pdf-extraction {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}
.citation-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.citation-hero strong {
  font-size: 32px;
  letter-spacing: -0.04em;
  color: var(--primary);
  line-height: 1;
}
.citation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.citation-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.citation-card strong {
  display: block;
  font-size: 28px;
  color: var(--primary);
  letter-spacing: -0.03em;
}
.citation-card small { color: var(--muted); font-weight: 700; }
.citation-card ul {
  margin: 8px 0 0;
  padding-left: 16px;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
}
.pdf-extraction p { margin: 6px 0 0; color: #334155; font-size: 13px; font-weight: 600; }

.snap-grid, .evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.evidence-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.snap-grid article, .evidence-grid article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.snap-grid h3 { margin: 4px 0 8px; font-size: 15px; color: var(--primary); }
.snap-grid p { margin: 0 0 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.chip-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.signal-chip {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
}
.signal-chip.ok { background: rgba(15,159,110,.14); color: #0b6b49; }
.signal-chip.miss { background: rgba(217,45,32,.12); color: #9f1d1d; }
.signal-chip.muted { background: #eef2f7; color: #64748b; }
.checklist { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 10px; }
.check-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  list-style: decimal;
}
.check-item strong { display: block; color: var(--primary); }
.check-item span { display: block; font-weight: 800; margin-top: 2px; }
.check-item small { color: var(--muted); font-weight: 700; }
.check-item p { margin: 6px 0 0; color: #334155; font-size: 13px; font-weight: 600; }
.check-item.P0 { border-left: 4px solid var(--red); }
.check-item.P1 { border-left: 4px solid var(--orange); }
.check-item.P2 { border-left: 4px solid var(--green); }

.history-panel {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.history-panel > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}
.history-panel > summary::-webkit-details-marker { display: none; }
.history-panel strong { display: block; color: var(--primary); margin-top: 2px; }
.history-list { display: grid; gap: 8px; margin-top: 8px; }
.history-item {
  width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; padding: 12px 14px; cursor: pointer; display: grid; gap: 4px;
  font-family: inherit;
}
.history-item:hover { border-color: var(--blue); }
.history-item strong { color: var(--primary); }
.history-item small, .history-item span { color: var(--muted); font-size: 12px; font-weight: 700; }

.intelligence-panel details > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
}
.intelligence-panel details > summary::-webkit-details-marker { display: none; }
.intelligence-panel strong { display: block; color: var(--primary); margin-top: 2px; }
.intel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 12px;
}
.intel-loading {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}
.intel-provenance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #b7e2d0;
  border-radius: 14px;
  background: #f1fff8;
}
.intel-provenance div { display: flex; align-items: center; gap: 8px; color: #08794f; }
.intel-provenance p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(22, 165, 106, .13); }
.quality-banner {
  padding: 18px;
  border: 1px solid #f0d5a3;
  border-radius: 14px;
  background: #fffaf0;
}
.quality-banner.partial { border-color: #efc16f; }
.quality-banner.unavailable { border-color: #efb6b6; background: #fff6f6; }
.quality-banner.unavailable > strong { color: #a51d2d; }
.quality-banner.unavailable > p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.quality-grid article { padding: 12px; border: 1px solid rgba(30, 54, 79, .1); border-radius: 12px; background: #fff; }
.quality-grid small { display: block; color: var(--muted); font-size: 11px; font-weight: 800; }
.quality-grid strong { display: block; margin-top: 5px; color: var(--primary); font-size: 15px; }
.quality-grid p { margin: 4px 0 0; color: var(--muted); font-size: 11px; font-weight: 650; }
.quality-caveats { margin: 12px 0 0; padding-left: 18px; color: #805418; font-size: 12px; font-weight: 700; }
.status-pill, .hanwha-benchmark {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 10px;
  background: #edf3fa;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
}
.status-pill.ok { background: #e4faef; color: #08794f; }
.status-pill.unavailable { background: #ffe9e9; color: #a51d2d; }
.measured-metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.measured-metric { border-top: 4px solid var(--blue); background: #fff; }
.measured-metric.AEO { border-top-color: var(--green); }
.measured-metric.GEO { border-top-color: var(--violet); }
.measured-metric > small { color: var(--blue); font-size: 11px; font-weight: 900; }
.measured-metric > strong { display: block; margin: 8px 0 3px; color: var(--primary); font-size: clamp(28px, 4vw, 42px); line-height: 1; }
.measured-metric ul { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; font-weight: 650; }
.competitor-card { cursor: default; }
.competitor-card:hover { transform: none; box-shadow: none; border-color: var(--line); }
.missing-badge { display: inline-block; margin-right: 4px; padding: 3px 6px; border-radius: 999px; background: #fff0d6; color: #8a5b00; font-size: 10px; font-weight: 900; }
.insight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.insight-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.insight-card h3 { margin: 12px 0; color: var(--primary); font-size: 16px; line-height: 1.4; }
.insight-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.insight-head span { color: var(--blue); font-size: 11px; font-weight: 950; }
.insight-head small { color: var(--muted); font-size: 10px; font-weight: 800; }
.insight-evidence { padding: 12px; border-radius: 10px; background: var(--soft); }
.insight-evidence strong { color: var(--primary); font-size: 12px; }
.insight-evidence ul { margin: 7px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; font-weight: 650; }
.insight-flow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.insight-flow article { padding: 11px; border: 1px solid var(--line); border-radius: 10px; }
.insight-flow small { color: var(--green); font-size: 10px; font-weight: 900; }
.insight-flow p { margin: 4px 0 0; color: var(--muted); font-size: 12px; font-weight: 650; }
.measured-result { margin-top: 12px; padding: 11px; border-left: 3px solid var(--blue); background: #f4f8fd; }
.measured-result strong, .measured-result span { display: block; }
.measured-result strong { color: var(--blue); font-size: 11px; }
.measured-result span { margin-top: 4px; color: var(--primary); font-size: 12px; font-weight: 750; }
.evidence-source-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.evidence-source-grid article { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.evidence-source-grid strong { overflow-wrap: anywhere; color: var(--primary); font-size: 12px; }
.evidence-source-grid span { display: block; margin-top: 4px; color: var(--blue); font-size: 11px; font-weight: 900; }
.evidence-source-grid p { margin: 5px 0 0; color: var(--muted); font-size: 11px; font-weight: 650; }
.gap-report-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.gap-report-summary article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.gap-report-summary small,
.gap-question-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}
.gap-report-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--primary);
}
.gap-report-summary p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.gap-question-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.gap-question-columns > div {
  display: grid;
  align-content: start;
  gap: 10px;
}
.gap-question-columns > div > h4 {
  margin: 0;
  color: var(--primary);
  font-size: 14px;
  line-height: 1.45;
}
.gap-question-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: 14px;
  background: #fff;
}
.gap-question-card.AEO { border-top-color: var(--green); }
.gap-question-card.GEO { border-top-color: var(--violet); }
.gap-question-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.gap-question-head span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}
.gap-question-card.AEO .gap-question-head span { background: #e8f8f1; color: var(--green); }
.gap-question-card.GEO .gap-question-head span { background: #f2ecff; color: var(--violet); }
.gap-question-card h4 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}
.gap-question-card p,
.gap-question-card li {
  color: #43566b;
  font-size: 12px;
  line-height: 1.55;
}
.gap-question-card p { margin: 6px 0; }
.gap-question-card ul {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding-left: 18px;
}
.intel-card h3 { margin: 0 0 8px; color: var(--primary); font-size: 15px; }
.intel-card p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.intel-section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 10px;
}
.intel-section-head h3 {
  margin: 2px 0 0;
  color: var(--primary);
  font-size: 17px;
}
.competitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.competitor-card {
  background: #fff;
  min-height: 128px;
  width: 100%;
  color: inherit;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.competitor-card:hover,
.competitor-card.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11,99,206,.1);
  transform: translateY(-2px);
}
.competitor-card small,
.knowledge-card small {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.competitor-explorer {
  margin-top: 14px;
}
.competitor-explorer-shell {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
}
.competitor-explorer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.competitor-explorer-head small,
.competitor-analysis-head small {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.competitor-explorer-head h3,
.competitor-analysis-head h3 {
  margin: 3px 0 6px;
  color: var(--primary);
  font-size: 17px;
}
.competitor-explorer-head p,
.competitor-analysis-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.competitor-explorer-head > span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 12px;
  background: #e8eef7;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}
.competitor-page-layout {
  display: grid;
  grid-template-columns: minmax(240px, .85fr) minmax(0, 1.6fr);
  gap: 14px;
  align-items: start;
}
.competitor-page-list {
  display: grid;
  gap: 8px;
}
.competitor-page-btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--soft);
  color: inherit;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.competitor-page-btn:hover,
.competitor-page-btn.active {
  border-color: var(--green);
  background: #f1fff8;
}
.competitor-page-btn strong {
  display: block;
  color: var(--primary);
  font-size: 14px;
}
.competitor-page-btn span,
.competitor-page-btn em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
}
.competitor-analysis-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #f9fbfd;
}
.competitor-score-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.competitor-score-strip div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.competitor-score-strip small {
  display: block;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}
.competitor-score-strip strong {
  display: block;
  margin-top: 2px;
  color: var(--primary);
  font-size: 24px;
  line-height: 1;
}
.competitor-analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.competitor-analysis-grid article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.competitor-analysis-grid strong,
.competitor-action-note strong {
  display: block;
  color: var(--primary);
  font-size: 13px;
}
.competitor-analysis-grid p,
.competitor-action-note p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.competitor-signal-list {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.competitor-action-note {
  border: 1px solid #b7e2d0;
  border-radius: 12px;
  padding: 12px;
  background: #f1fff8;
}
.knowledge-pack-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.knowledge-card {
  background: #fff;
  border-top: 4px solid var(--blue);
}
.knowledge-card.AEO { border-top-color: var(--green); }
.knowledge-card.GEO { border-top-color: var(--violet); }
.knowledge-card ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.source-note-list {
  display: grid;
  gap: 8px;
}
.source-note-list span {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.engine-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
}
.engine-tabs button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  min-width: 88px;
}
.engine-tabs button:hover { border-color: rgba(11,99,206,.35); }
.engine-tabs button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.engine-tabs button[data-engine="SEO"].active { background: var(--blue); border-color: var(--blue); }
.engine-tabs button[data-engine="AEO"].active { background: var(--green); border-color: var(--green); }
.engine-tabs button[data-engine="GEO"].active { background: var(--violet); border-color: var(--violet); }
.capture-block {
  margin-top: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.capture-grid { margin-top: 8px; }
.overlay.is-dimmed {
  opacity: 0.08;
  pointer-events: none;
  filter: grayscale(0.4);
}

.visual-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  margin-top: 12px;
}
.finding-list { display: grid; gap: 10px; align-content: start; max-height: min(82vh, 960px); overflow: auto; }
.finding-card {
  width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 14px;
  background: #fff; padding: 14px; cursor: pointer; font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.finding-card:hover, .finding-card.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11,99,206,.12);
}
.finding-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 24px;
  margin: 0 8px 6px 0;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--blue);
  background: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
}
.badge {
  float: right; border-radius: 999px; padding: 4px 9px; color: #fff; font-size: 12px; font-weight: 900;
}
.badge.P0 { background: var(--red); }
.badge.P1 { background: var(--orange); color: #2b1700; }
.badge.P2 { background: var(--green); }
.page-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.page-tabs button {
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px;
  background: #fff; font-weight: 800; font-family: inherit; cursor: pointer;
}
.page-tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.browser-frame { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.browser-bar {
  display: flex; align-items: center; gap: 8px; height: 36px;
  background: #eef3f8; padding: 0 12px; color: var(--muted); font-size: 12px; font-weight: 700;
}
.browser-bar span { width: 10px; height: 10px; border-radius: 999px; background: var(--red); }
.browser-bar span:nth-child(2) { background: var(--orange); }
.browser-bar span:nth-child(3) { background: var(--green); }
.browser-bar b {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.preview-canvas {
  position: relative;
  min-height: 680px;
  background: #dce5f0;
  overflow: hidden;
}
.preview-stage {
  position: relative;
  width: 100%;
  height: min(78vh, 900px);
  min-height: 620px;
  background: #d3deeb;
}
.preview-doc-wrap { position: absolute; inset: 0; z-index: 1; background: #fff; }
.preview-doc { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.snapshot-scroll {
  position: absolute; inset: 0; z-index: 1; overflow: auto; background: #eef3f8;
  scrollbar-gutter: stable;
}
.snapshot-surface {
  position: relative; width: 100%; min-height: 100%; background: #fff;
}
.preview-snapshot {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill;
}
.snapshot-surface .overlay-layer { position: absolute; inset: 0; }
.preview-stage[data-preview-type="snapshot"] .preview-legend { position: sticky; top: 12px; margin: 12px; width: fit-content; }
.preview-snapshot:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
.preview-frame-note {
  position: absolute; left: 12px; bottom: 44px; z-index: 2; margin: 0; max-width: 72%;
  padding: 8px 10px; border-radius: 8px; background: rgba(15,23,42,.78); color: #fff;
  font-size: 12px; font-weight: 700; pointer-events: none;
}
.overlay-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.overlay-layer .overlay { pointer-events: auto; }
.preview-legend {
  position: absolute; left: 12px; top: 12px; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.94);
  border: 1px solid var(--line); font-size: 12px; font-weight: 800; pointer-events: none;
}
.preview-legend span { padding: 3px 8px; border-radius: 999px; color: #fff; }
.preview-legend .SEO { background: var(--blue); }
.preview-legend .AEO { background: var(--green); }
.preview-legend .GEO { background: var(--violet); }
.preview-legend em { color: var(--muted); font-style: normal; font-weight: 700; }
.preview-fallback, .preview-fallback-doc, .mock-page {
  position: absolute; inset: 16px; border: 1px solid var(--line); border-radius: 14px;
  background: #fff; padding: 28px; overflow: auto;
}
.preview-stage-empty .preview-doc-wrap {
  background: linear-gradient(180deg, #f8fbfe, #eef4f9);
}
/* ─── FAQ modal ────────────────────────────────────────────────────────── */
dialog.faq-modal {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: min(760px, 92vw);
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(6,39,70,.22);
  background: #fff;
}
dialog.faq-modal::backdrop { background: rgba(6,20,40,.48); backdrop-filter: blur(2px); }
.faq-modal-inner { display: flex; flex-direction: column; height: 100%; max-height: 85vh; }
.faq-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0;
  background: var(--primary);
}
.faq-modal-title { margin: 0; font-size: 16px; font-weight: 800; color: #fff; }
.faq-modal-actions { display: flex; gap: 8px; }
.faq-copy-btn {
  padding: 6px 14px; border: 1px solid rgba(255,255,255,.4); border-radius: 8px;
  background: transparent; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.faq-copy-btn:hover { background: rgba(255,255,255,.15); }
.faq-close-btn {
  width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255,255,255,.15);
  color: #fff; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.faq-modal-body { overflow-y: auto; padding: 20px 24px; flex: 1; }
.faq-title-h1 { font-size: 20px; color: var(--primary); margin: 0 0 16px; }
.faq-section { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 20px 0 6px; }
.faq-q { font-size: 15px; font-weight: 700; color: var(--primary); margin: 20px 0 6px; }
.faq-a { font-size: 14px; color: var(--ink); margin: 0 0 16px; line-height: 1.6; padding-left: 12px; border-left: 3px solid var(--blue); }
.faq-note { font-size: 12px; color: var(--muted); background: var(--soft); padding: 6px 10px; border-radius: 6px; margin: 4px 0; }
.faq-modal-body h1 { font-size: 18px; margin: 0 0 16px; }
.faq-modal-body hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.faq-modal-body li { font-size: 13px; color: var(--muted); margin: 3px 0; }

/* FAQ button in briefing list */
.bl-faq-btn {
  padding: 5px 10px; border: 1px solid var(--green); border-radius: 6px;
  background: transparent; color: var(--green); font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit; white-space: nowrap; margin-top: 4px; display: block;
  transition: background .14s, color .14s;
}
.bl-faq-btn:hover { background: var(--green); color: #fff; }

/* Submit status line shown during analyze */
.submit-status {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  min-height: 1.4em;
}
.submit-status.analyzing {
  color: var(--blue);
  font-weight: 600;
}

.empty-cta-link {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.empty-cta-link:hover { opacity: .85; }

.capture-empty-card {
  display: grid;
  gap: 8px;
  align-content: start;
  text-align: left;
}
.capture-empty-card small,
.capture-viewer-empty small {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}
.capture-empty-card strong,
.capture-viewer-empty strong {
  display: block;
  color: var(--primary);
  font-size: 17px;
}
.capture-empty-card p,
.capture-viewer-empty p {
  margin: 0;
  color: var(--muted);
}
.capture-viewer-empty {
  display: grid;
  place-content: center;
  text-align: center;
  gap: 8px;
}
.mock-page h1 { color: var(--primary); font-size: 28px; line-height: 1.15; max-width: 780px; margin: 0 0 10px; }
.mock-page h2 { color: var(--primary); font-size: 20px; margin: 8px 0; }
.mock-page p { color: var(--muted); max-width: 800px; margin: 0 0 8px; }
.mock-page-caption {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 0 0 14px;
}
.mock-meta { font-size: 14px; font-style: italic; color: var(--muted) !important; }
.mock-text { font-size: 14px; line-height: 1.6; color: #3d5166 !important; }
.mock-url { margin-top: 16px !important; font-size: 12px; }
.mock-url a { color: var(--blue); word-break: break-all; }
.overlay {
  position: absolute;
  border: 2px solid var(--overlay-color, currentColor);
  border-radius: 10px;
  padding: 0;
  background: transparent !important;
  backdrop-filter: none;
  box-shadow: none;
  font-weight: 900;
  cursor: pointer;
  text-align: left;
  color: var(--overlay-color, inherit);
  display: block;
  overflow: visible;
  transition: box-shadow .15s var(--ease), border-width .15s var(--ease);
}
.overlay:hover {
  transform: none;
  border-width: 3px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--overlay-color, currentColor) 18%, transparent);
}
.overlay-index {
  position: absolute;
  left: -14px;
  top: -14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--overlay-color, #0b63ce);
  color: #fff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .24);
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}
.overlay-caption {
  position: absolute;
  left: 14px;
  top: 12px;
  z-index: 1;
  display: grid;
  gap: 2px;
  width: max-content;
  max-width: min(320px, calc(100% - 28px));
  padding: 7px 9px;
  border: 1px solid rgba(15, 23, 42, .14);
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  color: #10233a;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .12);
  pointer-events: none;
}
.overlay-caption strong { font-size: 11px; color: var(--overlay-color, currentColor); }
.overlay-caption em {
  overflow: hidden;
  color: #42566c;
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.overlay.SEO { --overlay-color: var(--blue); color: var(--blue); }
.overlay.AEO { --overlay-color: var(--green); color: var(--green); }
.overlay.GEO { --overlay-color: var(--violet); color: var(--violet); }
.overlay.position-selector { border-style: solid; }
.overlay.position-anchor { border-style: dashed; }
.overlay.position-page { border-style: double; border-width: 4px; }
.overlay.position-heuristic { border-style: dotted; }
.overlay.warning, .overlay.improve { color: #a15b00; }
.overlay.critical { color: var(--red); }
.finding-card.is-selected,
.overlay.is-selected {
  box-shadow: 0 0 0 4px rgba(8, 102, 217, .2);
}
pre {
  white-space: pre-wrap; overflow: auto; max-height: 260px;
  border-radius: 12px; padding: 14px; background: #06192d; color: #fff; font-size: 12px;
}

/* Measured finding workbench */
.finding-workbench {
  --work-blue: #0866d9;
  --work-ink: #0b1f35;
  --work-line: #d8e1ec;
  --work-soft: #f7f9fc;
  --work-green: #0b8f63;
  --work-warning: #c97700;
  margin-top: 22px;
  border: 1px solid var(--work-line);
  border-radius: 18px;
  background: #fff;
  color: var(--work-ink);
  overflow: hidden;
}
.workbench-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 28px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
  border-bottom: 1px solid var(--work-line);
}
.workbench-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.workbench-title-line h2 { margin: 5px 0; font-size: clamp(24px, 3vw, 34px); }
.workbench-header p { margin: 6px 0 0; color: #526579; font-weight: 650; }
.workbench-header .source-meta {
  max-width: 78ch;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
}
.source-badge,
.evidence-state,
.position-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 850;
}
.source-badge.live_url,
.evidence-state.verified,
.position-status.selector { background: #e9f8f2; color: #08744f; }
.source-badge.submitted_html,
.source-badge.pdf { background: #edf5ff; color: #075ab7; }
.source-badge.sample,
.source-badge.unknown,
.evidence-state.missing,
.position-status.heuristic,
.position-status.not-located { background: #fff3df; color: #965900; }
.workbench-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.copy-action,
.secondary-action {
  min-height: 40px;
  border: 1px solid var(--work-line);
  border-radius: 10px;
  padding: 9px 12px;
  background: #fff;
  color: var(--work-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.workbench-actions .copy-action:last-child {
  background: var(--work-ink);
  border-color: var(--work-ink);
  color: #fff;
}
.copy-action:hover,
.secondary-action:hover { border-color: var(--work-blue); color: var(--work-blue); }
.workbench-section { padding: 28px; border-bottom: 1px solid var(--work-line); }
.workbench-section:last-child { border-bottom: 0; }
.section-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.section-kicker > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--work-line);
  border-radius: 999px;
  color: var(--work-blue);
  font-size: 11px;
  font-weight: 900;
}
.section-kicker small { display: block; color: #718196; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.section-kicker h3 { margin: 1px 0 0; font-size: 20px; color: var(--work-ink); }
.evidence-table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; border: 1px solid var(--work-line); border-radius: 12px; }
.evidence-table { width: 100%; min-width: 760px; border-collapse: collapse; text-align: left; }
.evidence-table th,
.evidence-table td { padding: 13px 15px; border-bottom: 1px solid var(--work-line); vertical-align: top; }
.evidence-table thead th { background: var(--work-soft); color: #526579; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.evidence-table tbody th { width: 150px; color: var(--work-ink); font-size: 13px; }
.evidence-table td { color: #40546a; font-size: 13px; overflow-wrap: anywhere; }
.evidence-table td small { display: block; margin-top: 5px; color: #72849a; }
.evidence-table tr:last-child th,
.evidence-table tr:last-child td { border-bottom: 0; }
.missing-value { color: var(--work-warning); font-weight: 800; }
.planning-decision-grid {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  grid-template-areas:
    "problem solution"
    "problem impact";
  border: 1px solid var(--work-line);
  border-radius: 12px;
  overflow: hidden;
}
.planning-decision-grid article { min-width: 0; padding: 20px; }
.planning-decision-grid small { display: block; margin-bottom: 8px; color: var(--work-blue); font-weight: 900; }
.planning-decision-grid strong { display: block; color: var(--work-ink); font-size: 14px; line-height: 1.65; }
.planning-problem { grid-area: problem; background: #fff; border-right: 1px solid var(--work-line); }
.planning-solution { grid-area: solution; background: #f7fbff; border-bottom: 1px solid var(--work-line); }
.planning-impact { grid-area: impact; background: var(--work-soft); }
.planning-solution small { color: #075ebf; }
.planning-impact small { color: #3d6d55; }
.rule-evidence { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 14px 0 0; list-style: none; }
.rule-evidence li { padding: 6px 9px; border-radius: 999px; background: var(--work-soft); color: #526579; font-size: 11px; font-weight: 800; }
.copy-compare-grid,
.execution-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.copy-column {
  border: 1px solid var(--work-line);
  border-radius: 12px;
  padding: 18px;
  background: #fff;
}
.copy-column.to-be { border-color: #9dc3ef; background: #f7fbff; }
.copy-column > div:first-child { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.copy-column > div small { color: var(--work-blue); font-weight: 900; }
.copy-column dl { margin: 0; display: grid; gap: 10px; }
.copy-column dt { display: flex; justify-content: space-between; gap: 8px; align-items: center; color: #617389; font-size: 12px; font-weight: 850; }
.copy-column dd { margin: -5px 0 2px; padding: 10px 0; border-bottom: 1px solid var(--work-line); color: var(--work-ink); overflow-wrap: anywhere; white-space: normal; word-break: break-word; }
.no-change-note { font-size: 11px; color: var(--muted); font-style: italic; }
.copy-column dd:last-child { border-bottom: 0; }
.copy-column .copy-action { min-height: 32px; padding: 5px 8px; }
.assumption-note { margin: 12px 0 0; padding: 10px; border-left: 3px solid var(--work-warning); background: #fff8ea; color: #795018; font-size: 12px; }
.change-list { display: grid; gap: 8px; margin-top: 14px; }
.change-list article { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 4px 14px; padding: 12px 14px; border: 1px solid var(--work-line); border-radius: 10px; }
.change-list span { overflow-wrap: anywhere; color: #40546a; }
.change-list p { grid-column: 2; margin: 0; color: #718196; font-size: 12px; }
.location-grid { display: grid; grid-template-columns: .72fr 1.45fr 1fr 1.25fr auto; gap: 10px; align-items: stretch; }
.location-grid article { min-width: 0; padding: 14px; border: 1px solid var(--work-line); border-radius: 10px; background: var(--work-soft); }
.location-grid small { display: block; color: #718196; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.location-grid code,
.location-grid strong { display: block; margin-top: 5px; overflow-wrap: anywhere; font-size: 12px; }
.location-marker-card { display: grid; align-content: start; }
.location-index { display: inline-grid; place-items: center; width: fit-content; min-width: 42px; min-height: 28px; padding: 4px 9px; border-radius: 999px; background: var(--work-blue); color: #fff; font-size: 12px; font-weight: 900; }
.position-context { display: block; margin-top: 5px; color: #718196; font-size: 11px; line-height: 1.45; }
.annotated-code-panel { min-width: 0; overflow: hidden; border: 1px solid var(--work-line); border-radius: 12px; background: #081a2c; }
.annotated-code-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; background: #f1f5fa; color: var(--work-ink); }
.annotated-code-head > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.annotated-code-head > div > div { min-width: 0; }
.annotated-code-head strong,
.annotated-code-head small { display: block; }
.annotated-code-head small { margin-top: 3px; color: #617389; overflow-wrap: anywhere; }
.annotated-code-note { margin: 0; padding: 11px 16px; border-top: 1px solid var(--work-line); border-bottom: 1px solid rgba(255,255,255,.12); background: #eaf4ff; color: #294761; font-size: 12px; line-height: 1.55; }
.annotated-code-note code { color: #075ebf; font-weight: 800; }
.annotated-code-panel pre { margin: 0; min-height: 260px; max-height: 680px; overflow: auto; border-radius: 0; background: #081a2c; white-space: pre; }
.annotated-code-panel pre:focus-visible { outline: 3px solid rgba(8, 102, 217, .55); outline-offset: -3px; }
.execution-grid article { padding: 18px; border: 1px solid var(--work-line); border-radius: 12px; background: var(--work-soft); }
.execution-grid h4 { margin: 0 0 10px; }
.execution-grid ol,
.execution-grid ul { display: grid; gap: 8px; margin: 0; padding-left: 20px; color: #40546a; }
.copy-fallback { padding: 18px 28px 28px; background: #fff8ea; }
.copy-fallback label { display: block; margin-bottom: 8px; color: #795018; font-size: 12px; font-weight: 800; }
.copy-fallback textarea { min-height: 180px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.finding-workbench .copy-action { min-height: 44px; }
.finding-workbench button:focus-visible,
.finding-card:focus-visible,
.overlay:focus-visible { outline: 3px solid rgba(8, 102, 217, .45); outline-offset: 3px; }

@media (max-width: 768px) {
  .intel-provenance { align-items: flex-start; flex-direction: column; }
  .quality-grid, .measured-metric-grid, .insight-grid, .insight-flow, .gap-report-summary, .gap-question-columns { grid-template-columns: 1fr; }
  .workbench-header { display: grid; padding: 20px; }
  .workbench-actions { justify-content: stretch; }
  .workbench-actions .copy-action { flex: 1 1 100%; min-height: 44px; }
  .workbench-section { padding: 20px; }
  .copy-compare-grid,
  .execution-grid,
  .location-grid { grid-template-columns: 1fr; }
  .planning-decision-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "problem"
      "solution"
      "impact";
  }
  .planning-problem { border-right: 0; border-bottom: 1px solid var(--work-line); }
  .change-list article { grid-template-columns: 1fr; }
  .change-list p { grid-column: 1; }
  .copy-action,
  .secondary-action { min-height: 44px; }
  .finding-workbench .copy-action { min-height: 44px; }
  .annotated-code-head { align-items: stretch; flex-direction: column; }
  .annotated-code-head .copy-action { width: 100%; }
}

@media print {
  .sidebar, .export-bar, #input, .history-panel, .toast, .loading-bar, .step-rail { display: none !important; }
  main { margin: 0; padding: 0; max-width: none; }
  .panel { box-shadow: none; break-inside: avoid; }
  .action-checklist, #visualAudit, #resultPanel, #seoGuide, #aeoGuide, #geoGuide, #briefing, #intelligence { display: block !important; }
}
@media (max-width: 1100px) {
  .nav-toggle { display: flex; }
  .sidebar-backdrop:not([hidden]) { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 300px);
    z-index: 50;
    transform: translateX(-105%);
    transition: transform .24s var(--ease);
    box-shadow: 12px 0 40px rgba(4, 40, 64, 0.28);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open { overflow: hidden; }
  main { margin-left: 0; padding: 72px 16px 40px; }
  .top { flex-direction: column; align-items: flex-start; }
  .form-grid, .score-grid, .briefing-list, .comparison-grid, .intel-grid, .competitor-grid, .competitor-page-layout, .competitor-score-strip, .competitor-analysis-grid, .knowledge-pack-grid, .visual-grid, .engine-page-head, .engine-guide-grid, .engine-workbench, .evidence-grid, .snap-grid, .guide-grid, .citation-grid {
    grid-template-columns: 1fr;
  }
  .comparison-brief-head {
    display: grid;
  }
  .competitor-explorer-head {
    display: grid;
  }
  .comparison-score-pill {
    justify-self: start;
  }
  .engine-page-head { display: grid; }
  .engine-score-badge { min-width: 0; }
  .sidebar-foot { margin-top: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ─── BRIEFING LIST PAGE ──────────────────────────────────────────────────── */

/* Migration status indicator */
.migration-status {
  font-size: 12px;
  color: var(--blue);
  background: #eff8ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 8px 14px;
  margin: 0 0 12px;
  font-weight: 600;
}
.migration-status:empty { display: none; }

.briefing-list-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.briefing-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.briefing-list-header h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--primary);
}

.briefing-list-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.briefing-list-count {
  flex-shrink: 0;
  padding: 4px 12px;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  align-self: flex-start;
  margin-top: 2px;
}
.bl-source-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.bl-source-tag.db { background: #d1fae5; color: #065f46; }
.bl-source-tag.memory { background: #fef3c7; color: #92400e; }
.bl-source-tag.local { background: #f3f4f6; color: #6b7280; }

/* Checkbox column */
.bl-th-check { width: 36px; text-align: center; }
.bl-check-cell { width: 36px; text-align: center; vertical-align: middle; }
.bl-row-check, #blCheckAll { cursor: pointer; width: 16px; height: 16px; }

/* Delete toolbar button */
.bl-delete-btn {
  padding: 5px 12px; border: 1px solid var(--red); border-radius: 6px;
  background: transparent; color: var(--red); font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit; white-space: nowrap; transition: background .14s, color .14s;
}
.bl-delete-btn:not(:disabled):hover { background: var(--red); color: #fff; }
.bl-delete-btn:disabled { opacity: .4; cursor: default; }

/* Analysis list table */
.bl-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.bl-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  text-align: left;
  background: var(--surface);
}

.bl-table thead th {
  padding: 11px 14px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
}

.bl-table tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background .12s;
}

.bl-table tbody tr:last-child { border-bottom: 0; }
.bl-table tbody tr:hover { background: var(--soft); }

.bl-table td {
  padding: 12px 14px;
  font-size: 13px;
  vertical-align: middle;
}

.bl-th-title { min-width: 180px; }
.bl-th-score { width: 56px; text-align: center; }

/* Allow long titles (e.g. 한화파워 brand suffix) to wrap — never ellipsis */
.bl-title-cell { min-width: 180px; max-width: 320px; }

.bl-title-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: normal;   /* allow wrap — 한화파워 must not be clipped */
  word-break: break-word;
}
.bl-title-btn:hover { color: var(--primary); }

.bl-url-cell { min-width: 180px; max-width: 260px; }

.bl-url-link {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
  text-decoration: none;
}
.bl-url-link:hover { color: var(--blue); text-decoration: underline; }

.bl-score {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.bl-good { color: #0a7f5e; }
.bl-fair { color: #92400e; }
.bl-improve { color: var(--primary); }
.bl-muted { color: var(--muted); }

.bl-lang {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.bl-date {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.bl-md-btn {
  padding: 5px 10px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background .14s, color .14s;
}
.bl-md-btn:hover { background: var(--blue); color: #fff; }

/* Detailed briefing collapsible */
.briefing-detail-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.briefing-detail-summary {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.briefing-detail-summary::-webkit-details-marker { display: none; }
.briefing-detail-summary::before {
  content: '▶';
  font-size: 10px;
  transition: transform .2s var(--ease);
}
.briefing-detail-wrap[open] .briefing-detail-summary::before { transform: rotate(90deg); }

#briefingDetailBody {
  padding: 16px;
}

.briefing-detail-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* Mobile */
@media (max-width: 768px) {
  .bl-table-wrap { border-radius: 8px; }
  .briefing-list-header { flex-direction: column; gap: 8px; }
}

/* ─── 3-SECTION ENGINE GUIDE ──────────────────────────────────────────────── */

.engine-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 24px;
  overflow: hidden;
}

.section-step-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--primary);
  color: #fff;
}

/* GEO Citation Section */
.geo-citation-section .section-step-kicker { background: #1e3a5f; }
.citation-intro { font-size: 13px; color: var(--muted); margin: 0 0 16px; line-height: 1.5; }
.geo-citation-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.geo-citation-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.citation-num { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.citation-body { flex: 1; min-width: 0; }
.citation-url { font-size: 13px; font-weight: 700; color: var(--blue); word-break: break-all; text-decoration: none; }
.citation-url:hover { text-decoration: underline; }
.citation-why { font-size: 12px; color: var(--muted); margin: 4px 0 0; line-height: 1.4; }
.citation-note { font-size: 10px; background: #fef3c7; color: #92400e; padding: 2px 6px; border-radius: 8px; font-weight: 600; }

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.step-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.engine-section-body {
  padding: 20px;
}

/* Score section */
.score-section-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}

.score-section-rationale {
  flex: 1;
  min-width: 0;
}

.score-rationale-text {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.5;
}

.score-delta-text {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
}

.score-site-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  background: #f0f4f8;
  border-left: 3px solid var(--blue);
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
}

/* Evidence table note */
.evidence-note {
  display: block;
  margin-top: 4px;
  color: var(--orange);
  font-size: 11px;
}

/* Legacy gap grid — kept for any older references, hidden in new layout */
.competitor-gap-grid { display: none; }

/* New competitor gap stack — vertical rows */
.cgap-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cgap-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cgap-row--nourl {
  background: var(--soft);
  border-color: #e0e4ea;
  padding: 12px 16px;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.cgap-row-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.cgap-company {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}

.cgap-source-note {
  font-size: 11px;
  background: #fef3c7;
  color: #92400e;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}

.cgap-url {
  font-size: 12px;
  color: var(--blue);
  word-break: break-all;
  text-decoration: none;
  flex: 1;
  min-width: 0;
}
.cgap-url:hover { text-decoration: underline; }

.cgap-url-none {
  font-size: 12px;
  color: var(--muted);
}

.cgap-nourl-note {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.cgap-evidence {
  margin: 0;
  padding: 0 0 0 14px;
  font-size: 12px;
  color: var(--muted);
  background: var(--soft);
  border-radius: 8px;
  padding: 8px 12px;
  list-style: disc;
}

.cgap-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cgap-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

.cgap-diffs {
  margin: 0;
  padding: 0 0 0 14px;
  font-size: 13px;
  color: var(--ink);
  list-style: disc;
}

.cgap-improvements {
  margin: 0;
  padding: 0 0 0 14px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}

.cgap-improvements li {
  margin-bottom: 4px;
  line-height: 1.45;
}

.gap-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gap-card--unmeasured {
  background: #f9f9fb;
  border-color: #e0e4ea;
  opacity: .85;
}
.gap-card--intel {
  background: #f5f9ff;
  border-color: #c3d8f5;
}

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

.gap-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.gap-card-status {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}

.status-fetched {
  background: #d1fadf;
  color: #065f38;
}

.status-unmeasured {
  background: #f3f4f6;
  color: #6b7280;
}
.status-intel {
  background: #dbeafe;
  color: #1e40af;
}
.status-blocked {
  background: #fef3c7;
  color: #92400e;
}
.gap-card--blocked {
  background: #fffbeb;
  border-color: #fde68a;
}

.gap-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gap-card-url {
  font-size: 11px;
  color: var(--blue);
  word-break: break-all;
  text-decoration: none;
}
.gap-card-url:hover { text-decoration: underline; }

.gap-card-facts {
  margin: 0;
  padding: 0 0 0 14px;
  font-size: 12px;
  color: var(--muted);
}

.gap-card-section { display: flex; flex-direction: column; gap: 4px; }

.gap-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

.gap-list {
  margin: 0;
  padding: 0 0 0 14px;
  font-size: 12px;
}

.gap-list--ahead li { color: var(--muted); }
.gap-list--lacks li { color: var(--orange); }

.gap-card-nodata {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.gap-card-unmeasured-body {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gap-card-intel-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gap-card-intel-note {
  font-size: 11px;
  color: var(--blue);
  font-weight: 700;
  margin: 0;
}
.gap-card-action {
  font-size: 12px;
  color: var(--ink);
  margin: 2px 0 0;
  line-height: 1.45;
}
.gap-card-probe-note {
  font-size: 10px;
  color: var(--muted);
  margin: 4px 0 0;
  font-style: italic;
}

.gap-card-ref-link {
  font-size: 12px;
  color: var(--blue);
  text-decoration: none;
  word-break: break-all;
}
.gap-card-ref-link:hover { text-decoration: underline; }

/* Paste guide blocks */
.paste-guide-note {
  font-size: 13px;
  color: var(--muted);
  background: var(--soft);
  border-left: 3px solid var(--blue);
  padding: 8px 12px;
  margin: 0 0 16px;
  border-radius: 0 6px 6px 0;
}

.paste-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
}

.paste-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  gap: 8px;
}

.paste-block-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  min-width: 0;
}

.paste-copy-btn {
  flex-shrink: 0;
  padding: 4px 12px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.paste-copy-btn:hover { background: var(--blue); color: #fff; }

.paste-block-warning {
  margin: 8px 14px 0;
  padding: 6px 10px;
  font-size: 12px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
}

.paste-block-code {
  margin: 0;
  padding: 14px;
  font-size: 12px;
  line-height: 1.6;
  background: #1e293b;
  color: #e2e8f0;
  overflow-x: auto;
  white-space: pre;
  border-radius: 0 0 10px 10px;
}

.paste-block-code code {
  font-family: "Fira Code", "Cascadia Code", Consolas, monospace;
}

/* Workbench details/summary */
.workbench-details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  margin-bottom: 24px;
}

.workbench-summary {
  padding: 14px 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.workbench-summary::-webkit-details-marker { display: none; }
.workbench-summary::before {
  content: '▶';
  font-size: 10px;
  transition: transform .2s var(--ease);
}
.workbench-details[open] .workbench-summary::before { transform: rotate(90deg); }

/* subsection helpers */
.subsection-head {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 10px;
}
.subsection-note {
  font-size: 12px;
  color: var(--muted);
  margin: -6px 0 12px;
}
.topic-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: var(--blue);
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}
.mt-lg { margin-top: 28px; }

/* Mobile adjustments for new sections */
@media (max-width: 768px) {
  .competitor-gap-grid { grid-template-columns: 1fr; }
  .score-section-row { flex-direction: column; }
  .workbench-details > .engine-guide-grid,
  .workbench-details > .engine-workbench { grid-template-columns: 1fr; }
}
