:root {
  --navy: #1F3864;
  --navy-2: #2f5590;
  --ink: #23303f;
  --sub: #6b7385;
  --line: #e7ded0;
  --bg: #faf5ec;
  --paper: #ffffff;
  --cream: #fbf6ea;
  --sand: #f3ead9;
  --blue: #3EA5DC;
  --pink: #E24C7F;
  --green: #96C04E;
  --warn: #8a6410;
  --warn-soft: #fdf3d8;
  --bad: #b3261e;
  --bad-soft: #fbe6e5;
  --ok-soft: #e6f3e0;
  --info-soft: #e6f0fa;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink);
  background:
    radial-gradient(1100px 420px at 8% -10%, #fdf0dd 0%, rgba(253,240,221,0) 62%),
    radial-gradient(900px 380px at 100% 4%, #e8f1fb 0%, rgba(232,241,251,0) 60%),
    var(--bg);
  background-attachment: fixed;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 15px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere;
  padding-bottom: 8px;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--navy); }
:focus-visible { outline: 3px solid #8fc4ea; outline-offset: 2px; }

.top {
  position: relative;
  background: linear-gradient(120deg, #1b3159 0%, var(--navy) 45%, #33598f 100%);
  color: #fff;
  box-shadow: 0 3px 14px rgba(31,56,100,.22);
}
.top::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue) 33%, var(--pink) 33%, var(--pink) 66%, var(--green) 66%, var(--green) 100%);
}
.top-in {
  max-width: 760px; margin: 0 auto; padding: 13px 16px;
  display: flex; align-items: center; gap: 10px;
}
.brand {
  flex: none; display: inline-flex; align-items: center;
  background: #fff; border-radius: 8px; padding: 4px 8px;
}
.brand img { height: 18px; width: auto; display: block; }
.top h1 {
  font-size: 16px; margin: 0; font-weight: 800; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 5px;
}
.top h1 .t-word { color: #fdf6e7; }
.top h1 .t-on {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ffd27a 0%, #f3a15c 55%, var(--pink) 100%);
  color: #33240f; font-weight: 900; font-size: 14px; letter-spacing: .02em;
  padding: 2px 9px; border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.55);
}
.top h1 small {
  font-size: 12px; font-weight: 700; color: #cfdcf0;
  background: rgba(255,255,255,.14); border-radius: 999px; padding: 2px 8px; margin-left: 2px;
}
.top button {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.45);
  color: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
main { max-width: 760px; margin: 0 auto; padding: 16px; }
h2 { font-size: 20px; margin: 4px 0 12px; letter-spacing: -.02em; }
h3 { font-size: 16px; margin: 0 0 8px; }
p { margin: 0 0 8px; }
.muted { color: var(--sub); font-size: 13.5px; }
.center { text-align: center; }

.hero {
  display: flex; align-items: center; gap: 14px; margin: 4px 0 14px;
  background: linear-gradient(135deg, #ffffff 0%, var(--cream) 100%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: 0 3px 12px rgba(120,96,60,.08);
}
.hero-icon { width: 72px; height: 72px; flex: none; }
.hero h2 { margin: 0 0 2px; font-size: 21px; }

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(120, 96, 60, .06);
}
.stack > * + * { margin-top: 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > select, .row > input { width: auto; flex: 1 1 130px; }
.row > input[type=checkbox] { flex: none; width: 22px; height: 22px; }
.row > .grow { flex: 1 1 150px; }
.grow { flex: 1; }

label.f { display: block; font-size: 13px; color: var(--sub); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
td input[type=number] { min-width: 68px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, var(--sand) 160%);
  border-radius: 10px;
  padding: 10px 14px; min-height: 44px; cursor: pointer; font-weight: 600; text-decoration: none;
}
.btn.primary { background: linear-gradient(180deg, #24406f 0%, var(--navy) 100%); border-color: var(--navy); color: #fff; }
.btn.accent { background: linear-gradient(180deg, #ec5b8b 0%, var(--pink) 100%); border-color: var(--pink); color: #fff; }
.btn.danger { color: var(--bad); border-color: #edbcb9; }
.btn.block { width: 100%; }
.btn.small { min-height: 34px; padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 11px; }
.tile {
  display: block; text-align: left; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #ffffff 0%, var(--cream) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 16px 20px;
  cursor: pointer; text-decoration: none; color: inherit;
  box-shadow: 0 3px 12px rgba(120, 96, 60, .08);
  transition: transform .12s ease, box-shadow .12s ease;
}
.tile::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  background: var(--navy); border-radius: var(--radius) 0 0 var(--radius);
}
.tile.blue::before { background: var(--blue); }
.tile.pink::before { background: var(--pink); }
.tile.green::before { background: var(--green); }
.tile.navy::before { background: var(--navy); }
.tile:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(120, 96, 60, .14); }
.tile b { display: block; font-size: 16px; letter-spacing: -.01em; }
.tile span { color: var(--sub); font-size: 13px; }

.ev { display: inline-block; border-radius: 6px; padding: 1px 9px; font-size: 12.5px; font-weight: 700; color: #fff; }
.ev.run { background: var(--blue); }
.ev.squat { background: var(--pink); }
.ev.burpee { background: var(--green); }
.ev-card { border-left: 5px solid var(--line); }
.ev-card.run { border-left-color: var(--blue); }
.ev-card.squat { border-left-color: var(--pink); }
.ev-card.burpee { border-left-color: var(--green); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; margin-top: 10px; }
.stat { background: var(--sand); border-radius: 10px; padding: 9px 11px; }
.stat small { display: block; color: var(--sub); font-size: 12px; }
.stat b { font-size: 18px; }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(120,96,60,.05); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: var(--sand); font-weight: 700; font-size: 13px; color: #5c5240; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fdf6e8; }
tr:last-child td { border-bottom: 0; }
.rank1 td:first-child { font-weight: 800; color: var(--navy); }

.note { border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 10px; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad { background: var(--bad-soft); color: #8b201a; }
.note.ok { background: var(--ok-soft); color: #2c5c22; }
.note.info { background: var(--info-soft); color: #1b4a80; }
.note ul { margin: 6px 0 0; padding-left: 18px; max-height: 230px; overflow: auto; }
.badge { display: inline-block; border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 700; }
.badge.wait { background: var(--warn-soft); color: var(--warn); }
.badge.ok { background: var(--ok-soft); color: #2c5c22; }
.badge.flag { background: var(--bad-soft); color: #8b201a; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { background: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: 13px; }
.chip small { color: var(--sub); font-size: 11px; }
.chip.lv1 { background: #fff7e6; border-color: #f0dcb4; }
.chip.lv2 { background: #ffeed2; border-color: #e9c581; box-shadow: inset 0 1px 0 #fff; }
.chip.lv3 {
  background: linear-gradient(135deg, #ffe2a8 0%, #f5b46a 60%, #ef8fae 100%);
  border-color: #e0a05c; font-weight: 700;
}
.chip.run { border-left: 4px solid var(--blue); }
.chip.squat { border-left: 4px solid var(--pink); }
.chip.burpee { border-left: 4px solid var(--green); }
.chip.total { border-left: 4px solid var(--navy); }

.bar { height: 10px; background: var(--sand); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green) 0%, #7fb43f 100%); }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 30px; margin-bottom: 8px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.file-in { display: block; width: 100%; padding: 12px; border: 2px dashed #d8c7a8; border-radius: 10px; background: #fffdf7; }
.big-ok { font-size: 24px; font-weight: 800; color: var(--green); margin-bottom: 6px; }
.loading { padding: 40px 0; color: var(--sub); text-align: center; }

.foot { margin: 26px auto 10px; padding: 18px 16px 10px; text-align: center; border-top: 1px solid var(--line); }
.foot img { width: 210px; max-width: 70%; height: auto; opacity: .95; }
.watermark-in { margin-top: 8px; font-size: 12px; color: #9aa7b8; }
.chip.run { border-color: #bfe0f3; }
.chip.squat { border-color: #f4c2d4; }
.chip.burpee { border-color: #d3e6b4; }
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.name-btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px; cursor: pointer; text-align: left; min-height: 52px; }
.name-btn b { display: block; }
.name-btn small { color: var(--sub); font-size: 12px; }
.name-btn.on { border-color: #9ccbe8; background: var(--info-soft); }
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(27,42,68,.93); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; z-index: 50; max-width: calc(100% - 32px);
}
.modal-bg { position: fixed; inset: 0; background: rgba(27,42,68,.45); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.modal { background: #fff; border-radius: 14px; padding: 20px; width: 100%; max-width: 360px; }
.modal h3 { margin-bottom: 14px; }

@media (max-width: 480px) {
  main { padding: 12px; }
  .panel { padding: 14px; }
  .brand {
  flex: none; display: inline-flex; align-items: center;
  background: #fff; border-radius: 8px; padding: 4px 8px;
}
.brand img { height: 18px; width: auto; display: block; }
.top h1 { font-size: 15px; }
  .hero-icon { width: 60px; height: 60px; }
  th, td { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
