/* 주술회전 팬텀 퍼레이드 아카이브
   Layout: 한 줄 헤더 + 탭, 역할별 줄 목록, 상세는 데스크톱 모달 / 모바일 바텀시트.
   다크 우선 디자인. 라이트는 prefers-color-scheme 또는 data-theme="light". */
:root {
  color-scheme: dark;
  --bg: #111219; --panel: #1A1C26; --sheet: #1C1E29; --card: #222533; --card2: #252836;
  --slot: #262938; --chip: #2A2D3B; --icon: #2E3142; --well: #33374A; --line: #262938; --line2: #3A3D4E;
  --fg: #ECEAE4; --fg2: #D4D0DC; --muted: #B4B0C0; --dim: #8C8999; --faint: #6F6C7C;
  --accent: #E8873A; --on-accent: #16171F; --link: #F0A868;
  --ink: #ECEAE4; --on-ink: #16171F;
  --star: #F2C14E; --sp: #B79BEA; --sp-text: #B69AE9; --chg: #7FD1C7; --chg-text: #7ED0C6;
  --bf: #E5484D; --ce: #5FD3E0; --gauge: #9B7BE8;
  --av-lim: #E8677A; --av-soon: #B79BEA;
  --imp-hi: #E8873A; --imp-mid: #D6CFC0; --imp-lo: #3A3D4E; --imp-lo-fg: #B4B0C0;
  --t-gen: #F2A3A3; --t-kage: #94BBF2; --t-yoru: #93D6A8; --t-gyo: #F2D47C; --t-on: #16171F;
  --b-gen: #F2A3A3; --b-kage: #94BBF2; --b-yoru: #93D6A8; --b-gyo: #F2D47C;
  --tier-s: #F5D06A; --tier-a: #F0A46A; --tier-b: #9DC2F2; --tier-c: #9ED9B0; --tier-d: #C4C1CC;
  --scrim: rgba(6, 7, 12, 0.74); --shadow: rgba(0, 0, 0, 0.55); --drop: rgba(232, 135, 58, 0.12);
  --font-body: 'IBM Plex Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-display: 'Black Han Sans', 'IBM Plex Sans KR', sans-serif;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #F6F4EF; --panel: #FFFFFF; --sheet: #FFFFFF; --card: #F2F0EB; --card2: #F2F0EB;
    --slot: #E6E3DC; --chip: #ECE9E2; --icon: #E2DFD7; --well: #DAD6CD; --line: #E6E3DC; --line2: #CFCBC2;
    --fg: #1C1D24; --fg2: #34353F; --muted: #55566A; --dim: #6B6C7A; --faint: #8E8D96;
    --accent: #D46F22; --on-accent: #16171F; --link: #B5541A;
    --ink: #555766; --on-ink: #FFFFFF;
    --star: #D9A21B; --sp-text: #6E4FB0; --chg-text: #2E8C80; --ce: #1F9DB0;
    --av-lim: #E25A6F; --imp-lo: #CFCBC2; --imp-lo-fg: #55566A;
    --t-gen: #B85C5A; --t-kage: #5577B3; --t-yoru: #3D8460; --t-gyo: #967020; --t-on: #FFFFFF;
    --b-gen: #F9DADA; --b-kage: #D8E6F9; --b-yoru: #D7F0DE; --b-gyo: #F8ECC3;
    --scrim: rgba(28, 26, 22, 0.45); --shadow: rgba(40, 35, 25, 0.18);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F6F4EF; --panel: #FFFFFF; --sheet: #FFFFFF; --card: #F2F0EB; --card2: #F2F0EB;
  --slot: #E6E3DC; --chip: #ECE9E2; --icon: #E2DFD7; --well: #DAD6CD; --line: #E6E3DC; --line2: #CFCBC2;
  --fg: #1C1D24; --fg2: #34353F; --muted: #55566A; --dim: #6B6C7A; --faint: #8E8D96;
  --accent: #D46F22; --on-accent: #16171F; --link: #B5541A;
  --ink: #555766; --on-ink: #FFFFFF;
  --star: #D9A21B; --sp-text: #6E4FB0; --chg-text: #2E8C80; --ce: #1F9DB0;
  --av-lim: #E25A6F; --imp-lo: #CFCBC2; --imp-lo-fg: #55566A;
  --t-gen: #B85C5A; --t-kage: #5577B3; --t-yoru: #3D8460; --t-gyo: #967020; --t-on: #FFFFFF;
  --b-gen: #F9DADA; --b-kage: #D8E6F9; --b-yoru: #D7F0DE; --b-gyo: #F8ECC3;
  --scrim: rgba(28, 26, 22, 0.45); --shadow: rgba(40, 35, 25, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 14px; line-height: 1.5;
  word-break: keep-all; overflow-wrap: break-word;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { text-wrap: balance; }

.wrap {
  max-width: 1200px; margin: 0 auto;
  padding-block: 36px 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 22px;
}
@media (min-width: 720px) { .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); } }

/* header */
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.kicker { font-size: 12px; letter-spacing: 0.06em; color: var(--dim); }
.titlerow { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 6vw, 44px); line-height: 1.1; }
.updated { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); background: var(--panel); padding: 4px 10px; border-radius: 999px; }
.iconbtn {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line2);
  background: var(--panel); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.iconbtn.round { width: 36px; height: 36px; border-radius: 50%; background: transparent; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab { min-height: 44px; padding: 0 16px; border: 0; background: none; color: var(--dim); font-size: 15px; font-weight: 500; }
.tab[aria-current="page"] { color: var(--fg); font-weight: 700; box-shadow: inset 0 -3px 0 var(--accent); }
@media (max-width: 640px) {
  .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; border: 0; }
  .tab { min-height: 42px; padding: 0 4px; border-radius: 10px; background: var(--panel); color: var(--muted); font-size: 13px; white-space: nowrap; }
  .tab[aria-current="page"] { background: var(--accent); color: var(--on-accent); box-shadow: none; }
}

/* common bits */
.panel { background: var(--panel); border-radius: 14px; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px 16px; }
.grp { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lbl { font-size: 12px; font-weight: 600; color: var(--dim); }
.pill {
  min-height: 36px; min-width: 44px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--line2); background: transparent; color: var(--muted);
}
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.pill.t-幻[aria-pressed="true"] { background: var(--t-gen); border-color: var(--t-gen); color: var(--t-on); }
.pill.t-影[aria-pressed="true"] { background: var(--t-kage); border-color: var(--t-kage); color: var(--t-on); }
.pill.t-夜[aria-pressed="true"] { background: var(--t-yoru); border-color: var(--t-yoru); color: var(--t-on); }
.pill.t-行[aria-pressed="true"] { background: var(--t-gyo); border-color: var(--t-gyo); color: var(--t-on); }
.btn { min-height: 44px; padding: 0 16px; border-radius: 10px; font-size: 13px; font-weight: 700; border: 1px solid var(--line2); background: transparent; color: var(--fg); }
.btn.primary { border: 0; background: var(--accent); color: var(--on-accent); }
.search { position: relative; display: flex; align-items: center; flex: 1 1 220px; max-width: 320px; }
.search svg { position: absolute; left: 12px; pointer-events: none; color: var(--dim); }
.search input { width: 100%; min-height: 44px; padding: 0 12px 0 36px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); font-size: 13px; }
.select { position: relative; display: inline-flex; align-items: center; }
.select select { appearance: none; -webkit-appearance: none; min-height: 44px; padding: 0 36px 0 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel); font-size: 13px; font-weight: 600; }
.select svg { position: absolute; right: 12px; pointer-events: none; color: var(--muted); }
.count { margin-left: auto; font-size: 13px; color: var(--muted); }
.empty { padding: 28px 20px; text-align: center; color: var(--dim); font-size: 14px; }
.status { margin: 0; font-size: 13px; color: var(--muted); }
.status.warn { color: var(--accent); }

/* character icon */
.ic { position: relative; border-radius: 10px; background: var(--slot); overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 11px; }
.ic img { width: 100%; height: 100%; object-fit: cover; }
.ic .sub { position: absolute; bottom: 3px; right: 3px; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 4px; background: var(--ink); color: var(--on-ink); line-height: 1.6; }

/* roles list */
.group { display: flex; flex-direction: column; gap: 10px; }
.group h2 { margin: 6px 0 2px; font-size: 20px; display: flex; align-items: baseline; gap: 10px; }
.group h2 small { font-size: 13px; font-weight: 500; color: var(--dim); }
.rows { overflow: hidden; }
.row { display: flex; flex-wrap: wrap; gap: 12px 20px; padding: 18px 20px; }
.row + .row { border-top: 1px solid var(--line); }
.rowhead { flex: 0 0 170px; display: flex; align-items: center; gap: 10px; padding-top: 4px; }
.rowhead b { font-size: 15px; }
.rowhead span { font-size: 12px; color: var(--dim); }
.bar4 { width: 4px; height: 22px; border-radius: 2px; background: var(--accent); flex: 0 0 auto; }
.chars { flex: 999 1 420px; min-width: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.chr { width: 84px; padding: 0; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chr .ic { width: 76px; height: 76px; }
.chr .nm { font-size: 12px; line-height: 1.3; text-align: center; color: var(--fg2); }
@media (max-width: 640px) {
  .row { padding: 14px 12px; }
  .rowhead { flex-basis: 100%; padding: 0; }
  .chars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 8px; flex-basis: 100%; }
  .chr { width: auto; min-width: 0; }
  .chr .ic { width: 100%; height: auto; aspect-ratio: 1 / 1; }
}

/* overlay (detail, picker) */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 20; display: flex; align-items: center; justify-content: center; padding: 24px; }
.sheet {
  width: 100%; max-width: 620px; max-height: calc(100vh - 48px); overflow-y: auto; background: var(--sheet); border-radius: 18px;
  box-shadow: 0 24px 80px var(--shadow); display: flex; flex-direction: column;
}
.sheet.wide { max-width: 800px; }
.grip { display: none; }
@media (max-width: 640px) {
  .scrim { align-items: flex-end; padding: 0; }
  .sheet, .sheet.wide { max-width: none; max-height: 88vh; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .grip { display: flex; justify-content: center; padding: 10px 0 2px; }
  .grip span { width: 40px; height: 4px; border-radius: 2px; background: var(--line2); }
}
.close { position: absolute; top: 14px; right: 14px; }
.dhead { position: relative; display: flex; gap: 18px; padding: 22px 22px 18px; }
.dhead .ic { width: 112px; height: 112px; flex: 0 0 auto; border-radius: 14px; }
.dmeta { display: flex; flex-direction: column; gap: 9px; min-width: 0; padding-right: 48px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--chip); color: var(--fg); }
.badge.av-한정 { background: var(--av-lim); color: #16171F; }
.badge.av-상시예정 { background: var(--av-soon); color: #16171F; }
.badge.b-幻 { background: var(--b-gen); color: #16171F; }
.badge.b-影 { background: var(--b-kage); color: #16171F; }
.badge.b-夜 { background: var(--b-yoru); color: #16171F; }
.badge.b-行 { background: var(--b-gyo); color: #16171F; }
.dname { margin: 0; font-size: 22px; line-height: 1.3; }
.roleline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; }
.roleline .bar4 { height: 16px; }
.roleline small { font-size: 12px; color: var(--dim); }
.roleline .sep { color: var(--line2); }
.alts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--dim); }
.alts .ic { width: 44px; height: 44px; border-radius: 8px; }
.alts button.altb { padding: 0; border: 0; background: none; }
.linkbtn { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--link); font-size: 12px; text-decoration: underline; }
.dbody { display: flex; flex-direction: column; gap: 20px; padding: 4px 22px 24px; }
.sec { display: flex; flex-direction: column; gap: 10px; }
.sechead { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sectitle { font-size: 13px; font-weight: 600; color: var(--muted); }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--card2); border-radius: 10px; }
.seg button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.toggles { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toggles .cl { font-size: 12px; color: var(--dim); }
.scard { background: var(--card2); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.shead { display: flex; align-items: center; gap: 10px; }
.sicon { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 8px; background: var(--well); overflow: hidden; }
.sicon img { width: 100%; height: 100%; object-fit: cover; }
.stitle { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stitle b { font-size: 14px; }
.cost { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.tag { flex: 0 0 auto; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px; color: #16171F; white-space: nowrap; }
.tag.sp { background: var(--sp); } .tag.chg { background: var(--chg); } .tag.bf { background: var(--bf); }
.imp { flex: 0 0 auto; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.imp.높음 { background: var(--imp-hi); color: #16171F; } .imp.중간 { background: var(--imp-mid); color: #16171F; } .imp.낮음 { background: var(--imp-lo); color: var(--imp-lo-fg); }
.desc { margin: 0; font-size: 13px; line-height: 1.65; color: var(--fg2); white-space: pre-line; }
.note { font-size: 12px; }
.note.sp { color: var(--sp-text); } .note.chg { color: var(--chg-text); }
.autos { background: var(--card2); border-radius: 12px; overflow: hidden; }
.arow { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; }
.arow + .arow { border-top: 1px solid var(--line); }
.arow .sicon { width: 34px; height: 34px; }
.arow .stitle b { font-size: 13px; }
.rems { display: flex; gap: 10px; flex-wrap: wrap; }
.rem { flex: 1 1 200px; display: flex; align-items: center; gap: 10px; background: var(--card2); border-radius: 12px; padding: 10px; font-size: 13px; }
.rem .sicon { width: 44px; height: 44px; }
@media (max-width: 640px) {
  .dhead { padding: 8px 16px 14px; gap: 14px; }
  .dhead .ic { width: 84px; height: 84px; }
  .close { top: 4px; right: 12px; }
  .dname { font-size: 19px; }
  .dbody { padding: 0 16px 24px; }
  .scard { padding: 12px; }
}

/* timeline */
.tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tli { display: flex; gap: 16px; }
.tld { flex: 0 0 120px; text-align: right; padding-top: 18px; display: flex; flex-direction: column; gap: 2px; }
.tld b { font-size: 15px; font-variant-numeric: tabular-nums; }
.tld span { font-size: 12px; color: var(--dim); }
.rail { flex: 0 0 16px; display: flex; flex-direction: column; align-items: center; }
.rail i { width: 2px; background: var(--line2); }
.rail i:first-child { height: 22px; } .rail i:last-child { flex: 1 1 auto; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--bg); background: var(--dim); flex: 0 0 auto; }
.dot.pending { background: var(--accent); }
.tlc { flex: 1 1 auto; min-width: 0; margin: 8px 0; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.tlh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.kind { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line2); color: var(--muted); }
.gl { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.gl.pending { background: var(--accent); color: var(--on-accent); }
.items { display: flex; flex-wrap: wrap; gap: 10px; }
.item { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 12px; border: 0; background: var(--card); min-height: 44px; text-align: left; }
.item .ic { width: 48px; height: 48px; border-radius: 8px; }
.item b { font-size: 13px; display: flex; align-items: center; gap: 4px; }
.item span { font-size: 12px; color: var(--dim); }
@media (max-width: 640px) { .tld { display: none; } .tli { gap: 10px; } .tlc { padding: 12px; } .item { width: 100%; } }

/* team builder */
.box { padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.boxhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.boxhead h2 { margin: 0; font-size: 20px; }
.slots { display: flex; flex-wrap: wrap; gap: 14px; }
.slot { width: 84px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.slot.sub { margin-left: 18px; }
.slot .k { font-size: 12px; font-weight: 700; color: var(--dim); }
.slotbtn { width: 72px; height: 72px; padding: 0; border-radius: 12px; border: 2px dashed var(--line2); background: transparent; color: var(--dim); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.slotbtn.filled { border-style: solid; border-color: transparent; background: var(--slot); }
.slotbtn.on { border-color: var(--accent); }
.slotbtn img { width: 100%; height: 100%; object-fit: cover; }
.slot .nm { font-size: 12px; text-align: center; line-height: 1.3; min-height: 16px; }
.slot .rl { font-size: 11px; color: var(--dim); text-align: center; min-height: 14px; }
.slot .out { min-height: 32px; padding: 0 8px; border: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; }
.sum { display: flex; flex-wrap: wrap; gap: 12px; }
.sumc { flex: 1 1 220px; min-width: 0; background: var(--card); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.sumc .k { font-size: 12px; font-weight: 600; color: var(--dim); }
.kv { display: flex; justify-content: space-between; gap: 8px; }
.tchip { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 700; border: 1px solid var(--line2); color: var(--faint); }
.tchip.on.t-幻 { background: var(--b-gen); border-color: var(--b-gen); color: #16171F; }
.tchip.on.t-影 { background: var(--b-kage); border-color: var(--b-kage); color: #16171F; }
.tchip.on.t-夜 { background: var(--b-yoru); border-color: var(--b-yoru); color: #16171F; }
.tchip.on.t-行 { background: var(--b-gyo); border-color: var(--b-gyo); color: #16171F; }
.pick { padding: 22px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.pickrow { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-start; }
.pickrow > b { flex: 0 0 120px; font-size: 13px; font-weight: 600; color: var(--muted); padding-top: 16px; }
.pickrow .chars { gap: 10px; }
.pc { width: 64px; padding: 0; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; text-align: center; line-height: 1.25; }
.pc .ic { width: 52px; height: 52px; border-radius: 9px; }
.pc[aria-disabled="true"] { opacity: 0.4; cursor: default; }
.pc em { font-style: normal; font-size: 10px; color: var(--accent); }
@media (max-width: 640px) {
  .box, .pick { padding: 14px; }
  .slots { gap: 8px; justify-content: space-between; flex-wrap: nowrap; }
  .slot { width: auto; flex: 1 1 0; min-width: 0; }
  .slot.sub { margin-left: 0; }
  .slotbtn { width: 100%; height: auto; aspect-ratio: 1 / 1; }
  .pickrow > b { flex-basis: 100%; padding: 0; }
  .pickrow .chars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); flex-basis: 100%; }
  .pc { width: auto; min-width: 0; }
  .pc .ic { width: 100%; height: auto; aspect-ratio: 1 / 1; }
}

/* quiz */
.qteam { display: flex; flex-wrap: wrap; gap: 10px; }
.qm { width: 72px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; text-align: center; }
.qm .ic { width: 64px; height: 64px; }
.qm.blank .ic { border: 2px dashed var(--accent); background: transparent; color: var(--accent); font-size: 22px; font-weight: 700; }
.qm.blank span { color: var(--accent); }
.qopts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.qo { border: 2px solid transparent; border-radius: 12px; background: var(--card); padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qo .ic { width: 64px; height: 64px; }
.qo b { font-size: 13px; text-align: center; }
.qo.picked { border-color: var(--accent); }
.qo.dim { opacity: 0.7; }
.verdict { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #16171F; }
.verdict.잘 { background: #7CC49A; } .verdict.가능 { background: #D6CFC0; } .verdict.안 { background: #E8677A; }
.fb { background: var(--card2); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 640px) { .qopts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* tier maker */
.tlhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.tlctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.info { position: relative; display: inline-flex; }
.pop { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: 260px; z-index: 6; background: var(--chip); color: var(--fg); border-radius: 10px; padding: 12px 14px; font-size: 12px; line-height: 1.6; box-shadow: 0 8px 24px var(--shadow); }
.popscrim { position: fixed; inset: 0; z-index: 5; }
@media (max-width: 640px) { .pop { left: auto; right: 0; transform: none; } }
.rename { display: inline-flex; align-items: center; gap: 6px; }
.rename input { width: 140px; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--accent); background: var(--card); font-size: 13px; }
.selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: var(--card2); border-radius: 12px; padding: 10px 14px; font-size: 13px; }
.selbar span { flex: 1 1 auto; }
.small { min-height: 36px; padding: 0 12px; border-radius: 8px; font-size: 12px; font-weight: 600; border: 1px solid var(--line2); background: transparent; }
.board { overflow: hidden; display: flex; flex-direction: column; }
.trow { display: flex; align-items: stretch; min-height: 84px; }
.trow + .trow { border-top: 1px solid var(--line); }
.trow.over { background: var(--drop); }
.tlabel { flex: 0 0 72px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; color: #16171F; }
.titems { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; align-items: flex-start; }
.titems .none { font-size: 12px; color: var(--faint); align-self: center; }
.drop { flex: 0 0 auto; align-self: center; margin-right: 10px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px dashed var(--accent); background: transparent; color: var(--accent); font-size: 13px; font-weight: 700; }
.tc { padding: 0; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 64px; font-size: 10px; line-height: 1.2; text-align: center; }
.tc .ic { width: 52px; height: 52px; border-radius: 8px; border: 2px solid transparent; }
.tc.sel .ic { border-color: var(--accent); }
.pool { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.pool h2 { margin: 0; font-size: 16px; }
.poolgrid { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 640px) {
  .trow { min-height: 68px; } .tlabel { flex-basis: 48px; }
  .tc { width: 52px; } .tc .ic { width: 44px; height: 44px; }
  .pool { padding: 12px; }
  .poolgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .poolgrid .tc { width: auto; min-width: 0; } .poolgrid .tc .ic { width: 100%; height: auto; aspect-ratio: 1 / 1; }
}

/* memo + footer */
.memo { max-width: 760px; display: flex; flex-direction: column; gap: 12px; }
.memo section { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.memo h2 { margin: 0; font-size: 16px; }
.memo p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--fg2); }
.foot { margin-top: 12px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 1.7; color: var(--dim); }
.foot b { font-size: 13px; color: var(--muted); }
.foot p { margin: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
#app { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pool .search, .pick .search { flex: 0 0 auto; }
