:root {
  --ey-yellow: #ffe600;
  --ey-dark: #2e2e38;
  --ey-near-black: #1a1a24;
  --ey-gray: #747480;
  --ey-link: #0f69ae;
  --card: #ffffff;
  --bg: #f4f4f8;
  --border: #e1e1ea;
  --text: #2e2e38;
  --text2: #4a4a57;
  --text3: #6b6b78;
  --text-muted: #8a8a96;
  --green: #16803c;
  --green-bg: #e8f7ee;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --red: #b91c1c;
  --red-bg: #fde8e8;
  --blue: #075985;
  --blue-bg: #e0f2fe;
}

* { box-sizing: border-box; }

/* The attribute has to beat any display rule set on the element itself, or a hidden
   flex/grid container stays on screen — as a full-screen overlay it eats every click. */
[hidden] { display: none !important; }

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

.beam { height: 4px; background: var(--ey-yellow); }

header.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--ey-near-black);
  padding: 14px 28px;
  color: #fff;
}
header.topbar img { height: 34px; }
header.topbar .title { font-size: 1.1rem; font-weight: 800; }
header.topbar .title span { color: var(--ey-yellow); }
header.topbar .topbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.auth-notice { max-width: 1180px; margin: 0 auto; padding: 0 28px; color: var(--red); font-size: .82rem; }
.auth-notice:empty { display: none; }

.pill {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 4px 12px;
  border-radius: 20px;
  background: #33333f;
  color: #d4d4dc;
  border: 1px solid #43434f;
}
.pill.ok { background: #14351f; color: #7ee2a8; border-color: #1f5230; }
.pill.bad { background: #3a1717; color: #fca5a5; border-color: #5c2020; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 28px 60px; }

.disclaimer {
  background: var(--amber-bg);
  border: 1px solid #fcd34d;
  color: #7c4a03;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.8rem;
  margin-bottom: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 20px;
}
.card h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card h3 {
  margin: 22px 0 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text3);
}
.card .step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ey-yellow);
  color: var(--ey-near-black);
  font-size: 0.75rem;
  font-weight: 800;
}
.lede { font-size: 0.82rem; color: var(--text3); line-height: 1.55; margin: 0 0 16px; }
.lede a { color: var(--ey-link); }

/* ---------- form ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 5px; font-size: 0.78rem; color: var(--text2); }
.field.wide { grid-column: 1 / -1; }
.field > span { font-weight: 600; }
.field em { font-style: normal; color: var(--red); font-size: 0.7rem; margin-left: 4px; }
input, select, textarea {
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--ey-yellow);
  outline-offset: -1px;
  border-color: #c9c9d6;
}
input.invalid { border-color: var(--red); background: #fffafa; }

.link-toggle {
  margin-top: 16px;
  background: none;
  border: none;
  color: var(--ey-link);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}
.advanced { margin-top: 16px; padding-top: 18px; border-top: 1px solid var(--border); }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: var(--ey-link);
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- guided input tiles: entry point ---------- */
.tiles-cta { margin-bottom: 16px; }
.tile-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  background: linear-gradient(180deg, #fff 0%, #fafafe 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.tile-cta:hover {
  border-color: #cfcfdb;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(26, 26, 36, .10);
}
.tile-cta:active { transform: none; box-shadow: none; }
.tile-cta:focus-visible { outline: 2px solid var(--ey-yellow); outline-offset: 2px; }
.tile-cta .tc-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--ey-yellow);
  color: var(--ey-near-black);
}
.tile-cta .tc-mark svg { display: block; }
.tile-cta .tc-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tile-cta .tc-title { font-size: 0.88rem; font-weight: 800; color: var(--text); }
.tile-cta .tc-sub { font-size: 0.76rem; color: var(--text3); line-height: 1.5; }
.tile-cta .tc-state {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 14px;
  background: #f1f1f6;
  color: var(--text3);
  white-space: nowrap;
}
.tile-cta .tc-state.part { background: var(--amber-bg); color: var(--amber); }
.tile-cta .tc-state.done { background: var(--green-bg); color: var(--green); }
.tile-cta .tc-go {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 1rem;
  transition: transform .16s ease, color .16s ease;
}
.tile-cta:hover .tc-go { transform: translateX(3px); color: var(--ey-dark); }

.tile-extras {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.tile-extras h4 {
  margin: 0 0 10px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text3);
}
.tx-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px; }
.tx-item {
  font-size: 0.78rem;
  color: var(--text2);
  background: #fafafe;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 11px;
  line-height: 1.5;
}
.tx-item b { display: block; font-size: 0.72rem; color: var(--text3); font-weight: 700; }

/* ---------- guided input tiles: panel ---------- */
.tile-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(26, 26, 36, .5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  animation: tp-fade .18s ease;
}
.tp-shell {
  background: var(--card);
  border-radius: 14px;
  width: 100%;
  max-width: 1120px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .32);
  animation: tp-rise .2s cubic-bezier(.2, .7, .3, 1);
}
@keyframes tp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tp-rise { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .tile-panel, .tp-shell { animation: none; }
  .tile-cta, .sec-tile, .q-tile, .chip, .tc-go { transition: none; }
}

.tp-head {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 16px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.tp-heading { min-width: 0; }
.tp-title { font-size: 1.05rem; font-weight: 800; }
.tp-sub { font-size: 0.78rem; color: var(--text3); line-height: 1.55; margin-top: 4px; max-width: 680px; }
.tp-progress {
  margin-left: auto;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-top: 2px;
}
.tp-progress .tp-count { font-size: 0.74rem; font-weight: 700; color: var(--text2); white-space: nowrap; }
.tp-progress .tp-bar {
  display: block;
  width: 132px;
  height: 5px;
  border-radius: 3px;
  background: #ebebf2;
  overflow: hidden;
}
.tp-progress .tp-bar span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--ey-yellow);
  transition: width .2s ease;
}

.tp-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(184px, 1fr));
  gap: 10px;
  padding: 14px 22px;
  background: #fafafe;
  border-bottom: 1px solid var(--border);
}
.sec-tile {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 13px 11px;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.sec-tile:hover { border-color: #cfcfdb; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26, 26, 36, .08); }
.sec-tile:focus-visible { outline: 2px solid var(--ey-yellow); outline-offset: 2px; }
.sec-tile[aria-selected="true"] {
  border-color: var(--ey-near-black);
  box-shadow: inset 0 2px 0 0 var(--ey-yellow), 0 4px 12px rgba(26, 26, 36, .10);
}
.sec-tile .st-tab { font-size: 0.66rem; font-weight: 800; letter-spacing: .5px; color: var(--text-muted); text-transform: uppercase; }
.sec-tile .st-title { font-size: 0.85rem; font-weight: 800; color: var(--text); }
.sec-tile .st-state { font-size: 0.71rem; color: var(--text3); }
.sec-tile .st-bar { display: block; height: 3px; border-radius: 2px; background: #ebebf2; overflow: hidden; margin-top: 2px; }
.sec-tile .st-bar span { display: block; height: 100%; background: var(--ey-gray); transition: width .2s ease; }
.sec-tile.part .st-state { color: var(--amber); font-weight: 700; }
.sec-tile.part .st-bar span { background: var(--amber); }
.sec-tile.done .st-state { color: var(--green); font-weight: 700; }
.sec-tile.done .st-bar span { background: var(--green); }

.tp-body { padding: 18px 22px 22px; overflow-y: auto; flex: 1 1 auto; }
.tp-blurb { font-size: 0.8rem; color: var(--text3); line-height: 1.55; margin: 0 0 14px; max-width: 940px; }
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}
.q-tile {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px 13px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.q-tile:hover { border-color: #cfcfdb; box-shadow: 0 3px 10px rgba(26, 26, 36, .06); }
.q-tile:focus-within { border-color: var(--ey-dark); box-shadow: 0 3px 12px rgba(26, 26, 36, .10); }
.q-tile.filled { border-left: 3px solid var(--green); padding-left: 12px; }
.q-tile.wide { grid-column: 1 / -1; }
.q-tile.note { background: #fafafe; border-style: dashed; }
.q-tile .q-head { display: flex; align-items: center; gap: 8px; }
.q-tile .q-label { font-size: 0.8rem; font-weight: 700; color: var(--text); }
.q-tile .q-req {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--red);
  background: var(--red-bg);
  border-radius: 8px;
  padding: 2px 7px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.q-tile .q-tick {
  margin-left: auto;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.66rem;
  font-weight: 800;
  color: #fff;
  background: transparent;
  transition: background .14s ease;
}
.q-tile.filled .q-tick { background: var(--green); }
.q-tile .q-guide { font-size: 0.73rem; color: var(--text3); line-height: 1.5; }
.q-tile textarea { min-height: 66px; resize: vertical; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 6px 13px;
  background: #fff;
  font-size: 0.76rem;
  font-family: inherit;
  color: var(--text2);
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.chip:hover { border-color: #cfcfdb; background: #fafafe; }
.chip:focus-visible { outline: 2px solid var(--ey-yellow); outline-offset: 1px; }
.chip[aria-pressed="true"] {
  background: var(--ey-near-black);
  border-color: var(--ey-near-black);
  color: #fff;
  font-weight: 700;
}
.chip[aria-pressed="true"]::before { content: "✓ "; color: var(--ey-yellow); }

.row-editor { display: flex; flex-direction: column; gap: 6px; }
.row-editor .re-row { display: flex; gap: 6px; align-items: center; }
.row-editor .re-row input { font-size: 0.78rem; padding: 7px 9px; }
.row-editor .re-del {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 7px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.row-editor .re-del:hover { background: var(--red-bg); border-color: #fca5a5; color: var(--red); }
.row-editor .re-head { display: flex; gap: 6px; font-size: 0.66rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.row-editor .re-head span { flex: 1 1 0; }
.row-editor .re-head .re-spacer { flex: 0 0 28px; }
.row-editor .re-actions { display: flex; gap: 8px; margin-top: 4px; }
.row-editor .re-actions button {
  border: 1px dashed var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 5px 11px;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ey-link);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.row-editor .re-actions button:hover { border-color: var(--ey-link); background: #f5faff; }

.manifest-lines { display: flex; flex-direction: column; gap: 5px; font-size: 0.77rem; color: var(--text2); }
.manifest-lines .ml-row { display: flex; gap: 8px; }
.manifest-lines .ml-name { font-weight: 700; }
.manifest-lines .ml-meta { color: var(--text3); }
.manifest-lines .ml-empty { color: var(--text-muted); }

.tp-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 13px 22px;
  border-top: 1px solid var(--border);
  background: #fafafe;
}
.tp-foot .spacer { flex: 1 1 auto; }
.tp-note { font-size: 0.75rem; color: var(--text3); }
.tp-note.warn { color: var(--amber); font-weight: 600; }
.tp-foot button.ghost, .tp-foot button.primary { padding: 8px 16px; font-size: 0.8rem; }
.tp-foot button.ghost:hover:not(:disabled) { border-color: #cfcfdb; background: #fff; }
.tp-foot button.ghost:disabled { opacity: .4; cursor: not-allowed; }
.tp-foot button.primary:hover { box-shadow: 0 4px 14px rgba(255, 230, 0, .5); }
.tp-foot button:focus-visible, .tp-head button:focus-visible { outline: 2px solid var(--ey-dark); outline-offset: 2px; }

/* ---------- step 3: scope from the knowledge graph ---------- */
.badge-soft {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  padding: 3px 9px;
  border-radius: 12px;
  background: #f1f1f7;
  border: 1px solid var(--border);
  color: var(--text3);
  vertical-align: middle;
}
.badge-soft.warn { background: var(--amber-bg); border-color: #fcd34d; color: var(--amber); }

.scope-unavailable {
  border: 1px solid #fcd34d;
  background: var(--amber-bg);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.82rem;
  color: var(--text2);
}
.scope-unavailable code { font-size: 0.76rem; }

.scope-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}
@media (max-width: 900px) { .scope-grid { grid-template-columns: minmax(0, 1fr); } }
.scope-col { min-width: 0; }
.scope-hint { font-size: 0.76rem; color: var(--text3); margin: 6px 0 10px; line-height: 1.5; }
.signal-head { font-size: 0.78rem; margin: 16px 0 0; color: var(--text2); }

.scope-search {
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}
.scope-search:focus-visible { outline: 2px solid var(--ey-yellow); outline-offset: 1px; border-color: var(--ey-dark); }

.scope-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafafe;
}
.scope-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  font: inherit;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}
.scope-row:last-child { border-bottom: 0; }
.scope-row:hover { background: #fff; }
.scope-row.on { background: #fffdf0; box-shadow: inset 3px 0 0 0 var(--ey-yellow); }
.scope-row.on .jname::before { content: "✓ "; color: var(--green); font-weight: 800; }
/* ISO long names run to 50+ characters; a wrapped row makes the list unscannable. */
.scope-row .jname {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.scope-row .jkind {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
  flex-shrink: 0;
}
.scope-row .jbadges { margin-left: auto; display: flex; gap: 4px; flex-shrink: 0; }

.jbadge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  background: #f1f1f7;
  border: 1px solid var(--border);
  color: var(--text3);
  white-space: nowrap;
}
.jbadge.ok { background: var(--green-bg); border-color: #a7e0bd; color: var(--green); }
.jbadge.p2 { background: var(--blue-bg); border-color: #7dd3fc; color: var(--blue); }
.jbadge.tier { background: #f5f0ff; border-color: #ddd0f5; color: #5b21b6; }
.jbadge.warn { background: var(--amber-bg); border-color: #fcd34d; color: var(--amber); }
.jbadge.qw { background: #fffbe6; border-color: var(--ey-yellow); color: #7a6a00; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip-row .chip { cursor: pointer; }
.chip-row .chip.on {
  background: var(--ey-near-black);
  border-color: var(--ey-near-black);
  color: #fff;
}
.chip-row .chip.on .x { color: var(--ey-yellow); font-weight: 800; margin-left: 2px; }
.selected-row { margin-top: 10px; }

.signal-group { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.signal {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.8rem;
  cursor: pointer;
}
.signal:hover { border-color: #cfcfdb; }
.signal.on { background: #fffdf0; border-color: #e6d97a; }
.signal.derived { cursor: default; background: var(--green-bg); border-color: #a7e0bd; }
/* The global input rule sets width:100% and padding, which turns a checkbox into a block that
   pushes the whole row off screen. */
.signal input[type="checkbox"] {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  accent-color: var(--ey-near-black);
}
.signal .sname { font-weight: 600; color: var(--text); min-width: 0; }
.signal .smeta { margin-left: auto; font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; }
.signal .sfrom { font-size: 0.62rem; font-weight: 700; color: var(--green); white-space: nowrap; }

.scope-result { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 18px; }
.scope-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.scope-kpis .kpi {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fafafe;
  text-align: center;
}
.scope-kpis .kpi-val { font-size: 1.5rem; font-weight: 800; color: var(--ey-near-black); }
.scope-kpis .kpi-label { font-size: 0.72rem; font-weight: 700; color: var(--text2); }
.scope-kpis .kpi-sub { font-size: 0.66rem; color: var(--text-muted); margin-top: 3px; }

.scope-gaps { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.scope-gap {
  font-size: 0.78rem;
  padding: 8px 12px;
  border-left: 3px solid var(--amber);
  background: var(--amber-bg);
  border-radius: 0 8px 8px 0;
  color: var(--text2);
}
.scope-caveat {
  font-size: 0.76rem;
  padding: 10px 12px;
  border-left: 3px solid var(--red);
  background: var(--red-bg);
  border-radius: 0 8px 8px 0;
  color: #7f1d1d;
  margin-bottom: 14px;
}

.scope-tabs { display: flex; gap: 4px; margin: 18px 0 0; border-bottom: 2px solid var(--border); }
.scope-tab {
  padding: 8px 14px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.scope-tab:hover { color: var(--text); }
.scope-tab.active { color: var(--ey-near-black); font-weight: 800; border-bottom-color: var(--ey-yellow); }
.scope-tab:focus-visible { outline: 2px solid var(--ey-dark); outline-offset: 2px; }
.scope-pane { padding-top: 14px; }
.scope-pane h4 { font-size: 0.84rem; margin: 18px 0 6px; color: var(--text); }

.scope-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.scope-table th {
  text-align: left;
  padding: 6px 8px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
}
.scope-table td { padding: 6px 8px; border-bottom: 1px solid #f0f0f5; vertical-align: top; }
.scope-table tbody tr:hover { background: #fafafe; }
.scope-table .mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 0.74rem; color: var(--text3); }
.scope-table .small { font-size: 0.72rem; color: var(--text3); }

.ready {
  font-size: 0.66rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.ready.supported { background: var(--green-bg); color: var(--green); }
.ready.partial { background: var(--amber-bg); color: var(--amber); }
.ready.needs_data { background: #f1f1f7; color: var(--text3); }
.ready.unknown { background: var(--blue-bg); color: var(--blue); }

/* ---- data -> opportunity map ---- */
.map-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  font-size: 0.72rem; color: var(--text2); margin: 12px 0 6px;
}
.map-legend .ml { display: inline-flex; align-items: center; gap: 6px; }
.map-legend .sw { width: 14px; height: 9px; border-radius: 2px; display: inline-block; }
.map-legend .sw.present { background: var(--ey-link); }
.map-legend .sw.absent { background: #d6d6e0; border: 1px dashed var(--ey-gray); }
.map-legend .sw.sup { background: var(--green); }
.map-legend .sw.part { background: var(--amber); }
.map-legend .sw.need { background: #c9c9d4; }
.map-legend .map-reset { margin-left: auto; padding: 3px 10px; font-size: 0.72rem; }

.map-wrap { overflow-x: auto; padding: 4px 0 8px; }
.map-svg { display: block; min-width: 100%; }
.map-svg .mhead {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  fill: var(--text3);
}
.map-svg .msub { font-size: 10px; font-weight: 700; fill: var(--text-muted); }

.map-svg .mlink { fill: none; stroke: var(--ey-link); opacity: .3; transition: opacity .15s; }
.map-svg .mlink.off { stroke: var(--ey-gray); opacity: .2; stroke-dasharray: 3 3; }
.map-svg .mlink.dim { opacity: .05; }
.map-svg .mlink:hover { opacity: .75; }

.map-svg .mnode { cursor: pointer; }
.map-svg .mnode rect { fill: #eef4fb; stroke: #b8d4ea; stroke-width: 1; }
.map-svg .mnode text { font-size: 11px; fill: var(--text); }
.map-svg .mnode .mcount { font-size: 10px; font-weight: 700; fill: var(--text3); }
.map-svg .mnode.absent rect { fill: #f6f6f9; stroke: #d6d6e0; stroke-dasharray: 3 2; }
.map-svg .mnode.absent text { fill: var(--text3); }
.map-svg .mnode.category rect { fill: #fffbe6; stroke: #e8d97a; }
.map-svg .mnode:hover rect { stroke: var(--ey-link); stroke-width: 1.6; }
.map-svg .mnode.sel rect { stroke: var(--ey-near-black); stroke-width: 2; stroke-dasharray: none; }
.map-svg .mnode.dim { opacity: .35; }
.map-svg .mnode:focus { outline: none; }
.map-svg .mnode:focus rect { stroke: var(--ey-near-black); stroke-width: 2; }
/* Written past `.mnode.category rect`: the readiness bar is a rect inside the node it describes,
   so it needs to out-specify the node fill or it disappears into the box. */
.map-svg .mnode .mbar rect.sup { fill: var(--green); }
.map-svg .mnode .mbar rect.part { fill: var(--amber); }
.map-svg .mnode .mbar rect.need { fill: #c9c9d4; }

.map-drill { margin-top: 10px; }
.map-drill-head { font-size: 0.84rem; margin: 6px 0 8px; color: var(--text); }
.map-table { margin-top: 14px; }
.map-table summary {
  cursor: pointer; font-size: 0.75rem; color: var(--ey-link); padding: 4px 0;
}
.map-table .absent-row td { color: var(--text3); }

.jprofile {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fafafe;
}
.jprofile summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.82rem; }
.jprofile summary .jname { font-weight: 700; }
.jprofile .jwhy { font-size: 0.78rem; color: var(--text2); margin: 10px 0 8px; line-height: 1.55; }
.jprofile .jblock { font-size: 0.76rem; color: var(--text2); margin: 8px 0; line-height: 1.55; }
.jprofile .jpage { font-size: 0.66rem; color: var(--text-muted); }
.jprofile .jimpl { font-size: 0.76rem; color: var(--text3); margin: 8px 0 0; padding-left: 20px; line-height: 1.5; }
.scope-rules { font-size: 0.78rem; color: var(--text2); line-height: 1.55; padding-left: 20px; }

/* ---------- checklist ---------- */
.checklist { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.check-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fafafe;
}
.check-group.satisfied { border-color: #a7e0bd; background: var(--green-bg); }
.check-group.missing-core { border-color: #fca5a5; background: var(--red-bg); }
.check-group .cg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text2);
  margin-bottom: 8px;
}
.check-group .cg-head .cg-state { margin-left: auto; font-weight: 700; letter-spacing: 0; text-transform: none; }
.check-items { display: flex; flex-wrap: wrap; gap: 6px; }
.check-item {
  font-size: 0.74rem;
  padding: 3px 10px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text3);
}
.check-item.on { background: var(--ey-near-black); color: #fff; border-color: var(--ey-near-black); }

/* ---------- dropzone + files ---------- */
.dropzone {
  border: 2px dashed #c7c7d4;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  color: var(--text3);
  cursor: pointer;
  transition: .15s;
  background: #fafafe;
}
.dropzone.drag { border-color: var(--ey-yellow); background: #fffef0; color: var(--text); }
.dropzone strong { color: var(--ey-dark); }
.dropzone .hint { font-size: 0.76rem; margin-top: 6px; }

.file-list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.file-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8f8fc;
  padding: 12px 14px;
}
.file-card.core { border-left: 3px solid var(--ey-yellow); }
.file-card .fc-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.file-card .fname { font-size: 0.85rem; font-weight: 700; }
.file-card .fmeta { font-size: 0.72rem; color: var(--text3); }
.file-card .spacer { flex: 1 1 auto; }
.fc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.fc-grid .field { font-size: 0.72rem; min-width: 0; }
.fc-grid .field.type { grid-column: span 2; }
.fc-grid input, .fc-grid select { font-size: 0.78rem; padding: 7px 9px; }
.fc-grid select { text-overflow: ellipsis; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.badge.core { background: var(--ey-yellow); color: var(--ey-near-black); }
.badge.recommended { background: var(--blue-bg); color: var(--blue); }
.badge.optional { background: #f1f1f6; color: var(--text2); }
.badge.pass { background: var(--green-bg); color: var(--green); }
.badge.fail { background: var(--red-bg); color: var(--red); }
.badge.warn { background: var(--amber-bg); color: var(--amber); }
.badge.not_tested { background: #f1f1f6; color: var(--text3); }
.badge.supported { background: var(--green-bg); color: var(--green); }
.badge.partial { background: var(--amber-bg); color: var(--amber); }
.badge.needs_data { background: #f1f1f6; color: var(--text3); }
.badge.high { background: var(--red-bg); color: var(--red); }
.badge.medium { background: var(--amber-bg); color: var(--amber); }
.badge.low { background: var(--blue-bg); color: var(--blue); }

/* ---------- controls ---------- */
.controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.inline-field { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text2); }
.inline-field select { width: auto; min-width: 170px; }
.checkbox { display: flex; align-items: center; gap: 7px; font-size: 0.8rem; color: var(--text2); }
.checkbox input { width: auto; }
button.primary {
  background: var(--ey-yellow);
  color: var(--ey-near-black);
  border: none;
  padding: 11px 22px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 8px;
  cursor: pointer;
}
button.primary:disabled { opacity: .45; cursor: not-allowed; }
button.ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
}
.run-note { font-size: 0.76rem; color: var(--text3); margin-top: 10px; }
.run-note.warn { color: var(--amber); }

/* ---------- progress ---------- */
.progress { margin-top: 18px; }
.progress-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 10px;
}
.progress-head .elapsed { margin-left: auto; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--text3); }
.progress-log {
  background: var(--ey-near-black);
  color: #d4d4dc;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  max-height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid #ccc;
  border-top-color: var(--ey-dark);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- results ---------- */
.result-head { font-size: 0.85rem; color: var(--text2); line-height: 1.6; margin-bottom: 16px; }
.result-head .rh-title { font-size: 1.05rem; font-weight: 800; color: var(--text); }
.result-head .rh-meta { color: var(--text3); font-size: 0.78rem; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--ey-yellow);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}
.kpi-card .lab {
  font-size: 0.7rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .4px;
  text-align: center;
}
.kpi-card .val { font-size: 1.4rem; font-weight: 800; margin-top: 6px; text-align: center; }
.kpi-card .src { font-size: 0.68rem; color: var(--text-muted); margin-top: 6px; text-align: center; }

.deliverables { display: flex; gap: 10px; flex-wrap: wrap; }
.dl-btn {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  background: #fafafe;
  text-decoration: none;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
}
.dl-btn:hover { border-color: var(--ey-yellow); background: #fffef0; }
.dl-btn .sub { font-size: 0.7rem; font-weight: 500; color: var(--text3); }
.dl-btn.accent { background: var(--ey-yellow); border-color: var(--ey-yellow); }
.dl-btn.accent .sub { color: #6b5c00; }

.qa-strip { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 0.76rem; color: var(--text3); }
.qa-chip {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 3px 10px;
  background: #fff;
  font-size: 0.72rem;
}
.qa-chip.FAIL { border-color: #fca5a5; background: var(--red-bg); color: var(--red); font-weight: 700; }
.qa-chip.WARN { border-color: #fcd34d; background: var(--amber-bg); color: var(--amber); }
.qa-chip.PASS { border-color: #a7e0bd; background: var(--green-bg); color: var(--green); }

.frame-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
#dashboardFrame { width: 100%; height: 820px; border: 0; display: block; }

.view-switch { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.view-btn {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px 14px;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
}
.view-btn:hover { border-color: var(--ey-yellow); }
.view-btn[aria-pressed="true"] { background: var(--ey-yellow); border-color: var(--ey-yellow); color: #1a1a24; }
.view-note { font-size: 0.74rem; color: var(--text3); margin-left: 6px; }

.dq-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; font-size: 0.82rem; }
.dq-score {
  font-size: 1.1rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--ey-near-black);
  color: #fff;
}
.table-wrap { overflow-x: auto; }
.dq-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.dq-table th {
  background: var(--ey-near-black);
  color: #fff;
  text-align: left;
  padding: 8px 10px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}
.dq-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text2); }
.dq-table td.num { text-align: right; font-family: ui-monospace, Menlo, Consolas, monospace; white-space: nowrap; }
.dq-table tr.fail td { background: #fff7f7; }

.insight {
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: #fff;
}
.insight.high { border-left-color: var(--red); }
.insight.medium { border-left-color: var(--amber); }
.insight.low { border-left-color: var(--blue); }
.insight .ins-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.insight .ins-id { font-size: 0.72rem; font-weight: 800; color: var(--text-muted); font-family: ui-monospace, Menlo, Consolas, monospace; }
.insight .ins-name { font-size: 0.92rem; font-weight: 800; }
.insight .ins-val { margin-left: auto; font-size: 0.95rem; font-weight: 800; }
.insight .ins-sum { font-size: 0.82rem; color: var(--text2); line-height: 1.55; margin-top: 8px; }
.insight .ins-foot { font-size: 0.72rem; color: var(--text-muted); margin-top: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.declined-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text3);
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
}
.declined-row .d-id { font-weight: 800; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--text2); }

.notes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.notes-grid h4 {
  margin: 0 0 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text3);
}
.notes-grid ul { margin: 0; padding-left: 18px; font-size: 0.8rem; color: var(--text2); line-height: 1.6; }
.notes-grid .empty-note { font-size: 0.8rem; color: var(--text-muted); }

.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fafafe;
}
.recent-row .r-client { font-weight: 700; }
.recent-row .r-meta { color: var(--text3); font-size: 0.74rem; }
.recent-row .spacer { flex: 1 1 auto; }
.recent-row button { padding: 5px 12px; font-size: 0.76rem; }

.error-box {
  background: var(--red-bg);
  border: 1px solid #fca5a5;
  color: var(--red);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.82rem;
  margin-top: 16px;
  line-height: 1.55;
}
.error-box ul { margin: 8px 0 0; padding-left: 18px; }

.footer {
  border-top: 1px solid var(--border);
  padding: 16px 28px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  background: #fff;
}

@media print {
  .card, .dropzone, .controls, .progress, .footer { break-inside: avoid; }
}
