:root {
  color-scheme: dark;
  --bg: #181818; --chrome: #202020; --chrome-2: #252526; --surface: #1e1e1e;
  --line: #343434; --muted: #a0a0a0; --text: #e8e8e8; --purple: #8b5cf6;
  --purple-2: #6d28d9; --blue: #3794ff; --green: #4ec9b0; --status: #68217a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--bg); font-family: "Segoe UI", Pretendard, "Noto Sans KR", system-ui, sans-serif; line-height: 1.55; }
button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.site-header { height: 35px; padding: 0 10px; display: flex; align-items: center; gap: 18px; background: #181818; border-bottom: 1px solid #2a2a2a; user-select: none; position: sticky; top: 0; z-index: 30; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.brand-mark { width: 21px; height: 21px; display: grid; place-items: center; color: white; background: linear-gradient(135deg, #b07cff, #68217a); font: 800 .68rem/1 "Segoe UI", sans-serif; clip-path: polygon(12% 20%, 52% 0, 52% 23%, 88% 8%, 100% 20%, 100% 80%, 88% 92%, 52% 77%, 52% 100%, 12% 80%, 0 63%, 0 37%); }
.menu-bar { display: flex; gap: 2px; }
.menu-bar a { padding: 3px 8px; border-radius: 4px; color: #c8c8c8; font-size: .76rem; }
.menu-bar a:hover { background: #303030; color: white; }
.command-center { width: min(430px, 36vw); height: 24px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 8px; color: #9d9d9d; background: #242424; border: 1px solid #3b3b3b; border-radius: 6px; font-size: .72rem; }
.command-center span { color: #c9c9c9; font-size: .9rem; }
.privacy-pill { display: inline-flex; align-items: center; gap: 7px; color: #bcbcbc; font-size: .7rem; white-space: nowrap; }
.privacy-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 7px rgba(78,201,176,.55); }
main { overflow: hidden; }
.studio-shell { height: calc(100vh - 35px); display: grid; grid-template-columns: 48px minmax(0,1fr); background: var(--surface); }
.activity-bar { background: #181818; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding-top: 7px; }
.activity { width: 48px; height: 48px; display: grid; place-items: center; color: #858585; border-left: 2px solid transparent; }
.activity svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.activity:hover { color: #d7d7d7; }
.activity.active { color: white; border-left-color: var(--purple); }
.workbench { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.intro { min-height: 64px; padding: 11px 18px; display: flex; align-items: center; gap: 26px; background: #1e1e1e; border-bottom: 1px solid var(--line); }
.intro > div { display: flex; align-items: baseline; gap: 12px; }
.eyebrow { margin: 0; color: #b17cff; font: 700 .64rem/1.2 Consolas, ui-monospace, monospace; letter-spacing: .12em; }
h1 { margin: 0; font-size: 1.25rem; line-height: 1.1; font-weight: 600; letter-spacing: -.025em; }
.intro-copy { margin: 0 0 0 auto; color: #9f9f9f; font-size: .78rem; }
.tab-strip { height: 35px; display: flex; align-items: stretch; background: #181818; border-bottom: 1px solid var(--line); }
.file-tab { min-width: 150px; padding: 0 13px; display: flex; align-items: center; gap: 8px; color: #999; background: #181818; border-right: 1px solid #2d2d2d; font-size: .75rem; }
.file-tab.active { color: #efefef; background: #1e1e1e; border-top: 1px solid var(--purple); }
.mermaid-icon { color: #c586c0; font: 700 .7rem Consolas, monospace; }
.preview-icon { color: #4fc1ff; }
.tab-close { margin-left: auto; color: #888; font-size: .95rem; }
.theme-bar { min-height: 45px; padding: 5px 9px 5px 13px; display: flex; align-items: center; gap: 10px; background: #202020; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.theme-label { flex: 0 0 auto; color: #888; font: 700 .57rem Consolas, monospace; letter-spacing: .1em; }
.theme-presets { display: flex; gap: 5px; }
.theme-chip { height: 32px; padding: 0 8px 0 5px; display: inline-flex; align-items: center; gap: 6px; color: #aaa; background: transparent; border: 1px solid transparent; border-radius: 4px; font-size: .65rem; }
.theme-chip:hover { color: white; background: #2d2d2d; }
.theme-chip.active { color: white; background: #333; border-color: #7650bb; box-shadow: inset 0 -1px #b17cff; }
.theme-chip i { width: 22px; height: 18px; flex: 0 0 auto; display: block; border-radius: 3px; background: linear-gradient(135deg,var(--c1) 0 48%,var(--c2) 49% 72%,var(--c3) 73%); border: 1px solid rgba(255,255,255,.14); }
.custom-theme-button { height: 30px; flex: 0 0 auto; margin-left: auto; padding: 0 9px; display: inline-flex; align-items: center; gap: 7px; color: #ddd; background: #2c2c2c; border: 1px solid #484848; border-radius: 4px; font-size: .67rem; }
.custom-theme-button:hover { background: #3a3a3a; border-color: #7650bb; }
.custom-swatch { width: 15px; height: 15px; border-radius: 50%; background: conic-gradient(#6366f1,#c7d2fe,#1e293b,#6366f1); border: 1px solid rgba(255,255,255,.35); }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(360px,.9fr) minmax(460px,1.1fr); background: #151515; }
.panel { min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border-right: 1px solid var(--line); }
.panel:last-child { border-right: 0; }
.panel-head { min-height: 38px; padding: 0 10px 0 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); background: var(--chrome-2); }
.panel-head > div { display: flex; align-items: center; gap: 8px; }
.panel-head h2 { margin: 0; color: #d9d9d9; font-size: .76rem; font-weight: 500; }
.panel-index { color: #c586c0; font: 700 .58rem Consolas, monospace; }
.panel-actions { display: flex; gap: 4px !important; }
button { color: #ccc; background: transparent; border: 1px solid transparent; cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 1px solid #c8a9ff; outline-offset: -1px; }
.text-button { height: 27px; padding: 0 8px; color: #bcbcbc; font-size: .68rem; border-radius: 3px; }
.text-button:hover { color: white; background: #3a3a3a; }
.icon-button, .download-button { height: 27px; border-color: #444; border-radius: 3px; background: #303030; }
.icon-button { width: 28px; display: grid; place-items: center; }
.icon-button svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.download-button { padding: 0 9px; font: 600 .64rem Consolas, monospace; }
.icon-button:hover, .download-button:hover { color: white; background: #414141; border-color: #5a5a5a; }
.expand-button { width: 25px; height: 25px; margin-left: 2px; color: #bcbcbc; }
.expand-button:hover { color: #d8c4ff; border-color: #7c54c7; }
.editor-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: 47px minmax(0,1fr); background: #1e1e1e; }
.line-numbers { margin: 0; padding: 14px 10px 14px 0; text-align: right; overflow: hidden; color: #858585; border-right: 1px solid #2a2a2a; user-select: none; font: .82rem/1.72 Consolas, "Cascadia Code", monospace; }
textarea { resize: none; width: 100%; height: 100%; border: 0; outline: 0; padding: 14px 18px; color: #d4d4d4; background: transparent; caret-color: white; white-space: pre; overflow: auto; font: .82rem/1.72 Consolas, "Cascadia Code", ui-monospace, monospace; tab-size: 2; }
textarea::selection { background: #264f78; }
.panel-foot { min-height: 24px; padding: 0 9px; background: var(--status); color: #f3eaf7; display: flex; align-items: center; justify-content: space-between; font: .64rem Consolas, monospace; }
.preview-panel .panel-foot { background: #191919; color: #a8a8a8; border-top: 1px solid var(--line); }
.preview-canvas { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; place-items: safe center; overflow: auto; padding: 28px; background-color: #f6f6f6; background-image: linear-gradient(#e5e5e5 1px, transparent 1px), linear-gradient(90deg,#e5e5e5 1px,transparent 1px); background-size: 24px 24px; cursor: grab; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #8b5cf6 #dcdcdc; }
.preview-canvas.panning { cursor: grabbing; user-select: none; }
.preview-canvas::-webkit-scrollbar { width: 14px; height: 14px; }
.preview-canvas::-webkit-scrollbar-track { background: #e3e3e3; }
.preview-canvas::-webkit-scrollbar-thumb { background: #9a9a9a; border: 3px solid #e3e3e3; border-radius: 8px; }
.preview-canvas::-webkit-scrollbar-thumb:hover { background: var(--purple-2); }
.preview-canvas::-webkit-scrollbar-corner { background: #e3e3e3; }
.diagram-output { min-width: max-content; user-select: none; -webkit-user-drag: none; }
.diagram-output svg { display: block; max-width: none; height: auto; -webkit-user-drag: none; }
.zoom-group { display: inline-flex; align-items: center; overflow: hidden; background: #303030; border: 1px solid #444; border-radius: 3px; }
.zoom-group .zoom-step { width: 25px; height: 27px; border: 0; border-radius: 0; background: transparent; }
.zoom-value { height: 27px; min-width: 46px; padding: 0 4px; color: #d8d8d8; background: transparent; border: 0; border-left: 1px solid #444; border-right: 1px solid #444; font: 600 .62rem Consolas, monospace; }
.zoom-group .zoom-step:hover, .zoom-value:hover { color: white; background: #414141; }
.loading-state, .error-state { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; text-align: center; color: #5f6772; background: rgba(246,246,246,.94); }
.loading-state p { font-size: .82rem; }
.loader { width: 27px; height: 27px; border: 3px solid #d4d4d4; border-top-color: var(--purple-2); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-state { padding: 30px; color: #333; }
.error-state strong { color: #c42b1c; }
.error-state p { margin: 7px 0 0; font-size: .78rem; max-width: 520px; word-break: break-word; }
.status-foot > span { display: flex; align-items: center; gap: 7px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #747474; }
.status-dot.ready { background: var(--green); }
.status-dot.error { background: #f14c4c; }
.ad-slot { max-width: 1080px; min-height: 80px; margin: 38px auto 0; border: 1px dashed #3c3c3c; display: grid; place-content: center; text-align: center; color: #777; background: #1d1d1d; }
.ad-slot span { font: 600 .58rem Consolas, monospace; letter-spacing: .14em; }
.ad-slot p { margin: 5px 0 0; font-size: .72rem; }
.guide-section, .faq-section { max-width: 1180px; margin: 0 auto; padding: 100px 32px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 38px; }
.section-heading .eyebrow, .types-copy .eyebrow { margin-bottom: 12px; }
.section-heading h2, .types-copy h2 { margin: 0; font-size: clamp(1.8rem,3.5vw,3rem); line-height: 1.08; letter-spacing: -.045em; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; padding: 0; background: var(--line); border: 1px solid var(--line); }
.steps li { min-height: 190px; padding: 26px; background: #202020; display: flex; gap: 20px; }
.steps li > span { color: #c586c0; font: 700 .75rem Consolas, monospace; }
.steps h3, .type-grid h3 { margin: 0 0 10px; font-size: 1rem; }
.steps p, .type-grid p, .types-copy > p { margin: 0; color: var(--muted); font-size: .85rem; }
code { color: #ce9178; background: #2a2a2a; padding: 2px 5px; border-radius: 3px; font: .84em Consolas, monospace; }
.types-section { border-top: 1px solid #333; border-bottom: 1px solid #333; background: #202020; display: grid; grid-template-columns: .76fr 1.24fr; gap: 70px; padding: 90px max(32px,calc((100vw - 1180px)/2)); }
.types-copy > p { max-width: 460px; margin-top: 22px; }
.type-grid { display: grid; grid-template-columns: repeat(2,1fr); border: 1px solid var(--line); }
.type-grid article { min-height: 230px; padding: 22px; border: 1px solid var(--line); background: #252526; position: relative; }
.type-grid article > span { position: absolute; right: 18px; top: 15px; color: #777; font: .68rem Consolas, monospace; }
.type-grid svg { width: 100%; height: 96px; margin-bottom: 16px; fill: none; stroke: #9b72cf; stroke-width: 1.4; }
.type-grid article:nth-child(2n) svg { stroke: #4fc1ff; }
.faq-section { padding-bottom: 120px; }
.faq-list { border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary { list-style: none; cursor: pointer; padding: 22px 4px; display: flex; justify-content: space-between; gap: 20px; font-weight: 600; }
summary::-webkit-details-marker { display:none; }
summary span { color: #c586c0; font-size: 1.3rem; line-height: 1; transition: transform .2s; }
details[open] summary span { transform: rotate(45deg); }
details p { margin: -5px 0 22px; color: var(--muted); max-width: 780px; font-size: .87rem; }
footer { min-height: 150px; max-width: 1180px; margin: 0 auto; padding: 38px 32px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 26px; color: #888; font-size: .75rem; }
.footer-brand { color: white; margin-right: auto; }
.copyright { margin-left: 18px; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 40; transform: translate(-50%,20px); padding: 9px 15px; border: 1px solid #7c54c7; border-radius: 4px; background: #2d2141; color: white; font-size: .76rem; box-shadow: 0 12px 30px rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.theme-dialog { width: min(520px,calc(100vw - 32px)); padding: 0; color: #e8e8e8; background: #252526; border: 1px solid #525252; border-radius: 6px; box-shadow: 0 24px 80px rgba(0,0,0,.55); }
.theme-dialog::backdrop { background: rgba(0,0,0,.62); backdrop-filter: blur(2px); }
.theme-dialog form { padding: 22px; }
.dialog-head { display: flex; justify-content: space-between; gap: 20px; }
.dialog-head h2 { margin: 4px 0 0; font-size: 1.1rem; }
.dialog-kicker { color: #b17cff; font: 700 .58rem Consolas,monospace; letter-spacing: .12em; }
.dialog-close { width: 30px; height: 30px; color: #aaa; border-radius: 3px; font-size: 1.2rem; }
.dialog-close:hover { color: white; background: #3a3a3a; }
.theme-dialog form > p { margin: 14px 0 18px; color: #aaa; font-size: .78rem; }
.color-fields { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.color-fields label { min-height: 68px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #c8c8c8; background: #1e1e1e; border: 1px solid #3b3b3b; border-radius: 4px; font-size: .72rem; }
.color-fields input[type="color"] { width: 34px; height: 34px; padding: 2px; border: 1px solid #555; border-radius: 4px; background: #292929; cursor: pointer; }
.dialog-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }
.secondary-button, .primary-button { min-width: 76px; height: 31px; border-radius: 3px; font-size: .72rem; }
.secondary-button { color: #ddd; border-color: #555; background: #303030; }
.primary-button { color: white; border-color: #8b5cf6; background: #68217a; }
.primary-button:hover { background: #7a2b8d; }
@media (max-width: 900px) {
  .command-center { display: none; } .privacy-pill { margin-left: auto; }
  .studio-shell { height: auto; }
  .studio-shell { grid-template-columns: 42px minmax(0,1fr); } .activity { width: 42px; }
  .intro { align-items: flex-start; flex-direction: column; gap: 5px; } .intro-copy { margin: 0; }
  .theme-chip span { display: none; }
  .theme-chip { padding-right: 5px; }
  .workspace { grid-template-columns: 1fr; min-height: 0; }
  .panel { min-height: 500px; border-right: 0; border-bottom: 1px solid var(--line); }
  .preview-panel { min-height: 580px; }
  .steps, .types-section { grid-template-columns: 1fr; }
  .guide-section, .faq-section { padding: 82px 20px; }
  .types-section { padding: 80px 20px; gap: 44px; }
  .ad-slot { margin: 32px 20px 0; }
}
@media (max-width: 560px) {
  .site-header { gap: 10px; } .menu-bar { display: none; } .privacy-pill { font-size: 0; }
  .studio-shell { grid-template-columns: 1fr; } .activity-bar { display: none; }
  .intro { min-height: 72px; } .file-tab { min-width: 135px; }
  .theme-label { display: none; }
  .custom-theme-button { font-size: 0; padding: 0 7px; }
  .color-fields { grid-template-columns: repeat(2,1fr); }
  .text-button { display: none; } .preview-canvas { padding: 18px; }
  .type-grid { grid-template-columns: 1fr; } .steps li { min-height: 160px; }
  footer { align-items: flex-start; flex-direction: column; gap: 9px; padding: 34px 20px; }
  .copyright { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
