@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;          /* 한글 단어 중간 줄바꿈 방지 */
  overflow-wrap: break-word;
}
a { color: inherit; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* 상단 바 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  height: 60px; padding: 0 20px;
  background: var(--bg); color: var(--ink);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; white-space: nowrap; }
.brand .dot { width: 28px; height: 28px; border-radius: 8px; background: none; display: grid; place-items: center; font-size: 13px; }
.topbar nav { display: flex; gap: 4px; margin-left: 12px; overflow-x: auto; min-width: 0; scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a {
  text-decoration: none; padding: 8px 12px; border-radius: 8px;
  color: var(--ink-2); font-size: 14px; white-space: nowrap;
}
.topbar nav a:hover { background: var(--ink-2); color: var(--ink); }
.topbar nav a[aria-current="page"] { background: var(--ink-2); color: var(--ink); font-weight: 600; }
.topbar .spacer { flex: 1; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn.primary:hover { background: var(--ink); border-color: var(--ink); }
.topbar .btn { background: transparent; color: var(--ink); border-color: var(--line); }
.topbar .btn:hover { border-color: var(--blue); }
.topbar .app-b { flex: none; width: 40px; height: 40px; padding: 0; justify-content: center; font-size: 18px; } /* 앱(PWA)으로 열었을 때만 guard.js가 넣는 뒤로 · 새로고침 */

/* 허브 */
.hero { background: var(--hero); color: var(--ink); padding: 56px 20px 72px; }
.hero .wrap, .tiles { max-width: 1120px; margin: 0 auto; }
.hero small { color: var(--blue-dark); font-weight: 700; letter-spacing: .08em; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); margin: 8px 0 10px; line-height: 1.2; }
.hero p { color: var(--ink-2); margin: 0; }
.tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px;
  padding: 0 20px; margin-top: -40px; margin-bottom: 60px;
}
.tile {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 26px 24px; min-height: 210px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; box-shadow: 0 6px 24px rgba(20, 23, 31, .06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(20, 23, 31, .12); }
.tile .ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--soft); color: var(--ink); }
.tile.live .ico { background: var(--blue); color: var(--on); }
.tile h2 { margin: 6px 0 0; font-size: 20px; }
.tile p { margin: 0; color: var(--muted); font-size: 14px; }
.tile .tag {
  position: absolute; top: 18px; right: 18px; font-size: 12px; font-weight: 700;
  padding: 3px 9px; border-radius: 99px; background: var(--soft); color: var(--muted);
}
.tile.live .tag { background: var(--blue-soft); color: var(--blue-dark); }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 0 20px 40px; }

/* 준비중 */
.wip { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 40px 20px; text-align: center; }
.wip .ico { width: 84px; height: 84px; border-radius: 22px; background: var(--soft); display: grid; place-items: center; margin: 0 auto 20px; }
.wip h1 { font-size: 28px; margin: 0 0 8px; }
.wip p { color: var(--muted); margin: 0 0 26px; }
.wip .typing::after { content: ""; animation: dots 1.4s steps(5) infinite; }
@keyframes dots { 0% { content: ""; } 20% { content: "."; } 40% { content: ".."; } 60% { content: "..."; } 80% { content: "...."; } 100% { content: "....."; } }
@media (prefers-reduced-motion: reduce) { .wip .typing::after { animation: none; content: "....."; } html { scroll-behavior: auto; } }

/* 로그인 */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--ink); }
.topbar + .login { min-height: calc(100vh - 60px); }
.login form {
  width: 100%; max-width: 380px; background: var(--card); border-radius: 18px; padding: 34px 30px;
}
.login h1 { font-size: 22px; margin: 14px 0 4px; }
.login p { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.login label { font-size: 13px; font-weight: 600; }
.login input {
  width: 100%; margin: 6px 0 14px; padding: 13px 14px; font-size: 18px; letter-spacing: .3em;
  border: 1px solid var(--line); border-radius: 10px;
}
.login .btn { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.login .err { color: var(--bad); font-size: 13px; margin: -6px 0 12px; }

/* 매뉴얼 뷰어 */
.viewer { display: grid; grid-template-columns: 300px 1fr; max-width: 1500px; margin: 0 auto; }
.toc {
  position: sticky; top: 124px; height: calc(100vh - 124px); overflow-y: auto;
  padding: 20px 16px 40px; border-right: 1px solid var(--line);
}
.toc h3 { font-size: 13px; margin: 18px 0 6px; display: flex; align-items: center; gap: 8px; }
.toc h3 a { text-decoration: none; }
.toc h3 .code { width: 22px; height: 22px; border-radius: 6px; background: var(--blue-dark); color: #fff; display: grid; place-items: center; font-size: 12px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li a {
  display: block; padding: 6px 10px; border-radius: 8px; text-decoration: none;
  font-size: 13.5px; color: var(--muted);
}
.toc li a:hover { background: var(--soft); color: var(--ink); }
.toc li a.on { background: var(--blue-soft); color: var(--blue-dark); font-weight: 600; }
.toc li a .lb { display: block; font-size: 11px; font-weight: 700; color: var(--muted); }
.toc li a.on .lb { color: var(--blue-dark); }
.toc .empty { color: var(--muted); font-size: 13px; padding: 6px 10px; }
.slides { padding: 24px 28px 80px; display: flex; flex-direction: column; gap: 34px; min-width: 0; }
.slide { margin: 0; scroll-margin-top: 140px; }
.slide.flash .frame { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 4px var(--blue); } 100% { box-shadow: 0 0 0 4px transparent; } }
.slide header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.slide header .no { font-size: 12px; font-weight: 700; color: var(--blue-dark); }
.slide header h2 { font-size: 16px; margin: 0; }
.slide header .sec-print { margin-left: auto; font-size: 12px; padding: 4px 10px; }
.frame { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--soft); aspect-ratio: 16 / 9; }
.frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.frame .hot { position: absolute; display: block; border-radius: 12px; }
.frame .hot:hover { outline: 3px solid var(--blue); background: var(--blue-soft); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* 매뉴얼 상단 검색 */
.msearch { position: sticky; top: 60px; z-index: 15; background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 20px; }
.msearch-in { position: relative; max-width: 1500px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.msearch input {
  flex: 1; min-width: 0; padding: 11px 14px 11px 42px; border: 1px solid var(--line); border-radius: 12px; font-size: 15px;
  background: var(--soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235b6370' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center;
}
.msearch input:focus { background-color: var(--card); border-color: var(--blue); }
.msearch .cnt { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.msearch select { display: none; }
.results {
  position: absolute; top: calc(100% + 6px); left: 0; width: min(760px, 100%); max-height: min(60vh, 520px); overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 36px rgba(20, 23, 31, .16); padding: 6px;
}
.results a { display: block; padding: 9px 12px; border-radius: 9px; text-decoration: none; }
.results a:hover, .results a.sel { background: var(--blue-soft); }
.results .rn { font-size: 12px; font-weight: 700; color: var(--blue-dark); }
.results .rt { font-size: 14px; font-weight: 700; }
.results .rs { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.results mark { background: rgba(245, 158, 11, .32); color: inherit; border-radius: 3px; padding: 0 1px; }
.results .none { margin: 0; padding: 14px 12px; font-size: 14px; color: var(--muted); }
.zoom { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.frame img, .lbx img { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
/* 슬라이드 크게 보기(워터마크 덮음) */
.lbx { position: fixed; inset: 0; z-index: 100; background: rgba(7, 8, 11, .94); overflow: auto; padding: 56px 16px 24px; }
.lbx[hidden] { display: none; }
.lbx-x { position: fixed; top: 10px; right: 12px; z-index: 2; background: #fff; }
.lbx-in { position: relative; width: min(100%, 1700px); margin: 0 auto; }
.lbx-in img { display: block; width: 100%; height: auto; border-radius: 8px; }
.lbx-in .lbx-wm { position: absolute; inset: 0; height: 100%; opacity: .75; }
@media (max-width: 900px) { .lbx { padding: 52px 0 16px; } .lbx-in { width: 180%; } }
.frame img.wm { display: none; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
@media print { .frame img.wm { display: block; } }
.btn:disabled { opacity: .7; cursor: progress; }
.foot a { color: var(--muted); }

@media (max-width: 640px) {
  .topbar nav.hub-nav { display: none; }
  .brand { font-size: 15px; }
  .hero { padding: 36px 16px 60px; }
  .tiles { padding: 0 16px; gap: 14px; }
  .tile { min-height: 0; padding: 22px 20px; }
}

@media (max-width: 900px) {
  .viewer { grid-template-columns: 1fr; }
  .toc { display: none; }
  .msearch { padding: 8px 12px; }
  .msearch-in { gap: 8px; }
  .msearch input { font-size: 16px; padding: 10px 10px 10px 38px; background-position: 11px center; }
  .msearch .cnt { display: none; }
  .msearch select { display: block; flex: 0 0 34%; min-width: 0; padding: 10px 6px; border-radius: 10px; border: 1px solid var(--line); font-size: 14px; background: var(--card); }
  .slide { scroll-margin-top: 130px; }
  .slides { padding: 16px 16px 60px; gap: 24px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .hide-sm { display: none; }
}

@media print {
  /* A4 세로 · 한 쪽에 슬라이드 2장 (190×107mm 두 장 + 간격 = 222mm < 쓸 수 있는 277mm, 세 장은 안 들어가 자동으로 넘어감) */
  @page { size: A4 portrait; margin: 10mm; }
  .topbar, .toc, .msearch, .sec-print, .no-print { display: none !important; }
  .viewer { display: block; }
  .slides { padding: 0; gap: 0; display: block; }
  .slide { break-inside: avoid; page-break-inside: avoid; margin: 0 0 12mm; }
  .slide header { display: none; }
  .frame { border: 0; border-radius: 0; }
  body[data-print-sec] .slide:not([data-sec-print]) { display: none; }
}

/* ───── 기본 틀(상단 바 · 메뉴 · 버튼 · 카드). 색은 맨 아래 '브랜드' 블록의 변수에서 관리 ───── */
:root {
  --radius: 18px;
}
.topbar { height: 56px; padding: 0 16px; gap: 10px; background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--ink); border-bottom: 1px solid var(--line); }
.brand { font-size: 17px; letter-spacing: -.01em; }
.topbar .ig { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--blue-dark); font-size: 13.5px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.topbar .ig:hover { border-color: var(--blue); }
nav.menu { display: flex; gap: 6px; padding: 8px 16px; overflow-x: auto; scrollbar-width: none; background: var(--bg); border-bottom: 1px solid var(--line); min-height: 53px; }
nav.menu::-webkit-scrollbar { display: none; }
nav.menu a { flex: none; text-decoration: none; padding: 8px 13px; border-radius: 99px; font-size: 14px; font-weight: 600; color: var(--ink-2); background: var(--soft); white-space: nowrap; }
nav.menu a:hover { background: var(--blue-soft); color: var(--blue-dark); }
nav.menu a[aria-current="page"] { background: var(--blue); color: var(--on); }
.hero { background: var(--hero); color: var(--ink); padding: 40px 20px 60px; }
.hero small { color: var(--blue-dark); }
.hero p { color: var(--ink-2); }
.hero .back a, .back a { color: var(--ink-2) !important; border-color: var(--line) !important; background: var(--card); }
.btn { border-radius: 12px; min-height: 40px; }
.btn:hover { border-color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); }
.tile { box-shadow: 0 6px 24px rgba(0, 0, 0, .05); border-radius: 20px; min-height: 170px; }
.tile:hover { box-shadow: 0 14px 34px rgba(0, 0, 0, .1); }
.tile .ico { background: var(--blue-soft); color: var(--blue-dark); }
.tile .tag { background: var(--blue-soft); color: var(--blue-dark); }
.foot { padding: 28px 20px 44px; border-top: 1px solid var(--line); margin-top: 28px; line-height: 1.8; }
.foot b { color: var(--ink-2); }
.note { max-width: 1120px; margin: 0 auto 18px; padding: 12px 16px; border-radius: 14px; background: var(--blue-soft); color: var(--blue-dark); font-size: 13.5px; font-weight: 600; }
/* 공용 본문 틀(새 페이지) */
.page { max-width: 1120px; margin: 0 auto; padding: 18px 16px 30px; display: grid; gap: 16px; }
.box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 16px; }
.box h2 { font-size: 19px; margin: 0 0 10px; }
.box h3 { font-size: 14.5px; margin: 14px 0 6px; }
.box p, .box li { font-size: 14px; }
.box ul, .box ol { margin: 6px 0; padding-left: 20px; display: grid; gap: 4px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 12px; }
.fgrid label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); min-width: 0; }
.fgrid select, .fgrid input { font: inherit; font-size: 15px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); min-height: 44px; width: 100%; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font: inherit; font-size: 14px; font-weight: 600; padding: 9px 14px; min-height: 40px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: var(--on); }
.warn { color: var(--bad); font-weight: 700; }
.muted { color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .topbar .ig span { display: none; } .topbar .ig { padding: 0 11px; } .hero { padding: 28px 16px 44px; } }
@media print { nav.menu, .foot .np { display: none !important; } }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; background: var(--card); flex: none; }
.lang button { font: inherit; font-size: 13px; font-weight: 700; min-height: 40px; padding: 0 11px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--blue); color: var(--on); }
[hidden] { display: none !important; }
.back { display: none !important; }
.page > *, .sim > * { min-width: 0; }
.topbar .btn { background: var(--card); color: var(--ink); border-color: var(--line); }
.topbar .btn:hover { border-color: var(--blue); }
.topbar nav a { color: var(--ink-2); }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { background: var(--blue-soft); color: var(--blue-dark); }

/* 휴대폰 하단 메뉴(앱처럼 엄지로 누르는 자리). 넓은 화면에서는 숨기고 위 가로 메뉴를 씀 */
.tabbar, .allmenu { display: none; }
@media (max-width: 760px) {
  nav.menu { display: none; }
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: color-mix(in srgb, var(--card) 96%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; min-height: 52px; padding: 4px 0; border: 0; background: none; font: inherit; font-size: 11.5px; font-weight: 700; color: var(--muted); text-decoration: none; cursor: pointer; border-radius: 12px; }
  .tabbar [aria-current="page"], .tabbar button[aria-expanded="true"] { color: var(--blue-dark); background: var(--blue-soft); }
  .allmenu:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(11, 16, 27, .5); }
  .allmenu > div { position: absolute; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); background: var(--card); border-radius: 22px 22px 0 0; padding: 16px 16px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 70vh; overflow-y: auto; }
  .allmenu b { grid-column: 1 / -1; font-size: 15px; }
  .allmenu a { display: flex; align-items: center; min-height: 52px; padding: 0 14px; border-radius: 14px; background: var(--soft); text-decoration: none; font-size: 15px; font-weight: 600; color: var(--ink); }
  .allmenu a[aria-current="page"] { background: var(--blue); color: var(--on); }
  .foot { padding-bottom: 20px; }
}
@media print { .tabbar, .allmenu { display: none !important; } }
/* 쉬운 화면: 계산기에서 전문 항목(.pro)을 접어 둠 */
.easy .pro { display: none !important; }
.modesw { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; background: var(--card); }
.modesw button { font: inherit; font-size: 14px; font-weight: 700; min-height: 44px; padding: 0 16px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.modesw button[aria-pressed="true"] { background: var(--blue); color: var(--on); }

/* ───── 둥근 모서리 · 눌림 ───── */
:root { --radius: 22px; }
h1, .brand, .tile h2, .box h2, .panel h2, .card > h2, .decks b, #cards h2, .cn h3, .allmenu b, .grp, .vd, .hero small { font-family: var(--cute); font-weight: 400; letter-spacing: 0; }
.hero h1 { font-size: clamp(32px, 7vw, 46px); }
.box h2, .panel h2 { font-size: 20px; }
.brand { font-size: 20px; }
.hero { border-radius: 0 0 30px 30px; background: var(--hero); }
.box, .panel, .card, .tile, .cn { border-radius: var(--radius); border-color: var(--line); }
.btn, .chips button, .seg button, .tog, .camtabs button, .fgrid select, .fgrid input, .rw select, .rw input { border-radius: 99px; }
.fgrid select, .fgrid input, .rw select, .rw input { padding-left: 14px; }
.btn, .chips button, .tile, .decks button, .tabbar a, .tabbar button, .looks button, nav.menu a, .allmenu a, .shoot { transition: transform .12s ease, background-color .12s ease, border-color .12s ease; }
.btn:active, .chips button:active, .tile:active, .decks button:active, .looks button:active, .allmenu a:active { transform: scale(.96); }
.tabbar a:active, .tabbar button:active { transform: scale(.9); }
.tile .ico, .decks .ic { border-radius: 18px; }
.tile .tag { font-family: var(--cute); font-weight: 400; font-size: 12.5px; }
.tabbar { border-radius: 22px 22px 0 0; box-shadow: 0 -4px 16px rgba(0, 0, 0, .05); }
.tabbar [aria-current="page"] svg { transform: translateY(-1px) scale(1.08); }
.note { border-radius: 18px; }
.foot { border-top: 0; }
@media (prefers-reduced-motion: reduce) { .btn, .chips button, .tile, .decks button, .tabbar a, .tabbar button, .looks button, nav.menu a, .allmenu a, .shoot { transition: none; } }

/* ───── 글꼴 · 카드 · 메뉴 공통 ───── */
@font-face { font-family: "Wonju"; src: url("/assets/fonts/wonju-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Wonju"; src: url("/assets/fonts/wonju-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
body { background: var(--bg); color: var(--ink); font-family: "Wonju", "Pretendard", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif; }
button, input, select, textarea { font-family: inherit; }
h1, .brand, .tile h2, .box h2, .panel h2, .card > h2, .decks b, #cards h2, .cn h3, .allmenu b, .grp, .vd, .hero small, .tile .tag { font-family: var(--cute); font-weight: 700; }
.topbar { background: color-mix(in srgb, var(--bg) 92%, transparent); color: var(--ink); border-bottom-color: var(--line); }
.topbar .ig, .lang, nav.menu { background: var(--card); }
.topbar .ig { color: var(--blue-dark); }
nav.menu { background: var(--bg); }
nav.menu a { background: var(--card); color: var(--ink-2); border: 1px solid var(--line); }
nav.menu a[aria-current="page"], .lang button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: var(--on); }
.hero { color: var(--ink); background: var(--hero); }
.hero small { color: var(--blue-dark); letter-spacing: .06em; }
.hero p { color: var(--ink-2); }
.box, .panel, .card, .tile, .cn, .decks button, .cards a, #pvrest { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn, .chips button, .fgrid select, .fgrid input, .rw select, .rw input, .rw button, textarea, .seg button, .tog, .camtabs button, .row select, .grid2 select, .lxg select, .sim input[type=number] { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.primary, .chips button[aria-pressed="true"], .seg button[aria-pressed="true"], .tog[aria-pressed="true"], .modesw button[aria-pressed="true"], .allmenu a[aria-current="page"], .steps li::before { background: var(--blue); border-color: var(--blue); color: var(--on); }
.tile { box-shadow: 0 6px 20px rgba(17, 24, 39, .05); }
.tile .tag, .note, .src a, .org a { background: var(--blue-soft); color: var(--blue-dark); }
.tabbar { background: color-mix(in srgb, var(--card) 96%, transparent); border-top-color: var(--line); }
.tabbar [aria-current="page"], .tabbar button[aria-expanded="true"] { color: var(--blue-dark); background: var(--blue-soft); }
.allmenu > div, .modesw, #view header button, #view footer button { background: var(--card); color: var(--ink); }
.allmenu a { background: var(--soft); color: var(--ink); }
#view { background: var(--bg); }
#view footer button.pri { background: var(--blue); border-color: var(--blue); color: var(--on); }
.looks button { background: var(--soft); color: var(--ink-2); }
.looks button[aria-pressed="true"] { background: var(--card); }
.foot { color: var(--muted); }
.foot b { color: var(--ink-2); }
.foot a { color: var(--blue-dark); }
a { color: inherit; }
:focus-visible { outline-color: var(--amber); }

/* 다크 모드(html[data-theme="dark"], lang.js가 붙임): 색은 맨 아래 '브랜드' 블록 */
html[data-theme="dark"] .tile, html[data-theme="dark"] #cards .cd { box-shadow: none; }
html[data-theme="dark"] .res div, html[data-theme="dark"] .pw div { background: var(--soft); }
html[data-theme="dark"] .car { background: var(--field); }
html[data-theme="dark"] .allmenu:not([hidden]) { background: rgba(0, 0, 0, .6); }

/* ───── 휴대폰에서 쓰기 편하게(2026-11-28) ───── */
input[type=range] { accent-color: var(--range); }
input[type=checkbox], input[type=radio] { accent-color: var(--range); }
@media (max-width: 760px) {
  /* 16px보다 작은 입력 글자는 아이폰이 누를 때 화면을 확대해 버림 */
  input, select, textarea { font-size: 16px !important; }
  input[type=range] { min-height: 40px; }
  /* 손가락으로 누르기 쉬운 크기(44px) */
  .seg button, .tog, .camtabs button, .btn, .chips button, .row select, .grid2 select, .lxg select, .tbl select, .sim input[type=number] { min-height: 44px !important; }
  .seg, .camtabs { gap: 6px; }
  /* 도구가 첫 화면에 바로 보이게 소개 영역을 줄임 */
  .hero { padding: 18px 16px 26px; border-radius: 0 0 24px 24px; }
  .hero h1 { font-size: 27px; margin: 4px 0 6px; }
  .hero p { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hero small { font-size: 11.5px; }
  .tiles { margin-top: -14px; gap: 12px; padding: 0 16px; }
  .tile { min-height: 0; padding: 18px; flex-direction: row; align-items: center; gap: 14px; flex-wrap: wrap; }
  .tile .ico { flex: none; }
  .tile h2 { margin: 0; flex: 1 1 0; min-width: 0; font-size: 18px; }
  .tile p { flex: 1 1 100%; }
  .page, .sim { padding-left: 14px; padding-right: 14px; }
}

/* ───── 디자인 시스템 v2 (2026-11-28 밤, 사용자 지정) ─────
   라이트 = 밝은 회청 바탕 + 흰 카드, 다크 = 딥 미드나잇 네이비(색은 아래 '브랜드' 블록). 전환은 위쪽 버튼(lang.js가 html[data-theme]를 붙임, 처음엔 기기 설정을 따름).
   글꼴은 Pretendard. 숫자는 고정폭(tabular-nums) — 값이 바뀌어도 좌우로 흔들리지 않게.
   판정(가능 · 주의 · 불가)은 브랜드 색이 아니라 상태 색(--ok · --warn · --bad). */
:root {
  --ui: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Malgun Gothic", "맑은 고딕", sans-serif; --cute: var(--ui);
}
body { font-family: var(--ui); line-height: 1.55; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.brand b, .brand { font-family: "Wonju", var(--ui); letter-spacing: 0; }
h1, h2, h3 { letter-spacing: -0.03em; }
/* 히어로: 그라데이션 · 동그란 장식 없이 단색 + 선 아이콘 */
.hero, html[data-theme="dark"] .hero { background: var(--hero); border-bottom: 1px solid var(--line); }
.hero .wrap { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 72' fill='none' stroke='%23f59e0b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' opacity='.45'%3E%3Cpath d='M10 22h16l6-9h32l6 9h16v40H10z'/%3E%3Ccircle cx='48' cy='41' r='13'/%3E%3Ccircle cx='48' cy='41' r='5'/%3E%3Cpath d='M74 31h4'/%3E%3C/svg%3E") right 8px center / 92px auto no-repeat; }
@media (max-width: 760px) { .hero .wrap { background-size: 0; } }
/* 입력창 */
.fgrid select, .fgrid input, .rw select, .rw input, textarea, .row select, .grid2 select, .lxg select, .sim input[type=number], .dtool input { background: var(--field); }
/* 강조 · 활성 상태는 포인트 색 하나로(위 알약 메뉴 · 아래 탭 · 버튼) */
.chips button[aria-pressed="true"], .btn.primary, html[data-theme="dark"] .chips button[aria-pressed="true"], html[data-theme="dark"] .btn.primary { box-shadow: none; }
.tabbar [aria-current="page"], .tabbar button[aria-expanded="true"] { color: var(--blue-dark); background: var(--blue-soft); }
.tile, .box, .panel, .card { box-shadow: var(--shadow); }
.topbar .tools { display: inline-flex; gap: 6px; align-items: center; }
.thm { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; padding: 0; }
.thm svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.thm[hidden] { display: none; }
/* 판정 색(공통) */
.vd.lv3 { background: color-mix(in srgb, var(--ok) 13%, var(--card)); color: var(--ok); }
.vd.lv2, .vd.lv1 { background: color-mix(in srgb, var(--warn) 15%, var(--card)); color: var(--warn); }
.vd.lv0 { background: color-mix(in srgb, var(--bad) 13%, var(--card)); color: var(--bad); }
.vd.lvn { background: var(--soft); color: var(--muted); }
.rw p.lv3 { color: var(--ok); } .rw p.lv1, .rw p.lv2 { color: var(--warn); } .rw p.lv0, .lst li.w { color: var(--bad); }
html[data-theme="light"] .vd.lv2, html[data-theme="light"] .vd.lv1, html[data-theme="light"] .rw p.lv1 { color: var(--warn-ink); } /* 밝은 바탕의 앰버 글자는 한 단계 진하게(읽힘) */
/* 설명 접기(간편 모드): 입력창과 결과만 */
.cmp { font: inherit; font-size: 13px; font-weight: 700; min-height: 36px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer; margin-top: 10px; }
.cmp[aria-pressed="true"] { background: var(--cta) border-box; border-color: transparent; color: var(--on-cta); }
html.compact .hero p, html.compact main .muted, html.compact main p.note, html.compact #easyBox, html.compact main ul.lst.muted, html.compact .guide { display: none !important; }

/* ═════ 브랜드(사용자 지정 2026-11-29 리뉴얼): 딥 미드나잇 네이비 + 앰버 → 코랄 리본 ═════
   색은 여기 한 곳에서만 정함 — 위쪽 규칙 · 각 페이지는 이 변수만 씀.
   --blue = 단색 강조(채움 · 테두리 · 슬라이더 · 아이콘), --blue-dark = 강조 글자(밝은 화면에서는 읽히게 진한 코랄 오렌지 #BC3F0C, 흰 바탕 대비 5.4:1),
   --cta = 핵심 버튼 · 켜진 토글의 그라데이션(글자 흰색), --on = 단색 앰버 위 글자. 초록 · 노랑 · 빨강은 판정(가능 · 주의 · 불가)에만 */
:root {
  --ink: #0f172a; --ink-2: #334155; --muted: #475569; --line: rgba(15, 23, 42, .08); --soft: #edf1f7; --field: #eef2f7; --bg: #f4f6fa; --card: #ffffff; --card-2: #f8fafc; --hero: #f4f6fa;
  --blue: #f59e0b; --blue-dark: #bc3f0c; --blue-soft: rgba(245, 158, 11, .12); --blue-line: rgba(245, 158, 11, .24); --amber: #f59e0b; --range: #ea580c; --on: #0b101b;
  --cta: linear-gradient(135deg, #f59e0b 0%, #ea580c 60%, #e11d48 100%); --on-cta: #ffffff;
  --ok: #046c4e; --warn: #d97706; --warn-ink: #a8500a; --bad: #b91c1c;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
}
html[data-theme="dark"] {
  --ink: #f1f5f9; --ink-2: #cbd5e1; --muted: #94a3b8; --line: rgba(255, 255, 255, .08); --soft: #1a2438; --field: #0f1624; --bg: #0b101b; --card: #131b2b; --card-2: #1a2438; --hero: #0b101b;
  --blue-dark: #f59e0b; --range: #f59e0b; /* 슬라이더: 밝은 화면에서는 한 단계 진하게(브라우저가 밝은 강조색이면 트랙을 검게 바꿈) */
  --ok: #34d399; --warn: #fbbf24; --warn-ink: #fbbf24; --bad: #f87171; --shadow: none; color-scheme: dark;
}
/* 핵심 버튼 · 켜진 토글 = 그라데이션 + 흰 글자. 테두리 자리까지 그라데이션이 이어지도록 border-box */
.btn.primary, nav.menu a[aria-current="page"], .lang button[aria-pressed="true"], .modesw button[aria-pressed="true"], .chips button[aria-pressed="true"], .seg button[aria-pressed="true"], .tog[aria-pressed="true"],
.allmenu a[aria-current="page"], .gs-br button[aria-pressed="true"], #view footer button.pri {
  background: var(--cta) border-box; border-color: transparent; color: var(--on-cta); text-shadow: 0 1px 1px rgba(124, 45, 18, .4); box-shadow: none; }
.btn.primary:hover, nav.menu a[aria-current="page"]:hover { border-color: transparent; color: var(--on-cta); filter: brightness(1.06); }
.steps li::before { background: var(--blue); border-color: var(--blue); color: var(--on); }
/* 카드 · 타일: 눌림 / 올림 색, 입력 · 구간 선택 바탕 */
.tile:hover, .tile:active, .allmenu a:active, .gs-l button:active, .pickbar:active, .gcard:active { background: var(--card-2); }
.lang, .modesw { background: var(--field); }
/* 360px 폰: 위 막대(로고 · 테마 · 언어 · 인스타)가 화면 밖으로 밀리지 않게 간격만 줄임 */
@media (max-width: 380px) { .topbar { padding: 0 10px; gap: 6px; } .topbar .lang button { min-width: 40px; padding: 0 8px; } }
.gs-h i { background: var(--muted); opacity: .4; }
/* 홈 타일 · 주제 아이콘: 색 돌려 쓰기 없이 한 가지 */
.tile:nth-child(n) .ico, .decks button:nth-child(n) .ic, html[data-theme="dark"] .tile:nth-child(n) .ico, html[data-theme="dark"] .decks button:nth-child(n) .ic { background: var(--blue-soft); border: 1px solid var(--blue-line); color: var(--blue-dark); }
/* 아이콘: 같은 굵기의 둥근 선 */
.ico svg, .ic svg, .tabbar svg, .thm svg, .topbar .ig svg, .allmenu svg, .tb svg, .rb svg, .gal svg { stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* 누름 대상은 44px 이상 */
.thm { width: 44px; height: 44px; }
.lang button { min-height: 44px; min-width: 44px; padding: 0 12px; }
.topbar .ig { min-height: 44px; }
.cmp { min-height: 44px; }
nav.menu a { min-height: 44px; display: inline-flex; align-items: center; }
/* 눌림 피드백 · 부드러운 전환(과하지 않게, 움직임 줄이기 설정이면 끔) */
button, .btn, .tile, nav.menu a, .tabbar a, .decks button, .chips button, .allmenu a, summary { transition: transform .15s ease, background-color .18s ease, border-color .18s ease, color .18s ease, opacity .18s ease; }
button:active, .btn:active, .tile:active, nav.menu a:active, .tabbar a:active, .decks button:active, .allmenu a:active { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } button:active, .btn:active, .tile:active { transform: none; } }
/* 하단 안내 */
.foot .dm { display: block; margin: 6px 0 4px; font-weight: 600; color: var(--ink-2); }
.foot .dm a { color: var(--blue-dark); font-weight: 700; }
/* 영어는 글자가 길어 아래 탭 · 위 알약에서 줄이 바뀌지 않게 */
.tabbar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
nav.menu a { white-space: nowrap; }

/* 경고 줄 앞 아이콘: 선으로 그린 삼각형(글자 ⚠는 기기에 따라 이모지로 나와서 안 씀). 색은 글자색을 따름 */
.wi { display: inline-block; width: 1.05em; height: 1.05em; margin-right: .32em; vertical-align: -.16em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 2.8 20h18.4z'/%3E%3Cpath d='M12 10v4.6M12 17.5v.1'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 2.8 20h18.4z'/%3E%3Cpath d='M12 10v4.6M12 17.5v.1'/%3E%3C/svg%3E") center / contain no-repeat; }

/* 헤더 로고(2026-11-29 브랜드 심볼 /logo-symbol-128.png): 둥근 사각 30px로, 글자는 Pretendard Bold(원주체 지정은 여기서 끝) */
.brand, .brand b { gap: 9px; font-family: var(--ui); font-weight: 700; letter-spacing: -.02em; }
.brand .dot { flex: none; display: block; width: 30px; height: 30px; border-radius: 8px; overflow: hidden; background: none; box-shadow: none; transform: none; }
.brand .dot img { display: block; width: 100%; height: 100%; }
.brand { min-height: 44px; } .topbar .ig { min-width: 44px; justify-content: center; } /* 누름 영역 44px */

/* ───────── 카메라 · 렌즈 카드와 고르기 시트(커튼) — 계산기 · 앵글 시뮬레이터 공통(gearpick.js) ───────── */
.gcard { position: relative; display: grid; gap: 2px; width: 100%; min-height: 66px; padding: 10px 40px 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--field); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.gcard small { font-size: 12px; font-weight: 700; color: var(--muted); }
.gcard b { font-size: 15.5px; line-height: 1.3; }
.gcard span { font-size: 12.5px; line-height: 1.4; color: var(--muted); font-variant-numeric: tabular-nums; }
.gcard i { position: absolute; right: 15px; top: 50%; width: 9px; height: 9px; margin-top: -7px; border: solid var(--muted); border-width: 0 1.7px 1.7px 0; transform: rotate(45deg); }
.gsheet { width: min(100vw, 560px); max-width: none; height: min(84dvh, 720px); max-height: none; margin: auto auto 0; padding: 0; border: 0; border-radius: 20px 20px 0 0; background: var(--card); color: var(--ink); overflow: hidden; animation: gsUp .24s ease-out; }
.gsheet[open] { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); }
.gsheet::backdrop { background: rgba(0, 0, 0, .5); }
@keyframes gsUp { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .gsheet { animation: none; } }
.gs-h { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 18px 6px 4px 18px; touch-action: none; cursor: grab; }
.gs-h i { position: absolute; left: 50%; top: 8px; width: 44px; height: 5px; margin-left: -22px; border-radius: 9px; background: var(--line); }
.gs-h b { font-size: 17px; }
.gs-h button { width: 44px; height: 44px; border: 0; background: none; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.gs-q { margin: 2px 14px 0; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); color: var(--ink); font: inherit; font-size: 16px; }
.gs-br { display: flex; gap: 6px; padding: 10px 14px; overflow-x: auto; scrollbar-width: none; } .gs-br::-webkit-scrollbar { display: none; }
.gs-br button { flex: none; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--ink-2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.gs-br button[aria-pressed="true"] { background: var(--cta) border-box; border-color: transparent; color: var(--on-cta); }
.gs-l { overflow-y: auto; overscroll-behavior: contain; padding: 0 14px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 6px; align-content: start; }
.gs-l h4 { margin: 8px 2px 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.gs-l button { display: grid; gap: 2px; min-height: 56px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.gs-l button b { font-size: 15px; line-height: 1.3; } .gs-l button span { font-size: 12.5px; line-height: 1.4; color: var(--muted); font-variant-numeric: tabular-nums; }
.gs-l button[aria-pressed="true"] { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.gs-l p { margin: 14px 2px; font-size: 14px; color: var(--muted); }

/* 제목 + 본문만 있는 커튼(sheet.js) · 누르면 커튼이 올라오는 한 줄 선택 바 */
.gsheet.gsx[open] { grid-template-rows: auto minmax(0, 1fr); height: fit-content; max-height: min(84dvh, 720px); }
.gsheet.gsx .gs-l { padding-top: 6px; }
.pickbar { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font: inherit; font-size: 15px; font-weight: 700; text-align: left; cursor: pointer; }
.pickbar small { flex: none; font-size: 13px; font-weight: 600; color: var(--muted); }
.pickbar b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pickbar i { flex: none; width: 9px; height: 9px; margin: -5px 3px 0; border: solid var(--muted); border-width: 0 1.7px 1.7px 0; transform: rotate(45deg); }

/* 콘텐츠 보호(사용자 요청 2026-11-29): 글 선택 · 길게 눌러 뜨는 메뉴 · 이미지 끌기를 막음. 입력 칸과 .allow-select 는 그대로 쓸 수 있음. 우클릭 · 복사 · 단축키를 막는 것은 site.js
   완전한 보호는 아님(화면 캡처 · 개발자 도구는 못 막음) — 가볍게 막아 두는 용도 */
html { -webkit-touch-callout: none; }
body { -webkit-user-select: none; user-select: none; }
input, textarea, select, [contenteditable="true"], .allow-select, .allow-select * { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img, canvas { -webkit-user-drag: none; }
