:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #17213a;
  --ink-2: #4a5570;
  --muted: #7d869c;
  --line: #e3e8f0;
  --line-2: #d9dfea;
  --brand: #1d3a6b;
  --brand-2: #2b5aa6;
  --mint: #e9f0fb;
  --mint-line: #cbdaf2;
  --mint-ink: #1d4c8f;
  --amber: #fff4dc;
  --amber-ink: #8a5a00;
  --red: #fdecea;
  --red-ink: #a1291c;
  --blue: #e8eefc;
  --blue-ink: #2a4a9a;
  --disabled: #8f9bb3;
  --ok: #e3f4ea;
  --ok-ink: #1d6b45;
  --kw-mark: #fff1a8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 33, 58, .06), 0 8px 24px rgba(23, 33, 58, .06);
  --shadow-pop: 0 2px 6px rgba(23, 33, 58, .08), 0 18px 48px rgba(23, 33, 58, .18);
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-2); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-2); background: var(--surface); border-radius: 12px;
  padding: 9px 16px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink);
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: #cfd1df; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #24467f; }
.btn.primary:disabled { background: var(--disabled); border-color: var(--disabled); cursor: not-allowed; }
.btn.brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.brand:hover { background: var(--brand-2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(23, 33, 58, .05); }
.btn.danger { color: var(--red-ink); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: #8fb0e3; box-shadow: 0 0 0 3px rgba(43, 90, 166, .16); }
.textarea { resize: vertical; min-height: 84px; }
label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }

/* ---------- chips & badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; background: #eef0f5; color: var(--ink-2); white-space: nowrap;
}
.chip.ok { background: var(--ok); color: var(--ok-ink); }
.chip.warn { background: var(--amber); color: var(--amber-ink); }
.chip.bad { background: var(--red); color: var(--red-ink); }
.chip.info { background: var(--blue); color: var(--blue-ink); }
.chip.agency { background: var(--brand); color: #fff; }

.rank {
  display: inline-flex; align-items: center; justify-content: center; min-width: 38px; padding: 3px 8px;
  border-radius: 8px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums;
}
.rank.r3 { background: #1f6b4f; color: #fff; }
.rank.r10 { background: #b8f0a8; color: #14531f; }
.rank.r30 { background: #e2f0f6; color: #1d5878; }
.rank.r100 { background: #fff1d6; color: #85570a; }
.rank.rnone { background: #eef0f4; color: #7d869c; }
.range { display: inline-block; padding: 2px 8px; border-radius: 8px; border: 1px dashed #c9cede; color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.range.top { background: #b8f0a8; border: 1px solid #7fd56a; color: #14531f; font-weight: 700; }
.link-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--brand-2); background: var(--mint); }
.link-icon:hover { background: var(--mint-line); }
.link-icon:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.col-pop { width: min(360px, calc(100vw - 24px)); }
.col-list { display: grid; gap: 6px; max-height: 50vh; overflow: auto; margin-top: 6px; }
.col-opt { display: flex; gap: 10px; align-items: center; font-size: 14px; padding: 4px 2px; cursor: pointer; }
.col-opt input { width: 16px; height: 16px; accent-color: var(--brand-2); }
.move { font-size: 12px; font-weight: 700; margin-left: 6px; white-space: nowrap; }
.move.up { color: #1f7a55; }
.move.down { color: #b23a2b; }

/* ---------- layout ---------- */
.topbar {
  background: var(--brand); color: #fff; padding: 0 24px;
}
.topbar-inner { max-width: 1440px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
.topbar .brandmark { font-weight: 700; letter-spacing: .2px; display: flex; align-items: center; gap: 10px; }
.topbar .brandmark .dot { width: 10px; height: 10px; border-radius: 50%; background: #8db8f2; }
.topbar a, .topbar button { color: #fff; }
.topbar .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff; }
.topbar .btn:hover { background: rgba(255, 255, 255, .18); }

.page { max-width: 1440px; margin: 0 auto; padding: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }

.hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 20px; }
.hero h1 { margin: 0 0 4px; font-size: 30px; letter-spacing: -.4px; }
.hero .sub { color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }

.tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 20px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: none; background: none; padding: 12px 14px; font-weight: 600; color: var(--ink-2); cursor: pointer;
  border-bottom: 3px solid transparent; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--brand); }
.tab .count { font-size: 12px; background: #e6ebf3; border-radius: 999px; padding: 1px 8px; color: var(--ink-2); }
.tab.active .count { background: var(--mint); color: var(--mint-ink); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.toolbar .left, .toolbar .right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; background: #e6ebf3; padding: 3px; border-radius: 12px; gap: 2px; flex-wrap: wrap; }
.seg button { border: none; background: transparent; padding: 6px 12px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.search { position: relative; }
.search input { padding-left: 34px; min-width: 220px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.progress { height: 8px; background: #e6ebf3; border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--brand-2); border-radius: 999px; transition: width .3s; }

/* ---------- data table ---------- */
.table-wrap { overflow: auto; max-height: calc(100vh - 220px); border-radius: var(--radius); }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; line-height: 1.4; }
table.data th {
  position: sticky; top: 0; z-index: 2; background: #f5f7fb; text-align: left; font-size: 12.5px; color: var(--ink-2);
  font-weight: 700; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data th.proj { color: var(--muted); font-weight: 600; }
table.data td { padding: 8px 10px; border-bottom: 1px solid #edf0f5; vertical-align: top; background: #fff; }
table.data tr:hover td { background: #fafbfd; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.primary { font-weight: 700; min-width: 170px; max-width: 280px; }
table.data td.idx { color: var(--muted); font-size: 12.5px; width: 1%; }
table.data .sticky-l { position: sticky; left: 0; z-index: 1; }
table.data th.sticky-l { z-index: 3; }
table.data .sticky-r { position: sticky; right: 0; z-index: 1; box-shadow: -8px 0 12px -10px rgba(23, 33, 58, .25); }
table.data th.sticky-r { z-index: 3; }
table.data td.fbcell { min-width: 300px; background: #fff; }
table.data td.fbcell .fb-actions { flex-wrap: nowrap; }
table.data td.fbcell .btn, table.data td.fbcell .chip { white-space: nowrap; flex: none; }
table.data td.linkcell { text-align: center; width: 1%; }
table.data td.nowrap { white-space: nowrap; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-width: 200px; max-width: 300px; cursor: pointer; }
.clamp.open { -webkit-line-clamp: unset; }
.cell-link { word-break: break-all; }
.fb-summary { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.fb-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.reactions { display: flex; gap: 4px; flex-wrap: wrap; }
.reactions span { font-size: 12.5px; background: #f0f3f8; border-radius: 999px; padding: 1px 7px; }
.empty { padding: 56px 20px; text-align: center; color: var(--ink-2); }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* ---------- feedback popover (matches the review card design) ---------- */
.pop-backdrop { position: fixed; inset: 0; z-index: 50; }
.popover {
  position: fixed; z-index: 51; width: min(420px, calc(100vw - 24px)); background: #fff; border-radius: 22px;
  box-shadow: var(--shadow-pop); padding: 22px 22px 18px; animation: pop .14s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } }
.popover h3 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.2px; }
.popover .ctx { color: var(--muted); font-size: 13px; margin-bottom: 14px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.popover .quote { border-left: 3px solid var(--mint-line); background: var(--surface-2); padding: 6px 10px; border-radius: 0 8px 8px 0; font-size: 13px; color: var(--ink-2); margin-bottom: 14px; max-height: 80px; overflow: auto; }
.choices { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.choice {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: 15.5px; background: #fff; border: 2px solid var(--line-2); transition: all .12s;
}
.choice .emo { font-size: 20px; line-height: 1; }
.choice.pos { background: var(--mint); border-color: var(--mint-line); }
.choice:hover { transform: translateY(-1px); }
.choice.selected { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(23, 33, 58, .08); }
.choice.pos.selected { border-color: var(--brand-2); background: #d6e4f8; }
.choice-break { flex-basis: 100%; height: 0; }
.pop-fields { display: grid; gap: 10px; }
.pop-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 16px; }
.pop-actions .btn.ghost { font-size: 16px; }
.pop-actions .btn.primary { padding: 11px 22px; font-size: 16px; border-radius: 14px; }

@media (max-width: 640px) {
  .popover { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100%; border-radius: 22px 22px 0 0; max-height: 88vh; overflow: auto; }
  .choice { padding: 9px 14px; font-size: 15px; }
}

/* ---------- drawer (comment threads) ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(23, 33, 58, .25); z-index: 40; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: #fff; z-index: 41;
  box-shadow: var(--shadow-pop); display: flex; flex-direction: column; animation: slide .18s ease-out;
}
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer header { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.drawer header h3 { margin: 0; font-size: 18px; }
.drawer .body { padding: 16px 20px; overflow: auto; flex: 1; display: grid; gap: 12px; align-content: start; }
.drawer footer { padding: 14px 20px; border-top: 1px solid var(--line); }

.fb { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.fb.open { border-color: #f0d8a8; }
.fb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13.5px; }
.fb-head .who { font-weight: 700; }
.fb-head .when { color: var(--muted); font-size: 12.5px; }
.fb-body { margin-top: 6px; white-space: pre-wrap; word-wrap: break-word; }
.fb-quote { margin-top: 8px; border-left: 3px solid var(--mint-line); padding: 4px 10px; color: var(--ink-2); font-size: 13.5px; background: var(--surface-2); border-radius: 0 8px 8px 0; cursor: pointer; }
.fb-replies { margin-top: 10px; display: grid; gap: 8px; padding-left: 12px; border-left: 2px solid var(--line); }
.fb-reply { font-size: 14px; }
.fb-reply-form { margin-top: 10px; display: grid; gap: 8px; }
.fb-item-label { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }

/* ---------- documents (blogs) ---------- */
.doc-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.doc-nav { position: sticky; top: 16px; display: grid; gap: 4px; }
.doc-nav button {
  text-align: left; border: 1px solid transparent; background: transparent; border-radius: 12px; padding: 10px 12px; cursor: pointer;
  display: grid; gap: 4px;
}
.doc-nav button:hover { background: rgba(23, 33, 58, .04); }
.doc-nav button.active { background: #fff; border-color: var(--line); box-shadow: var(--shadow); }
.doc-nav .t { font-weight: 600; font-size: 14px; line-height: 1.35; }
.doc-main { padding: 36px 44px; }
.doc-side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; display: grid; gap: 10px; }
.doc-side h4 { margin: 4px 0; font-size: 14px; }

.prose { font-size: 16.5px; line-height: 1.72; color: #1e2740; }
.prose h1 { font-size: 32px; letter-spacing: -.5px; margin: 0 0 18px; }
.prose h2 { font-size: 23px; margin: 34px 0 10px; }
.prose h3 { font-size: 18.5px; margin: 26px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose img { max-width: 100%; height: auto; border-radius: 12px; display: block; margin: 8px 0; }
.prose h1 img { max-width: 280px; border-radius: 0; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; }
.prose li { margin: 4px 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 12px 0 18px; font-size: 14.5px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: #f5f7fb; }
.prose td p, .prose th p { margin: 0; }
.prose mark { background: var(--kw-mark); padding: 0 2px; border-radius: 3px; }
.prose mark.hl { background: #dbe7f9; border-bottom: 2px solid #3f72c2; cursor: pointer; padding: 0; border-radius: 0; }
.prose mark.hl.active { background: #bcd3f4; }
.prose mark mark.hl { background: #dbe7f9; }

.seo-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 6px 18px; margin-bottom: 28px; }
.seo-card .row { display: grid; grid-template-columns: 190px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.seo-card .row:last-child { border-bottom: none; }
.seo-card .k { color: var(--muted); font-weight: 600; }
.seo-card .v { font-weight: 500; }
.seo-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; flex-wrap: wrap; }
.seo-head h4 { margin: 0; font-size: 13px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }

.approve-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 12px 16px; margin-bottom: 24px;
}
.select-hint { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.checklist { display: grid; gap: 10px; margin: 8px 0 18px; }
.check-item { display: grid; grid-template-columns: 26px 1fr; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; font-size: 15px; line-height: 1.5; }
.check-item .box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid #c8ccd8; display: grid; place-items: center; font-size: 13px; margin-top: 1px; }
.check-item.done .box { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.check-item .row2 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }

.sel-btn {
  position: absolute; z-index: 30; background: var(--ink); color: #fff; border: none; border-radius: 999px; padding: 8px 14px;
  font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow-pop); cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
  animation: pop .12s ease-out;
}

@media (max-width: 1180px) {
  .doc-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .doc-side { grid-column: 1 / -1; position: static; max-height: none; }
}
@media (max-width: 820px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-nav { position: static; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); overflow-x: auto; }
  .doc-main { padding: 22px 18px; }
  .seo-card .row { grid-template-columns: 1fr; gap: 2px; }
  .page { padding: 16px; }
  .hero h1 { font-size: 24px; }
  .topbar { padding: 0 16px; }
}

/* ---------- toast & misc ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 11px 18px; border-radius: 12px; z-index: 100; font-weight: 600; box-shadow: var(--shadow-pop); animation: pop .15s;
  max-width: calc(100vw - 32px);
}
.toast.error { background: var(--red-ink); }
.spinner { width: 28px; height: 28px; border: 3px solid #d9dfea; border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.name-pill { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; }
.name-pill button { background: none; border: none; text-decoration: underline; cursor: pointer; padding: 0; color: inherit; opacity: .85; }

/* ---------- admin ---------- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.proj-card { padding: 18px; display: grid; gap: 10px; cursor: pointer; transition: transform .1s, box-shadow .15s; }
.proj-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-pop); }
.proj-card h3 { margin: 0; font-size: 18px; }
.row-flex { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.between { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 14px; }
.linkbox code { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone { display: block; border: 2px dashed #cfd2dd; border-radius: 14px; padding: 26px; text-align: center; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand-2); background: #eef4fc; }
.dropzone input { display: none; }
table.plain { width: 100%; border-collapse: collapse; font-size: 14px; }
table.plain th, table.plain td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.plain th { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.section-title { margin: 28px 0 12px; font-size: 18px; }
.login { max-width: 380px; margin: 12vh auto; padding: 28px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.cols-preview { font-size: 12.5px; color: var(--muted); max-width: 420px; }

/* ---------- guided tour ---------- */
.tour { position: fixed; inset: 0; z-index: 70; }
.tour-shade { position: absolute; inset: 0; background: rgba(15, 25, 50, .55); }
.tour-shade.clear { background: transparent; }
.tour-hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(15, 25, 50, .55); outline: 3px solid #8db8f2; pointer-events: none; transition: all .2s; }
.tour-card {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto;
  background: #fff; border-radius: 20px; box-shadow: var(--shadow-pop); padding: 22px 22px 18px; animation: pop .16s ease-out;
}
.tour-count { font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--brand-2); }
.tour-card h3 { margin: 6px 0 10px; font-size: 20px; letter-spacing: -.2px; }
.tour-body p { margin: 0 0 8px; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.tour-check { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 8px; }
.tour-check li { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 14px; color: var(--ink-2); }
.tour-check strong { color: var(--ink); display: block; }
.tour-dots { display: flex; gap: 5px; margin: 12px 0 2px; }
.tour-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.tour-dots span.on { background: var(--brand-2); width: 18px; border-radius: 4px; }
.tour-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .tour-card { left: 0; right: 0; bottom: 0; top: auto; transform: none; width: 100%; border-radius: 20px 20px 0 0; max-height: 70vh; }
}
@media (prefers-reduced-motion: reduce) { .tour-card { animation: none; } .tour-hole { transition: none; } }

/* ---------- review steps ---------- */
.steps { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 20px; padding-bottom: 4px; scrollbar-width: none; counter-reset: step; }
.steps::-webkit-scrollbar { display: none; }
.step {
  flex: 1 0 170px; display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface);
  border-radius: 14px; padding: 10px 12px; cursor: pointer; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.step:hover { border-color: var(--line-2); }
.step.active { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(43, 90, 166, .14); }
.step-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: #e6ebf3; color: var(--ink-2); }
.step.todo .step-num { background: var(--brand); color: #fff; }
.step.done .step-num { background: var(--ok); color: var(--ok-ink); }
.step.soon, .step.locked { background: var(--surface-2); }
.step.soon .step-label, .step.locked .step-label { color: var(--muted); }
.step-text { display: grid; min-width: 0; }
.step-label { font-weight: 700; font-size: 14px; white-space: nowrap; }
.step-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.done .step-sub { color: var(--ok-ink); font-weight: 600; }

.step-footer { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.step-footer.done { background: var(--ok); border-color: #bfe5cd; color: var(--ok-ink); }

/* ---------- summary ---------- */
.summary { padding: 16px 20px; margin-bottom: 14px; display: grid; gap: 6px; max-width: 980px; }
.summary-label { font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--brand-2); }
.summary p { margin: 0; color: var(--ink-2); line-height: 1.55; }
.summary p:last-child { color: var(--ink); font-weight: 600; }

/* ---------- selection & frozen columns ---------- */
table.data .selcol { width: 36px; min-width: 36px; max-width: 36px; padding-left: 12px; padding-right: 0; }
table.data .selcol input { width: 16px; height: 16px; accent-color: var(--brand-2); cursor: pointer; }
table.data th.idx, table.data td.idx { width: 44px; min-width: 44px; }
table.data .freeze { position: sticky; z-index: 1; }
table.data th.freeze { z-index: 3; }
table.data .freeze-edge { box-shadow: 8px 0 10px -10px rgba(23, 33, 58, .35); }
table.data tr.picked td { background: #eef4fd; }
.select-bar {
  position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 14px; margin-bottom: 10px; box-shadow: var(--shadow-pop);
}
.select-bar .btn { border-color: rgba(255, 255, 255, .35); }
.select-bar .btn:not(.brand) { background: rgba(255, 255, 255, .12); color: #fff; }
.select-bar .btn.brand { background: #fff; color: var(--brand); border-color: #fff; }
.select-bar .btn.ghost { background: transparent; }

/* ---------- phases ---------- */
.phase-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.phase-bar-label { font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.phase-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2fa866; margin-left: 6px; vertical-align: middle; }
.on-target { font-size: 11.5px; font-weight: 700; color: var(--ok-ink); background: var(--ok); border-radius: 999px; padding: 1px 7px; margin-left: 6px; white-space: nowrap; }
