/* Academy Report — shared styles for the parent page and the staff page. */
:root {
  --bg: #eaf0f9;
  --surface: #ffffff;
  --card: #f2f5fb;
  --fg: #14213d;
  --muted: #5b6a86;
  --line: #dce3ef;
  --accent: #2457d6;
  --accent-soft: #e2ebff;
  --hero-a: #10295a;
  --hero-b: #2563eb;
  --hero-fg: #ffffff;
  --good: #1f9d55;
  --warn: #e07b00;
  --bad: #e03e44;
  --bad-soft: #fde4e5;
  --bar: #f58f93;
  --bar-on: #e03e44;
  --star: #f5b301;
  --star-off: #d6ddec;
  --font-body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-num: "Manrope", "Noto Sans KR", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1322; --surface: #121c31; --card: #19253f; --fg: #e8eefc; --muted: #9aaac8;
    --line: #26344f; --accent: #7aa5ff; --accent-soft: #1b2d57; --good: #3fc27a;
    --warn: #f5a524; --bad: #ff7075; --bad-soft: #3d1d22; --bar: #a8484d; --bar-on: #ff7075;
    --star-off: #34425f; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 15px; line-height: 1.6;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: max(16px, env(safe-area-inset-top, 0px));
  padding-bottom: max(40px, env(safe-area-inset-bottom, 0px));
}
.wrap { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: 16px; } /* 16px stops iPhone Safari from zooming into fields */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.topbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.seg.lang button { padding: 7px 12px; font-family: var(--font-num); font-weight: 700; font-size: 13px; }
.who { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }

/* ---- report view ---- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; color: var(--hero-fg);
  background: linear-gradient(135deg, var(--hero-a) 0%, #1a4fb8 55%, var(--hero-b) 100%);
  padding: 30px 28px 28px; display: flex; flex-direction: column; gap: 22px;
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.07); pointer-events: none; }
.hero::before { width: 260px; height: 260px; right: -70px; top: -80px; }
.hero::after { width: 200px; height: 200px; left: -60px; bottom: -110px; }
.hero > * { position: relative; }
.brand { font-family: var(--font-num); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: 12px; opacity: .85; overflow-wrap: anywhere; }
.hero h1 { margin: 4px 0 6px; font-size: clamp(26px, 6vw, 36px); line-height: 1.2; font-weight: 900; text-wrap: balance; }
.period { font-size: 13px; opacity: .72; font-family: var(--font-num); display: flex; flex-wrap: wrap; gap: 4px 16px; }
.summary { background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.22); border-radius: 16px; padding: 16px 18px; }
.summary b { display: block; font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.summary span { font-size: 13.5px; opacity: .85; font-family: var(--font-num); font-variant-numeric: tabular-nums; }

.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 6px 28px; }
.sec { padding: 24px 0; display: flex; flex-direction: column; gap: 16px; }
.sec + .sec { border-top: 1px solid var(--line); }
.sec-h { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.sec-h h2 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.sec-h h2 small { font-family: var(--font-num); font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.chip { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.side-note { color: var(--muted); font-size: 13px; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px 24px; margin: 0; }
.kv div { min-width: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 2px 0 0; font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }

.att { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.counts { display: flex; gap: 30px; }
.count span { display: block; color: var(--muted); font-size: 13px; }
.count b { font-family: var(--font-num); font-size: 34px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.count b i { font-style: normal; font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.gauge { position: relative; width: 84px; height: 84px; flex: none; }
.gauge svg { width: 100%; height: 100%; }
.gauge div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.15; }
.gauge strong { font-family: var(--font-num); font-size: 17px; font-variant-numeric: tabular-nums; }
.gauge em { font-style: normal; font-size: 10.5px; color: var(--muted); }

.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.plist li { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.plist .ok { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.plist .ok.off { background: var(--card); color: var(--muted); }
.plist .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.plist .t small { color: var(--muted); margin-left: 6px; font-size: 12.5px; }
.pill { border-radius: 999px; padding: 3px 12px; font-size: 12.5px; font-weight: 700; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.pill.off { background: var(--card); color: var(--muted); }

.bars { display: flex; gap: 12px; align-items: flex-end; height: 150px; padding: 0 4px; border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0 29px, var(--line) 29px 30px); }
.barcol { flex: 1; max-width: 140px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; }
.bar { border: 0; border-radius: 8px 8px 0 0; background: var(--bar); cursor: pointer; display: flex; justify-content: center; padding-top: 4px; color: #fff; font-weight: 700; font-size: 13px; font-family: var(--font-num); min-height: 26px; }
.bar[aria-pressed="true"] { background: var(--bar-on); }
.dates { display: flex; gap: 12px; padding: 0 4px; }
.dates span { flex: 1; max-width: 140px; min-width: 0; display: flex; flex-direction: column; text-align: center; font-size: 12px; color: var(--muted); font-family: var(--font-num); }
.dates em { font-style: normal; color: var(--fg); font-family: var(--font-body); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wrongbox { background: var(--card); border-radius: 14px; padding: 12px 14px; min-height: 52px; font-size: 14px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
details.more { border-top: 1px solid var(--line); padding-top: 12px; }
details.more summary { cursor: pointer; font-weight: 500; color: var(--muted); }
.tbl { overflow-x: auto; margin-top: 10px; }
.tbl table { border-collapse: collapse; width: 100%; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.tbl td.n { font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }

.stars { display: inline-flex; gap: 2px; }
.stars svg { width: 20px; height: 20px; }
.scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.score { background: var(--card); border-radius: 14px; padding: 14px 16px; }
.score > span { color: var(--muted); font-size: 13px; display: block; }
.score div { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.score b { font-family: var(--font-num); font-size: 22px; font-weight: 800; }
.score b i { font-style: normal; font-size: 13px; color: var(--muted); font-weight: 500; }
.score .stars svg { width: 14px; height: 14px; }
.comment { background: var(--card); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.comment p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.signed { border-top: 1px solid var(--line); padding-top: 10px; text-align: right; color: var(--muted); font-size: 14px; }
.signed b { color: var(--fg); margin-left: 4px; }
.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 8px 12px 0; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }

/* ---- forms and panels ---- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.panel h2 { margin: 0; font-size: 16px; font-weight: 700; }
.note { background: var(--accent-soft); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; overflow-wrap: anywhere; }
.note.err { background: var(--bad-soft); color: var(--bad); }
.note.ok { background: var(--accent-soft); }
.auto { display: flex; flex-wrap: wrap; gap: 6px 28px; background: var(--card); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.auto span { color: var(--muted); }
.auto b { font-family: var(--font-num); font-variant-numeric: tabular-nums; margin-left: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 16px; }
.f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f label, .f .lbl { font-size: 12.5px; color: var(--muted); }
.f input, .f select, .f textarea { width: 100%; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.f textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.f.wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 10px; }
.check input { width: 20px; height: 20px; }
.rows { display: flex; flex-direction: column; gap: 10px; }
.row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 120px auto; gap: 8px; align-items: end; padding: 10px; background: var(--card); border-radius: 12px; }
.row.v { grid-template-columns: 150px minmax(0, 1fr) 110px 110px auto; }
.row .f input, .row .f select { background: var(--surface); }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 500; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.del { color: var(--bad); }
.btn.del.armed { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.toolbar .f { flex: 1; min-width: 160px; }
.starin { display: flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; flex-wrap: wrap; }
.starin .sbtn { border: 0; background: none; padding: 2px; cursor: pointer; line-height: 0; border-radius: 6px; }
.starin svg { width: 28px; height: 28px; }
.starin .val { font-family: var(--font-num); font-weight: 800; margin-left: 6px; min-width: 2.6em; }
.starin .zero { margin-left: auto; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 2px 10px; cursor: pointer; font-family: var(--font-num); font-weight: 700; font-size: 13px; }
.starin .zero[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.srow { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; background: var(--card); border-radius: 12px; padding: 10px 12px; }
.srow > div { min-width: 0; overflow-wrap: anywhere; }
.srow small { color: var(--muted); margin-left: 6px; }
.srow .btns { display: flex; gap: 6px; flex-wrap: wrap; }
.cred { display: flex; flex-direction: column; gap: 10px; border: 2px solid var(--accent); border-radius: 14px; padding: 14px 16px; }
.cred code { display: block; background: var(--card); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; font-size: 13px; }
.cred .pin { font-family: var(--font-num); font-size: 26px; font-weight: 800; letter-spacing: .2em; }
.login { max-width: 420px; margin: 8vh auto 0; }
.pinbox { max-width: 420px; margin: 6vh auto 0; }
.pinbox input { text-align: center; letter-spacing: .3em; font-size: 22px; font-family: var(--font-num); }

@media (max-width: 640px) {
  .sheet { padding: 2px 18px; }
  .hero { padding: 24px 20px; }
  .row, .row.v { grid-template-columns: 1fr 1fr; }
  .row .grow, .row.v .grow { grid-column: 1 / -1; }
  .counts { gap: 22px; }
  .panel { padding: 18px 16px; }
}
@media (prefers-reduced-motion: no-preference) { .bar { transition: background .15s; } }
.srow-wrap { display: grid; gap: 8px; }
.srow-extra { background: var(--card); border-radius: 12px; padding: 10px 12px; display: grid; gap: 10px; }
