:root {
  --bg: #f6f7f9; --panel: #fff; --text: #1d2330; --muted: #667085; --line: #e3e6eb;
  --brand: #2f5bea; --brand-weak: #e8eefe; --ok: #127a43; --ok-weak: #e3f5ea;
  --warn: #9a5b00; --warn-weak: #fff3dc; --bad: #b42318; --bad-weak: #fde8e6;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --panel: #1b1f27; --text: #e7e9ee; --muted: #9aa3b2; --line: #2c323d;
    --brand: #7b9bff; --brand-weak: #1f2a4a; --ok: #5fd08e; --ok-weak: #15301f;
    --warn: #f0b85a; --warn-weak: #33270f; --bad: #ff8a80; --bad-weak: #3a1a17;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.55 "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, textarea.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--bg); padding: 10px; border-radius: 8px;
  border: 1px solid var(--line); margin: 6px 0; max-height: 360px; overflow: auto; }

header.top { display: flex; align-items: center; gap: 20px; padding: 0 24px; height: 52px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
header.top .brand { font-weight: 700; color: var(--text); }
header.top nav { display: flex; gap: 4px; flex: 1; }
header.top nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); }
header.top nav a.on { background: var(--brand-weak); color: var(--brand); font-weight: 600; }
header.top .me { display: flex; align-items: center; gap: 8px; color: var(--muted); }
header.top .me a { color: var(--text); }
main { max-width: 1240px; margin: 0 auto; padding: 20px 24px 60px; }

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.grid2 > * { min-width: 0; }
.stack > * + * { margin-top: 12px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.panel + .panel { margin-top: 16px; }
.grid2 > .panel + .panel, .grid2 > * + .panel { margin-top: 0; }
.grid2 + .panel, .panel + .grid2, .grid2 + .grid2 { margin-top: 16px; }
.panel.tight { padding: 12px 14px; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--brand); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.ok { border-color: var(--ok); color: var(--ok); }
.btn.bad { border-color: var(--bad); color: var(--bad); }
.btn.sm { padding: 3px 9px; font-size: 12.5px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
form.inline { display: inline; margin: 0; }

input[type=text], input[type=number], input[type=date], input[type=password], select, textarea {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 9px; }
textarea { width: 100%; min-height: 70px; }
textarea.code { min-height: 260px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
label.f > * { color: var(--text); font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 10px; align-items: end; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-weak); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-weak); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-weak); color: var(--bad); border-color: transparent; }
.badge.brand { background: var(--brand-weak); color: var(--brand); border-color: transparent; }

.flash { border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; border: 1px solid transparent; }
.flash.ok { background: var(--ok-weak); color: var(--ok); }
.flash.error { background: var(--bad-weak); color: var(--bad); }
.flash.warn { background: var(--warn-weak); color: var(--warn); }
.flash.warn a { color: inherit; text-decoration: underline; }
.flash ul { margin: 6px 0 0; padding-left: 18px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.meter { height: 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; min-width: 120px; }
.meter > i { display: block; height: 100%; background: var(--brand); }
.meter.hot > i { background: var(--bad); }

.steps { display: flex; gap: 0; margin: 14px 0 4px; }
.steps .s { flex: 1; text-align: center; font-size: 12.5px; color: var(--muted); position: relative; padding-top: 18px; }
.steps .s::before { content: ""; position: absolute; top: 6px; left: 0; right: 0; height: 3px; background: var(--line); }
.steps .s::after { content: ""; position: absolute; top: 1px; left: 50%; width: 13px; height: 13px; margin-left: -6px;
  border-radius: 50%; background: var(--panel); border: 3px solid var(--line); }
.steps .s.done::before, .steps .s.done::after { background: var(--brand); border-color: var(--brand); }
.steps .s.now { color: var(--brand); font-weight: 700; }
.steps .s.now::before { background: linear-gradient(90deg, var(--brand) 50%, var(--line) 50%); }
.steps .s.now::after { border-color: var(--brand); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tabs a .badge { margin-left: 4px; }

.next { border-left: 4px solid var(--brand); }
.blockers { margin: 8px 0 0; padding-left: 18px; color: var(--bad); }

.shot { scroll-margin-top: 70px; }
.shot-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.shot-head .id { font-weight: 700; font-size: 15px; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb { width: 200px; }
.thumb img, .thumb video { width: 200px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); background: #000; display: block; }
.thumb.sel img, .thumb.sel video { outline: 3px solid var(--ok); }
.ph { width: 200px; aspect-ratio: 16/9; border-radius: 8px; border: 1px dashed var(--line); display: flex;
  align-items: center; justify-content: center; color: var(--muted); font-size: 12.5px; text-align: center; padding: 8px; }
.takes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 12px; }
.take { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.take.sel { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok-weak); }
.take video, .take .ph { width: 100%; }
.take video { aspect-ratio: 16/9; border-radius: 8px; background: #000; display: block; }

.comment { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.comment.done { opacity: .62; }
.comment + .comment { margin-top: 10px; }
.quote { border-left: 3px solid var(--line); padding: 2px 10px; color: var(--muted); margin: 6px 0; }
.suggest { border-left: 3px solid var(--ok); padding: 2px 10px; margin: 6px 0; }
details > summary { cursor: pointer; color: var(--brand); margin: 6px 0; }
.issues { margin: 6px 0; padding-left: 18px; color: var(--bad); }
.warns { margin: 6px 0; padding-left: 18px; color: var(--warn); }
.empty { text-align: center; padding: 36px 10px; color: var(--muted); }
.login { max-width: 380px; margin: 10vh auto; }

@media (max-width: 720px) {
  header.top { padding: 8px 12px 0; gap: 4px 10px; height: auto; flex-wrap: wrap; }
  header.top .brand { white-space: nowrap; }
  header.top .me { margin-left: auto; }
  header.top nav { order: 3; flex: 1 0 100%; overflow-x: auto; padding-bottom: 6px; }
  header.top nav a { white-space: nowrap; }
  .row.between > * { min-width: 0; }
  .next .btn { white-space: normal; text-align: left; }
  .wide-scroll, table { display: block; overflow-x: auto; }
  .shot .grid2 { grid-template-columns: 1fr; }
  .takes { grid-template-columns: 1fr; }
  .ref { flex: 1 1 100%; }
  main { padding: 14px 12px 40px; }
  .steps .s { font-size: 0; }
  .thumb, .thumb img, .thumb video, .ph { width: 100%; }
}

.refs { display: flex; gap: 10px; flex-wrap: wrap; }
.ref { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.ref img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.refno { font-weight: 700; color: var(--brand); font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.copybox { position: relative; }
.copybox .copy { position: absolute; top: 6px; right: 6px; }
.copybox pre { padding-right: 70px; }
@media print {
  header.top, .noprint, .flash { display: none !important; }
  body { background: #fff; color: #000; }
  .panel { border: 1px solid #999; break-inside: avoid; }
  .copybox .copy { display: none; }
  pre { max-height: none; }
}
.scroll-x { overflow-x: auto; }
