/* 회계매크로 사용설명서(/guides/accounting-macro) — motion.css 의 토큰 위에 얹는다. 모든 규칙은 .am-docs 아래로만. */

.am-docs.am-gd { display: block; max-width: 1240px; margin: 0 auto; padding: 0 0 56px; }

.am-docs .am-gd-hero {
  padding: clamp(22px, 3.5vw, 40px); border: 1px solid var(--am-line); border-radius: 22px;
  background: radial-gradient(800px 360px at 100% 0, rgba(46, 96, 196, .14), transparent 62%), linear-gradient(180deg, #f7f9fe, #eaf0fb);
}
.am-docs .am-gd-hero h1 { margin: 0; font-size: clamp(28px, 3.6vw, 42px); font-weight: 800; line-height: 1.25; letter-spacing: -.02em; }
.am-docs .am-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--am-excel); font-size: 14px; font-weight: 800; }
.am-docs .am-kicker i { width: 8px; height: 8px; border-radius: 50%; background: var(--am-excel); }
.am-docs .am-lead { margin: 10px 0 0; color: var(--am-muted); font-size: 17px; }
.am-docs .am-support { margin: 10px 0 0; color: var(--am-muted); font-size: 13px; }
.am-docs .am-support--block { padding: 12px 16px; border: 1px solid var(--am-line); border-radius: 12px; background: #fff; color: var(--am-ink); font-size: 14px; }
.am-docs .am-support--block strong { margin-right: 8px; color: var(--am-blue-deep); }

/* 검색 */
.am-docs .am-search { margin-top: 18px; max-width: 520px; }
.am-docs .am-search label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 800; }
.am-docs .am-search input {
  display: block; width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid #b9c5de; border-radius: 12px; background: #fff; color: var(--am-ink); font: inherit; font-size: 16px;
}
.am-docs .am-search-status { margin: 6px 0 0; color: var(--am-muted); font-size: 13px; }

/* 레이아웃: 목차 + 본문 */
.am-docs .am-gd-layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); margin-top: 18px; align-items: start; }
.am-docs .am-toc { min-width: 0; padding: 12px; border: 1px solid var(--am-line); border-radius: 16px; background: #fff; }
.am-docs .am-toc-title { margin: 0 0 6px; padding: 0 6px; color: var(--am-muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.am-docs .am-toc-fold > summary { margin: 0; padding: 6px 8px; list-style: none; cursor: pointer; }
.am-docs .am-toc-fold > summary::-webkit-details-marker { display: none; }
.am-docs .am-toc-fold > summary::after { content: "펼치기"; float: right; color: var(--am-blue-deep); font-size: 12px; letter-spacing: 0; }
.am-docs .am-toc-fold[open] > summary::after { content: "접기"; }
.am-docs .am-toc-list, .am-docs .am-toc-sub { margin: 0; padding: 0; list-style: none; }
.am-docs .am-toc-list { display: grid; gap: 2px; margin-top: 6px; }
.am-docs .am-toc-list a { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 12px; border-radius: 9px; color: var(--am-muted); font-size: 14px; font-weight: 700; text-decoration: none; }
.am-docs .am-toc-list a:hover { background: var(--am-mist); color: var(--am-blue-deep); }
.am-docs .am-toc-list a:focus-visible { outline: 2px solid var(--am-blue); outline-offset: 1px; }
.am-docs .am-toc-list a[aria-current="true"] { background: var(--am-blue-wash); color: var(--am-blue-deep); }
.am-docs .am-toc-list a small { padding: 0 7px; border-radius: 999px; background: var(--am-line-soft); font-size: 11px; font-weight: 800; }
.am-docs .am-toc-sub { display: grid; gap: 1px; margin: 2px 0 6px 12px; padding-left: 8px; border-left: 2px solid var(--am-line); }
.am-docs .am-toc-sub a { justify-content: flex-start; padding: 5px 10px; font-size: 13px; font-weight: 600; }
.am-docs .am-toc-sub a[aria-current="location"] { background: var(--am-blue); color: #fff; font-weight: 800; }
.am-docs .am-toc-sub li[hidden] { display: none; }
/* 스크립트가 켜진 뒤에는 지금 보는 묶음만 펼친다 */
.am-docs .am-toc.is-on li:not(.is-open) > .am-toc-sub { display: none; }
.am-docs .am-toc-product { display: block; margin-top: 8px; padding: 8px 12px; color: var(--am-blue-deep); font-size: 13px; font-weight: 800; text-decoration: none; }

.am-docs .am-gd-body { min-width: 0; display: grid; gap: 22px; }
.am-docs .am-chapter { min-width: 0; padding: clamp(18px, 2.6vw, 32px); border: 1px solid var(--am-line); border-radius: 20px; background: #fff; scroll-margin-top: 96px; }
.am-docs .am-chapter.is-empty { display: none; }
.am-docs .am-chapter-head { margin-bottom: 18px; }
.am-docs .am-eyebrow { margin: 0 0 4px; color: var(--am-blue); font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.am-docs .am-chapter-head h2 { margin: 0; font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; line-height: 1.35; }
.am-docs .am-chapter-head p { margin: 4px 0 0; color: var(--am-muted); }
.am-docs .am-chapter-head .am-eyebrow { color: var(--am-blue); }
.am-docs .am-chapter-head .am-chapter-note { display: inline-block; margin-top: 8px; padding: 2px 12px; border-radius: 999px; background: var(--am-amber-wash); color: var(--am-amber-ink); font-size: 13px; font-weight: 700; }
.am-docs .am-nomatch { display: none; margin: 0; color: var(--am-muted); }
.am-docs .am-chapter.is-empty .am-nomatch { display: block; }

/* 카드 */
.am-docs .am-cards { display: grid; gap: 16px; }
.am-docs .am-card { min-width: 0; padding: 18px; border: 1px solid var(--am-line); border-radius: 18px; background: #fff; scroll-margin-top: 96px; }
.am-docs .am-card:target { border-color: var(--am-blue); box-shadow: 0 0 0 4px rgba(46, 96, 196, .14); }
.am-docs .am-card.is-off { display: none; }
.am-docs .am-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.am-docs .am-card-head h3 { margin: 0; font-size: 20px; }
.am-docs .am-card-head h3 a { color: inherit; text-decoration: none; }
.am-docs .am-card-head h3 a:hover { color: var(--am-blue-deep); }
.am-docs .am-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.am-docs .am-kind { display: inline-block; padding: 1px 9px; border-radius: 999px; background: var(--am-green-wash); color: var(--am-green); font-size: 12px; font-style: normal; font-weight: 800; }
.am-docs .am-kind--soft { background: var(--am-blue-wash); color: var(--am-blue-deep); }
.am-docs .am-card-line { margin: 6px 0 12px; font-size: 16px; }
.am-docs .am-vtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.am-docs .am-vtab { min-height: 36px; padding: 0 14px; border: 1px solid var(--am-line); border-radius: 999px; background: #fff; color: var(--am-muted); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.am-docs .am-vtab[aria-selected="true"] { border-color: var(--am-blue); background: var(--am-blue); color: #fff; }
.am-docs .am-vpanel { margin-bottom: 8px; }
.am-docs .am-vpanel.is-off { display: none; }
.am-docs .am-vlabel { margin: 0 0 8px; color: var(--am-muted); font-size: 14px; font-weight: 700; }
.am-docs .am-ministeps { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.am-docs .am-ministeps li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 14px; }
.am-docs .am-chip { display: inline-block; padding: 2px 10px; border: 1px solid #b9c5de; border-radius: 8px; background: var(--am-mist); color: var(--am-blue-deep); font-size: 13px; font-weight: 800; }
.am-docs .am-where, .am-docs .am-caution { margin: 10px 0 0; font-size: 14px; }
.am-docs .am-where span, .am-docs .am-caution span { display: inline-block; margin-right: 8px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 800; }
.am-docs .am-where span { background: var(--am-green-wash); color: var(--am-green); }
.am-docs .am-caution span { background: var(--am-amber-wash); color: var(--am-amber-ink); }
.am-docs .am-more-details { margin-top: 10px; border: 1px solid var(--am-line); border-radius: 12px; }
.am-docs .am-more-details summary { padding: 10px 14px; font-size: 14px; font-weight: 800; cursor: pointer; }
.am-docs .am-more-details p { margin: 0; padding: 0 14px 12px; color: var(--am-muted); font-size: 14px; }

/* 시작하기·문제 해결 블록 */
.am-docs .am-steplist { display: grid; gap: 10px; margin: 0 0 14px; padding: 0; list-style: none; }
.am-docs .am-steplist li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: start; }
.am-docs .am-steplist li > b { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--am-blue); color: #fff; font-size: 14px; }
.am-docs .am-steplist li > div { display: grid; gap: 2px; min-width: 0; }
.am-docs .am-steplist li span { color: var(--am-muted); font-size: 14px; }
.am-docs .am-notes { margin: 0 0 14px; padding-left: 20px; }
.am-docs .am-notes li { margin: 4px 0; }
.am-docs .am-facts-list { display: grid; gap: 8px; margin: 0 0 14px; }
.am-docs .am-facts-list div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding-top: 8px; border-top: 1px solid var(--am-line-soft); font-size: 14px; }
.am-docs .am-facts-list dt { color: var(--am-muted); }
.am-docs .am-facts-list dd { margin: 0; font-weight: 700; }
.am-docs .am-scenefig { margin: 0 0 14px; max-width: 460px; }
.am-docs .am-scenefig.is-wide { max-width: 760px; }
.am-docs .am-scenefig figcaption { margin-top: 6px; color: var(--am-muted); font-size: 13px; }
.am-docs .am-outputs { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); margin: 14px 0 0; padding: 0; list-style: none; }
.am-docs .am-out { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--am-line); border-radius: 14px; background: #fff; }
.am-docs .am-out > span { color: var(--am-muted); font-size: 14px; }
.am-docs .am-out--cell { border-top: 4px solid var(--am-amber); }
.am-docs .am-out--sheet { border-top: 4px solid var(--am-green); }
.am-docs .am-out--file { border-top: 4px solid var(--am-blue); }
.am-docs .am-trouble { display: grid; gap: 8px; }
.am-docs .am-trouble details { border: 1px solid var(--am-line); border-radius: 14px; background: #fff; }
.am-docs .am-trouble summary { padding: 12px 16px; font-weight: 800; cursor: pointer; }
.am-docs .am-trouble details p { margin: 0; padding: 0 16px 10px; font-size: 14px; }
.am-docs .am-trouble details p span { display: inline-block; margin-right: 8px; padding: 0 8px; border-radius: 6px; background: var(--am-blue-wash); color: var(--am-blue-deep); font-size: 12px; font-weight: 800; }
.am-docs .am-empty { margin: 0; color: var(--am-muted); }
.am-docs .am-price-hint { background: var(--am-mist); }
.am-docs .am-price-hint p { margin: 0 0 4px; }
.am-docs .am-price-hint a { color: var(--am-blue-deep); font-weight: 800; }

@media (min-width: 640px) {
  .am-docs .am-outputs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .am-docs .am-gd-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .am-docs .am-toc { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .am-docs .am-toc-fold > summary { pointer-events: none; cursor: default; }
  .am-docs .am-toc-fold > summary::after { content: none; }
}

@media (prefers-reduced-motion: reduce) {
  .am-docs .am-card, .am-docs .am-vtab { transition: none; }
}

.am-docs .am-more-steps { margin-top: 8px; }
.am-docs .am-more-steps .am-ministeps { margin: 0; padding: 0 14px 12px; }

.am-docs .am-btnfig { display: flex; align-items: center; gap: 12px; margin: 14px 0; padding: 10px 12px; border: 1px solid var(--am-line); border-radius: 12px; background: #fff; }
.am-docs .am-btnfig img { flex: none; width: 78px; height: 97px; border: 1px solid var(--am-line); border-radius: 8px; }
.am-docs .am-btnfig figcaption { color: var(--am-muted); font-size: 13px; }

/* 카드 기본 모습은 제목·한 줄 설명·전후 격자·3단계 띠. 실제 화면은 접힘 안에 둔다. */
.am-docs .am-screens { margin-top: 10px; }
.am-docs .am-screens > .am-scenefig { margin: 12px 14px; }
.am-docs .am-screens > .am-ministeps { margin: 0; padding: 0 14px 14px; }
.am-docs .am-card .am-result { grid-template-columns: minmax(0, 1fr); }
.am-docs .am-card .am-motion:not(.has-pane) .am-arrow { transform: rotate(90deg); justify-self: center; }
.am-docs .am-card .am-motion:not(.has-pane) .am-result { grid-template-columns: minmax(0, 1fr); }
.am-docs .am-scenefig .am-pane-frame, .am-docs .am-steplist .am-pane-frame { width: fit-content; max-width: 100%; }

/* 플로우차트 예시: 방향(세로형·가로형)에 따른 도형 놓임 — 작은 정지 그림 */
.am-docs .am-dirs { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); margin: 12px 0 4px; padding: 12px; border: 1px solid var(--am-line); border-radius: 14px; background: var(--am-mist); }
.am-docs .am-dir { margin: 0; min-width: 0; }
.am-docs .am-dir figcaption { margin-top: 6px; color: var(--am-ink); font-size: 13px; font-weight: 800; }
.am-docs .am-dirs-title { grid-column: 1 / -1; margin: 0; color: var(--am-ink); font-size: 14px; font-weight: 800; }
.am-docs .am-dir-flow { display: flex; margin: 0; padding: 0; list-style: none; }
.am-docs .am-dir--h .am-dir-flow { overflow-x: auto; padding: 0 16px 8px 0; scrollbar-width: thin; }
.am-docs .am-caution--list { display: flex; align-items: baseline; gap: 8px; }
.am-docs .am-caution--list > span { flex: none; margin-right: 0; white-space: nowrap; }
.am-docs .am-caution--list ul { margin: 0; padding-left: 18px; }
.am-docs .am-caution--list li { margin: 2px 0; }
.am-docs .am-dir--v .am-dir-flow { flex-direction: column; align-items: flex-start; gap: 14px; }
.am-docs .am-dir--h .am-dir-flow { flex-direction: row; align-items: stretch; gap: 14px; }
.am-docs .am-dir-node {
  position: relative; display: grid; place-items: center; min-width: 0; padding: 4px 8px; border: 2px solid var(--am-blue); border-radius: 6px;
  background: #fff; color: var(--am-ink); font-size: 11px; font-weight: 700; line-height: 1.3; text-align: center;
}
.am-docs .am-dir--v .am-dir-node { width: 128px; }
.am-docs .am-dir--h .am-dir-node { flex: 1 0 76px; }
.am-docs .am-dir-node--시작, .am-docs .am-dir-node--끝 { border-radius: 999px; background: var(--am-blue-wash); }
.am-docs .am-dir-node--판단 { border-color: var(--am-amber); background: var(--am-amber-wash); }
.am-docs .am-dir-node:not(:last-child)::after { position: absolute; color: var(--am-blue); font-size: 12px; font-weight: 800; line-height: 1; }
.am-docs .am-dir--v .am-dir-node:not(:last-child)::after { content: "↓"; left: 50%; bottom: -15px; transform: translateX(-50%); }
.am-docs .am-dir--h .am-dir-node:not(:last-child)::after { content: "→"; right: -13px; top: 50%; transform: translateY(-50%); }
@media (min-width: 640px) {
  .am-docs .am-dirs { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}
