:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #fff;
  --subtle: #f1f5f9;
  --line: #e2e8f0;
  --line-dark: #cbd5e1;
  --ink: #111827;
  --body: #475569;
  --muted: #64748b;
  --accent: #111827;
  --font: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font);
  color: var(--body);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body { min-width: 280px; min-height: 100vh; margin: 0; background: var(--bg); color: var(--body); font-size: 14px; }
button, input { color: inherit; font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
::selection { background: #cbd5e1; color: var(--ink); }
[hidden] { display: none !important; }

.skip-link { position: fixed; top: -60px; left: 16px; z-index: 100; padding: 12px 16px; background: var(--ink); color: #fff; }
.skip-link:focus { top: 12px; }
.topbar { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); background: var(--surface); }
.nav-row { display: flex; max-width: 1320px; min-height: 72px; align-items: center; gap: 22px; margin: 0 auto; padding: 0 24px; }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; color: var(--ink); font-size: 20px; font-weight: 800; letter-spacing: -.06em; white-space: nowrap; }
.brand-glyph { display: grid; width: 29px; height: 29px; place-items: center; background: var(--ink); color: #fff; font-size: 18px; font-weight: 500; }
.search-box { display: flex; min-width: 190px; max-width: 410px; height: 40px; flex: 1 1 320px; align-items: center; gap: 9px; margin: 0 auto; padding: 0 11px; border: 1px solid var(--line); border-radius: 2px; background: var(--bg); color: var(--muted); transition: border-color .15s, background .15s; }
.search-box:focus-within { border-color: #64748b; background: #fff; }
.search-icon { color: var(--ink); font-size: 21px; line-height: 1; transform: rotate(-18deg); }
.search-box input { width: 100%; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.search-box input::placeholder { color: #94a3b8; }
kbd { flex: 0 0 auto; padding: 2px 6px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); font-size: 9px; }
.subject-nav { display: flex; flex: 0 0 auto; align-items: center; gap: 17px; }
.subject-link { position: relative; min-height: 36px; padding: 8px 0 10px; border: 0; background: transparent; color: var(--body); font-size: 11px; white-space: nowrap; }
.subject-link:hover, .subject-link.is-active { color: var(--ink); }
.subject-link.is-active { font-weight: 700; }
.subject-link::after { position: absolute; right: 0; bottom: 3px; left: 0; height: 2px; transform: scaleX(0); transform-origin: left; background: var(--ink); content: ""; transition: transform .16s ease; }
.subject-link.is-active::after, .subject-link:hover::after, .subject-link:focus-visible::after { transform: scaleX(1); }
.saved-nav { display: inline-flex; min-height: 34px; flex: 0 0 auto; align-items: center; gap: 6px; padding: 0 9px; border: 1px solid var(--line); border-radius: 2px; background: #fff; color: var(--body); font-size: 10px; white-space: nowrap; }
.saved-nav:hover, .saved-nav.is-active { border-color: #94a3b8; background: var(--subtle); color: var(--ink); }
.saved-nav svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.25; }
.saved-count { color: var(--muted); font-size: 9px; }

main { min-height: calc(100vh - 150px); }
.hero { padding: 58px 24px 52px; border-bottom: 1px solid var(--line); background: var(--surface); }
.hero-inner { display: grid; max-width: 1120px; grid-template-columns: 1.25fr .75fr; align-items: center; gap: clamp(34px, 7vw, 96px); margin: 0 auto; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 15px; color: #334155; font-size: 11px; font-weight: 700; letter-spacing: .025em; }
.eyebrow::before { width: 17px; height: 2px; background: #334155; content: ""; }
.hero h1 { margin: 0; color: var(--ink); font-size: clamp(38px, 4.7vw, 56px); font-weight: 700; line-height: 1.22; letter-spacing: -.065em; }
.hero-desc { margin: 17px 0 24px; color: var(--muted); font-size: 14px; line-height: 1.85; }
.hero-link { display: inline-flex; min-height: 40px; align-items: center; gap: 18px; padding: 0 14px; border: 1px solid var(--ink); border-radius: 2px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; }
.hero-link:hover { border-color: #334155; background: #334155; }
.hero-link span { font-size: 14px; }
.hero-guide { padding: 0 0 0 19px; border-left: 2px solid var(--line-dark); background: transparent; }
.hero-guide > p { margin: 0 0 13px; color: var(--ink); font-size: 14px; font-weight: 650; }
.hero-guide > div { display: flex; min-height: 59px; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.hero-guide > div > span { display: block; width: 24px; flex: 0 0 24px; color: #64748b; font-size: 10px; font-weight: 700; }
.hero-guide section strong, .hero-guide section small { display: block; }
.hero-guide section strong { color: var(--ink); font-size: 13px; font-weight: 600; }
.hero-guide section small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.popular-formulas { display: flex; max-width: 1120px; flex-wrap: wrap; align-items: center; gap: 7px; margin: 28px auto 0; padding-top: 15px; border-top: 1px solid var(--line); }
.popular-formulas > span { margin-right: 5px; color: var(--muted); font-size: 10px; font-weight: 600; }
.popular-formulas button { min-height: 31px; padding: 0 9px; border: 1px solid var(--line); border-radius: 2px; background: #fff; color: var(--body); font-size: 10px; }
.popular-formulas button:hover { border-color: var(--line-dark); background: var(--subtle); color: var(--ink); }
.popular-formulas b { margin-left: 7px; color: #64748b; font-size: 10px; font-weight: 400; }

.explore { max-width: 1280px; margin: 0 auto; padding: 43px 24px 55px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.section-heading .eyebrow { margin-bottom: 8px; }
.section-heading h2 { margin: 0; color: var(--ink); font-size: 28px; font-weight: 700; line-height: 1.35; letter-spacing: -.045em; }
.section-aside { margin: 0 0 1px; color: var(--muted); font-size: 12px; line-height: 1.8; text-align: right; }
.catalogue-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); align-items: start; gap: 28px; padding-top: 19px; border-top: 1px solid var(--line); }
.filters { position: sticky; top: 91px; }
.filter-label { margin: 0 0 9px; color: var(--body); font-size: 12px; font-weight: 600; }
.category-filters { display: grid; gap: 2px; }
.category-filter { display: flex; width: 100%; min-height: 36px; align-items: center; justify-content: space-between; padding: 9px 10px; border: 0; border-radius: 2px; background: transparent; color: var(--body); text-align: left; font-size: 12px; }
.category-filter:hover { background: #eef2f6; }
.category-filter.is-active { background: #e9edf2; color: var(--ink); font-weight: 600; }
.category-count { color: var(--muted); font-size: 9px; }
.category-filter.is-active .category-count { color: var(--ink); }
.filter-note { display: flex; gap: 8px; margin-top: 20px; padding: 11px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); color: var(--muted); font-size: 9px; line-height: 1.7; }
.filter-note p { margin: 0; }
.note-dot { width: 6px; height: 6px; flex: 0 0 6px; margin-top: 4px; border-radius: 50%; background: #64748b; }
.result-meta { display: flex; align-items: center; justify-content: space-between; padding: 0 1px 9px; color: var(--muted); font-size: 10px; }
.result-meta strong { color: var(--body); font-weight: 600; }
.clear-btn { border: 0; background: transparent; color: var(--body); font-size: 10px; }
.clear-btn:hover { color: var(--ink); text-decoration: underline; }
.clear-btn span { margin-left: 4px; font-size: 12px; }
.formula-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 25px; border-top: 1px solid var(--line); }
.formula-card { display: flex; min-width: 0; min-height: 190px; flex-direction: column; padding: 17px 10px 14px; border: 0; border-bottom: 1px solid var(--line); border-left: 2px solid transparent; border-radius: 0; background: transparent; color: var(--body); text-align: left; transition: border-color .15s ease, background .15s ease; }
.formula-card:hover { border-left-color: var(--ink); background: #f1f5f9; }
.formula-card:focus-visible { position: relative; z-index: 1; outline-offset: -2px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-subject { display: flex; align-items: center; gap: 7px; color: #334155; font-size: 10px; font-weight: 600; }
.card-subject > span { color: #94a3b8; font-weight: 400; }
.card-level { flex: 0 0 auto; color: var(--muted); font-size: 9px; }
.card-title { display: flex; align-items: center; gap: 7px; margin: 12px 0 8px; color: var(--ink); font-size: 16px; font-weight: 650; letter-spacing: -.03em; }
.saved-mark { display: inline-flex; color: var(--ink); }
.saved-mark svg { width: 12px; height: 12px; fill: var(--ink); }
.formula-expression { display: block; overflow: hidden; color: #334155; font-size: 14px; font-weight: 500; letter-spacing: .01em; line-height: 1.6; text-overflow: ellipsis; white-space: nowrap; }
.card-meaning { display: -webkit-box; overflow: hidden; margin-top: 8px; color: var(--muted); font-size: 10px; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 13px; color: #64748b; font-size: 9px; }
.card-arrow { color: #94a3b8; font-size: 13px; transition: color .15s, transform .15s; }
.formula-card:hover .card-arrow { transform: translate(2px, -2px); color: var(--ink); }
.empty-state { padding: 48px 15px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); color: var(--muted); text-align: center; }
.empty-state > span { display: block; color: #64748b; font-size: 28px; }
.empty-state strong { display: block; margin: 8px 0 5px; color: var(--ink); font-size: 13px; }
.empty-state p { margin: 0; font-size: 10px; }
.reset-empty { margin-top: 15px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); color: var(--body); font-size: 10px; }
.reset-empty:hover { border-color: var(--line-dark); color: var(--ink); }
.catalogue-foot { display: flex; align-items: flex-start; gap: 10px; margin-top: 23px; padding: 3px 0 3px 13px; border-left: 2px solid #64748b; color: var(--muted); font-size: 10px; line-height: 1.7; }
.catalogue-foot p { margin: 0; }
.catalogue-foot strong { color: var(--body); font-weight: 600; }
.foot-mark { color: var(--body); font-size: 14px; }
.page-footer { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 20px; max-width: 1280px; margin: 0 auto; padding: 0 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.page-footer .brand { font-size: 15px; }
.page-footer .brand-glyph { width: 22px; height: 22px; font-size: 14px; }
.page-footer > a:last-child { color: var(--body); }
.page-footer > a:last-child:hover { color: var(--ink); }

.detail-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(15, 23, 42, .28); }
.detail-panel { position: fixed; inset: 0 0 0 auto; z-index: 41; display: flex; width: min(520px, 100vw); flex-direction: column; overflow-y: auto; padding: 25px clamp(22px, 4vw, 38px) 38px; border-left: 1px solid var(--line); background: var(--surface); box-shadow: -20px 0 50px rgba(15, 23, 42, .09); animation: panel-in .22s ease-out; }
@keyframes panel-in { from { transform: translateX(20px); opacity: .7; } to { transform: translateX(0); opacity: 1; } }
.detail-top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.detail-label { color: var(--muted); font-size: 10px; font-weight: 600; }
.icon-button { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid var(--line); border-radius: 2px; background: #fff; color: var(--ink); font-size: 21px; line-height: 1; }
.icon-button:hover { border-color: var(--line-dark); }
.detail-content { padding-top: 40px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.detail-tags span { padding: 5px 8px; border: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.detail-content h2 { margin: 20px 0 23px; color: var(--ink); font-size: 30px; letter-spacing: -.05em; }
.formula-display { display: grid; min-height: 122px; place-items: center; margin: 0 0 22px; padding: 20px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: clamp(15px, 3vw, 21px); font-weight: 600; line-height: 1.7; text-align: center; overflow-wrap: anywhere; }
.detail-actions { display: flex; gap: 8px; margin-bottom: 35px; }
.detail-actions button { min-height: 39px; padding: 0 14px; border: 1px solid var(--line-dark); border-radius: 2px; background: transparent; color: var(--body); font-size: 11px; }
.detail-actions button:hover { border-color: var(--ink); color: var(--ink); }
.detail-actions .copy-action { border-color: var(--ink); background: var(--ink); color: #fff; }
.detail-actions .copy-action:hover { background: #334155; }
.detail-section { padding: 21px 0; border-top: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 10px; color: var(--muted); font-size: 10px; font-weight: 600; }
.detail-section p { margin: 0; color: var(--body); font-size: 13px; line-height: 1.85; }
.detail-example { padding: 14px 15px; background: var(--subtle); color: var(--ink) !important; font-size: 11px !important; }
.detail-footnote { margin-top: 24px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; padding: 11px 15px; background: var(--ink); color: #fff; font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

.site-footer { border-top: 1px solid var(--line-dark); background: #fff; color: var(--body); }
.footer-main { display: grid; max-width: 1280px; grid-template-columns: minmax(240px, 1.4fr) 1fr 1fr minmax(190px, 1.1fr); gap: 34px; margin: 0 auto; padding: 42px 24px 34px; }
.footer-brand-block > p { margin: 17px 0 0; color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.55; letter-spacing: -.045em; }
.footer-link-group { display: grid; align-content: start; gap: 12px; }
.footer-link-group > span { margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .04em; }
.footer-link-group a { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink); font-size: 12px; }
.footer-link-group a:hover, .footer-bottom a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-link-group b { color: var(--muted); font-size: 11px; font-weight: 400; }
.footer-note { max-width: 240px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.8; }
.footer-bottom { display: flex; max-width: 1280px; min-height: 52px; align-items: center; justify-content: space-between; gap: 16px; margin: 0 auto; padding: 0 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.footer-bottom a { color: var(--body); }

@media (max-width: 1100px) {
  .nav-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 18px; padding-block: 10px; }
  .nav-row > .brand { grid-column: 1; grid-row: 1; }
  .nav-row > .search-box { grid-column: 2; grid-row: 1; width: 100%; }
  .nav-row > .saved-nav { grid-column: 3; grid-row: 1; }
  .subject-nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; gap: 26px; }
  .catalogue-layout { grid-template-columns: 175px minmax(0, 1fr); gap: 20px; }
  .formula-grid { column-gap: 15px; }
}
@media (max-width: 760px) {
  .nav-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 9px 16px 0; }
  .nav-row > .brand { grid-column: 1; grid-row: 1; }
  .nav-row > .saved-nav { grid-column: 2; grid-row: 1; }
  .nav-row > .search-box { grid-column: 1 / -1; grid-row: 2; width: 100%; max-width: none; margin: 0; }
  .subject-nav { grid-column: 1 / -1; grid-row: 3; justify-content: flex-start; gap: 20px; overflow-x: auto; scrollbar-width: none; }
  .subject-nav::-webkit-scrollbar { display: none; }
  .subject-link { flex: 0 0 auto; }
  .hero { padding: 43px 20px 38px; }
  .hero-inner { grid-template-columns: 1fr; gap: 30px; }
  .hero h1 { font-size: clamp(36px, 9vw, 48px); }
  .hero-desc { margin: 14px 0 20px; font-size: 12px; }
  .hero-guide { max-width: 460px; }
  .popular-formulas { gap: 5px; margin-top: 21px; }
  .popular-formulas > span { width: 100%; }
  .explore { padding: 34px 18px 42px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .section-heading h2 { font-size: 23px; }
  .section-aside { text-align: left; font-size: 10px; }
  .section-aside br { display: none; }
  .catalogue-layout { grid-template-columns: 1fr; gap: 14px; padding-top: 15px; }
  .filters { position: static; }
  .filter-label { margin-bottom: 7px; }
  .category-filters { display: flex; flex-wrap: wrap; gap: 5px; }
  .category-filter { width: auto; min-height: 32px; gap: 12px; padding: 6px 9px; font-size: 10px; }
  .filter-note { margin-top: 10px; padding: 8px 9px; font-size: 9px; }
  .formula-grid { grid-template-columns: 1fr; }
  .formula-card { min-height: 166px; padding: 15px 9px 12px; }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 28px 22px; padding: 31px 18px 25px; }
  .footer-note { max-width: 310px; grid-column: 1 / -1; }
  .footer-bottom { min-height: 49px; padding: 0 18px; font-size: 9px; }
  .detail-panel { width: 100%; padding-top: max(16px, env(safe-area-inset-top)); }
  .detail-content { padding-top: 28px; }
  .toast { right: 15px; bottom: max(15px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Shelf taxonomy and full-page formula detail */
.filter-label { display: block; margin-top: 0; }
.filter-select { width: 100%; min-height: 36px; margin: 2px 0 15px; padding: 0 9px; border: 1px solid var(--line); border-radius: 2px; background: #fff; color: var(--body); font-size: 11px; }
.filter-select:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.grade-label { margin-top: 2px; }
.category-label { margin-top: 6px; }
.category-tree { display: grid; gap: 2px; }
.category-empty { margin: 4px 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.area-group { min-width: 0; }
.area-filter { display: flex; width: 100%; min-height: 34px; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px; border: 0; background: transparent; color: var(--body); text-align: left; font-size: 11px; }
.area-filter:hover, .area-filter.is-active { background: #eef2f6; color: var(--ink); }
.area-filter.is-active { font-weight: 600; }
.area-filter > span:last-child { color: var(--muted); font-size: 9px; }
.topic-list { display: grid; gap: 1px; padding: 1px 0 6px 10px; }
.topic-filter { display: flex; min-height: 29px; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; border: 0; border-left: 1px solid var(--line-dark); background: transparent; color: var(--muted); text-align: left; font-size: 10px; }
.topic-filter:hover, .topic-filter.is-active { border-left: 2px solid var(--ink); color: var(--ink); }
.topic-filter > span:last-child { color: #94a3b8; font-size: 9px; }
.topic-filter.is-active > span:last-child { color: var(--ink); }
.card-level { max-width: 45%; text-align: right; line-height: 1.5; }

.detail-page { min-height: calc(100vh - 150px); background: var(--surface); }
.detail-container { max-width: 1040px; margin: 0 auto; padding: 28px 24px 70px; }
.back-button { padding: 8px 0; border: 0; background: transparent; color: var(--body); font-size: 11px; }
.back-button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.detail-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 24px 0 33px; color: var(--muted); font-size: 10px; }
.detail-breadcrumb a:hover { color: var(--ink); text-decoration: underline; }
.detail-record { max-width: 820px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-meta span { padding: 5px 8px; border: 1px solid var(--line); color: var(--body); font-size: 10px; }
.detail-record > h1 { margin: 18px 0 9px; color: var(--ink); font-size: clamp(30px, 5vw, 43px); font-weight: 700; letter-spacing: -.06em; line-height: 1.25; }
.detail-intro { max-width: 660px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.85; }
.formula-display { display: flex; min-height: 145px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 13px; margin: 28px 0 12px; padding: 22px clamp(18px, 4vw, 34px); border: 1px solid var(--line); background: var(--bg); text-align: left; }
.formula-display > span { color: var(--muted); font-size: 10px; font-weight: 600; }
.formula-display > strong { color: var(--ink); font-size: clamp(19px, 3vw, 27px); font-weight: 600; letter-spacing: -.025em; line-height: 1.65; overflow-wrap: anywhere; }
.detail-action-row { display: flex; gap: 7px; }
.detail-action-row button { min-height: 35px; padding: 0 12px; border: 1px solid var(--line-dark); border-radius: 2px; background: #fff; color: var(--body); font-size: 10px; }
.detail-action-row button:hover { border-color: var(--ink); color: var(--ink); }
.detail-action-row .copy-action { border-color: var(--ink); background: var(--ink); color: #fff; }
.detail-action-row .copy-action:hover { background: #334155; }
.detail-block { display: grid; grid-template-columns: minmax(180px, .65fr) minmax(0, 1.35fr); gap: 25px; padding: 23px 0; border-top: 1px solid var(--line); }
.detail-action-row + .detail-block { margin-top: 31px; }
.detail-label { margin: 0 0 8px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; }
.detail-block h2, .related-heading h2 { margin: 0 0 7px; color: var(--ink); font-size: 15px; font-weight: 650; letter-spacing: -.025em; }
.detail-block > div:first-child > p:last-child, .detail-block > p:not(.detail-label) { margin: 0; color: var(--body); font-size: 12px; line-height: 1.85; }
.grade-tags { display: flex; flex-wrap: wrap; align-content: start; gap: 6px; }
.grade-tags span { min-height: 28px; padding: 6px 8px; border: 1px solid var(--line); background: var(--bg); color: var(--body); font-size: 10px; }
.worked-example { padding: 15px 16px; background: var(--subtle); color: var(--ink) !important; font-size: 12px !important; line-height: 1.8; }
.example-caption { margin: 7px 0 0; color: var(--muted); font-size: 9px; }
.curriculum-note { grid-template-columns: 1fr; gap: 3px; }
.curriculum-note a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.triples-section { grid-template-columns: minmax(0,1fr); gap: 22px; }
.triples-section>div:first-child>p:last-child { max-width: 64ch; font-size: 13px; }
.triples-tool { min-width: 0; }
.triples-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; padding: 18px; background: var(--subtle); }
.triples-filter label { display: grid; gap: 8px; color: var(--body); font-size: 12px; }
.triples-tool input[type=number] { width: 130px; max-width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 0; background: var(--bg); color: var(--ink); font: inherit; }
.triples-filter .triples-primitive { display: flex; gap: 7px; align-items: center; min-height: 42px; }
.triples-tool button { min-height: 44px; padding: 10px 16px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font-family: inherit; font-size: 12px; cursor: pointer; }
.triples-tool button:disabled { opacity: .35; cursor: default; }
.triples-tool :is(button,input,a):focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.triples-status { margin: 20px 0 10px; font-size: 12px; }
.triples-table-wrap { overflow-x: auto; }
.triples-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.triples-table caption { text-align: left; margin-bottom: 10px; color: var(--muted); font-size: 11px; }
.triples-table :is(th,td) { border-bottom: 1px solid var(--line); padding: 11px 8px; text-align: left; font-size: 12px; }
.triples-table th { background: var(--subtle); font-weight: 600; }
.triples-table td:last-child { font-family: Georgia,serif; }
.triples-paging { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: 12px; }
.triples-rule,.triples-check { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.triples-tool h3 { margin: 0 0 12px; font-size: 15px; }
.triples-rule p,.triples-check-result { color: var(--body); font-size: 13px; line-height: 1.85; }
.triples-rule .triples-equation { padding: 14px; background: var(--subtle); color: var(--ink); font-size: 17px; overflow-wrap: anywhere; }
.triples-rule a { color: var(--ink); font-size: 12px; text-underline-offset: 3px; }
.triples-check-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 12px; }
.triples-check-fields label { display: grid; gap: 8px; font-size: 12px; }
.triples-check-fields input[type=number] { width: 100%; }
@media(max-width:400px) { .triples-table :is(th,td) { padding: 10px 3px; font-size: 10px; } .triples-filter { padding: 12px; gap: 10px; } }
.related-section { margin-top: 6px; padding-top: 20px; border-top: 1px solid var(--line); }
.related-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 13px; }
.related-heading .detail-label { margin-bottom: 5px; }
.related-heading h2 { margin: 0; }
.related-heading > span { color: var(--muted); font-size: 10px; }
.related-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; border-top: 1px solid var(--line); }
.related-list button { display: flex; min-width: 0; min-height: 61px; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 8px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.related-list button:hover { background: var(--bg); }
.related-list button strong, .related-list button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-list button strong { color: var(--ink); font-size: 11px; font-weight: 600; }
.related-list button small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.related-list button > span:last-child { color: var(--muted); font-size: 13px; }
@media (max-width: 760px) {
  .filter-select { width: calc(50% - 5px); display: inline-block; margin: 2px 5px 9px 0; }
  .grade-label { margin-left: 3px; }
  .category-label { margin-top: 9px; }
  .category-tree { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 8px; }
  .topic-list { padding-left: 6px; }
  .area-filter { font-size: 10px; }
  .topic-filter { font-size: 9px; }
  .detail-container { padding: 20px 18px 50px; }
  .detail-breadcrumb { margin: 19px 0 26px; }
  .detail-block { grid-template-columns: 1fr; gap: 12px; padding: 19px 0; }
  .grade-block { grid-template-columns: 1fr; }
  .grade-tags { gap: 5px; }
  .related-list { grid-template-columns: 1fr; }
}
