:root {
  --bg: #090909;
  --panel: #111;
  --panel-raised: #181818;
  --text: #f5f5f2;
  --muted: #a1a19a;
  --line: rgba(255, 255, 255, 0.11);
  --accent: #b9ff66;
  --accent-ink: #102000;
  --danger: #ff8b8b;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 20%, rgba(185, 255, 102, 0.08), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 350;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: .65rem 1rem;
  background: #fff;
  color: #000;
  border-radius: 999px;
}
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}
.wordmark { font-size: 1.25rem; font-weight: 260; letter-spacing: -.055em; }
.topbar-meta { display: flex; align-items: center; gap: 1rem; color: var(--muted); font-size: .78rem; }
.preview-chip, .build-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .38rem .7rem;
}
.preview-chip { color: var(--accent); }

.workspace {
  width: min(1480px, 100%);
  min-height: calc(100vh - 68px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
}
.guide {
  padding: clamp(2.2rem, 5vw, 5rem) clamp(1.4rem, 4vw, 3.5rem);
  border-right: 1px solid var(--line);
}
.eyebrow {
  margin: 0 0 1.1rem;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.guide h1 {
  margin: 0;
  font-size: clamp(2.45rem, 4.3vw, 4.75rem);
  line-height: .98;
  font-weight: 270;
  letter-spacing: -.065em;
}
.guide-copy { margin: 1.5rem 0 2.4rem; color: var(--muted); line-height: 1.7; font-size: .92rem; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.step {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: .8rem;
  align-items: center;
  padding: .9rem;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #70706a;
  transition: .2s ease;
}
.step > span {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: .75rem;
}
.step div { display: grid; gap: .16rem; }
.step strong { font-size: .88rem; }
.step small { font-size: .72rem; }
.step.is-current { color: var(--text); background: rgba(255,255,255,.04); border-color: var(--line); }
.step.is-complete { color: var(--accent); }
.privacy-note { margin-top: 2rem; border-top: 1px solid var(--line); padding-top: 1rem; color: var(--muted); }
.privacy-note summary { cursor: pointer; font-size: .78rem; color: var(--text); }
.privacy-note p { font-size: .72rem; line-height: 1.65; }

.product { min-width: 0; position: relative; padding: clamp(1rem, 3vw, 2.3rem); }
.product-bar {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: .76rem;
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: .5rem;
  border-radius: 50%;
  background: #777;
  box-shadow: 0 0 0 4px rgba(255,255,255,.04);
}
.status-dot.is-ready { background: var(--accent); }
.text-button { border: 0; background: none; color: var(--muted); cursor: pointer; }
.text-button:hover { color: var(--text); }

.empty-state {
  min-height: min(720px, calc(100vh - 150px));
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  border: 1px dashed rgba(255,255,255,.18);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
}
.empty-state.is-over { border-color: var(--accent); background: rgba(185,255,102,.04); }
.file-mark {
  width: 72px;
  height: 88px;
  display: grid;
  place-items: center;
  margin-bottom: 1.4rem;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 7px 18px 7px 7px;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 750;
  letter-spacing: .06em;
  transform: rotate(-2deg);
}
.empty-state h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 320; letter-spacing: -.04em; }
.empty-state p { margin: .7rem 0 1.5rem; color: var(--muted); font-size: .84rem; }

.primary-button, .secondary-button, .save-button {
  border-radius: 999px;
  padding: .72rem 1.15rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease;
}
.primary-button, .save-button { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.secondary-button { background: transparent; border-color: var(--line); }
button:active:not(:disabled) { transform: scale(.98); }
button:disabled { cursor: not-allowed; opacity: .38; }

.document-state { display: grid; gap: 1rem; }
.document-head { display: flex; align-items: center; justify-content: space-between; }
.document-label { margin: 0 0 .2rem; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
.document-head h2 { margin: 0; font-size: 1.2rem; font-weight: 420; }
.format-chip { border: 1px solid var(--line); border-radius: 999px; padding: .35rem .65rem; font-size: .7rem; color: var(--accent); }
.document-stage {
  height: clamp(360px, 52vh, 640px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #c9c9c6;
}
.document-stage iframe { width: 100%; height: 100%; border: 0; background: #dededb; }

.ai-panel, .change-card, .save-row {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.ai-panel { padding: 1rem; }
.ai-panel label { display: block; margin-bottom: .65rem; font-size: .78rem; font-weight: 550; }
.prompt-row { display: flex; gap: .6rem; }
.prompt-row input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .75rem 1rem;
  background: #0b0b0b;
  color: var(--text);
}
.prompt-hint { margin: .55rem .3rem 0; color: var(--muted); font-size: .68rem; }
.change-card { padding: 1rem; }
.change-title { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.change-title span { color: var(--accent); font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.change-title small { color: var(--muted); }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: .8rem 0; }
.diff-grid > div { min-width: 0; padding: .85rem; border-radius: 12px; background: #0b0b0b; }
.diff-grid span { color: var(--muted); font-size: .67rem; }
.diff-grid p { margin: .35rem 0 0; font-size: .78rem; line-height: 1.55; overflow-wrap: anywhere; }
.diff-grid > div:last-child { box-shadow: inset 3px 0 var(--accent); }
.change-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.save-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; }
.save-row div { display: grid; gap: .25rem; }
.save-row strong { font-size: .82rem; }
.save-row small { color: var(--muted); font-size: .7rem; }

.toast, .error {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 20;
  max-width: min(420px, calc(100vw - 3rem));
  padding: .9rem 1.1rem;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  font-size: .78rem;
}
.toast { background: var(--accent); color: var(--accent-ink); }
.error { background: #311919; border: 1px solid #6f3535; color: var(--danger); }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .guide { border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 2rem; }
  .guide h1 { font-size: clamp(2.4rem, 10vw, 4rem); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: .65rem .35rem; }
  .privacy-note { display: none; }
}
@media (max-width: 640px) {
  .topbar-meta > a, .build-chip { display: none; }
  .steps small { display: none; }
  .product { padding: .8rem; }
  .empty-state { min-height: 480px; border-radius: 20px; }
  .prompt-row, .save-row { align-items: stretch; flex-direction: column; }
  .diff-grid { grid-template-columns: 1fr; }
  .document-stage { height: 430px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
