/* Pikkola CSV Workbench (26호기).
   A working sheet on a desk: warm paper, hairline rules, tabular figures and one
   pine accent for anything you can act on. Weights stay at 400, 500, 600 and 700. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/fonts/inter.woff2) format("woff2-variations");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/jetbrains-mono.woff2) format("woff2");
}

:root {
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1180px;
  --r: 10px;
  --r-sm: 6px;
}

html[lang="ko"] {
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  word-break: keep-all;
}
html[lang="ja"] {
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  word-break: normal;
}
html[lang="ja"] h1, html[lang="ja"] h2, html[lang="ja"] h3, html[lang="ja"] p, html[lang="ja"] li, html[lang="ja"] summary {
  word-break: auto-phrase; line-break: strict; overflow-wrap: break-word;
}

html[data-theme="light"] {
  --bg: #f4f3ec;
  --bg-2: #ecebe2;
  --surface: #fffef9;
  --surface-2: #f7f6ee;
  --surface-3: #f1efe4;
  --ink: #16181a;
  --ink-2: #3f4442;
  --ink-3: #6d726d;
  --ink-4: #9aa09a;
  --line: #dedcd0;
  --line-2: #c8c5b6;
  --accent: #1d5c4f;
  --accent-2: #12443a;
  --accent-ink: #f4fbf8;
  --accent-soft: #dcebe4;
  --mark: #d9a83f;
  --mark-soft: #f6eac4;
  --warn: #9a5f19;
  --warn-soft: #f7e8cd;
  --danger: #a23f2c;
  --danger-soft: #f6e0da;
  --code-bg: #1a1d18;
  --code-ink: #e7eadf;
  --code-dim: #9ba697;
  --shadow: 0 1px 2px rgba(28, 30, 24, .05), 0 12px 32px -18px rgba(28, 30, 24, .25);
}

html[data-theme="dark"] {
  --bg: #101310;
  --bg-2: #161a16;
  --surface: #1a1e19;
  --surface-2: #20251f;
  --surface-3: #262c24;
  --ink: #eef0e6;
  --ink-2: #c4cabe;
  --ink-3: #909a8c;
  --ink-4: #6c766a;
  --line: #2b312a;
  --line-2: #3b423a;
  --accent: #6fc7a9;
  --accent-2: #8ed9bd;
  --accent-ink: #08201a;
  --accent-soft: #1d3a31;
  --mark: #e0bb63;
  --mark-soft: #3a331e;
  --warn: #d9a05a;
  --warn-soft: #392b1a;
  --danger: #e08a76;
  --danger-soft: #3a221d;
  --code-bg: #0b0e0b;
  --code-ink: #dfe4d8;
  --code-dim: #8d978a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -20px rgba(0, 0, 0, .8);
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.02em; line-height: 1.18; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

.visually-hidden {
  position: absolute !important;
  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: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-sm);
  text-decoration: none;
  font-size: .9rem;
}
.skip-link:focus { top: 14px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  flex: none;
}
.brand-mark { width: 26px; height: 26px; color: var(--accent); }
.brand-name { font-weight: 650; letter-spacing: -0.02em; font-size: 1.02rem; }
.brand-tool {
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .12em;
  color: var(--ink-3);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  padding: 2px 5px;
  margin-left: 1px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: 6px;
  font-size: .875rem;
  color: var(--ink-2);
}
.site-nav a { text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--line-2); }

.header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.lang-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 3px 4px 3px 8px;
  background: var(--surface);
}
.lang-globe { width: 14px; height: 14px; }
.lang-field select {
  border: 0;
  background: transparent;
  font-size: .78rem;
  font-family: var(--mono);
  padding: 2px 2px;
  cursor: pointer;
  color: var(--ink-2);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-2);
}
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.small { width: 30px; height: 28px; }
.icon-btn.small svg { width: 15px; height: 15px; }
.icon-btn:disabled { opacity: .35; cursor: default; }

html[data-theme="light"] .ico-sun { display: none; }
html[data-theme="dark"] .ico-moon { display: none; }

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

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  gap: 54px;
  align-items: center;
  padding-top: 66px;
  padding-bottom: 54px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -60px -10vw auto;
  height: 460px;
  z-index: -1;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--line) 58%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line) 58%, transparent) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(70% 80% at 38% 30%, #000 0%, transparent 72%);
  mask-image: radial-gradient(70% 80% at 38% 30%, #000 0%, transparent 72%);
  opacity: .85;
  pointer-events: none;
}

.eyebrow {
  display: inline-block;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2.05rem, 4.1vw, 3.25rem);
  line-height: 1.07;
  letter-spacing: -0.032em;
  font-weight: 680;
  max-width: 15em;
}
html[lang="ko"] .hero h1 { letter-spacing: -0.045em; line-height: 1.14; }

.hero-lede {
  margin-top: 22px;
  max-width: 36em;
  font-size: 1.02rem;
  line-height: 1.72;
  color: var(--ink-2);
}

.facts {
  display: flex;
  gap: 38px;
  margin: 32px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  max-width: 430px;
}
.facts div { display: flex; flex-direction: column; gap: 3px; }
.facts dt { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; }
.facts dd { margin: 0; font-size: .77rem; color: var(--ink-3); }

/* the plate */

.plate {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-size: .8rem;
}

.plate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-size: .7rem;
  color: var(--ink-3);
}
.plate-badge {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: .64rem;
  letter-spacing: .02em;
}

.plate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .74rem;
}
.plate-table th, .plate-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.plate-table th {
  font-family: var(--mono);
  font-weight: 500;
  font-size: .62rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-4);
  border-bottom: 1px solid var(--line-2);
}
.plate-table .num { text-align: right; }
.plate-table .rn { width: 26px; color: var(--ink-4); font-size: .64rem; }
.plate-table tr:last-child td { border-bottom: 0; }
.plate-table .hl td { background: color-mix(in srgb, var(--mark-soft) 55%, transparent); }
.plate-table .hl td:first-child { box-shadow: inset 2px 0 0 var(--mark); }

.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: .6rem;
  padding: 1px 6px;
  border-radius: 20px;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  background: var(--surface-2);
}
.pill.ok { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--accent-soft); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); background: var(--warn-soft); }

.plate-foot {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  padding: 10px 14px 12px;
  display: grid;
  gap: 9px;
}
.profile-row { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .63rem; color: var(--ink-3); }
.profile-row b { color: var(--ink-2); font-weight: 500; }
.plate-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .66rem;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  width: fit-content;
}
.toast-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.toast-undo { margin-left: 6px; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- workbench ---------- */

.workbench { padding-bottom: 24px; }

.wb-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.wb-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
}
.wb-kicker {
  display: block;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 5px;
}
.wb-title h2 { font-size: 1.32rem; letter-spacing: -0.025em; }
.wb-head-actions { display: flex; gap: 8px; flex: none; }

.ghost-btn {
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: var(--r-sm);
  padding: 7px 12px;
  font-size: .82rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.ghost-btn:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface)); }
.ghost-btn.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-sm);
  padding: 8px 15px;
  font-size: .86rem;
  font-weight: 550;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); }
.small-btn { padding: 6px 13px; font-size: .8rem; }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.link-btn:hover { color: var(--accent-2); }

/* drop */

.drop {
  margin: 0 24px 18px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r);
  background:
    linear-gradient(to bottom, color-mix(in srgb, var(--surface-2) 70%, transparent), transparent 70%);
  padding: 46px 24px 44px;
  text-align: center;
  transition: border-color .15s ease, background .15s ease;
}
.drop:hover, .drop:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface)); }
.drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop-icon { width: 46px; height: 46px; margin: 0 auto 14px; color: var(--accent); opacity: .9; }
.drop-title { font-size: 1.08rem; font-weight: 600; letter-spacing: -0.015em; }
.drop-sub { margin-top: 6px; font-size: .86rem; color: var(--ink-3); }
.drop-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  font-size: .86rem;
}
.btn-like {
  display: inline-block;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-sm);
  padding: 8px 16px;
  font-weight: 500;
}
.drop-or { color: var(--ink-4); font-size: .72rem; }

.paste-panel {
  margin: 0 24px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  padding: 14px;
}
.paste-panel textarea {
  width: 100%;
  min-height: 128px;
  resize: vertical;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 11px 12px;
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.6;
  color: var(--ink);
  tab-size: 4;
}
.paste-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.paste-hint { margin-right: auto; font-size: .68rem; color: var(--ink-3); }

.samples {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 24px 22px;
}
.samples-label {
  font-size: .68rem;
  letter-spacing: .04em;
  color: var(--ink-4);
  margin-right: 2px;
}
.chip {
  border: 1px solid var(--line-2);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: .78rem;
  color: var(--ink-2);
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* loaded */

.loaded.is-over { outline: 2px dashed var(--accent); outline-offset: -6px; }

.filebar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  flex-wrap: wrap;
}
.filebar-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.file-ico { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.file-name {
  font-weight: 550;
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}
.file-badge { font-size: .66rem; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 3px; padding: 1px 5px; }
.filebar-stats { display: flex; flex-wrap: wrap; gap: 0; margin-left: auto; font-size: .68rem; color: var(--ink-3); }
.filebar-stats span { padding: 0 10px; border-left: 1px solid var(--line-2); white-space: nowrap; }
.filebar-stats span:first-child { border-left: 0; padding-left: 0; }
.filebar-actions { flex: none; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 24px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  background: var(--surface);
}
.tool-group { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tool-group.right { gap: 8px; }

.field { display: inline-flex; align-items: center; gap: 6px; }
.field.inline { gap: 5px; }
.field-label {
  font-size: .6rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-4);
  white-space: nowrap;
}
.field select, .field input[type="text"] {
  border: 1px solid var(--line-2);
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 5px 7px;
  font-size: .78rem;
  color: var(--ink);
  font-family: var(--mono);
}
.field select:hover, .field input[type="text"]:hover { border-color: var(--accent); }

.switch { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--ink-2); cursor: pointer; }
.switch input { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; cursor: pointer; }
.switch.small { font-size: .78rem; color: var(--ink-3); }

.search-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 0 9px;
  background: var(--surface);
  min-width: 208px;
}
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent); }
.search-field svg { width: 15px; height: 15px; color: var(--ink-4); flex: none; }
.search-field input {
  border: 0;
  background: transparent;
  padding: 6px 0;
  font-size: .82rem;
  width: 100%;
  outline: none;
}
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }

.viewbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 8px 24px;
  font-size: .68rem;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  min-height: 33px;
  align-items: center;
}
.viewbar:empty { display: none; }
.view-dupes { color: var(--warn); background: var(--warn-soft); border-radius: 20px; padding: 1px 8px; }

/* the grid */

.grid-wrap {
  position: relative;
  max-height: 620px;
  overflow: auto;
  background: var(--surface);
  overscroll-behavior: contain;
}

.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}

.grid thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface-3);
  border-bottom: 1px solid var(--line-2);
  padding: 0;
  vertical-align: bottom;
  text-align: left;
}
.grid thead tr:first-child th { border-top: 0; }

.grid th.rn-th, .grid tbody th.rn {
  width: 54px;
  min-width: 54px;
  padding: 9px 10px;
  text-align: right;
  color: var(--ink-4);
  font-size: .66rem;
  font-weight: 400;
  border-right: 1px solid var(--line);
  background: var(--surface-3);
  position: sticky;
  left: 0;
  z-index: 2;
}
.grid tbody th.rn { background: var(--surface); z-index: 1; }

.th-btn {
  display: flex;
  align-items: baseline;
  gap: 6px;
  width: 100%;
  border: 0;
  background: none;
  padding: 9px 12px 8px;
  text-align: left;
  color: var(--ink-2);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}
.th-btn:hover { color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
.th-label { overflow: hidden; text-overflow: ellipsis; }
.th-type {
  font-size: .6rem;
  font-weight: 400;
  letter-spacing: .04em;
  color: var(--ink-3);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  padding: 0 3px;
  flex: none;
}
.th-mark { margin-left: auto; color: var(--ink-4); font-size: .66rem; }
th[aria-sort="ascending"] .th-mark, th[aria-sort="descending"] .th-mark { color: var(--accent); }
th[aria-sort="ascending"], th[aria-sort="descending"] { background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface-3)); }

.filter-row th {
  position: sticky;
  top: 34px;
  z-index: 3;
  background: var(--surface-3);
  padding: 0 6px 7px;
  border-bottom: 1px solid var(--line-2);
}
.filter-input {
  width: 100%;
  min-width: 76px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--surface);
  padding: 3px 6px;
  font-size: .68rem;
  font-family: var(--sans);
  outline: none;
}
.filter-input:focus { border-color: var(--accent); }

.grid tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
  color: var(--ink);
}
.grid tbody tr:nth-child(even) td, .grid tbody tr:nth-child(even) th.rn { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.grid tbody tr:hover td, .grid tbody tr:hover th.rn { background: color-mix(in srgb, var(--accent-soft) 30%, var(--surface)); }
.grid td.num { text-align: right; font-family: var(--mono); font-size: .76rem; }
.grid td.date { font-family: var(--mono); font-size: .74rem; color: var(--ink-2); }
.grid td.bool { font-family: var(--mono); font-size: .74rem; color: var(--ink-2); }
.grid td.is-empty { text-align: left; }
.grid td.is-empty::after { content: "·"; color: var(--ink-4); }
.grid tbody tr:last-child td, .grid tbody tr:last-child th.rn { border-bottom: 0; }

.grid-empty {
  position: sticky;
  left: 0;
  padding: 54px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: .9rem;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  flex-wrap: wrap;
}
.pager-info { font-size: .7rem; color: var(--ink-3); }
.pager-controls { display: flex; align-items: center; gap: 8px; }

/* ---------- sections ---------- */

.section { padding: 66px 28px 0; }

.section-head {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  column-gap: 0;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.section-num {
  grid-row: 1 / span 2;
  font-size: .7rem;
  color: var(--accent);
  letter-spacing: .06em;
  padding-top: .35em;
}
.section-head h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.95rem);
  letter-spacing: -0.028em;
  max-width: 22em;
}
.section-lede {
  grid-column: 2;
  margin-top: 12px;
  max-width: 46em;
  color: var(--ink-2);
  font-size: .95rem;
  line-height: 1.72;
}

/* profiles */

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 12px;
  margin-top: 28px;
}
.profile-card {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 13px 14px 12px;
  border-top: 2px solid var(--line-2);
}
.profile-card.t-int, .profile-card.t-number { border-top-color: var(--accent); }
.profile-card.t-date { border-top-color: var(--mark); }
.profile-card.t-bool { border-top-color: var(--warn); }
.profile-card.t-empty { border-top-color: var(--ink-4); }
.profile-card-head { display: flex; align-items: center; gap: 7px; margin-bottom: 11px; }
.profile-index { font-size: .62rem; color: var(--ink-4); }
.profile-name {
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.type-pill {
  margin-left: auto;
  flex: none;
  font-size: .58rem;
  letter-spacing: .03em;
  padding: 1px 5px;
  border-radius: 20px;
  background: var(--surface-3);
  color: var(--ink-3);
}
.type-pill.t-int, .type-pill.t-number { background: var(--accent-soft); color: var(--accent); }
.type-pill.t-date { background: var(--mark-soft); color: var(--warn); }
.type-pill.t-bool { background: var(--warn-soft); color: var(--warn); }
.profile-stats { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; }
.profile-stats div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.profile-stats dt { font-family: var(--sans); font-size: .64rem; color: var(--ink-3); }
.profile-stats dd { margin: 0; font-size: .76rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-empty { margin-top: 26px; font-size: .88rem; color: var(--ink-3); }

/* export */

.export-shell {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
}

.export-tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tab {
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  padding: 11px 22px;
  font-size: .78rem;
  color: var(--ink-3);
  position: relative;
}
.tab-code { letter-spacing: .06em; }
.tab:hover { color: var(--ink); }
.tab.is-on { background: var(--surface); color: var(--accent); }
.tab.is-on::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--accent);
}

.export-pane { padding: 14px 18px 0; border-bottom: 1px solid var(--line); }
.export-pane[hidden] { display: none; }
.export-opts { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-bottom: 13px; }
.export-desc { font-size: .84rem; color: var(--ink-2); line-height: 1.6; flex: 1 1 320px; max-width: 62em; }

.export-body { background: var(--code-bg); }
.export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 14px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  flex-wrap: wrap;
}
.export-meta { font-size: .66rem; color: var(--code-dim); }
.export-actions { display: flex; gap: 8px; }
.export-body .ghost-btn {
  background: transparent;
  border-color: rgba(255, 255, 255, .2);
  color: #dfe4d8;
  padding: 5px 11px;
  font-size: .76rem;
}
.export-body .ghost-btn:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .4); color: #fff; }
.export-body .btn {
  background: #e8ebdf;
  border-color: #e8ebdf;
  color: #16181a;
}
.export-body .btn:hover { background: #ffffff; border-color: #ffffff; }

.export-code {
  margin: 0;
  padding: 15px 18px 20px;
  max-height: 400px;
  overflow: auto;
  font-size: .76rem;
  line-height: 1.72;
  color: var(--code-ink);
  tab-size: 2;
  white-space: pre;
}
.export-code[data-preview="1"]::after {
  content: "";
}

/* method */

.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px 46px;
  margin-top: 30px;
}
.method-item {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.method-num { font-size: .64rem; color: var(--accent); letter-spacing: .06em; }
.method-item h3 { margin-top: 6px; font-size: 1rem; font-weight: 600; letter-spacing: -0.015em; }
.method-item p { margin-top: 7px; font-size: .88rem; color: var(--ink-2); line-height: 1.7; }

/* faq */

.faq-list { margin-top: 26px; max-width: 60em; }
.faq-list details { border-top: 1px solid var(--line); }
.faq-list details:last-child { border-bottom: 1px solid var(--line); }
.faq-list summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 2px;
  font-size: .95rem;
  font-weight: 550;
  cursor: pointer;
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::before {
  content: "+";
  font-family: var(--mono);
  color: var(--ink-4);
  font-size: .95rem;
  width: 14px;
  flex: none;
}
.faq-list details[open] summary::before { content: "\2212"; color: var(--accent); }
.faq-list details p {
  padding: 0 0 18px 26px;
  font-size: .89rem;
  color: var(--ink-2);
  line-height: 1.74;
  max-width: 54em;
}

/* related */

.related { padding-bottom: 72px; }
.related-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}
.related-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 17px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  text-decoration: none;
  transition: border-color .14s ease, transform .14s ease;
}
.related-link:hover { border-color: var(--accent); transform: translateY(-1px); }
.related-tag { font-size: .62rem; color: var(--ink-4); letter-spacing: .06em; }
.related-title { font-size: .94rem; font-weight: 600; letter-spacing: -0.015em; }
.related-body { font-size: .82rem; color: var(--ink-3); line-height: 1.6; }

/* footer */

.site-footer { border-top: 1px solid var(--line); background: var(--surface-2); }
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 30px;
  padding: 26px 28px 30px;
}
.footer-brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.footer-name { font-size: .78rem; color: var(--ink-2); }
.footer-lab {
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-4);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  padding: 1px 5px;
}
.footer-nav { display: flex; gap: 18px; font-size: .78rem; color: var(--ink-3); flex-wrap: wrap; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
.footer-note { grid-column: 1 / -1; font-size: .74rem; color: var(--ink-4); }

/* toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(92vw, 640px);
  padding: 11px 16px;
  border-radius: 10px;
  background: #1c201a;
  color: #f1f4ea;
  box-shadow: 0 12px 34px -10px rgba(0, 0, 0, .5);
  font-size: .84rem;
  line-height: 1.45;
}
html[data-theme="dark"] .toast { background: #e9ecdf; color: #16181a; }
.toast-btn {
  border: 0;
  background: rgba(255, 255, 255, .14);
  color: inherit;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: .78rem;
  font-weight: 600;
  flex: none;
}
html[data-theme="dark"] .toast-btn { background: rgba(0, 0, 0, .1); }

/* ---------- plain pages ---------- */

.doc-wrap { max-width: 860px; padding-top: 56px; padding-bottom: 80px; }
.notfound { padding-top: 12vh; }
.doc { max-width: 720px; }
.doc h1 { font-size: clamp(2rem, 4vw, 2.9rem); letter-spacing: -0.03em; }
html[lang="ko"] .doc h1 { letter-spacing: -0.04em; }
.doc-date { margin-top: 8px; font-size: .72rem; color: var(--ink-4); }
.doc-lede {
  margin-top: 20px;
  font-size: 1.08rem;
  line-height: 1.72;
  color: var(--ink-2);
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.doc h2 {
  margin-top: 34px;
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.doc p { margin-top: 10px; font-size: .93rem; line-height: 1.78; color: var(--ink-2); }
.doc a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.doc .btn { display: inline-block; margin-top: 24px; text-decoration: none; color: var(--accent-ink); }
.doc .btn:hover { color: var(--accent-ink); }

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

@media (max-width: 1040px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 48px; }
  .plate { max-width: 560px; }
  .site-nav { display: none; }
}

@media (max-width: 820px) {
  .wrap { padding: 0 18px; }
  .section { padding: 52px 18px 0; }
  .section-head { grid-template-columns: 38px minmax(0, 1fr); }
  .method-grid { grid-template-columns: 1fr; gap: 20px; }
  .related-row { grid-template-columns: 1fr; }
  .filebar { gap: 8px 14px; }
  .filebar-stats { margin-left: 0; width: 100%; }
  .filebar-stats span { padding: 0 8px; }
  .toolbar { gap: 10px; }
  .search-field { min-width: 100%; order: -1; }
  .tool-group.right { width: 100%; }
  .tool-group.right .ghost-btn { flex: 1; }
  .grid-wrap { max-height: 480px; }
  .footer-inner { grid-template-columns: 1fr; }
  .export-tabs { overflow-x: auto; }
  .tab { padding: 10px 16px; flex: none; }
  .profile-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .header-inner { min-height: 56px; gap: 12px; }
  .brand-name { font-size: .95rem; }
  .hero { padding-top: 38px; padding-bottom: 38px; }
  .facts { gap: 24px; }
  .drop { padding: 34px 16px 32px; margin: 0 14px 14px; }
  .drop-actions { flex-direction: column; gap: 8px; }
  .wb-head { padding: 18px 16px 14px; flex-direction: column; align-items: stretch; }
  .wb-head-actions .ghost-btn { flex: 1; }
  .filebar, .toolbar, .viewbar, .pager { padding-left: 14px; padding-right: 14px; }
  .grid thead th { position: sticky; }
  .profile-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .profile-card { padding: 11px 11px 10px; }
  .profile-stats { grid-template-columns: 1fr; gap: 4px; }
  .export-pane { padding: 12px 14px 0; }
  .export-opts { gap: 10px; }
  .export-code { font-size: .68rem; padding: 12px 14px 16px; }
  .toast { bottom: 14px; width: calc(100vw - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
