:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --accent: #ff8a3d;
  --text: #1f2933;
  --muted: #6b7280;
  --border: #e5e7eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.site-header {
  padding: 16px 24px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(6px);
}

.branding {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #f9fafb;
}

.logo-block {
  padding: 8px 12px;
  letter-spacing: 0.2em;
  font-weight: 600;
}

.logo-block.accent {
  background: var(--accent);
  color: #fff;
}

.tagline {
  color: var(--muted);
  font-size: 14px;
}

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  padding: 16px;
}

.controls {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 16px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label {
  font-weight: 600;
  font-size: 14px;
}

.subtext {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.2;
  margin-top: 2px;
}

.hint {
  color: var(--muted);
  font-size: 12px;
}

input[type="file"],
input[type="text"],
input[type="color"],
select,
button {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f9fafb;
  color: var(--text);
  font-size: 14px;
}

input[type="file"] {
  color: var(--muted);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

input[type="color"] {
  padding: 0;
  height: 40px;
}

input[type="range"] {
  width: 100%;
  accent-color: #9ca3af; /* neutral gray instead of blue */
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: #d1d5db;
  border-radius: 999px;
  border: 1px solid #cbd2d9;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #6b7280;
  border: 2px solid #f9fafb;
  margin-top: -6px;
  box-shadow: 0 1px 2px rgba(31, 41, 51, 0.25);
}

input[type="range"]::-moz-range-track {
  height: 6px;
  background: #d1d5db;
  border: 1px solid #cbd2d9;
  border-radius: 999px;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #6b7280;
  border: 2px solid #f9fafb;
  box-shadow: 0 1px 2px rgba(31, 41, 51, 0.25);
}

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

.line-row {
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}

.line-row input[type="color"] {
  flex: 1 1 0;
  min-width: 0;
  padding: 0;
  height: 40px;
}

.line-row select {
  flex: 1 1 0;
  min-width: 0;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.slider-row span {
  width: 52px;
}

.slider-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.primary {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.primary:hover {
  filter: brightness(1.05);
}

.secondary {
  background: #f3f4f6;
  color: var(--text);
  font-weight: 700;
  border: 1px solid var(--border);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.secondary:hover {
  background: #e5e7eb;
}

.icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 10px;
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.share-group .row {
  gap: 10px;
}

.preview {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.canvas-wrapper {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  justify-content: center;
}

canvas {
  width: 100%;
  max-width: 960px;
  height: auto;
  background: #fff;
  border-radius: 6px;
}

.preview-hint {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 960px) {
  .layout {
    display: flex;
    flex-direction: column;
  }

  .preview {
    order: 1;
    position: sticky;
    top: 12px;
    z-index: 1;
  }

  .controls {
    order: 2;
    position: static;
  }
}
