:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --panel: #ffffff;
  --ink: #181b1f;
  --muted: #667079;
  --line: #d5dadd;
  --accent: #1f8a70;
  --accent-dark: #146a56;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, sans-serif;
}

.shell {
  display: grid;
  grid-template-columns: minmax(360px, 460px) minmax(420px, 1fr);
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.previewPane,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.previewPane {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 22px;
  overflow: auto;
}

.sticker {
  position: relative;
  width: 384px;
  height: 800px;
  background: #fff;
  border: 1px solid #111;
  color: #111;
  font-family: Arial, sans-serif;
  overflow: hidden;
}

.layoutBlock {
  position: absolute;
  overflow: hidden;
  cursor: move;
  touch-action: none;
  user-select: none;
}

.layoutBlock.selected {
  outline: 3px solid #e22;
  outline-offset: -3px;
}

.stickerHeader {
  border-radius: 12px;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.dishBox {
  border: 2px solid #111;
}

.dishTitle {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-bottom: 2px solid #111;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
}

.orderRow {
  display: grid;
  grid-template-columns: 1fr 78px;
  min-height: 146px;
}

.orderNumber,
.orderType {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.orderNumber {
  font-size: 68px;
}

.orderType {
  border-left: 2px solid #111;
  font-size: 48px;
}

.composition {
  padding: 0;
  font-size: 13px;
  line-height: 1.22;
}

.mediaSlot {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  height: 206px;
  padding: 12px 18px;
}

.mediaSlot img {
  display: none;
  max-width: 145px;
  max-height: 145px;
  object-fit: contain;
}

.mediaSlot img.visible {
  display: block;
}

.footer {
  display: flex;
  justify-content: space-between;
  padding: 0;
  font-size: 19px;
  font-weight: 700;
}

.footer div {
  display: flex;
  flex-direction: column;
}

.footer div:last-child {
  text-align: right;
}

.panel {
  padding: 22px;
}

.panelHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

p {
  margin: 0;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  font-weight: 700;
}

.field.compact {
  margin-bottom: 14px;
}

input[type="text"],
.field input,
.field select,
.constructor input,
.constructor select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  font-size: 18px;
  background: #fff;
}

.constructor {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  margin: 18px 0;
}

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

.hint {
  margin: -4px 0 14px;
  color: var(--muted);
}

h2 {
  margin: 0;
  font-size: 20px;
}

.paperGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.paperGrid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.buttonRow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

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

.checkGrid label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}

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

.assetBox {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

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

.assetTitle label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

input[type="file"] {
  width: 100%;
  margin-bottom: 12px;
}

.assetPreview {
  height: 150px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
}

.assetPreview img {
  display: none;
  max-width: 130px;
  max-height: 130px;
  object-fit: contain;
}

.assetPreview img.visible {
  display: block;
}

button {
  height: 42px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 16px;
  font-size: 16px;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

.primary {
  min-width: 150px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.ghost {
  height: 32px;
  padding: 0 10px;
  color: var(--muted);
}

.settingsNote {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.settingsNote div {
  display: grid;
  gap: 6px;
}

.settingsNote span {
  color: var(--muted);
  font-size: 14px;
}

code {
  display: inline-block;
  overflow-wrap: anywhere;
  border-radius: 6px;
  background: #eef2f1;
  padding: 8px 10px;
  font-family: Consolas, monospace;
  color: #0f2c25;
}

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

  .paperGrid,
  .assetGrid {
    grid-template-columns: 1fr;
  }
}
