:root {
  color-scheme: light;
  --paper: #f2f1ec;
  --surface: #fbfaf6;
  --ink: #171716;
  --muted: #74736e;
  --line: #d7d5cd;
  --blue: #1557ff;
  --green: #00a65a;
  --radius: 14px;
  font-family: "Avenir Next", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

html {
  height: 100%;
  overscroll-behavior: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  color: var(--ink);
  background:
    radial-gradient(circle at 1px 1px, rgba(23, 23, 22, 0.055) 0.7px, transparent 0.8px) 0 0 / 6px 6px,
    var(--paper);
}

button,
input,
label {
  font: inherit;
}

button,
.button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(1680px, calc(100% - 24px));
  height: 100dvh;
  margin: 0 auto;
  padding: 12px 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 48px;
  margin-bottom: 10px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 37px;
  height: 37px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: inset 0 0 0 8px #c8ff22;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 750;
}

.brand-block p,
.control-heading p,
.control-actions p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.header-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.header-tool,
.export-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.header-tool:disabled {
  cursor: default;
  opacity: .38;
}

.export-trigger {
  border: 1px solid var(--ink);
  color: #fff;
  background: var(--ink);
}

.export-trigger:disabled {
  cursor: default;
  opacity: .38;
}

.export-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 246px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 16px 45px rgba(23, 23, 22, .18);
}

.export-menu-head {
  display: grid;
  gap: 3px;
  padding: 1px 1px 11px;
}

.export-menu-head strong {
  font-size: 13px;
}

.export-menu-head small,
.export-mode-row small {
  color: var(--muted);
  font-size: 10px;
}

.export-format {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.export-format label {
  position: relative;
  cursor: pointer;
}

.export-format input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  opacity: 0;
}

.export-format span {
  display: grid;
  place-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}

.export-format input:checked + span {
  border-color: var(--ink);
  color: #fff;
  background: var(--ink);
}

.export-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.export-mode-row span {
  display: grid;
  gap: 2px;
}

.export-mode-row strong {
  font-size: 12px;
}

.export-mode-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.export-download {
  width: 100%;
  min-height: 36px;
  margin-top: 9px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.export-download:disabled {
  cursor: wait;
  opacity: .55;
}

.button,
.text-button,
.reset-button {
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
}

.button-secondary {
  color: var(--ink);
  background: var(--surface);
}

.button-primary {
  color: #fff;
  background: var(--ink);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 60px rgba(21, 21, 20, 0.08);
}

.preview-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  background: #e8e7e1;
}

.preview-toolbar,
.preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 246, 0.92);
}

.preview-footer {
  min-height: 40px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
}

.file-info span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
}

.text-button,
.reset-button {
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}

.text-button:active {
  color: var(--blue);
}

.preview-tools,
.preview-zoom {
  display: flex;
  align-items: center;
  gap: 9px;
}

.preview-zoom {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.preview-zoom input {
  width: 74px;
}

.preview-zoom output {
  min-width: 34px;
  color: var(--muted);
  font-size: 11px;
}

.canvas-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 18px;
  overflow: auto;
  background:
    linear-gradient(45deg, rgba(255,255,255,.32) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.32) 75%) 0 0 / 18px 18px,
    linear-gradient(45deg, rgba(255,255,255,.32) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.32) 75%) 9px 9px / 18px 18px,
    #e5e4de;
}

#previewCanvas {
  display: block;
  max-width: none;
  max-height: none;
  width: 100%;
  height: auto;
  margin: auto;
  flex: 0 0 auto;
  background: #fff;
  box-shadow: 0 10px 36px rgba(23, 23, 22, 0.15);
}

.canvas-stage.is-empty #previewCanvas {
  display: none;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

.empty-state[hidden] {
  display: none;
}

.drop-hint {
  position: absolute;
  inset: 20px;
  display: grid;
  place-items: center;
  border: 2px dashed var(--blue);
  border-radius: 10px;
  color: var(--blue);
  background: rgba(255,255,255,.9);
  font-size: 18px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
}

.preview-panel.is-dragging .drop-hint {
  opacity: 1;
}

.controls-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 18px 20px 24px;
  border-left: 1px solid var(--line);
  background: var(--surface);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.controls-panel.is-empty .quick-actions,
.controls-panel.is-empty .control-list,
.controls-panel.is-empty .control-actions {
  display: none;
}

.control-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.control-heading h2 {
  font-size: 20px;
  letter-spacing: -0.03em;
}

.dot-sample {
  display: grid;
  grid-template-columns: repeat(3, 6px);
  gap: 4px;
  flex: 0 0 auto;
  padding: 10px;
  border-radius: 50%;
  background: #c8ff22;
}

.dot-sample i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
}

.control-list {
  display: grid;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.quick-actions button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.quick-actions .reset-button {
  border-color: var(--blue);
  color: var(--blue);
  text-align: left;
}

.quick-actions button:disabled {
  cursor: default;
  opacity: .42;
}

.control-section {
  margin: 0;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.control-section h3,
.control-section legend {
  margin: 0 0 13px;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading-row h3 {
  margin: 0;
}

.section-heading-row label {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.layer-list {
  display: grid;
  gap: 6px;
}

.layer-item {
  display: grid;
  grid-template-columns: 14px 38px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  padding: 5px 8px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background: #fff;
  cursor: pointer;
}

.layer-item.is-dragging {
  opacity: .42;
}

.layer-item.is-drop-target {
  border-color: var(--blue);
  transform: translateY(1px);
}

.layer-drag {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  letter-spacing: -4px;
  cursor: grab;
}

.layer-item:active .layer-drag {
  cursor: grabbing;
}

.layer-item.is-active {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.layer-item img {
  width: 38px;
  height: 38px;
  border-radius: 5px;
  object-fit: cover;
  background: #eceae4;
}

.layer-item > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.layer-item strong,
.layer-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-item strong {
  font-size: 12px;
}

.layer-item small {
  color: var(--muted);
  font-size: 10px;
}

.layer-remove {
  position: relative;
  width: 30px;
  height: 30px;
  padding: 0;
  appearance: none;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, transform .15s ease;
}

.layer-remove::before,
.layer-remove::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.layer-remove::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.layer-remove:hover {
  color: var(--ink);
  background: rgba(23, 23, 22, .08);
}

.layer-remove:active {
  transform: scale(.92);
}

.layer-color-chip {
  width: 22px;
  height: 22px;
  padding: 1px;
  appearance: none;
  border: 1px solid rgba(23, 23, 22, .22);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.layer-color-chip::-webkit-color-swatch-wrapper {
  padding: 0;
}

.layer-color-chip::-webkit-color-swatch {
  border: 0;
  border-radius: 50%;
}

.layer-color-chip::-moz-color-swatch {
  border: 0;
  border-radius: 50%;
}

.layer-original-color-chip,
.original-color-icon {
  border-radius: 50%;
  background: conic-gradient(#ff48a5 0 20%, #f1df00 20% 40%, #00a846 40% 60%, #1576bd 60% 80%, #8b55ac 80% 100%);
}

.layer-original-color-chip {
  width: 24px;
  height: 24px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(23, 23, 22, .22);
}

.layer-adjustments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
  margin-top: 10px;
}

.layer-adjustments .control-row {
  padding-bottom: 5px;
}

.layer-adjustments .control-label {
  font-size: 11px;
}

.layer-rotation-row {
  grid-column: 1 / -1;
}

.layer-adjustments output {
  min-width: 32px;
}

.layer-note {
  margin-top: 11px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.layer-ink-control {
  margin-top: 13px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.layer-ink-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
}

.layer-ink-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.original-color-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.original-color-button.is-selected {
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.original-color-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.plate-badge {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 5px;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
  font-size: 10px;
}

.segment-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.segment-control label {
  position: relative;
  cursor: pointer;
}

.segment-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  opacity: 0;
}

.segment-control span {
  display: grid;
  place-items: center;
  gap: 7px;
  min-height: 66px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 650;
}

.segment-control input:checked + span {
  border-color: var(--ink);
  color: #fff;
  background: var(--ink);
}

.segment-control input:focus-visible + span {
  outline: 3px solid rgba(21, 87, 255, 0.3);
  outline-offset: 2px;
}

.texture-icon {
  width: 24px;
  height: 18px;
  opacity: .85;
  background-color: currentColor;
}

.texture-icon-dots {
  background: radial-gradient(circle, currentColor 1.6px, transparent 1.8px) 0 0 / 7px 7px;
}

.texture-icon-lines {
  background: repeating-linear-gradient(45deg, transparent 0 3px, currentColor 3px 5px);
}

.texture-icon-grid {
  background:
    linear-gradient(currentColor 1px, transparent 1px) 0 0 / 7px 7px,
    linear-gradient(90deg, currentColor 1px, transparent 1px) 0 0 / 7px 7px;
}

.control-row {
  display: grid;
  gap: 14px;
  padding: 9px 0 13px;
}

.control-row + .control-row {
  margin-top: 4px;
}

.control-hint {
  margin-top: -3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.control-label {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  font-weight: 650;
}

output {
  min-width: 44px;
  color: var(--blue);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: ew-resize;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: #d2d0c8;
}

input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7px;
  appearance: none;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: #d2d0c8;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--blue);
}

.toggle-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.toggle-row span {
  display: grid;
  gap: 3px;
}

.toggle-row strong {
  font-size: 14px;
}

.toggle-row small {
  color: var(--muted);
  font-size: 12px;
}

.toggle-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  opacity: 0;
}

.toggle-row > i {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 30px;
  background: #c9c7c0;
  transition: background .16s ease;
}

.toggle-row > i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform .16s ease;
}

.toggle-row input:checked + i {
  background: var(--blue);
}

.toggle-row input:checked + i::after {
  transform: translateX(18px);
}

.toggle-row input:focus-visible + i {
  outline: 3px solid rgba(21, 87, 255, 0.3);
  outline-offset: 3px;
}

.plate-color-picker {
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.recommended-combos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 9px;
}

.combo-button {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

.combo-button i {
  width: 15px;
  height: 15px;
  border: 1px solid rgba(23, 23, 22, .14);
  border-radius: 50%;
  background: var(--combo);
}

.combo-button i + i {
  margin-left: -4px;
}

.combo-button span {
  margin-left: 6px;
  font-size: 10px;
  font-weight: 700;
}

.combo-button:hover {
  border-color: var(--ink);
}

.plate-color-list {
  display: grid;
  gap: 8px;
}

.plate-color-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 650;
}

.plate-color-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.plate-color-head > span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plate-color-row b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
  font-size: 11px;
}

.color-field {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.color-field small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.color-field input[type="color"] {
  width: 34px;
  height: 30px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.color-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-field input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 3px;
}

.color-field output {
  min-width: 57px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.ink-swatches {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
}

.ink-swatch {
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgba(23, 23, 22, .16);
  border-radius: 50%;
  background: var(--swatch);
  cursor: pointer;
}

.ink-swatch.is-selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink);
}

.ink-swatch:focus-visible {
  outline: 3px solid rgba(21, 87, 255, 0.3);
  outline-offset: 3px;
}

.paper-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.paper-strength-row {
  margin-top: 12px;
  padding-bottom: 0;
}

.paper-options label {
  position: relative;
  cursor: pointer;
}

.paper-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  opacity: 0;
}

.paper-options span {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 650;
}

.paper-options input:checked + span {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.paper-options input:focus-visible + span {
  outline: 3px solid rgba(21, 87, 255, 0.3);
  outline-offset: 2px;
}

.paper-sample {
  width: 34px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid rgba(23, 23, 22, .12);
  border-radius: 5px;
  background-color: #faf8ef;
}

.paper-white {
  background: #fff;
}

.paper-smooth {
  background:
    radial-gradient(circle at 28% 32%, rgba(120, 100, 70, .08), transparent 42%),
    #fcf9f0;
}

.paper-fine {
  background:
    repeating-linear-gradient(12deg, transparent 0 4px, rgba(90, 80, 62, .13) 4px 4.7px),
    radial-gradient(circle at 68% 25%, rgba(112, 93, 61, .12), transparent 38%),
    #f8f4e8;
}

.paper-cotton {
  background:
    repeating-linear-gradient(17deg, transparent 0 5px, rgba(107, 100, 83, .12) 5px 5.8px, transparent 5.8px 9px),
    repeating-linear-gradient(102deg, transparent 0 8px, rgba(255, 255, 255, .8) 8px 9px),
    #f8f7f1;
}

.paper-rough {
  background:
    repeating-linear-gradient(2deg, transparent 0 5px, rgba(81, 66, 46, .12) 5px 6px),
    radial-gradient(circle at 25% 30%, rgba(72, 61, 45, .18) 0 1px, transparent 1.5px),
    radial-gradient(circle at 72% 64%, rgba(72, 61, 45, .14) 0 1.5px, transparent 2px),
    #f5f0e3;
  background-size: auto, 9px 8px, 13px 12px, auto;
}

.paper-recycled {
  background:
    repeating-linear-gradient(16deg, transparent 0 5px, rgba(80, 64, 42, .12) 5px 6px, transparent 6px 9px),
    radial-gradient(ellipse at 30% 40%, rgba(96, 73, 43, .24) 0 1px, transparent 1.4px),
    radial-gradient(ellipse at 70% 75%, rgba(95, 113, 69, .2) 0 1px, transparent 1.4px),
    #e8ddc3;
  background-size: auto, 12px 11px, 17px 15px, auto;
}

.paper-kraft {
  background:
    repeating-linear-gradient(9deg, transparent 0 4px, rgba(72, 43, 20, .15) 4px 4.8px, transparent 4.8px 8px),
    radial-gradient(circle at 22% 38%, rgba(56, 31, 13, .28) 0 1px, transparent 1.4px),
    radial-gradient(circle at 73% 61%, rgba(255, 229, 183, .18) 0 1px, transparent 1.5px),
    #c29768;
  background-size: auto, 11px 13px, 16px 14px, auto;
}

.control-actions {
  margin-top: auto;
  padding-top: 26px;
}

.reset-button {
  color: var(--blue);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

button:focus-visible,
.button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(21, 87, 255, 0.3);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow: auto;
    overscroll-behavior: auto;
  }

  .app-shell {
    width: min(100% - 24px, 720px);
    height: auto;
    display: block;
    padding-top: 16px;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .controls-panel {
    height: auto;
    border-top: 1px solid var(--line);
    border-left: 0;
    overflow-y: visible;
  }

  .canvas-stage {
    min-height: 420px;
  }

  #previewCanvas {
    max-height: none;
  }

  .control-actions {
    margin-top: 0;
  }
}

@media (max-width: 560px) {
  .masthead {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions,
  .button {
    width: 100%;
  }

  .header-actions .button {
    width: auto;
    flex: 1 1 30%;
  }

  .preview-toolbar {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .preview-tools {
    width: 100%;
    justify-content: space-between;
  }

  .canvas-stage {
    min-height: 360px;
    padding: 14px;
  }

  .preview-footer span:last-child {
    display: none;
  }

  .layer-adjustments {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: none;
  }
}
