:root {
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #111827;
  background: #fbfbfd;
  font-synthesis: none;
  --navy: #111827;
  --text: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --surface: #fff;
  --soft: #f4f3ff;
  --primary: #6375f4;
  --primary-dark: #4c5ed7;
  --danger: #b43c4d;
  --footer: #11172b;
  --shadow: 0 18px 45px rgba(62, 72, 130, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #fbfbfd; color: var(--text); line-height: 1.65; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, select, input[type="color"], input[type="checkbox"] { cursor: pointer; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
[hidden] { display: none !important; }
.container { width: min(1100px, calc(100% - 32px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 100; top: -70px; left: 14px; padding: 10px 14px; border: 2px solid var(--navy); background: #fff; font-weight: 800; }
.skip-link:focus { top: 12px; }
.eyebrow { margin: 0 0 7px; color: #596bea; font-size: .78rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
h1, h2, h3, strong { color: var(--navy); }

.site-header { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid #ececf2; background: rgba(255, 255, 255, .94); box-shadow: 0 1px 16px rgba(30, 41, 59, .04); backdrop-filter: blur(12px); }
.header-inner { display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-mark { display: block; width: 34px; height: 34px; object-fit: contain; }
.brand strong { font-size: 1.24rem; font-weight: 900; line-height: 1; letter-spacing: -.045em; }
.site-header nav { display: flex; align-items: center; gap: 4px; }
.site-header nav a { padding: 8px 10px; border-radius: 7px; color: #475569; font-size: .9rem; font-weight: 650; text-decoration: none; }
.site-header nav a:hover { background: #f3f2ff; color: #4657d2; }

.hero { padding: 62px 0 28px; text-align: center; }
.hero h1 { margin: 0; font-size: clamp(2.4rem, 7vw, 3.7rem); line-height: 1.1; letter-spacing: -.06em; }
.hero p:last-child { margin: 13px auto 0; color: var(--muted); font-size: 1.02rem; }
.tool-section { padding: 20px 0 76px; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr); gap: 20px; align-items: start; }
.panel { min-width: 0; padding: 26px; border: 1px solid #e3e4ed; border-radius: 20px; background: #fff; box-shadow: 0 10px 32px rgba(40, 48, 91, .06); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.panel-heading > div { display: flex; align-items: center; gap: 10px; }
.panel-heading h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.035em; }
.step { display: grid; width: 28px; height: 28px; place-items: center; margin: 0; border-radius: 50%; background: var(--soft); color: var(--primary-dark); font-size: .78rem; font-weight: 900; }
.text-button { padding: 6px 4px; border: 0; background: transparent; color: #687085; font-size: .82rem; font-weight: 750; }
.text-button:hover { color: var(--danger); }
.field-label, fieldset legend { display: block; margin-bottom: 7px; color: var(--navy); font-size: .86rem; font-weight: 800; }
textarea { display: block; width: 100%; min-height: 150px; resize: vertical; padding: 14px; border: 1px solid #dfe1ea; border-radius: 11px; background: #fff; color: var(--navy); line-height: 1.55; transition: border-color .2s, box-shadow .2s; }
textarea:hover { border-color: #c4c8dc; }
textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 117, 244, .12); outline: none; }
.field-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; color: var(--muted); font-size: .76rem; }
.field-meta .is-over { color: var(--danger); font-weight: 800; }
fieldset { min-width: 0; margin: 22px 0 0; padding: 0; border: 0; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.settings-grid > label:not(.check-field) { display: grid; gap: 6px; color: #4b5563; font-size: .8rem; font-weight: 750; }
select { width: 100%; min-height: 43px; padding: 8px 34px 8px 11px; border: 1px solid #dfe1ea; border-radius: 9px; background: #fff; color: var(--navy); }
.color-field span { display: flex; min-height: 43px; align-items: center; gap: 9px; padding: 5px 9px; border: 1px solid #dfe1ea; border-radius: 9px; background: #fff; }
.color-field input { width: 32px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; }
.color-field b { color: #596174; font-size: .78rem; }
.check-field { display: flex; min-height: 43px; align-items: center; gap: 9px; align-self: end; padding: 8px 11px; border: 1px solid #dfe1ea; border-radius: 9px; color: var(--navy); font-size: .82rem; font-weight: 750; }
.check-field input { width: 17px; height: 17px; accent-color: var(--primary); }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 800; text-decoration: none; cursor: pointer; }
.button-primary { background: linear-gradient(135deg, #7b6ff0, #4f72ea); color: #fff; }
.button-primary:hover:not(:disabled) { background: linear-gradient(135deg, #6f63e2, #4565d9); }
.button-secondary { border-color: #dfe1ea; background: #fff; color: var(--navy); }
.button-secondary:hover:not(:disabled) { background: #f5f5fa; }
.button:disabled { cursor: not-allowed; opacity: .46; }
.generate-button { width: 100%; margin-top: 17px; }
.error, .notice { margin: 13px 0 0; padding: 10px 12px; border-radius: 8px; font-size: .82rem; }
.error { background: #fff1f2; color: #9f2638; }
.warning { border: 1px solid #f2d495; background: #fffbeb; color: #765215; }
.privacy-note { margin: 10px 0 0; color: var(--muted); font-size: .75rem; text-align: center; }
.preview-panel { position: sticky; top: 86px; }
.preview-box { display: grid; aspect-ratio: 1; place-items: center; overflow: hidden; padding: 22px; border: 1px solid #ececf2; border-radius: 16px; background-color: #f7f7fa; background-image: linear-gradient(45deg, #ececf2 25%, transparent 25%), linear-gradient(-45deg, #ececf2 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ececf2 75%), linear-gradient(-45deg, transparent 75%, #ececf2 75%); background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-size: 16px 16px; }
.preview-box canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.status { margin: 12px 0; color: var(--muted); font-size: .82rem; text-align: center; }
.download-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

.content { padding-bottom: 86px; }
.content-block { padding: 48px 0; border-top: 1px solid var(--line); }
.content-block h2, .related h2 { margin: 0 0 18px; font-size: clamp(1.45rem, 4vw, 1.9rem); letter-spacing: -.04em; }
.content-block ol { margin: 0; padding-left: 22px; }
.content-block li + li { margin-top: 8px; }
.tip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tip-grid article { padding: 19px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.tip-grid h3 { margin: 0 0 7px; font-size: 1rem; }
.tip-grid p { margin: 0; color: #596174; font-size: .88rem; }
details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { padding: 17px 2px; color: var(--navy); font-weight: 800; cursor: pointer; }
details p { margin: -3px 2px 18px; color: #596174; }
.related { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 30px; border: 1px solid #dfe1ef; border-radius: 18px; background: #fff; }
.related h2 { margin-bottom: 0; }
.ad-slot { width: min(1100px, calc(100% - 32px)); min-height: 100px; margin: 0 auto 30px; }

.site-footer { padding: 38px 0 24px; background: var(--footer); color: #dbe1f2; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 24px; }
.footer-inner strong { color: #fff; }
.footer-inner p { margin: 5px 0; color: #adb7d0; font-size: .86rem; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-inner a { color: #dbe1f2; font-size: .84rem; }
.footer-inner small { grid-column: 1 / -1; padding-top: 16px; border-top: 1px solid #30394f; color: #929db8; }
.consent { position: fixed; z-index: 40; right: 18px; bottom: 18px; width: min(470px, calc(100% - 36px)); padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.consent p { margin: 0 0 13px; color: var(--text); font-size: .9rem; }
.consent-actions { display: flex; justify-content: flex-end; gap: 8px; }
.consent button { min-height: 39px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--navy); font-weight: 800; }
.consent button:last-child { border-color: var(--primary); background: var(--primary); color: #fff; }
.noscript { margin: 0; padding: 12px; background: #fff1f2; color: #9f2638; text-align: center; }

.policy-shell { width: min(800px, calc(100% - 32px)); min-height: 65vh; margin: 0 auto; padding: 58px 0 82px; }
.policy-shell h1 { margin: 0; font-size: clamp(2rem, 6vw, 2.8rem); letter-spacing: -.045em; }
.policy-shell h2 { margin: 34px 0 9px; font-size: 1.25rem; }
.policy-shell p, .policy-shell li { color: #4b5563; }
.policy-meta { color: var(--muted); font-size: .86rem; }
.contact-card { margin-top: 30px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.contact-card a { color: var(--primary-dark); font-weight: 800; }
.not-found { display: grid; min-height: 70vh; place-items: center; padding: 24px; text-align: center; }
.not-found div { max-width: 560px; }
.not-found h1 { margin: 4px 0; font-size: clamp(2rem, 7vw, 3.5rem); }
.not-found p { color: var(--muted); }

@media (max-width: 820px) {
  .tool-grid { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .preview-box { width: min(100%, 440px); margin-inline: auto; }
  .tip-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .container { width: min(100% - 22px, 1100px); }
  .header-inner { gap: 10px; min-height: 60px; }
  .site-header nav a { padding-inline: 6px; font-size: .78rem; }
  .hero { padding: 48px 0 20px; }
  .hero p:last-child { max-width: 300px; font-size: .92rem; }
  .tool-section { padding-bottom: 58px; }
  .panel { padding: 19px; border-radius: 16px; }
  .settings-grid { grid-template-columns: 1fr; }
  .field-meta { align-items: flex-end; flex-direction: column; gap: 1px; }
  .preview-box { padding: 15px; }
  .content-block { padding: 38px 0; }
  .related { align-items: stretch; flex-direction: column; padding: 22px; }
  .related .button { width: 100%; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-inner nav { flex-direction: column; gap: 7px; }
  .footer-inner small { grid-column: auto; }
  .consent-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
