/* =========================================================
   학생.kr — dark theme
   시안(디자인 캔버스)과 같은 토큰. 테두리 대신 면으로 띄우고,
   거터 24px / 섹션 28px / 라운드 18px 로 통일한다.
   ========================================================= */

@font-face {
  font-family: 'Yeongdo';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2410-1@1.2/Yeongdo-Bd.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #0A0A0A;
  --surface: #141417;     /* 카드 · 입력 · 미선택 컨트롤 */
  --surface-2: #1A1A1E;   /* 비활성 버튼 */
  --line: #26262B;
  --line-2: #1C1C20;      /* 구분선 */
  --text: #FAFAFA;
  --body: #D4D4D8;
  --muted: #A1A1AA;
  --label: #71717A;
  --dim: #52525B;
  --fill: #FAFAFA;        /* YES */
  --track: #2A2A2F;       /* NO */
  --on-fill: #0A0A0A;

  --gut: 24px;
  --radius: 18px;
  --radius-sm: 10px;
  --tab-h: 80px;
}

* { box-sizing: border-box; }

/* .sheet 등 display 를 지정한 클래스가 [hidden] 을 이겨버리므로 명시적으로 눌러준다 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Archivo', 'IBM Plex Sans KR', system-ui, -apple-system,
               'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

/* ---- 레이아웃 --------------------------------------------------------- */

.wrap {
  max-width: 430px; margin: 0 auto; min-height: 100dvh;
  display: flex; flex-direction: column; position: relative;
}
.screen { flex: 1 0 auto; padding: max(env(safe-area-inset-top), 24px) 0 0 0;
          display: flex; flex-direction: column; }
.pad { padding-left: var(--gut); padding-right: var(--gut); }

/* ---- 로고 — kr 은 flex 윗변 기준으로 올린다 ---------------------------- */

.logo {
  display: inline-flex; align-items: flex-start;
  font-family: 'Yeongdo', 'Archivo', system-ui, sans-serif;
  font-weight: 700; font-size: 26px; line-height: 1; letter-spacing: -0.01em;
}
.logo .sup { font-size: 0.42em; line-height: 1; margin-left: 0.09em; margin-top: -0.10em; }
.logo--lg { font-size: 34px; }
.logo--sm { font-size: 20px; }

/* ---- 타이포 ----------------------------------------------------------- */

.h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; margin: 0; }
.h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.display { font-size: 23px; font-weight: 700; line-height: 1.5; letter-spacing: -0.03em;
           margin: 0; text-wrap: pretty; }
.label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--label); }
.meta { font-size: 12px; font-weight: 500; color: var(--muted); }
.dim { color: var(--dim); }
.body { font-size: 14px; line-height: 1.65; letter-spacing: -0.01em; }

/* ---- 가로 슬라이더 ---------------------------------------------------- */

.rail-head { display: flex; align-items: baseline; justify-content: space-between;
             gap: 10px; margin-top: 28px; }
.rail-head .sub { font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 3px; }
.badge-live { font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
              background: var(--fill); color: var(--on-fill);
              padding: 2px 6px; border-radius: 5px; }

.rail { display: flex; gap: 10px; margin-top: 11px;
        overflow-x: auto; scroll-snap-type: x mandatory;
        padding: 0 var(--gut) 2px var(--gut);
        scrollbar-width: none; -ms-overflow-style: none; }
.rail::-webkit-scrollbar { display: none; }

/* ---- 정사각 주제 카드 -------------------------------------------------- */

.tcard {
  width: 156px; height: 156px; flex: 0 0 auto;
  background: var(--surface); border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; justify-content: space-between;
  scroll-snap-align: start;
}
.tcard:active { background: var(--surface-2); }
.tcard .cat { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; color: var(--label); }
.tcard .title { font-size: 13.5px; font-weight: 600; line-height: 1.45; letter-spacing: -0.02em;
                display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .pct { font-size: 19px; font-weight: 700; letter-spacing: -0.03em; }
.tcard .pct span { font-size: 11px; }
.tcard .votes { font-size: 10px; font-weight: 500; color: var(--label); }
.tcard .yn { display: flex; justify-content: space-between; font-size: 10px;
             font-weight: 600; letter-spacing: 0.04em; }
.tcard.empty { background: transparent; border: 1px dashed var(--track); color: var(--muted); }

.row-between { display: flex; align-items: baseline; justify-content: space-between; }

/* ---- 게이지 ----------------------------------------------------------- */

.gauge { height: 4px; border-radius: 999px; background: var(--track); overflow: hidden; }
.gauge > i { display: block; height: 100%; background: var(--fill); }
.gauge--md { height: 6px; }
.gauge--lg { height: 10px; }

/* ---- 버튼 · 칩 --------------------------------------------------------- */

.btn { min-height: 48px; padding: 0 20px; border-radius: var(--radius);
       display: inline-flex; align-items: center; justify-content: center; gap: 8px;
       font-size: 15px; font-weight: 700; letter-spacing: -0.01em; border: 0; }
.btn--fill { background: var(--fill); color: var(--on-fill); }
.btn--ghost { border: 1.5px solid var(--text); color: var(--text); }
.btn--quiet { background: var(--surface); color: var(--muted); }
.btn--disabled { background: var(--surface-2); color: var(--dim); pointer-events: none; }
.btn--block { width: 100%; }
.btn--lg { min-height: 56px; font-size: 15.5px; }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 12.5px; border-radius: var(--radius-sm); }

.choice { flex: 1 1 0; min-height: 58px; border-radius: var(--radius);
          display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
          background: var(--surface); border: 0; }
.choice b { font-size: 16px; font-weight: 700; letter-spacing: 0.03em; }
.choice small { font-size: 10.5px; font-weight: 500; color: var(--muted); }
.choice.is-selected { background: var(--fill); color: var(--on-fill); }
.choice.is-selected small { color: #3F3F46; }

.chip { padding: 9px 14px; border-radius: var(--radius-sm); background: var(--surface);
        font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.chip.is-on { background: var(--fill); color: var(--on-fill); font-weight: 700; }
.chip-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }

.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
       border-radius: 9px; background: var(--surface);
       font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }

/* ---- 카드 · 리스트 ---------------------------------------------------- */

.card { border-radius: var(--radius); background: var(--surface); padding: 16px 18px; }
.card--dashed { background: transparent; border: 1px dashed var(--track); }

.list-row { padding: 15px 0; border-bottom: 1px solid var(--line-2);
            display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.list-row:last-child { border-bottom: 0; }

.stat-row { display: flex; border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.stat { flex: 1 1 0; padding: 15px 0; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.stat span { font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }

/* ---- 선택 시트 (학교 유형) --------------------------------------------- */

.field { min-height: 58px; border-radius: 16px; background: var(--surface);
         display: flex; align-items: center; justify-content: space-between;
         padding: 0 18px; width: 100%; text-align: left; }
.field span { font-size: 15.5px; font-weight: 600; }
.field.is-empty span { font-weight: 500; color: var(--dim); }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 40; }
.sheet { position: fixed; left: 50%; transform: translateX(-50%);
         bottom: 0; width: 100%; max-width: 430px; z-index: 41;
         background: var(--surface); border-radius: 24px 24px 0 0;
         padding: 12px var(--gut) calc(24px + env(safe-area-inset-bottom)) var(--gut);
         max-height: 88dvh; display: flex; flex-direction: column; }
.sheet-grip { width: 40px; height: 4px; border-radius: 999px; background: var(--track); align-self: center; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.sheet-title { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.sheet-list { margin-top: 14px; overflow-y: auto; display: flex; flex-direction: column; }
.sheet-list label { min-height: 46px; display: flex; align-items: center;
                    justify-content: space-between; gap: 10px; cursor: pointer; }
.sheet-list label span { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: -0.01em; }
.sheet-list label.is-on span { font-weight: 700; color: var(--text); }
.sheet-list label svg { display: none; }
.sheet-list label.is-on svg { display: block; }

/* ---- 댓글 ------------------------------------------------------------- */

.cmt { display: flex; flex-direction: column; gap: 8px; }
.cmt + .cmt { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.cmt-head { display: flex; align-items: center; gap: 7px; }
.stance { font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
          padding: 2px 7px; border-radius: 6px; border: 1px solid var(--text); }
.stance--yes { background: var(--fill); color: var(--on-fill); border-color: var(--fill); }
.stance--no { background: transparent; color: var(--text); }
.cmt-actions { display: flex; align-items: center; gap: 16px; }
.cmt-actions button { font-size: 11.5px; font-weight: 600; color: var(--muted);
                      display: inline-flex; align-items: center; gap: 5px; }
.cmt-actions button.is-on { color: var(--text); }

.replies { margin: 10px 0 0 11px; padding-left: 14px; border-left: 1px solid var(--line);
           display: flex; flex-direction: column; gap: 12px; }
.reply { display: flex; flex-direction: column; gap: 6px; }
.reply .body { font-size: 13px; color: var(--body); }
.reply .stance { font-size: 9.5px; padding: 1px 6px; border-radius: 4px; }

.hidden-cmt { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---- 작성 ------------------------------------------------------------- */

.composer { border-radius: var(--radius); background: var(--surface);
            border: 1.5px solid var(--text); padding: 16px;
            min-height: 210px; display: flex; flex-direction: column; }
.composer textarea { flex: 1 1 auto; width: 100%; border: 0; outline: 0; resize: none;
                     background: transparent; font-size: 15px; line-height: 1.75; letter-spacing: -0.01em; }
.composer textarea::placeholder { color: var(--dim); }
.composer-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line);
                 display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.counter { font-size: 13px; font-weight: 700; letter-spacing: -0.01em;
           display: flex; align-items: center; gap: 8px; }
.counter .num.is-over { color: #F87171; }
.counter .bar { width: 52px; }

.inline-composer { display: flex; align-items: center; gap: 9px;
                   padding-top: 10px; border-top: 1px solid var(--line-2); }
.inline-composer .fake-input { flex: 1 1 auto; min-height: 50px; background: var(--surface);
                               border-radius: 16px; display: flex; align-items: center;
                               justify-content: space-between; padding: 0 14px;
                               font-size: 13.5px; color: var(--muted); }
.send { width: 50px; height: 50px; border-radius: 16px; background: var(--fill); color: var(--on-fill);
        display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }

/* ---- 하단 탭 ---------------------------------------------------------- */

.tabbar { position: sticky; bottom: 0; z-index: 10; height: var(--tab-h);
          padding: 14px 28px calc(env(safe-area-inset-bottom)) 28px;
          border-top: 1px solid var(--line-2); background: rgba(10, 10, 10, 0.92);
          backdrop-filter: blur(8px); display: flex; align-items: flex-start; }
.tabbar a { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); }
.tabbar a span { font-size: 10.5px; font-weight: 500; }
.tabbar a.is-on { color: var(--text); }
.tabbar a.is-on span { font-weight: 700; }

/* ---- 기타 ------------------------------------------------------------- */

.flash { margin: 12px var(--gut) 0 var(--gut); padding: 12px 14px; border-radius: 14px;
         background: var(--surface); font-size: 12.5px; color: var(--muted); }
.flash.error { color: #FCA5A5; }

.note { display: flex; align-items: center; justify-content: center; gap: 6px;
        font-size: 11.5px; font-weight: 500; color: var(--muted); }

/* 약관·방침 본문용. .note 는 display:flex 라 <b> 가 줄바꿈돼서 따로 둔다 */
.doc-note { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted);
            line-height: 1.75; letter-spacing: -0.01em; text-align: left; margin: 0; }
.doc-note b { color: var(--body); font-weight: 700; }

.divider { height: 1px; background: var(--line-2); margin: 14px 0; }
.spacer { flex: 1 1 auto; }
.col { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mt-28 { margin-top: 28px; } .mt-32 { margin-top: 32px; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-9 { gap: 9px; } .gap-10 { gap: 10px; }
.gap-12 { gap: 12px; } .gap-14 { gap: 14px; }

@media (prefers-reduced-motion: no-preference) {
  .tcard, .btn, .choice, .chip, .field { transition: background .12s ease, color .12s ease; }
}
