:root {
  color-scheme: light;
  --ink: #101820;
  --muted: #5d6975;
  --surface: #ffffff;
  --panel: #f2f6f7;
  --line: #d8e0e5;
  --accent: #006d77;
  --accent-strong: #004f56;
  --gold: #ffb703;
  --danger: #9b2c2c;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #e8f1f2 0%, #f9fbfb 45%, #ffffff 100%);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 14px 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 2px 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 9vw, 3.25rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-strong);
  font-size: 1.35rem;
  font-weight: 800;
}

.stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 1px solid #c6d3d9;
  border-radius: 8px;
  background: #17212b;
  box-shadow: 0 18px 38px rgb(16 24 32 / 14%);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 22px;
  color: #eef6f6;
  text-align: center;
}

.empty-state strong {
  font-size: 1.35rem;
}

.empty-state span {
  color: #b9c9cf;
}

.capture-row,
.save-row,
.button-grid,
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.capture-row {
  margin: 14px 0;
}

.primary-action,
.secondary-action,
button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-action {
  background: var(--accent);
  color: #fff;
}

.primary-action span {
  color: #fff;
}

.secondary-action,
button {
  background: var(--surface);
  color: var(--accent-strong);
  border-color: var(--line);
}

.primary-action input,
.secondary-action input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.panel {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 82%);
  backdrop-filter: blur(10px);
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label > span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

input,
select {
  min-height: 44px;
  padding: 0 11px;
}

textarea {
  resize: vertical;
  padding: 10px 11px;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--accent);
}

.check-row span {
  color: var(--ink);
}

.save-row {
  margin-top: 14px;
  grid-template-columns: 1.15fr 1fr 1fr;
}

.save-row button:first-child {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.save-row button:nth-child(2) {
  background: var(--gold);
  color: #1c2430;
  border-color: #e0a200;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.status {
  min-height: 20px;
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 380px) {
  .app-shell {
    padding-inline: 10px;
  }

  .capture-row,
  .save-row,
  .button-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }
}
