/* 참고(designbookmark.com/motion)의 체계를 밝은 바탕으로 옮긴 토큰: 바탕 위에 둥근 면, 알약 컨트롤, 무채색 강조 하나. */
:root {
  color-scheme: light;
  --bg: #f2f2f7;
  --surface: #fff;
  --fill: #e5e5ea;
  --fill-2: #d8d8dd;
  --sunken: #f7f7f9;
  --line: #e5e5ea;
  --line-strong: #c7c7cc;
  --text: #1c1c1e;
  --text-2: #5c5c61;
  --text-3: #6e6e73;
  --accent: #000;
  --accent-ink: #fff;
  --ok: #007956;
  --info: #1447e6;
  --warn: #9a5800;
  --bad: #c9252d;
  --ok-bg: #e3f8ee;
  --info-bg: #e8f0ff;
  --warn-bg: #fff1d6;
  --bad-bg: #fdeaea;
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) transparent; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 14px/1.55 var(--font); font-feature-settings: 'tnum' 1; -webkit-font-smoothing: antialiased; caret-color: var(--accent);
}
::selection { background: #000; color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
.noscript { padding: 24px; text-align: center; }

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 14px; height: 14px; }
.ic.logo { fill: currentColor; stroke: none; width: 28px; height: 28px; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }
.small { font-size: 12px; }
.gap { margin-bottom: 14px; }
.grow { flex: 1; }
.link { display: inline-block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* 로그인 */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 360px; display: grid; gap: 28px; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand h1 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--text-2); }
.input {
  width: 100%; height: 42px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); transition: border-color .15s;
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: #a1a1a6; }
.input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 0, 0, .12); }
.form-error { display: flex; gap: 8px; align-items: flex-start; color: var(--bad); font-size: 13px; }
.form-error .ic { margin-top: 2px; }
.hint { padding: 12px 14px; background: var(--surface); border-radius: var(--radius-sm); color: var(--text-2); font-size: 13px; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 999px; background: var(--fill); color: var(--text); font-weight: 550;
  white-space: nowrap; text-decoration: none; transition: background-color .15s, opacity .15s, transform .15s var(--ease);
}
.btn:hover { background: var(--fill-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #2c2c2e; }
.btn.ghost { background: transparent; border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--fill); }
.btn.block { width: 100%; height: 44px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.busy { pointer-events: none; opacity: .7; }

/* 셸 */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1080px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.01em; font-size: 15px; white-space: nowrap; }
.tabs { position: relative; display: inline-flex; padding: 4px; background: var(--fill); border-radius: 999px; }
.tabs a { position: relative; z-index: 1; padding: 6px 16px; border-radius: 999px; color: var(--text-2); font-weight: 550; text-decoration: none; white-space: nowrap; transition: color .2s; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current='page'] { color: var(--accent-ink); }
.tab-ind { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0; background: var(--accent); border-radius: 999px; }
.tab-ind.ready { transition: transform .28s var(--ease), width .28s var(--ease); }
.top-end { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.who { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sample { padding: 2px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-size: 12px; font-weight: 600; white-space: nowrap; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); transition: background-color .15s, color .15s; }
.icon-btn:hover { background: var(--fill); color: var(--text); }

main { max-width: 1080px; margin: 0 auto; padding: 32px 20px 96px; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; }
.page-head p { margin-top: 4px; color: var(--text-2); }
.head-end { display: flex; align-items: center; gap: 12px; }
.stamp { color: var(--text-3); font-size: 12px; }

.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; flex: 0 1 280px; min-width: 200px; }
.search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 40px; height: 38px; border-radius: 999px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--surface); color: var(--text-2); font-weight: 550; transition: background-color .15s, color .15s; }
.pill:hover { background: var(--fill); color: var(--text); }
.pill[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); }
.pill b { font-weight: 600; opacity: .7; font-variant-numeric: tabular-nums; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 14px; text-align: left; font-size: 12px; font-weight: 550; color: var(--text-3); border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child > td { border-bottom: 0; }
.r { text-align: right; }
.fine { margin-top: 12px; color: var(--text-3); font-size: 12px; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--fill); color: var(--text-2); }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }

/* 슬롯 내역 */
.slots td.c-name { padding: 0; }
.row-toggle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 14px; border: 0; border-radius: 0; background: none; text-align: left; }
.row-toggle:focus-visible { outline-offset: -2px; }
.row-toggle .ic { color: var(--text-3); transition: transform .22s var(--ease); }
.row-toggle[aria-expanded='true'] .ic { transform: rotate(180deg); }
.nm { min-width: 0; display: grid; }
.nm b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.slots tr.item:hover > td { background: rgba(0, 0, 0, .025); }
.slots tr.detail > td { padding: 0; background: var(--sunken); }
.detail-in { padding: 16px 16px 18px 14px; display: grid; gap: 14px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 0; }
.facts div { display: grid; gap: 2px; }
.facts dt { color: var(--text-3); font-size: 12px; }
.facts dd { margin: 0; }

/* 순위 이력 */
.ranks th.sticky, .ranks td.sticky { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.ranks td.sticky { box-shadow: 1px 0 0 var(--line); }
.ranks .who-cell { min-width: 220px; max-width: 260px; }
.ranks .cur { white-space: nowrap; }
.ranks .cur strong { font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.delta { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-weight: 550; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }
.ranks th.dcol, .ranks td.cell { text-align: center; padding-left: 4px; padding-right: 4px; min-width: 42px; }
.ranks th.dcol.today { color: var(--text); }
.ranks td.cell { font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 550; }
.ranks td.cell.t1 { background: #a4f4cf; }
.ranks td.cell.t2 { background: #d0fae5; }
.ranks td.cell.t3 { background: #ecfdf5; }
.ranks td.cell.none { color: var(--text-3); font-weight: 400; }
.ranks td.cell.x { color: var(--warn); font-size: 11px; font-weight: 600; }

/* 엑셀 등록 */
.drop { display: grid; justify-items: center; gap: 14px; padding: 44px 20px; text-align: center; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); transition: border-color .2s, background-color .2s; }
.drop.over { border-color: var(--accent); background: var(--sunken); }
.drop .ic.big { width: 30px; height: 30px; color: var(--text-2); }
.drop h2 { font-size: 16px; font-weight: 600; }
.drop-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.bar { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.counts { display: flex; gap: 6px 18px; flex-wrap: wrap; color: var(--text-2); }
.counts b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.counts .bad b { color: var(--bad); }
.counts .warn b { color: var(--warn); }
.preview { max-height: 560px; overflow: auto; }
.preview table { min-width: 720px; }
.preview th { position: sticky; top: 0; z-index: 2; }
.preview td { padding: 9px 14px; }
.preview tr.off td { color: var(--text-3); }
.preview td.msg { color: var(--text-2); min-width: 220px; }
.preview td.msg.bad { color: var(--bad); }
.preview td.msg.warn { color: var(--warn); }
.preview td.msg .ic { vertical-align: -3px; margin-right: 6px; }
.chk { width: 16px; height: 16px; accent-color: #000; vertical-align: middle; }
.chkcol { width: 40px; }
.action-bar { position: sticky; bottom: 12px; z-index: 3; margin-top: 16px; padding: 12px 12px 12px 18px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.progress { height: 6px; border-radius: 6px; background: var(--fill); overflow: hidden; margin: 8px 0 0; }
.progress i { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(0); background: var(--accent); transition: transform .3s var(--ease); }
.sending { display: grid; gap: 2px; margin-bottom: 14px; padding: 16px 18px; background: var(--surface); border-radius: var(--radius); }
.result-head { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.result-head .ic { width: 22px; height: 22px; }
.result-head.ok .ic { color: var(--ok); }
.result-head.warn .ic { color: var(--warn); }

/* 상태 */
.state { padding: 56px 20px; text-align: center; display: grid; justify-items: center; gap: 10px; }
.state h2 { font-size: 16px; font-weight: 600; }
.state p { color: var(--text-2); max-width: 36ch; }
.state .btn { margin-top: 6px; }
.skel { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--fill) 25%, var(--bg) 50%, var(--fill) 75%); background-size: 200% 100%; animation: sh 1.4s linear infinite; }
@keyframes sh { to { background-position: -200% 0; } }
.skel-row { display: grid; grid-template-columns: 2fr 1fr 1fr .6fr 1fr; gap: 24px; padding: 18px 14px; border-bottom: 1px solid var(--line); }
.skel-row:last-child { border-bottom: 0; }
.more { display: flex; justify-content: center; padding: 14px; border-top: 1px solid var(--line); }

@media (max-width: 720px) {
  .top-in { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px 12px; }
  .brand { order: 1; }
  .top-end { order: 2; }
  .tabs { order: 3; width: 100%; }
  .tabs a { flex: 1; text-align: center; padding: 8px 6px; }
  main { padding: 20px 16px 80px; }
  .who { display: none; }
  .search { flex: 1 1 100%; }
  .btn, .pill, .icon-btn { min-height: 40px; }
  .page-head h1 { font-size: 22px; }

  .slots thead { display: none; }
  .slots, .slots tbody { display: block; }
  .slots tr.item { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 12px; padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
  .slots tr.item > td { display: block; padding: 0 16px; border: 0; }
  .slots tr.item:hover > td { background: none; }
  .slots td.c-name { grid-column: 1 / 3; padding: 0; }
  .slots td.c-status { grid-column: 3; grid-row: 1; justify-self: end; align-self: center; padding: 10px 16px 0 0; }
  .slots td[data-l]::before { content: attr(data-l); display: block; font-size: 12px; color: var(--text-3); }
  .slots tr.detail { display: block; border-bottom: 1px solid var(--line); }
  .slots tr.detail > td { display: block; border: 0; }
  .detail-in { padding: 14px 16px 16px; }
  .ranks .who-cell { min-width: 150px; max-width: 160px; }
  .link { max-width: 180px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
