/* ═══════════ 칭찬보드 · 디자인 ═══════════ */
:root {
  --bg: #FFF8EF; --bg2: #FFEFDC; --card: #FFFFFF; --ink: #2E241B; --ink2: #6E5C4C; --ink3: #A6927F; --line: #F1E3D1; --line2: #E7D3BA;
  --primary: #FF7A45; --primary-d: #EE6330; --primary-soft: #FFE7DB;
  --sun: #FFC21A; --sun-soft: #FFF3C9; --mint: #1FAF7A; --mint-soft: #DDF6EC; --sky: #3D8BFF; --sky-soft: #E2EEFF;
  --berry: #F0517E; --berry-soft: #FFE3EB; --grape: #7B5CFF; --grape-soft: #ECE6FF; --red: #E5484D;
  --r-lg: 24px; --r: 18px; --r-sm: 12px;
  --shadow: 0 1px 0 rgba(46,36,27,.04), 0 12px 32px -14px rgba(140,82,24,.22);
  --shadow-sm: 0 1px 0 rgba(46,36,27,.04), 0 6px 16px -8px rgba(140,82,24,.20);
  --font: 'Pretendard Variable', Pretendard, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif;
  --display: var(--font);
  --nav-h: 72px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
html.big { font-size: 21px; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); min-height: 100vh; line-height: 1.45; -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(circle at 1px 1px, rgba(214,170,120,.18) 1px, transparent 0); background-size: 22px 22px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }
.display { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; letter-spacing: -.01em; }
.muted { color: var(--ink2); } .faint { color: var(--ink3); }
:focus-visible { outline: 3px solid rgba(61,139,255,.45); outline-offset: 2px; border-radius: 10px; }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 46px; padding: 0 1.1em; border-radius: 999px;
  font-weight: 700; font-size: .95rem; background: var(--card); border: 1.5px solid var(--line2); color: var(--ink); transition: transform .08s, background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { border-color: var(--ink3); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 16px -6px rgba(255,122,69,.7); }
.btn.primary:hover { background: var(--primary-d); border-color: var(--primary-d); }
.btn.soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-d); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink2); }
.btn.ghost:hover { background: rgba(0,0,0,.04); }
.btn.danger { background: #fff; border-color: #F6C9CB; color: var(--red); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.block { width: 100%; }
.btn.lg { min-height: 56px; font-size: 1.05rem; padding: 0 1.4em; }
.btn:disabled { opacity: .45; pointer-events: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; display: inline-grid; place-items: center; font-size: 1.15rem; color: var(--ink2); transition: background .15s; }
.icon-btn:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.icon-btn.on { background: var(--sun-soft); color: #8A6400; }

/* ── inputs ── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: .85rem; font-weight: 700; color: var(--ink2); }
.input, select.input, textarea.input { width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 14px; border: 1.5px solid var(--line2); background: #FFFCF8; outline: none; transition: border-color .15s, box-shadow .15s; font-size: 1rem; }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; font-size: .92rem; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255,122,69,.15); background: #fff; }
.search { position: relative; }
.search .input { padding-left: 44px; }
.search::before { content: '🔍'; position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-size: .95rem; opacity: .6; }

/* ── demo banner ── */
.demo-banner { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 8px 16px; font-weight: 700; font-size: .88rem; color: #6B4A00;
  background: repeating-linear-gradient(-45deg, #FFE27A 0 14px, #FFD84D 14px 28px); }
.demo-banner .btn { min-height: 32px; padding: 0 .9em; font-size: .8rem; background: #fff; border-color: transparent; }

/* ── top bar ── */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255,248,239,.88); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1360px; margin: 0 auto; height: var(--nav-h); padding: 0 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; }
.brand-logo { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, #FFB547, #FF7A45); display: grid; place-items: center; font-size: 1.35rem; box-shadow: 0 6px 14px -6px rgba(255,122,69,.8); flex: none; }
.brand-name { font-family: var(--display); font-size: 1.45rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; gap: 4px; background: #fff; padding: 5px; border-radius: 999px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); margin: 0 auto; }
.tab { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px; font-weight: 700; color: var(--ink2); font-size: .98rem; transition: background .15s, color .15s; }
.tab .ti { font-size: 1.15rem; }
.tab:hover { color: var(--ink); background: var(--bg); }
.tab.active { background: var(--ink); color: #fff; }
.tools { display: flex; gap: 2px; flex: none; }
.lang-btn { font-weight: 700; font-size: .8rem; width: auto; padding: 0 10px; }

/* ── bottom nav (phone) ── */
.bottom-nav { display: none; }

/* ── page ── */
main { flex: 1; }
.page { max-width: 1360px; margin: 0 auto; padding: 26px 24px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; font-size: 2.2rem; line-height: 1.1; display: flex; align-items: center; gap: 10px; }
.page-head p { color: var(--ink2); font-weight: 600; margin-top: 6px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--card); border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: var(--shadow); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: .8rem; background: rgba(255,255,255,.75); }
.empty { text-align: center; padding: 48px 20px; color: var(--ink2); font-weight: 600; }
.empty .em { font-size: 3rem; margin-bottom: 8px; }

/* ── avatar ── */
.av { --s: 40px; width: var(--s); height: var(--s); border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; color: #3A2A12;
  font-size: calc(var(--s) * .36); background-size: cover; background-position: center; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(80,50,20,.18); overflow: hidden; position: relative; letter-spacing: -.03em; }
.av.photo { color: transparent; }

/* ═══════════ LEVEL BOARD ═══════════ */
.zones { display: flex; flex-direction: column; gap: 14px; }
.zone { --zbg: #fff; --zline: #ddd; --zink: #333; --zdot: #999; background: var(--zbg); border: 2px solid var(--zline); border-radius: var(--r-lg); padding: 18px 20px 20px; transition: opacity .2s; box-shadow: var(--shadow-sm); }
.zone.collapsed { padding: 12px 20px; opacity: .62; box-shadow: none; }
.zone.collapsed:hover { opacity: .9; }
.zone-head { display: flex; align-items: center; gap: 10px; color: var(--zink); cursor: pointer; user-select: none; }
.zone-head .zdot { width: 16px; height: 16px; border-radius: 50%; background: var(--zdot); box-shadow: 0 0 0 4px rgba(255,255,255,.8); }
.zone-head .zname { font-family: var(--display); font-size: 1.55rem; }
.zone-head .zrange { font-size: .8rem; font-weight: 700; opacity: .7; }
.zone-head .zcount { margin-left: auto; background: #fff; color: var(--zink); }
.zone-head .chev { font-size: .9rem; opacity: .6; transition: transform .2s; }
.zone.collapsed .chev { transform: rotate(-90deg); }
.track { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; margin-top: 14px; }
.zone.collapsed .track { display: none; }
.cell { position: relative; min-height: 96px; border-radius: 16px; background: rgba(255,255,255,.55); border: 1.5px dashed color-mix(in srgb, var(--zline) 70%, transparent);
  padding: 8px 6px 8px; display: flex; flex-direction: column; align-items: center; text-align: center; transition: transform .2s; }
.cell .num { position: absolute; top: 6px; left: 8px; font-size: .68rem; font-weight: 700; color: var(--zink); opacity: .5; }
.cell .nm { font-weight: 700; font-size: .88rem; color: var(--zink); margin-top: 14px; line-height: 1.2; }
.cell.has { background: #fff; border-style: solid; border-color: var(--zline); box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--zdot) 80%, transparent); }
.cell .on { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 8px; }
.cell .on .av { --s: 38px; border-width: 2.5px; cursor: pointer; transition: transform .15s; }
.cell .on .av:hover { transform: scale(1.18); z-index: 3; }
.cell.pop { animation: pop .45s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

.manage { margin-top: 22px; padding: 22px; }
.manage-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.manage-head h2 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; font-size: 1.5rem; }
.manage-head .hint { color: var(--ink3); font-size: .85rem; font-weight: 600; }
.add-row { display: flex; gap: 8px; margin-left: auto; }
.add-row .input { width: 200px; min-height: 46px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mcard { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); }
.mcard .av { --s: 56px; cursor: pointer; }
.mcard .av::after { content: '✎'; position: absolute; right: -2px; bottom: -2px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.mcard .av:hover::after { opacity: 1; }
.mcard .info { flex: 1; min-width: 0; }
.mcard .nmr { font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.mcard select.input { min-height: 40px; padding: 6px 10px; font-size: .85rem; border-radius: 10px; }
.updown { display: flex; flex-direction: column; gap: 6px; }
.updown button { width: 44px; height: 38px; border-radius: 12px; font-weight: 700; font-size: 1rem; }
.updown .up { background: var(--mint-soft); color: var(--mint); }
.updown .dn { background: var(--berry-soft); color: var(--berry); }
.updown button:active { transform: scale(.94); }

/* ═══════════ STICKER BOARD ═══════════ */
.sb { display: grid; grid-template-columns: 330px 1fr; gap: 20px; align-items: start; }
.roster { padding: 14px; position: sticky; top: calc(var(--nav-h) + 16px); max-height: calc(100vh - var(--nav-h) - 40px); display: flex; flex-direction: column; }
.roster .search { margin-bottom: 10px; }
.roster-list { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin: 0 -4px; padding: 0 4px; }
.ritem { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; text-align: left; width: 100%; transition: background .12s; }
.ritem:hover { background: var(--bg); }
.ritem.active { background: var(--primary-soft); box-shadow: inset 0 0 0 2px rgba(255,122,69,.45); }
.ritem .av { --s: 44px; }
.ritem .rmid { flex: 1; min-width: 0; }
.ritem .rname { font-family: var(--display); font-size: 1.2rem; line-height: 1.15; }
.ritem .rbar { height: 6px; border-radius: 6px; background: var(--line); margin-top: 6px; overflow: hidden; }
.ritem .rbar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--sun), var(--primary)); }
.ritem .rright { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.money { font-family: var(--display); color: var(--mint); font-size: 1.15rem; }
.troph { font-size: .78rem; font-weight: 700; color: #9A6B00; }

.detail { padding: 26px 28px 28px; }
.d-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.d-head .av { --s: 84px; border-width: 4px; }
.d-name { font-family: var(--display); font-size: 2.5rem; line-height: 1; }
.d-chips { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; font-weight: 700; font-size: .95rem; }
.chip.coin { background: var(--mint-soft); color: #0E7A53; font-family: var(--display); font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; }
.chip.trophy { background: var(--sun-soft); color: #8A6400; }
.chip.lvl { background: var(--sky-soft); color: #1F5AA6; }
.d-head .del { margin-left: auto; align-self: flex-start; }
.d-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.stickers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.st { aspect-ratio: 1; border-radius: 20px; border: 2.5px dashed var(--line2); display: grid; place-items: center; font-weight: 700; color: var(--ink3); font-size: 1.15rem; background: #FFFCF7; transition: transform .1s, border-color .15s; }
.st:hover { border-color: var(--sun); }
.st:active { transform: scale(.93); }
.st.on { border: 0; background: radial-gradient(circle at 35% 30%, #FFE680, #FFC21A 55%, #F5A300); box-shadow: inset 0 -4px 0 rgba(180,110,0,.25), 0 6px 14px -6px rgba(245,163,0,.8); color: #fff; }
.st.on span { font-size: 2.3rem; line-height: 1; text-shadow: 0 2px 0 rgba(170,100,0,.35); transform: rotate(var(--rot, 0deg)); }
.st.on.new { animation: stamp .35s cubic-bezier(.3,1.6,.5,1); }
@keyframes stamp { from { transform: scale(.4) rotate(-20deg); } to { transform: scale(1); } }
.progress { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.progress .bar { flex: 1; height: 12px; border-radius: 12px; background: var(--line); overflow: hidden; }
.progress .bar i { display: block; height: 100%; border-radius: 12px; background: linear-gradient(90deg, var(--sun), var(--primary)); transition: width .35s; }
.progress b { font-family: var(--display); font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; min-width: 70px; text-align: right; }
.ctrl { display: flex; flex-direction: column; gap: 10px; }
.ctrl .lbl { font-size: .8rem; font-weight: 700; color: var(--ink3); letter-spacing: .04em; margin-top: 6px; }
.row { display: flex; gap: 8px; }
.act { flex: 1; min-height: 62px; border-radius: 18px; font-weight: 700; font-size: 1.15rem; transition: transform .08s, filter .15s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.act:active { transform: scale(.95); }
.act:hover { filter: brightness(1.04); }
.act.s-minus { background: #F3ECE3; color: var(--ink2); flex: .7; }
.act.s-plus { background: var(--sun); color: #5A3D00; box-shadow: inset 0 -4px 0 rgba(150,90,0,.2); flex: 1.6; }
.act.m-minus { background: var(--berry-soft); color: var(--berry); }
.act.m-plus { background: var(--mint-soft); color: #0E7A53; }
.act.m-big { background: var(--mint); color: #fff; box-shadow: inset 0 -4px 0 rgba(0,80,50,.2); }
.act.buy { background: var(--grape); color: #fff; box-shadow: inset 0 -4px 0 rgba(40,20,120,.25); margin-top: 6px; }
.pick-empty { padding: 80px 20px; text-align: center; color: var(--ink2); font-weight: 700; }
.pick-empty .em { font-size: 3.4rem; }

/* ═══════════ MARKET ═══════════ */
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.item { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.item .pic { height: 120px; display: grid; place-items: center; font-size: 3.6rem; background: var(--tint, var(--sun-soft)); }
.item .pic span { filter: drop-shadow(0 6px 8px rgba(90,50,10,.18)); transition: transform .2s; }
.item:hover .pic span { transform: scale(1.08) rotate(-4deg); }
.item .ib { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.item .iname { font-weight: 700; font-size: 1.08rem; line-height: 1.25; }
.item .itag { font-size: .82rem; color: var(--ink3); font-weight: 600; }
.item .irow { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; }
.price { font-family: var(--display); font-size: 1.6rem; color: var(--mint); line-height: 1; }
.stock { font-size: .8rem; font-weight: 700; color: var(--sky); background: var(--sky-soft); padding: 4px 10px; border-radius: 999px; }
.stock.inf { color: var(--ink2); background: #F3ECE3; }
.item .iact { display: flex; gap: 6px; margin-top: 12px; }
.item .iact .btn { flex: 1; min-height: 42px; }
.item .iact .icon-btn { width: 42px; height: 42px; border: 1.5px solid var(--line2); border-radius: 50%; font-size: .95rem; }
.item.out .pic { filter: grayscale(1); opacity: .6; }
.item.out .price { color: var(--ink3); }
.ribbon { position: absolute; top: 14px; right: -34px; transform: rotate(35deg); background: var(--red); color: #fff; font-weight: 700; font-size: .8rem; padding: 4px 40px; letter-spacing: .1em; }

/* ═══════════ SETTINGS ═══════════ */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.set-card { padding: 22px 24px; }
.set-card h2 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; font-size: 1.4rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.set-card .help { color: var(--ink2); font-size: .88rem; margin: -6px 0 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { min-height: 38px; padding: 0 16px; border-radius: 999px; font-weight: 700; color: var(--ink2); }
.seg button.on { background: var(--ink); color: #fff; }
.zone-edit { border: 2px solid var(--zline); background: var(--zbg); border-radius: var(--r); padding: 12px; margin-bottom: 12px; }
.zone-edit .zrow { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.zone-edit .zrow .input { min-height: 42px; }
.zone-edit .zrow select.input { width: 120px; flex: none; }
.data-btns { display: flex; flex-direction: column; gap: 10px; }
.data-btns .row { flex-wrap: wrap; }
.data-btns .row .btn { flex: 1; }
.acct { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--mint-soft); color: #0E5E41; font-weight: 700; margin-bottom: 12px; }
.acct.trial { background: var(--sun-soft); color: #6B4A00; }
.acct .em { font-size: 1.6rem; }

/* ═══════════ MODAL / TOAST ═══════════ */
.modal-back { position: fixed; inset: 0; z-index: 200; background: rgba(46,30,15,.42); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { width: 100%; max-width: 460px; max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 26px; padding: 24px; box-shadow: 0 30px 80px -20px rgba(60,30,0,.45); animation: rise .2s ease; }
.modal.wide { max-width: 560px; }
.modal h2 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; font-size: 1.6rem; margin-bottom: 6px; }
.modal .sub { color: var(--ink2); font-weight: 600; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; }
.modal-actions .btn { flex: 1; min-height: 52px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px) scale(.98); opacity: 0; } }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow: auto; margin: 0 -4px; padding: 2px 4px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; border: 2px solid var(--line); text-align: left; width: 100%; background: #fff; }
.pick:hover { border-color: var(--line2); }
.pick.sel { border-color: var(--grape); background: var(--grape-soft); }
.pick:disabled { opacity: .4; }
.pick .pe { font-size: 1.8rem; width: 44px; text-align: center; }
.pick .av { --s: 40px; }
.pick .pm { flex: 1; min-width: 0; font-weight: 700; }
.pick .pm small { display: block; font-weight: 600; color: var(--ink3); }
.after { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: var(--bg); font-weight: 700; }
.after b { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; font-size: 1.4rem; color: var(--mint); }
.after b.neg { color: var(--red); }
.log-list { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow: auto; }
.log { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--bg); }
.log .ln { font-weight: 700; }
.log .ld { font-size: .78rem; color: var(--ink3); font-weight: 600; }
.log .lr { text-align: right; font-weight: 700; }
.log .lr.cost { color: var(--red); }
.log .lr.st { color: #B07A00; }
.log .lr.done { color: var(--primary-d); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line2); }
.sw.on { box-shadow: 0 0 0 3px var(--ink); }
.photo-row { display: flex; align-items: center; gap: 14px; }
.photo-row .av { --s: 72px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; z-index: 300; background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 999px;
  font-weight: 700; font-size: 1rem; box-shadow: 0 16px 40px -12px rgba(0,0,0,.4); transition: all .25s; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.celebrate { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(circle at center, rgba(255,214,80,.45), rgba(255,122,69,.15) 45%, transparent 70%); }
.celebrate.show { opacity: 1; }
.celebrate .ce { text-align: center; }
.celebrate .ce .em { font-size: 8rem; animation: bounce .45s ease infinite alternate; }
.celebrate .ce .tx { font-family: var(--display); font-size: 3.2rem; color: #fff; -webkit-text-stroke: 2px rgba(150,70,0,.35); text-shadow: 0 6px 0 #E86A2E, 0 12px 30px rgba(120,50,0,.4); padding: 0 20px; }
@keyframes bounce { to { transform: scale(1.15) rotate(4deg); } }
.loading { min-height: 100vh; display: grid; place-items: center; font-family: var(--display); font-size: 1.4rem; color: var(--ink2); }
.loading .em { font-size: 3rem; display: block; text-align: center; animation: bounce .6s ease infinite alternate; }

/* ═══════════ AUTH ═══════════ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.hero { position: relative; overflow: hidden; padding: 56px 56px; color: #fff; display: flex; flex-direction: column; justify-content: center;
  background: radial-gradient(circle at 15% 15%, rgba(255,255,255,.25), transparent 40%), linear-gradient(150deg, #FFB547 0%, #FF8A4C 45%, #F2607E 100%); }
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); }
.hero::before { width: 420px; height: 420px; right: -140px; top: -120px; }
.hero::after { width: 260px; height: 260px; left: -80px; bottom: -90px; }
.hero-brand { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-size: 1.5rem; margin-bottom: 36px; position: relative; z-index: 1; }
.hero-brand .brand-logo { background: #fff; box-shadow: none; }
.hero h1 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; font-size: 3.1rem; line-height: 1.12; position: relative; z-index: 1; text-shadow: 0 3px 0 rgba(150,50,0,.18); }
.hero .lead { font-size: 1.12rem; font-weight: 600; margin-top: 14px; opacity: .95; white-space: pre-line; position: relative; z-index: 1; }
.feat { list-style: none; margin-top: 28px; display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 1; }
.feat li { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.02rem; }
.feat li i { font-style: normal; width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.22); display: grid; place-items: center; font-size: 1.2rem; }
.mock { position: relative; z-index: 1; margin-top: 34px; background: rgba(255,255,255,.95); border-radius: 22px; padding: 16px 18px; color: var(--ink); max-width: 430px; box-shadow: 0 24px 50px -20px rgba(120,30,0,.55); transform: rotate(-2deg); }
.mock .mh { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mock .mh .av { --s: 40px; }
.mock .mh b { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; font-size: 1.3rem; }
.mock .mh .chip { margin-left: auto; height: 30px; }
.mock .ms { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.mock .ms .st { border-radius: 12px; font-size: .8rem; border-width: 2px; }
.mock .ms .st.on span { font-size: 1.3rem; }
.auth-side { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; padding: 30px 30px 26px; }
.auth-card h2 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; font-size: 1.9rem; margin-bottom: 4px; }
.auth-tabs { display: flex; background: var(--bg); border-radius: 999px; padding: 5px; margin-bottom: 22px; border: 1px solid var(--line); }
.auth-tabs button { flex: 1; height: 44px; border-radius: 999px; font-weight: 700; color: var(--ink2); }
.auth-tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink3); font-weight: 700; font-size: .85rem; margin: 18px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line2); }
.note { margin-top: 14px; padding: 12px 14px; border-radius: 14px; font-size: .86rem; font-weight: 600; line-height: 1.5; }
.note.info { background: var(--sky-soft); color: #1F4F8F; }
.note.ok { background: var(--mint-soft); color: #0E5E41; }
.note.err { background: #FDE7E8; color: #A3262B; }
.note.warn { background: var(--sun-soft); color: #6B4A00; }
.linkish { color: var(--ink2); font-weight: 700; font-size: .88rem; text-decoration: underline; text-underline-offset: 3px; }
.trial-badge { text-align: center; margin-top: 14px; font-size: .88rem; font-weight: 700; color: var(--primary-d); }
.expired { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.expired .card { max-width: 520px; width: 100%; padding: 40px 34px; text-align: center; }
.expired .em { font-size: 4.5rem; }
.expired h1 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; font-size: 2.3rem; margin: 10px 0; }
.expired p { color: var(--ink2); font-weight: 600; white-space: pre-line; }
.expired .btns { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 1180px) {
  .d-body { grid-template-columns: minmax(0, 1fr); }
  .sb { grid-template-columns: 290px 1fr; }
  .tab { padding: 0 14px; }
}
@media (max-width: 980px) {
  .tabs .tab span.tl { display: none; }
  .tab { padding: 0 16px; }
  .set-grid { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .hero { padding: 36px 28px 40px; }
  .mock { display: none; }
}
@media (max-width: 760px) {
  html { font-size: 16px; } html.big { font-size: 19px; }
  :root { --nav-h: 60px; }
  .topbar-in { padding: 0 14px; gap: 8px; }
  .brand-logo { width: 38px; height: 38px; font-size: 1.15rem; border-radius: 12px; }
  .brand-name { font-size: 1.2rem; }
  .tabs { display: none; }
  .tools { margin-left: auto; }
  .tools .icon-btn { width: 40px; height: 40px; }
  .tools .hide-sm { display: none; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 14px; font-size: .72rem; font-weight: 700; color: var(--ink3); }
  .bottom-nav button .ti { font-size: 1.35rem; filter: grayscale(.6); opacity: .8; }
  .bottom-nav button.active { color: var(--ink); background: var(--primary-soft); }
  .bottom-nav button.active .ti { filter: none; opacity: 1; }
  main { padding-bottom: 84px; }
  .page { padding: 16px 14px 28px; }
  .page-head { margin-bottom: 14px; align-items: flex-start; }
  .page-head h1 { font-size: 1.7rem; }
  .page-head p { font-size: .9rem; margin-top: 4px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; min-height: 42px; padding: 0 .7em; font-size: .85rem; }
  .zone { padding: 14px; border-radius: 20px; }
  .zone-head .zname { font-size: 1.3rem; }
  .track { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cell { min-height: 84px; }
  .cell .nm { font-size: .78rem; }
  .cell .on .av { --s: 32px; }
  .add-row { width: 100%; margin-left: 0; } .add-row .input { flex: 1; width: auto; min-width: 0; } .add-row .btn { flex: none; white-space: nowrap; }
  .mgrid { grid-template-columns: 1fr; }
  .sb { grid-template-columns: 1fr; gap: 12px; }
  .roster { position: static; max-height: none; padding: 10px; }
  .roster .search { display: none; }
  .roster-list { flex-direction: row; overflow-x: auto; gap: 6px; scroll-snap-type: x proximity; padding-bottom: 4px; }
  .ritem { flex-direction: column; width: 78px; flex: none; padding: 8px 4px; gap: 4px; text-align: center; scroll-snap-align: start; }
  .ritem .av { --s: 46px; }
  .ritem .rname { font-size: .95rem; }
  .ritem .rbar, .ritem .troph { display: none; }
  .ritem .rmid { width: 100%; }
  .ritem .rright { align-items: center; }
  .ritem .money { font-size: .95rem; }
  .detail { padding: 16px; }
  .d-head { gap: 12px; margin-bottom: 14px; }
  .d-head .av { --s: 60px; border-width: 3px; }
  .d-name { font-size: 1.8rem; }
  .chip { height: 30px; padding: 0 10px; font-size: .82rem; } .chip.coin { font-size: 1.05rem; }
  .stickers { gap: 7px; }
  .st { border-radius: 14px; font-size: .9rem; }
  .st.on span { font-size: 1.6rem; }
  .act { min-height: 54px; font-size: 1.02rem; border-radius: 16px; }
  .mk-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .item .pic { height: 92px; font-size: 2.8rem; }
  .item .ib { padding: 10px 12px 12px; }
  .item .iname { font-size: .95rem; }
  .price { font-size: 1.35rem; }
  .item .iact .btn { min-height: 38px; font-size: .85rem; padding: 0 .5em; }
  .item .iact .icon-btn { width: 38px; height: 38px; }
  .ribbon { font-size: .7rem; top: 10px; right: -38px; }
  .two { grid-template-columns: 1fr; }
  .modal-back { place-items: end center; padding: 0; }
  .modal { border-radius: 26px 26px 0 0; max-height: 92vh; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); }
  .hero { padding: 28px 22px 30px; }
  .hero-brand { margin-bottom: 18px; font-size: 1.25rem; }
  .hero h1 { font-size: 2.05rem; }
  .hero .lead { font-size: .95rem; }
  .feat { display: none; }
  .auth-side { padding: 0 14px 30px; margin-top: -18px; position: relative; z-index: 2; }
  .auth-card { padding: 22px 20px; }
  .celebrate .ce .tx { font-size: 2rem; }
  .celebrate .ce .em { font-size: 5rem; }
  .toast { bottom: 96px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* overflow guards */
.sb > *, .d-body > *, .page > * { min-width: 0; }
@media (max-width: 760px) { .sb { grid-template-columns: minmax(0, 1fr); } .d-body { grid-template-columns: minmax(0, 1fr); } }
html, body { overflow-x: clip; }
.btn { max-width: 100%; }

/* ── typography: Pretendard ── */
body { font-weight: 500; letter-spacing: -.005em; font-feature-settings: 'ss06'; }
h1, h2, h3, .display, .brand-name, .d-name, .zname, .rname, .iname { letter-spacing: -.02em; font-weight: 700; }
.money, .price, .chip.coin, .progress b, .st, .cell, .stock, .troph, .zone-head, .mock { font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink2); margin: 4px 0 8px; cursor: pointer; } .check input { width: 20px; height: 20px; accent-color: var(--primary); }

/* ═══════════════════════════════════════════════
   THEME · 중고등 (차분한)  html[data-theme=teen]
   ═══════════════════════════════════════════════ */
html[data-theme=teen] {
  --bg: #F4F5F7; --bg2: #ECEEF2; --card: #FFFFFF; --ink: #1B2431; --ink2: #545F6E; --ink3: #8B95A3; --line: #E2E6EB; --line2: #CFD6DE;
  --primary: #24395A; --primary-d: #192A44; --primary-soft: #E6EBF3;
  --sun: #24395A; --sun-soft: #EEF1F5; --mint: #2E6E57; --mint-soft: #E3EFEA; --sky: #3B6492; --sky-soft: #E8EEF5;
  --berry: #9A4A58; --berry-soft: #F4E9EB; --grape: #24395A; --grape-soft: #E6EBF3; --red: #B0433B;
  --r-lg: 10px; --r: 8px; --r-sm: 6px;
  --shadow: 0 1px 2px rgba(20,30,45,.05), 0 1px 0 rgba(20,30,45,.03);
  --shadow-sm: 0 1px 2px rgba(20,30,45,.05);
}
html[data-theme=teen] body { background-image: none; }
html[data-theme=teen] .ico { width: 1.15em; height: 1.15em; display: block; }
html[data-theme=teen] .btn, html[data-theme=teen] .tabs, html[data-theme=teen] .tab, html[data-theme=teen] .seg, html[data-theme=teen] .seg button,
html[data-theme=teen] .chip, html[data-theme=teen] .stock, html[data-theme=teen] .pill, html[data-theme=teen] .toast, html[data-theme=teen] .auth-tabs, html[data-theme=teen] .auth-tabs button { border-radius: 7px; }
html[data-theme=teen] .btn { font-weight: 600; box-shadow: none; border-width: 1px; }
html[data-theme=teen] .btn.primary { box-shadow: none; }
html[data-theme=teen] .icon-btn { border-radius: 7px; color: var(--ink2); }
html[data-theme=teen] .icon-btn.on { background: var(--primary-soft); color: var(--primary); }
html[data-theme=teen] .input, html[data-theme=teen] select.input, html[data-theme=teen] textarea.input { border-radius: 7px; border-width: 1px; background: #fff; }
html[data-theme=teen] .input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(36,57,90,.12); }
html[data-theme=teen] .search::before { content: ''; width: 14px; height: 14px; border: 1.6px solid var(--ink3); border-radius: 50%; opacity: 1; left: 16px; margin-top: -1px; }
html[data-theme=teen] .demo-banner { background: #1B2431; color: #DCE2EA; font-weight: 600; }
html[data-theme=teen] .demo-banner .btn { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.18); }
html[data-theme=teen] .topbar { background: rgba(255,255,255,.92); }
html[data-theme=teen] .brand-logo { background: var(--primary); color: #fff; border-radius: 8px; box-shadow: none; font-size: 1.15rem; font-weight: 700; width: 40px; height: 40px; }
html[data-theme=teen] .brand-name { font-size: 1.25rem; font-weight: 700; }
html[data-theme=teen] .tabs { box-shadow: none; padding: 4px; background: var(--bg); }
html[data-theme=teen] .tab { height: 42px; padding: 0 16px; font-weight: 600; }
html[data-theme=teen] .tab.active { background: #fff; color: var(--primary); box-shadow: 0 1px 2px rgba(20,30,45,.12); }
html[data-theme=teen] .tab .ti { color: currentColor; }
html[data-theme=teen] .page-head h1 { font-size: 1.85rem; }
html[data-theme=teen] .page-head p { font-weight: 500; }
html[data-theme=teen] .card { box-shadow: var(--shadow); }
html[data-theme=teen] .em, html[data-theme=teen] .pick .pe, html[data-theme=teen] .feat li i, html[data-theme=teen] .acct .em { display: none; }
html[data-theme=teen] .av { border-width: 2px; box-shadow: none; filter: saturate(.55); }
html[data-theme=teen] .av.photo { filter: none; }
/* level */
html[data-theme=teen] .zone { background: #fff !important; border: 1px solid var(--line) !important; border-left: 4px solid var(--zdot) !important; border-radius: var(--r-lg); box-shadow: var(--shadow); }
html[data-theme=teen] .zone-head { color: var(--ink) !important; }
html[data-theme=teen] .zone-head .zname { font-size: 1.25rem; }
html[data-theme=teen] .zone-head .zdot { width: 10px; height: 10px; box-shadow: none; filter: saturate(.5); }
html[data-theme=teen] .zone-head .zcount { background: var(--bg); color: var(--ink2); }
html[data-theme=teen] .cell { border-radius: 6px; background: var(--bg); border: 1px solid transparent; min-height: 84px; }
html[data-theme=teen] .cell .nm, html[data-theme=teen] .cell .num { color: var(--ink2); }
html[data-theme=teen] .cell .nm { font-weight: 600; }
html[data-theme=teen] .cell.has { background: #fff; border: 1px solid var(--line2); box-shadow: none; }
html[data-theme=teen] .cell.has .nm { color: var(--ink); }
html[data-theme=teen] .cell .on .av { --s: 34px; }
html[data-theme=teen] .mcard { border-radius: 8px; background: #fff; }
html[data-theme=teen] .updown button { border-radius: 6px; }
html[data-theme=teen] .updown .up { background: var(--mint-soft); color: var(--mint); }
html[data-theme=teen] .updown .dn { background: var(--bg); color: var(--ink2); }
/* points */
html[data-theme=teen] .ritem { border-radius: 7px; }
html[data-theme=teen] .ritem.active { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
html[data-theme=teen] .ritem .rname, html[data-theme=teen] .d-name { font-weight: 700; }
html[data-theme=teen] .ritem .rname { font-size: 1.05rem; }
html[data-theme=teen] .d-name { font-size: 2rem; }
html[data-theme=teen] .rbar i, html[data-theme=teen] .progress .bar i { background: var(--primary); }
html[data-theme=teen] .rbar, html[data-theme=teen] .progress .bar { height: 6px; }
html[data-theme=teen] .money, html[data-theme=teen] .price { color: var(--mint); font-weight: 700; }
html[data-theme=teen] .troph { color: var(--ink3); }
html[data-theme=teen] .chip { height: 30px; font-size: .85rem; font-weight: 600; }
html[data-theme=teen] .chip.coin { background: var(--mint-soft); color: var(--mint); font-size: 1rem; }
html[data-theme=teen] .chip.trophy { background: var(--bg); color: var(--ink2); }
html[data-theme=teen] .chip.lvl { background: var(--sky-soft); color: var(--sky); }
html[data-theme=teen] .st { border-radius: 6px; border: 1px solid var(--line2); background: #fff; color: var(--ink3); font-weight: 600; }
html[data-theme=teen] .st:hover { border-color: var(--primary); }
html[data-theme=teen] .st.on { background: var(--primary); box-shadow: none; color: #fff; border: 0; }
html[data-theme=teen] .st.on .ico { width: 46%; height: 46%; stroke-width: 2.2; }
html[data-theme=teen] .st.on.new { animation: fadein .25s ease; }
@keyframes fadein { from { opacity: .3; } }
html[data-theme=teen] .act { border-radius: 8px; font-weight: 600; min-height: 56px; box-shadow: none !important; }
html[data-theme=teen] .act.s-minus { background: var(--bg); color: var(--ink2); }
html[data-theme=teen] .act.s-plus { background: var(--primary); color: #fff; }
html[data-theme=teen] .act.m-minus { background: var(--berry-soft); color: var(--berry); }
html[data-theme=teen] .act.m-plus { background: var(--mint-soft); color: var(--mint); }
html[data-theme=teen] .act.m-big { background: var(--mint); color: #fff; }
html[data-theme=teen] .act.buy { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
html[data-theme=teen] .ctrl .lbl { letter-spacing: .06em; text-transform: uppercase; }
/* market */
html[data-theme=teen] .item .pic { height: 96px; background: var(--bg) !important; border-bottom: 1px solid var(--line); }
html[data-theme=teen] .item .pic .mono { width: 52px; height: 52px; border-radius: 8px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line2); color: var(--primary); font-size: 1.4rem; font-weight: 700; }
html[data-theme=teen] .item .iname { font-weight: 700; font-size: 1.02rem; }
html[data-theme=teen] .item .iact .btn .ico { width: 1.05em; height: 1.05em; }
html[data-theme=teen] .item .iact .icon-btn { border-radius: 7px; border-width: 1px; }
html[data-theme=teen] .stock { background: var(--bg); color: var(--ink2); font-weight: 600; }
html[data-theme=teen] .ribbon { background: var(--ink2); font-weight: 600; letter-spacing: .04em; }
/* settings / modal */
html[data-theme=teen] .seg button.on { background: var(--primary); }
html[data-theme=teen] .modal { border-radius: 12px; box-shadow: 0 20px 50px -20px rgba(15,25,40,.35); }
html[data-theme=teen] .modal-back { background: rgba(15,22,32,.45); }
html[data-theme=teen] .pick { border-radius: 8px; border-width: 1px; }
html[data-theme=teen] .pick.sel { border-color: var(--primary); background: var(--primary-soft); }
html[data-theme=teen] .log, html[data-theme=teen] .after, html[data-theme=teen] .acct { border-radius: 8px; }
html[data-theme=teen] .log .lr.st { color: var(--primary); }
html[data-theme=teen] .log .lr.done { color: var(--mint); }
html[data-theme=teen] .sw { border-radius: 6px; }
/* calm celebration: small check card */
html[data-theme=teen] .celebrate { background: rgba(244,245,247,.35); }
html[data-theme=teen] .celebrate .ce { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 22px 30px; box-shadow: 0 20px 50px -20px rgba(15,25,40,.35); display: flex; align-items: center; gap: 14px; }
html[data-theme=teen] .celebrate .ce .em { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--mint); color: #fff; font-size: 1rem; animation: none; }
html[data-theme=teen] .celebrate .ce .em .ico { width: 24px; height: 24px; stroke-width: 2.4; }
html[data-theme=teen] .celebrate .ce .tx { font-size: 1.35rem; color: var(--ink); -webkit-text-stroke: 0; text-shadow: none; padding: 0; font-weight: 700; }
@media (max-width: 760px) {
  html[data-theme=teen] .bottom-nav button { border-radius: 8px; font-weight: 600; }
  html[data-theme=teen] .bottom-nav button .ti { filter: none; opacity: .7; display: grid; place-items: center; height: 1.5rem; }
  html[data-theme=teen] .bottom-nav button .ti .ico { width: 1.3rem; height: 1.3rem; }
  html[data-theme=teen] .bottom-nav button.active { color: var(--primary); background: var(--primary-soft); }
  html[data-theme=teen] .bottom-nav button.active .ti { opacity: 1; }
  html[data-theme=teen] .d-name { font-size: 1.6rem; }
  html[data-theme=teen] .item .pic { height: 76px; }
}
html[data-theme=teen] .d-chips .chip:not(.coin):not(.trophy) { background: var(--sky-soft) !important; color: var(--sky) !important; }
@media (max-width: 760px) {
  .demo-banner { gap: 6px 8px; padding: 6px 10px; font-size: .78rem; }
  .demo-banner .btn { min-height: 28px; font-size: .74rem; padding: 0 .7em; }
}
html[data-theme=teen] .chip.lvl { background: var(--sky-soft) !important; color: var(--sky) !important; }

/* ═══════════ 오늘 체크 (출석 · 숙제) ═══════════ */
.ck-tabs { display: inline-flex; padding: 4px; gap: 4px; background: var(--bg2); border-radius: 999px; }
.ck-tabs button { min-height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 700; color: var(--ink2); }
.ck-tabs button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.ck-bar { padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
.ck-date { display: flex; align-items: center; gap: 6px; }
.ck-date .icon-btn { font-size: 1.6rem; font-weight: 700; }
.ck-date .icon-btn:disabled { opacity: .3; pointer-events: none; }
.ck-dlabel { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line2); background: #FFFCF8; cursor: pointer; }
.ck-dlabel b { font-family: var(--display); font-size: 1.1rem; letter-spacing: -.01em; white-space: nowrap; }
.ck-dlabel input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.ck-dlabel input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.btn.sm { min-height: 38px; padding: 0 .9em; font-size: .85rem; }
.today-pill { background: var(--primary-soft); color: var(--primary-d); }
.ck-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.ck-sum { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; font-size: .82rem; font-weight: 700; color: var(--ink2); }
.ck-sum .s { padding: 4px 10px; border-radius: 999px; background: var(--bg2); }
.ck-sum .s b { font-variant-numeric: tabular-nums; margin-left: 2px; color: var(--ink); }
.ck-sum .s.g { background: var(--mint-soft); } .ck-sum .s.y { background: var(--sun-soft); } .ck-sum .s.r { background: var(--berry-soft); }
.ck-sum .sep { width: 1px; background: var(--line2); margin: 0 4px; }
.ck-list { display: grid; gap: 8px; }
.ck-row { display: grid; grid-template-columns: minmax(150px, 1fr) auto auto; align-items: center; gap: 10px 20px; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.ck-row.absent { background: #FFF6F7; }
.ck-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ck-name { font-weight: 800; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-grp { display: flex; align-items: center; gap: 4px; }
.ck-lbl { font-size: .74rem; font-weight: 800; color: var(--ink3); min-width: 2.6em; margin-right: 2px; flex: none; white-space: nowrap; }
.ckb { min-width: 64px; min-height: 42px; padding: 0 10px; border-radius: 12px; border: 1.5px solid var(--line2); background: #fff; font-weight: 700; font-size: .88rem; color: var(--ink2); transition: background .12s, border-color .12s, transform .08s; }
.ckb:active { transform: scale(.95); }
.ckb.on.g { background: var(--mint); border-color: var(--mint); color: #fff; }
.ckb.on.y { background: #F2A900; border-color: #F2A900; color: #fff; }
.ckb.on.r { background: var(--berry); border-color: var(--berry); color: #fff; }
.ckb.on.n { background: var(--ink3); border-color: var(--ink3); color: #fff; }

.ck-month { padding: 14px; }
.ck-mnav { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.ck-mnav b { font-family: var(--display); font-size: 1.25rem; min-width: 7.5em; text-align: center; }
.ck-mnav .icon-btn { font-size: 1.6rem; font-weight: 700; } .ck-mnav .icon-btn:disabled { opacity: .3; pointer-events: none; }
.ck-mnav .btn { margin-left: auto; }
.ck-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; font-weight: 700; color: var(--ink2); margin-bottom: 10px; align-items: center; }
.ck-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ck-legend .lg { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.ck-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r-sm); }
.ck-table { border-collapse: separate; border-spacing: 0; font-size: .82rem; min-width: 100%; }
.ck-table th, .ck-table td { border-bottom: 1px solid var(--line); text-align: center; }
.ck-table thead th { background: var(--bg2); font-weight: 800; color: var(--ink2); padding: 6px 2px; position: sticky; top: 0; }
.ck-table th.d { min-width: 28px; font-variant-numeric: tabular-nums; } .ck-table th.d small { display: block; font-size: .66rem; font-weight: 600; color: var(--ink3); }
.ck-table th.we, .ck-table td.we { background-color: rgba(0,0,0,.025); }
.ck-table th.td { color: var(--primary-d); box-shadow: inset 0 -3px 0 var(--primary); }
.ck-table .nm { position: sticky; left: 0; z-index: 2; background: var(--card); text-align: left; padding: 8px 10px; font-weight: 800; white-space: nowrap; min-width: 76px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--line); }
.ck-table thead .nm { background: var(--bg2); z-index: 3; }
.ck-table .rt { padding: 4px 8px; white-space: nowrap; font-variant-numeric: tabular-nums; border-right: 1px solid var(--line); }
.ck-table td.rt b { display: block; font-size: .9rem; } .ck-table td.rt small { color: var(--ink3); font-size: .7rem; } .ck-table td.rt.none { color: var(--ink3); }
.ck-table td.c { height: 38px; position: relative; cursor: pointer; border-right: 1px solid rgba(0,0,0,.03); }
.ck-table td.c:hover { outline: 2px solid var(--sky); outline-offset: -2px; }
.a-present { background: #CFF1E2 !important; } .a-late { background: #FFE6A3 !important; } .a-absent { background: #FFC9D6 !important; }
.ck-table i, .ck-legend i.hd, .ck-legend i.hm { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.ck-table td.c i { position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%); }
i.hd { background: var(--mint); } i.hm { background: var(--berry); border: 0; } i.hn { background: transparent; border: 1.5px solid var(--ink3); width: 7px !important; height: 7px !important; }

/* ═══════════ 공유 카드 모달 ═══════════ */
.modal.share-modal { max-width: 920px; }
.share-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; margin-top: 10px; }
.share-img { position: relative; aspect-ratio: 1080 / 1350; max-height: 66vh; margin: 0 auto; border-radius: 14px; overflow: hidden; background: var(--bg2); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.share-img img { width: 100%; height: 100%; object-fit: contain; }
.share-wait { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; color: var(--ink2); background: rgba(255,255,255,.55); }
.share-wait[hidden] { display: none; }
.share-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.share-side .field { margin-bottom: 0; }
.share-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-msg textarea.input { min-height: 150px; font-size: .9rem; }
.share-month { display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--bg2); border-radius: 14px; padding: 2px; }
.share-month b { font-family: var(--display); font-size: 1.1rem; min-width: 7em; text-align: center; }
.share-month .icon-btn { font-size: 1.5rem; font-weight: 700; } .share-month .icon-btn:disabled { opacity: .3; pointer-events: none; }
.share-side textarea[data-comment] { min-height: 64px; }
.tone { display: flex; gap: 4px; padding: 3px; background: var(--bg2); border-radius: 12px; }
.tone button { flex: 1; min-height: 36px; border-radius: 9px; font-weight: 700; font-size: .85rem; color: var(--ink2); }
.tone button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.share-row { margin-top: 10px; }
.share-row .btn { flex: 1; }
.mshare { width: 38px; height: 38px; font-size: 1rem; flex: none; }
.d-share { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.d-share .btn { min-height: 40px; font-size: .88rem; }

/* 레벨업 후 '축하 카드 만들기' 제안 */
.act-toast { position: fixed; left: 50%; bottom: 92px; z-index: 260; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 10px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line2); border-radius: 18px; padding: 10px 10px 10px 18px; box-shadow: 0 18px 40px -14px rgba(0,0,0,.35); transition: opacity .2s, transform .2s; max-width: calc(100vw - 24px); }
.act-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.act-toast .at-msg { font-weight: 700; font-size: .92rem; }
.act-toast .btn { min-height: 42px; font-size: .88rem; }
.act-toast .at-x { width: 34px; height: 34px; border-radius: 10px; color: var(--ink3); }

/* 선물 채우기 */
.gift-soon { text-align: center; padding: 22px 8px 8px; }
.gift-soon .gi { font-size: 3rem; display: grid; place-items: center; margin-bottom: 8px; color: var(--primary); }
.gift-soon .gi .ico { width: 48px; height: 48px; }
.gift-soon b { font-family: var(--display); font-size: 1.25rem; display: block; margin-bottom: 6px; }
.gift-soon p { color: var(--ink2); font-weight: 600; }
.gift-list { display: grid; gap: 8px; margin-top: 10px; }
.gift { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: inherit; }
.gift:hover { border-color: var(--ink3); }
.gift .ge { font-size: 1.6rem; } .gift .gm { flex: 1; min-width: 0; display: flex; flex-direction: column; } .gift .gm small { color: var(--ink2); }
.gift .gp { font-weight: 800; } .gift .go { font-weight: 700; color: var(--primary-d); font-size: .85rem; }
.gift-disc { margin-top: 12px; font-size: .78rem; color: var(--ink3); font-weight: 600; }
.field-help { display: block; font-size: .78rem; font-weight: 600; }

@media (max-width: 980px) {
  .ck-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ck-row .ck-who { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .ck-bar { padding: 12px; gap: 10px; }
  .ck-date { width: 100%; } .ck-dlabel { flex: 1; justify-content: center; }
  .ck-quick { margin-left: 0; width: 100%; } .ck-quick .btn { flex: 1; min-height: 44px; padding: 0 .6em; font-size: .88rem; }
  .ck-row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px 12px; }
  .ck-grp { width: 100%; } .ckb { flex: 1; min-width: 0; padding: 0 4px; }
  .ck-who .av { --s: 32px !important; }
  .ck-mnav b { min-width: 0; flex: 1; }
  .ck-mnav .btn { margin-left: 0; width: 100%; }
  .share-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .share-img { max-height: 48vh; }
  .act-toast { top: calc(10px + env(safe-area-inset-top)); bottom: auto; left: 12px; right: 12px; transform: translateY(-30px); flex-wrap: wrap; }
  .act-toast.show { transform: translateY(0); }
  .act-toast .at-msg { flex: 1 1 100%; } .act-toast .btn { flex: 1; }
}

/* 중고등 테마 */
html[data-theme=teen] .ck-tabs, html[data-theme=teen] .ck-tabs button, html[data-theme=teen] .tone, html[data-theme=teen] .tone button, html[data-theme=teen] .ckb,
html[data-theme=teen] .ck-dlabel, html[data-theme=teen] .ck-sum .s, html[data-theme=teen] .share-month, html[data-theme=teen] .share-img, html[data-theme=teen] .act-toast { border-radius: 6px; }
html[data-theme=teen] .ckb { border-width: 1px; font-weight: 600; }
html[data-theme=teen] .ckb.on.g { background: #2E6E57; border-color: #2E6E57; }
html[data-theme=teen] .ckb.on.y { background: #A07A1E; border-color: #A07A1E; }
html[data-theme=teen] .ckb.on.r { background: #9A4A58; border-color: #9A4A58; }
html[data-theme=teen] .ckb.on.n { background: #6B7684; border-color: #6B7684; }
html[data-theme=teen] .ck-row.absent { background: #FAF5F6; }
html[data-theme=teen] .a-present { background: #D6E7DF !important; } html[data-theme=teen] .a-late { background: #EFE2BF !important; } html[data-theme=teen] .a-absent { background: #EBD3D8 !important; }
html[data-theme=teen] .ck-dlabel, html[data-theme=teen] .ckb { background: #fff; }
html[data-theme=teen] .ck-quick .ico, html[data-theme=teen] .share-side .ico, html[data-theme=teen] .d-share .ico, html[data-theme=teen] .share-row .ico, html[data-theme=teen] .gift-btn .ico { width: 1.05em; height: 1.05em; }
.ck-table td.c.fu { cursor: default; background-image: repeating-linear-gradient(45deg, transparent 0 5px, rgba(0,0,0,.025) 5px 6px); }
.ck-table td.c.fu:hover { outline: none; }

/* ═══════════ 약관 · 개인정보처리방침 · 가입 동의 ═══════════ */
.legal-links { text-align: center; margin-top: 18px; font-size: .82rem; font-weight: 600; color: var(--ink3); }
.legal-links a { color: var(--ink2); text-decoration: underline; text-underline-offset: 3px; }
.legal-links a:hover { color: var(--ink); }
.set-footer { margin-top: 26px; padding-bottom: 8px; }
.consent { word-break: keep-all; display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--bg); border: 1.5px solid var(--line); font-size: .88rem; font-weight: 600; color: var(--ink2); line-height: 1.5; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--primary); cursor: pointer; }
.consent a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.consent.need { border-color: var(--primary); }
.age-note { word-break: keep-all; margin: -4px 0 12px; font-size: .82rem; font-weight: 600; color: var(--ink3); line-height: 1.5; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.legal-page { max-width: 820px; margin: 0 auto; padding: 22px 18px 60px; }
.legal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.legal-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.legal-brand .brand-logo { width: 36px; height: 36px; font-size: 1.05rem; border-radius: 11px; }
.legal-back { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line2); font-weight: 700; font-size: .88rem; color: var(--ink2); text-decoration: none; white-space: nowrap; }
.legal-back:hover { border-color: var(--ink3); color: var(--ink); }
.legal { padding: 34px 38px; line-height: 1.75; font-size: .96rem; color: var(--ink); word-break: keep-all; overflow-wrap: anywhere; }
.legal h1 { font-weight: 800; letter-spacing: -.02em; font-size: 1.9rem; line-height: 1.25; }
.legal .meta { color: var(--ink3); font-weight: 600; font-size: .88rem; margin: 6px 0 18px; }
.legal .lead { color: var(--ink2); margin-bottom: 8px; }
.legal h2 { font-weight: 800; letter-spacing: -.01em; font-size: 1.18rem; margin: 30px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.legal h3 { font-weight: 700; font-size: 1rem; margin: 16px 0 6px; }
.legal p { margin: 8px 0; }
.legal ul, .legal ol { margin: 8px 0 8px 1.3em; }
.legal li { margin: 4px 0; }
.legal a { color: var(--primary-d); text-decoration: underline; text-underline-offset: 3px; }
.legal b, .legal strong { font-weight: 700; }
.legal .toc { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; margin: 14px 0 6px; }
.legal .toc ol { margin: 4px 0 0 1.3em; columns: 2; column-gap: 28px; font-size: .9rem; }
.legal .toc a { color: var(--ink2); text-decoration: none; }
.legal .toc a:hover { text-decoration: underline; }
.legal .box { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; margin: 12px 0; }
.legal .box.tip { background: var(--mint-soft); border-color: #BFE9D6; }
.legal .tbl { width: 100%; overflow-x: auto; margin: 10px 0; border: 1px solid var(--line); border-radius: 14px; }
.legal table { width: 100%; border-collapse: collapse; font-size: .88rem; line-height: 1.6; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.legal th { background: var(--bg); font-weight: 700; color: var(--ink2); white-space: nowrap; }
.legal tr:last-child td { border-bottom: 0; }
.legal dl.kv { display: grid; grid-template-columns: 8.5em 1fr; gap: 6px 14px; margin: 10px 0; font-size: .9rem; }
.legal dl.kv dt { color: var(--ink2); font-weight: 700; }
.legal .contact-line { font-weight: 700; }
.legal-foot { text-align: center; margin-top: 22px; font-size: .84rem; color: var(--ink3); font-weight: 600; }
.legal-foot a { color: var(--ink2); }
@media (max-width: 600px) {
  .legal-page { padding: 14px 12px 40px; }
  .legal { padding: 22px 18px; font-size: .94rem; line-height: 1.7; border-radius: 20px; }
  .legal h1 { font-size: 1.55rem; }
  .legal h2 { font-size: 1.08rem; }
  .legal .toc ol { columns: 1; }
  .legal dl.kv { grid-template-columns: 1fr; gap: 2px; }
  .legal dl.kv dd { margin-bottom: 8px; }
  .legal-brand span.nm { display: none; }
  .legal table.stack thead { display: none; }
  .legal table.stack, .legal table.stack tbody, .legal table.stack tr, .legal table.stack td { display: block; width: 100%; }
  .legal table.stack tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .legal table.stack tr:last-child { border-bottom: 0; }
  .legal table.stack td { border: 0; padding: 4px 12px; }
  .legal table.stack td::before { content: attr(data-th); display: block; font-size: .76rem; font-weight: 700; color: var(--ink3); }
  .legal table.stack td:first-child { font-weight: 800; color: var(--ink); padding-top: 6px; }
  .legal table.stack td:first-child::before { display: none; }
}
@media print { body { background: #fff; } .legal-top, .legal-foot { display: none; } .legal { box-shadow: none; border: 0; padding: 0; } }
