:root {
  --bg: #f5f3ef;
  --panel: #ffffff;
  --text: #1f2024;
  --muted: #6b6f76;
  --accent: #1a73e8;
  --accent-dark: #155ab6;
  --border: #e5e3dd;
  --shadow: 0 8px 24px rgba(20, 20, 30, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard",
    "Apple SD Gothic Neo", "Noto Sans KR", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 16px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.hero-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: white;
  padding: 6px;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px 40px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.controls .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  flex: 1;
}

.mode-tabs {
  display: flex;
  gap: 6px;
  background: #f1efe9;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.mode-tab {
  flex: 1;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 9px;
}

.mode-tab.active {
  background: white;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.mode-tab:not(.active):hover {
  color: var(--text);
}

.edie-advanced {
  margin: 4px 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  background: #fafaf7;
}

.edie-advanced summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  padding: 4px 0;
}

.edie-advanced[open] summary {
  margin-bottom: 8px;
  color: var(--text);
}

.payload-box {
  margin-bottom: 14px;
}

.payload-box label {
  display: block;
  margin-bottom: 6px;
}

.payload-box pre {
  margin: 0;
  padding: 10px 12px;
  background: #1f2024;
  color: #e8e4d8;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.controls .row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.controls .row .field { min-width: 140px; }

label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="color"] {
  width: 100%;
  height: 38px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

textarea { resize: vertical; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.field.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
}

.field.checkbox label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.logo-box {
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 14px 16px 4px;
  margin: 6px 0 16px;
}

.logo-box legend {
  padding: 0 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.file-field {
  flex-direction: column;
  align-items: stretch;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

button {
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s, background 0.15s, color 0.15s;
}

button:active { transform: translateY(1px); }

button.primary {
  background: var(--accent);
  color: white;
}
button.primary:hover { background: var(--accent-dark); }

button.secondary {
  background: #eef2f7;
  color: var(--text);
}
button.secondary:hover { background: #e1e7ef; }

button.ghost {
  background: transparent;
  color: var(--accent);
  padding: 6px 0;
  text-align: left;
  font-size: 13px;
}
button.ghost:hover { color: var(--accent-dark); text-decoration: underline; }

.preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.qr-canvas {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(45deg, #f3f1ec 25%, transparent 25%),
    linear-gradient(-45deg, #f3f1ec 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f3f1ec 75%),
    linear-gradient(-45deg, transparent 75%, #f3f1ec 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.qr-canvas canvas, .qr-canvas svg {
  max-width: 100%;
  max-height: 100%;
}

.hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

footer {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 13px;
}

footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

.heart { color: #e25555; }
