/* 트레이스 세린 지부 공개 열람 단말 SR-07
   어두운 단말 외곽 + 가운데 종이 문서 한 장. 작품 안내는 단말 밖 색. */
:root {
  --bezel: #0B0F12;
  --term: #11171B;
  --term-2: #172026;
  --term-line: #26323A;
  --term-text: #DCE4E7;
  --term-muted: #8D9BA3;
  --teal: #3CC4B6;
  --warn: #F0A04B;

  --paper: #EFEBE2;
  --paper-2: #E5E0D4;
  --paper-line: #CFC8B8;
  --ink: #1E2327;
  --ink-2: #4A5258;
  --ink-teal: #16786E;
  --red: #B8352E;

  --gd: #2E7D4A; --gc: #9A7410; --gb: #C0661A; --ga: #B8352E;

  --serif: "Noto Serif KR", "AppleMyungjo", serif;
  --sans: "IBM Plex Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "IBM Plex Sans KR", "Apple SD Gothic Neo", monospace;
  --rail: 232px;
  --max: 1280px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bezel);
  color: var(--term-text);
  font: 16px/1.75 var(--sans);
  word-break: keep-all;
  overflow-wrap: break-word;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
p { margin: 0 0 .8em; }
small { font-size: .8em; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--teal); color: #000; padding: 8px 12px; z-index: 20; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ── 단말 외곽 ─────────────────────────────── */
.term {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--term);
  border-left: 1px solid var(--term-line);
  border-right: 1px solid var(--term-line);
}
.term-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px;
  padding: 10px 20px;
  background: rgba(11, 15, 18, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--term-line);
  font-size: 13px; color: var(--term-muted);
}
.term-bar b { color: var(--term-text); font-weight: 500; }
.unit { display: flex; align-items: center; gap: 10px; color: var(--term-text); font-weight: 600; font-size: 15px; }
.mark { width: 22px; height: 14px; border: 1px solid var(--teal); background: repeating-linear-gradient(135deg, var(--teal) 0 4px, transparent 4px 8px); }
.bar-sep { width: 1px; height: 16px; background: var(--term-line); }
.bar-item.open { color: var(--teal); }
.bar-item.open b { color: var(--teal); }
.bar-item.open::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); margin-right: 8px; vertical-align: 1px; animation: blink 2.4s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .bar-item.open::before { animation: none; } }
.bar-item.right { margin-left: auto; }

.term-body { flex: 1; display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }

/* ── 문서철 ─────────────────────────────── */
.rail {
  position: sticky; top: 49px; align-self: start;
  max-height: calc(100vh - 49px); overflow-y: auto;
  padding: 24px 16px 24px 20px;
  border-right: 1px solid var(--term-line);
  font-size: 14px;
}
.rail-title { margin: 0 0 8px; font-size: 12px; color: var(--term-muted); letter-spacing: .08em; }
.rail-title.out { margin-top: 24px; color: var(--warn); }
.rail ol { list-style: none; margin: 0; padding: 0; }
.rail a {
  display: flex; gap: 10px; align-items: baseline;
  padding: 7px 10px; margin: 0 -10px;
  text-decoration: none; color: var(--term-muted);
  border-left: 2px solid transparent;
}
.rail a i { font-style: normal; font-family: var(--mono); font-size: 12px; color: #5E6C74; min-width: 18px; }
.rail a:hover { color: var(--term-text); background: var(--term-2); }
.rail a[aria-current="page"] { color: var(--term-text); background: var(--term-2); border-left-color: var(--teal); }
.rail a[aria-current="page"] i { color: var(--teal); }
.rail ol.out a[aria-current="page"] { border-left-color: var(--warn); }
.rail ol.out a[aria-current="page"] i { color: var(--warn); }

/* ── 문서 한 장 ─────────────────────────────── */
.pane { padding: 32px clamp(16px, 4vw, 48px) 56px; min-width: 0; }
.doc + .doc { margin-top: 40px; }
body.js .doc + .doc { margin-top: 0; }
.paper {
  position: relative; display: flow-root;
  max-width: 900px; margin: 0 auto;
  padding: clamp(24px, 4vw, 48px);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--paper-line), 0 18px 40px rgba(0, 0, 0, .45);
}
.paper::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: repeating-linear-gradient(135deg, var(--ink-teal) 0 10px, transparent 10px 20px);
}
.paper h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.01em; margin: 0 0 20px; }
.paper h2 {
  font-family: var(--serif); font-weight: 900; font-size: 21px;
  margin: 40px 0 14px; padding-top: 18px; border-top: 1px solid var(--paper-line);
}
.paper h2 small { font-family: var(--sans); font-weight: 400; font-size: 13px; color: var(--ink-2); margin-left: 8px; }
.paper .first { font-size: 17px; }
.paper b { font-weight: 600; }
.note, .fine { color: var(--ink-2); font-size: 14px; }
.fine { margin: 0; }

/* 문서 머리 */
.slip {
  display: flex; flex-wrap: wrap; gap: 0;
  margin-bottom: 24px;
  border: 1px solid var(--paper-line);
  font-size: 12px; color: var(--ink-2);
}
.slip span { display: flex; flex-direction: column; padding: 6px 12px; border-right: 1px solid var(--paper-line); flex: 1 1 auto; }
.slip span:last-child { border-right: 0; }
.slip b { font-size: 14px; font-weight: 500; color: var(--ink); }

/* 사진 */
.shot { margin: 0 0 24px; }
.shot img { width: 100%; aspect-ratio: 1200 / 320; object-fit: cover; filter: saturate(.85); }
.shot figcaption { font-size: 13px; color: var(--ink-2); padding-top: 6px; }

/* 도장 */
.stamp {
  position: absolute; right: clamp(20px, 6vw, 64px); top: 150px;
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-content: center; text-align: center;
  border: 3px solid var(--red); color: var(--red);
  font-size: 12px; line-height: 1.3; font-weight: 600;
  transform: rotate(-14deg); opacity: .8;
  mix-blend-mode: multiply; pointer-events: none;
}
.stamp b { font-family: var(--serif); font-size: 20px; font-weight: 900; }
.stamp.small { width: 58px; height: 58px; top: auto; bottom: 16px; right: 16px; font-size: 13px; }

/* 장부 표 */
.ledger { width: 100%; border-collapse: collapse; font-size: 15px; }
.ledger td { padding: 9px 10px; border-bottom: 1px solid var(--paper-line); vertical-align: top; }
.ledger tr:first-child td { border-top: 2px solid var(--ink); }
.ledger .k { font-variant-numeric: tabular-nums; color: var(--ink-teal); white-space: nowrap; width: 1%; font-weight: 500; }
.ledger .s { text-align: right; white-space: nowrap; color: var(--ink-2); font-size: 13px; }
.ledger .s.on { color: var(--ink-teal); font-weight: 600; }
.ledger caption { text-align: left; font-weight: 600; padding-bottom: 8px; }
.ledger caption small { font-weight: 400; color: var(--ink-2); margin-left: 6px; }

/* ── 01 측정 ─────────────────────────────── */
.steps { counter-reset: s; list-style: none; margin: 0 0 16px; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 18px 52px; }
.steps li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute; left: 0; top: 2px;
  font-family: var(--mono); font-size: 13px; color: var(--ink-teal);
  border: 1px solid var(--ink-teal); padding: 0 6px;
}
.steps b { display: block; }
.steps span { color: var(--ink-2); font-size: 15px; }

.slip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; margin-top: 16px; }
.slip-form { display: grid; gap: 14px; }
.slip-form label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.slip-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.slip-form input, .slip-form select, .slip-form textarea {
  font: 16px var(--sans); color: var(--ink);
  padding: 9px 12px;
  background: #FBF9F4; border: 1px solid var(--paper-line); border-bottom: 2px solid var(--ink-2);
  border-radius: 0;
}
.slip-form textarea { resize: vertical; line-height: 1.5; }
.slip-form input:focus, .slip-form select:focus, .slip-form textarea:focus { outline: none; border-bottom-color: var(--ink-teal); background: #fff; }
.slip-out {
  position: relative;
  background: #FBF9F4; border: 1px solid var(--paper-line);
  padding: 16px 18px 20px;
  font-size: 15px;
}
.slip-out-head { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 2px solid var(--ink); font-weight: 600; }
.slip-out-head .mono { font-weight: 400; font-size: 12px; color: var(--red); }
.slip-out dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.slip-out dt { color: var(--ink-2); font-size: 13px; padding-top: 2px; }
.slip-out dd { margin: 0; padding-right: 64px; }
.slip-out [data-f="grade"] { font-family: var(--mono); font-weight: 500; color: var(--ink-teal); }
.slip-out.blank dd { color: #9A9486; }
.copyline {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 16px; padding: 14px 16px;
  background: var(--ink); color: var(--paper);
}
.copyline p { margin: 0; flex: 1 1 280px; font-family: var(--mono); font-size: 15px; word-break: break-all; }
.copyline button, .filters button {
  font: 14px var(--sans); cursor: pointer;
  padding: 6px 14px; border-radius: 0;
}
.copyline button { background: var(--teal); color: #06201D; border: 0; font-weight: 600; }
.copyline button:hover { background: #5AD6C9; }

/* ── 02 용어 ─────────────────────────────── */
.glossary { display: grid; grid-template-columns: 7em 1fr; margin: 0 0 28px; border-top: 2px solid var(--ink); }
.glossary dt, .glossary dd { padding: 12px 0; border-bottom: 1px solid var(--paper-line); }
.glossary dt { font-weight: 600; color: var(--ink-teal); }
.glossary dd { margin: 0; font-size: 15px; }
.two-up { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 16px; }

/* ── 03 레이 ─────────────────────────────── */
.rules {
  margin: 20px 0; padding: 16px 20px 16px 38px;
  background: var(--paper-2); border-left: 3px solid var(--red);
}
.rules li { margin-bottom: 4px; }
.rules li:last-child { margin-bottom: 0; }
.g { font-family: var(--mono); font-weight: 500; }
.g.d { color: var(--gd); } .g.c { color: var(--gc); } .g.b { color: var(--gb); } .g.a { color: var(--ga); } .g.n { color: var(--ink-2); }
.ray-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; clear: both; }
.ray-card { background: #FBF9F4; border: 1px solid var(--paper-line); overflow: hidden; }
.ray-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #222; }
.ray-card > div { padding: 12px 14px 14px; }
.ray-card h3 { font-size: 17px; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ray-card .g { border: 1px solid currentColor; padding: 0 6px; font-size: 12px; line-height: 1.6; }
.ray-card dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; font-size: 13.5px; line-height: 1.55; }
.ray-card dt { color: var(--ink-2); }
.ray-card dd { margin: 0; }

/* ── 04 구역 ─────────────────────────────── */
.districts { display: grid; gap: 18px; }
.districts article { background: #FBF9F4; border: 1px solid var(--paper-line); overflow: hidden; }
.districts article > img { width: 100%; aspect-ratio: 1200 / 320; object-fit: cover; }
.districts .info { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 4px 24px; align-items: start; }
.districts .info h3 { grid-column: 1 / -1; }
.districts .info { padding: 14px 18px 16px; }
.districts h3 { font-size: 18px; margin-bottom: 4px; }
.districts h3 small { color: var(--ink-2); font-weight: 400; font-size: 13px; margin-left: 4px; }
.districts p { font-size: 14.5px; margin-bottom: 8px; }
.districts dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; font-size: 13.5px; }
.districts dt { color: var(--ink-teal); font-weight: 600; }
.districts dd { margin: 0; color: var(--ink-2); }
.facs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; padding: 12px 14px 14px; border-top: 1px solid var(--paper-line); background: var(--paper-2); }
.facs figure { margin: 0; }
.facs img { width: 100%; aspect-ratio: 1200 / 320; object-fit: cover; }
.facs figcaption { font-size: 13px; font-weight: 600; padding-top: 5px; line-height: 1.45; }
.facs figcaption small { display: block; font-weight: 400; color: var(--ink-2); font-size: 12px; }

.fold { margin-top: 20px; background: var(--paper-2); border: 1px solid var(--paper-line); padding: 0 18px; }
.fold summary, .terms-box summary, .bounties summary { cursor: pointer; }
.fold summary { padding: 12px 0; font-weight: 600; }
.fold[open] { padding-bottom: 16px; }
.fold .shot { margin-bottom: 12px; }
.fold p { margin: 0; font-size: 15px; }

/* ── 05 명부 ─────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 24px; }
.filters button { background: transparent; color: var(--ink-2); border: 1px solid var(--paper-line); }
.filters button:hover { border-color: var(--ink-2); color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.org { border-top: 3px solid var(--g); padding-top: 14px; margin-bottom: 36px; }
.org:last-child { margin-bottom: 0; }
.org h2 {
  margin: 0 0 8px; padding: 0; border: 0;
  display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap;
}
.org h2 span { font-family: var(--sans); font-weight: 400; font-size: 13px; color: var(--ink-2); }
.org h2::before { content: ""; width: 10px; height: 10px; background: var(--g); align-self: center; border: 1px solid rgba(0, 0, 0, .25); }
.terms-box { margin-bottom: 14px; font-size: 15px; }
.terms-box summary { font-size: 14px; color: var(--ink-2); padding: 2px 0; }
.terms-box p { background: var(--paper-2); border-left: 3px solid var(--g); padding: 10px 14px; margin: 6px 0 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cards figure, .board-card { margin: 0; }
.cards img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; background: #222; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.cards figcaption { color: var(--ink-2); font-size: 13.5px; padding-top: 8px; line-height: 1.6; }

/* ── 06 바운티 ─────────────────────────────── */
.bounties { list-style: none; margin: 0 0 16px; padding: 0; border-top: 2px solid var(--ink); clear: both; }
.bounties > li { border-bottom: 1px solid var(--paper-line); }
.bounties summary {
  list-style: none;
  display: grid; grid-template-columns: 5.5em 1fr 2.2em 7.5em 5em; gap: 12px; align-items: baseline;
  padding: 12px 6px; font-size: 15px;
}
.bounties summary::-webkit-details-marker { display: none; }
.bounties summary:hover { background: var(--paper-2); }
.bounties details[open] summary { background: var(--paper-2); }
.bid { font-size: 12px; color: var(--ink-2); font-family: var(--sans); font-variant-numeric: tabular-nums; }
.btitle { font-weight: 500; }
.btitle small { color: var(--ink-2); font-weight: 400; margin-left: 4px; }
.bounties .g { text-align: center; border: 1px solid currentColor; font-size: 12px; line-height: 1.6; }
.bmoney { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; white-space: nowrap; }
.bmoney small { display: block; font-family: var(--sans); font-size: 11px; color: var(--ink-2); font-weight: 400; }
.bstate { font-size: 12px; text-align: center; padding: 1px 0; border: 1px solid var(--paper-line); color: var(--ink-2); }
.bstate.on { color: var(--ink-teal); border-color: var(--ink-teal); font-weight: 600; }
.bstate.off { color: #9A9486; text-decoration: line-through; }
.bounties details > dl {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 16px;
  margin: 0; padding: 10px 16px 16px calc(5.5em + 18px);
  font-size: 14.5px; background: var(--paper-2);
}
.bounties dt { color: var(--ink-2); }
.bounties dd { margin: 0; }
.bounties .labor { background: repeating-linear-gradient(135deg, transparent 0 12px, rgba(0, 0, 0, .025) 12px 24px); }

 (단말 밖) ─────────────────────────────── */
.out-doc .paper { background: var(--term-2); color: var(--term-text); box-shadow: 0 0 0 1px var(--term-line); }
.out-doc .paper::before { background: repeating-linear-gradient(135deg, var(--warn) 0 10px, transparent 10px 20px); }
.outmark { font-size: 13px; color: var(--warn); margin-bottom: 10px; }
.play-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 24px; }
.you { background: var(--term); border: 1px solid var(--term-line); border-top: 2px solid var(--warn); padding: 20px 22px; }
.out-doc .you h2 { margin: 0 0 10px; padding: 0; border: 0; font-size: 20px; }
.you h3 { font-size: 15px; color: var(--warn); margin: 18px 0 6px; }
.you ul { margin: 0 0 12px; padding-left: 20px; }
.you small, .out-doc .fine { color: var(--term-muted); }
.starts { display: grid; gap: 14px; align-content: start; }
.starts article { display: grid; grid-template-columns: 170px 1fr; background: var(--term); border: 1px solid var(--term-line); }
.starts img { width: 100%; height: 100%; object-fit: cover; }
.starts article > div { padding: 14px 16px; }
.starts .mono { color: var(--warn); font-size: 12px; }
.starts h3 { font-family: var(--serif); font-size: 20px; margin: 2px 0 6px; }
.starts p { margin: 0; font-size: 14.5px; color: #C6D0D4; }
.rating { color: var(--term-muted); font-size: 14px; margin: 20px 0 0; }

/* ── 단말 바닥 ─────────────────────────────── */
.term-foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px;
  padding: 14px 20px; border-top: 1px solid var(--term-line);
  font-size: 12px; color: #5E6C74;
}

/* ── 반응형 ─────────────────────────────── */
@media (max-width: 1000px) {
  .ray-grid { grid-template-columns: repeat(2, 1fr); }
  .play-grid { grid-template-columns: 1fr; }
  .two-up { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  :root { --rail: 0; }
  .term { border: 0; }
  .term-bar { position: static; padding: 10px 16px; }
  .bar-sep, .bar-item.right { display: none; }
  .term-body { grid-template-columns: minmax(0, 1fr); }
  .rail, .pane { min-width: 0; }
  .rail {
    position: sticky; top: 0; z-index: 9;
    max-height: none; overflow-x: auto; overflow-y: hidden;
    display: flex; align-items: center;
    padding: 0 16px;
    background: rgba(17, 23, 27, .96); backdrop-filter: blur(8px);
    border-right: 0; border-bottom: 1px solid var(--term-line);
    scrollbar-width: none;
  }
  .rail::-webkit-scrollbar { display: none; }
  .rail-title { display: none; }
  .rail ol { display: flex; flex: none; }
  .rail ol.out { margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--term-line); }
  .rail a { margin: 0; padding: 12px 10px; white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .rail a[aria-current="page"] { border-bottom-color: var(--teal); background: transparent; }
  .rail ol.out a[aria-current="page"] { border-bottom-color: var(--warn); }
  .pane { padding: 20px 12px 40px; }
  .slip-grid { grid-template-columns: 1fr; }
  .districts .info { grid-template-columns: 1fr; }
  .facs { grid-template-columns: 1fr; }
  .stamp { top: 64px; width: 68px; height: 68px; font-size: 11px; }
  .stamp b { font-size: 16px; }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  .ray-grid, .two-up { grid-template-columns: 1fr; }
  .glossary { grid-template-columns: 1fr; }
  .glossary dt { border-bottom: 0; padding-bottom: 0; }
  .glossary dd { padding-top: 2px; }
  .slip span { flex-basis: 50%; border-bottom: 1px solid var(--paper-line); }
  .bounties summary { grid-template-columns: 2.2em 1fr auto; grid-template-areas: "g t t" "g m s"; row-gap: 2px; }
  .bounties .bid { display: none; }
  .bounties .g { grid-area: g; align-self: start; }
  .btitle { grid-area: t; }
  .bmoney { grid-area: m; text-align: left; }
  .bmoney small { display: inline; margin-left: 4px; }
  .bstate { grid-area: s; padding: 1px 8px; }
  .bounties details > dl { padding-left: 16px; }
  .starts article { grid-template-columns: 1fr; }
  .starts img { aspect-ratio: 1200 / 320; }
  .stamp { display: none; }
}
