:root {
  --bg: #f5f3ed; --paper: #fffef9; --ink: #304039; --ink-soft: #4a5a52; --muted: #778079; --line: #e2e3d9; --line-strong: #c9cbbd;
  --green: #31594e; --green-soft: #e4ece6; --red: #ba6351; --red-soft: #f6e4de; --amber: #a8781f; --amber-soft: #f6ecd6; --blue: #3c6f8f; --blue-soft: #e2edf3;
  --sans: Pretendard, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1b211e; --paper: #222a26; --ink: #e6e9e3; --ink-soft: #c8cec7; --muted: #9aa49c; --line: #36403b; --line-strong: #4a5650;
    --green: #8fc0ad; --green-soft: #26362f; --red: #e39a88; --red-soft: #3d2a25; --amber: #e0b765; --amber-soft: #3a3121; --blue: #93bdd8; --blue-soft: #22313b; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.6 var(--sans); }
a { color: var(--green); }
.bar { display: flex; align-items: center; gap: 18px; padding: 10px 24px; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.bar .brand { font-weight: 800; text-decoration: none; color: var(--ink); }
.bar nav a { text-decoration: none; color: var(--ink-soft); }
.sp { flex: 1; }
main { padding: 24px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 22px 0 10px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 10px; }
input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=number], select, textarea { background: var(--bg); border: 1px solid var(--line-strong); border-radius: 6px; padding: 5px 8px; min-width: 0; }
button { background: var(--green); color: var(--paper); border: 0; border-radius: 7px; padding: 6px 12px; font-weight: 600; cursor: pointer; }
button.ghost { background: transparent; color: var(--green); border: 1px solid var(--green); }
button.danger { background: transparent; color: var(--red); border: 1px solid var(--red-soft); }
button:disabled { opacity: .5; cursor: default; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--line); color: var(--ink-soft); white-space: nowrap; }
.tag.ok { background: var(--green-soft); color: var(--green); } .tag.warn { background: var(--amber-soft); color: var(--amber); }
.tag.bad { background: var(--red-soft); color: var(--red); } .tag.info { background: var(--blue-soft); color: var(--blue); }
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; } .progress i { display: block; height: 100%; background: var(--green); }
.review { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.lessons { position: sticky; top: 64px; max-height: calc(100vh - 84px); overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.lessons a { display: flex; justify-content: space-between; gap: 6px; padding: 6px 8px; border-radius: 7px; text-decoration: none; color: var(--ink-soft); font-size: 13px; }
.lessons a.on { background: var(--green-soft); color: var(--green); font-weight: 600; }
.lessons a span:last-child { white-space: nowrap; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.thumbs a img { height: 180px; border: 1px solid var(--line); border-radius: 4px; background: #fff; display: block; }
.thumbs figure { margin: 0; text-align: center; font-size: 11.5px; color: var(--muted); }
.items td input[type=text], .items td textarea { width: 100%; }
.items td textarea { resize: vertical; line-height: 1.45; display: block; }
.items tr.approved td:first-child { box-shadow: inset 3px 0 var(--green); }
.items tr.rejected { opacity: .45; }
.items tr.rejected td:first-child { box-shadow: inset 3px 0 var(--red); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; }
.seg button { background: transparent; color: var(--ink-soft); border-radius: 0; padding: 3px 8px; font-weight: 500; font-size: 12px; }
.seg button.on { background: var(--green); color: var(--paper); }
.seg button.on.rej { background: var(--red); }
.score td, .score th { text-align: right; } .score td:first-child, .score th:first-child { text-align: left; }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; }
#toast.on { opacity: .95; }
pre.log { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; max-height: 160px; overflow: auto; font-size: 12px; margin: 8px 0 0; }
@media (max-width: 860px) { .review { grid-template-columns: minmax(0, 1fr); } .lessons { position: static; max-height: 220px; } main { padding: 16px; } }
