/* =====================================================================
   MI User Story 제작 도움말 · 스타일
   ---------------------------------------------------------------------
   1. 글꼴 (assets/fonts · 사내망에서도 외부 연결 없이 표시)
   2. 기본 설정
   3. 색 · 크기 토큰 (:root) — MI UserStory 디자인 가이드 값
   4. 상단 바 · 메뉴 · 문서 · 홈 · 검색 창 · 반응형
   ===================================================================== */

/* ── 1. 글꼴 ── */
@font-face {
  font-family: "Pretendard";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/Pretendard-Regular.subset.woff2") format("woff2");
}

@font-face {
  font-family: "Pretendard";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/Pretendard-SemiBold.subset.woff2") format("woff2");
}

@font-face {
  font-family: "Pretendard";
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/Pretendard-Bold.subset.woff2") format("woff2");
}

/* ── 2. 기본 설정 ── */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

/* ── 3. 토큰 · 레이아웃 ── */
/* Layout: 개발자 문서형 3단 — 상단 검색 바 · 좌측 문서 트리 · 본문 · 우측 "이 페이지" 목차. 토큰은 MI UserStory 디자인 가이드 값 그대로. */
:root {
  color-scheme: light;
  --primary: #024ad8;
  --primary-bright: #296ef9;
  --navy: #0e3191;
  --navy-deep: #071c52;
  --on-primary: #ffffff;
  --ink: #1a1a1a;
  --charcoal: #3d3d3d;
  --graphite: #636363;
  --steel: #a8a8a8;
  --fog: #e8e8e8;
  --cloud: #f7f8fa;
  --canvas: #ffffff;
  --hairline: #e8eaee;
  --hairline-strong: #d3d7de;
  --navy-mist: #eef2fb;
  --error: #b3262b;
  --error-mist: #fbeeee;
  --code-bg: #f5f7fb;
  --code-fg: #1f2a44;
  --tk-com: #8a93a6;
  --tk-str: #0e3191;
  --tk-tag: #024ad8;
  --mark: #dfe8ff;
  --scrim: rgba(7, 28, 82, .45);
  --shadow-lift: 0 2px 8px rgba(7, 28, 82, .06);
  --shadow-pop: 0 24px 64px rgba(7, 28, 82, .24), 0 2px 8px rgba(7, 28, 82, .10);
  --focus-ring: 0 0 0 3px rgba(2, 74, 216, .25);
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 14px;
  --r-2xl: 18px;
  --r-pill: 9999px;
  --sans: Pretendard, "Pretendard Variable", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, "DejaVu Sans Mono", monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --dur-fast: .12s;
  --dur: .2s;
  --top-h: 60px;
  --side-w: 264px;
  --toc-w: 208px;
}

.help-wrap,
.help-wrap *,
.help-modal,
.help-modal *,
.help-toast {
  box-sizing: border-box
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: -.01em;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased
}

.help-wrap a {
  color: var(--primary);
  text-decoration: none
}

.help-wrap a:hover {
  text-decoration: underline
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-sm)
}

/* ── Top bar ── */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
  height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding-inline: 20px;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--hairline)
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink) !important;
  text-decoration: none !important;
  flex-shrink: 0
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--navy);
  display: grid;
  place-items: center
}

.brand-mark span {
  display: block;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 2px;
  transform: rotate(45deg)
}

.brand-logo {
  display: block;
  height: 26px;
  width: auto
}

.brand small {
  padding-left: 10px;
  border-left: 1px solid var(--hairline-strong);
  line-height: 1.2
}

.brand small {
  font-size: 13px;
  color: var(--graphite);
  font-weight: 500
}

.ver {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--navy);
  background: var(--navy-mist);
  padding: 2px 8px;
  border-radius: var(--r-pill)
}

.search-trigger {
  flex: 1;
  min-width: 0;
  max-width: 420px;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  background: var(--cloud);
  color: var(--steel);
  font: inherit;
  font-size: 14px;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast)
}

.search-trigger:hover {
  border-color: var(--primary);
  background: var(--canvas)
}

.search-trigger .ph {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

kbd {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--graphite);
  background: var(--canvas);
  border: 1px solid var(--hairline-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 6px;
  line-height: 20px
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--charcoal);
  cursor: pointer;
  flex-shrink: 0
}

.icon-btn:hover {
  background: var(--cloud);
  border-color: var(--hairline)
}

.icon-btn svg {
  width: 18px;
  height: 18px
}

.menu-btn {
  display: none
}

/* ── Shell ── */
.shell {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  max-width: 1440px;
  margin: 0 auto
}

.side {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + var(--top-h));
  height: calc(100vh - var(--top-h));
  overflow-y: auto;
  padding: 24px 16px 48px 20px;
  border-right: 1px solid var(--hairline)
}

.side-group {
  margin-bottom: 22px
}

.side-group h4 {
  margin: 0 0 6px 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--graphite);
  letter-spacing: -.01em
}

.side-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px
}

.side-link {
  display: block;
  padding: 6px 10px;
  border-radius: var(--r-md);
  color: var(--charcoal) !important;
  font-size: 14px;
  line-height: 1.45;
  text-decoration: none !important;
  transition: background var(--dur-fast)
}

.side-link:hover {
  background: var(--cloud)
}

.side-link.is-active {
  background: var(--navy-mist);
  color: var(--navy) !important;
  font-weight: 700
}

.side-home {
  margin-bottom: 18px
}

.main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--toc-w);
  gap: 48px;
  padding: 40px 40px 96px
}

.main.is-home {
  display: block;
  padding: 0 0 96px
}

/* ── Article ── */
.doc {
  min-width: 0;
  max-width: 740px
}

.crumb {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: var(--graphite);
  margin-bottom: 10px
}

.crumb span+span::before {
  content: "/";
  margin-right: 6px;
  color: var(--steel)
}

.doc h1:focus {
  box-shadow: none;
  outline: none
}

.doc h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -.035em;
  text-wrap: balance
}

.doc .lead {
  margin: 0 0 28px;
  font-size: 16.5px;
  color: var(--graphite);
  line-height: 1.65
}

.doc h2 {
  margin: 44px 0 12px;
  padding-top: 4px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.03em;
  scroll-margin-top: 84px;
  text-wrap: balance
}

.doc h3 {
  margin: 28px 0 8px;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -.025em;
  scroll-margin-top: 84px
}

.doc p {
  margin: 0 0 14px
}

.doc ul,
.doc ol {
  margin: 0 0 16px;
  padding-left: 22px
}

.doc li {
  margin-bottom: 6px
}

.doc li::marker {
  color: var(--steel)
}

.doc strong {
  font-weight: 700;
  color: var(--ink)
}

.doc code {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--code-bg);
  border: 1px solid var(--hairline);
  padding: 1px 5px;
  border-radius: 5px;
  color: var(--code-fg);
  white-space: nowrap
}

.doc pre code {
  white-space: pre;
  background: none;
  border: 0;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit
}

.doc h2 .anchor {
  margin-left: 8px;
  opacity: 0;
  color: var(--steel) !important;
  font-weight: 400
}

.doc h2:hover .anchor {
  opacity: 1
}

.tbl-wrap {
  overflow-x: auto;
  margin: 0 0 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg)
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.55
}

.doc th {
  background: var(--cloud);
  text-align: left;
  font-weight: 700;
  color: var(--charcoal);
  font-size: 13px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap
}

.doc td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top
}

.doc tr:last-child td {
  border-bottom: 0
}

.doc td.num {
  font-family: var(--mono);
  color: var(--graphite);
  font-size: 13px;
  width: 40px
}

.code {
  position: relative;
  margin: 0 0 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--code-bg);
  overflow: hidden
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--hairline);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--graphite)
}

.copy-btn {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-sm);
  background: var(--canvas);
  color: var(--charcoal);
  font: inherit;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  cursor: pointer
}

.copy-btn:hover {
  border-color: var(--primary);
  color: var(--primary)
}

.code pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--code-fg);
  tab-size: 2
}

.tk-com {
  color: var(--tk-com);
  font-style: italic
}

.tk-str {
  color: var(--tk-str)
}

.tk-tag {
  color: var(--tk-tag);
  font-weight: 600
}

.callout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--hairline);
  background: var(--cloud);
  font-size: 14.5px;
  line-height: 1.65
}

.callout p:last-child,
.callout ul:last-child {
  margin-bottom: 0
}

.callout .c-ico {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  margin-top: 1px;
  font-family: var(--mono)
}

.callout .c-label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 2px
}

.callout.must {
  background: var(--navy-mist);
  border-color: transparent
}

.callout.must .c-ico {
  background: var(--navy);
  color: #fff
}

.callout.must .c-label {
  color: var(--navy)
}

.callout.warn {
  background: var(--error-mist);
  border-color: transparent
}

.callout.warn .c-ico {
  background: var(--error);
  color: #fff
}

.callout.warn .c-label {
  color: var(--error)
}

.callout.tip .c-ico {
  background: var(--primary);
  color: #fff
}

.callout.tip .c-label {
  color: var(--primary)
}

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  white-space: nowrap
}

.pill.req {
  background: var(--navy);
  color: #fff
}

.pill.opt {
  border: 1px solid var(--hairline-strong);
  color: var(--graphite)
}

.pill.block {
  background: var(--error-mist);
  color: var(--error)
}

/* related / prev-next */
.related {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline)
}

.related h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--graphite);
  font-weight: 700
}

.related ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

.related a {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  font-size: 13.5px;
  color: var(--charcoal) !important;
  text-decoration: none !important
}

.related a:hover {
  border-color: var(--primary);
  color: var(--primary) !important
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 28px
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  text-decoration: none !important;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast)
}

.pager a:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lift)
}

.pager small {
  font-size: 12.5px;
  color: var(--graphite)
}

.pager b {
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -.02em
}

.pager .next {
  text-align: right;
  grid-column: 2
}

.doc-foot {
  margin-top: 28px;
  font-size: 13px;
  color: var(--steel)
}

/* TOC */
.toc {
  position: sticky;
  top: calc(var(--top-h) + 40px);
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  font-size: 13.5px
}

.toc h5 {
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--graphite)
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--hairline)
}

.toc a {
  display: block;
  padding: 4px 0 4px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--graphite) !important;
  line-height: 1.45;
  text-decoration: none !important
}

.toc a:hover {
  color: var(--ink) !important
}

.toc a.is-active {
  border-left-color: var(--navy);
  color: var(--navy) !important;
  font-weight: 700
}

/* ── Home ── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 40px 44px;
  border-bottom: 1px solid var(--hairline);
  background: #f7f8fc
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../images/hero-bg.jpg") right center/cover no-repeat;
  opacity: .85;
  pointer-events: none
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, .78) 0%, rgba(255, 255, 255, .45) 50%, rgba(255, 255, 255, 0) 80%), linear-gradient(0deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 40%);
  pointer-events: none
}

.hero-in {
  position: relative;
  z-index: 1
}

@media (max-width:640px) {
  .hero::before {
    opacity: .4
  }
}

.hero-in {
  max-width: 760px
}

.hero .eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--navy);
  margin-bottom: 10px
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -.04em;
  text-wrap: balance
}

.hero p {
  margin: 0 0 24px;
  color: var(--graphite);
  font-size: 16px
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 54px;
  padding: 0 14px 0 18px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-xl);
  background: var(--canvas);
  box-shadow: 0 8px 24px rgba(7, 28, 82, .08);
  color: var(--steel);
  font: inherit;
  font-size: 16px;
  cursor: text;
  text-align: left;
  transition: border-color var(--dur-fast)
}

.hero-search:hover {
  border-color: var(--primary)
}

.hero-search svg {
  width: 20px;
  height: 20px;
  color: var(--graphite);
  flex-shrink: 0
}

.hero-search .ph {
  flex: 1
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  align-items: center
}

.chips small {
  color: var(--graphite);
  font-size: 13px;
  margin-right: 2px
}

.chip {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: var(--canvas);
  color: var(--charcoal);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
  cursor: pointer
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary)
}

.home-body {
  padding: 40px 40px 0;
  max-width: 1180px
}

.home-body h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.03em
}

.rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 44px
}

.rule {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 16px 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  background: var(--canvas);
  color: var(--ink) !important;
  text-decoration: none !important;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast)
}

.rule:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lift)
}

.rule-top {
  display: flex;
  justify-content: space-between;
  align-items: center
}

.rule-no {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--steel);
  letter-spacing: .04em
}

.rule b {
  font-size: 15px;
  letter-spacing: -.02em;
  line-height: 1.45
}

.rule span.d {
  font-size: 13.5px;
  color: var(--graphite);
  line-height: 1.55
}

.cats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 44px
}

.cat {
  padding: 18px 18px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  background: var(--cloud)
}

.cat h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.03em
}

.cat p {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--graphite);
  line-height: 1.55
}

.cat ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px
}

.cat a {
  font-size: 14px;
  font-weight: 600
}

.faq {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  border-top: 1px solid var(--hairline)
}

.faq a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink) !important;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.02em;
  text-decoration: none !important
}

.faq a:hover {
  color: var(--primary) !important
}

.faq a::after {
  content: "→";
  color: var(--steel)
}

/* ── Figures ── */
.figs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 24px
}

.figs.figs-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr))
}

.figs figure {
  margin: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--cloud)
}

.figs img {
  display: block;
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover
}

.figs figcaption {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--graphite);
  line-height: 1.45
}

.figs figcaption b {
  color: var(--ink);
  margin-right: 4px
}

.samples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 44px
}

.sample {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  overflow: hidden;
  color: var(--ink) !important;
  text-decoration: none !important;
  background: var(--canvas);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast)
}

.sample:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lift)
}

.sample img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 120px
}

.sample div {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px
}

.sample small {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: .04em
}

.sample b {
  font-size: 16px;
  letter-spacing: -.03em
}

.sample span {
  font-size: 13.5px;
  color: var(--graphite);
  line-height: 1.5
}

@media (max-width:900px) {
  .samples {
    grid-template-columns: minmax(0, 1fr)
  }
}

@media (max-width:640px) {
  .figs,
  .figs.figs-3 {
    grid-template-columns: minmax(0, 1fr)
  }

  .sample {
    grid-template-columns: 120px minmax(0, 1fr)
  }
}

/* ── Tools inside docs ── */
.tool {
  margin: 0 0 24px;
  padding: 18px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-xl);
  background: var(--canvas)
}

.tool-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 700
}

.tool-head .pill {
  background: var(--primary);
  color: #fff
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--charcoal)
}

.field input[type=text] {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: 14.5px
}

.field input[type=text]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring)
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
  font-size: 14px
}

.checks label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer
}

.checks input {
  accent-color: var(--navy);
  width: 16px;
  height: 16px
}

.name-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.name-fields .field {
  position: relative;
}

.name-fields .field label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.name-fields input[type=text] {
  padding-right: 64px;
}

.name-fields input[type=text]:disabled {
  background: var(--cloud);
  color: var(--steel);
}

/* 화면 이름 글자 수 (10자 넘으면 빨강) */
.name-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--steel);
  font-variant-numeric: tabular-nums;
}

.name-count.is-over {
  color: var(--error);
  font-weight: 700;
}

@media (max-width: 640px) {
  .name-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

.gen-warn {
  font-size: 13px;
  color: var(--error);
  margin: -4px 0 10px
}

.cl-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  background: var(--cloud);
  font-size: 14px;
  font-weight: 600
}

.cl-bar {
  flex: 1;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--fog);
  overflow: hidden
}

.cl-bar i {
  display: block;
  height: 100%;
  background: var(--navy);
  width: 0;
  transition: width var(--dur) var(--ease)
}

.cl-count {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--graphite)
}

.cl-reset {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-sm);
  background: var(--canvas);
  color: var(--charcoal);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer
}

.cl-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 20px !important;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg)
}

.cl-list li {
  margin: 0 !important;
  border-bottom: 1px solid var(--hairline)
}

.cl-list li:last-child {
  border-bottom: 0
}

.cl-list label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14.5px
}

.cl-list input {
  accent-color: var(--navy);
  width: 16px;
  height: 16px;
  margin-top: 4px;
  flex-shrink: 0
}

.cl-list input:checked+span {
  color: var(--steel);
  text-decoration: line-through
}

/* Diagram: safe area */
.zone {
  position: relative;
  aspect-ratio: 1280/768;
  max-width: 100%;
  margin: 0 0 20px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-lg);
  background: var(--cloud);
  overflow: hidden;
  font-size: 12px;
  font-weight: 600
}

.zone div {
  position: absolute;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1.35;
  color: var(--navy);
  background: var(--navy-mist);
  border: 1px dashed color-mix(in srgb, var(--navy) 40%, transparent)
}

.zone .z-free {
  background: transparent;
  border: 0;
  color: var(--graphite)
}

.zone .z-panel {
  background: var(--error-mist);
  color: var(--error) !important;
  border-color: color-mix(in srgb, var(--error) 45%, transparent)
}

/* ── Search modal ── */
.help-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(10vh, 24px) 16px 16px;
  background: var(--scrim);
  backdrop-filter: blur(4px)
}

.help-modal[hidden] {
  display: none !important
}

.sbox {
  width: 100%;
  max-width: 640px;
  max-height: min(620px, 80vh);
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  font-family: var(--sans);
  color: var(--ink)
}

.sbox-in {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 0 18px;
  height: 58px;
  border-bottom: 1px solid var(--hairline)
}

.sbox-in svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
  flex-shrink: 0
}

.sbox-in input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16.5px;
  letter-spacing: -.02em;
  outline: none
}

.sbox-in input:focus-visible {
  box-shadow: none
}

.sbox-in input::placeholder {
  color: var(--steel)
}

.sres {
  flex: 1;
  overflow-y: auto;
  padding: 8px
}

.sgroup {
  padding: 10px 10px 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--graphite)
}

.sitem {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: var(--r-lg);
  color: var(--ink) !important;
  text-decoration: none !important;
  cursor: pointer
}

.sitem .s-ico {
  width: 28px;
  height: 28px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  display: grid;
  place-items: center;
  color: var(--graphite);
  font-size: 13px;
  font-family: var(--mono);
  font-weight: 700
}

.sitem .s-t {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.4
}

.sitem .s-sec {
  color: var(--graphite);
  font-weight: 500
}

.sitem .s-x {
  display: block;
  font-size: 13px;
  color: var(--graphite);
  line-height: 1.5;
  margin-top: 2px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical
}

.sitem mark {
  background: var(--mark);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px
}

.sitem.is-sel {
  background: var(--navy)
}

.sitem.is-sel .s-t,
.sitem.is-sel .s-sec,
.sitem.is-sel .s-x {
  color: #fff
}

.sitem.is-sel .s-ico {
  border-color: rgba(255, 255, 255, .35);
  color: #fff
}

.sitem.is-sel mark {
  background: rgba(255, 255, 255, .22)
}

.sempty {
  padding: 36px 20px;
  text-align: center;
  color: var(--graphite);
  font-size: 14.5px
}

.sempty b {
  display: block;
  color: var(--ink);
  font-size: 15px;
  margin-bottom: 4px
}

.sfoot {
  display: flex;
  gap: 16px;
  align-items: center;
  height: 42px;
  padding: 0 16px;
  border-top: 1px solid var(--hairline);
  background: var(--cloud);
  font-size: 12.5px;
  color: var(--graphite)
}

.sfoot span {
  display: flex;
  align-items: center;
  gap: 5px
}

.help-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 11000;
  padding: 12px 24px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  box-shadow: 0 12px 32px rgba(7, 28, 82, .16);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease)
}

.help-toast.is-shown {
  opacity: 1;
  transform: translateX(-50%) translateY(0)
}

.side-scrim {
  display: none
}

/* ── Responsive ── */
@media (max-width:1180px) {
  .main {
    grid-template-columns: minmax(0, 1fr)
  }

  .toc {
    display: none
  }
}

@media (max-width:900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr)
  }

  .menu-btn {
    display: grid
  }

  .side {
    position: fixed;
    left: 0;
    top: calc(env(safe-area-inset-top, 0px) + var(--top-h));
    bottom: 0;
    height: auto;
    width: min(300px, 86vw);
    z-index: 45;
    background: var(--canvas);
    transform: translateX(-100%);
    transition: transform var(--dur) var(--ease)
  }

  .side.is-open {
    transform: none;
    box-shadow: var(--shadow-pop)
  }

  .side-scrim.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 44;
    background: var(--scrim)
  }

  .main {
    padding: 28px 20px 80px
  }

  .hero {
    padding: 40px 20px 32px
  }

  .home-body {
    padding: 28px 20px 0
  }

  .rules,
  .cats {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr)
  }

  .faq {
    grid-template-columns: minmax(0, 1fr)
  }

  .brand small {
    display: none
  }
}

@media (max-width:640px) {
  .topbar {
    padding-inline: 12px;
    gap: 8px
  }

  .brand b {
    display: none
  }

  .ver {
    display: none
  }

  .search-trigger kbd {
    display: none
  }

  .rules,
  .cats {
    grid-template-columns: minmax(0, 1fr)
  }

  .hero h1 {
    font-size: 26px
  }

  .doc h1 {
    font-size: 25px
  }

  .pager {
    grid-template-columns: minmax(0, 1fr)
  }

  .pager .next {
    grid-column: 1
  }

  .sfoot {
    display: none
  }
}

@media (prefers-reduced-motion:reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important
  }

  .help-toast.is-shown {
    transform: translateX(-50%)
  }
}