/* KnowFlow — light editorial knowledge tool */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface2: #faf9f6;
  --ink: #29251f;
  --ink2: #57503f;
  --muted: #8a8375;
  --border: #e5e1d6;
  --border2: #d8d3c5;
  --accent: #6d4df0;
  --accent-deep: #5636d8;
  --accent-soft: #efeafd;
  --accent-border: #d8cdfb;
  --green: #1d7a4f;
  --green-soft: #e4f3ea;
  --amber: #a16207;
  --amber-soft: #fbf0d9;
  --blue: #2456a6;
  --blue-soft: #e5edf9;
  --red: #c03434;
  --red-soft: #fbe9e7;
  --orange: #c2410c;
  --orange-soft: #fdeee2;
  --shadow: 0 1px 2px rgba(41,37,31,.05), 0 4px 16px rgba(41,37,31,.06);
  --shadow-lg: 0 4px 12px rgba(41,37,31,.08), 0 16px 48px rgba(41,37,31,.14);
  --radius: 10px;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 13.5px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-deep); text-decoration: none; }
svg.ic { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.9; fill: none;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -2.5px; flex: none; }

/* ---------- app shell ---------- */
#app { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 228px; flex: none; background: var(--surface2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 10px 10px;
  gap: 2px; overflow-y: auto;
}
.logo { display: flex; align-items: center; gap: 9px; padding: 4px 8px 14px; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  display: grid; place-items: center; color: #fff; box-shadow: 0 2px 8px rgba(109,77,240,.35); }
.logo-mark svg { width: 17px; height: 17px; }
.logo b { font-size: 15.5px; letter-spacing: -.01em; }
.logo small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; margin-top: -2px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 10px; border-radius: 8px; color: var(--ink2);
  font-weight: 500; font-size: 13px; text-align: left; position: relative;
}
.nav-item:hover { background: rgba(41,37,31,.05); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-deep); }
.nav-item .count {
  margin-left: auto; font-size: 11px; background: rgba(41,37,31,.07);
  border-radius: 20px; padding: 0 7px; line-height: 17px; color: var(--ink2); font-weight: 600;
}
.nav-item.active .count { background: rgba(109,77,240,.16); color: var(--accent-deep); }
.nav-item .count.hot { background: var(--orange-soft); color: var(--orange); }
.nav-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding: 14px 10px 5px; font-weight: 600; }
.side-src { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 10px;
  border-radius: 7px; font-size: 12.5px; color: var(--ink2); }
.side-src:hover { background: rgba(41,37,31,.05); }
.side-src .dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.side-src .count { margin-left: auto; font-size: 11px; color: var(--muted); }
.side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.userchip { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; }
.userchip:hover { background: rgba(41,37,31,.05); }
.avatar { width: 27px; height: 27px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.userchip .un { font-size: 12.5px; font-weight: 600; }
.userchip .ue { font-size: 10.5px; color: var(--muted); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 52px; flex: none; display: flex; align-items: center; gap: 12px;
  padding: 0 20px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.searchwrap { position: relative; width: 380px; max-width: 40vw; }
.searchbox {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 11px; color: var(--muted);
}
.searchbox input { flex: 1; border: none; outline: none; background: transparent; color: var(--ink); font-size: 13px; }
.searchbox kbd { font-family: var(--mono); font-size: 10px; background: var(--surface);
  border: 1px solid var(--border2); border-radius: 4px; padding: 1px 5px; color: var(--muted); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; width: 480px; max-width: 70vw;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); z-index: 60; max-height: 400px; overflow-y: auto; padding: 6px;
}
.search-hit { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px; width: 100%; text-align: left; }
.search-hit:hover { background: var(--accent-soft); }
.search-hit .t { font-weight: 600; font-size: 13px; }
.search-hit .s { font-size: 11.5px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.top-hint { font-size: 11px; color: var(--muted); }
.content { flex: 1; overflow-y: auto; padding: 22px 26px 60px; }
.content.nopad { padding: 0; overflow: hidden; }

/* ---------- generic ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border2); background: var(--surface);
  border-radius: 8px; padding: 6px 13px; font-size: 12.5px; font-weight: 600; color: var(--ink2);
  transition: all .12s;
}
.btn:hover { border-color: var(--muted); background: var(--surface2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.green:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red); border-color: #eccfcb; }
.btn.danger:hover { background: var(--red-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(41,37,31,.06); }
.btn.sm { padding: 3.5px 9px; font-size: 11.5px; border-radius: 7px; }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn.on { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-deep); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700;
  border-radius: 5px; padding: 1.5px 7px; letter-spacing: .02em; white-space: nowrap; }
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; }
.chip { display: inline-flex; align-items: center; font-size: 11px; background: rgba(41,37,31,.06);
  border-radius: 5px; padding: 1.5px 8px; color: var(--ink2); font-weight: 500; }
.chip.tag::before { content: "#"; opacity: .5; margin-right: 1px; }
.chip.on { background: var(--accent-soft); color: var(--accent-deep); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--accent-border); background: var(--accent-soft); color: var(--accent-deep);
  border-radius: 20px; padding: 2px 10px; }
.pill.plain { border-color: var(--border2); background: var(--surface); color: var(--ink2); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13px; }
.card-h .sub { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.card-h .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-b { padding: 14px 16px; }

.page-h { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-h h1 { font-size: 19px; letter-spacing: -.01em; }
.page-h .desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.page-h .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.empty { text-align: center; color: var(--muted); padding: 34px 16px; font-size: 12.5px; }
.empty svg.ic { width: 26px; height: 26px; opacity: .4; display: block; margin: 0 auto 8px; }

/* score meter */
.meter { display: flex; align-items: center; gap: 8px; }
.meter .bar { flex: 1; height: 6px; background: rgba(41,37,31,.08); border-radius: 4px; overflow: hidden; }
.meter .fill { height: 100%; border-radius: 4px; transition: width .3s; }
.meter .num { font-family: var(--mono); font-size: 11.5px; font-weight: 700; width: 30px; text-align: right; }

/* item cards */
.item-card {
  display: flex; flex-direction: column; gap: 7px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: border-color .12s, box-shadow .12s; position: relative;
}
.item-card:hover { border-color: var(--accent-border); box-shadow: var(--shadow); }
.item-card.sel { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }
.item-card .ic-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.item-card .ic-title { font-weight: 700; font-size: 13.5px; line-height: 1.4; }
.item-card .ic-sum { font-size: 12px; color: var(--ink2); display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-card .ic-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.item-card .ic-meta { font-size: 10.5px; color: var(--muted); margin-left: auto; white-space: nowrap; }

/* list rows */
.row { display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  border-bottom: 1px solid var(--border); cursor: pointer; }
.row:hover { background: var(--surface2); }
.row:last-child { border-bottom: none; }
.row .r-title { font-weight: 600; font-size: 12.5px; }
.row .r-sub { font-size: 11px; color: var(--muted); }

/* ---------- login ---------- */
.login-wrap { height: 100vh; flex: 1; display: grid; place-items: center;
  background: radial-gradient(1200px 700px at 70% -10%, #ece7fd 0%, var(--bg) 55%); }
.login-card { width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg); padding: 34px 34px 28px; }
.login-card .logo { padding-bottom: 4px; }
.login-card h1 { font-size: 20px; margin: 14px 0 4px; letter-spacing: -.01em; }
.login-card .lead { color: var(--muted); font-size: 12.5px; margin-bottom: 20px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink2); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--border2); border-radius: 8px;
  padding: 8px 11px; font-size: 13px; background: var(--surface); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109,77,240,.14); }
.field textarea { resize: vertical; min-height: 90px; font-family: inherit; }
.login-demo { margin-top: 16px; background: var(--surface2); border: 1px dashed var(--border2);
  border-radius: 9px; padding: 10px 13px; font-size: 11.5px; color: var(--muted); }
.login-demo code { font-family: var(--mono); color: var(--ink2); font-size: 11px; }
.login-err { color: var(--red); font-size: 12px; margin: 6px 0; min-height: 16px; }

/* ---------- dashboard ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 15px; cursor: pointer; transition: border-color .12s; }
.stat:hover { border-color: var(--accent-border); }
.stat .s-label { font-size: 11px; color: var(--muted); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.stat .s-val { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stat .s-note { font-size: 10.5px; color: var(--muted); }
.stat.warn .s-val { color: var(--orange); }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr 320px; gap: 14px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.alert { display: flex; gap: 10px; align-items: center; background: var(--orange-soft);
  border: 1px solid #f3d9c2; color: var(--orange); border-radius: var(--radius);
  padding: 10px 14px; font-size: 12.5px; font-weight: 600; margin-bottom: 16px; }
.alert .btn { margin-left: auto; }
.tagcloud { display: flex; flex-wrap: wrap; gap: 7px; }
.srcbar { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 12px; }
.srcbar .sb-track { flex: 1; height: 7px; background: rgba(41,37,31,.07); border-radius: 4px; overflow: hidden; }
.srcbar .sb-fill { height: 100%; border-radius: 4px; }
.srcbar .sb-n { font-family: var(--mono); font-size: 11px; width: 20px; text-align: right; color: var(--ink2); }
.srcbar .sb-label { width: 88px; display: flex; align-items: center; gap: 7px; font-weight: 600; }
.feed { display: flex; flex-direction: column; }
.feed-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.feed-row:last-child { border-bottom: none; }
.feed-ic { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex: none; margin-top: 1px; }
.feed-row .f-detail { color: var(--ink2); }
.feed-row .f-time { color: var(--muted); font-size: 10.5px; margin-top: 1px; }

/* ---------- inbox ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 8px 14px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 7px; align-items: center; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent-deep); border-bottom-color: var(--accent); }
.tab .dot { width: 8px; height: 8px; border-radius: 3px; }
.inbox-grid { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(380px, 1.1fr); gap: 16px; align-items: start; }
.norm-preview .np-row { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.norm-preview .np-row:last-child { border-bottom: none; }
.norm-preview .np-key { width: 96px; flex: none; color: var(--muted); font-size: 11.5px; font-weight: 600; padding-top: 2px; }
.taginput { display: flex; flex-wrap: wrap; gap: 5px; border: 1px solid var(--border2); border-radius: 8px; padding: 6px 8px; }
.taginput input { border: none; outline: none; flex: 1; min-width: 90px; font-size: 12.5px; background: transparent; }
.taginput .chip button { margin-left: 4px; opacity: .5; font-size: 12px; }
.taginput .chip button:hover { opacity: 1; }
.bulkbar { display: flex; align-items: center; gap: 8px; background: var(--ink); color: #fff;
  border-radius: 10px; padding: 8px 14px; margin-bottom: 12px; position: sticky; top: 0; z-index: 5; box-shadow: var(--shadow-lg); }
.bulkbar .btn { background: rgba(255,255,255,.12); border-color: transparent; color: #fff; }
.bulkbar .btn:hover { background: rgba(255,255,255,.22); }
.list-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.list-toolbar select { border: 1px solid var(--border2); border-radius: 7px; padding: 5px 8px; font-size: 12px; background: var(--surface); }
.cards-list { display: flex; flex-direction: column; gap: 10px; }
.ck { width: 15px; height: 15px; accent-color: var(--accent); flex: none; cursor: pointer; }

/* ---------- review ---------- */
.review-wrap { display: grid; grid-template-columns: 280px 1fr; height: 100%; }
.review-list { border-right: 1px solid var(--border); overflow-y: auto; background: var(--surface2); }
.review-list-h { padding: 14px 16px 8px; font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 7px;
  position: sticky; top: 0; background: var(--surface2); z-index: 2; }
.rq-item { padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.rq-item:hover { background: rgba(41,37,31,.04); }
.rq-item.sel { background: var(--accent-soft); border-left: 3px solid var(--accent); padding-left: 11px; }
.rq-item .t { font-weight: 600; font-size: 12.5px; line-height: 1.35; }
.rq-item .m { display: flex; gap: 6px; align-items: center; margin-top: 5px; }
.review-main { display: flex; flex-direction: column; overflow: hidden; }
.review-cols { flex: 1; display: grid; grid-template-columns: 1.2fr 1fr 0.95fr; gap: 0; overflow: hidden; }
.rcol { overflow-y: auto; padding: 18px; border-right: 1px solid var(--border); }
.rcol:last-child { border-right: none; }
.rcol h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.review-actions { flex: none; display: flex; gap: 9px; align-items: center; padding: 12px 18px;
  border-top: 1px solid var(--border); background: var(--surface); }
.kbd-hint { font-size: 10.5px; color: var(--muted); font-family: var(--mono); }
.ai-box { background: var(--accent-soft); border: 1px solid var(--accent-border);
  border-radius: 9px; padding: 11px 13px; margin-bottom: 12px; }
.ai-box .ai-label { font-size: 10.5px; font-weight: 700; color: var(--accent-deep);
  display: flex; gap: 5px; align-items: center; margin-bottom: 5px; }
.conflict-box { background: var(--orange-soft); border: 1px solid #f3d9c2; border-radius: 9px;
  padding: 11px 13px; margin-bottom: 12px; font-size: 12px; color: var(--orange); }
.sug-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.sug-row:last-child { border-bottom: none; }
.sug-row .t { font-size: 12px; font-weight: 600; flex: 1; }
.axes { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.axis { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.axis .a-name { width: 62px; color: var(--ink2); font-weight: 600; }
.axis .a-track { flex: 1; height: 5px; background: rgba(41,37,31,.08); border-radius: 3px; overflow: hidden; }
.axis .a-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.axis .a-num { font-family: var(--mono); font-size: 10.5px; color: var(--muted); width: 38px; text-align: right; }

/* markdown */
.md { font-size: 13px; line-height: 1.7; color: var(--ink); }
.md h1 { font-size: 17px; margin: 14px 0 8px; }
.md h2 { font-size: 14.5px; margin: 14px 0 6px; padding-bottom: 3px; border-bottom: 1px solid var(--border); }
.md h3 { font-size: 13px; margin: 12px 0 5px; }
.md p { margin: 7px 0; }
.md ul, .md ol { margin: 7px 0 7px 20px; }
.md li { margin: 3px 0; }
.md blockquote { border-left: 3px solid var(--accent-border); background: var(--surface2);
  padding: 7px 12px; margin: 8px 0; border-radius: 0 7px 7px 0; color: var(--ink2); }
.md code { font-family: var(--mono); font-size: 11.5px; background: rgba(41,37,31,.07);
  border-radius: 4px; padding: 1px 5px; }
.md pre { background: #26251f; color: #eae7dd; border-radius: 8px; padding: 12px 14px;
  overflow-x: auto; margin: 9px 0; }
.md pre code { background: none; color: inherit; padding: 0; }
.md table { border-collapse: collapse; margin: 9px 0; font-size: 12px; }
.md th, .md td { border: 1px solid var(--border2); padding: 4.5px 10px; text-align: left; }
.md th { background: var(--surface2); font-weight: 700; }
.md hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

/* diff */
.diff { font-family: var(--mono); font-size: 11.5px; line-height: 1.6; border: 1px solid var(--border);
  border-radius: 9px; overflow: hidden; max-height: 420px; overflow-y: auto; }
.diff .dl { padding: 1.5px 12px; white-space: pre-wrap; word-break: break-all; }
.diff .dl.same { color: var(--ink2); }
.diff .dl.add { background: var(--green-soft); color: var(--green); }
.diff .dl.add::before { content: "+ "; font-weight: 700; }
.diff .dl.del { background: var(--red-soft); color: var(--red); text-decoration: line-through; opacity: .8; }
.diff .dl.del::before { content: "− "; font-weight: 700; }

/* ---------- map ---------- */
.map-wrap { position: relative; height: 100%; overflow: hidden; background:
  radial-gradient(rgba(41,37,31,.10) 1px, transparent 1px); background-size: 22px 22px; }
#map-canvas { width: 100%; height: 100%; display: block; cursor: grab; }
#map-canvas.dragging { cursor: grabbing; }
.map-panel { position: absolute; top: 14px; left: 14px; width: 240px; background: rgba(255,255,255,.94);
  backdrop-filter: blur(6px); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); padding: 13px 14px; z-index: 5; }
.map-panel h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 10px 0 6px; }
.map-panel h4:first-child { margin-top: 0; }
.map-inspector { position: absolute; top: 14px; right: 14px; width: 300px; max-height: calc(100% - 28px);
  overflow-y: auto; background: rgba(255,255,255,.96); backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 15px 16px; z-index: 5; }
.map-legend { position: absolute; bottom: 14px; left: 14px; display: flex; gap: 10px; flex-wrap: wrap;
  background: rgba(255,255,255,.92); border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 12px; font-size: 11px; z-index: 5; }
.map-legend .lg { display: flex; align-items: center; gap: 5px; color: var(--ink2); }
.map-legend .dot { width: 9px; height: 9px; border-radius: 50%; }
.map-hint { position: absolute; bottom: 14px; right: 14px; font-size: 11px; color: var(--muted);
  background: rgba(255,255,255,.92); border: 1px solid var(--border); border-radius: 10px; padding: 6px 11px; z-index: 5; }
.linkmode-banner { position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 20px; padding: 7px 16px; font-size: 12px;
  font-weight: 600; z-index: 6; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; }

/* ---------- publish ---------- */
.pub-grid { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.pub-steps { display: flex; flex-direction: column; gap: 14px; }
.step-h { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 13px; }
.step-n { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent-deep); display: grid; place-items: center; font-size: 11.5px; font-weight: 800; flex: none; }
.db-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
.db-card { border: 1.5px solid var(--border); border-radius: 10px; padding: 11px 12px; cursor: pointer;
  transition: all .12s; background: var(--surface); text-align: left; }
.db-card:hover { border-color: var(--accent-border); }
.db-card.sel { border-color: var(--accent); background: var(--accent-soft); }
.db-card .n { font-weight: 700; font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.db-card .d { font-size: 10.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.db-card .suggest { font-size: 9.5px; color: var(--accent-deep); font-weight: 700; margin-top: 4px; }
.prop-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.prop-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: 5px 10px; border-bottom: 1px solid var(--border); }
.prop-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prop-table tr:last-child td { border-bottom: none; }
.prop-table .pt-name { font-weight: 700; white-space: nowrap; }
.prop-table .pt-type { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.prop-table .pt-src { font-family: var(--mono); font-size: 10.5px; color: var(--accent-deep); }
.blocks-preview { border: 1px solid var(--border); border-radius: 9px; padding: 13px 16px;
  max-height: 300px; overflow-y: auto; background: var(--surface2); }
.confirm-row { display: flex; align-items: center; gap: 9px; background: var(--amber-soft);
  border: 1px solid #ecd9ab; border-radius: 9px; padding: 10px 13px; font-size: 12.5px; }
.result-box { background: var(--green-soft); border: 1px solid #bfe0cd; color: var(--green);
  border-radius: 9px; padding: 12px 15px; font-size: 12.5px; font-weight: 600; }
.notion-page-view .np-title { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.props-grid { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; font-size: 12px; margin-bottom: 14px; }
.props-grid .pk { color: var(--muted); display: flex; gap: 5px; align-items: center; font-size: 11.5px; padding: 2px 0; }

/* ---------- weekly ---------- */
.week-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.check-row { display: flex; gap: 9px; align-items: flex-start; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.check-row:last-child { border-bottom: none; }
.dup-pair { border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; margin-bottom: 9px; }
.dup-pair .vs { font-size: 10px; color: var(--muted); text-transform: uppercase; font-weight: 700; margin: 4px 0; }

/* ---------- settings ---------- */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; max-width: 1100px; }
.set-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.set-row:last-child { border-bottom: none; }
.set-row .sr-label { flex: 1; font-size: 12.5px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.set-row select, .set-row input[type=number] { border: 1px solid var(--border2); border-radius: 7px;
  padding: 5px 9px; font-size: 12px; background: var(--surface); width: 150px; }
.set-row input[type=range] { width: 140px; accent-color: var(--accent); }
.range-val { font-family: var(--mono); font-size: 12px; font-weight: 700; width: 34px; text-align: right; }
.switch { position: relative; width: 36px; height: 20px; border-radius: 20px; background: var(--border2);
  transition: background .15s; flex: none; }
.switch.on { background: var(--accent); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on::after { left: 18px; }

/* ---------- modal / toast ---------- */
#modal-root .overlay { position: fixed; inset: 0; background: rgba(30,27,22,.45);
  display: grid; place-items: center; z-index: 100; padding: 24px; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 640px; max-width: 94vw; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
  animation: pop .16s ease; }
.modal.wide { width: 860px; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.modal-h { display: flex; align-items: center; gap: 9px; padding: 15px 20px;
  border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px; }
.modal-h .x { margin-left: auto; color: var(--muted); padding: 4px; border-radius: 6px; }
.modal-h .x:hover { background: rgba(41,37,31,.07); color: var(--ink); }
.modal-b { padding: 18px 20px; overflow-y: auto; }
.modal-f { padding: 13px 20px; border-top: 1px solid var(--border); display: flex; gap: 9px; justify-content: flex-end; }
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column;
  gap: 8px; z-index: 200; }
.toast { background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 16px;
  font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow-lg); display: flex; gap: 8px;
  align-items: center; animation: slidein .2s ease; max-width: 380px; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } }

/* responsive */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .review-cols { grid-template-columns: 1fr 1fr; }
  .rcol.rcol-right { display: none; }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .inbox-grid, .pub-grid, .week-grid, .set-grid, .dash-grid { grid-template-columns: 1fr; }
  .review-wrap { grid-template-columns: 1fr; }
  .review-list { display: none; }
  .review-cols { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(41,37,31,.16); border-radius: 6px; border: 2.5px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(41,37,31,.3); border: 2.5px solid transparent; background-clip: content-box; }
