:root {
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --bg: #f5f6fb;
  --panel: #ffffff;
  --border: #e2e4ee;
  --text: #1f2330;
  --text-muted: #5c6378;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.page-header {
  padding: 2.5rem 1.25rem 1rem;
  text-align: center;
}

.page-header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

@media (min-width: 768px) {
  .layout {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: start;
  }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.panel h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1.5rem;
}

legend {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0;
  margin-bottom: 0.75rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.field > span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

input[type="text"],
select,
input[type="color"] {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

select {
  appearance: auto;
}

input[type="text"]:read-only {
  background: #f3f4fa;
}

input[type="color"] {
  padding: 0.25rem;
  height: 44px;
  cursor: pointer;
}

input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hint {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hint.inline {
  margin-top: 0.5rem;
}

.hint code {
  background: #eef0f8;
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 1rem;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 36px;
  font-size: 0.9rem;
}

.check-grid label.disabled {
  opacity: 0.4;
  pointer-events: none;
}

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

.color-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.color-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.option-row {
  margin-bottom: 0.5rem;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.btn {
  min-height: 44px;
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn:hover {
  background: var(--accent-strong);
}

.btn.ghost {
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
}

.btn.ghost:hover {
  background: #eef0fe;
}

.preview-frame {
  display: flex;
  justify-content: center;
  padding: 1.25rem;
  background: #10131c;
  border-radius: 10px;
  min-height: 160px;
  overflow-x: auto;
}

#preview {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  image-rendering: auto;
}

.copy-row {
  display: flex;
  gap: 0.5rem;
}

.copy-row input {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.copy-row .btn {
  min-width: 76px;
  flex-shrink: 0;
}

.page-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 1rem 1.25rem 2.5rem;
}

.page-footer code {
  background: #eef0f8;
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
}
