:root {
  --bg: #f5efe4;
  --bg-soft: rgba(255, 249, 240, 0.72);
  --panel: rgba(255, 252, 247, 0.92);
  --line: rgba(56, 36, 23, 0.12);
  --text: #25170f;
  --muted: #6b5649;
  --accent: #b24a2d;
  --accent-strong: #8e3419;
  --accent-soft: rgba(178, 74, 45, 0.12);
  --shadow: 0 22px 60px rgba(68, 34, 18, 0.12);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(214, 150, 94, 0.18), transparent 32%),
    linear-gradient(160deg, #f2ebdf 0%, #f8f4ee 46%, #efe4d4 100%);
  color: var(--text);
  font-family: "Aptos", "Pretendard Variable", "Malgun Gothic", sans-serif;
}

body {
  position: relative;
  overflow-x: hidden;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.backdrop {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  filter: blur(14px);
  opacity: 0.55;
}

.backdrop-a {
  top: -120px;
  left: -80px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(214, 102, 74, 0.18);
}

.backdrop-b {
  right: -100px;
  bottom: 8%;
  width: 300px;
  height: 300px;
  border-radius: 40%;
  background: rgba(146, 109, 69, 0.14);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
  margin-bottom: 20px;
}

.eyebrow,
.section-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.hero h1,
.workspace h2,
.preview-card h2 {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: clamp(28px, 3vw, 44px);
  letter-spacing: -0.03em;
}

.hero-copy {
  max-width: 860px;
  margin: 14px 0 0;
  line-height: 1.65;
  color: var(--muted);
}

.hero-status {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-weight: 700;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 8px rgba(178, 74, 45, 0.12);
}

.intake {
  padding: 22px;
  margin-bottom: 20px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.section-head h2,
.editor-panel h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 140px;
  border-radius: 20px;
  border: 1.5px dashed rgba(178, 74, 45, 0.32);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.66), rgba(255, 246, 237, 0.88)),
    repeating-linear-gradient(
      -45deg,
      rgba(178, 74, 45, 0.04),
      rgba(178, 74, 45, 0.04) 12px,
      transparent 12px,
      transparent 24px
    );
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.dropzone.dragging {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.dropzone span {
  display: block;
  font-size: 18px;
  font-weight: 700;
}

.dropzone-sub {
  margin-top: 6px;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 500px) minmax(0, 1fr);
  gap: 20px;
}

.left-column,
.right-column {
  display: grid;
  gap: 20px;
  align-content: start;
}

.left-column > .card,
.right-column > .card {
  padding: 22px;
}

.action-row,
.action-stack,
.utility-bar,
.search-wrap {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.action-stack {
  margin-top: 18px;
}

.button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: rgba(58, 34, 23, 0.08);
  color: var(--text);
  transition: transform 0.16s ease, background 0.16s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff8f0;
}

.button.subtle {
  background: rgba(178, 74, 45, 0.1);
  color: var(--accent-strong);
}

.button.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

.file-list {
  display: grid;
  gap: 14px;
}

.file-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
}

.file-card.active {
  border-color: rgba(178, 74, 45, 0.45);
  box-shadow: inset 0 0 0 1px rgba(178, 74, 45, 0.12);
}

.file-head,
.file-name-wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.file-title {
  font-weight: 700;
  font-size: 17px;
  word-break: break-all;
}

.meta-line,
.small-note,
.tiny-note {
  color: var(--muted);
}

.meta-line {
  margin-top: 6px;
  font-size: 13px;
}

.tiny-note,
.small-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.tiny-note {
  font-size: 12px;
}

.file-grid,
.form-grid,
.toggle-grid,
.editor-grid {
  display: grid;
  gap: 12px;
}

.file-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full {
  grid-column: 1 / -1;
}

.toggle-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.editor-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  border: 1px solid rgba(66, 38, 25, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
}

input[type="color"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(66, 38, 25, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px;
}

.toggle,
.inline-check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle input,
.inline-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.file-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.file-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.empty-state,
.empty-box {
  display: grid;
  place-items: center;
  min-height: 110px;
  padding: 16px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.preview-card {
  min-height: 820px;
}

.preview-empty {
  margin-top: 18px;
}

.preview-holder {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.page-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(56, 36, 23, 0.08);
}

.page-stage {
  position: relative;
  background: #ece7dd;
  overflow: auto;
  padding: 16px;
}

.page-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 12px 28px rgba(48, 27, 16, 0.12);
}

.page-overlay {
  position: absolute;
  pointer-events: none;
  inset: 16px;
}

.marker {
  position: absolute;
  border-radius: 6px;
  border: 2px solid;
  background: rgba(255, 255, 255, 0.08);
}

.marker.selected {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.18);
}

.marker.patch {
  border-color: #d97706;
  background: rgba(217, 119, 6, 0.18);
}

.result-list,
.patch-list,
.form-field-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  align-content: start;
}

.result-item,
.patch-item,
.field-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  padding: 10px 12px;
}

.result-item {
  cursor: pointer;
  text-align: left;
}

.result-item.active {
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.14);
}

.result-text,
.patch-text {
  display: block;
  margin-top: 4px;
  word-break: break-all;
  line-height: 1.55;
}

.field-row {
  display: grid;
  gap: 8px;
}

.field-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .editor-grid {
    grid-template-columns: 1fr;
  }

  .preview-card {
    min-height: unset;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 14px;
  }

  .hero,
  .left-column > .card,
  .right-column > .card,
  .intake {
    padding: 18px;
  }

  .hero {
    flex-direction: column;
  }

  .file-grid,
  .form-grid,
  .toggle-grid {
    grid-template-columns: 1fr;
  }
}

/* 설명·도움말 카드 (2026-09-21) */
.guide-card { margin-top: 20px; padding: 28px; line-height: 1.75; max-width: 980px; }
.guide-card h2 { margin: 0 0 10px; font-family: "Georgia", "Times New Roman", serif; font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -0.02em; }
.guide-card h3 { margin: 26px 0 10px; font-size: 19px; color: var(--accent-strong); }
.guide-card h4 { margin: 16px 0 6px; font-size: 16px; }
.guide-card p { margin: 0 0 10px; color: var(--text); }
.guide-card ol { padding-left: 22px; margin: 0; }
.guide-card li + li { margin-top: 8px; }
.guide-card a { color: var(--accent-strong); font-weight: 700; }
