:root{
  --bg:#ffffff; --bg2:#f7f7f8; --ink:#212124; --sub:#868b94; --line:#eceef1; --line2:#dcdfe4;
  --orange:#ff6f0f; --orange-bg:#fff3ea; --green:#1f9d55; --green-bg:#e9f8ef; --blue:#2c6ef2; --blue-bg:#edf3ff;
  --font:Pretendard,'Pretendard Variable','Apple SD Gothic Neo','Noto Sans KR','Malgun Gothic',system-ui,sans-serif;
  --r:12px; --maxw:680px; --top:56px; --tab:60px;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#17181c; --bg2:#1f2126; --ink:#ececec; --sub:#8f949c; --line:#2a2d33; --line2:#3a3e46;
    --orange:#ff7a24; --orange-bg:#33200f; --green:#4fc27c; --green-bg:#17301f; --blue:#7aa2ff; --blue-bg:#1b2742;
    color-scheme:dark;
  }
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink)}
body{font-family:var(--font);font-size:15px;line-height:1.55;word-break:keep-all;-webkit-text-size-adjust:100%;
  padding-top:var(--top);padding-bottom:calc(var(--tab) + env(safe-area-inset-bottom))}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit;color:inherit}
input,select,textarea{width:100%;background:var(--bg2);border:1px solid var(--line);border-radius:10px;padding:11px 12px;font-size:16px;outline:none}
input:focus,select:focus,textarea:focus{border-color:var(--ink)}
textarea{min-height:120px;resize:vertical;line-height:1.5}
:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
[hidden]{display:none !important}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--line2);background:var(--bg);
  border-radius:10px;padding:0 16px;height:44px;font-weight:600;cursor:pointer;white-space:nowrap}
.btn.primary{background:var(--orange);border-color:var(--orange);color:#fff}
.btn.small{height:34px;padding:0 12px;font-size:14px}
.btn.block{width:100%}
.btn:disabled{opacity:.45;cursor:default}
.top .aio{display:inline-flex;padding:4px;border-radius:8px}
.top .aio img{display:block;width:28px;height:28px;border-radius:7px}
.foot{max-width:var(--maxw);margin:0 auto;padding:24px 16px 20px;font-size:12px;color:var(--sub);text-align:center}
.foot p{margin:0}
.foot .legal{font-size:11.5px;line-height:1.5;text-align:left;word-break:keep-all;margin-bottom:12px}
.foot .org{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:400px){.foot .org{font-size:11px}}
.top .help{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;border:1.5px solid var(--line2);color:var(--sub);font-weight:700;font-size:15px;margin-right:2px}
.top .help:hover{border-color:var(--ink);color:var(--ink)}
.top .play{border:0;background:none;padding:0;cursor:pointer;display:inline-flex;border-radius:50%;overflow:hidden;width:30px;height:30px;box-shadow:0 0 0 1.5px var(--line2)}
.top .play img{width:30px;height:30px;display:block;object-fit:cover}
.top .play:hover{box-shadow:0 0 0 1.5px var(--orange)}
.top .ext{display:inline-flex;border-radius:50%;overflow:hidden;width:30px;height:30px;box-shadow:0 0 0 1.5px var(--line2)}
.top .ext img{width:30px;height:30px;display:block;object-fit:cover}
.top .ext:hover{box-shadow:0 0 0 1.5px var(--orange)}
/* 설명 화면 */
.about{padding:8px 16px 32px}
.about h1{font-size:22px;margin:20px 0 6px}
.about h2{font-size:17px;margin:28px 0 8px}
.about h3{font-size:15px;margin:18px 0 4px;color:var(--ink)}
.about .lead{font-size:16px}
.about .fig{display:block;width:100%;height:auto;margin:4px 0 14px}
.about .fig text{font-family:var(--font);fill:var(--ink)}
.about .fig .lab{font-size:15px;font-weight:700}
.about .fig .cap{font-size:12px;fill:var(--sub)}
.about .fig .node{fill:var(--bg2);stroke:var(--line);stroke-width:1}
.about .fig .ico{fill:none;stroke:var(--ink);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.about .fig .arr{fill:none;stroke:var(--orange);stroke-width:4;stroke-linecap:round}
.about .fig .arrh{fill:var(--orange)}
.about p{margin:0 0 10px;line-height:1.7}
.about ul,.about ol{margin:0 0 10px;padding-left:20px;line-height:1.7}
.about li{margin-bottom:4px}
.about table{border-collapse:collapse;width:100%;margin:8px 0 12px;font-size:14px}
.about th,.about td{border-bottom:1px solid var(--line);padding:8px 6px;text-align:left}
.about th{color:var(--sub);font-weight:600;font-size:12.5px}
.about td.n,.about th.n{text-align:right;font-variant-numeric:tabular-nums}
.about .src{font-size:12px;color:var(--sub)}
.about .src a{text-decoration:underline}
.about .box{background:var(--bg2);border-radius:12px;padding:14px 16px;margin:10px 0}
.about .box b{color:var(--orange)}
.foot a{color:var(--sub);text-decoration:underline}
.icon-btn{border:0;background:none;padding:6px;cursor:pointer;color:var(--ink);display:inline-flex;border-radius:8px}

/* 머리 */
.top{position:fixed;top:0;left:0;right:0;height:var(--top);z-index:20;background:var(--bg);border-bottom:1px solid var(--line);
  display:flex;align-items:center;gap:8px;padding:0 14px}
.top .brand{display:flex;align-items:center;gap:8px;font-weight:800;font-size:18px;letter-spacing:-.3px;flex:1}
.top .brand img{display:block}
.top .brand span{white-space:nowrap}
@media (max-width:360px){.top{gap:6px;padding:0 10px}.top .brand{font-size:16px;gap:6px}}
.top-nav{display:none;align-items:center;gap:4px}
.top-nav a{padding:6px 10px;border-radius:8px;font-weight:600;color:var(--sub)}
.top-nav a.active{color:var(--ink)}
.top-nav a.btn{color:#fff;margin-left:8px}

/* 탭바 */
.tabbar{position:fixed;left:0;right:0;bottom:0;height:calc(var(--tab) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);
  z-index:20;background:var(--bg);border-top:1px solid var(--line);display:flex}
.tabbar a{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:11px;color:var(--sub)}
.tabbar a svg{width:24px;height:24px}
.tabbar a.active{color:var(--ink)}
.tabbar a.tab-write svg{width:30px;height:30px;color:var(--orange)}

/* 본문 */
.view{max-width:var(--maxw);margin:0 auto;min-height:60vh}
.pad{padding:16px}
.empty{padding:48px 16px;text-align:center;color:var(--sub)}
.muted{color:var(--sub)}
.row{display:flex;align-items:center;gap:8px}
.grow{flex:1;min-width:0}
h1,h2,h3{margin:0;letter-spacing:-.3px}
h2{font-size:17px;font-weight:700}
.section{padding:16px;border-bottom:8px solid var(--bg2)}
.section:last-child{border-bottom:0}
.section-head{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:10px}
.section-head a{font-size:13px;color:var(--sub)}

/* 칩 */
.chips{display:flex;gap:8px;overflow-x:auto;padding:10px 16px;scrollbar-width:none;border-bottom:1px solid var(--line)}
.chips::-webkit-scrollbar{display:none}
.chips.wrap{flex-wrap:wrap;overflow:visible;padding:0;border:0}
.chip{flex:none;border:1px solid var(--line2);background:var(--bg);border-radius:999px;padding:6px 12px;font-size:13.5px;cursor:pointer;line-height:1.3}
.chip.on{background:var(--ink);border-color:var(--ink);color:var(--bg)}
.chip.orange.on{background:var(--orange);border-color:var(--orange);color:#fff}

/* 글 목록 */
.post{display:flex;gap:14px;padding:16px;border-bottom:1px solid var(--line);cursor:pointer}
.post:hover{background:var(--bg2)}
.thumb{flex:none;width:60px;height:60px;border-radius:12px;background:var(--bg2);display:flex;align-items:center;justify-content:center;
  font-weight:800;font-size:15px;letter-spacing:-.5px;color:var(--sub)}
.post .t{font-size:16px;font-weight:600;line-height:1.35;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.post .m{font-size:13px;color:var(--sub);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.post .r{font-size:15px;font-weight:700;margin-top:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.post .r .tag{display:inline-block;vertical-align:1px;font-size:11px;font-weight:700;line-height:1;padding:4px 6px;border-radius:5px;background:var(--orange-bg);color:var(--orange);margin-right:7px}
.post .b{font-size:12.5px;color:var(--sub);margin-top:6px;display:flex;gap:10px;align-items:center}
.state{display:inline-block;font-size:11.5px;font-weight:700;padding:2px 7px;border-radius:5px;background:var(--bg2);color:var(--sub)}
.state.open{background:var(--orange);color:#fff}
.state.doing{background:var(--green);color:#fff}
.state.done{background:var(--line2);color:var(--ink)}

/* 글 상세 */
.detail .author{display:flex;align-items:center;gap:12px;padding:16px;border-bottom:1px solid var(--line)}
.avatar{flex:none;width:40px;height:40px;border-radius:50%;background:var(--bg2);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:15px}
.avatar.lg{width:64px;height:64px;font-size:22px}
.author .n{font-weight:700}
.author .d{font-size:13px;color:var(--sub)}
.temp{font-weight:700;text-align:right;font-size:15px}
.temp small{display:block;font-size:11px;color:var(--sub);font-weight:500}
.tempbar{height:5px;border-radius:3px;background:var(--line);overflow:hidden;width:72px;margin-left:auto;margin-top:4px}
.tempbar i{display:block;height:100%;background:var(--orange)}
.detail .title{font-size:20px;font-weight:700;line-height:1.35}
.detail .meta{font-size:13px;color:var(--sub);margin-top:6px}
.detail .body{white-space:pre-wrap;margin-top:14px;line-height:1.65}
.rewards{display:flex;flex-direction:column;gap:6px;margin-top:4px}
.reward{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:10px;background:var(--orange-bg);font-weight:600}
.reward span:last-child{color:var(--orange)}
.list{display:flex;flex-direction:column}
.item{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid var(--line);align-items:flex-start}
.item:last-child{border-bottom:0}
.item .who{font-weight:700;font-size:14px}
.item .who small{font-weight:500;color:var(--sub);margin-left:6px}
.item .txt{margin-top:2px;white-space:pre-wrap}
.item .when{font-size:12.5px;color:var(--sub);margin-top:2px}
.actions{position:sticky;bottom:calc(var(--tab) + env(safe-area-inset-bottom));background:var(--bg);border-top:1px solid var(--line);padding:12px 16px;display:flex;gap:10px;align-items:center}
.actions .r{font-weight:800;font-size:16px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.compose-inline{display:flex;gap:8px;padding:12px 0}
.compose-inline input{flex:1}
.compose-inline .btn{flex:none}
.anon-mini{flex:none;display:flex;align-items:center;gap:4px;font-size:13px;color:var(--sub);cursor:pointer;white-space:nowrap}
.anon-mini input{width:16px;height:16px;margin:0;accent-color:var(--orange)}
.notice{font-size:12.5px;color:var(--sub);padding:0 16px 12px}

/* 글쓰기 */
.form{padding:16px;display:flex;flex-direction:column;gap:18px}
.form label{display:block;font-weight:700;font-size:14px;margin-bottom:8px}
.form label small{font-weight:500;color:var(--sub);margin-left:6px}
.chosen{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.chosen .c{display:flex;gap:8px;align-items:center}
.chosen .c b{flex:none;min-width:120px;font-weight:600;font-size:14px}
.chosen .c input{height:38px;padding:6px 10px;font-size:14px}
.chosen .c .x{border:0;background:none;color:var(--sub);font-size:18px;cursor:pointer;padding:4px}
.custom{display:flex;gap:8px;margin-top:8px}
.custom input{height:38px;padding:6px 10px;font-size:14px}

.check{display:flex;align-items:flex-start;gap:10px;cursor:pointer}
.check input{width:20px;height:20px;margin:2px 0 0;flex:none;accent-color:var(--orange)}
.check span{font-weight:600}
.check small{display:block;font-weight:500;color:var(--sub);font-size:12.5px;margin-top:2px}

/* 로그아웃 상태: 바로 로그인 */
.quick{max-width:420px;margin:0 auto;padding:32px 16px 24px}
.quick h2{font-size:20px;margin-bottom:14px}
.quick form{display:flex;flex-direction:column;gap:10px}
.quick .or{display:flex;align-items:center;gap:10px;color:var(--sub);font-size:13px;margin:22px 0 12px}
.quick .or::before,.quick .or::after{content:"";flex:1;height:1px;background:var(--line)}

/* 사람 */
.rank{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--line);cursor:pointer}
.rank:last-child{border-bottom:0}
.rank .no{width:22px;font-weight:800;color:var(--sub);text-align:center}
.rank .no.hi{color:var(--orange)}
.rank .n{font-weight:700}
.rank .d{font-size:13px;color:var(--sub)}
.rank .v{font-weight:800;text-align:right}
.rank .v small{display:block;font-weight:500;color:var(--sub);font-size:11.5px}
.badges{display:flex;flex-wrap:wrap;gap:6px}
.badge{font-size:12.5px;background:var(--bg2);border-radius:999px;padding:4px 10px}
.badge b{margin-left:4px;color:var(--orange)}
.profile{display:flex;align-items:center;gap:14px;padding:20px 16px;border-bottom:1px solid var(--line)}
.profile .n{font-size:18px;font-weight:800}
.profile .d{color:var(--sub);font-size:14px}
.profile .f{font-size:13px;margin-top:4px}
.bigtemp{text-align:right}
.bigtemp b{font-size:24px;font-weight:800;color:var(--orange)}
.bigtemp small{display:block;color:var(--sub);font-size:12px}

/* 시트(아래에서 올라오는 창) */
.sheet-bg{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:40}
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:41;background:var(--bg);border-radius:18px 18px 0 0;padding:16px 16px calc(16px + env(safe-area-inset-bottom));
  max-height:88vh;overflow:auto;max-width:var(--maxw);margin:0 auto}
.sheet h2{font-size:18px;margin-bottom:12px}
.sheet .field{margin-bottom:14px}
.sheet .field label{display:block;font-weight:700;font-size:13.5px;margin-bottom:6px}
.sheet .foot{display:flex;gap:8px;margin-top:16px;position:sticky;bottom:calc(-16px - env(safe-area-inset-bottom));background:var(--bg);padding:12px 0 calc(12px + env(safe-area-inset-bottom));margin-bottom:calc(-16px - env(safe-area-inset-bottom))}
.sheet .foot .btn{flex:1}
.toast{position:fixed;left:50%;bottom:calc(var(--tab) + 20px);transform:translateX(-50%) translateY(20px);background:var(--ink);color:var(--bg);
  padding:10px 16px;border-radius:999px;font-size:14px;opacity:0;transition:.2s;z-index:50;pointer-events:none;white-space:nowrap}
.toast.show{opacity:1;transform:translateX(-50%)}

/* 인트로 영상: 기기마다 한 번 */
.intro{position:fixed;inset:0;z-index:100;background:rgba(0,0,0,.92);display:flex;align-items:center;justify-content:center;transition:opacity .25s}
.intro.out{opacity:0;pointer-events:none}
.intro .yt{position:relative;width:min(100vw,56.25vh);height:min(100vh,177.8vw);background:#000}
.intro .unmute{position:absolute;left:50%;top:calc(14px + env(safe-area-inset-top));transform:translateX(-50%);background:rgba(255,255,255,.92)}
.intro .unmute[hidden]{display:none}
.intro .yt iframe,.intro .yt video{width:100%;height:100%;border:0;display:block;background:#000;object-fit:contain}
.intro #introSkip{position:absolute;top:calc(14px + env(safe-area-inset-top));right:16px;background:rgba(255,255,255,.92)}

/* 연결맵 */
.map{padding:12px 16px 0}
.map svg{display:block;width:100%;height:auto}
.map text{font-family:var(--font);font-size:11.5px;fill:var(--ink)}
.map .edge{fill:none;stroke:var(--orange);stroke-linecap:round}
.map .edge.dim{opacity:.08}
.map .edge.sel{stroke:var(--ink)}
.map .node{fill:var(--orange)}
.map .node.off{fill:var(--line2)}
.map .legend{display:flex;gap:14px;font-size:12px;color:var(--sub);padding:6px 0 10px}
.map .legend i{display:inline-block;width:22px;height:0;border-top:4px solid var(--orange);vertical-align:middle;margin-right:5px}
.map .legend i.w{border-top-width:1.5px;opacity:.35}
.rank.sel{background:var(--bg2);margin:0 -16px;padding-left:16px;padding-right:16px;border-radius:0}
.rank .pair{font-weight:700}
.rank .pair small{display:block;font-weight:500;color:var(--sub);font-size:12px}

/* 검색 */
.search{padding:10px 16px;border-bottom:1px solid var(--line)}

/* 넓은 화면 */
@media (min-width:720px){
  body{padding-bottom:24px}
  .tabbar{display:none}
  .top-nav{display:flex}
  .top{padding:0 calc((100% - var(--maxw)) / 2)}
  .top .brand{flex:1}
  .view{border-left:1px solid var(--line);border-right:1px solid var(--line);min-height:calc(100vh - var(--top))}
  .actions{bottom:0}
  .toast{bottom:32px}
  .sheet{bottom:auto;top:50%;transform:translateY(-50%);border-radius:18px;max-width:480px}
  .post:hover{background:var(--bg2)}
}
@media (prefers-reduced-motion: reduce){.toast{transition:none}}
