:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1a1d21;
  --muted: #5b646e;
  --line: #e4e7eb;
  --accent: #1f4e79;
  --accent-hover: #163a5c;
  --focus: #2b6cb0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.06);
  --max: 1120px;
  --font: system-ui, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--accent);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
}

.hero {
  padding: 2.25rem 0 0.5rem;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 42rem;
}

.ad-slot {
  min-height: 90px;
  margin: 1.25rem 0;
}

.tool {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 1.25rem;
  align-items: start;
  margin-block: 0.5rem 2.5rem;
  margin-inline: auto;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.preview-panel {
  padding: 1rem;
  min-height: 420px;
}

.preview-stage {
  display: grid;
  place-items: center;
  min-height: 380px;
  background: repeating-conic-gradient(#eef0f3 0% 25%, #f7f8fa 0% 50%) 50% / 20px 20px;
  border-radius: 10px;
  overflow: auto;
}

.preview-stage canvas {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: grab;
  touch-action: none;
}

.preview-stage canvas.is-dragging {
  cursor: grabbing;
}

.placeholder {
  margin: 0;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.controls {
  padding: 1.1rem 1.15rem 1.25rem;
}

.controls h2 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
}

.field {
  margin-bottom: 0.9rem;
}

.field label,
.legend {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
}

input[type="text"],
input[type="email"],
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  background: #fff;
}

input[type="range"] {
  width: 100%;
}

input[type="color"] {
  width: 3rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 0.9rem;
  padding: 0.7rem 0.8rem 0.85rem;
}

.inline-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.inline-options label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 400;
  font-size: 0.9rem;
  margin: 0;
}

.dropzone {
  border: 1px dashed #c5ccd4;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  background: #fafbfc;
}

.dropzone.is-over,
.preview-stage.is-over {
  border-color: var(--accent);
  background: #eef4fa;
}

.dropzone p {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  background: #f3f5f7;
}

.btn-block {
  width: 100%;
  margin-top: 0.35rem;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.file-meta {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.content {
  padding: 0 0 3rem;
}

.content h2 {
  margin: 2.2rem 0 0.7rem;
  font-size: 1.25rem;
}

.steps {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, 1fr);
}

.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
}

.step h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.faq {
  display: grid;
  gap: 0.75rem;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
}

.faq p {
  margin: 0.6rem 0 0;
  color: var(--muted);
}

.prose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem 1.8rem;
  max-width: 46rem;
}

.prose h1 {
  margin-top: 0;
  font-size: 1.7rem;
}

.prose h2 {
  font-size: 1.15rem;
  margin-top: 1.75rem;
}

.prose p,
.prose li {
  color: #333;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 1.25rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

@media (max-width: 860px) {
  .tool {
    grid-template-columns: 1fr;
  }

  .preview-panel,
  .preview-stage {
    min-height: 280px;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 0;
    min-height: 0;
  }
}
