:root {
  --white: #ffffff;
  --gray-strip: #f5f5f5;
  --ink: #1f2329;
  --muted: #5b6268;
  --teal: #49a2b0;
  --teal-dark: #2b7c88;
  --stroke: #cfd4d8;
}

* {
  box-sizing: border-box;
}

button,
input,
select,
textarea {
  border-radius: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--white);
}

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

.site-header {
  background: var(--white);
  border-bottom: 1px solid #dbdbdb;
}

.promo-bar {
  background: var(--teal);
  color: var(--white);
  text-align: center;
  padding: 0.9rem 1rem 0.95rem;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.header-main {
  background: var(--white);
}

.header-inner {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.6rem 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  justify-self: start;
}

.nav-link {
  border-bottom: 2px solid transparent;
  padding-bottom: 0.2rem;
  font-size: 1.05rem;
}

.nav-link.is-active {
  border-bottom-color: #202327;
}

.nav-link.is-disabled {
  color: #33393f;
  opacity: 0.82;
  cursor: default;
  pointer-events: none;
}

.logo-link {
  justify-self: center;
  display: inline-block;
}

.logo-link img {
  display: block;
  height: 108px;
  width: auto;
}

.header-spacer {
  justify-self: end;
  width: 1px;
  height: 1px;
}

.page {
  width: 100%;
  margin: 0;
  display: grid;
  gap: 0;
}

.panel,
.studio {
  padding: 1.55rem 0 1.65rem;
}

.background-panel {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.stripe-gray {
  background: var(--gray-strip);
}

.stripe-white {
  background: var(--white);
}

.panel-head,
.background-grid,
.controls-grid,
.variant-wrapper,
.placed-wrapper,
.action-panel > * {
  width: min(1180px, calc(100% - 2rem));
  margin-left: auto;
  margin-right: auto;
}

.background-panel .panel-head,
.background-panel .background-grid {
  width: 70%;
  max-width: 854px;
}

.panel-head {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.panel-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.background-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 0.7rem;
}

.background-panel .background-grid {
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 0.55rem;
}

.bg-thumb {
  border: 1px solid #c7d0d4;
  overflow: hidden;
  background: var(--white);
  cursor: pointer;
  padding: 0;
}

.bg-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.bg-thumb span {
  display: block;
  font-size: 0.79rem;
  text-align: center;
  padding: 0.38rem 0.4rem 0.43rem;
  background: var(--white);
}

.bg-thumb.is-active {
  border-color: var(--teal-dark);
  outline: 2px solid #95c3cb;
  outline-offset: -2px;
}

.upload-thumb {
  border: 1px dashed #98abb1;
  min-height: 100%;
  background: var(--white);
  display: grid;
  place-items: center;
  padding: 0.8rem 0.7rem;
  gap: 0.32rem;
  cursor: pointer;
}

.upload-thumb strong {
  width: 44px;
  height: 44px;
  border: 1px solid #97acb2;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  font-weight: 300;
  line-height: 1;
  color: #3f5158;
}

.upload-thumb span {
  font-size: 0.8rem;
  text-align: center;
}

.upload-thumb.is-active {
  border-style: solid;
  border-color: var(--teal-dark);
}

.studio {
  padding-top: 1.8rem;
  padding-bottom: 1.8rem;
}

.wall-stage {
  position: relative;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #d6dadd;
  aspect-ratio: 16 / 10;
  background: #edf1f3;
}

#wallBackground {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.letters-layer {
  position: absolute;
  inset: 0;
}

.wall-letter {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  line-height: 1;
  cursor: grab;
  transform-origin: top left;
  user-select: none;
}

.wall-letter img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.wall-letter:active {
  cursor: grabbing;
}

.wall-letter.is-selected {
  background: rgb(255 255 255 / 10%);
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
  align-items: end;
}

.field-group {
  display: grid;
  gap: 0.32rem;
}

.field-group label {
  font-size: 0.86rem;
}

select,
input[type="email"] {
  min-height: 44px;
  border: 1px solid var(--stroke);
  padding: 0 0.75rem;
  background: var(--white);
  font-size: 0.97rem;
}

.btn {
  min-height: 44px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  padding: 0.55rem 1rem;
  cursor: pointer;
}

.btn-primary {
  background: #9bb9bf;
  color: #0f1d23;
}

.btn-secondary {
  background: #5f7f89;
  color: var(--white);
}

.btn-ghost {
  background: var(--white);
  border-color: var(--stroke);
}

.btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.btn.large {
  min-height: 58px;
  min-width: min(340px, 100%);
}

.variant-wrapper {
  margin-top: 0.9rem;
}

.variant-wrapper p,
.placed-wrapper p {
  margin: 0 0 0.45rem;
  font-size: 0.86rem;
}

.variant-picker {
  min-height: 80px;
  border: 1px dashed var(--stroke);
  padding: 0.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 0.55rem;
  background: var(--white);
}

.variant-card {
  border: 1px solid #d4e0e4;
  background: #f7fafb;
  cursor: pointer;
  padding: 0.3rem;
  display: grid;
  gap: 0.2rem;
}

.variant-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.variant-card span {
  font-size: 0.7rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.variant-card.is-active {
  border-color: #48717f;
  outline: 1px solid #9ec4cd;
}

.variant-empty {
  margin: 0;
  font-size: 0.83rem;
  color: var(--muted);
}

.placed-wrapper {
  margin-top: 0.9rem;
}

.placed-letters {
  min-height: 48px;
  border: 1px dashed var(--stroke);
  padding: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  background: var(--white);
}

.placed-chip {
  border: 1px solid #ccdbe1;
  background: #f5f9fa;
  padding: 0.27rem 0.56rem;
  font-size: 0.78rem;
}

.action-panel {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
}

.email-form {
  width: min(820px, 100%);
  display: grid;
  gap: 0.45rem;
}

.email-row {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1fr auto;
}

.small-note {
  margin: 0;
  font-size: 0.79rem;
  color: var(--muted);
}

.status-message {
  margin: 0.1rem 0 0;
  font-size: 0.9rem;
  min-height: 1.4em;
}

@media (max-width: 1080px) {
  .header-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.9rem;
  }

  .main-nav {
    justify-self: center;
    flex-wrap: wrap;
    justify-content: center;
  }

  .header-spacer {
    display: none;
  }

  .controls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .background-panel .panel-head,
  .background-panel .background-grid {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  .promo-bar {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
  }

  .logo-link img {
    height: 84px;
  }

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