:root {
  --bg: #f7f8f8;
  --card: #ffffff;
  --ink: #001c2e;
  --muted: #6b7280;
  --line: #e7e9ec;
  --brand: #df1f2a;       /* ATION 브랜드 레드 */
  --brand-dark: #b3141f;
  --navy: #001c2e;        /* 보조 다크 네이비 */
  --good: #16a34a;
  --warn: #d97706;
  --bad: #df1f2a;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 16px; }
.wrap.wide { max-width: 1100px; }

header.bar {
  position: sticky; top: 0; z-index: 20;
  background: var(--card); border-bottom: 1px solid var(--line);
  border-top: 4px solid var(--brand);
  padding: 12px 16px;
}
header.bar h1 { font-size: 17px; margin: 0; color: var(--navy); }
header.bar h1::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--brand); margin-right: 8px; vertical-align: middle; }
header.bar .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; width: 0%; background: var(--brand); transition: width .25s ease; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; margin: 14px 0; box-shadow: var(--shadow);
}
.card h2 { font-size: 15px; margin: 0 0 4px; }
.cat-title { display: flex; align-items: center; gap: 8px; margin: 24px 4px 6px; font-size: 14px; font-weight: 700; color: var(--brand-dark); }
.cat-title { color: var(--navy); }
.cat-title .idx { background: var(--brand); color:#fff; border-radius: 8px; padding: 1px 8px; font-size: 12px; }

.q { padding: 14px 0; border-bottom: 1px solid var(--line); }
.q:last-child { border-bottom: 0; }
.q .qtext { font-size: 15px; margin-bottom: 10px; font-weight: 500; }
.q .qtext .num { color: var(--muted); font-weight: 700; margin-right: 6px; }

.likert { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale10 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
@media (min-width: 520px){ .scale10 { grid-template-columns: repeat(10, 1fr); } }
.opt {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 4px; cursor: pointer;
  background: #fff; text-align: center; min-height: 54px; transition: all .12s ease; user-select: none;
}
.opt .v { font-weight: 700; font-size: 16px; }
.opt .lbl { font-size: 10px; color: var(--muted); margin-top: 2px; line-height: 1.2; }
.opt:hover { border-color: var(--brand); }
.opt.sel { background: var(--brand); border-color: var(--brand); color: #fff; }
.opt.sel .lbl { color: rgba(255,255,255,.85); }
.opt input { display: none; }

label.field { display:block; font-size: 13px; font-weight:600; margin: 10px 0 4px; }
select, input[type=text], textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }

button.btn {
  appearance: none; border: 0; border-radius: 12px; padding: 14px 18px; font-size: 16px; font-weight: 700;
  background: var(--brand); color: #fff; cursor: pointer; width: 100%; transition: background .12s;
}
button.btn:hover { background: var(--brand-dark); }
button.btn:disabled { opacity: .5; cursor: not-allowed; }
button.ghost { background: #fdeced; color: var(--brand-dark); }
button.sm { width: auto; padding: 9px 14px; font-size: 13px; border-radius: 10px; }

.note { font-size: 12px; color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--bad); color:#fff; padding: 11px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); z-index: 50; }

/* 완료 화면 */
.done { text-align:center; padding: 40px 20px; }
.done .check { width: 72px; height: 72px; border-radius: 50%; background: var(--good); color:#fff; font-size: 40px; display:flex; align-items:center; justify-content:center; margin: 0 auto 16px; }
.winbadge { display:inline-block; margin-top: 12px; background:#fdeced; color:var(--brand-dark); border:1.5px dashed var(--brand); border-radius:10px; padding:8px 16px; font-size:14px; letter-spacing:1px; }
.winbadge b { font-size:18px; letter-spacing:2px; }

/* 관리자 */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px){ .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--card); border:1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font-size: 28px; font-weight: 800; margin-top: 4px; }
.kpi .value small { font-size: 14px; color: var(--muted); font-weight: 600; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; background: #fbfbfc; position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar-cell { display:flex; align-items:center; gap:8px; }
.minibar { flex:1; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.minibar > div { height:100%; background: var(--brand); }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; background:#fdeced; color: var(--brand-dark); }
.row { display:flex; gap:10px; align-items:center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.scoretag { font-weight:700; }
.s-good { color: var(--good); } .s-mid { color: var(--warn); } .s-bad { color: var(--bad); }
.comment-item { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.comment-item .meta { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.login-box { max-width: 360px; margin: 60px auto; }
canvas { max-width: 100%; }
