:root {
  color-scheme: light;
  --bg: #f3efe5;
  --bg-accent: #e1d5bc;
  --panel: rgba(255, 252, 245, 0.92);
  --text: #1f1a14;
  --muted: #64594c;
  --line: rgba(78, 61, 41, 0.16);
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --danger: #d9485f;
  --shadow: 0 18px 48px rgba(62, 39, 12, 0.12);
  font-family: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.16), transparent 32%),
    linear-gradient(180deg, var(--bg) 0%, #f8f4eb 100%);
  color: var(--text);
}

.app {
  width: min(100%, 840px);
  margin: 0 auto;
  padding: 20px 16px 36px;
}

.hero {
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.1;
}

.lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel + .panel {
  margin-top: 16px;
}

.canvas-toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.field {
  display: block;
  width: 100%;
}

.field span {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

input[type="range"] {
  width: 100%;
}

.canvas-shell {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #f8f1e0 0%, var(--bg-accent) 100%);
}

.canvas-shell img,
.canvas-shell canvas {
  display: block;
  width: 100%;
}

.canvas-shell canvas {
  position: absolute;
  inset: 0;
  touch-action: none;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 130px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  padding: 14px 16px;
  font: inherit;
  color: inherit;
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.primary-button {
  width: 100%;
  margin-top: 14px;
  background: var(--primary);
  color: #fff;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  border: 1px solid var(--line);
}

.hint,
.status {
  margin: 12px 2px 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.status[data-tone="error"] {
  color: var(--danger);
}

.status[data-tone="success"] {
  color: var(--primary-strong);
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 26px;
  }

  .canvas-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .ghost-button {
    width: 100%;
  }
}
