/*
 * forBible — '서재' 화면 꼴 (2026-11-15)
 *
 * claude.ai/design 캔버스 'forBible 새 화면'(메인·노트 목록·노트 보기·노트 편집)을
 * 옮긴 것. **색은 하나도 박지 않는다** — 모두 `themes.css` 의 토큰이다. 그래서
 * 계절 테마·밝기를 바꿔도 따라간다. '서재' 테마가 캔버스의 색 그대로다.
 *
 * ⚠ **글꼴을 적지 않는다.** 모두 `inherit` — 몸의 `--site-font`(사용자가 고른 글꼴)를
 *   따라간다. 처음에 제목·구절에 명조(`--serif`)를 박았더니 고른 글꼴이 그 자리들에만
 *   안 먹었다(2026-11-15, 사용자가 찾음).
 * ⚠ 이름은 모두 `fb-` 로 시작한다. Bootstrap·neumorphism.css 의 `.card`·`.btn`
 *   과 섞이지 않게. 남의 꼴이 `button` 에 그림자를 박아 두어서, `.fb-btn` 은
 *   `box-shadow:none` 을 스스로 적는다.
 * ⚠ 운영의 /static/ 은 nginx 경로다. 이 파일은 그쪽에 **심볼릭 링크**로 걸려
 *   있다(themes.css 와 같은 길). 새 파일을 더하면 링크도 걸 것.
 */

.fb-page { max-width: 1200px; margin: 0 auto; padding: 28px 20px 72px; color: var(--text-primary); }
.fb-page--wide { max-width: 1320px; }
/* base.html 이 내용을 Bootstrap `.container`(최대 1140px) 안에 넣는다. 세 칸 화면은
   그 밖으로 넓힌다 — 가운데 맞춘 채 화면 폭(양옆 16px)까지. */
.fb-bleed { width: min(var(--fb-bleed, 1380px), calc(100vw - 32px)); max-width: none;
            margin-left: calc(50% - min(var(--fb-bleed, 1380px), calc(100vw - 32px)) / 2); }
.fb-page h1, .fb-page h2, .fb-page h3 { color: var(--text-primary); }

.fb-serif { font-family: inherit; }
.fb-muted { color: var(--text-muted); }
.fb-soft { color: var(--text-secondary); }
.fb-small { font-size: 0.875rem; }
.fb-xs { font-size: 0.8125rem; }
.fb-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 칸 */
.fb-card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: none;
}
.fb-card--pad { padding: 22px 26px; }
.fb-card--tight { padding: 14px 18px; }
.fb-stack { display: flex; flex-direction: column; gap: 12px; }
.fb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fb-split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.fb-split > .fb-main { flex: 999 1 560px; min-width: 0; }
.fb-split > .fb-side { flex: 1 1 260px; min-width: 0; }
.fb-grow { flex: 1 1 auto; min-width: 0; }

/* 단추 — 링크든 button 이든 같은 꼴 */
.fb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-card);
  color: var(--text-primary); font: inherit; font-size: 0.9375rem; line-height: 1;
  text-decoration: none; cursor: pointer; box-shadow: none; white-space: nowrap;
}
.fb-btn:hover { background: var(--surface-sunken); color: var(--text-primary); text-decoration: none; }
.fb-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fb-btn--primary { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent, #fff); font-weight: 600; }
.fb-btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--text-on-accent, #fff); }
.fb-btn--ink { background: var(--text-primary); border-color: var(--text-primary); color: var(--surface-bg); }
.fb-btn--ink:hover { background: var(--text-tertiary); color: var(--surface-bg); }
.fb-btn--ghost { background: transparent; border-color: transparent; }
.fb-btn--danger { color: var(--danger); }
.fb-btn--sm { height: 34px; padding: 0 10px; font-size: 0.8125rem; border-radius: 8px; }
.fb-btn--icon { width: 40px; padding: 0; }
.fb-btn--sm.fb-btn--icon { width: 34px; }
.fb-btn[aria-pressed="true"], .fb-btn.is-on { background: var(--text-primary); border-color: var(--text-primary); color: var(--surface-bg); }

/* 단추 묶음(정렬 고르기) */
.fb-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-card); }
.fb-seg > * { height: 40px; padding: 0 14px; border: 0; background: transparent; color: var(--text-primary);
  font: inherit; font-size: 0.9375rem; display: inline-flex; align-items: center; text-decoration: none; box-shadow: none; }
.fb-seg > *:hover { background: var(--surface-sunken); text-decoration: none; color: var(--text-primary); }
.fb-seg > .is-on, .fb-seg > [aria-pressed="true"] { background: var(--text-primary); color: var(--surface-bg); }

/* 알약 */
.fb-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px;
  border-radius: 999px; background: var(--surface-sunken); color: var(--text-secondary);
  font-size: 0.8125rem; text-decoration: none; white-space: nowrap;
}
.fb-chip:hover { color: var(--text-primary); text-decoration: none; }
.fb-chip--accent { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.fb-chip--line { background: transparent; border: 1px solid var(--line); border-radius: 6px; }

/* 입력 */
.fb-input {
  height: 44px; box-sizing: border-box; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-card); color: var(--text-primary);
  font: inherit; box-shadow: none;
}
.fb-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.fb-label { font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); }

/* 줄 목록 */
.fb-list { list-style: none; margin: 0; padding: 0; }
.fb-list > li, .fb-line {
  display: flex; align-items: center; gap: 12px; min-height: 52px;
  padding: 6px 0; border-bottom: 1px solid var(--line);
}
.fb-list > li:last-child { border-bottom: 0; }

/* 섹션 제목 */
.fb-kicker { margin: 0; font-size: 0.875rem; color: var(--text-muted); }
.fb-h { margin: 0; font-family: inherit; font-weight: 700; letter-spacing: -0.01em; color: var(--text-primary); }
.fb-h--xl { font-size: 2rem; line-height: 1.4; }
.fb-h--l { font-size: 1.5rem; line-height: 1.45; }
.fb-h--m { font-size: 1.25rem; line-height: 1.45; }
.fb-h--s { font-size: 1rem; font-family: inherit; font-weight: 600; }

/* 탭(밑줄) */
.fb-tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 8px 0; border-bottom: 1px solid var(--line); background: var(--surface-sunken); }
.fb-tabs .nav-link, .fb-tabs > button, .fb-tabs > a {
  height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px;
  border: 0 !important; border-bottom: 2px solid transparent !important; border-radius: 0 !important;
  background: transparent !important; color: var(--text-secondary) !important; font-size: 0.875rem;
  box-shadow: none !important; text-decoration: none;
}
.fb-tabs .nav-link.active, .fb-tabs > .is-on { border-bottom-color: var(--accent) !important; color: var(--text-primary) !important; font-weight: 600; }

/* 칸 머리 · 접히는 메뉴 */
.fb-menu {
  min-width: 220px; padding: 6px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-card); box-shadow: 0 10px 28px rgba(34, 32, 28, 0.16);
}
.fb-menu .dropdown-item, .fb-menu > button, .fb-menu > a {
  display: flex; align-items: center; width: 100%; min-height: 40px; padding: 0 12px; border: 0;
  border-radius: 8px; background: transparent; color: var(--text-primary); font: inherit; font-size: 0.875rem;
  text-align: left; text-decoration: none; box-shadow: none;
}
.fb-menu .dropdown-item:hover, .fb-menu > button:hover, .fb-menu > a:hover { background: var(--surface-sunken); color: var(--text-primary); }

/* 토스트 — alert 창 대신 */
.fb-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 2000; transform: translateX(-50%) translateY(16px);
  max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 12px;
  background: var(--text-primary); color: var(--surface-bg); font-size: 0.9375rem;
  opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 180ms ease;
}
.fb-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 칸 네 개 '오늘 할 것' */
.fb-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.fb-tile {
  display: flex; flex-direction: column; gap: 2px; padding: 18px 22px; border-radius: 14px;
  background: var(--surface-card); border: 1px solid var(--line); color: var(--text-primary); text-decoration: none;
}
.fb-tile:hover { border-color: var(--accent); color: var(--text-primary); text-decoration: none; }
.fb-tile__k { font-size: 0.875rem; color: var(--text-muted); }
.fb-tile__v { font-family: inherit; font-size: 1.75rem; font-weight: 600; line-height: 1.35; }
.fb-tile__v small { font-family: inherit; font-size: 0.9375rem; color: var(--text-muted); font-weight: 400; }
.fb-tile__s { font-size: 0.8125rem; color: var(--text-muted); }

@media (max-width: 640px) {
  .fb-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .fb-tabs > li, .fb-tabs .nav-link { flex: 0 0 auto; white-space: nowrap; }
  .fb-page { padding: 18px 14px 96px; }
  .fb-card--pad { padding: 18px 18px; }
  .fb-h--xl { font-size: 1.5rem; }
  .fb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .fb-tile { padding: 14px 16px; }
  .fb-tile__v { font-size: 1.375rem; }
}

/* ── 위 메뉴 · 아래 탭 (base.html) ─────────────────────────────── */
.navbar.fb-nav { background: var(--surface-card) !important; border-bottom: 1px solid var(--line); box-shadow: none !important;
                 position: relative; z-index: 1050; min-height: 64px; }
.fb-nav .fb-nav__brand { font-family: inherit; font-weight: 700; font-size: 1.25rem; color: var(--text-primary) !important;
                         padding: 6px 4px; border: 0; box-shadow: none; background: transparent; letter-spacing: -0.01em; }
.fb-nav .fb-nav__brand i { color: var(--accent); }
.fb-nav__links .nav-link { padding: 9px 12px !important; margin: 0 1px; border-radius: 8px; color: var(--text-secondary) !important;
                           font-size: 0.9375rem; box-shadow: none !important; background: transparent !important; border: 0 !important; }
.fb-nav__links .nav-link:hover { background: var(--surface-sunken) !important; color: var(--text-primary) !important; }
.fb-nav__links .nav-link.active { background: var(--surface-sunken) !important; color: var(--text-primary) !important; font-weight: 600; }
.fb-nav .nav-icon-btn { box-shadow: none !important; border: 1px solid var(--line) !important; background: var(--surface-card) !important; }
/* 메뉴 글자는 꺾이지 않는다. 992–1199px(Bootstrap lg 칸 960px)에선 칸이 좁아 '훈련 개요' 가
   '훈련 개 / 요' 로, 두 글자 메뉴는 세로로 한 자씩 꺾였다 → 간격·글 크기·찾기 칸을 줄인다. */
.fb-nav__links .nav-link { white-space: nowrap; }
@media (min-width: 992px) and (max-width: 1199.98px) {
  .fb-nav .fb-nav__brand { font-size: 1.125rem; }
  .fb-nav__links.ml-3 { margin-left: 6px !important; }
  .fb-nav__links .nav-link { padding: 8px 9px !important; font-size: 0.875rem; }
  .fb-nav .fb-navsearch { width: 150px; }
  .fb-nav .fb-navsearch kbd { display: none; }
}

.fb-tabbar { display: none; }
@media (max-width: 991.98px) {
  .fb-tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
    height: calc(62px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface-card); border-top: 1px solid var(--line);
  }
  .fb-tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
                 color: var(--text-muted); font-size: 0.75rem; text-decoration: none; }
  .fb-tabbar a i { font-size: 1.25rem; line-height: 1; }
  .fb-tabbar a[aria-current="page"] { color: var(--accent); font-weight: 600; }
  /* 노트 탭 검토 알림 숫자(2026-11-17) */
  .fb-tab-ic { position: relative; display: inline-flex; }
  .fb-tab-badge { position: absolute; top: -6px; left: calc(100% - 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
                  background: #d0342c; color: #fff; font-size: 0.6875rem; font-weight: 700; line-height: 18px; text-align: center;
                  font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--surface-card); white-space: nowrap; }
  body.has-tabbar { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  body.has-tabbar .fb-jump { bottom: calc(62px + 14px + env(safe-area-inset-bottom)); right: 14px; }
  body.has-tabbar footer { margin-bottom: 0; }
}
@media print { .fb-tabbar, .fb-jump { display: none !important; } }

/* 검토 알림 숫자 — 0 이면 숨김(base.html 이 늘 그려 두고 스크립트가 새로고침 없이 고친다, 2026-11-20) */
.fb-arc-zero, .fb-btn.fb-arc-zero, .badge.fb-arc-zero { display: none !important; }

/* 맨 위·맨 아래 단추(2026-11-20) — base.html `#fbJump`. 굴릴 때만 나타나고 쉬면 사라진다.
   모달(1040~)·읽기 창(2000) 아래, 아래 탭(1040)과 같은 층. 색은 토큰만. */
.fb-jump { position: fixed; right: 20px; bottom: 20px; z-index: 1035; display: flex; flex-direction: column; gap: 0;
           border: 1px solid var(--line); border-radius: 999px; background: var(--surface-card); overflow: hidden;
           box-shadow: 0 8px 24px -8px rgba(34, 32, 28, 0.28), 0 2px 6px rgba(34, 32, 28, 0.08);
           opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.fb-jump.is-on { opacity: 1; transform: none; pointer-events: auto; }
.fb-jump__btn { display: grid; place-items: center; width: 42px; height: 42px; margin: 0; padding: 0; border: 0; border-radius: 0;
                background: transparent; color: var(--text-secondary); cursor: pointer; box-shadow: none; }
.fb-jump__btn[hidden] { display: none; }
.fb-jump__btn + .fb-jump__btn:not([hidden]) { border-top: 1px solid var(--line); }
.fb-jump__btn:hover { background: var(--surface-sunken); color: var(--accent); }
.fb-jump__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.fb-jump__btn:active { background: var(--accent-soft); }
.fb-jump__btn svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .fb-jump { transition: none; } }

/* ── 어두운 쪽 ──
 * themes.css 가 어두울 때 **모든 `a`** 를 강조색으로 칠한다(`:is(...) a`). 그 규칙이
 * `.fb-btn--primary` 보다 세서, 링크로 된 단추는 강조색 바탕에 강조색 글자가 되어 안 보였다
 * (어두운 '서재' 로 찍어 보고 찾음). 링크 꼴 부품은 같은 앞가지로 다시 적는다. */
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) a.fb-btn,
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) .fb-seg > a,
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) a.fb-tile,
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) .fb-menu a { color: var(--text-primary); }
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) a.fb-btn--primary,
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) a.fb-btn--primary:hover { color: var(--text-on-accent); }
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) a.fb-btn--ink { color: var(--surface-bg); }
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) .fb-seg > a.is-on { color: var(--surface-bg); }
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) a.fb-chip { color: var(--text-secondary); }
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) a.fb-chip--accent { color: var(--accent-strong); }

/* ── 읽는 글(노트 본문) — `.fb-prose` ───────────────────────────────
 * 코드는 코드답게(고정폭·가로 굴림·언어 이름·복사), 인용·표·머리말을 또렷하게.
 * ⚠ 남의 꼴(neumorphism·Bootstrap)이 blockquote 에 회색 상자·기울임을, code 에 분홍을
 *   박아 두었다. 여기서 되돌린다. 글꼴은 몸의 `--site-font`, 코드만 고정폭. */
.fb-prose { --code-font: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'D2Coding', monospace; }
.fb-prose > :first-child { margin-top: 0; }
.fb-prose h1, .fb-prose h2, .fb-prose h3, .fb-prose h4 { color: var(--text-primary); font-weight: 700; letter-spacing: -0.01em; line-height: 1.4; }
.fb-prose h1 { font-size: 1.6em; margin: 1.6em 0 0.6em; }
.fb-prose h2 { font-size: 1.35em; margin: 1.6em 0 0.55em; padding-bottom: 0.3em; border-bottom: 1px solid var(--line); }
.fb-prose h3 { font-size: 1.15em; margin: 1.4em 0 0.5em; }
.fb-prose h4, .fb-prose h5, .fb-prose h6 { font-size: 1em; margin: 1.2em 0 0.4em; }
.fb-prose p { margin: 0 0 0.9em; }
.fb-prose ul, .fb-prose ol { margin: 0 0 1em; padding-left: 1.5em; }
.fb-prose li { margin: 0.25em 0; }
.fb-prose li > ul, .fb-prose li > ol { margin: 0.25em 0 0.25em; }
.fb-prose li > p { margin: 0 0 0.4em; }
.fb-prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.fb-prose a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.fb-prose img { max-width: 100%; height: auto; border-radius: 8px; }
.fb-prose del, .fb-prose s { color: var(--text-muted); }

.fb-prose blockquote {
  margin: 1em 0 1.2em; padding: 0.2em 0 0.2em 1.1em !important;
  border: 0 !important; border-left: 3px solid var(--accent) !important; border-radius: 0 !important;
  background: transparent !important; box-shadow: none !important;
  color: var(--text-secondary); font-style: normal !important;
}
.fb-prose blockquote > :last-child { margin-bottom: 0; }

/* 글 속 코드 */
.fb-prose :not(pre) > code {
  font-family: var(--code-font); font-size: 0.86em; padding: 0.12em 0.4em; border-radius: 5px;
  background: var(--surface-sunken); color: var(--text-primary); border: 1px solid var(--line); word-break: break-word;
}

/* 코드 덩이 — `.fb-code` 틀은 스크립트가 씌운다(언어 이름·복사 단추) */
.fb-prose pre, .fb-prose .codehilite {
  margin: 0; padding: 0; background: transparent; border: 0; box-shadow: none;
}
.fb-code { margin: 1em 0 1.3em; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-sunken); }
.fb-code__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 34px; padding: 0 6px 0 14px;
                border-bottom: 1px solid var(--line); font-size: 0.75rem; color: var(--text-muted); font-family: var(--code-font); }
.fb-code__copy { height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-card);
                 color: var(--text-secondary); font: inherit; font-size: 0.75rem; cursor: pointer; box-shadow: none; }
.fb-code__copy:hover { color: var(--text-primary); }
.fb-prose pre code, .fb-prose pre code.hljs, .markdown-content.fb-prose pre code {
  display: block; margin: 0; padding: 14px 16px !important; overflow-x: auto; white-space: pre; tab-size: 4;
  background: transparent !important; color: var(--text-primary); border: 0; border-radius: 0;
  font-family: var(--code-font) !important; font-size: 0.85em; line-height: 1.65;
}
.fb-prose .hljs-ln { border-collapse: collapse; width: 100%; margin: 0; display: table; }
.fb-prose .hljs-ln tr, .fb-prose .hljs-ln td { background: transparent !important; border: 0 !important; box-shadow: none !important; }
.fb-prose .hljs-ln td { padding: 0; border: 0 !important; background: transparent !important; }
.fb-prose .hljs-ln-numbers { color: var(--text-muted) !important; border-right: 1px solid var(--line) !important; padding: 0 10px 0 0 !important;
                             text-align: right !important; min-width: 2.2em; opacity: 0.8; }
.fb-prose .hljs-ln-code { padding-left: 12px !important; }

/* 표 */
.fb-prose table:not(.hljs-ln) { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1em 0 1.3em; font-size: 0.92em; }
.fb-prose table:not(.hljs-ln) :is(th, td) { padding: 8px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.fb-prose table:not(.hljs-ln) th { background: var(--surface-sunken); font-weight: 600; }
.fb-prose table:not(.hljs-ln) tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-sunken) 45%, transparent); }

/* 어두울 때 코드 색 — atom-one-light 는 밝은 바탕용이라 어두우면 안 읽힌다 */
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) .fb-prose .hljs { color: #d8dee9; }
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) .fb-prose :is(.hljs-keyword, .hljs-selector-tag, .hljs-built_in) { color: #c792ea; }
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) .fb-prose :is(.hljs-string, .hljs-attr, .hljs-addition) { color: #a5d6a7; }
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) .fb-prose :is(.hljs-number, .hljs-literal, .hljs-symbol) { color: #f7c56b; }
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) .fb-prose :is(.hljs-title, .hljs-section, .hljs-name, .hljs-function) { color: #82aaff; }
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) .fb-prose :is(.hljs-comment, .hljs-quote, .hljs-meta) { color: #8c95a5; }
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) .fb-prose :is(.hljs-variable, .hljs-template-variable, .hljs-type, .hljs-params) { color: #f2a37a; }
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) .fb-prose a { color: var(--accent); }

/* 위 메뉴 찾기 칸 (V2) — '/' 로 들어간다 */
.fb-navsearch { align-items: center; gap: 8px; height: 38px; width: 230px; padding: 0 8px 0 12px; border: 1px solid var(--line); border-radius: 10px;
                background: var(--surface-bg); color: var(--text-muted); margin: 0; }
.fb-navsearch:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--surface-card); }
.fb-navsearch input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: 0.875rem; outline: none; box-shadow: none; padding: 0; }
.fb-navsearch kbd { padding: 1px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-card); color: var(--text-muted);
                    font-family: inherit; font-size: 0.75rem; box-shadow: none; }
.fb-navsearch:focus-within kbd { display: none; }
@media (max-width: 1199px) { .fb-navsearch { width: 170px; } }

/* 위치(브레드크럼) — 밑줄 없는 흐린 글, 사이는 가는 꺾쇠. 긴 이름은 한 줄로 줄인다. */
.fb-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; font-size: 0.8125rem; }
.fb-crumbs li { display: inline-flex; align-items: center; min-width: 0; margin: 0; padding: 0; font-size: inherit; line-height: 1.4; color: var(--text-muted); }
.fb-crumbs li + li::before { content: ''; flex: none; width: 5px; height: 5px; margin: 0 8px 0 6px; border-top: 1.5px solid currentColor;
                             border-right: 1.5px solid currentColor; transform: rotate(45deg); opacity: 0.55; }
.fb-crumbs a { max-width: 16em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 6px; margin: 0 -2px; border-radius: 6px;
               color: var(--text-secondary) !important; text-decoration: none !important; }
.fb-crumbs a:hover { background: var(--surface-sunken); color: var(--text-primary) !important; }
.fb-crumbs a:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.fb-crumbs li:last-child a { color: var(--text-primary) !important; font-weight: 500; }
.fb-crumbs li[aria-current] { padding: 3px 4px; color: var(--text-muted); }
@media (max-width: 640px) { .fb-crumbs a { max-width: 10em; } }

/* 플래시 토스트 — 오른쪽 위에 쌓인다. 왼쪽 색 띠로 종류를 가른다(색은 토큰). */
.fb-toasts { position: fixed; top: 88px; right: 20px; z-index: 2100; display: flex; flex-direction: column; gap: 10px;
             width: min(380px, calc(100vw - 28px)); pointer-events: none; }
.fb-note { --note: var(--accent); display: flex; align-items: flex-start; gap: 10px; padding: 12px 10px 12px 14px;
           border: 1px solid var(--line); border-radius: 12px; background: var(--surface-card); color: var(--text-primary);
           box-shadow: inset 3px 0 0 var(--note), 0 10px 28px rgba(34, 32, 28, 0.16); pointer-events: auto;
           opacity: 0; transform: translateY(-8px); transition: opacity 180ms ease, transform 180ms ease; }
.fb-note.is-on { opacity: 1; transform: none; }
.fb-note.is-off { opacity: 0; transform: translateX(16px); }
.fb-note--success { --note: var(--success); }
.fb-note--danger { --note: var(--danger); }
.fb-note--warning { --note: var(--warning); }
.fb-note__icon { flex: none; width: 22px; height: 22px; margin-top: 1px; display: inline-flex; align-items: center; justify-content: center;
                 border-radius: 999px; background: var(--note); color: var(--surface-card); font-size: 0.75rem; font-weight: 700; line-height: 1; }
.fb-note--warning .fb-note__icon { color: #22201c; }
.fb-note__msg { flex: 1; min-width: 0; margin: 0 !important; font-size: 0.9375rem !important; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.fb-note__x { flex: none; width: 28px; height: 28px; margin: -3px 0 -3px 0; border: 0; border-radius: 8px; background: transparent;
              color: var(--text-muted); font-size: 1.25rem; line-height: 1; box-shadow: none; cursor: pointer; }
.fb-note__x:hover { background: var(--surface-sunken); color: var(--text-primary); }
.fb-note__x:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 640px) {
  .fb-toasts { top: auto; right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); flex-direction: column-reverse; }
}
@media (prefers-reduced-motion: reduce) { .fb-note, .fb-note.is-off { transition: none; transform: none; } }

/* 내용이 짧은 화면에서 바닥글이 화면 가운데 떠 있지 않게(데스크톱만 — 휴대폰은 아래 탭이 바닥이다).
   180px ≈ 위 메뉴 65 + 위 여백 24 + 바닥글 58 + 그 위 여백 32. */
/* 바닥글을 화면 아래에 — 이름을 fb-split 의 .fb-main 과 겹치지 말 것(카드가 화면 높이로 늘어난다) */
@media (min-width: 992px) { .fb-content { min-height: calc(100vh - 180px); } }

/* ── 확인 창 `.fb-dialog` — Bootstrap `.modal` 위에 얹는다 ─────────────────────
   노트 보기의 옛 모달 규칙(휴대폰에서 높이 100vh · 회색 머리·발 띠 · 본문 padding 0 · 제목 가운데)을
   여기서 되돌린다 — 그 규칙은 첨부 미리보기 창 몫이라 그대로 둔다. 색은 토큰만. */
.modal.fb-dialog .modal-dialog { max-width: 420px; width: calc(100% - 32px); height: auto; min-height: calc(100% - 3.5rem);
  margin: 1.75rem auto; display: flex; align-items: center; justify-content: center; max-height: none; }
.modal.fb-dialog .modal-content { position: relative; width: 100%; max-width: none; height: auto; max-height: calc(100vh - 3.5rem);
  overflow: auto; padding: 0; background: var(--surface-card); color: var(--text-primary); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 24px 64px -24px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .08); }
.modal.fb-dialog .modal-body { display: block; height: auto; overflow: visible; padding: 26px 24px 6px; }
.modal.fb-dialog .modal-footer { display: flex; gap: 8px; justify-content: flex-end; height: auto; padding: 18px 24px 22px;
  border: 0; background: transparent; }
.modal.fb-dialog .modal-footer > * { margin: 0; }
.fb-dialog__close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); font-size: 1.375rem; line-height: 1; cursor: pointer; }
.fb-dialog__close:hover, .fb-dialog__close:focus-visible { background: var(--surface-sunken); color: var(--text-primary); }
.fb-dialog__icon { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 0 14px; border-radius: 50%;
  background: color-mix(in srgb, var(--danger) 12%, var(--surface-card)); color: var(--danger); }
.fb-dialog__icon svg { width: 22px; height: 22px; }
.modal.fb-dialog .fb-dialog__title { margin: 0 0 6px; width: auto; white-space: normal; text-align: left; overflow: visible;
  font-size: 1.1875rem; font-weight: 700; line-height: 1.35; color: var(--text-primary); }
.fb-dialog__lead { margin: 0; font-size: 0.9375rem; line-height: 1.55; color: var(--text-secondary); }
.fb-dialog__target { margin: 14px 0 0; padding: 11px 14px; border-radius: 12px; background: var(--surface-sunken);
  font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; color: var(--text-primary); }
.fb-dialog__warn { margin: 12px 0 0; padding: 11px 14px; border-radius: 12px; font-size: 0.875rem; line-height: 1.5;
  background: color-mix(in srgb, var(--danger) 9%, var(--surface-card)); color: var(--text-primary);
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); }
.fb-dialog__warn ul { margin: 6px 0 0; padding-left: 1.2em; color: var(--text-secondary); }
.fb-dialog__check { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; font-size: 0.875rem; cursor: pointer; }
.fb-dialog__check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--danger); flex: none; }
.fb-btn--destroy { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
.fb-btn--destroy:hover { background: color-mix(in srgb, var(--danger) 85%, #000); border-color: transparent; color: #fff; }
.fb-btn--destroy:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 575.98px) {
  .modal.fb-dialog .modal-dialog { width: calc(100% - 24px); }
  .modal.fb-dialog .modal-footer > .fb-btn { flex: 1 1 0; justify-content: center; min-height: 46px; }
}
.fb-dialog__warn li { font-size: inherit; line-height: 1.5; }   /* neumorphism 가 li 를 20px 로 박는다 */
/* 모달 뒤 막 — neumorphism 이 밝은 회색(#e6e7ee)을 0.9 로 깔아 어두운 테마에서도 하얗게 덮였다. 모든 모달에 건다. */
.modal-backdrop { background-color: #15130f; }
.modal-backdrop.show { opacity: .42; }
:is(body.site-mode-dark, html[data-dark] body.site-mode-auto) .modal-backdrop.show { opacity: .62; }

/* ── 노트 줄 목록 `.uc-` — 한 분류·한 태그·오픈 노트·받은 공유 노트가 함께 쓴다(2026-11-16) ── */
  .uc-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 22px; }
  .uc-kicker { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 0.8125rem; font-weight: 600; color: var(--accent-strong); }
  .uc-kicker svg { width: 15px; height: 15px; }
  .uc-sub { margin: 6px 0 0; font-size: 0.875rem; color: var(--text-muted); }
  .uc-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
  /* 아이폰 사파리는 입력 칸의 기본 폭(size 20 × 글자 폭)을 줄일 수 없는 폭으로 친다 — 찾기 줄이 버텨
     「찾기」 단추가 화면 밖으로 나갔다(2026-11-19). 줄·칸·입력 모두 0 까지 줄 수 있게. */
  .uc-tools > *, .uc-search { min-width: 0; }
  .uc-tools > * { max-width: 100%; }
  .uc-search > svg, .uc-tools .fb-btn { flex: none; }
  .uc-search { display: flex; align-items: center; gap: 10px; flex: 1 1 280px; height: 44px; margin: 0; padding: 0 14px;
               border: 1px solid var(--line); border-radius: 10px; background: var(--surface-card); color: var(--text-muted); }
  .uc-search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
  .uc-search input { flex: 1; width: 0; min-width: 0; border: 0; background: transparent; color: var(--text-primary); font: inherit; outline: none; box-shadow: none; }
  .uc-seg { display: inline-flex; height: 44px; padding: 3px; box-sizing: border-box; border-radius: 10px; background: var(--surface-sunken); }
  .uc-seg a { display: inline-flex; align-items: center; padding: 0 12px; border-radius: 8px; color: var(--text-secondary); font-size: 0.875rem; text-decoration: none; white-space: nowrap; }
  .uc-seg a:hover { color: var(--text-primary); text-decoration: none; }
  .uc-seg a.is-on { background: var(--surface-card); color: var(--text-primary); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
  .uc-list { margin: 0; padding: 0; list-style: none; background: var(--surface-card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
  .uc-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
  .uc-item:last-child { border-bottom: 0; }
  .uc-item:hover { background: var(--surface-bg); }
  .uc-title { min-width: 0; font-weight: 600; color: var(--text-primary); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .uc-title:hover { color: var(--accent); text-decoration: none; }
  .uc-date { font-size: 0.8125rem; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; align-self: center; }
  .uc-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 0.8125rem; color: var(--text-muted); }
  .uc-meta .uc-in { display: inline-block; max-width: 20em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
  .uc-meta .uc-in svg { width: 12px; height: 12px; margin-right: 3px; vertical-align: -1px; }
  .uc-by { padding: 0 7px; border: 1px solid var(--line); border-radius: 6px; font-size: 0.75rem; color: var(--text-muted); }
  .uc-tag { padding: 1px 8px; border-radius: 999px; background: var(--surface-sunken); color: var(--text-secondary); font-size: 0.75rem; }
  .uc-ex { grid-column: 1 / -1; margin: 2px 0 0; font-size: 0.875rem; line-height: 1.55; color: var(--text-secondary);
           display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .uc-new { width: 7px; height: 7px; border-radius: 999px; background: var(--accent); display: inline-block; margin-left: 6px; vertical-align: middle; }
  .uc-empty { padding: 32px 20px; text-align: center; color: var(--text-secondary); }
  .uc-pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
  .uc-pager a, .uc-pager span { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px;
                                border-radius: 10px; font-size: 0.875rem; text-decoration: none; }
  .uc-pager a { border: 1px solid var(--line); background: var(--surface-card); color: var(--text-secondary); }
  .uc-pager a:hover { background: var(--surface-sunken); color: var(--text-primary); text-decoration: none; }
  .uc-pager .is-on { background: var(--accent); color: var(--text-on-accent, #fff); font-weight: 600; }
  .uc-pager .is-gap { color: var(--text-muted); }
  .uc-side a { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 8px; border-radius: 8px;
               color: var(--text-secondary); font-size: 0.875rem; text-decoration: none; }
  .uc-side a span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .uc-side a:hover { background: var(--surface-sunken); color: var(--text-primary); text-decoration: none; }
  .uc-side .uc-n { color: var(--text-muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
  @media (max-width: 640px) {
    .uc-item { padding: 12px 14px; }
    .uc-seg { width: 100%; } .uc-seg a { flex: 1; justify-content: center; padding: 0 6px; }
  }

/* ── 분류·태그 모음 `.fx-` — 모음 화면과 고치기 화면이 함께 쓴다(2026-11-16) ── */
  .fx-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 22px; }
  .fx-sub { margin: 6px 0 0; font-size: 0.875rem; color: var(--text-muted); }
  .fx-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
  .fx-search { display: flex; align-items: center; gap: 10px; flex: 1 1 280px; height: 44px; margin: 0; padding: 0 14px;
               border: 1px solid var(--line); border-radius: 10px; background: var(--surface-card); color: var(--text-muted); }
  .fx-search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
  .fx-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text-primary); font: inherit; outline: none; box-shadow: none; }
  .fx-seg { display: inline-flex; height: 44px; padding: 3px; box-sizing: border-box; border-radius: 10px; background: var(--surface-sunken); }
  .fx-seg a { display: inline-flex; align-items: center; padding: 0 14px; border-radius: 8px; color: var(--text-secondary); font-size: 0.875rem; text-decoration: none; white-space: nowrap; }
  .fx-seg a:hover { color: var(--text-primary); text-decoration: none; }
  .fx-seg a.is-on { background: var(--surface-card); color: var(--text-primary); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
  .fx-h2 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px 2px; font-size: 1rem; font-weight: 700; color: var(--text-primary); }
  .fx-h2 span { font-size: 0.8125rem; font-weight: 400; color: var(--text-muted); }
  .fx-top { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 0 0 30px; padding: 0; list-style: none; }
  .fx-card { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px;
             background: var(--surface-card); color: var(--text-primary); text-decoration: none; transition: border-color 120ms ease, transform 120ms ease; }
  .fx-card:hover { border-color: var(--accent); transform: translateY(-1px); color: var(--text-primary); text-decoration: none; }
  .fx-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .fx-card__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fx-card__row { display: flex; align-items: center; gap: 10px; }
  .fx-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; }
  .fx-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
  .fx-num { font-size: 0.8125rem; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .fx-jump { position: sticky; top: 8px; z-index: 3; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 18px; padding: 6px;
             border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface-card) 92%, transparent);
             backdrop-filter: blur(6px); }
  .fx-jump a { min-width: 34px; height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; border-radius: 8px;
               color: var(--text-secondary); font-size: 0.875rem; font-weight: 600; text-decoration: none; }
  .fx-jump a:hover { background: var(--surface-sunken); color: var(--text-primary); text-decoration: none; }
  .fx-group { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); scroll-margin-top: 64px; }
  .fx-letter { font-size: 1.25rem; font-weight: 700; color: var(--text-muted); line-height: 34px; text-align: center; }
  .fx-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
  .fx-chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 12px; border: 1px solid var(--line); border-radius: 999px;
             background: var(--surface-card); color: var(--text-primary); font-size: 0.9375rem; text-decoration: none; max-width: 100%; }
  .fx-chip:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); text-decoration: none; }
  .fx-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .fx-chip__n { min-width: 24px; height: 22px; display: inline-flex; align-items: center; justify-content: center; padding: 0 7px; border-radius: 999px;
                background: var(--surface-sunken); color: var(--text-secondary); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
  .fx-chip__t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fx-none { display: none; padding: 28px; text-align: center; color: var(--text-secondary); border: 1px dashed var(--line); border-radius: 14px; }
  .fx-hide { display: none !important; }
  :is(body.site-mode-dark, html[data-dark] body.site-mode-auto) a.fx-card,
  :is(body.site-mode-dark, html[data-dark] body.site-mode-auto) a.fx-chip { color: var(--text-primary); }
  :is(body.site-mode-dark, html[data-dark] body.site-mode-auto) a.fx-chip:hover { color: var(--accent-strong); }
  @media (max-width: 640px) {
    .fx-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fx-group { grid-template-columns: 30px minmax(0, 1fr); gap: 8px; }
    .fx-seg { width: 100%; } .fx-seg a { flex: 1; justify-content: center; }
  }

/* 수 미니 레이블 — 노트 길잡이·관련 문서 등에서 같은 꼴(2026-11-17) */
.fb-count { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface-sunken);
            color: var(--text-muted); font-size: 0.6875rem; font-weight: 600; line-height: 1.5; text-align: center;
            font-variant-numeric: tabular-nums; vertical-align: 1px; }
