/* 학교체육 챌린지 LAB — 기본 스타일 (디자인 다듬기는 코덱스 담당) */
:root {
  --bg: #f6f7f2; --surface: #ffffff; --ink: #1d2a24; --muted: #5d6b64; --line: #dfe4dc;
  --brand: #1f6f5c; --brand-ink: #ffffff; --brand-soft: #e3f1ec; --accent: #ffd166;
  --basic: #2f9e6e; --mid: #e08a1e; --adv: #c2410c; --danger: #b42318; --warn-bg: #fff4e0;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.05);
  --a-fit: #2f9e6e; --a-tech: #2563eb; --a-inv: #dc2626; --a-net: #7c3aed; --a-eco: #0f766e; --a-exp: #db2777;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #121815; --surface: #1b2420; --ink: #e8efe9; --muted: #9fb0a7; --line: #2c3833;
  --brand: #43b493; --brand-ink: #08130f; --brand-soft: #1f3a31; --warn-bg: #3a2c12;
} }
:root[data-theme="dark"] { --bg: #121815; --surface: #1b2420; --ink: #e8efe9; --muted: #9fb0a7; --line: #2c3833; --brand: #43b493; --brand-ink: #08130f; --brand-soft: #1f3a31; --warn-bg: #3a2c12; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--brand); }
h1 { font-size: 1.5rem; line-height: 1.3; margin: .4em 0 .3em; }
h2 { font-size: 1.15rem; margin: 1.2em 0 .5em; }
h2 small, h1 small { font-weight: 400; color: var(--muted); font-size: .8em; }
.muted { color: var(--muted); }
.center { text-align: center; }
.note { font-size: .88rem; color: var(--muted); background: var(--brand-soft); padding: .5em .8em; border-radius: 10px; }
.warn { background: var(--warn-bg); padding: .6em .9em; border-radius: 10px; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; background: var(--brand); color: var(--brand-ink); }
.brand { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { font-size: 1.6rem; }
.brand b { display: block; font-size: 1.05rem; }
.brand small { display: block; font-size: .75rem; opacity: .85; }
.me-btn { background: rgba(255,255,255,.16); color: inherit; border: 0; border-radius: 10px; padding: 6px 10px; text-align: right; cursor: pointer; font: inherit; }
.me-btn b { display: block; font-size: .9rem; } .me-btn small { display: block; font-size: .72rem; opacity: .85; }
.tabs { display: flex; background: var(--surface); border-bottom: 1px solid var(--line); }
.tabs a { flex: 1; text-align: center; padding: 10px 4px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; border-bottom: 3px solid transparent; }
.tabs a.on { color: var(--brand); border-color: var(--brand); }
main { max-width: 960px; margin: 0 auto; padding: 12px 16px 80px; outline: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.big { min-height: 54px; font-size: 1.05rem; padding: 10px 24px; }
.btn.sm { min-height: 34px; padding: 4px 10px; font-size: .85rem; }
.btn.danger { color: var(--danger); border-color: currentColor; }
.btn:disabled { opacity: .6; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }

.crumbs { font-size: .85rem; color: var(--muted); margin: 4px 0 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs i { font-style: normal; opacity: .6; }
.badge { display: inline-block; min-width: 1.6em; padding: 0 .5em; border-radius: 99px; background: var(--accent); color: #3b2a00; font-size: .78rem; font-weight: 700; text-align: center; }

.hero { background: linear-gradient(135deg, var(--brand), #2a8c74); color: #fff; border-radius: var(--radius); padding: 26px 20px; margin: 8px 0 16px; }
.hero h1 { font-size: 1.9rem; }
.hero .btn.primary { background: var(--accent); color: #3b2a00; border-color: var(--accent); margin-top: 8px; }
.eyebrow { font-size: .8rem; letter-spacing: .04em; font-weight: 700; opacity: .85; margin: 0; }

.search { position: relative; margin: 8px 0 16px; }
.search input { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.qres { display: grid; gap: 4px; margin-top: 6px; }
.qres a { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.qres small { color: var(--muted); }

.steps ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 10px; align-items: baseline; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.steps li span { color: var(--muted); font-size: .88rem; margin-left: auto; text-align: right; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.tile { display: grid; gap: 2px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.tile span { color: var(--muted); font-size: .85rem; }

.areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.area { --c: var(--brand); display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.area .ico { grid-row: 1 / 4; font-size: 2rem; }
.area small { color: var(--muted); } .area em { font-style: normal; font-size: .8rem; color: var(--c); font-weight: 700; }
.area-fit { --c: var(--a-fit); } .area-tech { --c: var(--a-tech); } .area-inv { --c: var(--a-inv); } .area-net { --c: var(--a-net); } .area-eco { --c: var(--a-eco); } .area-exp { --c: var(--a-exp); }
h2.sub { font-size: 1rem; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.sports { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sport { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 56px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.sport small { width: 100%; color: var(--adv); font-size: .75rem; }

.stages { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.stages details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.stages summary { display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer; list-style: none; }
.stages summary::-webkit-details-marker { display: none; }
.stages .no { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; display: grid; place-items: center; }
.stages .nm { flex: 1; } .stages .nm b { display: block; } .stages .nm small { color: var(--muted); }
.stages details[open] .no { background: var(--brand); color: var(--brand-ink); }
.stage-body { padding: 0 12px 14px 56px; display: grid; gap: 8px; justify-items: start; }
.mini { display: block; font-size: .9rem; padding: 6px 0; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); vertical-align: middle; }
.tag.club { background: #fde68a; color: #6b4500; } .tag.ex { background: var(--line); color: var(--muted); }

.textbook { margin-top: 24px; }
.pub select, .filters select, select { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; padding: 6px 10px; }
.pdfs { display: flex; flex-wrap: wrap; gap: 6px; }
.tbu { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; padding: 8px 12px; }
.tbu summary { cursor: pointer; font-weight: 600; font-size: .92rem; }
.tbu ul { margin: 6px 0 0; padding-left: 1.2em; font-size: .9rem; }

/* 활동지 */
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.sheet-head .auto { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.sheet-head .auto span { background: var(--brand-soft); border-radius: 10px; padding: 6px 10px; font-weight: 700; }
.sheet-head .auto small { display: block; font-weight: 400; font-size: .72rem; color: var(--muted); }
.q { border: 0; border-top: 1px solid var(--line); margin: 14px 0 0; padding: 14px 0 0; display: grid; gap: 8px; }
.q legend, .q > summary { font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; padding: 0; }
.q legend span, .q > summary span { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: inline-grid; place-items: center; font-size: .85rem; }
.q > summary { cursor: pointer; list-style: none; }
.sheet input:not([type=checkbox]):not([type=radio]), .sheet textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; }
.sheet textarea { resize: vertical; }
.sheet label { display: grid; gap: 4px; font-weight: 600; font-size: .92rem; }
.sheet label.inline { display: flex; align-items: center; gap: 8px; }
.sheet label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.hint { font-size: .82rem; color: var(--muted); margin: 2px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { min-height: 38px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; }
.chip-btn.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.picked { display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; padding: 6px; border: 1px dashed var(--line); border-radius: 12px; }
.eqsearch { display: flex; gap: 6px; } .eqsearch .btn { flex: none; }
.eqall summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .9rem; }
.people { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lvl { border-left: 5px solid var(--c, var(--brand)); background: var(--bg); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.lvl h3 { margin: 0; font-size: 1rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lvl h3 small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.succ-row { display: grid; grid-template-columns: minmax(130px, 40%) 1fr; gap: 6px; }
.lv-basic { --c: var(--basic); } .lv-mid { --c: var(--mid); } .lv-adv { --c: var(--adv); }
.lv-tag { display: inline-block; padding: 1px 10px; border-radius: 99px; background: var(--c); color: #fff; font-weight: 800; font-size: .82rem; }
.stds { display: grid; gap: 6px; }
.std { display: flex !important; gap: 8px; align-items: flex-start; font-weight: 400 !important; font-size: .85rem !important; }

/* 카드·보드 */
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.card, .big { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.card h3 { margin: 4px 0 2px; font-size: 1.08rem; } .card h3 a { color: var(--ink); text-decoration: none; }
.meta { color: var(--muted); font-size: .85rem; margin: 0 0 8px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 8px; }
.facts div { background: var(--bg); border-radius: 10px; padding: 6px 10px; } .facts dt { font-size: .72rem; color: var(--muted); } .facts dd { margin: 0; font-weight: 600; font-size: .9rem; }
.lv { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lv li { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; }
.lv p { margin: 0; font-size: .92rem; } .lv .succ { color: var(--muted); font-size: .85rem; }
.big h1 { font-size: 1.7rem; } .big .lv p { font-size: 1.05rem; }
.stdline { font-size: .85rem; color: var(--muted); } .safety { font-size: .92rem; }
.paper { background: #fff; color: #111; padding: 20px; border-radius: var(--radius); }
.ptable { width: 100%; border-collapse: collapse; } .ptable th, .ptable td { border: 1px solid #bbb; padding: 10px; text-align: left; vertical-align: top; } .ptable th { width: 22%; background: #f1f4ef; }
.atable { width: 100%; border-collapse: collapse; font-size: .85rem; } .atable td, .atable th { border-bottom: 1px solid var(--line); padding: 6px; text-align: left; } .atable tr.hid { opacity: .5; }
.inline-form { display: flex; gap: 6px; } .inline-form input { flex: 1; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }

/* 발표 화면 */
body.presenting .tabs, body.presenting .top { display: none; }
body.presenting main { max-width: 1400px; }
.present-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; } .present-head h1 { font-size: 2.2rem; margin-right: auto; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ptile { display: grid; gap: 4px; padding: 18px; min-height: 130px; background: var(--surface); border-top: 8px solid var(--c, var(--brand)); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.ptile b { font-size: 1.3rem; line-height: 1.3; } .ptile small, .ptile span { color: var(--muted); }
.big.present { font-size: 1.2rem; } .big.present h1 { font-size: 2.6rem; } .big.present .lv p { font-size: 1.35rem; }

dialog { border: 0; border-radius: var(--radius); padding: 20px; width: min(92vw, 420px); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog label { display: grid; gap: 4px; font-weight: 600; }
dialog input { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--bg); color: var(--ink); }
dialog fieldset { border: 0; padding: 0; margin: 14px 0; } dialog legend { font-weight: 600; margin-bottom: 6px; }
dialog menu { padding: 0; margin: 0; display: flex; justify-content: flex-end; }
.chip { position: relative; } .chip input { position: absolute; opacity: 0; } .chip span { display: inline-block; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); cursor: pointer; }
.chip input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 40px); opacity: 0; background: #1d2a24; color: #fff; padding: 10px 18px; border-radius: 99px; transition: .25s; z-index: 50; max-width: calc(100vw - 32px); text-align: center; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .steps li { flex-wrap: wrap; } .steps li span { margin-left: 36px; text-align: left; width: 100%; }
  .succ-row { grid-template-columns: 1fr; }
  .stage-body { padding-left: 12px; }
  .hero h1 { font-size: 1.6rem; }
}
@media print {
  .top, .tabs, .noprint, .toast { display: none !important; }
  body { background: #fff; } main { padding: 0; } .paper { padding: 0; }
}
