/* 가이드 페이지 공통: index.html과 같은 다크 테마 + 실제 화면을 HTML로 다시 그린 움직이는 모형(.m-) */
:root {
  color-scheme: dark;
  --bg: #101116; --bg-2: #262833; --panel: rgba(255, 255, 255, .035); --panel-strong: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .08); --line-strong: rgba(255, 255, 255, .16);
  --text: #ededef; --muted: #8e8e98; --faint: #5f5f69; --accent: #a5b4fc; --on-text: #0b0b0d;
  --glow-a: rgba(99, 102, 241, .16); --glow-b: rgba(56, 189, 248, .10); --logo-a: #c7d2fe; --logo-b: #7dd3fc;
  --bar: #3987e5; --track: rgba(255, 255, 255, .06); --field: rgba(0, 0, 0, .35); --code-bg: #0f0f12;
  --win: #3987e5; --draw: #5a5955; --loss: #e66767; --radius: 16px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}
@media (max-width: 860px) { :root { --panel: rgba(255, 255, 255, .06); --line: rgba(255, 255, 255, .13); } }
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); min-height: 100vh; background: var(--bg);
       font: 15px/1.7 -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
       -webkit-font-smoothing: antialiased;
       word-break: keep-all; overflow-wrap: break-word; } /* 한국어는 낱말 중간에서 줄을 바꾸지 않는다 */
h1, h2 { text-wrap: balance; } p, li { text-wrap: pretty; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
               background: radial-gradient(1100px 520px at 12% -12%, var(--glow-a), transparent 60%),
                           radial-gradient(900px 480px at 100% -8%, var(--glow-b), transparent 60%), linear-gradient(120deg, var(--bg), var(--bg-2)); }
a { color: var(--accent); }
/* 왼쪽 목차(넓은 화면에서 따라 내려옴) + 본문 */
.g-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 48px; max-width: 1288px; margin: 0 auto; padding: 0 16px; }
main { min-width: 0; padding: 24px 0 40px; }
.g-side-in { position: sticky; top: 24px; }
.g-logo { display: inline-flex; padding: 4px 4px 4px 12px; margin-bottom: 36px; border-radius: 8px; }
.g-logo img { height: 28px; width: auto; }
.g-logo:hover { opacity: .85; } .g-logo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.g-side nav { display: flex; flex-direction: column; gap: 2px; }
.g-side nav a { display: block; padding: 7px 12px; border-radius: 9px; color: var(--muted); font-size: 14px; text-decoration: none;
            transition: color .15s, background .15s; }
.g-side nav a:hover { color: var(--text); background: var(--panel); }
.g-side nav a[aria-current="page"] { color: var(--text); background: var(--panel-strong); box-shadow: inset 0 0 0 1px var(--line); }
.g-side nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* 좁은 화면: 위쪽에 가로로 넘기는 목차 (스크롤해도 위에 붙어 있음) */
@media (max-width: 860px) {
  .g-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .g-side { position: sticky; top: 0; z-index: 40; margin: 0 -16px; padding: 10px 16px; background: rgba(16, 17, 22, .86);
            backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .g-side-in { position: static; display: flex; align-items: center; gap: 10px; }
  .g-logo { flex: none; margin: 0; padding: 2px; } .g-logo img { height: 20px; }
  .g-side nav { flex-direction: row; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none;
               mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); padding: 0 14px; } /* 넘기는 칸 양끝을 흐리게 */
  .g-side nav::-webkit-scrollbar { display: none; }
  .g-side nav a { flex: none; padding: 5px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
  .g-side nav a[aria-current="page"] { border-color: var(--accent); box-shadow: none; }
}
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.crumb a { color: var(--muted); text-decoration: none; } .crumb a:hover { color: var(--text); }
h1 { font-size: clamp(28px, 4.4vw, 44px); font-weight: 600; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 12px; }
.lead { color: var(--muted); font-size: 17px; margin: 0 0 32px; }
h2 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 12px; }
p { margin: 0 0 12px; }
ol, ul { margin: 0 0 12px; padding-left: 20px; } li { margin: 4px 0; }
code, kbd { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--code-bg); border: 1px solid var(--line);
            border-radius: 6px; padding: 1px 6px; }

/* 설명 + 모형: 넓은 화면은 좌우, 좁으면 위아래 */
.g-sec { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center; margin: 72px 0; }
.g-sec.flip > .g-copy { order: 2; }
.g-copy > :last-child { margin-bottom: 0; }
.g-copy p, .g-copy li { color: #c9c9d1; }
@media (max-width: 860px) { .g-sec { grid-template-columns: minmax(0, 1fr); gap: 20px; margin: 48px 0; } .g-sec.flip > .g-copy { order: 0; } }

figure { margin: 0; }
figure img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line-strong); }
figcaption { color: var(--muted); font-size: 13px; margin-top: 8px; }
.shot { max-width: 720px; margin: 0 auto; }
.tip { background: var(--panel-strong); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin: 12px 0; color: #c9c9d1; }
table.g-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 12px; }
.g-table th, .g-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.g-table th { color: var(--muted); font-weight: 600; } .g-table td:first-child { white-space: nowrap; }

/* 허브: 주제 카드 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 0 0 56px; padding: 0; list-style: none; }
.cards a { display: grid; grid-template-columns: 40px 1fr; gap: 4px 14px; align-items: center; height: 100%; padding: 20px; border-radius: 14px;
           background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none;
           transition: border-color .2s, background .2s; }
.cards a:hover, .cards a:focus-visible { border-color: var(--line-strong); background: var(--panel-strong); }
.cards a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cards .glyph { grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--panel-strong);
                border: 1px solid var(--line); color: var(--accent); font: 600 17px ui-monospace, Menlo, monospace; }
.cards b { font-size: 16px; } .cards span:last-child { color: var(--muted); font-size: 13px; line-height: 1.5; }
/* 데이터 & 문의 */
.g-block { padding: 24px; margin: 0 0 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.g-block > :last-child { margin-bottom: 0; } .g-block li { color: #c9c9d1; }
.g-contact { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.g-contact li { margin: 0; }
.g-contact a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line-strong);
               background: var(--panel); color: var(--text); font-size: 14px; text-decoration: none; transition: border-color .15s; }
.g-contact a:hover { border-color: rgba(255, 255, 255, .3); } .g-contact a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 가이드 홈으로 · FCLM 메인으로 */
.g-home { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 64px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.g-home a { padding: 6px 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--muted);
            font-size: 14px; text-decoration: none; transition: color .15s, border-color .15s; }
.g-home a:hover { color: var(--text); border-color: rgba(255, 255, 255, .3); }
.g-home a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.foot { color: var(--faint); font-size: 12px; max-width: 1288px; margin: 0 auto; padding: 0 16px 32px; }
.foot p { margin: 0 0 4px; line-height: 1.5; }
.foot .contact { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.foot .contact a { display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; }
.foot .contact a:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }

/* ---------- 움직이는 모형 ---------- */
.m-window { position: relative; border-radius: 18px; background: #16171d; border: 1px solid var(--line-strong); overflow: hidden;
            box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8), 0 0 60px -20px rgba(99, 102, 241, .35); font-size: 13px; line-height: 1.55;
            user-select: none; isolation: isolate; }
.m-window.hero { margin: 0 0 72px; }
@media (max-width: 860px) { .m-window.hero { margin-bottom: 48px; } }
.m-bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; background: #1d1e25; border-bottom: 1px solid var(--line); }
.m-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a3b44; }
.m-bar span { margin: 0 auto; padding: 2px 14px; border-radius: 7px; background: rgba(255, 255, 255, .05); color: var(--muted); font-size: 11px; }
.m-stage { position: relative; height: 420px; padding: 16px; }
.m-stage.tall { height: 500px; }
.m-stage.short { height: 300px; }
@media (max-width: 560px) { .m-stage, .m-stage.tall { height: 400px; padding: 12px; } .m-stage.short { height: 280px; } .m-window { font-size: 12px; } }

/* 챗봇 칸 */
.m-chat { position: relative; display: flex; flex-direction: column; height: 100%; padding: 14px; border-radius: 14px;
          background: rgba(255, 255, 255, .035); border: 1px solid transparent; }
.m-chat::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none;
                  background: linear-gradient(135deg, var(--logo-a), var(--logo-b)); opacity: .8;
                  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.m-title { font-weight: 600; font-size: 15px; margin-bottom: 8px; } .m-title small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.m-log { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding-bottom: 10px; }
.m-hello { color: var(--muted); font-size: 12px; margin-bottom: auto; }
.m-me { align-self: flex-end; max-width: 80%; padding: 8px 12px; border-radius: 12px; background: #e8e8ec; color: #111; }
.m-me .at { color: #2563eb; font-weight: 600; }
.m-bot > * { margin: 0 0 6px; } .m-bot b { color: #fff; }
.m-note { color: var(--muted); font-size: 12px; }
.m-note::before { content: "✓ "; color: var(--accent); }
.m-dots { display: inline-flex; gap: 4px; padding: 6px 2px; } .m-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: m-dot 1s infinite; }
.m-dots i:nth-child(2) { animation-delay: .15s; } .m-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes m-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.m-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.m-table th, .m-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.m-table th { color: var(--muted); font-weight: 500; } .m-table td:first-child { font-weight: 600; }
.m-pill { display: inline-block; padding: 3px 12px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); font-size: 12px; }

/* 입력창 */
.m-form { position: relative; }
.m-input { position: relative; min-height: 64px; padding: 10px 52px 10px 12px; border-radius: 14px; background: #1c1d23; border: 1px solid var(--line);
           font-size: 14px; color: var(--text); }
.m-input .ph { color: var(--faint); }
.m-chip { display: inline-flex; margin-right: 6px; padding: 0 8px; border-radius: 8px; background: rgba(59, 130, 246, .16); color: #60a5fa; font-weight: 600; }
.m-caret { display: inline-block; width: 1.5px; height: 1.1em; margin-left: 1px; vertical-align: -2px; background: var(--text); animation: m-blink 1s steps(1) infinite; }
@keyframes m-blink { 50% { opacity: 0; } }
.m-send { position: absolute; right: 10px; bottom: 10px; width: 32px; height: 32px; border-radius: 50%; background: #fff; color: #000;
          display: grid; place-items: center; font-weight: 600; }
.m-teambox { position: absolute; left: 0; bottom: calc(100% + 8px); width: min(60%, 300px); padding: 6px 6px 6px 14px; border-radius: 999px;
             background: var(--field); border: 1px solid #3b82f6; box-shadow: 0 0 0 3px rgba(96, 165, 250, .2); display: flex; align-items: center; gap: 8px; }
.m-teambox .ph { color: var(--faint); } .m-teambox .val { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.m-teambox .go { width: 26px; height: 26px; border-radius: 50%; background: #3b82f6; color: #fff; display: grid; place-items: center; font-size: 13px; flex: none; }
.m-teambox .hint { position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 11px; white-space: nowrap; }
.m-menu { position: absolute; left: 0; bottom: calc(100% + 8px); min-width: 150px; margin: 0; padding: 6px; list-style: none; border-radius: 14px;
          background: #19191e; border: 1px solid var(--line-strong); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.m-menu li { position: relative; padding: 5px 10px; border-radius: 9px; font: 600 12px ui-monospace, Menlo, monospace; transition: background .15s; }
.m-menu li.on { background: rgba(255, 255, 255, .08); color: var(--accent); }
.m-menu li span { display: none; position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); padding: 6px 10px; border-radius: 10px;
                  background: #19191e; border: 1px solid var(--line-strong); color: var(--text); font: 12px/1.5 inherit; font-family: inherit; white-space: nowrap; }
.m-menu li.on span { display: block; font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; font-weight: 400; }

/* 왼쪽 통계 */
.m-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; height: 100%; }
@media (max-width: 560px) { .m-split { grid-template-columns: minmax(0, 1fr); } .m-split > .m-chat { display: none; } }
.m-panel { padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line); }
.m-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.m-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(0, 0, 0, .3); margin-bottom: 10px; }
.m-tabs b { padding: 3px 10px; border-radius: 7px; font-weight: 500; font-size: 12px; color: var(--muted); transition: background .2s, color .2s; }
.m-tabs b.on { background: rgba(255, 255, 255, .1); color: var(--text); }
.m-row { position: relative; display: grid; grid-template-columns: 84px 1fr 44px; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 8px;
         border: 1px solid transparent; transition: border-color .2s; }
.m-row.on { border-color: rgba(255, 255, 255, .7); }
.m-row em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-row .t { height: 8px; } .m-row .t i { display: block; height: 100%; border-radius: 3px; background: var(--bar); transform-origin: left;
                                         transition: transform .9s var(--ease-out); }
.m-row small { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.m-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.m-stats div { padding: 7px 8px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.m-stats small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; } .m-stats b { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-panel { container-type: inline-size; }
@container (max-width: 470px) { .m-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } } /* 칸이 좁으면 요약 칸 2×2 */
.m-h { font-size: 16px; font-weight: 600; margin-bottom: 8px; } .m-h small { color: var(--muted); font-weight: 400; font-size: 11px; margin-left: 6px; }

/* 분포 칸 크게 (화면 둘러보기의 분포 막대) */
.m-big { height: 100%; padding: 20px; font-size: 15px; display: flex; flex-direction: column; justify-content: center; }
.m-big .m-tabs { align-self: flex-start; margin-bottom: 18px; } .m-big .m-tabs b { font-size: 13px; padding: 5px 14px; }
.m-big .m-row { grid-template-columns: 120px 1fr 56px; padding: 9px 10px; } .m-big .m-row .t { height: 12px; }
@media (max-width: 560px) { .m-big { padding: 14px; font-size: 13px; } .m-big .m-row { grid-template-columns: 96px 1fr 44px; padding: 7px 8px; } }
/* 상세를 내려 보기 */
.m-scrollbox { position: relative; height: 100%; overflow: hidden; }
.m-scroll { transition: transform 1.2s var(--ease-out); }
.m-sub { margin: 14px 0 8px; font-weight: 600; font-size: 13px; }
.m-scrollbox .m-pitch { height: 200px; margin: 0; }
.m-legend { display: flex; gap: 12px; margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.m-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.m-mu { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px 12px; align-items: center; font-size: 12px; }
.m-mu .stack { display: flex; gap: 2px; height: 10px; } .m-mu .stack i { border-radius: 3px; min-width: 2px; }
.m-mu small { color: var(--muted); font-variant-numeric: tabular-nums; }
.m-tipbox { position: absolute; z-index: 25; padding: 8px 10px; border-radius: 9px; background: #16161a; border: 1px solid var(--line-strong);
            box-shadow: 0 8px 24px rgba(0, 0, 0, .5); white-space: pre; font-size: 12px; line-height: 1.5; }
.m-tipbox[hidden] { display: none; }

/* 스쿼드메이커로 내보내기: 새 탭 */
.m-tab2 { position: absolute; inset: 40px 16px 16px 30%; border-radius: 14px; background: #14151b; border: 1px solid var(--line-strong);
          box-shadow: -20px 0 60px rgba(0, 0, 0, .6); padding: 14px; overflow: hidden; }
@media (max-width: 560px) { .m-tab2 { inset: 30px 10px 10px 10px; } }
.m-pitch { position: relative; height: 230px; border-radius: 10px; background: #11151c; border: 1px solid rgba(255, 255, 255, .14); margin: 8px 0 10px; }
.m-pitch::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid rgba(255, 255, 255, .14); }
.m-pl { position: absolute; transform: translate(-50%, -50%); text-align: center; font-size: 10px; white-space: nowrap; }
.m-pl i { display: block; width: 18px; height: 18px; margin: 0 auto 2px; border-radius: 50%; background: var(--accent); }
.m-steps { display: flex; gap: 6px; } .m-steps span { flex: 1; padding: 6px 8px; border-radius: 9px; border: 1px solid var(--line); color: var(--muted); font-size: 11px;
                                                      transition: border-color .3s, color .3s; }
.m-steps span.on { border-color: var(--accent); color: var(--text); }

/* 커서와 등장 */
.m-cursor { position: absolute; left: 0; top: 0; z-index: 20; width: 18px; height: 18px; pointer-events: none; opacity: 0;
            transition: transform .7s var(--ease-out), opacity .3s; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .7)); }
.m-cursor::after { content: ""; position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; opacity: 0; }
.m-cursor.click::after { animation: m-ripple .45s ease-out; }
@keyframes m-ripple { from { opacity: .9; transform: scale(.4); } to { opacity: 0; transform: scale(1.8); } }
.m-in { animation: m-in .35s var(--ease-out) both; }
.m-pop { animation: m-pop .22s var(--ease-out) both; transform-origin: bottom left; }
.m-drop { animation: m-drop .5s var(--ease-out) both; }
@keyframes m-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes m-pop { from { opacity: 0; transform: scale(.96) translateY(4px); } }
@keyframes m-drop { from { opacity: 0; transform: translate(-50%, -90%); } to { opacity: 1; transform: translate(-50%, -50%); } }
.m-tab2.m-in { animation-name: m-slide; } @keyframes m-slide { from { opacity: 0; transform: translateX(40px); } }
.m-replay { position: absolute; right: 10px; bottom: 10px; z-index: 30; display: none; }

@media (prefers-reduced-motion: reduce) {
  .m-in, .m-pop, .m-drop, .m-tab2.m-in { animation: none; }
  .m-dots i, .m-caret { animation: none; } .m-scroll { transition: none; }
  .m-row .t i, .m-cursor { transition: none; }
}
@media (max-width: 560px) { .m-panel { padding: 10px; } .m-row { padding: 3px 6px; } .m-col { gap: 10px; } }
