/* Pikkola Rank — 네이버 블로그 원고 검사기 */

:root {
  --bg: #08090b;
  --bg-soft: #0b0d10;
  --surface: #0f1116;
  --surface-2: #12151b;
  --surface-3: #171b22;
  --border: rgba(255, 255, 255, .075);
  --border-mid: rgba(255, 255, 255, .11);
  --border-strong: rgba(255, 255, 255, .18);
  --text: #e9ecf1;
  --text-dim: #b6bcc6;
  --muted: #8d949f;
  --faint: #666e7a;
  --accent: #8f9bff;
  --accent-2: #5ee0a0;
  --accent-ink: #0a0b10;
  --accent-soft: rgba(143, 155, 255, .13);
  --good: #3ddc97;
  --good-bg: rgba(61, 220, 151, .13);
  --good-text: #a9f2d2;
  --warn: #efb45f;
  --warn-bg: rgba(239, 180, 95, .12);
  --warn-text: #f4d6a8;
  --danger: #f2706a;
  --danger-bg: rgba(242, 112, 106, .13);
  --danger-text: #ffc4c0;

  --mk-warn: rgba(239, 180, 95, .32);
  --mk-danger: rgba(242, 112, 106, .34);
  --mk-info: rgba(94, 224, 160, .2);
  --mk-kw: rgba(143, 155, 255, .14);

  --shadow-card: 0 1px 0 rgba(255, 255, 255, .035) inset, 0 30px 60px -40px rgba(0, 0, 0, .9);
  --radius: 16px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial,
    "Apple SD Gothic Neo", "Noto Sans KR", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme="light"] {
  --bg: #fbfbfc;
  --bg-soft: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fcfcfd;
  --surface-3: #f4f5f7;
  --border: rgba(12, 16, 26, .085);
  --border-mid: rgba(12, 16, 26, .13);
  --border-strong: rgba(12, 16, 26, .22);
  --text: #14171d;
  --text-dim: #3d434e;
  --muted: #646b77;
  --faint: #8b919c;
  --accent: #4f5bd5;
  --accent-2: #0f9b66;
  --accent-soft: rgba(79, 91, 213, .09);
  --good: #109c68;
  --good-bg: rgba(16, 156, 104, .12);
  --good-text: #0a6b48;
  --warn: #b57612;
  --warn-bg: rgba(197, 138, 33, .14);
  --warn-text: #8a5a09;
  --danger: #c0392f;
  --danger-bg: rgba(192, 57, 47, .1);
  --danger-text: #8f241c;

  --mk-warn: rgba(239, 180, 95, .55);
  --mk-danger: rgba(242, 112, 106, .42);
  --mk-info: rgba(16, 156, 104, .2);
  --mk-kw: rgba(79, 91, 213, .1);

  --shadow-card: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 24px 48px -36px rgba(12, 16, 26, .45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  word-break: keep-all;
  overflow-wrap: break-word;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 420px at 50% -8%, rgba(143, 155, 255, .11), transparent 70%),
    radial-gradient(700px 380px at 88% 4%, rgba(61, 220, 151, .05), transparent 70%);
}
[data-theme="light"] body::before {
  background:
    radial-gradient(900px 420px at 50% -8%, rgba(79, 91, 213, .08), transparent 70%),
    radial-gradient(700px 380px at 88% 4%, rgba(16, 156, 104, .04), transparent 70%);
}

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.028em; line-height: 1.16; }
p { margin: 0; }
button { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 60;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600; transition: top .15s ease;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 60px; }

.brand { display: inline-flex; align-items: center; gap: 9px; letter-spacing: -0.02em; }
.brand-mark { width: 24px; height: 24px; color: var(--accent); flex: none; }
.brand-name { font-size: 16px; font-weight: 620; letter-spacing: -0.02em; }
.brand-tool {
  font-size: 11.5px; font-weight: 560; color: var(--muted); letter-spacing: .05em;
  padding: 2px 7px; border: 1px solid var(--border-mid); border-radius: 6px;
  text-transform: uppercase; line-height: 1.5;
}

.site-nav { display: flex; gap: 2px; margin-left: 4px; }
.site-nav a {
  font-size: 13.5px; color: var(--muted); padding: 7px 10px; border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.site-nav a:hover { color: var(--text); background: var(--surface-3); }

.header-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-dim);
  border-radius: 10px; cursor: pointer; transition: .15s ease; flex: none;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ico-sun { display: none; }
[data-theme="light"] .ico-sun { display: block; }
[data-theme="light"] .ico-moon { display: none; }

/* ---------- hero ---------- */

.hero { padding: 44px 0 18px; }
.hero .eyebrow, .section .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 550;
}
.eyebrow .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-bg); }
.hero h1 {
  margin-top: 13px; text-wrap: balance;
  font-size: clamp(1.95rem, 1.3rem + 2.6vw, 3.05rem);
  max-width: 26ch; letter-spacing: -0.038em;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { margin-top: 14px; max-width: 74ch; color: var(--muted); font-size: 15px; }
.hero .lede b { color: var(--text-dim); font-weight: 550; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted); font-weight: 520;
  border: 1px solid var(--border); background: var(--surface);
  padding: 5px 10px; border-radius: 999px;
}
.badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; color: var(--good); }

/* ---------- generic ---------- */

.section { padding: 78px 0 0; }
.section h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); margin-top: 12px; max-width: 28ch; text-wrap: balance; }
.section .sub { margin-top: 12px; color: var(--muted); font-size: 14.5px; max-width: 76ch; }

.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  position: relative;
  z-index: 2;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 12px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-3); color: var(--text-dim);
  font-size: 13px; font-weight: 540; cursor: pointer; transition: .15s ease; white-space: nowrap;
}
.btn:hover { color: var(--text); border-color: var(--border-strong); }
.btn:disabled { opacity: .45; cursor: default; }
.btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-3); }
.btn-primary { background: var(--text); color: var(--bg); border-color: transparent; font-weight: 630; padding-inline: 16px; }
.btn-primary:hover { color: var(--bg); opacity: .92; }
.btn-quiet { background: transparent; padding: 6px 9px; font-size: 12.5px; border-color: transparent; color: var(--faint); }
.btn-quiet:hover { background: var(--surface-3); color: var(--text); }

.chip {
  border: 0; background: transparent; color: var(--faint); cursor: pointer;
  font-size: 12px; font-weight: 520; padding: 4px 7px; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 5px; transition: .15s ease; white-space: nowrap;
}
.chip:hover { color: var(--text); background: var(--surface-3); }
.chip svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- tool: meta row ---------- */

.tool-section { padding-top: 14px; }
.tool-card { overflow: hidden; }

.meta-row { padding: 14px 14px 12px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.field { display: flex; align-items: center; gap: 10px; min-width: 0; }
.field-label {
  font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint);
  font-weight: 650; flex: none; width: 42px;
}
.field-input {
  flex: 1 1 auto; min-width: 0; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px;
  font: inherit; font-size: 14px; outline: none; transition: border-color .15s ease, background .15s ease;
}
.field-input::placeholder { color: var(--faint); }
.field-input:focus { border-color: var(--accent); background: var(--surface); }
.field-count {
  flex: none; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums;
  min-width: 46px; text-align: right;
}

/* ---------- workspace ---------- */

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 316px; }
.editor-col { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); }

.editor-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 10px 9px 14px; border-bottom: 1px solid var(--border); min-height: 46px;
}
.pane-label {
  font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
  font-weight: 640; white-space: nowrap;
}
.sample-tag {
  font-size: 10.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  padding: 1px 6px; border-radius: 5px; letter-spacing: .02em;
}
.editor-tools { margin-left: auto; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.toggle-chip {
  border: 1px solid transparent; background: transparent; color: var(--faint); cursor: pointer;
  font-size: 11.5px; font-weight: 540; padding: 4px 7px; border-radius: 7px;
  display: inline-flex; align-items: center; gap: 5px; transition: .15s ease;
}
.toggle-chip:hover { color: var(--text); background: var(--surface-3); }
.toggle-chip .sw { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.toggle-chip[aria-pressed="true"] { color: var(--text); background: var(--surface-3); border-color: var(--border); }
.toggle-chip[aria-pressed="true"] .sw.d { background: var(--danger); }
.toggle-chip[aria-pressed="true"] .sw.k { background: var(--accent); }

.editor-shell {
  position: relative; flex: 1 1 auto; min-height: 420px; height: 420px;
  background: var(--surface);
}
.editor-shell .hl,
.editor-shell textarea {
  font-family: var(--font);
  font-size: 14.6px;
  line-height: 1.85;
  letter-spacing: -0.003em;
  padding: 18px 20px 26px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  tab-size: 4;
  border: 0;
  margin: 0;
}
.editor-shell .hl {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none; color: transparent;
  background: transparent; z-index: 1;
}
.editor-shell textarea {
  position: relative; z-index: 2; display: block; width: 100%; height: 100%;
  min-height: 420px; resize: none;
  background: transparent; color: var(--text);
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  outline: none; overflow: auto;
}
.editor-shell textarea::placeholder { -webkit-text-fill-color: var(--faint); color: var(--faint); opacity: 1; }
.editor-shell textarea::selection { background: color-mix(in srgb, var(--accent) 32%, transparent); }
.editor-shell .hl::-webkit-scrollbar { width: 10px; }
.kw-list .empty-line { font-size: 12px; color: var(--muted); padding: 10px 2px; }

.editor-shell mark { color: transparent; border-radius: 3px; padding: 1px 0; background: transparent; }
.editor-shell mark.mk-warn { background: var(--mk-warn); box-shadow: inset 0 -2px 0 var(--warn); }
.editor-shell mark.mk-danger { background: var(--mk-danger); box-shadow: inset 0 -2px 0 var(--danger); }
.editor-shell mark.mk-info { background: var(--mk-info); box-shadow: inset 0 -2px 0 var(--good); }
.editor-shell mark.mk-kw { background: var(--mk-kw); }
.editor-shell.mark-risk .hl mark.mk-kw { background: transparent; box-shadow: none; }

.editor-foot {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 12px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--surface-3) 34%, transparent);
}
.stat {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 2px 7px; border-radius: 6px; border: 1px solid transparent;
}
.stat b { font-weight: 620; color: var(--text-dim); font-size: 12px; }
.stat.ok b { color: var(--good-text); }
.stat.warn b { color: var(--warn-text); }
.stat.bad b { color: var(--danger-text); }
.editor-foot .spacer { margin-left: auto; }

/* ---------- rail ---------- */

.rail { display: flex; flex-direction: column; min-width: 0; background: var(--surface-2); }

.score-card { padding: 18px 18px 16px; border-bottom: 1px solid var(--border); }
.score-top { display: flex; align-items: center; gap: 14px; }
.ring { position: relative; width: 96px; height: 96px; flex: none; }
.ring svg { width: 96px; height: 96px; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--surface-3); stroke-width: 7; }
.ring .bar {
  fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round;
  transition: stroke-dashoffset .55s cubic-bezier(.22, 1, .36, 1), stroke .3s ease;
}
.ring.mid .bar { stroke: var(--warn); }
.ring.low .bar { stroke: var(--danger); }
.ring.high .bar { stroke: var(--good); }
.ring-num {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.ring-num b { font-size: 26px; font-weight: 650; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-num span { display: block; margin-top: 4px; font-size: 10px; color: var(--faint); letter-spacing: .08em; }
.score-meta { min-width: 0; }
.score-meta .grade {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 620;
  padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface-3); color: var(--text-dim);
}
.score-meta .grade.high { color: var(--good-text); background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 28%, transparent); }
.score-meta .grade.mid { color: var(--warn-text); background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 28%, transparent); }
.score-meta .grade.low { color: var(--danger-text); background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 28%, transparent); }
.score-meta p { margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.5; }

.score-bars { margin-top: 14px; display: grid; gap: 7px; }
.sbar { display: grid; grid-template-columns: 62px 1fr 34px; align-items: center; gap: 8px; }
.sbar span { font-size: 11px; color: var(--muted); }
.sbar .track { height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.sbar .fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .45s ease; }
.sbar .fill.ok { background: var(--good); }
.sbar .fill.warn { background: var(--warn); }
.sbar .fill.bad { background: var(--danger); }
.sbar b { font-size: 10.5px; color: var(--faint); text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }

.rail-block { padding: 14px 18px 16px; border-bottom: 1px solid var(--border); }
.rail-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 650;
}
.rail-title .n {
  margin-left: auto; font-size: 10px; letter-spacing: 0; color: var(--faint);
  border: 1px solid var(--border); border-radius: 999px; padding: 0 6px;
}
.tips { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.tips li {
  position: relative; padding-left: 18px; font-size: 12.4px; color: var(--text-dim); line-height: 1.55;
}
.tips li::before {
  content: ""; position: absolute; left: 3px; top: 6px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--warn);
}
.tips li.sev-danger::before { background: var(--danger); }
.tips li.sev-good::before { background: var(--good); }
.tips li b { color: var(--text); font-weight: 600; }
.tips .empty { padding-left: 0; color: var(--muted); font-size: 12.4px; }
.tips .empty::before { display: none; }

.rail-foot {
  margin-top: auto; padding: 12px 18px 14px; font-size: 11px; color: var(--faint);
  display: flex; align-items: flex-start; gap: 7px; line-height: 1.5;
}
.rail-foot svg { width: 13px; height: 13px; flex: none; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ---------- panels ---------- */

.panels { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 1px; background: var(--border); border-top: 1px solid var(--border); }
.panel { background: var(--surface); padding: 16px 16px 18px; min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 8px; }
.panel-head h3 { font-size: 13.5px; letter-spacing: -0.01em; }
.panel-head .cnt {
  font-size: 10.5px; color: var(--faint); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.panel-head .more { margin-left: auto; font-size: 11px; color: var(--faint); }
.panel-sub { margin-top: 4px; font-size: 11.5px; color: var(--faint); }

.kw-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.kw {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 7px; cursor: pointer; border: 1px solid transparent;
  transition: .13s ease; background: transparent; text-align: left; width: 100%;
}
.kw:hover { background: var(--surface-3); border-color: var(--border); }
.kw .rank { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.kw .word { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-dim); }
.kw .word .phrase { color: var(--accent); }
.kw .meter { display: flex; align-items: center; gap: 8px; }
.kw .meter i {
  display: block; height: 4px; width: var(--w, 20px); max-width: 78px; border-radius: 2px;
  background: var(--accent); opacity: .55;
}
.kw .meter b { font-size: 11px; color: var(--faint); font-weight: 550; font-variant-numeric: tabular-nums; }
.kw.dense .meter i { background: var(--danger); opacity: .8; }
.kw.dense .meter b { color: var(--danger-text); }

.risk-group + .risk-group { margin-top: 13px; }
.risk-group h4 {
  font-size: 11px; letter-spacing: .02em; color: var(--muted); font-weight: 600;
  display: flex; align-items: center; gap: 6px; margin-bottom: 7px;
}
.risk-group h4 .lv { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.risk-group h4 .lv.danger { background: var(--danger); }
.risk-group h4 .lv.info { background: var(--good); }
.risk-group h4 small { margin-left: auto; color: var(--faint); font-weight: 500; font-size: 10.5px; }
.risk-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.rtag {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  font-size: 11.5px; color: var(--text-dim); padding: 3px 7px; border-radius: 6px;
  background: var(--surface-3); border: 1px solid var(--border); transition: .13s ease;
}
.rtag:hover { border-color: var(--border-strong); color: var(--text); }
.rtag b { font-size: 10px; color: var(--faint); font-weight: 600; }
.rtag.danger { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 24%, transparent); color: var(--danger-text); }
.rtag.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 24%, transparent); color: var(--warn-text); }
.risk-empty { margin-top: 12px; font-size: 12px; color: var(--muted); display: flex; gap: 7px; align-items: flex-start; line-height: 1.55; }
.risk-empty svg { width: 14px; height: 14px; flex: none; margin-top: 2px; fill: none; stroke: var(--good); stroke-width: 2; }

.check-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 1px; }
.check {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 6px 4px; border-radius: 6px; font-size: 12.4px; color: var(--text-dim);
}
.check:hover { background: var(--surface-3); }
.check .box {
  width: 15px; height: 15px; border-radius: 4px; border: 1px solid var(--border-strong);
  display: grid; place-items: center; flex: none;
}
.check .box svg { width: 10px; height: 10px; fill: none; stroke: var(--bg); stroke-width: 3; opacity: 0; }
.check.pass .box { background: var(--good); border-color: var(--good); }
.check.pass .box svg { opacity: 1; }
.check.fail .box { border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: var(--warn-bg); }
.check.fail { color: var(--text-dim); }
.check .manual { font-size: 10px; color: var(--faint); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.check.manual-row { cursor: pointer; }
.check.manual-row .box { cursor: pointer; }
.check.manual-row.done .box { background: var(--accent); border-color: var(--accent); }
.check.manual-row.done .box svg { opacity: 1; stroke: var(--accent-ink); }
.check.manual-row.done span.label { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.check-progress {
  margin-top: 10px; font-size: 11px; color: var(--faint); display: flex; align-items: center; gap: 8px;
}
.check-progress .track { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.check-progress .fill { height: 100%; background: var(--good); border-radius: 2px; transition: width .3s ease; }

.under-card { margin-top: 12px; font-size: 12px; color: var(--faint); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.under-card .dot-sep { opacity: .5; }

/* ---------- diagnose ---------- */

.diag-card { padding: 16px; }
.diag-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.id-wrap {
  flex: 1 1 320px; display: flex; align-items: center; gap: 0; min-width: 0;
  border: 1px solid var(--border-mid); background: var(--surface-2); border-radius: 10px;
  padding: 2px 2px 2px 12px; transition: border-color .15s ease;
}
.id-wrap:focus-within { border-color: var(--accent); }
.id-wrap .pre { font-size: 12.5px; color: var(--faint); white-space: nowrap; font-family: var(--mono); }
.id-wrap input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 14px; padding: 8px 6px; outline: none;
}
.id-wrap input::placeholder { color: var(--faint); }
.diag-note { margin-top: 10px; font-size: 11.5px; color: var(--faint); display: flex; gap: 7px; align-items: flex-start; }
.diag-note svg { width: 12px; height: 12px; flex: none; margin-top: 3px; fill: none; stroke: currentColor; stroke-width: 2; }

.diag-status { margin-top: 14px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.spinner {
  width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--border-strong);
  border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.diag-error {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); background: var(--warn-bg);
  color: var(--warn-text); font-size: 12.5px; line-height: 1.6;
}
.diag-error b { font-weight: 650; }

.diag-result { margin-top: 16px; }
.profile-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.avatar {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 17px; font-weight: 650;
  background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}
.profile-head .who { min-width: 0; }
.profile-head .who h3 { font-size: 15px; }
.profile-head .who p { margin-top: 3px; font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-head .grade-box { margin-left: auto; text-align: right; }
.grade-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650;
  padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-3); color: var(--text-dim);
}
.grade-pill.high { color: var(--good-text); background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 28%, transparent); }
.grade-pill.mid { color: var(--warn-text); background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 28%, transparent); }
.grade-pill.low { color: var(--danger-text); background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 28%, transparent); }
.grade-box small { display: block; margin-top: 4px; font-size: 10.5px; color: var(--faint); }

.via-badge {
  flex: none; margin-left: 6px; font-size: 10.5px; font-weight: 600;
  color: var(--good-text); background: var(--good-bg);
  border: 1px solid color-mix(in srgb, var(--good) 26%, transparent);
  padding: 1px 7px; border-radius: 999px; white-space: nowrap;
}
.chart-empty {
  margin-top: 10px; height: 64px; display: grid; place-items: center;
  font-size: 12px; color: var(--faint);
  border: 1px dashed var(--border-mid); border-radius: 9px;
}
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border); margin-top: 14px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.metric { background: var(--surface-2); padding: 12px 13px; }
.metric .k { font-size: 11px; color: var(--faint); }
.metric .v { margin-top: 5px; font-size: 19px; font-weight: 620; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.metric .v small { font-size: 11px; font-weight: 500; color: var(--faint); margin-left: 3px; letter-spacing: 0; }

.chart-wrap { margin-top: 16px; }
.chart-head { display: flex; align-items: baseline; gap: 8px; font-size: 11.5px; color: var(--faint); }
.chart-head b { color: var(--text-dim); font-weight: 600; font-size: 12px; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 88px; margin-top: 10px; padding-top: 6px; border-bottom: 1px solid var(--border); }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.chart .col i {
  display: block; width: 100%; max-width: 34px; border-radius: 3px 3px 0 0;
  background: color-mix(in srgb, var(--accent) 55%, var(--surface-3)); min-height: 2px;
  transition: height .4s ease;
}
.chart .col.zero i { background: var(--surface-3); }
.chart .col.now i { background: var(--accent); }
.chart .col span { font-size: 9px; color: var(--faint); white-space: nowrap; }

.post-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 1px; max-height: 264px; overflow: auto; }
.post-list li { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; padding: 7px 6px; border-radius: 6px; align-items: baseline; }
.post-list li:hover { background: var(--surface-3); }
.post-list time { font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.post-list a { font-size: 12.6px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-list a:hover { color: var(--accent); }
.diag-tips { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.diag-tips h4 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 650; }
.diag-tips ul { margin: 8px 0 0; padding-left: 16px; display: grid; gap: 5px; }
.diag-tips li { font-size: 12.4px; color: var(--muted); line-height: 1.55; }
.diag-tips li b { color: var(--text-dim); font-weight: 600; }

.manual-paste { margin-top: 14px; }
.manual-paste textarea {
  width: 100%; min-height: 110px; margin-top: 8px; resize: vertical;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
  color: var(--text); font-family: var(--mono); font-size: 11.5px; line-height: 1.6; padding: 10px 12px;
  outline: none;
}
.manual-paste textarea:focus { border-color: var(--accent); }
.manual-paste .row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }

/* ---------- guide ---------- */

.gcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 30px; }
.gcard { border: 1px solid var(--border); border-radius: 13px; background: var(--surface); padding: 18px 18px 20px; }
.gcard .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; }
.gcard .ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.gcard h3 { font-size: 14.5px; }
.gcard p { margin-top: 7px; font-size: 13px; color: var(--muted); line-height: 1.65; }
.gcard ul { margin: 10px 0 0; padding-left: 16px; }
.gcard li { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; }
.gcard li + li { margin-top: 4px; }

.table-wrap { margin-top: 26px; border: 1px solid var(--border); border-radius: 12px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 650; background: var(--bg-soft); }
tr:last-child td { border-bottom: 0; }
td { color: var(--muted); line-height: 1.6; }
td b { color: var(--text-dim); font-weight: 600; }

.note-block { margin-top: 26px; padding: 24px 26px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-soft); }
.note-block h3 { font-size: 15px; }
.note-block p { margin-top: 10px; font-size: 13.8px; color: var(--muted); max-width: 84ch; line-height: 1.72; }
.note-block b { color: var(--text-dim); font-weight: 600; }

.faq-list { margin-top: 26px; border-top: 1px solid var(--border); }
.faq-list details { border-bottom: 1px solid var(--border); }
.faq-list summary { cursor: pointer; padding: 16px 30px 16px 2px; font-size: 14.5px; font-weight: 550; list-style: none; position: relative; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 17px; font-weight: 400; transition: .2s ease; }
.faq-list details[open] summary::after { content: "–"; }
.faq-list p { padding: 0 40px 18px 2px; color: var(--muted); font-size: 13.5px; line-height: 1.72; max-width: 92ch; }

/* ---------- footer ---------- */

.site-footer { margin-top: 84px; border-top: 1px solid var(--border); background: var(--bg-soft); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-start; padding: 34px 0 40px; }
.footer-brand { display: flex; flex-direction: column; gap: 6px; }
.footer-brand .brand-name { font-size: 14px; }
.footer-brand p { font-size: 12.5px; color: var(--faint); max-width: 36ch; }
.footer-col { display: flex; flex-direction: column; gap: 7px; }
.footer-col h4 { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 650; margin: 0 0 2px; }
.footer-col a { font-size: 12.5px; color: var(--muted); }
.footer-col a:hover { color: var(--text); }
.footer-nav { margin-left: auto; display: flex; gap: 22px; flex-wrap: wrap; }
.footer-fine { font-size: 12px; color: var(--faint); width: 100%; margin-top: 6px; }

.noscript { margin: 20px auto; max-width: 720px; padding: 12px 16px; font-size: 13px; border: 1px solid var(--warn-bg); background: var(--warn-bg); color: var(--warn-text); border-radius: 10px; text-align: center; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 8px);
  background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: 9px;
  font-size: 12.5px; font-weight: 550; z-index: 90; opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease; box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .6);
  max-width: min(90vw, 460px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- doc pages ---------- */

.doc { padding: 52px 0 0; max-width: 760px; }
.doc h1 { font-size: clamp(1.7rem, 1.3rem + 1.3vw, 2.3rem); }
.doc .updated { margin-top: 10px; font-size: 12.5px; color: var(--faint); }
.doc h2 { font-size: 15.5px; margin: 32px 0 8px; }
.doc p, .doc li { font-size: 14px; color: var(--text-dim); line-height: 1.78; }
.doc p + p { margin-top: 10px; }
.doc ul, .doc ol { margin: 10px 0 0; padding-left: 20px; }
.doc li + li { margin-top: 4px; }
.doc a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.doc .lede-doc { margin-top: 18px; font-size: 14.5px; color: var(--muted); }
.doc code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.doc .callout { margin-top: 18px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-soft); font-size: 13px; color: var(--muted); }
.doc-404 { padding: 90px 0 40px; text-align: center; }
.doc-404 .code { font-family: var(--mono); font-size: 12px; letter-spacing: .2em; color: var(--faint); }
.doc-404 h1 { margin-top: 14px; font-size: clamp(1.8rem, 1.4rem + 2vw, 2.8rem); }
.doc-404 p { margin-top: 12px; color: var(--muted); font-size: 14px; }
.doc-404 .btn { margin-top: 22px; }

/* ---------- responsive ---------- */

@media (max-width: 1040px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 290px; }
  .panels { grid-template-columns: 1fr 1fr; }
  .panel:last-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .site-nav { display: none; }
  .gcards { grid-template-columns: 1fr; }
  .via-badge {
  flex: none; margin-left: 6px; font-size: 10.5px; font-weight: 600;
  color: var(--good-text); background: var(--good-bg);
  border: 1px solid color-mix(in srgb, var(--good) 26%, transparent);
  padding: 1px 7px; border-radius: 999px; white-space: nowrap;
}
.chart-empty {
  margin-top: 10px; height: 64px; display: grid; place-items: center;
  font-size: 12px; color: var(--faint);
  border: 1px dashed var(--border-mid); border-radius: 9px;
}
.metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .wrap { width: calc(100% - 24px); }
  .header-inner { height: 54px; gap: 10px; }
  .brand-tool { display: none; }
  .hero { padding: 28px 0 14px; }
  .hero .lede { font-size: 14px; }
  .workspace { grid-template-columns: 1fr; }
  .editor-col { border-right: 0; border-bottom: 1px solid var(--border); }
  .editor-shell { min-height: 300px; height: 300px; }
  .editor-shell, .editor-shell textarea { min-height: 300px; }
  .rail { display: grid; grid-template-columns: 1fr; }
  .score-card { border-bottom: 1px solid var(--border); }
  .rail-foot { display: none; }
  .panels { grid-template-columns: 1fr; }
  .panel:last-child { grid-column: auto; }
  .panel + .panel { border-top: 1px solid var(--border); }
  .meta-row { padding: 12px; }
  .field-label { width: 34px; font-size: 10px; }
  .section { padding-top: 58px; }
  .footer-nav { margin-left: 0; }
  .diag-card { padding: 12px; }
  .post-list { max-height: 300px; }
}

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