:root {
  color-scheme: light;
  --ink: #1e2328;
  --muted: #68727d;
  --line: #d8dee5;
  --paper: #f6f7f2;
  --surface: #ffffff;
  --accent: #236a79;
  --accent-2: #8b5e34;
  --steel: #6f7f8d;
  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: var(--paper);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.app {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(420px, 1fr);
  grid-template-rows: minmax(480px, 1fr) auto;
  gap: 14px;
  min-height: 100vh;
  padding: 14px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(31, 37, 43, 0.08);
}

.controls {
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
}

.brand,
.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.15;
}

h2 {
  font-size: 1rem;
  line-height: 1.2;
}

p,
.section-title span,
small,
.hint {
  color: var(--muted);
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  cursor: pointer;
  font-size: 1.2rem;
}

.control-grid {
  display: grid;
  gap: 12px;
}

.control-grid label {
  display: grid;
  grid-template-columns: 1fr 112px 34px;
  align-items: center;
  gap: 10px;
}

input[type="number"] {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 9px;
  color: var(--ink);
  background: #fff;
}

.slider-label {
  display: grid;
  gap: 10px;
}

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

.toggles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  color: var(--ink);
}

.toggles label {
  display: flex;
  gap: 9px;
  align-items: center;
}

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

.actions button {
  border: 0;
  border-radius: 8px;
  padding: 11px 12px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.actions button + button {
  background: var(--accent-2);
}

.readout {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px 12px;
  margin: 12px 0 0;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  font-weight: 750;
  text-align: right;
}

.stage {
  position: relative;
  min-height: 480px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(226, 231, 225, 0.7)),
    radial-gradient(circle at 80% 12%, rgba(35, 106, 121, 0.12), transparent 32%);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 480px;
  cursor: grab;
}

canvas:active {
  cursor: grabbing;
}

.hint {
  position: absolute;
  right: 14px;
  bottom: 12px;
  font-size: 0.88rem;
  pointer-events: none;
}

.cut-panel {
  padding: 16px;
}

table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.94rem;
}

th,
td {
  border-top: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th:nth-child(1),
td:nth-child(1),
th:nth-child(3),
td:nth-child(3) {
  width: 72px;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(460px, 58vh) auto;
  }

  .controls {
    grid-row: auto;
  }
}

@media (max-width: 520px) {
  .app {
    padding: 8px;
  }

  .control-grid label {
    grid-template-columns: 1fr 96px 28px;
  }

  table {
    font-size: 0.86rem;
  }
}
