:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  background: #f5f6f4;
  color: #1c211e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 20px;
  min-height: 100vh;
  padding: 20px;
}

.tool,
.preview-panel {
  background: #ffffff;
  border: 1px solid #dfe4dc;
  border-radius: 8px;
  box-shadow: 0 14px 40px rgba(44, 55, 45, 0.08);
}

.tool {
  align-self: start;
  display: grid;
  gap: 18px;
  padding: 20px;
  position: sticky;
  top: 20px;
}

.topbar,
.preview-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  color: #f36f21;
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 4px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.08;
}

h2 {
  font-size: 18px;
}

.primary {
  background: #f36f21;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 800;
  min-height: 44px;
  padding: 0 18px;
}

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

.drop-zone {
  align-items: center;
  border: 2px dashed #b8c2b5;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  min-height: 180px;
  padding: 20px;
  position: relative;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop-zone.is-dragging {
  background: #fff7f0;
  border-color: #f36f21;
}

.drop-zone input {
  cursor: pointer;
  inset: 0;
  opacity: 0;
  position: absolute;
}

.drop-copy {
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.drop-copy strong {
  font-size: 18px;
}

.drop-copy span,
.summary span,
.slice-card span,
#status {
  color: #6d766c;
  font-size: 13px;
}

.controls {
  display: grid;
  gap: 12px;
}

.controls label {
  display: grid;
  gap: 6px;
}

.controls label span {
  color: #465046;
  font-size: 13px;
  font-weight: 700;
}

.controls input,
.controls select {
  border: 1px solid #cfd7cc;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 12px;
  width: 100%;
}

.summary {
  display: grid;
  gap: 10px;
}

.summary div {
  align-items: center;
  background: #f7f8f6;
  border: 1px solid #e4e8e1;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 12px;
}

.preview-panel {
  min-width: 0;
  padding: 18px;
}

.preview-head {
  border-bottom: 1px solid #e5e9e2;
  margin-bottom: 16px;
  padding-bottom: 14px;
}

.preview {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.slice-card {
  background: #fbfcfa;
  border: 1px solid #dfe5dc;
  border-radius: 8px;
  overflow: hidden;
}

.slice-card canvas {
  background: #ecefeb;
  display: block;
  height: auto;
  width: 100%;
}

.slice-card div {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.slice-card strong {
  font-size: 14px;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .tool {
    position: static;
  }
}
