:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: #eef2f6;
  color: #172033;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

.shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.panel {
  background: #ffffff;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(23, 32, 51, 0.08);
}

.brand-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.top-actions a {
  color: #1456d9;
  font-weight: 700;
  text-decoration: none;
}

.logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

h1 {
  margin: 0 0 4px;
  font-size: 28px;
  line-height: 1.15;
}

p {
  margin: 0;
  color: #607086;
}

form {
  display: grid;
  gap: 16px;
}

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

label,
fieldset {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 650;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #bdc8d6;
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 450;
  color: #172033;
  background: #ffffff;
}

select {
  min-height: 43px;
}

textarea {
  resize: vertical;
}

fieldset {
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  padding: 14px;
}

legend {
  padding: 0 6px;
  color: #344158;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
}

.radio-row input {
  width: auto;
}

.dropzone {
  border: 1px dashed #8fa0b6;
  border-radius: 8px;
  padding: 18px;
  background: #f8fafc;
}

.dropzone span {
  font-size: 16px;
}

.dropzone small {
  color: #607086;
  font-weight: 450;
}

button {
  justify-self: start;
  border: 0;
  border-radius: 6px;
  padding: 11px 18px;
  background: #1456d9;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #0e46b5;
}

.button-link {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 11px 18px;
  background: #eef2f6;
  color: #172033;
  font-weight: 700;
  text-decoration: none;
}

.steps {
  display: flex;
  gap: 8px;
  margin: 6px 0 18px;
}

.steps span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid #bdc8d6;
  color: #607086;
  font-weight: 800;
}

.steps .active {
  border-color: #1456d9;
  background: #1456d9;
  color: #ffffff;
}

.wide {
  width: min(1080px, calc(100% - 32px));
}

.canvas-wrap {
  overflow: auto;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  background: #f8fafc;
  max-height: 72vh;
}

canvas {
  display: block;
  max-width: 100%;
  height: auto;
  touch-action: none;
  background: #ffffff;
}

.preview-only img {
  display: block;
  max-width: 100%;
  height: auto;
}

.overlap-preview {
  position: relative;
  width: fit-content;
  max-width: 100%;
}

.overwrite-box {
  position: absolute;
  border: 3px solid #dc2626;
  background: rgba(220, 38, 38, 0.16);
  box-shadow: 0 0 0 9999px rgba(17, 24, 39, 0.06);
  pointer-events: none;
}

.overwrite-box span {
  position: absolute;
  left: 0;
  top: -28px;
  white-space: nowrap;
  border-radius: 4px;
  background: #dc2626;
  color: #ffffff;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 800;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.toolbar button {
  justify-self: auto;
}

.download-frame {
  width: 1px;
  height: 1px;
  border: 0;
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.alert {
  margin-bottom: 16px;
  border: 1px solid #f2b8b5;
  background: #fff1f0;
  color: #9b1c1c;
  border-radius: 8px;
  padding: 11px 12px;
}

.notice {
  margin-bottom: 16px;
  border: 1px solid #f1d08a;
  background: #fff8e6;
  color: #73510b;
  border-radius: 8px;
  padding: 11px 12px;
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 920px);
    padding: 10px 0;
  }

  .panel {
    padding: 18px;
  }

  .brand-row,
  .grid {
    grid-template-columns: 1fr;
  }

  .brand-row {
    align-items: flex-start;
  }

  h1 {
    font-size: 23px;
  }
}
