:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #68707a;
  --line: #d6dce2;
  --paper: #ffffff;
  --surface: #f2f5f7;
  --panel: #fbfcfd;
  --accent: #006d77;
  --accent-ink: #ffffff;
}

* {
  box-sizing: border-box;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  min-height: 100vh;
}

.panel {
  height: 100vh;
  overflow: auto;
  padding: 22px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

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

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

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.12;
}

h2 {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #39434d;
}

h3 {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
}

p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.control-section {
  display: grid;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.two-col {
  grid-template-columns: 1fr 1fr;
}

label {
  display: grid;
  gap: 7px;
  color: #43505c;
  font-size: 12px;
  font-weight: 700;
}

.hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.hint.multiline,
.hint.multiline span {
  display: block;
}

.hint strong {
  color: #43505c;
  font-weight: 700;
}

.hidden {
  display: none;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #c7d0d8;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

input[type="color"] {
  padding: 3px;
}

input[type="file"] {
  min-height: auto;
  padding: 8px;
}

.file-control {
  display: grid;
  grid-template-columns: 1fr 38px;
  gap: 8px;
  align-items: center;
}

.trash-button {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
}

.trash-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

textarea {
  resize: vertical;
  line-height: 1.35;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}

.checkbox.hidden {
  display: none;
}

.checkbox input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.option-stack {
  display: grid;
  gap: 8px;
}

.logo-options {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

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

.label-set-field.hidden {
  display: none;
}

.mini-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mini-actions button {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

button {
  min-height: 40px;
  border: 1px solid #aeb9c2;
  border-radius: 6px;
  padding: 8px 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  border-color: #7d8a95;
}

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

.preview-wrap {
  min-width: 0;
  height: 100vh;
  overflow: auto;
  padding: 24px;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  max-width: 900px;
  margin: 0 auto 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.sheet-host {
  width: min(100%, 900px);
  margin: 0 auto;
}

.sheet-host svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--paper);
  box-shadow: 0 18px 60px rgba(31, 41, 55, 0.18);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 10px 24px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.site-footer a {
  color: var(--accent);
  font-weight: 700;
}

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

  .panel {
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .preview-wrap {
    height: auto;
    padding: 16px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  body {
    background: #fff;
  }

  .panel,
  .preview-toolbar,
  .site-footer {
    display: none;
  }

  .app-shell {
    display: block;
  }

  .preview-wrap {
    height: auto;
    overflow: visible;
    padding: 0;
  }

  .sheet-host {
    width: 210mm;
    height: 297mm;
    margin: 0;
  }

  .sheet-host svg {
    width: 210mm;
    height: 297mm;
    box-shadow: none;
  }
}
