:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #202421;
  --muted: #68716a;
  --line: #d8ddd4;
  --accent: #1f6f5b;
  --accent-2: #9b3f2f;
  --tile: #eef1ed;
  --shadow: 0 18px 55px rgba(33, 42, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.workspace {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.upload-button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.upload-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.tool-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 580px;
}

.controls {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #fbfbf8;
}

.controls label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.controls span {
  color: var(--ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

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

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

.button-row button:first-child {
  background: var(--surface);
  color: var(--ink);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.preview-grid article {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.preview-grid article + article {
  border-left: 1px solid var(--line);
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.preview-header span {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
  background-color: var(--tile);
  background-image:
    linear-gradient(45deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.04) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.notes article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.notes p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 880px) {
  .tool-layout,
  .preview-grid,
  .notes {
    grid-template-columns: 1fr;
  }

  .controls,
  .preview-grid article + article {
    border-right: 0;
    border-left: 0;
  }

  .preview-grid article + article {
    border-top: 1px solid var(--line);
  }

  canvas {
    min-height: 360px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 10px;
  }

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

  h1 {
    font-size: 24px;
  }
}

