/* ══════════════════════════════════════════════════════════════════
   반응형 브레이크포인트 정책 (현황 기록 — 2026-08)

   이 파일에는 성격이 다른 반응형 기준이 두 종류 섞여 있다. 둘 다 "모바일"을
   뜻하지만 발동 조건이 달라서, 서로 안 맞물리는 화면(대표적으로 아이패드 세로)이
   생긴다. 수정 전 아래를 먼저 읽을 것.

   [A] @media (max-aspect-ratio:3/4)  — 가로세로비 0.75 이하(세로로 긴 화면)
       기준이 "폭"이 아니라 "화면 모양"이다. 뷰포트 폭은 보지 않는다.
       원본 사이트(첫 커밋)부터 있던 기반 전략이며 max- 8곳 + min- 1곳에서 쓰인다.
       (각 사용처에는 "[A] 세로비 기준" 주석을 달아뒀다. grep 하면 찾을 수 있다.)
         .container       max-width 1040 -> 720px, padding 16 -> 20px
         .brand-img img   큰 로고 120px (min-width:768px와 OR 조건)
         .grid            퀴즈 카드 2열 -> 1열
         .tabs-grid       탭 목록 2열 -> 1열
         .tabs-grid       (min- 조건) 가로일 때 내체표 2열
         .header          헤더 폭 제한 해제 + 패딩 재계산
         .brand-img img   작은 로고 28px (min-width:768px와 OR 조건)
         .grid            gap 16px
         #tabs input      font-size 16px (iOS 입력 시 자동확대 방지)
       주의: 폭이 아닌 비율 기준이라 폰 가로모드(비율 2.1)에서는 데스크톱
       레이아웃(카드 2열)이 나오고, 반대로 창을 세로로 길게 늘리면 폭이 넉넉해도
       1열이 된다. "몇 px부터"라는 답이 존재하지 않는다.

   [B] @media (max-width:720px)  — 뷰포트 폭 720px 이하
       나중에 추가된 폭 기준. 4곳에서 쓰인다.
       (각 사용처에는 "[B] 폭 기준" 주석을 달아뒀다.)
         .board-head      게시판 헤더/검색 축소
         #boardToolbarList 게시판 툴바 세로 전환, PC용 표 숨기고 모바일 카드 목록 표시
         .m-post          모바일 카드 스타일
         .home-extras     홈 위젯 세로 전환 + 순서 재배치 + 폭 100%

   [사각지대 - 홈 위젯은 2026-08-13 해소, 나머지는 유지]
   - (해소) 아이패드 세로와 데스크톱 창 721~815px에서 홈 위젯이 한 줄에도 못 들어가고
     정돈된 세로 스택도 아닌 어중간한 줄바꿈이 되던 문제. flex-wrap:nowrap + flex-shrink로
     "좁아지면 두 위젯이 같이 줄어들되 줄바꿈은 안 함"으로 바꿔서 없앴다.
     결과: 폰(<=720px)만 세로 스택, 그 위는 항상 한 줄.
   - 중요: 아이패드 세로의 컨텐츠 폭은 기기와 무관하게 **일괄 680px**이다.
     [A]가 .container를 720px로 캡하고 padding 20px를 주기 때문(뷰포트 744든 1024든 동일).
     "뷰포트 - 패딩"으로 계산하면 틀린다.
   - (유지) [A]는 비율 기준이라 폰 가로모드에서는 화면이 좁아도 데스크톱 레이아웃이 나온다.
     카드/탭 열수가 이에 해당. 폰 가로모드 사용 빈도가 낮아 수용 중.

   [참고] 전체 폭이 넓은 모니터에서 가운데만 차는 것은 위 두 규칙과 무관하다.
   .container의 max-width:1040px + margin:0 auto 때문이며 의도된 설계다(좌우 광고 영역).
   ══════════════════════════════════════════════════════════════════ */

/* ── Toss Design Tokens ──────────────────────────────────────────── */
:root {
  /* Brand */
  --toss-brand:        #F0527A;
  --toss-brand-dark:   #D4405F;
  --toss-brand-tint:   #FFF0F4;
  --toss-brand-10:     rgba(240, 82, 122, 0.12);
  --toss-brand-focus:  rgba(240, 82, 122, 0.45);

  /* Text — 5-level grayscale */
  --toss-text-strong:    #2A2A2A;
  --toss-text-primary:   #3C3C3C;
  --toss-text-secondary: #6A6A6A;
  --toss-text-tertiary:  #7A7A7A;
  --toss-text-disabled:  #9B9B9B;

  /* Backgrounds */
  --toss-bg-page:       #FFFFFF;
  --toss-bg-card:       #FAFAFA;
  --toss-bg-input:      #F4F4F4;
  --toss-surface-muted: #E8E6E1;

  /* Semantic / Status */
  --toss-up:          #10B981;
  --toss-down:        #FB7185;
  --toss-warning:     #F59E0B;
  --toss-info:        #3B82F6;
  --toss-success:     #10B981;

  /* Typography */
  --toss-font:        'Pretendard', 'Inter', system-ui, sans-serif;
  --toss-fw-normal:   400;
  --toss-fw-medium:   500;
  --toss-fw-semibold: 600;
  --toss-fw-bold:     700;

  /* Spacing (6px 배수) */
  --toss-sp-1:  6px;
  --toss-sp-2:  12px;
  --toss-sp-3:  18px;
  --toss-sp-4:  24px;  /* 섹션 간격 */
  --toss-sp-6:  36px;
  --toss-sp-8:  48px;  /* 히어로 패딩 */
  --toss-mx:    24px;  /* 카드 좌우 마진 (mx-6) */

  /* Border Radius */
  --toss-radius-card:  16px;    /* 카드 */
  --toss-radius-xl:    12px;    /* 큰 버튼 */
  --toss-radius-lg:    8px;     /* 일반 버튼 */
  --toss-radius-input: 12px;    /* 입력창 */
  --toss-radius-pill:  9999px;  /* 필 토글 */

  /* Shadows (불투명도 ≤ 8%) */
  --toss-shadow-card:     0 1px 4px rgba(0, 0, 0, 0.06);
  --toss-shadow-btn:      0 1px 3px rgba(0, 0, 0, 0.06);
  --toss-shadow-hover:    0 2px 4px rgba(0, 0, 0, 0.08);
  --toss-shadow-elevated: 0 4px 12px rgba(0, 0, 0, 0.08);
  --toss-shadow-modal:    0 8px 24px rgba(0, 0, 0, 0.12);

  /* Layout */
  --toss-max-w:   430px;
  --toss-pb-nav:  96px;   /* 바텀 네비 위 여유 공간 */
  --toss-touch:   44px;   /* 최소 터치 타깃 */

  /* Dividers & Borders */
  --toss-line:         rgba(0, 0, 0, 0.06);  /* 구분선 */
  --toss-border:       rgba(0, 0, 0, 0.10);  /* 인터랙티브 요소 테두리 */

  /* Brand opacity variants */
  --toss-brand-row:    rgba(240, 82, 122, 0.04);  /* 테이블 행 hover */
  --toss-brand-hover:  rgba(240, 82, 122, 0.15);  /* 버튼 hover 배경 */
  --toss-brand-border: rgba(240, 82, 122, 0.25);  /* 필/탭 테두리 */

  /* Status opacity variants */
  --toss-up-tint:   rgba(16, 185, 129, 0.08);    /* 정답 입력 배경 */
  --toss-up-border: rgba(16, 185, 129, 0.35);   /* tab-success 테두리 */
  --toss-down-tint: rgba(251, 113, 133, 0.10);  /* 오답 입력 배경 */
}

:root {
  color-scheme: only light;
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #111827;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --chip: #f8fafc;
  --chip-border: #e5e7eb;
  --headbar-overlap: -61px;
  --nav-lift: 51px;
  --headbar-fine: -118px;
  --btn-write-min: 81px;
  --board-post-font-size: 14px;
  --board-post-title-pad-left: 8px
}

* {
  box-sizing: border-box
}

/* scrollbar-gutter: stable both-edges 제거 — 커뮤니티는 이 예약이 없어서
   페이지 전체가 좌우 15px씩 안쪽으로 들어가 보이는 차이의 원인이었음(헤더 정렬과 무관, 전역 이슈) */

@media (pointer:fine) {
  [hidden] {
    display: none !important
  }
  /* body { overflow-y: scroll } 제거 — 커뮤니티처럼 필요할 때만 스크롤바가 뜨게(기본값).
     이전엔 짧은 페이지(홈 등)에서도 항상 스크롤바를 강제해 커뮤니티와 폭이 달라 보였음 */
}

html,
body {
  min-height: 100%
}

body {
  margin: 0;
  background: var(--toss-bg-page);
  color: var(--text);
  font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale
}

.container {
  width: 100%;
  max-width: 1040px; /* 커뮤니티(.ik-wrap)와 폭 통일 */
  margin: 0 auto;
  padding: 0 16px
}

/* [A] 세로비 기준 — 폭이 아니라 화면 모양. 아이패드 세로도 여기 걸려 컨테이너가
   720px로 좁아진다(홈 위젯이 한 줄에 못 들어가는 직접 원인). 상단 정책 주석 참고 */
@media (max-aspect-ratio:3/4) {
  .container {
    max-width: 720px;
    padding: 0 20px
  }
}

.header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 0 calc(6px + var(--headbar-overlap) + var(--nav-lift) + var(--headbar-fine));
  border-bottom: 0
}

.brand-img {
  padding-inline-start: max(10px, env(safe-area-inset-left));
  text-decoration: none
}

.brand-img img {
  display: block;
  height: 96px;
  width: auto;
  object-fit: contain
}

/* [A] 세로비 기준 (OR 조건) — 폭 768 이상이거나 세로로 긴 화면이면 큰 로고 */
@media (min-width:768px),
(max-aspect-ratio:3/4) {
  .brand-img img {
    height: 120px
  }
}

.headbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0;
  position: relative;
  z-index: 2;
  transform: translateY(calc(-1 * var(--headbar-overlap) + var(--headbar-fine)));
  pointer-events: none
}

.headbar .quick-links,
.headbar .quick-links *,
.headbar .timebar,
.headbar .timebar * {
  pointer-events: auto
}

#brandHome {
  position: relative;
  z-index: 10
}

.quick-links {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding-inline-start: max(10px, env(safe-area-inset-left));
  flex-wrap: nowrap
}

.ql-link {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f3f4f6;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: transform .15s;
  white-space: nowrap;
  text-align: center;
  min-width: 30px
}

.ql-link:hover {
  transform: translateY(-1px)
}

.timebar {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  padding-inline-end: max(10px, env(safe-area-inset-right))
}

.timebar.rightstack {
  flex-direction: column;
  align-items: flex-end;
  gap: 1px
}

.time {
  font-size: 12px;
  line-height: 1;
  color: var(--muted)
}

.time.dday {
  font-weight: 600
}

.nav {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-top: 2px;
  padding-bottom: 6px;
  margin-top: calc(-1 * var(--nav-lift));
  position: relative;
  z-index: 1
}

.nav-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 6px 0
}

.nav-row.scroll-x {
  flex-wrap: nowrap;
  justify-content: center;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scrollbar-width: none;
  will-change: scroll-position
}

.nav-row.scroll-x::-webkit-scrollbar {
  display: none
}

.nav-row.scroll-x.overflow {
  justify-content: flex-start
}

.nav-row.scroll-x.dragging {
  cursor: grabbing;
  user-select: none
}

.nav-row a {
  text-decoration: none
}

.chip,
.subchip {
  background: var(--chip);
  border: 1px solid var(--chip-border);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  transition: transform .15s;
  flex: 0 0 auto
}

.subchip {
  border-radius: 8px
}

.chip:hover,
.subchip:hover {
  transform: translateY(-1px)
}

.chip.active,
.subchip.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand)
}

.section {
  padding: 18px 0
}

.grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(2, 1fr)
}

/* [A] 세로비 기준 — 퀴즈 카드 2열 -> 1열. 폭 기준이 아니라서 "몇 px부터 1열"이라는
   답이 없다. 폰 가로모드에서는 화면이 좁아도 2열로 나온다 */
@media (max-aspect-ratio:3/4) {
  .grid {
    grid-template-columns: 1fr;
    gap: 24px
  }
}

.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 24px;
  background: #fafafa
}

.card h2 {
  margin: 0 0 10px;
  font-size: 22px
}

.row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0
}

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--toss-text-secondary)
}

.substeps {
  margin: 6px 0 10px 14px;
  padding-left: 12px;
  border-left: 2px solid var(--line)
}

.substeps .row {
  margin: 8px 0
}

input[type="text"] {
  width: 100%;
  height: 44px;
  padding: 10px 12px;
  font-size: 17px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, background-color .15s
}

input[type="text"]:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .2)
}

input[type="text"].ok {
  border-color: var(--toss-up);
  background: var(--toss-up-tint)
}

input[type="text"].bad {
  border-color: var(--toss-down);
  background: var(--toss-down-tint)
}

input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
  visibility: hidden;
  pointer-events: none;
  position: absolute
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0
}

#tabs {
  display: none
}

body.is-home #home {
  display: flex
}

body.is-home #grid,
body.is-home #tabs {
  display: none
}

body.is-tab #home,
body.is-tab #grid {
  display: none
}

body.is-tab #tabs {
  display: block
}

#home[hidden],
#tabs[hidden] {
  display: none !important
}

.tabs-grid {
  column-count: 2;
  column-gap: 28px
}

/* [A] 세로비 기준 — 탭 목록 1열 */
@media (max-aspect-ratio:3/4) {
  .tabs-grid {
    column-count: 1;
    column-gap: 24px
  }
}

#tabs[data-ctx="nae"] .tabs-grid {
  column-count: 1;
  column-gap: 24px
}

/* [A] 세로비 기준 (min- 반대 조건) — 가로로 넓은 화면일 때만 내체표 2열 */
@media (min-aspect-ratio:3/4) {
  #tabs[data-ctx="nae"].nae-2col .tabs-grid {
    column-count: 2;
    column-gap: 28px
  }
}

/* 2열 배치 과목은 카드 폭이 좁으므로 표의 범주(첫째) 열을 슬림하게.
   범주 라벨은 모두 가운뎃점·줄갈이로 세로 스택되며(핵심→아이→디어 포함) 좁은 폭에 들어간다. */
#tabs[data-ctx="nae"].nae-2col .matrix-table .cat {
  width: 38px;
  padding-left: 7px;
  padding-right: 7px
}

#tabs[data-ctx="edu"][data-item="총론"] .tabs-grid,
#tabs[data-ctx="edu"][data-item="창체"] .tabs-grid {
  column-count: 1;
  column-gap: 24px
}

.tabs-card {
  break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin: 0 0 28px;
  border: 1px solid var(--toss-border);
  border-radius: 16px;
  padding: 20px 24px;
  background: #fafafa
}

.tabs-card h2 {
  margin: 0 0 10px;
  font-size: 20px
}

.tabs-muted {
  color: var(--muted);
  font-size: 14px
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 12px
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--toss-radius-xl);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: var(--toss-fw-semibold);
  cursor: pointer;
  transition: filter .15s, background .15s
}

.btn-green {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff
}

.btn-red {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff
}

.btn-green:hover,
.btn-red:hover {
  filter: brightness(.95)
}

#tabs .global-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 8px;
  margin: 16px 0 28px;
  column-span: all
}

#tabs .global-actions .ga-break {
  flex-basis: 100%;
  height: 0
}

#tabs .global-actions .btn-camera {
  background: #374151;
  border-color: #374151;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  position: relative;
  top: -1px
}

#tabs[data-loading="1"] .global-actions {
  display: none !important
}

.input-wrap {
  position: relative;
  display: block;
  width: 100%
}

.input-wrap>input[type="text"] {
  width: 100%;
  padding-right: 12px
}

.ghost-in {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  max-width: min(38%, 220px);
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  color: #ef4444;
  opacity: .65;
  font-size: 13px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 1
}

#tabs[data-ctx="mo"] .ghost-in {
  color: var(--muted) !important;
  opacity: .8 !important;
  font-size: 12px
}

#tabs[data-ctx="mo"]:not([data-item="전과목 역량"]):not([data-item="전과목 모형 이름"]) .ghost-in {
  position: static;
  display: block;
  transform: none;
  max-width: none;
  margin: 5px 2px 0;
  overflow: visible;
  text-overflow: clip;
  text-align: left;
  white-space: normal;
  line-height: 1.35;
  pointer-events: none
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff
}

.tabs-card .matrix-table {
  margin-top: 18px;
  margin-bottom: 8px;
  border: 1px solid #d1d5db;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08)
}

.tabs-card .matrix-table th,
.tabs-card .matrix-table td {
  padding: 14px 16px;
  line-height: 1.85
}

.tabs-card .matrix-table .content {
  vertical-align: middle
}

.tabs-card .matrix-table .content:has(.cell-text) {
  vertical-align: top;
  padding-top: 8px
}

#tabs[data-ctx="nae"] .matrix-table .content {
  vertical-align: top
}

#tabs[data-ctx="nae"] .matrix-table {
  box-shadow: none;
  border-color: var(--line)
}

.tabs-card .matrix-table .content:has(.cell-text) .line {
  margin-top: 0
}

.tabs-card .matrix-table .content input[type="text"] {
  text-align: center
}

.tabs-card .matrix-table .content .cell-text {
  margin-top: 10px;
  text-align: left
}

.tabs-card .matrix-table thead th {
  padding-top: 4px;
  padding-bottom: 4px
}


.tabs-card .matrix-table.detail .cat {
  width: 150px
}

.tabs-card .matrix-table.detail td:nth-child(2) {
  width: 200px
}

.matrix-table th,
.matrix-table td {
  padding: 10px 12px;
  border-bottom: 2px solid #cbd5e1;
  border-right: 2px solid #cbd5e1;
  vertical-align: top;
  font-size: 14px
}

.matrix-table tr:last-child td,
.matrix-table tr:last-child th {
  border-bottom: none
}

.matrix-table th:last-child,
.matrix-table td:last-child {
  border-right: none
}

.matrix-table thead th {
  background: #e5e7eb;
  text-align: center;
  font-weight: 700;
  color: #111
}

.matrix-table tbody tr:first-child td {
  border-top: 2px solid #cbd5e1
}

.matrix-table .cat {
  background: #e5e7eb;
  font-weight: 600;
  width: 60px;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
  word-break: keep-all;
  line-height: 1.4
}

.matrix-table .content {
  background: #f7f7f7
}

.matrix-table .content .line {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 6px 0
}

.matrix-table .bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #747474;
  flex: 0 0 6px
}

.matrix-table .content input[type="text"] {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 40px;
  font-size: 14px
}

.matrix-table .input-wrap {
  position: relative;
  display: block;
  width: 100%
}

.matrix-table .input-wrap>input[type="text"] {
  width: 100%;
  padding-right: 72px !important
}

.matrix-table .ghost-in {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  max-width: min(40%, 220px);
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
  opacity: .8;
  z-index: 1
}

#tabs[data-ctx="nae"] .input-wrap > input[type="text"],
#tabs[data-ctx="edu"] .input-wrap > input[type="text"] {
  padding-right: 14px !important
}
#tabs[data-ctx="nae"] .ghost-in,
#tabs[data-ctx="edu"] .ghost-in {
  left: 12px;
  right: 12px;
  max-width: none !important;
  overflow: auto !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  -ms-overflow-style: none;
  scrollbar-width: none
}

#tabs[data-ctx="nae"] .ghost-in::-webkit-scrollbar,
#tabs[data-ctx="edu"] .ghost-in::-webkit-scrollbar {
  display: none
}

#tabs[data-ctx="mo"]:not([data-item="전과목 역량"]):not([data-item="전과목 모형 이름"]) .input-wrap > .ghost-in {
  position: static;
  display: block;
  transform: none;
  max-width: none !important;
  margin: 5px 2px 0;
  overflow: visible !important;
  text-overflow: clip !important;
  text-align: right;
  white-space: normal !important;
  line-height: 1.35;
  pointer-events: none
}

#tabs[data-ctx="mo"]:not([data-item="전과목 역량"]):not([data-item="전과목 모형 이름"]) .row > label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%
}

#tabs[data-ctx="mo"]:not([data-item="전과목 역량"]):not([data-item="전과목 모형 이름"]) .row > label .ghost-in {
  position: static;
  display: block;
  flex: 1 1 auto;
  max-width: 70% !important;
  margin: 0 0 0 auto;
  transform: none;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: right;
  white-space: nowrap !important;
  line-height: inherit;
  color: var(--muted) !important;
  opacity: .8 !important;
  pointer-events: none
}

#tabs[data-ctx="mo"][data-item="전과목 역량"] .input-wrap > input[type="text"],
#tabs[data-ctx="mo"][data-item="전과목 모형 이름"] .input-wrap > input[type="text"] {
  padding-right: 90px
}


.home-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 46vh;
  padding: 12px 0 18px
}

.home-hero img {
  width: min(96%, 980px);
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  margin-bottom: 12px
}

.feedback-box {
  width: min(96%, 480px);
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px
}

.feedback-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--toss-label);
  margin: 0
}

.feedback-row {
  display: flex;
  gap: 8px
}

.feedback-row input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 10px 12px !important;
  border: 1px solid var(--toss-line) !important;
  border-radius: 10px !important;
  font-size: 14px;
  height: auto !important
}

.feedback-row input[type="text"]:focus {
  border-color: var(--toss-blue) !important
}

.feedback-row button {
  flex-shrink: 0;
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  background: var(--toss-brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(240, 82, 122, .22);
  white-space: nowrap
}

.feedback-row button:hover {
  background: #E64870
}

.feedback-row button:disabled {
  opacity: .5;
  cursor: default
}

.feedback-msg {
  font-size: 13px;
  margin: 0
}

.feedback-msg.ok { color: #22c55e }
.feedback-msg.err { color: #ef4444 }

body.is-board #home,
body.is-board #grid,
body.is-board #tabs {
  display: none !important
}

.board-page {
  padding-top: 12px
}

.board-meta-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 10px;
  border: 1px solid var(--toss-border);
  border-radius: var(--toss-radius-xl);
  background: var(--toss-bg-card);
  margin-bottom: 10px
}

.bd-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis
}

.bd-meta-label {
  font-weight: var(--toss-fw-semibold);
  font-size: 13px;
  color: var(--toss-text-secondary)
}

.bd-meta-sep {
  opacity: .55
}

.bd-like-btn {
  padding: 6px 10px;
  border-radius: var(--toss-radius-xl);
  border: 1px solid var(--toss-border);
  background: #fff;
  font-weight: var(--toss-fw-semibold);
  font-size: 13px
}

.bd-like-btn:disabled {
  opacity: .6;
  cursor: default
}

.bd-like-count {
  font-weight: 900;
  font-size: 13px;
  min-width: 18px;
  text-align: left
}

.bd-divider {
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.10);
  margin: 12px 0
}

body.is-board #boardDetailPage .toastui-editor-contents {
  font-size: 16px;
  line-height: 1.75
}

.board-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin: 6px 0 12px
}

.board-toolbar {
  display: block;
  background: var(--toss-bg-card);
  border: 1px solid var(--toss-border);
  border-radius: var(--toss-radius-card);
  padding: 8px 10px
}

.board-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%
}

.board-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0
}

.board-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto
}

.board-toolbar-spacer {
  flex: 1 1 auto;
  min-width: 12px
}

.board-toolbar-title {
  font-weight: var(--toss-fw-bold);
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 8px
}

.board-toolbar .board-tabbar {
  margin: 0;
  background: transparent;
  border: 0;
  padding: 0
}

.board-toolbar .board-actions {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px
}

.board-write-title-top {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--toss-radius-input);
  border: 1.5px solid var(--toss-border);
  background: #FFFFFF;
  outline: none
}

@media (max-width:820px) {
  .board-toolbar-row {
    flex-wrap: nowrap;
    gap: 8px
  }

  .board-toolbar-left {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden
  }

  .board-toolbar-right {
    flex: 0 0 auto;
    justify-content: flex-end
  }
}

.board-head h2 {
  margin: 0;
  font-size: 20px;
  white-space: nowrap;
  flex: 0 0 auto;
  margin-right: auto
}

.board-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  justify-content: flex-end
}

.board-actions select {
  height: 36px;
  font-size: 14px;
  padding: 6px 28px 6px 12px;
  border-radius: var(--toss-radius-input);
  border: 1.5px solid var(--toss-border);
  background: var(--toss-bg-input) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236A6A6A' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  color: var(--toss-text-primary);
  flex: 0 0 auto;
  white-space: nowrap;
  cursor: pointer
}

.board-actions input[type="text"] {
  height: 36px;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: var(--toss-radius-lg);
  border: 1.5px solid var(--toss-border);
  flex: 0 1 220px;
  max-width: 260px;
  min-width: 0
}

.board-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 2px 0 4px
}

.board-note p {
  margin: 2px 0
}

#btnWrite.btn {
  min-width: var(--btn-write-min);
  padding: 8px 9px;
  white-space: nowrap;
  flex: 0 0 auto
}

.board-write {
  margin: 12px 0 14px;
  border: 1px solid var(--toss-border);
  border-radius: var(--toss-radius-card);
  background: var(--toss-bg-card);
  padding: 16px
}

.board-write .row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0
}

.board-write .row.two {
  flex-direction: row
}

.board-write .row.two>input,
.board-write .row.two>select {
  flex: 1;
  min-width: 0
}

.board-write select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--toss-border);
  border-radius: var(--toss-radius-input);
  font-size: 14px;
  background: #fff
}

.board-write input[type="text"],
.board-write input[type="password"],
.board-write input[type="url"],
.board-write textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--toss-border);
  border-radius: var(--toss-radius-input);
  font-size: 14px
}

.bw-editor {
  border: 1.5px solid var(--toss-border);
  border-radius: var(--toss-radius-xl);
  overflow: hidden;
  background: #fff
}

.bw-editor .toastui-editor-defaultUI {
  border: none
}

.bw-attach {
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed var(--toss-border);
  border-radius: var(--toss-radius-xl);
  background: #fff
}

.bw-attach-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 8px
}

.bw-attach-title {
  font-weight: 700
}

.bw-attach-desc {
  color: var(--muted);
  font-size: 12px
}

.bw-attach-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap
}

.bw-attach-btn {
  padding: 8px 10px;
  background: #fff;
  border: 1.5px solid var(--toss-border);
  border-radius: var(--toss-radius-lg);
  cursor: pointer
}

.bw-attach-hint {
  color: var(--muted);
  font-size: 12px
}

.bw-attach-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px
}

.bw-attach-item {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px
}

.bw-attach-badge {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: var(--toss-radius-pill);
  border: 1px solid var(--toss-border);
  background: var(--toss-bg-card);
  flex: 0 0 auto
}

.bw-attach-item a {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 420px
}

.bw-attach-meta {
  color: var(--muted);
  font-size: 12px;
  flex: 0 0 auto
}

.board-write textarea {
  min-height: 220px;
  height: clamp(220px, 40vh, 520px);
  resize: vertical;
  line-height: 1.5
}

.board-write .write-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px
}

.board-list-mobile {
  display: none
}

.board-table-wrap {
  border: 1px solid var(--toss-border);
  border-radius: var(--toss-radius-card);
  overflow: hidden;
  background: #fff
}

.board-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed
}

.board-table th,
.board-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--toss-line);
  font-size: 14px;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.board-table th {
  background: var(--toss-bg-card);
  color: var(--toss-text-secondary);
  font-weight: var(--toss-fw-semibold);
  text-align: left
}

.board-table tr:last-child td {
  border-bottom: none
}

.board-table td.title {
  text-align: left
}

.board-table td.title .title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0
}

.board-table td.title .title-wrap a {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.board-table .badge {
  font-size: 12px;
  border: 1px solid var(--toss-border);
  border-radius: var(--toss-radius-pill);
  padding: 2px 6px;
  background: var(--toss-bg-card)
}

.board-table .cmt {
  font-size: 12px;
  color: var(--toss-text-secondary)
}

.board-table tbody tr[data-href] {
  cursor: pointer
}

.board-table tbody tr[data-href]:hover {
  background: rgba(0, 0, 0, 0.035)
}

.board-muted {
  color: var(--muted);
  text-align: center
}

@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0 }
  100% { background-position: 400px 0 }
}

.skeleton {
  display: inline-block;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.4s infinite linear
}

.board-footer {
  display: flex;
  justify-content: center;
  margin: 12px 0
}

.board-pager {
  display: flex;
  gap: 8px;
  align-items: center
}

.board-pager button {
  padding: 6px 10px;
  border: 1px solid var(--toss-border);
  border-radius: var(--toss-radius-lg);
  background: #fff;
  cursor: pointer
}

/* [B] 폭 기준 720px — 게시판 헤더/검색 축소 */
@media (max-width:720px) {
  .board-head {
    gap: 6px
  }

  .board-head h2 {
    font-size: 18px
  }

  .board-actions {
    gap: 6px
  }

  .board-actions input[type="text"] {
    font-size: 13px;
    padding: 6px 8px;
    flex: 0 1 160px;
    max-width: 200px
  }

  .board-table th:nth-child(3),
  .board-table td:nth-child(3) {
    width: 120px
  }
}

#tabs.loading-lock {
  overflow: hidden
}

#tabs.loading-fade {
  opacity: 0;
  transition: opacity .12s
}

#tabs[data-ctx="nae"] .tabs-card.shrink-1-2 {
  width: 66%;
  display: block;
  margin: 0 auto 28px
}

body.is-board #board.container,
body.is-board #boardWritePage.board-page.container,
body.is-board #boardDetailPage.board-page.container {
  width: 100%;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto
}

.board-tabbar {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 10px 0;
  background: var(--toss-bg-card);
  border: 1px solid var(--toss-border);
  border-radius: var(--toss-radius-card);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch
}

.board-tabbar::-webkit-scrollbar {
  display: none
}

.board-tabbar .tab-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: var(--toss-fw-semibold);
  color: var(--toss-text-secondary);
  cursor: pointer;
  border-radius: var(--toss-radius-xl) var(--toss-radius-xl) 0 0
}

.board-tabbar .tab-btn.is-active {
  background: #ffffff;
  color: var(--toss-text-strong);
  border-bottom: 3px solid var(--toss-brand)
}

.board-table th {
  text-align: center
}

.board-table td {
  vertical-align: middle
}

.board-table td.col-center {
  text-align: center
}

.board-table td.title {
  text-align: left
}

.tab-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  white-space: nowrap
}

.tab-pill.tab-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46
}

.tab-pill.tab-materials {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af
}

.tab-pill.tab-study {
  background: #fef9c3;
  border-color: #fde68a;
  color: #92400e
}

#btnWrite {
  background: rgba(255, 158, 221, 0.86);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #fff4f4
}

#btnWrite:hover {
  filter: brightness(0.95)
}

.board-topline {
  margin: 10px auto 8px
}

.board-topline-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 8px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 14px
}

.board-topline-title {
  font-weight: 800;
  font-size: 18px;
  line-height: 1.2
}

.board-topline-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px
}

.board-topline-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.board-topline-actions {
  display: flex;
  align-items: center;
  gap: 8px
}

.board-write-title-top {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 700;
  background: #fff
}

.board-toolbar-shell {
  width: 100%;
  max-width: 960px;
  margin: 0 auto 14px
}

.board-mode-detail #boardToolbarActions,
.board-mode-write #boardToolbarActions {
  display: none !important
}

.board-mode-write #boardWritePage .bw-title-row {
  display: none
}

.board-table tbody tr {
  border-bottom: none
}

.board-table tbody td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08)
}

.board-table tbody tr:last-child td {
  border-bottom: none
}

#boardToplineWrite .board-write-title-top {
  flex: 1;
  width: auto
}

.bd-like-row {
  display: flex;
  align-items: center;
  gap: 10px
}

.bd-like-btn {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 158, 221, 0.86);
  color: #fff4f4;
  font-weight: 800
}

.bd-like-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed
}

.bd-like-count {
  font-weight: 800;
  color: var(--text)
}

body.is-board #boardDetailPage {
  font-size: var(--board-post-font-size)
}

body.is-board #boardDetailPage .board-topline-title {
  padding-left: var(--board-post-title-pad-left)
}

#bwEditor {
  --bwEditorFontFamily: system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans KR", sans-serif;
  --bwEditorFontSize: 12pt
}

#bwEditor .toastui-editor-contents {
  font-family: var(--bwEditorFontFamily);
  font-size: var(--bwEditorFontSize);
  line-height: 1.6
}

#bwEditor .bw-typo-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid rgba(0, 0, 0, 0.12)
}

#bwEditor .bw-typo-toolbar .bw-typo-label {
  font-size: 12px;
  opacity: 0.85;
  white-space: nowrap
}

#bwEditor .bw-typo-toolbar select {
  height: 30px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 10px;
  padding: 0 10px;
  background: #fff;
  font-size: 12px;
  outline: none
}

#bwEditor .bw-typo-toolbar select:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18)
}

.line-prefix {
  display: inline-block;
  margin-right: 2px;
  font-weight: 600;
  white-space: nowrap
}

body.js-loading #home,
body.js-loading #grid,
body.js-loading #tabs,
body.js-loading #boardToolbarShell,
body.js-loading #board,
body.js-loading #boardWritePage,
body.js-loading #boardDetailPage {
  display: none !important
}

#boardDetailPage .bd-link-line {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px
}

#boardDetailPage .bd-link-label {
  white-space: nowrap;
  font-weight: 700;
  opacity: 0.9
}

#boardDetailPage .bd-link-anchor {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

[hidden] {
  display: none !important
}

.matrix-table td .group-block+.group-block {
  margin-top: 18px
}

.matrix-table td .group-parent-line {
  margin-bottom: 10px
}

.matrix-table td .group-parent-line input {
  width: 100%
}

.matrix-table td .group-children {
  margin-left: 28px;
  padding-left: 18px;
  border-left: 2px solid rgba(0, 0, 0, 0.10)
}

.matrix-table td .group-child-line+.group-child-line {
  margin-top: 12px
}

.matrix-table td .group-child-line input {
  width: 100%
}

.matrix-group-cell {
  vertical-align: top
}

.matrix-groups {
  display: flex;
  flex-direction: column;
  gap: 18px
}

.matrix-group {
  display: flex;
  flex-direction: column;
  gap: 10px
}

.matrix-group-label {
  margin: 0;
  font-weight: 700;
  color: #374151;
  line-height: 1.45;
  white-space: pre-line
}

.matrix-group-items {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-left: 14px;
  padding-left: 18px
}

.matrix-group-items::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.12)
}

.matrix-group-items .line {
  display: block
}

.matrix-group-items .line .bullet,
.matrix-group-items .line .bullet-text {
  display: none !important
}

.matrix-group-items .line input[type="text"] {
  width: 100%
}

/* [B] 폭 기준 720px — 게시판 툴바 세로 전환, PC용 표 숨기고 모바일 카드 목록 표시 */
@media (max-width:720px) {
  #boardToolbarList {
    flex-direction: column;
    align-items: stretch;
    gap: 10px
  }

  #boardToolbarList .board-toolbar-left,
  #boardToolbarList .board-toolbar-right {
    width: 100%
  }

  #boardToolbarList .board-toolbar-right {
    justify-content: flex-start
  }

  #boardToolbarActions {
    width: 100%
  }

  .board-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px
  }

  #boardSearchScope {
    min-width: 96px
  }

  #boardSearch {
    flex: 1;
    min-width: 160px
  }

  #btnWrite {
    margin-left: 0
  }

  #board .board-table-wrap {
    display: none
  }

  #boardListMobile {
    display: flex !important;
    flex-direction: column;
    gap: 10px
  }

  .m-post {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    outline: none
  }

  .m-post:active {
    transform: translateY(1px)
  }

  .m-post-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0
  }

  .m-post-title {
    flex: 1;
    min-width: 0;
    font-weight: 700;
    line-height: 1.25;
    word-break: keep-all
  }

  .m-post-title a {
    color: inherit;
    text-decoration: none;
    display: block
  }

  .m-post-title a:active {
    opacity: 0.75
  }

  .tab-pill {
    white-space: nowrap
  }

  .m-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.86
  }

  .m-post-meta span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%
  }

  .m-post-meta .m-author {
    max-width: 46vw
  }
}

/* ══════════════════════════════════════════════════════════════════
   Toss-style Header & Nav
   ══════════════════════════════════════════════════════════════════ */

/* ─── Header ─────────────────────────────────────────────────── */
/* 커뮤니티(ImgoCommunity.jsx .ik-header 계열)와 픽셀 단위 동일 스펙.
   값 바꿀 때 양쪽 함께 변경할 것: 높이 52 / 로고 28 / 폰트 14·600 / 색 #8B95A1·#191F28 / 선 #E5E8EB */
.header {
  position: relative;
  top: auto;
  z-index: 100;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  height: 52px;
  background: #FFFFFF;
  border-bottom: 1px solid #E5E8EB;
  font-family: "Pretendard", system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", Segoe UI, Roboto, sans-serif
}

/* header 엘리먼트는 class="header container"라 .container의 max-width/margin(폭 좁힘+중앙정렬)이
   같이 걸림 — 구분선은 풀폭, 내용물만 1040px 중앙이어야 하므로(.ik-header/.ik-wrap과 동일 구조)
   더 높은 특정도로 .container 쪽 규칙을 취소 */
.header.container {
  max-width: none;
  margin: 0;
  padding: 0 max(16px, calc((100% - 1008px) / 2));
}

/* [A] 세로비 기준 — 헤더만 컨테이너 폭 제한을 풀고 패딩으로 정렬을 맞춘다 */
@media (max-aspect-ratio: 3/4) {
  .header.container {
    max-width: none;
    padding: 0 max(16px, calc((100% - 1008px) / 2))
  }
}

.brand-img {
  display: flex;
  align-items: center;
  padding: 0;
  flex-shrink: 0
}

.brand-img img {
  height: 28px;
  width: auto
}

/* [A] 세로비 기준 (OR 조건) — 글로벌 헤더의 작은 로고 */
@media (min-width: 768px),
(max-aspect-ratio: 3/4) {
  .brand-img img {
    height: 28px
  }
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: 0
}

.hnav-link {
  display: inline-block;
  padding: 10px 0;
  color: #8B95A1;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s
}

.hnav-link:hover {
  color: #4E5968
}

body.is-home #hnavHome,
body.is-tab #hnavHome {
  color: #191F28;
  font-weight: 800
}

body.is-board #hnavBoard {
  color: #191F28;
  font-weight: 800
}

body.is-board .nav {
  display: none
}

.timebar,
.timebar.rightstack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  width: auto;
  padding: 7px 0 0;
  flex-shrink: 0;
  margin-left: auto
}

.time {
  font-size: 11px;
  line-height: 1.2;
  color: var(--toss-text-tertiary);
  white-space: nowrap
}

.time.dday {
  font-size: 12px;
  font-weight: var(--toss-fw-semibold);
  color: var(--toss-brand)
}

/* ─── Nav ────────────────────────────────────────────────────── */
.nav {
  position: relative;
  top: auto;
  z-index: 99;
  background: #FFFFFF;
  border-top: none;
  border-bottom: 1px solid var(--toss-line);
  padding: 0;
  margin-top: 0
}

.nav-row {
  padding: 0 var(--toss-mx);
  gap: 0
}

/* topNav / subNav — 컴팩트 pill 칩 */
#topNav.nav-row {
  padding: 8px var(--toss-mx);
  border-bottom: 1px solid var(--toss-line);
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap
}

#subNav.nav-row,
#eduNav.nav-row {
  padding-top: 8px;
  padding-bottom: 8px;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap
}

#subNav.nav-row {
  border-bottom: 1px solid var(--toss-line)
}

#topNav.nav-row.overflow,
#subNav.nav-row.overflow,
#eduNav.nav-row.overflow {
  justify-content: flex-start
}

.nav-chips-scroll {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none
}

.nav-chips-scroll::-webkit-scrollbar {
  display: none
}

.nav-chips-scroll.overflow {
  justify-content: flex-start
}

.nav-cat-label {
  flex-shrink: 0;
  color: var(--toss-text-tertiary);
  font-size: 12px;
  font-weight: var(--toss-fw-medium);
  padding-right: 6px;
  white-space: nowrap;
  align-self: center
}

#topNav .chip,
#subNav .subchip,
#eduNav .subchip {
  background: transparent;
  border: 1px solid var(--toss-border);
  border-radius: var(--toss-radius-pill);
  color: var(--toss-text-primary);
  height: 28px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: var(--toss-fw-medium);
  display: flex;
  align-items: center;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap
}

#topNav .chip:hover,
#subNav .subchip:hover,
#eduNav .subchip:hover {
  background: var(--toss-brand-tint);
  color: var(--toss-brand);
  border-color: var(--toss-brand-border);
  transform: none
}

#topNav .chip.active,
#subNav .subchip.active,
#eduNav .subchip.active {
  background: rgba(240, 82, 122, 0.15);
  color: var(--toss-brand);
  border-color: var(--toss-brand-border);
  font-weight: var(--toss-fw-semibold)
}

/* ══════════════════════════════════════════════════════════════════
   Toss-style Grid Cards & Inputs
   ══════════════════════════════════════════════════════════════════ */

body {
  background: var(--toss-bg-page)
}

/* ─── Grid layout ─────────────────────────────────────────────── */
.grid {
  gap: 20px
}

/* [A] 세로비 기준 — 카드 간격만 좁힌다(위 .grid 1열 규칙과 짝) */
@media (max-aspect-ratio: 3/4) {
  .grid {
    gap: 16px
  }
}

/* ─── Card ─────────────────────────────────────────────────────── */
#grid .card {
  border: none;
  background: var(--toss-bg-card);
  box-shadow: var(--toss-shadow-card)
}

#grid .card h2 {
  font-size: 11px;
  font-weight: var(--toss-fw-bold);
  color: var(--toss-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 0 0 14px
}

/* ─── Row & Label ──────────────────────────────────────────────── */
#grid .row {
  gap: 6px;
  margin: 10px 0
}

#grid .row:first-of-type {
  margin-top: 0
}

#grid label {
  font-size: 14px;
  color: var(--toss-text-primary);
  line-height: 1.55
}

#grid .substeps {
  border-left-color: var(--toss-surface-muted)
}

/* ─── Input ────────────────────────────────────────────────────── */
#grid input[type="text"] {
  height: 48px;
  padding: 0 14px;
  font-size: 16px;
  background: var(--toss-bg-card);
  border: 1.5px solid var(--toss-border);
  border-radius: var(--toss-radius-input);
  color: var(--toss-text-strong);
  transition: border-color .15s, background .15s, box-shadow .15s
}

#grid .input-wrap > input[type="text"] {
  padding-right: 90px
}

#grid input[type="text"]:focus {
  background: var(--toss-bg-card);
  border-color: var(--toss-brand);
  box-shadow: 0 0 0 3px var(--toss-brand-10);
  outline: none
}

#grid input[type="text"].ok {
  background: var(--toss-up-tint);
  border-color: var(--toss-up);
  box-shadow: none
}

#grid input[type="text"].bad {
  background: var(--toss-down-tint);
  border-color: var(--toss-down);
  box-shadow: none
}

/* ─── 줄글 빈칸 ─────────────────────────────────────────────────── */
.passage-block {
  margin: 10px 0;
  font-size: 14px;
  color: var(--toss-text-primary);
  line-height: 2.8;
  word-break: keep-all
}

#tabs[data-ctx="edu"][data-item="총론"] .passage-block,
#tabs[data-ctx="edu"][data-item="창체"] .passage-block {
  --passage-marker-col: 34px;
  --passage-marker-gap: 8px;
  margin: 0;
  padding: 16px 0;
  border-bottom: 1px solid var(--toss-border)
}

#tabs[data-ctx="edu"][data-item="총론"] .passage-block.has-marker,
#tabs[data-ctx="edu"][data-item="창체"] .passage-block.has-marker {
  display: grid;
  grid-template-columns: var(--passage-marker-col) minmax(0, 1fr);
  column-gap: var(--passage-marker-gap);
  align-items: start
}

#tabs[data-ctx="edu"][data-item="총론"] .passage-block.is-indented,
#tabs[data-ctx="edu"][data-item="창체"] .passage-block.is-indented {
  padding-left: 20px
}

#tabs[data-ctx="edu"][data-item="총론"] .passage-block.is-deep,
#tabs[data-ctx="edu"][data-item="창체"] .passage-block.is-deep {
  padding-left: 44px
}

#tabs[data-ctx="edu"][data-item="총론"] .passage-block.indent-lv-1,
#tabs[data-ctx="edu"][data-item="창체"] .passage-block.indent-lv-1 {
  padding-left: 24px
}

#tabs[data-ctx="edu"][data-item="총론"] .passage-block.indent-lv-2,
#tabs[data-ctx="edu"][data-item="창체"] .passage-block.indent-lv-2 {
  padding-left: 56px
}

#tabs[data-ctx="edu"][data-item="총론"] .passage-block:last-child,
#tabs[data-ctx="edu"][data-item="창체"] .passage-block:last-child {
  border-bottom: 0;
  padding-bottom: 0
}

#tabs[data-ctx="edu"][data-item="총론"] .tabs-card h2 + .passage-block,
#tabs[data-ctx="edu"][data-item="창체"] .tabs-card h2 + .passage-block {
  padding-top: 8px
}

.passage-marker {
  display: block;
  color: var(--toss-text-primary);
  font-weight: 800;
  line-height: 2.8;
  text-align: right
}

.passage-body {
  display: inline
}

.passage-leading {
  margin-right: 8px;
  color: var(--toss-text-primary);
  font-weight: 800
}

.passage-inline-marker {
  margin-right: 8px;
  color: var(--toss-text-primary);
  font-weight: 800
}

.passage-block .input-wrap {
  display: inline-block !important;
  width: auto !important;
  margin-right: 1px;
  vertical-align: middle
}
.passage-block .input-wrap > input[type="text"] {
  padding-right: 8px !important
}
.passage-block .ghost-in {
  display: none
}
input[type="text"].inline-blank {
  position: relative;
  top: -4px;
  height: 30px;
  padding: 0 8px;
  font-size: 13px;
  border-radius: 8px;
  vertical-align: middle;
  text-align: center
}
#tabs input[type="text"].inline-blank {
  height: 30px !important;
  padding: 0 8px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
  text-align: center !important;
  background: var(--toss-bg-input);
  border: 1.5px solid var(--toss-border);
  color: var(--toss-text-strong)
}
#tabs[data-ctx="edu"] .passage-block .input-wrap > input[type="text"].inline-blank {
  padding-left: 8px !important;
  padding-right: 8px !important;
  text-align: center !important
}
#tabs input[type="text"].inline-blank.ok {
  background: var(--toss-up-tint);
  border-color: var(--toss-up);
  box-shadow: none
}
#tabs input[type="text"].inline-blank.bad {
  background: var(--toss-down-tint);
  border-color: var(--toss-down);
  box-shadow: none
}

/* ══════════════════════════════════════════════════════════════════
   Toss-style Board
   ══════════════════════════════════════════════════════════════════ */

/* ─── Toolbar ─────────────────────────────────────────────────── */
.board-toolbar {
  background: var(--toss-bg-card);
  border: none;
  border-radius: var(--toss-radius-card);
  box-shadow: var(--toss-shadow-card);
  padding: var(--toss-sp-2)
}

.board-toolbar-title {
  font-size: 15px;
  font-weight: var(--toss-fw-semibold);
  color: var(--toss-text-strong)
}

/* ─── Tabbar — 언더라인 탭 ────────────────────────────────────── */
.board-tabbar {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--toss-line);
  border-radius: 0;
  padding: 0;
  margin-top: 0;
  gap: 0;
  overflow-x: auto
}

.board-tabbar .tab-btn {
  background: transparent;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  margin-bottom: -1px;
  font-size: 14px;
  font-weight: var(--toss-fw-medium);
  color: var(--toss-text-secondary);
  transition: color .15s, border-color .15s
}

.board-tabbar .tab-btn:hover:not(.is-active) {
  color: var(--toss-text-primary);
  background: var(--toss-bg-input)
}

.board-tabbar .tab-btn.is-active {
  background: transparent;
  color: var(--toss-brand);
  border-bottom-color: var(--toss-brand);
  font-weight: var(--toss-fw-semibold)
}

/* ─── 글쓰기 버튼 ─────────────────────────────────────────────── */
#btnWrite,
#btnWrite.btn {
  background: var(--toss-brand);
  border: none;
  color: #fff;
  border-radius: var(--toss-radius-pill);
  font-weight: var(--toss-fw-semibold)
}

#btnWrite:hover {
  filter: brightness(0.88)
}

/* ─── 검색 input ──────────────────────────────────────────────── */
.board-actions input[type="text"],
.board-actions select {
  background: var(--toss-bg-input);
  border: 1.5px solid transparent;
  border-radius: var(--toss-radius-pill);
  color: var(--toss-text-primary);
  transition: border-color .15s, box-shadow .15s
}

.board-actions input[type="text"]:focus,
.board-actions select:focus {
  background: var(--toss-bg-card);
  border-color: var(--toss-brand);
  box-shadow: 0 0 0 3px var(--toss-brand-10);
  outline: none
}

/* ─── 목록 테이블 ─────────────────────────────────────────────── */
.board-table-wrap {
  border: none;
  border-radius: var(--toss-radius-card);
  box-shadow: var(--toss-shadow-card);
  background: var(--toss-bg-card)
}

.board-table th {
  background: transparent;
  color: var(--toss-text-tertiary);
  font-size: 11px;
  font-weight: var(--toss-fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--toss-line)
}

.board-table th,
.board-table td {
  border-bottom-color: var(--toss-line)
}

.board-table td {
  color: var(--toss-text-primary)
}

.board-table td.title .title-wrap a {
  color: var(--toss-text-strong)
}

.board-table tbody tr[data-href]:hover {
  background: var(--toss-brand-row)
}

.board-table .badge {
  background: var(--toss-bg-input);
  border-color: transparent;
  color: var(--toss-text-secondary)
}

.board-table .cmt {
  color: var(--toss-text-tertiary)
}

/* ─── 탭 뱃지 ────────────────────────────────────────────────── */
.tab-pill {
  background: var(--toss-bg-input);
  border-color: transparent;
  color: var(--toss-text-secondary)
}

.tab-pill.tab-success {
  background: var(--toss-up-tint);
  border-color: var(--toss-up-border);
  color: var(--toss-up)
}

.tab-pill.tab-materials {
  background: var(--toss-brand-tint);
  border-color: var(--toss-brand-border);
  color: var(--toss-brand)
}

.tab-pill.tab-study {
  background: rgba(251, 191, 36, 0.10);
  border-color: rgba(251, 191, 36, 0.35);
  color: #b45309
}

/* ─── 글쓰기 폼 ───────────────────────────────────────────────── */
.board-write {
  border: none;
  border-radius: var(--toss-radius-card);
  background: var(--toss-bg-card);
  box-shadow: var(--toss-shadow-card);
  padding: 20px
}

.board-write input[type="text"],
.board-write input[type="password"],
.board-write input[type="url"],
.board-write select,
.board-write textarea {
  background: var(--toss-bg-input);
  border: 1.5px solid transparent;
  border-radius: var(--toss-radius-input);
  color: var(--toss-text-strong);
  transition: border-color .15s, background .15s, box-shadow .15s
}

.board-write input[type="text"]:focus,
.board-write input[type="password"]:focus,
.board-write input[type="url"]:focus,
.board-write select:focus,
.board-write textarea:focus {
  background: var(--toss-bg-card);
  border-color: var(--toss-brand);
  box-shadow: 0 0 0 3px var(--toss-brand-10);
  outline: none
}

.board-write-title-top {
  background: var(--toss-bg-input);
  border: 1.5px solid transparent;
  border-radius: var(--toss-radius-input)
}

.board-write-title-top:focus {
  background: var(--toss-bg-card);
  border-color: var(--toss-brand);
  box-shadow: 0 0 0 3px var(--toss-brand-10);
  outline: none
}

.bw-editor {
  border-color: var(--toss-line);
  border-radius: var(--toss-radius-input)
}

.bw-attach {
  border-color: var(--toss-line);
  border-radius: var(--toss-radius-input);
  background: var(--toss-bg-page)
}

.bw-attach-btn {
  background: var(--toss-bg-card);
  border-color: var(--toss-border);
  border-radius: var(--toss-radius-lg)
}

.bw-attach-badge {
  background: var(--toss-bg-input);
  border-color: transparent;
  color: var(--toss-text-secondary)
}

/* ─── 게시글 상세 ─────────────────────────────────────────────── */
.board-page .card {
  border: none;
  background: var(--toss-bg-card);
  box-shadow: var(--toss-shadow-card);
  border-radius: var(--toss-radius-card)
}

.board-topline-inner {
  background: var(--toss-bg-card);
  border: none;
  box-shadow: var(--toss-shadow-card);
  border-radius: var(--toss-radius-card)
}

.board-topline-title {
  color: var(--toss-text-strong)
}

.board-meta-line {
  background: var(--toss-bg-page);
  border-color: var(--toss-line)
}

.bd-meta-label {
  font-weight: var(--toss-fw-semibold);
  color: var(--toss-text-tertiary)
}

.bd-like-btn {
  background: var(--toss-bg-card);
  border: 1px solid var(--toss-border);
  color: var(--toss-text-primary);
  border-radius: var(--toss-radius-pill);
  font-weight: var(--toss-fw-semibold)
}

/* ─── 페이지네이션 ────────────────────────────────────────────── */
.board-pager button {
  border: 1.5px solid var(--toss-border);
  border-radius: var(--toss-radius-pill);
  background: var(--toss-bg-card);
  color: var(--toss-text-secondary);
  font-size: 14px;
  padding: var(--toss-sp-1) var(--toss-sp-2);
  transition: background .15s, border-color .15s, color .15s
}

.board-pager button:hover {
  background: var(--toss-brand-tint);
  border-color: var(--toss-brand-border);
  color: var(--toss-brand)
}

.board-pager button[aria-current="page"],
.board-pager button.active {
  background: var(--toss-brand);
  border-color: var(--toss-brand);
  color: #fff;
  font-weight: var(--toss-fw-semibold)
}

/* [A] 세로비 기준 — iOS는 폰트 16px 미만 input에 포커스하면 화면을 자동확대한다.
   자동확대는 폭이 아니라 세로 화면에서 문제가 되므로 여기서는 비율 기준이 적절 */
@media (max-aspect-ratio: 3/4) {
  #tabs input[type="text"] {
    font-size: 16px;
    height: 40px
  }
}

/* ─── 모바일 목록 ─────────────────────────────────────────────── */
/* [B] 폭 기준 720px — 모바일 카드 스타일 */
@media (max-width: 720px) {
  .m-post {
    background: var(--toss-bg-card);
    border: none;
    border-radius: var(--toss-radius-card);
    box-shadow: var(--toss-shadow-card)
  }

  .m-post-title {
    color: var(--toss-text-strong)
  }

  .m-post-meta {
    color: var(--toss-text-tertiary);
    opacity: 1
  }
}

/* ─── 모바일 대문 위젯 순서: 문의 → 페이지 → 선생님 ──────────────── */
/* [B] 폭 기준 720px — 홈 위젯 세로 스택.
   주의: 이 규칙은 뷰포트 폭만 보므로 아이패드 세로(744~1024)에서는 발동하지 않는다.
   그런데 [A]는 이미 컨테이너를 720px로 좁혀놔서, 한 줄(816px 필요)에도 못 들어가고
   이 스택도 적용 안 되는 어중간한 구간이 생긴다. 상단 정책 주석의 [알려진 사각지대] 참고 */
@media (max-width: 720px) {
  .home-extras {
    flex-direction: column
  }

  /* column 전환 시 flex-basis는 높이로 해석되고 min-width는 좁은 폰에서 넘치므로,
     가로 배치용으로 준 flex/min-width를 여기서 되돌린다 */
  .home-extras-side,
  .city-widget {
    flex: 0 0 auto;
    min-width: 0;
    width: 100%
  }

  .home-extras-side {
    order: 1
  }

  .city-widget {
    order: 2
  }
}

/* ══════════════════════════════════════════════════════════════════
   Toss-style Common Elements
   ══════════════════════════════════════════════════════════════════ */

/* ─── 버튼 ─────────────────────────────────────────────────────── */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  height: auto;
  min-height: unset;
  padding: 8px 12px;
  border: 1.5px solid transparent;
  border-radius: var(--toss-radius-lg);
  font-size: 14px;
  font-weight: var(--toss-fw-semibold);
  cursor: pointer;
  background: var(--toss-bg-input);
  color: var(--toss-text-primary);
  transition: filter .15s, background .15s
}

.btn:hover {
  filter: brightness(.96)
}

.btn-green {
  background: var(--toss-brand);
  border-color: var(--toss-brand);
  color: #fff
}

.btn-red {
  background: transparent;
  border-color: var(--toss-border);
  color: var(--toss-text-secondary)
}

.btn-green:hover {
  filter: brightness(.92)
}

.btn-red:hover {
  background: var(--toss-surface-muted);
  filter: none
}

/* ─── 전역 input / select ──────────────────────────────────────── */
input[type="text"],
input[type="password"] {
  background: var(--toss-bg-input);
  border: 1.5px solid transparent;
  border-radius: var(--toss-radius-input);
  color: var(--toss-text-strong);
  transition: border-color .15s, background .15s, box-shadow .15s
}

input[type="text"]:focus,
input[type="password"]:focus {
  background: var(--toss-bg-card);
  border-color: var(--toss-brand);
  box-shadow: 0 0 0 3px var(--toss-brand-10);
  outline: none
}

#grid input[type="text"],
#tabs input[type="text"] {
  width: 100%;
  min-width: 0;
  background: #FFFFFF;
  border: 1.5px solid var(--toss-border);
  border-radius: var(--toss-radius-input);
  color: var(--toss-text-strong);
  text-align: left;
  -webkit-appearance: none;
  appearance: none
}

#grid input[type="text"]:focus,
#tabs input[type="text"]:focus {
  background: #FFFFFF;
  border-color: var(--toss-brand-focus);
  box-shadow: 0 0 0 3px var(--toss-brand-10);
  outline: none
}

#tabs .capture-title {
  font-size: 22px;
  font-weight: 700;
  color: #111;
  text-align: center;
  margin: 4px 0 18px
}


#tabs input[type="text"].ok {
  background: var(--toss-up-tint);
  border-color: var(--toss-up);
  box-shadow: none
}

#tabs input[type="text"].bad {
  background: var(--toss-down-tint);
  border-color: var(--toss-down);
  box-shadow: none
}

select {
  background: var(--toss-bg-input);
  border: 1.5px solid transparent;
  border-radius: var(--toss-radius-lg);
  color: var(--toss-text-primary);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s
}

select:focus {
  background: var(--toss-bg-card);
  border-color: var(--toss-brand);
  box-shadow: 0 0 0 3px var(--toss-brand-10);
  outline: none
}

/* ─── 안내 텍스트 ───────────────────────────────────────────────── */
.board-muted {
  color: var(--toss-text-tertiary);
  font-size: 14px
}


/* 위젯 두 개는 줄바꿈하지 않고 좁아지면 함께 줄어든다(nowrap + flex-shrink).
   폭이 모자랄 때 어중간하게 두 줄로 쪼개지던 문제를 없앤다 — 진짜 세로 스택은
   아래 [B] 720px 규칙이 폰에서만 담당한다. 상단 정책 주석 참고 */
.home-extras {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: stretch;
    gap: 16px;
    width: 100%
}

.home-extras .feedback-box {
    margin-top: 0
}

/* 기본 480px, 좁아지면 360px까지 줄어든다(늘어나지는 않음 - flex-grow 0) */
.home-extras-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 0 1 480px;
    min-width: 360px
}

.home-extras-side .feedback-box {
    width: 100%
}

.side-widget {
    flex: 1;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--toss-line);
    border-radius: 12px;
    background: #fff
}

.page-widget-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px
}

.page-widget-total {
    margin: 0;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--toss-text-secondary)
}

/* 기본 320px, 좁아지면 240px까지 줄어든다(늘어나지는 않음 - flex-grow 0) */
.city-widget {
    flex: 0 1 320px;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--toss-line);
    border-radius: 12px;
    background: #fff
}

.city-widget-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--toss-label);
    margin: 0
}

.city-widget-list {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.city-widget-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px
}

.city-widget-name {
    flex-shrink: 0;
    width: 64px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--toss-label)
}

.city-widget-bar-track {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #f1f3f5;
    overflow: hidden
}

.city-widget-bar-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: var(--toss-brand)
}

.page-widget-chart {
    display: flex;
    align-items: stretch;
    flex: 1;
    min-height: 0;
    gap: 6px
}

.page-widget-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px
}

.page-widget-value {
    font-size: 10px;
    font-weight: 600;
    color: var(--toss-text-secondary)
}

.page-widget-bar-track {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: flex-end;
    background: #f1f3f5;
    border-radius: 4px;
    overflow: hidden
}

.page-widget-bar-fill {
    width: 100%;
    border-radius: 4px 4px 0 0;
    background: var(--toss-brand)
}

.page-widget-label {
    width: 100%;
    flex-shrink: 0;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 10px;
    line-height: 1.3;
    color: var(--toss-label);
    word-break: keep-all
}

.city-widget-count {
    flex-shrink: 0;
    width: 34px;
    text-align: right;
    font-weight: 600
}

.city-widget-date {
    margin: 0;
    text-align: left;
    font-size: 11px;
    line-height: 1.4;
    color: var(--toss-text-tertiary)
}

.site-footer {
    max-width: 1080px;
    margin: 24px auto 0;
    padding: 16px 20px 32px;
    text-align: center;
    font-size: 12px
}

.site-footer a {
    color: var(--toss-text-tertiary);
    text-decoration: none
}

.site-footer a:hover {
    text-decoration: underline
}

/* ── 칩별 모드 툴바 (feat/chip-modes) ─────────────────────────────────── */
#tabs .mode-toolbar {
  column-span: all;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 16px 20px 10px;
  padding: 10px 16px;
  background: var(--toss-bg-card);
  border-radius: var(--toss-radius-card);
  box-shadow: var(--toss-shadow-card);
}

#tabs .mode-toolbar .mt-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--toss-text-tertiary);
  flex-shrink: 0;
}

#tabs .mode-toolbar .mt-level-wrap,
#tabs .mode-toolbar .mt-shuffle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#tabs .mode-toolbar .mt-seg {
  display: flex;
  background: #EFEFF1;
  border-radius: var(--toss-radius-pill);
  padding: 3px;
  flex-shrink: 0;
}

#tabs .mode-toolbar .mt-seg > button {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: var(--toss-radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--toss-text-secondary);
  white-space: nowrap;
  transition: background .15s, color .15s;
}

#tabs .mode-toolbar .mt-seg > button.is-on {
  background: #fff;
  color: var(--toss-brand);
  font-weight: var(--toss-fw-bold);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .10);
}

#tabs .mode-toolbar .mt-toggle {
  position: relative;
  width: 38px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: var(--toss-radius-pill);
  background: rgba(0, 0, 0, .16);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}

#tabs .mode-toolbar .mt-toggle.is-on {
  background: var(--toss-brand);
}

#tabs .mode-toolbar .mt-toggle i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: left .15s;
}

#tabs .mode-toolbar .mt-toggle.is-on i {
  left: 18px;
}

#tabs .mode-toolbar .mt-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

#tabs .mode-toolbar .mt-actions .btn {
  white-space: nowrap;
}

/* 모바일에서만 쓰는 "설정" 버튼(2b 시안) — 데스크톱은 항상 숨김 */
#tabs .mode-toolbar .mt-settings-btn {
  position: relative;
  display: none;
  border: 0;
  background: #EFEFF1;
  color: var(--toss-text-secondary);
  border-radius: var(--toss-radius-pill);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
}

#tabs .mode-toolbar .mt-settings-btn .mt-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--toss-brand);
  display: none;
}

#tabs .mode-toolbar .mt-settings-btn.has-change .mt-badge {
  display: block;
}

/* 난이도 '상': 힌트(ghost-in) 숨김. '하'는 보류(다음 단계) */
#tabs.mode-hard .ghost-in {
  display: none;
}

/* [B] 폭 720px 이하 — 2b: 채점방식 칩 + "설정" 버튼만 한 줄, 난이도/순서섞기는 설정 시트로 */
@media (max-width: 720px) {
  #tabs .mode-toolbar {
    gap: 10px;
    margin: 12px 12px 8px;
    padding: 8px 12px;
  }
  #tabs .mode-toolbar .mt-settings-btn {
    display: inline-flex;
    align-items: center;
  }
  #tabs .mode-toolbar .mt-level-wrap,
  #tabs .mode-toolbar .mt-shuffle-wrap {
    display: none;
    width: 100%;
    order: 10;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid rgba(0, 0, 0, .06);
  }
  #tabs .mode-toolbar.sheet-open .mt-level-wrap,
  #tabs .mode-toolbar.sheet-open .mt-shuffle-wrap {
    display: flex;
  }
  #tabs .mode-toolbar .mt-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    order: 20;
  }
}
