/* CATS 제품 매뉴얼 공용 화면(/pro/manual, /sheetmetal/manual, /seouldream/manual). 동작은 /cats-brand/manual-app.js.
   넓은 화면: 머리글 아래 목차 | 명령 목록 | 읽기 창이 화면 높이를 채우고 칸마다 따로 굴러간다.
   1199px 이하: 목차는 서랍. 859px 이하: 목록과 읽기 창을 번갈아 보이고 문서가 굴러간다.
   제품 차이는 강조색(--ma-accent)뿐이다. */

:root {
  --ma-ink: #0f172a;
  --ma-text: #1f2937;
  --ma-muted: #5b6472;
  --ma-faint: #8a94a3;
  --ma-line: #e3e8ef;
  --ma-line-strong: #d3dae4;
  --ma-soft: #f6f8fb;
  --ma-side: #f8fafc;
  --ma-hover: #f1f4f8;
  --ma-accent: #1d4ed8;
  --ma-accent-strong: #1e40af;
  --ma-tint: #eef4ff;
  --ma-ring: rgba(29, 78, 216, 0.18);
  --ma-header-h: 56px;
  --ma-mono: "Cascadia Mono", Consolas, "SFMono-Regular", ui-monospace, monospace;
  color-scheme: light;
}

.cats-manual-pro {
  --ma-accent: #1d4ed8;
  --ma-accent-strong: #1e40af;
  --ma-tint: #eef4ff;
  --ma-ring: rgba(29, 78, 216, 0.18);
}

.cats-manual-sheetmetal {
  --ma-accent: #0f5f7a;
  --ma-accent-strong: #0b4a5f;
  --ma-tint: #eaf6fa;
  --ma-ring: rgba(15, 95, 122, 0.2);
}

.cats-manual-seouldream {
  --ma-accent: #0f766e;
  --ma-accent-strong: #0b5e57;
  --ma-tint: #e9f8f5;
  --ma-ring: rgba(15, 118, 110, 0.2);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.ma-body {
  margin: 0;
  background: #fff;
  color: var(--ma-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

.ma-body a {
  color: inherit;
  text-decoration: none;
}

.ma-body :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid #1a56db;
  outline-offset: 2px;
}

.ma-body img {
  max-width: 100%;
}

.ma-body code {
  font-family: var(--ma-mono);
}

.ma-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ma-skip {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--ma-ink);
  color: #fff !important;
  font-weight: 800;
}

.ma-skip:focus {
  top: 8px;
}

/* ---------- 머리글 ---------- */
.ma-header {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--ma-header-h);
  padding: 0 16px 0 18px;
  border-bottom: 1px solid var(--ma-line);
  background: #fff;
}

.ma-brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  color: var(--ma-ink);
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
}

.ma-brand img {
  display: block;
  width: 30px;
  height: 30px;
}

.ma-header-title {
  flex: none;
  padding-left: 14px;
  border-left: 1px solid var(--ma-line-strong);
  color: var(--ma-ink);
  font-size: 15px;
  font-weight: 800;
}

.ma-products {
  display: flex;
  flex: none;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--ma-hover);
}

.ma-products a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  color: var(--ma-muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.ma-products a::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ma-dot, var(--ma-faint));
}

.ma-products .is-pro { --ma-dot: #1d4ed8; }
.ma-products .is-sheetmetal { --ma-dot: #0f5f7a; }
.ma-products .is-seouldream { --ma-dot: #0f766e; }

.ma-products a:hover {
  color: var(--ma-ink);
}

.ma-products a[aria-current="page"] {
  background: #fff;
  color: var(--ma-ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.ma-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  min-width: 0;
}

.ma-header-link {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--ma-muted);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}

.ma-header-link:hover {
  background: var(--ma-hover);
  color: var(--ma-ink);
}

.ma-cta {
  display: inline-flex;
  align-items: center;
  height: 34px;
  margin-left: 6px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--ma-accent);
  color: #fff !important;
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
}

.ma-cta:hover {
  background: var(--ma-accent-strong);
}

.ma-body .lang-switch {
  display: inline-flex;
  gap: 2px;
  margin: 0 4px;
  padding: 3px;
  border-radius: 8px;
  background: var(--ma-hover);
}

.ma-body .lang-btn {
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ma-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.ma-body .lang-btn.active {
  background: #fff;
  color: var(--ma-accent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* ---------- 세 칸 ---------- */
.ma-app {
  display: grid;
  grid-template-columns: 248px clamp(300px, 25vw, 380px) minmax(0, 1fr);
  min-height: 0;
}

.ma-sidebar,
.ma-list,
.ma-reader {
  min-width: 0;
  min-height: 0;
}

.ma-sidebar,
#maList,
.ma-reader {
  scrollbar-width: thin;
  scrollbar-color: #cdd5df transparent;
}

/* 목차 */
.ma-sidebar {
  display: flex;
  flex-direction: column;
  padding: 14px 10px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--ma-line);
  background: var(--ma-side);
}

.ma-side-section + .ma-side-section {
  margin-top: 18px;
}

.ma-side-title {
  display: flex;
  justify-content: space-between;
  margin: 0 0 4px;
  padding: 0 10px;
  color: var(--ma-faint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.ma-side-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ma-text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.ma-side-item:hover {
  background: var(--ma-hover);
}

.ma-side-item.is-active {
  background: var(--ma-tint);
  color: var(--ma-accent);
  font-weight: 800;
}

.ma-side-item,
.ma-item {
  position: relative;
}

.ma-side-item.is-active::before,
.ma-item.is-active::before {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--ma-accent);
}

.ma-side-item.is-empty {
  color: var(--ma-faint);
}

.ma-side-count {
  flex: none;
  color: var(--ma-faint);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ma-side-item.is-active .ma-side-count {
  color: var(--ma-accent);
}

.ma-side-item.is-external::after {
  content: "↗";
  color: var(--ma-faint);
  font-size: 12px;
}

.ma-side-foot {
  display: grid;
  gap: 2px;
  margin-top: auto;
  padding: 16px 10px 0;
  color: var(--ma-muted);
  font-size: 12.5px;
}

.ma-side-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 6px;
}

.ma-side-foot a {
  font-weight: 700;
}

.ma-side-foot a:hover {
  color: var(--ma-accent);
}

/* 명령 목록 */
.ma-list {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--ma-line);
  background: #fff;
}

.ma-list-head {
  display: flex;
  gap: 8px;
  padding: 12px 12px 10px;
}

.ma-menu-btn {
  display: none;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--ma-line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ma-ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.ma-menu-btn::before {
  content: "";
  width: 16px;
  height: 12px;
  background: linear-gradient(currentColor 0 0) top / 100% 2px no-repeat,
    linear-gradient(currentColor 0 0) center / 100% 2px no-repeat,
    linear-gradient(currentColor 0 0) bottom / 100% 2px no-repeat;
}

.ma-search {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
}

.ma-search svg {
  position: absolute;
  left: 11px;
  width: 16px;
  height: 16px;
  color: var(--ma-faint);
  pointer-events: none;
}

.ma-search input {
  width: 100%;
  height: 40px;
  padding: 0 36px 0 34px;
  border: 1px solid var(--ma-line-strong);
  border-radius: 8px;
  background: var(--ma-soft);
  color: var(--ma-ink);
  font: inherit;
  font-size: 14px;
}

.ma-search input::placeholder {
  color: var(--ma-faint);
}

.ma-search input:focus {
  outline: none;
  border-color: var(--ma-accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--ma-ring);
}

.ma-search kbd {
  position: absolute;
  right: 9px;
  min-width: 20px;
  padding: 1px 6px;
  border: 1px solid var(--ma-line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  color: var(--ma-faint);
  font: 700 11px/1.4 var(--ma-mono);
  text-align: center;
  pointer-events: none;
}

.ma-search input:focus ~ kbd,
.ma-search input:not(:placeholder-shown) ~ kbd {
  display: none;
}

.ma-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 0 14px 8px;
  border-bottom: 1px solid var(--ma-line);
  color: var(--ma-muted);
  font-size: 12.5px;
  font-weight: 600;
}

.ma-link-button {
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--ma-accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

#maList {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 16px;
}

.ma-list-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 10px 16px 5px;
  background: #fff;
  color: var(--ma-faint);
  font-size: 12px;
  font-weight: 800;
}

.ma-items {
  margin: 0;
  padding: 0 6px;
  list-style: none;
}

.ma-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 8px;
}

.ma-item:hover {
  background: var(--ma-hover);
}

.ma-item.is-active {
  background: var(--ma-tint);
}

.ma-body .ma-item:focus-visible {
  outline: 2px solid var(--ma-accent);
  outline-offset: -2px;
}

.ma-item-icon,
.ma-cmd-icon,
.ma-related-icon,
.ma-chip-icon {
  display: grid;
  flex: none;
  place-items: center;
  overflow: hidden;
}

.ma-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--ma-hover);
}

.ma-item-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.ma-item-icon.is-text,
.ma-cmd-icon.is-text,
.ma-related-icon.is-text,
.ma-chip-icon.is-text {
  background: #475569;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.ma-item-body {
  min-width: 0;
}

.ma-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ma-item-name {
  overflow: hidden;
  color: var(--ma-ink);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ma-item.is-active .ma-item-name {
  color: var(--ma-accent);
}

.ma-item-summary {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--ma-muted);
  font-size: 12.5px;
  line-height: 1.45;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ma-item-chip {
  flex: none;
  margin-left: auto;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--ma-hover);
  color: var(--ma-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
}

.ma-item .command-ui-badge {
  flex: none;
  min-height: 18px;
  padding: 0 6px;
  font-size: 10.5px;
}

.ma-empty {
  display: grid;
  justify-items: start;
  gap: 4px;
  margin: 16px 12px;
  padding: 18px;
  border: 1px dashed var(--ma-line-strong);
  border-radius: 8px;
  background: var(--ma-soft);
}

.ma-empty strong {
  color: var(--ma-ink);
}

.ma-empty p {
  margin: 0 0 8px;
  color: var(--ma-muted);
  font-size: 13.5px;
}

/* 읽기 창 */
.ma-reader {
  position: relative;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  container-type: inline-size;
  container-name: reader;
}

.ma-reader-bar {
  display: none;
}

.ma-status {
  margin: 18px clamp(20px, 3.4vw, 48px) 0;
  padding: 10px 14px;
  border: 1px solid #fde3b0;
  border-radius: 8px;
  background: #fff8eb;
  color: #7a4a06;
  font-size: 14px;
  font-weight: 600;
}

.ma-command,
.ma-doc {
  margin: 0 auto;
  padding: 24px clamp(20px, 3.4vw, 48px) 64px;
}

.ma-command {
  max-width: 1240px;
}

.ma-doc {
  max-width: 940px;
}

.ma-command[hidden],
.ma-doc[hidden] {
  display: none;
}

.ma-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--ma-muted);
  font-size: 12.5px;
  font-weight: 600;
}

.ma-crumb {
  padding: 2px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--ma-tint);
  color: var(--ma-accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.ma-crumb:hover {
  background: var(--ma-accent);
  color: #fff;
}

.ma-cmd-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.ma-cmd-icon {
  width: 60px;
  height: 60px;
  border: 1px solid var(--ma-line);
  border-radius: 12px;
  background: var(--ma-soft);
}

.ma-cmd-icon img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.ma-cmd-icon.is-text {
  font-size: 17px;
}

.ma-cmd-heading {
  min-width: 0;
}

.ma-cmd-title {
  margin: 2px 0 0;
  color: var(--ma-ink);
  font-size: clamp(24px, 2.3vw, 30px);
  font-weight: 850;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.ma-cmd-title:focus {
  outline: none;
}

.ma-runs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.ma-runs-label {
  margin-right: 2px;
  color: var(--ma-muted);
  font-size: 12.5px;
  font-weight: 700;
}

.ma-run {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--ma-line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ma-muted);
  font: inherit;
  cursor: pointer;
}

.ma-run code {
  color: var(--ma-ink);
  font-size: 13px;
  font-weight: 700;
}

.ma-run:hover {
  border-color: var(--ma-accent);
  color: var(--ma-accent);
}

.ma-run-copy {
  width: 14px;
  height: 14px;
  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='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='12' height='12' rx='2'/%3E%3Cpath d='M5 15V5a2 2 0 0 1 2-2h10'/%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='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='12' height='12' rx='2'/%3E%3Cpath d='M5 15V5a2 2 0 0 1 2-2h10'/%3E%3C/svg%3E") center / contain no-repeat;
}

[data-ma-flash] {
  position: relative;
}

[data-ma-flash]::after {
  content: attr(data-ma-flash);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  z-index: 3;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--ma-ink);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

.ma-lead {
  max-width: 76ch;
  margin: 16px 0 0;
  color: var(--ma-text);
  font-size: 17px;
  line-height: 1.7;
}

.ma-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ma-line);
}

.ma-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--ma-line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ma-ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.ma-button:hover {
  border-color: var(--ma-accent);
  color: var(--ma-accent);
}

.ma-button.is-primary {
  border-color: var(--ma-accent);
  background: var(--ma-accent);
  color: #fff;
}

.ma-button.is-primary:hover {
  background: var(--ma-accent-strong);
  color: #fff;
}

.ma-cmd-body {
  display: grid;
  gap: 0 40px;
}

@container reader (min-width: 960px) {
  .ma-cmd-body.has-aside {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  }
}

@container reader (min-width: 1240px) {
  .ma-cmd-body.has-aside {
    grid-template-columns: minmax(0, 1fr) 460px;
  }
}

.ma-cmd-main,
.ma-cmd-aside {
  min-width: 0;
}

.ma-section {
  margin-top: 26px;
}

.ma-section h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--ma-ink);
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.4;
}

.ma-section p {
  max-width: 76ch;
  margin: 0 0 8px;
  line-height: 1.78;
}

.ma-steps {
  display: grid;
  gap: 8px;
  max-width: 76ch;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: ma-step;
}

.ma-steps li {
  position: relative;
  padding: 1px 0 1px 36px;
  line-height: 1.7;
  counter-increment: ma-step;
}

.ma-steps li::before {
  content: counter(ma-step);
  position: absolute;
  top: 1px;
  left: 0;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--ma-tint);
  color: var(--ma-accent);
  font-size: 12px;
  font-weight: 800;
}

.ma-bullets {
  max-width: 76ch;
  margin: 0;
  padding-left: 20px;
}

/* "제목|설명" 항목의 제목 줄(제품 도움말 창과 같은 모양) */
.ma-term {
  display: block;
  color: var(--ma-ink);
  font-weight: 700;
}

.ma-points {
  display: grid;
  gap: 10px;
  max-width: 76ch;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ma-points li {
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--ma-tint);
  line-height: 1.7;
}

.ma-bullets li + li {
  margin-top: 4px;
}

.ma-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ma-line);
  border-radius: 8px;
}

.ma-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.6;
}

.ma-table th,
.ma-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--ma-line);
  text-align: left;
  vertical-align: top;
}

.ma-table tbody tr:last-child > * {
  border-bottom: 0;
}

.ma-table thead th {
  background: var(--ma-soft);
  color: var(--ma-muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.ma-table tbody th {
  color: var(--ma-ink);
  font-weight: 750;
  white-space: nowrap;
}

.ma-table td:nth-child(2) {
  color: var(--ma-muted);
  white-space: nowrap;
}

.ma-table code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--ma-hover);
  font-size: 12.5px;
  white-space: nowrap;
}

@container reader (max-width: 620px) {
  .ma-table thead {
    display: none;
  }

  .ma-table,
  .ma-table tbody,
  .ma-table tr,
  .ma-table th,
  .ma-table td {
    display: block;
  }

  .ma-table tr {
    padding: 10px 12px;
    border-bottom: 1px solid var(--ma-line);
  }

  .ma-table tbody tr:last-child {
    border-bottom: 0;
  }

  .ma-table th,
  .ma-table td {
    padding: 0;
    border: 0;
    white-space: normal;
  }

  .ma-table td:nth-child(2),
  .ma-table td:nth-child(3) {
    display: inline;
    margin-right: 8px;
    font-size: 12.5px;
  }

  .ma-table td:last-child {
    margin-top: 4px;
  }
}

.ma-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ma-pills li {
  padding: 4px 11px;
  border: 1px solid var(--ma-line);
  border-radius: 999px;
  background: var(--ma-soft);
  font-size: 13px;
  font-weight: 600;
}

.ma-callout {
  max-width: 76ch;
  padding: 12px 14px;
  border: 1px solid var(--ma-line);
  border-radius: 8px;
  background: var(--ma-soft);
}

.ma-callout p:last-child {
  margin-bottom: 0;
}

.ma-callout.is-warn {
  border-color: #fde3b0;
  background: #fff8eb;
  color: #6b4106;
}

/* 명령 창 그림·같은 그룹 명령(넓으면 오른쪽 칸) */
.ma-body .command-ui {
  max-width: 920px;
  margin: 26px 0 0;
}

.ma-body .command-ui-note {
  margin: -4px 0 12px;
  color: var(--ma-muted);
  font-size: 13px;
}

@container reader (min-width: 960px) {
  .ma-cmd-body.has-aside .command-ui-grid.has-help {
    grid-template-columns: minmax(0, 1fr);
  }

  .ma-cmd-body.has-aside .command-ui-help {
    max-width: 320px;
  }
}

@container reader (max-width: 620px) {
  .ma-body .command-ui-grid.has-help {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ma-related {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ma-related-link {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
}

.ma-related-link:hover {
  background: var(--ma-hover);
}

.ma-related-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--ma-hover);
}

.ma-related-icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.ma-related-icon.is-text {
  font-size: 9px;
}

.ma-related-link span:last-child {
  min-width: 0;
}

.ma-related-link strong,
.ma-related-link small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ma-related-link strong {
  color: var(--ma-ink);
  font-size: 13.5px;
  font-weight: 750;
}

.ma-related-link small {
  color: var(--ma-muted);
  font-size: 12px;
}

@container reader (max-width: 959px) {
  .ma-related {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

/* 판금 PDF 매뉴얼 예시 */
.ma-example {
  max-width: 920px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--ma-line);
  border-radius: 8px;
}

.ma-example header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ma-example h3 {
  margin: 0 0 8px;
  color: var(--ma-ink);
  font-size: 15px;
}

.ma-example h4 {
  margin: 12px 0 6px;
  color: var(--ma-muted);
  font-size: 13px;
}

.ma-tag {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--ma-tint);
  color: var(--ma-accent);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.ma-example-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.ma-example-images figure {
  margin: 0;
}

.ma-example-images figcaption {
  margin-top: 6px;
  color: var(--ma-muted);
  font-size: 12px;
  font-weight: 700;
}

.ma-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--ma-line);
}

.ma-pager-link {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--ma-line);
  border-radius: 8px;
}

.ma-pager-link.is-next {
  text-align: right;
}

.ma-pager-link small {
  color: var(--ma-muted);
  font-size: 12px;
  font-weight: 700;
}

.ma-pager-link strong {
  overflow: hidden;
  color: var(--ma-ink);
  font-size: 14.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ma-pager-link:hover {
  border-color: var(--ma-accent);
}

.ma-pager-link:hover strong {
  color: var(--ma-accent);
}

/* ---------- 가이드 문서 ---------- */
.ma-eyebrow {
  margin: 0;
  color: var(--ma-accent);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.ma-doc h1 {
  margin: 4px 0 0;
  color: var(--ma-ink);
  font-size: clamp(26px, 2.6vw, 32px);
  font-weight: 850;
  line-height: 1.2;
}

.ma-doc h1:focus {
  outline: none;
}

.ma-doc h2 {
  margin: 34px 0 12px;
  color: var(--ma-ink);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
}

.ma-doc h3 {
  margin: 0 0 6px;
  color: var(--ma-ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
}

.ma-doc p {
  max-width: 76ch;
  margin: 0 0 10px;
  line-height: 1.78;
}

.ma-doc .ma-lead {
  margin-top: 10px;
}

.ma-doc-tip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  color: var(--ma-muted);
  font-size: 14px;
}

.ma-kbd-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.ma-doc-tip kbd {
  padding: 1px 6px;
  border: 1px solid var(--ma-line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  font: 700 12px/1.4 var(--ma-mono);
}

.ma-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.ma-stats li {
  display: grid;
}

.ma-stats strong {
  color: var(--ma-ink);
  font-size: 26px;
  font-weight: 850;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.ma-stats span {
  color: var(--ma-muted);
  font-size: 13px;
  font-weight: 600;
}

.ma-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.ma-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--ma-line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ma-ink);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.ma-chip-command {
  padding-left: 7px;
}

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

.ma-chip-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
}

.ma-chip-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.ma-chip-icon.is-text {
  font-size: 8px;
}

.ma-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ma-card {
  display: grid;
  align-content: start;
  gap: 4px;
  height: 100%;
  padding: 16px;
  border: 1px solid var(--ma-line);
  border-radius: 8px;
  background: #fff;
}

button.ma-card {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.ma-card .ma-card-meta {
  order: -1;
  margin: 0;
  font-size: 12px;
}

a.ma-card:hover,
button.ma-card:hover {
  border-color: var(--ma-accent);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.ma-card strong {
  color: var(--ma-ink);
  font-size: 15px;
  font-weight: 800;
}

a.ma-card:hover strong,
button.ma-card:hover strong {
  color: var(--ma-accent);
}

.ma-card span {
  color: var(--ma-muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.ma-card .ma-card-meta {
  margin-top: 6px;
  color: var(--ma-accent);
  font-weight: 800;
}

.ma-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.ma-block {
  padding: 18px 20px;
  border: 1px solid var(--ma-line);
  border-radius: 8px;
  background: #fff;
}

.ma-block > p {
  color: var(--ma-muted);
  font-size: 14px;
}

.ma-block .ma-steps {
  margin-top: 12px;
  font-size: 14.5px;
}

.ma-block .ma-bullets {
  margin-top: 10px;
  color: var(--ma-text);
  font-size: 14.5px;
  line-height: 1.7;
}

.ma-note {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--ma-soft);
  color: var(--ma-muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.ma-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--ma-line);
  border-radius: 8px;
  background: var(--ma-soft);
  list-style: none;
}

.ma-checklist strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ma-ink);
  font-size: 13.5px;
}

.ma-checklist span {
  color: var(--ma-muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.ma-status-chip {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
}

.ma-status-chip.is-danger { background: #fee2e2; color: #b91c1c; }
.ma-status-chip.is-warn { background: #fef3c7; color: #92400e; }
.ma-status-chip.is-ok { background: #dcfce7; color: #047857; }

.ma-faq {
  max-width: 820px;
  border-top: 1px solid var(--ma-line);
}

.ma-faq details {
  border-bottom: 1px solid var(--ma-line);
}

.ma-faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 2px;
  color: var(--ma-ink);
  font-weight: 750;
  list-style: none;
  cursor: pointer;
}

.ma-faq summary::-webkit-details-marker {
  display: none;
}

.ma-faq summary::after {
  content: "+";
  flex: none;
  color: var(--ma-accent);
  font-size: 20px;
  line-height: 1;
}

.ma-faq details[open] summary::after {
  content: "−";
}

.ma-faq details p {
  margin: -4px 2px 16px;
  color: var(--ma-text);
}

.ma-workflow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: ma-flow;
}

.ma-workflow li {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--ma-line);
  border-radius: 8px;
  background: #fff;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.5;
  counter-increment: ma-flow;
}

.ma-workflow li::before {
  content: counter(ma-flow, decimal-leading-zero);
  color: var(--ma-accent);
  font-size: 12px;
  font-weight: 900;
}

.ma-workflow .ma-chips {
  margin-top: 2px;
}

.ma-workflow .ma-chip {
  height: 26px;
  padding: 0 9px;
  font-family: var(--ma-mono);
  font-size: 12px;
}

.ma-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.ma-scrim {
  display: none;
}

/* ---------- 넓은 화면: 화면 높이를 칸들이 나눠 쓴다 ----------
   min-width: 860px로 따로 걸면 859.4px처럼 소수점 폭인 기기(폴드·태블릿)에서 두 조건이
   모두 빠져, 두 칸 배치인데 문서 전체가 함께 굴러간다. 기본으로 두고 859px 이하에서만 푼다. */
body.ma-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.ma-app {
  flex: 1;
}

/* ---------- 1199px 이하: 목차는 서랍 ---------- */
@media (max-width: 1199px) {
  .ma-app {
    grid-template-columns: clamp(300px, 36vw, 380px) minmax(0, 1fr);
  }

  .ma-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    width: min(300px, 86vw);
    visibility: hidden;
    border-right: 0;
    box-shadow: 0 18px 54px rgba(15, 23, 42, 0.24);
    transform: translateX(-102%);
    transition: transform 0.2s ease, visibility 0s linear 0.2s;
  }

  .ma-app[data-drawer="open"] .ma-sidebar {
    visibility: visible;
    transform: none;
    transition: transform 0.2s ease;
  }

  .ma-scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    background: rgba(15, 23, 42, 0.36);
    opacity: 0;
    pointer-events: none;
    touch-action: none;
    transition: opacity 0.2s ease;
  }

  .ma-app[data-drawer="open"] .ma-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  /* 서랍은 혼자 굴러가고, 뒤의 문서는 서랍이나 가림막을 끌어도 움직이지 않는다. */
  html.ma-drawer-open,
  html.ma-drawer-open body {
    overflow: hidden;
  }

  .ma-menu-btn {
    display: inline-flex;
  }

  .ma-header-link.is-optional {
    display: none;
  }
}

/* ---------- 859px 이하: 목록과 읽기 창을 번갈아 ---------- */
@media (max-width: 859px) {
  .ma-header {
    flex-wrap: wrap;
    gap: 8px 10px;
    height: auto;
    padding: 10px 14px;
  }

  .ma-brand {
    font-size: 17px;
  }

  .ma-brand img {
    width: 28px;
    height: 28px;
  }

  .ma-header-title {
    padding-left: 10px;
    font-size: 14px;
  }

  .ma-products {
    order: 3;
    flex: 1 1 100%;
  }

  .ma-products a {
    flex: 1;
    justify-content: center;
    padding: 0 6px;
  }

  .ma-header-link {
    display: none;
  }

  .ma-cta {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
  }

  /* 한 칸씩 보여 주므로 문서가 굴러가고, 머리글도 함께 올라간다. */
  body.ma-body {
    display: block;
    height: auto;
    overflow: visible;
  }

  .ma-app {
    display: block;
  }

  .ma-app[data-pane="list"] .ma-reader,
  .ma-app[data-pane="reader"] .ma-list {
    display: none;
  }

  .ma-list {
    border-right: 0;
  }

  .ma-list-head {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
  }

  .ma-list-meta {
    padding-top: 2px;
  }

  .ma-kbd-hint,
  .ma-search kbd {
    display: none;
  }

  #maList {
    overflow: visible;
  }

  .ma-list-heading {
    top: 62px;
  }

  .ma-item {
    padding: 9px 8px;
  }

  .ma-item-summary {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .ma-reader {
    overflow: visible;
  }

  .ma-reader-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 52px;
    padding: 0 10px;
    border-bottom: 1px solid var(--ma-line);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
  }

  .ma-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--ma-accent);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
  }

  .ma-back::before {
    content: "←";
  }

  .ma-reader-bar .ma-menu-btn {
    height: 36px;
  }

  .ma-command,
  .ma-doc {
    padding: 18px 16px 48px;
  }

  .ma-cmd-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
  }

  .ma-cmd-icon img {
    width: 36px;
    height: 36px;
  }

  .ma-lead {
    font-size: 16px;
  }

  .ma-pager {
    grid-template-columns: 1fr;
  }

  .ma-pager-link.is-next {
    text-align: left;
  }
}

@media (max-width: 420px) {
  .ma-header-title {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ma-sidebar,
  .ma-scrim {
    transition: none !important;
  }
}

@media print {
  .ma-header,
  .ma-sidebar,
  .ma-list,
  .ma-reader-bar,
  .ma-actions,
  .ma-pager,
  .ma-scrim {
    display: none !important;
  }

  body.ma-body {
    display: block;
    height: auto;
    overflow: visible;
  }

  .ma-app {
    display: block;
  }

  .ma-reader {
    overflow: visible;
  }
}
