:root {
  color-scheme: light;
  --ink: #273067;
  --muted: #5f668f;
  --line: #273067;
  --paper: #ffffff;
  --panel: #fffdf8;
  --green: #c1f0ad;
  --yellow: #ecf0a8;
  --cyan: #b1f0ee;
  --lavender: #dac5ed;
  --pink: #f0bee1;
  --accent: #273067;
  --shadow: 0 18px 50px rgba(39, 48, 103, 0.14);
  --app-header-height: 126px;
}

* {
  box-sizing: border-box;
}

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

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(39, 48, 103, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(39, 48, 103, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 16px clamp(20px, 5vw, 76px);
  border-bottom: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: fit-content;
}

.brand img {
  width: 118px;
  height: auto;
}

.header-tutorial {
  justify-self: center;
  max-width: 620px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(14px, 1.35vw, 17px);
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.app-header nav {
  justify-self: end;
  display: flex;
  gap: clamp(18px, 4vw, 42px);
  color: var(--ink);
  font-weight: 850;
}

.app-header nav a {
  border-bottom: 2px solid transparent;
}

.app-header nav a:hover {
  border-color: currentColor;
}

.app-shell {
  min-height: calc(100vh - var(--app-header-height));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: start;
}

.workspace {
  position: sticky;
  top: 0;
  display: grid;
  justify-items: center;
  align-items: start;
  height: calc(100vh - var(--app-header-height));
  min-height: calc(100vh - var(--app-header-height));
  overflow: hidden;
  padding: 36px;
  padding-top: 64px;
  background: #ffffff url("../assets/pattern.webp") center / cover no-repeat;
}

.stage {
  width: min(78vh, 78vw);
  max-width: 760px;
  min-width: 320px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

canvas.is-dragging {
  cursor: grabbing;
}

canvas.is-picking-color {
  cursor: crosshair;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: calc(100vh - var(--app-header-height));
  padding: 34px 28px;
  border-left: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: -18px 0 50px rgba(39, 48, 103, 0.08);
}

.brand-block {
  display: grid;
  gap: 8px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: 0;
}

.brand-block p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

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

.form-two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.file-drop {
  display: grid;
  gap: 5px;
  padding: 18px;
  border: 2px dashed rgba(39, 48, 103, 0.28);
  border-radius: 18px;
  background: rgba(236, 240, 168, 0.38);
  cursor: pointer;
}

.file-drop input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  opacity: 0;
}

.file-title {
  font-weight: 800;
}

.file-hint {
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.control-group,
.control-grid {
  display: grid;
  gap: 14px;
}

.control-group label,
.control-grid span,
.color-row > span:first-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

select {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(39, 48, 103, 0.2);
  border-radius: 999px;
  padding: 0 14px;
  background: white;
  color: var(--ink);
}

.number-input {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(39, 48, 103, 0.2);
  border-radius: 999px;
  padding: 0 14px;
  background: white;
  color: var(--ink);
}

.control-grid label {
  display: grid;
  gap: 8px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--ink);
}

.color-row {
  display: grid;
  grid-template-columns: 1fr 38px 92px;
  align-items: center;
  gap: 12px;
}

.background-swatch {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--selected-background, #d7d7d7);
  box-shadow: inset 0 0 0 3px white;
}

.hex-readout {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.pick-color-button {
  grid-column: 2 / 4;
  min-height: 36px;
  font-size: 13px;
}

.pick-color-button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.adjust-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(39, 48, 103, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.adjust-actions span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.adjust-actions button {
  min-height: 38px;
  padding-inline: 22px;
}

.switch-row {
  display: grid;
  gap: 10px;
  color: var(--ink);
}

.switch-row label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch-row input {
  inline-size: 18px;
  block-size: 18px;
  accent-color: var(--green);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.terms-check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid rgba(39, 48, 103, 0.2);
  border-radius: 18px;
  background: white;
}

.terms-check input {
  inline-size: 18px;
  block-size: 18px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--ink);
}

.terms-check span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.terms-check a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

button {
  min-height: 44px;
  border: 1px solid rgba(39, 48, 103, 0.22);
  border-radius: 999px;
  padding: 0 14px;
  background: white;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

button.primary {
  border-color: rgba(39, 48, 103, 0.22);
  background: var(--green);
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(39, 48, 103, 0.1);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}


.upload-note {
  margin: -10px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.upload-help {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}
.form-status {
  min-height: 22px;
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.spec-list {
  display: grid;
  gap: 12px;
  margin: auto 0 0;
  padding: 16px 0 0;
  border-top: 1px solid rgba(39, 48, 103, 0.18);
}

.spec-list div {
  display: grid;
  gap: 3px;
}

.spec-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.spec-list dd {
  margin: 0;
  line-height: 1.35;
}

.whatsapp-float {
  position: fixed;
  right: clamp(16px, 3vw, 30px);
  bottom: clamp(16px, 3vw, 30px);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 18px 8px 10px;
  border: 1px solid rgba(39, 48, 103, 0.22);
  border-radius: 999px;
  background: var(--green);
  color: var(--ink);
  box-shadow: 0 18px 42px rgba(39, 48, 103, 0.22);
  font-weight: 950;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.whatsapp-float span {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font-size: 13px;
}

.whatsapp-float svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.whatsapp-float:hover,
.whatsapp-float:focus-visible {
  transform: translateY(-3px);
  background: var(--cyan);
  box-shadow: 0 22px 48px rgba(39, 48, 103, 0.28);
}

.whatsapp-float:focus-visible {
  outline: 3px solid rgba(193, 240, 173, 0.95);
  outline-offset: 4px;
}

@media (min-width: 861px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    height: calc(100vh - var(--app-header-height));
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) 480px;
    overflow: hidden;
  }

  .workspace {
    position: relative;
    top: auto;
    height: 100%;
    min-height: 0;
  }

  .stage {
    width: min(calc(100vh - var(--app-header-height) - 96px), calc(100vw - 640px), 680px);
  }

  .panel {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (max-width: 860px) {
  :root {
    --app-header-height: 116px;
  }

  body {
    height: 100vh;
    overflow: hidden;
  }

  .app-shell {
    height: calc(100vh - var(--app-header-height));
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .workspace {
    z-index: 5;
    height: auto;
    min-height: 0;
    overflow: hidden;
    padding: 8px;
    place-items: center;
    border-bottom: 2px solid var(--line);
  }

  .stage {
    width: min(72vw, 34vh, 340px);
    min-width: 190px;
  }

  .panel {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-left: 0;
    border-top: 2px solid var(--line);
  }

  .app-header {
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    padding: 8px 22px 10px;
  }

  .brand img {
    width: 88px;
  }

  .header-tutorial {
    grid-column: 1 / -1;
    order: 3;
    font-size: 13px;
    line-height: 1.25;
  }

  .header-tutorial {
    justify-self: start;
    max-width: none;
    text-align: left;
  }

  .app-header nav {
    justify-self: end;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 15px;
  }

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

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

  .whatsapp-float {
    right: 14px;
    bottom: 14px;
    min-height: 50px;
    padding: 6px;
  }

  .whatsapp-float strong {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .whatsapp-float span {
    width: 38px;
    height: 38px;
  }
}


