:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #dfe3e9;
  --text: #1b1e24;
  --muted: #6b7280;
  --accent: #2563eb;
  --warn: #92400e;
  --warn-bg: #fef3c7;
}

* { box-sizing: border-box; }

/* Author display rules otherwise beat the UA rule for [hidden]. */
[hidden] { display: none !important; }

body {
  margin: 0;
  padding: 24px 16px 64px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

header, main { max-width: 760px; margin: 0 auto; }

h1 { margin: 0 0 4px; font-size: 24px; }

h2 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.sub { margin: 0 0 24px; color: var(--muted); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.row > label {
  min-width: 62px;
  color: var(--muted);
}

.row:last-of-type { margin-bottom: 0; }

select, input[type="number"] {
  font: inherit;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: inherit;
}

input[type="number"] { width: 88px; }

input[type="range"] { flex: 1; min-width: 160px; }

.times, .unit-label, .hint, .filename { color: var(--muted); }

.hint { margin: 10px 0 0; font-size: 13px; }

.filename { font-size: 13px; }

.drop {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  transition: background 0.15s, border-color 0.15s;
}

.drop.over { border-color: var(--accent); background: #eff4ff; }

.drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.button {
  display: inline-block;
  font: inherit;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: inherit;
  cursor: pointer;
}

.drop input[type="file"]:focus-visible + .button { outline: 2px solid var(--accent); }

.button.primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.button.primary:disabled {
  background: #c7cdd6;
  cursor: not-allowed;
}

.info {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.warning {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 13px;
}

#crop {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: #1b1e24;
  touch-action: none;
  cursor: grab;
  margin-bottom: 14px;
}

#crop:active { cursor: grabbing; }

.sheet-wrap {
  padding: 12px;
  border-radius: 8px;
  background: repeating-conic-gradient(#eceff3 0% 25%, #f8fafc 0% 50%) 0 0 / 16px 16px;
  margin-bottom: 14px;
}

#sheet {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 1px 4px rgba(20, 22, 28, 0.18);
}
