/* 꽥꽥이 필드랩 허브 — 계측기 느낌의 담백한 화면 */
:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #f9fafb;
  --ink: #15181e;
  --ink-2: #4a515e;
  --ink-3: #6f7685;
  --line: #dde1e8;
  --line-2: #c9ced8;
  --accent: #2457d6;
  --accent-ink: #ffffff;
  --accent-soft: #e6edfc;
  --ok: #18794e;
  --ok-soft: #e3f4ea;
  --warn: #9a5b00;
  --warn-soft: #fbf0dc;
  --bad: #c0362c;
  --bad-soft: #fbe6e4;
  --mute-soft: #eceef2;
  --g1: #d9480f; --g2: #2457d6; --g3: #7c3aed; --g4: #0f8a6a;
  --mat: #3a7d44;
  --radius: 6px;
  --shadow: 0 1px 0 rgba(20, 24, 32, .04), 0 1px 3px rgba(20, 24, 32, .06);
  --sans: 'IBM Plex Sans KR', system-ui, -apple-system, 'Malgun Gothic', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Consolas', monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --panel: #171b21;
    --panel-2: #1c2128;
    --ink: #e7eaf0;
    --ink-2: #b2b9c6;
    --ink-3: #8a92a1;
    --line: #2a3039;
    --line-2: #39414d;
    --accent: #6b93f5;
    --accent-ink: #0b1020;
    --accent-soft: #1b2744;
    --ok: #4cc38a; --ok-soft: #16301f;
    --warn: #f0b04a; --warn-soft: #33270f;
    --bad: #ff7b6e; --bad-soft: #3a1a17;
    --mute-soft: #232831;
    --g1: #ff8a4c; --g2: #6b93f5; --g3: #a98bff; --g4: #3fcf9f;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.6 var(--sans); word-break: keep-all; overflow-wrap: anywhere;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--mute-soft); padding: 1px 5px; border-radius: 4px; }
pre { font-family: var(--mono); font-size: 13px; line-height: 1.55; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; overflow-x: auto; white-space: pre; }
pre code { background: none; padding: 0; }

/* ── 머리 ── */
.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 18px; min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.brand-mark { width: 26px; height: 18px; border: 2px solid var(--accent); border-radius: 3px; position: relative; flex: none; }
.brand-mark::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2px solid var(--accent); }
.brand-mark::after { content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; border: 2px solid var(--accent); border-radius: 50%; transform: translate(-50%, -50%); background: var(--panel); }
.brand small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-3); line-height: 1.2; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 7px 11px; border-radius: 5px; font-size: 14px; }
.nav a:hover { background: var(--mute-soft); color: var(--ink); }
.nav a[aria-current='page'] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
@media (max-width: 720px) {
  .top { position: static; }
  .top-in { padding: 8px 16px; gap: 8px; }
  .nav { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .nav a { white-space: nowrap; }
}

main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 20px; }
h1 { font-size: 26px; line-height: 1.3; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 19px; margin: 0 0 12px; letter-spacing: -.01em; }
h3 { font-size: 16px; margin: 18px 0 8px; }
.lead { color: var(--ink-2); margin: 6px 0 0; max-width: 70ch; }
.eyebrow { font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }

/* ── 패널 ── */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-h h2 { margin: 0; font-size: 15px; }
.panel-b { padding: 16px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .cols-2 { grid-template-columns: 1fr; } .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .cols-4 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 16px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ── 상태 표시 ── */
.live { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--mono); color: var(--ink-3); }
.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.live[data-on='1']::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.live[data-on='err']::before { background: var(--bad); }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 1; padding: 4px 7px; border-radius: 4px; background: var(--mute-soft); color: var(--ink-2); white-space: nowrap; font-weight: 500; }
.chip.g1 { color: var(--g1); } .chip.g2 { color: var(--g2); } .chip.g3 { color: var(--g3); } .chip.g4 { color: var(--g4); }
.chip.gtag { background: transparent; border: 1px solid currentColor; font-family: var(--mono); }
.st { font-weight: 600; }
.st[data-s='접수'] { background: var(--mute-soft); color: var(--ink-2); }
.st[data-s='검토 중'] { background: var(--warn-soft); color: var(--warn); }
.st[data-s='진행 중'] { background: var(--accent-soft); color: var(--accent); }
.st[data-s='반영됨'] { background: var(--ok-soft); color: var(--ok); }
.st[data-s='보류'] { background: var(--bad-soft); color: var(--bad); }

/* ── 진행 단계 ── */
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin-top: 10px; }
.stages span { height: 6px; background: var(--mute-soft); border-radius: 2px; }
.stages span.on { background: var(--accent); }
.stage-labels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; font: 11px var(--mono); color: var(--ink-3); margin-top: 4px; }
.stage-labels .on { color: var(--accent); font-weight: 600; }

.gcard { padding: 14px 16px; border-top: 3px solid var(--line-2); }
.gcard[data-g='1'] { border-top-color: var(--g1); } .gcard[data-g='2'] { border-top-color: var(--g2); }
.gcard[data-g='3'] { border-top-color: var(--g3); } .gcard[data-g='4'] { border-top-color: var(--g4); }
.gcard .gname { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.gcard .doing { margin: 6px 0 0; min-height: 3em; color: var(--ink-2); }
.gcard .meta { font-size: 12px; color: var(--ink-3); margin-top: 6px; }

/* ── 피드 ── */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 58px 46px 1fr; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line); align-items: baseline; }
.feed li:last-child { border-bottom: 0; }
.feed li.new { animation: flash 2.4s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .feed li.new { animation: none; } }
.feed time { font: 12px var(--mono); color: var(--ink-3); }
.feed .k { font-size: 12px; color: var(--ink-3); }
.feed .t { min-width: 0; }
.feed .who { color: var(--ink-3); font-size: 13px; }
.feed .src-sim .k { color: var(--g4); }
.feed .src-teacher .k { color: var(--accent); font-weight: 600; }
.feed .data { font: 12px var(--mono); color: var(--ink-3); display: block; margin-top: 2px; }
.feed-scroll { max-height: 620px; overflow-y: auto; }
.empty { padding: 28px 16px; text-align: center; color: var(--ink-3); }

/* ── 폼 ── */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
input[type=text], input[type=password], input:not([type]), textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line-2); border-radius: 5px; padding: 8px 10px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.field { margin-bottom: 12px; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .fields-2 { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -5000px; }
button, .btn {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 5px; padding: 8px 14px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px;
}
button:hover, .btn:hover { border-color: var(--ink-3); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--bad); }
button.ghost { border-color: transparent; background: transparent; }
button[disabled] { opacity: .55; cursor: not-allowed; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 5px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; border-radius: 0; min-height: 32px; padding: 5px 11px; font-weight: 500; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.msg { font-size: 13px; margin-top: 8px; min-height: 1.4em; }
.msg.err { color: var(--bad); } .msg.ok { color: var(--ok); }

/* ── 게시판 ── */
.reqs { list-style: none; margin: 0; padding: 0; }
.req { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); align-items: start; }
.req:last-child { border-bottom: 0; }
.req .no { font: 600 13px var(--mono); color: var(--ink-3); padding-top: 2px; }
.req a.title { color: var(--ink); font-weight: 600; text-decoration: none; }
.req a.title:hover { color: var(--accent); text-decoration: underline; }
.req .sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.req .counts { font: 12px var(--mono); color: var(--ink-3); text-align: right; white-space: nowrap; }
.req.hidden { opacity: .55; }
@media (max-width: 560px) { .req { grid-template-columns: 40px 1fr; } .req .counts { grid-column: 2; text-align: left; } }
.body-text { white-space: pre-wrap; margin: 0; }
.reply { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 0 var(--radius) var(--radius) 0; }
.reply .who { font-weight: 700; color: var(--accent); font-size: 13px; margin-bottom: 4px; }
.comments { list-style: none; padding: 0; margin: 0; }
.comments li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.comments li.teacher .cname { color: var(--accent); }
.comments .cname { font-weight: 600; font-size: 13px; }
.comments time { font: 12px var(--mono); color: var(--ink-3); margin-left: 6px; }
.status-flow { display: flex; gap: 0; flex-wrap: wrap; font-size: 12px; }
.status-flow span { padding: 4px 10px; border: 1px solid var(--line-2); margin-left: -1px; color: var(--ink-3); }
.status-flow span:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.status-flow span:last-child { border-radius: 0 4px 4px 0; }
.status-flow span.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.status-flow span.hold { border-style: dashed; }

/* ── 안내 문서 ── */
.doc { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; }
.toc { position: sticky; top: 76px; font-size: 14px; }
.toc a { display: block; color: var(--ink-2); text-decoration: none; padding: 5px 10px; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--accent); border-left-color: var(--accent); }
@media (max-width: 860px) { .doc { grid-template-columns: 1fr; } .toc { position: static; display: flex; flex-wrap: wrap; gap: 4px; } .toc a { border: 1px solid var(--line); border-radius: 4px; } }
.doc section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; scroll-margin-top: 76px; }
.doc section > h2 { display: flex; gap: 10px; align-items: baseline; }
.doc section > h2 .n { font: 600 13px var(--mono); color: var(--accent); }
.doc p, .doc li { max-width: 78ch; }
.table-wrap { overflow-x: auto; margin: 10px 0; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--panel-2); white-space: nowrap; }
td.num { font-family: var(--mono); white-space: nowrap; }
.note { border: 1px solid var(--line); border-left: 3px solid var(--warn); background: var(--warn-soft); padding: 10px 14px; border-radius: 0 var(--radius) var(--radius) 0; font-size: 14px; }
.kbd, kbd { font: 600 12px var(--mono); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; background: var(--panel); }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 34px; margin: 10px 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 600 12px/22px var(--mono); text-align: center; }
.check { list-style: none; padding: 0; margin: 0; }
.check li { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.field-svg { width: 100%; height: auto; max-width: 760px; display: block; margin: 8px 0; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.legend i { display: inline-block; width: 10px; height: 10px; vertical-align: -1px; margin-right: 4px; border-radius: 2px; }

.foot { max-width: 1180px; margin: 0 auto; padding: 20px 16px 40px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 6px; font-size: 14px; z-index: 20; max-width: calc(100% - 32px); }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; margin: 0; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; }
details > summary { cursor: pointer; font-weight: 600; }
