:root {
  --ink: #242220;
  --ink-deep: #1d1107;
  --paper: #f4f2ed;
  --brown: #26180d;
  --lime: #d8fc3b;
  --blue: #2f4fff;
  --muted: rgba(36, 34, 32, 0.58);
  --line: rgba(36, 34, 32, 0.12);
  --surface: #fff;
  --font-sans: "Inter", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-display: "Newsreader", "Noto Serif SC", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font-sans);
  color: var(--ink);
  background: #ebe7df;
}

.wb {
  display: grid;
  grid-template-columns: minmax(340px, 40%) 1fr;
  height: 100vh;
}

.wb-form {
  overflow: auto;
  padding: 20px 20px 40px;
  background: var(--paper);
  border-right: 1px solid var(--line);
}

.wb-preview {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #d9d4ca;
}

.wb-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--brown);
  color: #f1e8c7;
  font-family: var(--font-mono);
  font-size: 12px;
}

.wb-preview iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
}

.wb-brand {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 4px;
}

.wb-sub {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 18px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px 10px;
  margin-bottom: 12px;
}

.panel h2 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 500;
}

.field {
  margin-bottom: 10px;
}

.field label {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--ink-deep);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  background: #fff;
}

.field textarea { min-height: 56px; resize: vertical; }

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pkg-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pkg-options label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  font-size: 13px;
}

.pkg-options label:has(input:checked) {
  border-color: var(--blue);
  background: rgba(47, 79, 255, 0.06);
}

.pkg-options small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 8px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

button, .btn {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.btn-primary {
  background: var(--lime);
  color: var(--ink-deep);
  font-weight: 600;
}

.btn-dark {
  background: var(--brown);
  color: #f1e8c7;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.hint {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 8px;
}

.hint code {
  font-size: 10px;
}

.qr-preview {
  margin-top: 8px;
  width: 120px;
  height: 120px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: #faf8f4;
}

.qr-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.qr-slot {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  padding: 8px;
  box-sizing: border-box;
}

.custom-line {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
}

.hidden { display: none !important; }

.status {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

@media (max-width: 960px) {
  .wb {
    grid-template-columns: 1fr;
    height: auto;
  }
  .wb-preview {
    min-height: 70vh;
  }
}
