/* 공유 범위 첫 안내(#5598) — 웹·앱 첫 진입 카드 · 설치 승인 직후 · «무엇이 공유되나» 다시 보기.
   ⚠ 생성물 — 원본은 시안 HTML(프로젝트 #5598 share-guide.html)이다. 이름은 전부 sg- 로 감쌌다(제품의 .card · .pill · .pop 등과 안 겹치게).
   제품 토큰(--surface · --ink · --ink-sub · --muted · --line · --accent)을 그대로 쓰고, 이 카드에만 있는 색만 .sg-root 에 둔다. */
.sg-root {
  --surface-2: var(--bg-tint, #F6F8FD);
  --mine: var(--accent, #4558FF); --mine-ink: #3343E0; --mine-soft: #ECEFFF; --mine-glow: rgba(69, 88, 255, .22);
  --team: #10A37F; --team-ink: #0B7F63; --team-soft: #E4F7F1;
  --off: #A3ADC0; --off-soft: #EFF2F7; --hl: #C9F2E3; --bad: #E0517A;
  --sg-shadow: 0 40px 80px -30px rgba(20, 33, 58, .45), 0 2px 10px rgba(20, 33, 58, .08);
  --win-shadow: 0 18px 40px -18px rgba(20, 33, 58, .35), 0 1px 3px rgba(20, 33, 58, .08);
  --sky-a: #F3F5FF; --sky-b: #EAF6F2;
  --term-bg: #0F1524; --term-ink: #D8DFEE; --term-dim: #7F8BA6; --term-on: #A9B6FF; --term-ok: #63D7B2;
  --p-min: #E0517A; --p-jun: #1E8FD0; --p-so: #8656E6; --p-ha: #E39B2D;
  --sg-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sg-font: "Pretendard", -apple-system, "Apple SD Gothic Neo", sans-serif;
  color: var(--ink); line-height: 1.6; font-size: 15px;
}
:root[data-theme="dark"] .sg-root {
  --mine: #8394FF; --mine-ink: #AEB9FF; --mine-soft: #1D2650; --mine-glow: rgba(131, 148, 255, .28);
  --team: #39C79F; --team-ink: #6FDDBC; --team-soft: #10372E; --off: #5B6780; --off-soft: #1A2236; --hl: #154A3C;
  --sg-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8); --win-shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
  --sky-a: #161F3A; --sky-b: #11282A; --term-bg: #070B14;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sg-root {
    --mine: #8394FF; --mine-ink: #AEB9FF; --mine-soft: #1D2650; --mine-glow: rgba(131, 148, 255, .28);
    --team: #39C79F; --team-ink: #6FDDBC; --team-soft: #10372E; --off: #5B6780; --off-soft: #1A2236; --hl: #154A3C;
    --sg-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8); --win-shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
    --sky-a: #161F3A; --sky-b: #11282A; --term-bg: #070B14;
  }
}
.sg-root *, .sg-root *::before, .sg-root *::after { box-sizing: border-box; }
:where(.sg-root) button { font: inherit; color: inherit; }
.sg-root [hidden] { display: none !important; }
.sg-root :focus-visible { outline: 2px solid var(--mine); outline-offset: 3px; border-radius: 8px; }
.sg-root .sg-ic { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* 모달 층(첫 진입 · 다시 보기) — 제품 모달(.ov-back 1450) 높이에 맞춘다 */
.sg-back { position: fixed; inset: 0; z-index: 1450; background: rgba(20, 33, 58, .46); overflow: auto; display: flex; flex-direction: column; align-items: center;
  padding-block: calc(16px + env(safe-area-inset-top, 0px)) calc(24px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.sg-back > .sg-root { width: min(600px, 100%); margin-block: auto; }
.sg-inline { width: min(600px, 100%); margin: 8px auto 0; }

/* 카드 */
.sg-card { width: 100%; background: var(--surface); border-radius: 26px; box-shadow: var(--sg-shadow); overflow: visible; position: relative; }
.sg-stage { position: relative; width: 100%; aspect-ratio: 52 / 31; container-type: inline-size; overflow: hidden; border-radius: 26px 26px 0 0;
  background: radial-gradient(60% 80% at 15% 20%, var(--sky-a), transparent 70%), radial-gradient(55% 75% at 90% 85%, var(--sky-b), transparent 70%), var(--surface-2); }
.sg-scene { position: absolute; inset: 0; }
.sg-p { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); }
.sg-svgl { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.sg-svgl path { fill: none; stroke-width: .45; stroke-linecap: round; }
.sg-svgl .sg-d { stroke-dasharray: 1; stroke-dashoffset: 0; }
.sg-svgl .sg-dash { stroke-dasharray: 1.2 1.2; }

/* 뱃지 — 장면 왼쪽 위 · 요약 표 · CLI 상자가 같은 꼴을 쓴다 */
.sg-badges { position: absolute; left: 14px; top: 12px; z-index: 3; display: flex; gap: 6px; flex-wrap: wrap; }
.sg-badges:empty { display: none; }
.sg-bd { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.sg-bd.sg-what { background: var(--surface); color: var(--ink); box-shadow: 0 4px 12px -6px rgba(20, 33, 58, .35); }
.sg-bd.sg-what .sg-ic { color: var(--mine); }
.sg-bd.sg-priv { background: var(--mine); color: #fff; }
.sg-bd.sg-pub { background: var(--team); color: #fff; }
.sg-bd.sg-off { background: var(--ink); color: var(--surface); }
@keyframes sg-bdin { from { opacity: 0; transform: translateY(-6px); } }
.sg-badges .sg-bd { animation: sg-bdin .45s ease both; } .sg-badges .sg-bd + .sg-bd { animation-delay: .12s; }

/* 그림 부품 */
.sg-win { width: var(--w, 40cqw); background: var(--surface); border-radius: 2.4cqw; box-shadow: var(--win-shadow); overflow: hidden; display: flex; flex-direction: column; font-size: max(8.5px, 2.1cqw); line-height: 1.4; }
.sg-tab { display: flex; align-items: center; gap: 1cqw; padding: 1.3cqw 1.6cqw; background: var(--surface-2); border-bottom: 1px solid var(--line); font-weight: 700; font-size: max(8.5px, 2cqw); }
.sg-tab .sg-ic { color: var(--mine); }
.sg-tab .sg-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-lockp { flex: none; display: inline-flex; align-items: center; gap: .5cqw; padding: .45cqw 1.2cqw; border-radius: 99px; background: var(--mine); color: #fff; font-size: max(8px, 1.8cqw); line-height: 1.3; font-weight: 800; white-space: nowrap; }
.sg-lockp .sg-ic, .sg-tab .sg-lockp .sg-ic { color: inherit; font-size: 1em; }
.sg-lockp.sg-pub { background: var(--team); }
.sg-win-b { padding: 1.6cqw; display: flex; flex-direction: column; gap: 1.1cqw; }
.sg-msg { padding: .9cqw 1.5cqw; border-radius: 1.7cqw; max-width: 90%; }
.sg-msg.sg-me { align-self: flex-end; background: var(--mine); color: #fff; border-bottom-right-radius: .5cqw; }
.sg-msg.sg-ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: .5cqw; }
.sg-guard { padding: 1.3cqw; border-radius: 3.4cqw; border: .3cqw solid color-mix(in srgb, var(--mine) 40%, transparent); background: color-mix(in srgb, var(--mine-soft) 55%, transparent); }

.sg-av { width: var(--s, 6.6cqw); height: var(--s, 6.6cqw); border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: calc(var(--s, 6.6cqw) * .4);
  border: .45cqw solid var(--surface); box-shadow: 0 .6cqw 1.4cqw -.4cqw rgba(20, 33, 58, .35); }
.sg-av.sg-min { background: var(--p-min); } .sg-av.sg-jun { background: var(--p-jun); } .sg-av.sg-so { background: var(--p-so); } .sg-av.sg-ha { background: var(--p-ha); }
.sg-av.sg-ghost { filter: grayscale(1); opacity: .3; }
.sg-who { display: flex; flex-direction: column; align-items: center; gap: .8cqw; }
.sg-pill { display: inline-flex; align-items: center; gap: .6cqw; padding: .5cqw 1.4cqw; border-radius: 99px; font-size: max(8px, 1.85cqw); font-weight: 800; white-space: nowrap; }
.sg-pill.sg-mine { background: var(--mine); color: #fff; }
.sg-pill.sg-team { background: var(--team); color: #fff; }
.sg-pill.sg-soft { background: var(--surface); color: var(--ink-sub); box-shadow: 0 .4cqw 1cqw -.4cqw rgba(20, 33, 58, .3); }
.sg-pill.sg-bad { background: var(--surface); color: var(--bad); box-shadow: 0 .4cqw 1cqw -.4cqw rgba(20, 33, 58, .3); }

/* 1장 — 세션 목록 */
.sg-slist { width: 29cqw; background: var(--surface); border-radius: 2.4cqw; box-shadow: var(--win-shadow); padding: 1.4cqw; display: flex; flex-direction: column; gap: .7cqw; }
.sg-slist-h { display: flex; align-items: center; gap: .8cqw; font-size: max(8.5px, 1.9cqw); font-weight: 800; color: var(--muted); padding: .2cqw .6cqw .5cqw; }
.sg-srow { display: flex; align-items: center; gap: 1cqw; padding: 1.1cqw 1.2cqw; border-radius: 1.4cqw; font-size: max(8.5px, 1.95cqw); }
.sg-srow .sg-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-srow .sg-ic { color: var(--muted); }
.sg-srow .sg-lk { color: var(--mine); }
.sg-srow.sg-sel { background: var(--mine-soft); color: var(--mine-ink); font-weight: 800; }
.sg-srow.sg-sel .sg-ic { color: var(--mine-ink); }

/* 2장 — 프로젝트 */
.sg-proj { width: 46cqw; background: var(--surface); border-radius: 2.6cqw; box-shadow: var(--win-shadow); overflow: hidden; }
.sg-proj-h { display: flex; align-items: center; gap: 1cqw; padding: 1.5cqw 1.8cqw; background: var(--mine-soft); }
.sg-proj-h .sg-fi { width: 4.6cqw; height: 4.6cqw; border-radius: 1.2cqw; background: var(--surface); color: var(--mine-ink); display: grid; place-items: center; font-size: 2.5cqw; }
.sg-proj-h b { font-size: max(9.5px, 2.3cqw); display: block; line-height: 1.2; }
.sg-proj-h small { font-size: max(8px, 1.7cqw); color: var(--mine-ink); font-weight: 700; display: block; }
.sg-proj-h .sg-sp { flex: 1; }
.sg-proj-b { padding: 1.6cqw 1.8cqw 2cqw; display: flex; flex-direction: column; gap: 1.2cqw; }
.sg-slot { height: 6.2cqw; border-radius: 1.6cqw; border: .25cqw dashed var(--line); }
.sg-sess { width: 42cqw; display: flex; align-items: center; gap: 1cqw; padding: 1.3cqw 1.5cqw; border-radius: 1.6cqw; background: var(--surface); box-shadow: 0 .8cqw 2cqw -1cqw rgba(20, 33, 58, .4), 0 0 0 1px var(--line); font-size: max(8.5px, 1.95cqw); }
.sg-sess .sg-ic { color: var(--mine); }
.sg-sess .sg-t { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-sess small { color: var(--muted); font-size: max(8px, 1.65cqw); white-space: nowrap; }
.sg-sess .sg-lk { color: var(--mine); }
.sg-pzone { position: absolute; border-radius: 3.6cqw; border: .32cqw dashed color-mix(in srgb, var(--mine) 55%, transparent); background: color-mix(in srgb, var(--mine-soft) 60%, transparent); }
.sg-pzone-r { position: absolute; inset: 0; border-radius: inherit; }
.sg-pz-l { position: absolute; left: 2.4cqw; top: -1.9cqw; display: inline-flex; align-items: center; gap: .6cqw; padding: .55cqw 1.5cqw; border-radius: 99px; background: var(--mine); color: #fff; font-size: max(8.5px, 1.85cqw); font-weight: 800; white-space: nowrap; }
.sg-pz-l.sg-pub { background: var(--team); }
.sg-mems { display: inline-flex; }
.sg-mems .sg-av { border-width: .35cqw; margin-left: -1.2cqw; }
.sg-mems .sg-av:first-child { margin-left: 0; }
.sg-av.sg-me-av { background: var(--mine); }
.sg-sess .sg-bad-lk { color: var(--bad); }
@keyframes sg-tored { from { color: var(--mine); } }
.sg-play .sg-sess .sg-bad-lk { animation: sg-tored .3s ease 5.3s both, sg-shake .4s ease 5.4s 2; }
.sg-note2 { width: 25cqw; display: flex; gap: 1.2cqw; align-items: flex-start; padding: 1.6cqw 1.8cqw; border-radius: 2cqw; background: var(--surface); border: .25cqw dashed color-mix(in srgb, var(--bad) 45%, var(--line)); font-size: max(8.5px, 1.85cqw); line-height: 1.45; color: var(--ink-sub); }
.sg-note2 b { color: var(--bad); font-size: max(10px, 2.6cqw); line-height: 1; }
.sg-note2 strong { color: var(--ink); }
@keyframes sg-blip { 0% { opacity: 0; transform: scale(.7); } 15% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.sg-play .sg-i-blip { animation: sg-blip 1.4s ease var(--d, 0s) both; }
.sg-xmark { width: 4.4cqw; height: 4.4cqw; border-radius: 50%; display: grid; place-items: center; background: var(--bad); color: #fff; font-size: 2.6cqw; box-shadow: 0 .6cqw 1.2cqw -.4cqw rgba(224, 81, 122, .7); }

/* 3장 — 지식 */
.sg-chip { display: inline-flex; align-items: center; gap: .7cqw; padding: .8cqw 1.4cqw; border-radius: 99px; font-size: max(8px, 1.8cqw); font-weight: 800; white-space: nowrap; background: var(--surface); box-shadow: 0 .5cqw 1.2cqw -.6cqw rgba(20, 33, 58, .4), 0 0 0 1px var(--line); }
.sg-chip.sg-no { color: var(--ink-sub); text-decoration: line-through; text-decoration-thickness: .25cqw; text-decoration-color: var(--bad); opacity: .85; }
.sg-chip.sg-no .sg-ic { color: var(--bad); }
.sg-chip.sg-yes { color: var(--team-ink); background: var(--team-soft); box-shadow: 0 0 0 .25cqw color-mix(in srgb, var(--team) 40%, transparent); }
.sg-kdoc { width: 36cqw; background: var(--surface); border-radius: 2.4cqw; box-shadow: var(--win-shadow), 0 0 0 .3cqw color-mix(in srgb, var(--team) 35%, transparent); overflow: hidden; }
.sg-kdoc-h { display: flex; align-items: center; gap: .8cqw; padding: 1.2cqw 1.6cqw; background: var(--team-soft); color: var(--team-ink); font-weight: 800; font-size: max(8.5px, 1.9cqw); }
.sg-kdoc-h .sg-sp { flex: 1; }
.sg-kdoc-b { padding: 1.5cqw 1.7cqw 1.8cqw; display: flex; flex-direction: column; gap: 1cqw; }
.sg-kdoc-b b { font-size: max(10px, 2.4cqw); line-height: 1.25; }
.sg-kf { display: grid; grid-template-columns: 6.4cqw minmax(0, 1fr); gap: .8cqw; font-size: max(8px, 1.75cqw); line-height: 1.45; }
.sg-kf span:first-child { color: var(--muted); font-weight: 700; }
.sg-kf span:last-child { color: var(--ink-sub); }

/* 4장 — 터미널 */
.sg-twin { width: 86cqw; background: var(--term-bg); border-radius: 2.4cqw; box-shadow: 0 2cqw 4cqw -2cqw rgba(0, 0, 0, .6); overflow: hidden; font: max(8.5px, 1.95cqw)/1.75 var(--sg-mono); color: var(--term-ink); }
.sg-twin-h { display: flex; align-items: center; gap: .9cqw; padding: 1.1cqw 1.6cqw; background: rgba(255, 255, 255, .05); }
.sg-twin-h i { width: 1.4cqw; height: 1.4cqw; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.sg-twin-h .sg-t { margin-left: .8cqw; color: var(--term-dim); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-lvst { position: relative; width: 19cqw; height: 3.6cqw; }
.sg-lvst span { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: .6cqw; padding: .35cqw 1.2cqw; border-radius: 99px; font: 800 max(8px, 1.7cqw)/1.4 var(--sg-font); white-space: nowrap; }
.sg-lvst .sg-on { background: rgba(169, 182, 255, .18); color: var(--term-on); }
.sg-lvst .sg-off { background: rgba(255, 255, 255, .1); color: var(--term-dim); }
.sg-lvst i { width: 1cqw; height: 1cqw; border-radius: 50%; background: currentColor; }
.sg-twin-b { padding: 1.6cqw 2.2cqw 2.2cqw; }
.sg-tl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-tl.sg-u { color: #fff; } .sg-tl.sg-t { color: var(--term-on); } .sg-tl.sg-d { color: var(--term-dim); } .sg-tl.sg-ok { color: var(--term-ok); }
.sg-tag-off { display: inline-flex; margin-left: 1cqw; padding: 0 1cqw; border-radius: 99px; background: rgba(255, 255, 255, .12); color: var(--term-dim); font: 800 max(8px, 1.6cqw)/1.7 var(--sg-font); vertical-align: middle; }
.sg-caret { display: inline-block; width: .9cqw; height: 2.2cqw; background: var(--term-ink); vertical-align: middle; animation: sg-blink 1s steps(1) infinite; }

/* 5장 — 한눈에 */
.sg-rcap { width: 90cqw; display: flex; flex-direction: column; gap: 1.2cqw; }
.sg-rrow { display: grid; grid-template-columns: 25cqw 14cqw minmax(0, 1fr); align-items: center; gap: 1.4cqw; padding: 1.5cqw 1.8cqw; border-radius: 2.2cqw; background: var(--surface); box-shadow: var(--win-shadow); }
.sg-rrow .sg-bd { font-size: max(8.5px, 1.9cqw); padding: .7cqw 1.5cqw; gap: .6cqw; justify-self: start; }
.sg-rrow .sg-bd.sg-what { box-shadow: 0 0 0 1px var(--line); }
.sg-rrow p { margin: 0; font-size: max(8.5px, 1.95cqw); color: var(--ink-sub); line-height: 1.4; }
.sg-rrow p strong { color: var(--ink); }
.sg-rrow p .sg-sub { font-size: .9em; color: var(--muted); }

/* 글 */
.sg-content { position: relative; padding: 24px 34px 26px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.sg-dots { display: flex; gap: 6px; margin-bottom: 4px; }
.sg-dots button { width: 8px; height: 8px; border-radius: 99px; border: 0; padding: 0; background: var(--line); cursor: pointer; transition: width .3s, background .3s; }
.sg-dots button[aria-current="step"] { width: 24px; background: var(--mine); }
.sg-content h2 { margin: 0; font-size: clamp(21px, 4.4vw, 25px); font-weight: 800; letter-spacing: -.02em; line-height: 1.32; text-wrap: balance; }
.sg-lead { margin: 0; color: var(--ink-sub); max-width: 42ch; text-wrap: pretty; }
.sg-lead strong { color: var(--ink); }
.sg-lead code, .sg-pop code { font-family: var(--sg-mono); font-size: .9em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; color: var(--ink); white-space: nowrap; }
.sg-note { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); max-width: 46ch; }
.sg-more { margin-top: 2px; border: 0; background: transparent; color: var(--mine-ink); font-weight: 700; font-size: 14px; cursor: pointer; padding: 4px 2px; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px; display: inline-flex; align-items: center; gap: 6px; }
.sg-more:hover { text-decoration-style: solid; }
.sg-actions { width: 100%; display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.sg-actions .sg-sp { flex: 1; }
.sg-btn { border: 0; border-radius: 12px; padding: 11px 20px; cursor: pointer; font-weight: 700; font-size: 15px; background: transparent; color: var(--muted); }
.sg-btn:hover:not(:disabled) { color: var(--ink); }
.sg-btn.sg-pri { background: var(--mine); color: #fff; min-width: 120px; box-shadow: 0 8px 20px -10px var(--mine); }
.sg-btn.sg-pri:hover { color: #fff; filter: brightness(1.06); }
.sg-replay { position: absolute; right: 12px; top: 12px; display: inline-flex; align-items: center; gap: 5px; border: 0; background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--muted); border-radius: 99px; padding: 4px 10px; font-size: 12px; cursor: pointer; z-index: 3; }
.sg-replay:hover { color: var(--ink); }

/* 팝오버 — 읽기 전용 · 인코그니토 켜는 법 */
.sg-more-wrap { position: relative; display: inline-flex; }
.sg-pop { position: absolute; left: 50%; bottom: calc(100% + 12px); transform: translateX(-50%); width: min(540px, calc(100vw - 32px)); z-index: 10;
  background: var(--surface); border-radius: 18px; box-shadow: 0 30px 60px -20px rgba(20, 33, 58, .55), 0 0 0 1px var(--line); padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.sg-pop::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; background: var(--surface); transform: translateX(-50%) rotate(45deg); box-shadow: 1px 1px 0 var(--line); }
@keyframes sg-popin { from { opacity: 0; transform: translate(-50%, 8px) scale(.97); } }
.sg-pop:not([hidden]) { animation: sg-popin .3s cubic-bezier(.2, .9, .3, 1.2) both; }
.sg-pop-top { display: flex; align-items: center; gap: 8px; }
.sg-ptabs { display: inline-flex; background: var(--surface-2); border-radius: 99px; padding: 3px; gap: 2px; }
.sg-ptabs button { border: 0; background: transparent; border-radius: 99px; padding: 5px 12px; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.sg-ptabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 2px 6px -2px rgba(20, 33, 58, .3); }
.sg-pop-x { margin-left: auto; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 4px 6px; }
.sg-mini { position: relative; aspect-ratio: 16 / 9.4; border-radius: 12px; overflow: hidden; container-type: inline-size; background: var(--bg); }
/* 홈 입력창(실제: v2/views.sg-ts «무엇이든 시키세요» + 아래 줄 · 오른쪽 [⚙][＋][시키기]) */
.sg-cmp { position: absolute; left: 5cqw; top: 17cqw; width: 90cqw; background: var(--surface); border-radius: 3cqw; box-shadow: var(--win-shadow); padding: 3cqw 3cqw 2.4cqw; display: flex; flex-direction: column; gap: 4cqw; }
.sg-cmp-in { font-size: 3.2cqw; color: var(--muted); line-height: 1.45; }
.sg-cmp-in span { font-size: 2.6cqw; }
.sg-cmp-row { display: flex; align-items: center; gap: 1.6cqw; }
.sg-cmp-ctl { font-size: 2.5cqw; color: var(--ink-sub); background: var(--surface-2); border-radius: 1.6cqw; padding: 1cqw 1.8cqw; white-space: nowrap; }
.sg-cmp-row .sg-sp { flex: 1; }
.sg-cmp-gear, .sg-cmp-plus { width: 6cqw; height: 6cqw; border-radius: 1.6cqw; display: grid; place-items: center; color: var(--ink-sub); font-size: 3.6cqw; }
.sg-cmp-gear { background: var(--surface-2); }
.sg-cmp-send { background: var(--mine); color: #fff; font-weight: 800; font-size: 2.8cqw; border-radius: 1.8cqw; padding: 1.4cqw 3cqw; }
.sg-cmp-tip { position: absolute; left: 66cqw; top: 25.5cqw; transform: translateX(-50%); background: var(--ink); color: var(--surface); font-size: 2.5cqw; font-weight: 700; border-radius: 1.4cqw; padding: 1cqw 2cqw; white-space: nowrap; }
.sg-cmp-tip::after { content: ""; position: absolute; left: 50%; bottom: -.9cqw; width: 2cqw; height: 2cqw; background: var(--ink); transform: translateX(-50%) rotate(45deg); }
/* 「새 세션 기본값」 창(실제: v2/session-defaults.sg-ts — 라이블리 모드 · 실행 승인 · 기록 범위 · [저장]) */
.sg-mdl { position: absolute; left: 50%; top: 50%; width: 84cqw; transform: translate(-50%, -50%); background: var(--surface); border-radius: 3cqw; box-shadow: 0 4cqw 8cqw -3cqw rgba(20, 33, 58, .55), 0 0 0 1px var(--line); padding: 2.8cqw 3.2cqw; display: flex; flex-direction: column; gap: 1.6cqw; opacity: 0; }
.sg-mdl-h { display: flex; align-items: center; justify-content: space-between; font-size: 3.4cqw; font-weight: 800; }
.sg-mdl-h span { color: var(--muted); font-size: 3cqw; font-weight: 500; }
.sg-mdl-l { font-size: 2.6cqw; font-weight: 800; display: flex; align-items: center; gap: 1cqw; }
.sg-mdl-l i { font-style: normal; width: 3.2cqw; height: 3.2cqw; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 2cqw; color: var(--muted); }
.sg-mdl-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2cqw; }
.sg-mdl-seg span { border: 1px solid var(--line); border-radius: 1.8cqw; padding: 1.3cqw 1cqw; text-align: center; font-size: 2.7cqw; font-weight: 800; color: var(--ink); background: var(--surface); }
.sg-mdl-seg small { display: block; font-size: 2.1cqw; font-weight: 500; color: var(--muted); }
.sg-mdl-seg span.sg-sel { background: var(--mine); border-color: var(--mine); color: #fff; }
.sg-mdl-seg span.sg-sel small { color: rgba(255, 255, 255, .85); }
.sg-mdl-dim { opacity: .4; }
.sg-mdl-f { display: flex; justify-content: flex-end; }
.sg-mdl-save { background: var(--mine); color: #fff; font-weight: 800; font-size: 2.8cqw; border-radius: 1.8cqw; padding: 1.3cqw 3.6cqw; }
.sg-cursor2 { position: absolute; width: 5cqw; height: 5cqw; left: var(--sx); top: var(--sy); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); z-index: 3; }
@keyframes sg-cur2 {
  0% { left: 96cqw; top: 54cqw; transform: scale(1); }
  16% { left: var(--gx); top: var(--gy); transform: scale(1); } 19% { transform: scale(.8); } 22% { left: var(--gx); top: var(--gy); transform: scale(1); }
  44% { left: var(--ox); top: var(--oy); transform: scale(1); } 47% { transform: scale(.8); } 50% { left: var(--ox); top: var(--oy); transform: scale(1); }
  70% { left: var(--sx); top: var(--sy); transform: scale(1); } 73% { transform: scale(.8); } 76%, 100% { left: var(--sx); top: var(--sy); transform: scale(1); }
}
@keyframes sg-mdl { 0%, 21% { opacity: 0; transform: translate(-50%, -48%) scale(.96); } 26%, 74% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(.98); } }
@keyframes sg-ring { 0% { box-shadow: 0 0 0 0 var(--mine-glow); } 100% { box-shadow: 0 0 0 2.4cqw transparent; } }
@keyframes sg-selon { from { background: var(--surface); border-color: var(--line); color: var(--ink); } }
@keyframes sg-seloff { from { background: var(--mine); border-color: var(--mine); color: #fff; } }
.sg-play .sg-cursor2 { animation: sg-cur2 5.6s cubic-bezier(.45, 0, .25, 1) .2s both; }
.sg-play .sg-mdl { animation: sg-mdl 5.6s ease .2s both; }
.sg-play .sg-cmp-gear { animation: sg-ring .6s ease-out 1.25s; }
.sg-play .sg-mdl-save { animation: sg-ring .6s ease-out 4.3s; }
.sg-play .sg-mdl-seg .sg-on { animation: sg-selon .25s ease 2.85s both; }
.sg-play .sg-mdl-seg .sg-was { animation: sg-seloff .25s ease 2.85s both; }
.sg-play .sg-cmp-tip { animation: sg-pop .45s cubic-bezier(.2, .9, .3, 1.3) 4.8s both; }
.sg-mini-wrap { position: relative; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.sg-mini-wrap .sg-mini { border-radius: 0; }
.sg-mini-bar { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: #0F1524; }
.sg-mini-bar .sg-dots3 { display: inline-flex; gap: 5px; margin-right: 4px; }
.sg-mini-bar .sg-dots3 i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.sg-mini-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 99px; background: rgba(255, 255, 255, .1); }
.sg-mini-switch button { border: 0; background: transparent; color: rgba(255, 255, 255, .78); border-radius: 99px; padding: 4px 10px; font-size: 11.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.sg-mini-switch button .sg-ic { font-size: 13px; }
.sg-mini-switch button[aria-selected="true"] { background: #fff; color: #14213A; }
/* 터미널 장면 — 실제: lively run --readonly → «claude 실행 [readonly]» → Claude Code */
.sg-mterm { position: absolute; left: 5cqw; top: 13cqw; width: 90cqw; background: var(--term-bg); border-radius: 2.6cqw; overflow: hidden; box-shadow: 0 2cqw 4cqw -2cqw rgba(0, 0, 0, .55); font: 3cqw/1.75 var(--sg-mono); color: var(--term-ink); }
.sg-mterm-h { display: flex; align-items: center; gap: 1.2cqw; padding: 1.6cqw 2.2cqw; background: rgba(255, 255, 255, .06); color: var(--term-dim); font-size: 2.5cqw; }
.sg-mterm-h i { width: 1.8cqw; height: 1.8cqw; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.sg-mterm-b { padding: 2.2cqw 3cqw 3cqw; }
.sg-mterm-b div { white-space: nowrap; overflow: hidden; }
.sg-mterm .sg-pr { color: var(--term-dim); }
.sg-mterm .sg-cmd { color: #fff; display: inline-block; }
.sg-mterm .sg-cmd em { font-style: normal; color: var(--term-on); }
.sg-mterm .sg-dim { color: var(--term-dim); }
.sg-mterm .sg-cc { color: #E8916F; font-weight: 700; }
.sg-mcap { position: absolute; left: 50%; bottom: 3.4cqw; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 1cqw; padding: 1.4cqw 2.6cqw; border-radius: 99px; background: var(--mine); color: #fff; font-size: 2.9cqw; font-weight: 800; white-space: nowrap; box-shadow: 0 1.4cqw 3cqw -1.4cqw var(--mine); }
.sg-mcap.sg-ic-mode { background: var(--ink); color: var(--surface); }
@keyframes sg-capin { from { opacity: 0; transform: translate(-50%, 1.6cqw); } }
.sg-play .sg-mcap { animation: sg-capin .45s ease var(--d, 0s) both; }
.sg-play .sg-mterm .sg-i-type { animation: sg-typing 1.1s steps(22, end) var(--d, 0s) both; }
.sg-pop-steps { margin: 0; padding-left: 20px; font-size: 13.5px; color: var(--ink-sub); display: flex; flex-direction: column; gap: 2px; }
.sg-pop-steps b { color: var(--ink); }
.sg-pop-cli { margin: 0; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; }
.sg-pop-txt { margin: 0; font-size: 13.5px; color: var(--ink-sub); }
.sg-pop-txt strong { color: var(--ink); }

/* ── 움직임: 기본은 끝 장면. .sg-play 일 때 처음 모습에서 출발 ── */
@keyframes sg-popc { from { opacity: 0; transform: translate(-50%, -50%) scale(.86); } }
@keyframes sg-risec { from { opacity: 0; transform: translate(-50%, calc(-50% + 2.4cqw)); } }
@keyframes sg-rise { from { opacity: 0; transform: translateY(1.6cqw); } }
@keyframes sg-pop { from { opacity: 0; transform: scale(.6); } }
@keyframes sg-fade { from { opacity: 0; } }
@keyframes sg-fadeout { from { opacity: 1; } }
@keyframes sg-ghostin { from { opacity: 0; } }
@keyframes sg-light { from { filter: grayscale(1); opacity: .3; } }
@keyframes sg-mv { from { left: var(--x0); top: var(--y0); } }
@keyframes sg-ripple { 0% { box-shadow: 0 0 0 0 var(--mine-glow); } 100% { box-shadow: 0 0 0 4cqw transparent; } }
@keyframes sg-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-.8cqw); } }
@keyframes sg-draw { from { stroke-dashoffset: 1; } }
@keyframes sg-strike { from { opacity: 1; text-decoration-color: transparent; } }
@keyframes sg-selrow { from { background: transparent; color: var(--ink); } }
@keyframes sg-typing { from { clip-path: inset(0 100% 0 0); } }
@keyframes sg-blink { 50% { opacity: 0; } }
@keyframes sg-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-.8cqw); } 75% { transform: translateX(.8cqw); } }
@keyframes sg-pickit { from { background: transparent; color: var(--muted); } }
@keyframes sg-unpick { from { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(20, 33, 58, .2); } }

.sg-play .sg-p.sg-a-pop { animation: sg-popc .6s cubic-bezier(.2, .9, .3, 1.25) var(--d, 0s) both; }
.sg-play .sg-p.sg-a-rise { animation: sg-risec .6s cubic-bezier(.2, .8, .3, 1) var(--d, 0s) both; }
.sg-play .sg-p.sg-a-fade { animation: sg-fade .6s ease var(--d, 0s) both; }
.sg-play .sg-p.sg-a-mv { animation: sg-mv 1s cubic-bezier(.6, 0, .2, 1) var(--d, 0s) both; }
.sg-play .sg-p.sg-a-fly { animation: sg-mv 1.1s cubic-bezier(.6, 0, .2, 1) var(--d2, 0s) both, sg-fade .35s ease var(--d, 0s) both; }
.sg-play .sg-i-rise { animation: sg-rise .5s ease var(--d, 0s) both; }
.sg-play .sg-i-pop { animation: sg-pop .5s cubic-bezier(.2, .9, .3, 1.3) var(--d, 0s) both; }
.sg-play .sg-i-fade { animation: sg-fade .5s ease var(--d, 0s) both; }
.sg-play .sg-i-out { animation: sg-fadeout .35s ease var(--d, 0s) both; }
.sg-play .sg-i-ghost { animation: sg-ghostin .8s ease var(--d, 0s) both, sg-bob 3.6s ease-in-out calc(var(--d, 0s) + .8s) infinite; }
.sg-play .sg-i-light { animation: sg-light .7s ease var(--d, 0s) both; }
.sg-play .sg-i-ripple { animation: sg-ripple 1.4s ease-out var(--d, 0s) 2; }
.sg-play .sg-i-draw { animation: sg-draw .8s ease var(--d, 0s) both; }
.sg-play .sg-i-strike { animation: sg-strike .5s ease var(--d, 0s) both; }
.sg-play .sg-i-sel { animation: sg-selrow .4s ease var(--d, 0s) both; }
.sg-play .sg-i-type { animation: sg-typing .9s steps(20, end) var(--d, 0s) both; }
.sg-play .sg-i-shake { animation: sg-shake .4s ease var(--d, 0s) 2; }
.sg-play .sg-i-pick { animation: sg-pickit .3s ease var(--d, 0s) both; }
.sg-play .sg-i-unpick { animation: sg-unpick .3s ease var(--d, 0s) both; }

@media (prefers-reduced-motion: reduce) {
  .sg-play *, .sg-caret, .sg-badges .sg-bd, .sg-pop { animation: none !important; }
}
@media (max-width: 520px) {
  .sg-content { padding: 20px 18px 20px; }
  .sg-card { border-radius: 20px; } .sg-stage { border-radius: 20px 20px 0 0; }
  .sg-badges { left: 10px; top: 8px; } .sg-bd { font-size: 11px; padding: 3px 9px; }
}

/* 다시 보기 창의 닫기 — 그림 오른쪽 위(다시 보기 단추는 그 왼쪽으로 비킨다) */
.sg-close { position: absolute; right: 10px; top: 10px; z-index: 4; width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.sg-close:hover { color: var(--ink); }
.sg-stage:has(.sg-close) .sg-replay { right: 48px; }
.sg-root [data-sg="title"]:focus { outline: none; }
