:root {
  --ink: #182230;
  --muted: #475467;
  --line: #b8c2d1;
  --surface: #f3f4f6;
  --panel: #ffffff;
  --accent: #ff4f12;
  --accent-dark: #d9400b;
  --blue: #0b6bcb;
  --sky: #38bdf8;
  --night: #0f172a;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background: #fafafa;
}

html,
body {
  width: 100%;
  min-width: 100%;
  overflow-x: hidden;
}

.demo-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(135deg, #cfd9df 0%, #e2ebf0 100%);
}

.demo-shell {
  display: block;
  width: 100vw;
  max-width: none;
  min-height: 100vh;
  margin: 0;
}

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

button,
input,
select {
  font: inherit;
}

button {
  min-height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.landing-page {
  min-height: 100vh;
  background: var(--night);
  color: #fff;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px clamp(18px, 4vw, 56px);
}

.brand {
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand span,
.hero-copy span {
  color: var(--sky);
}

.brand.dark {
  color: var(--ink);
}

.demo-link,
.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  padding: 0 22px;
  background: var(--sky);
  color: #020617;
  font-weight: 800;
}

.demo-link {
  min-width: 96px;
}

.landing-hero {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 120px 20px 72px;
}

.hero-copy {
  width: min(760px, 100%);
  text-align: center;
}

.hero-copy h1 {
  margin: 0 0 24px;
  color: #fff;
  font-size: clamp(44px, 6vw, 70px);
  line-height: 0.95;
  text-shadow: 0 3px 0 #000;
}

.hero-copy h2 {
  margin: 0 auto 24px;
  max-width: 640px;
  color: #fff;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.14;
  text-shadow: 0 3px 0 #000;
}

.hero-copy p {
  margin: 0 auto 6px;
  color: #f8fafc;
  font-size: 20px;
}

.contact-link {
  margin-top: 34px;
  min-width: 260px;
}

.hero-copy small {
  display: block;
  margin-top: 28px;
  color: #b6c7dc;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--night);
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid #1f2a44;
  background: #fff;
}

.login-card h1 {
  margin-top: 24px;
}

.login-card p {
  margin-bottom: 22px;
}

.topbar {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  width: 100vw;
  max-width: none;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  border-bottom: 1px solid #aab4c3;
  background: #fff;
  color: var(--ink);
}

.topbar span {
  margin-left: 10px;
  color: #cbd5e1;
}

.topbar .brand span {
  margin-left: 0;
  color: var(--sky);
}

.topbar .brand {
  color: var(--ink);
  justify-self: start;
}

.topbar nav {
  justify-content: center;
}

#logoutButton {
  justify-self: end;
  padding: 0 16px;
}

nav {
  display: flex;
  gap: 8px;
}

.tab {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 16px;
}

.tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

main {
  width: 100vw;
  max-width: none;
  padding: 24px;
}

.workspace {
  display: none;
}

.workspace.is-active {
  display: block;
}

.backend-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.subtab {
  border-bottom: 0;
  padding: 0 18px;
}

.subtab.is-active {
  border-color: var(--accent);
  background: #fff;
  color: var(--accent);
  font-weight: 800;
}

.backend-panel {
  display: none;
}

.backend-panel.is-active {
  display: block;
}

.split,
.customer-shell {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  padding: 20px;
  border: 1px solid #b8c2d1;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
}

h1,
h2 {
  margin: 0 0 14px;
}

h1 {
  font-size: 22px;
}

h2 {
  font-size: 18px;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 140px;
  margin: 20px 0 14px;
  border: 2px dashed #b8c2d1;
  background: #f8fafc;
  text-align: center;
}

.dropzone input {
  max-width: 240px;
}

output {
  display: block;
  min-height: 22px;
  margin-top: 12px;
  color: var(--muted);
}

.file-count {
  min-height: 22px;
  margin: -4px 0 14px;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.asset {
  display: grid;
  grid-template-rows: 120px auto auto;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #b8c2d1;
  background: #fff;
}

.asset img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  background: #f2f4f7;
}

.asset strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset span {
  color: var(--muted);
  font-size: 13px;
}

.empty-assets {
  display: grid;
  gap: 8px;
  min-height: 120px;
  place-items: center;
  padding: 20px;
  border: 1px dashed #98a2b3;
  background: #f8fafc;
  color: #344054;
  text-align: center;
}

.empty-assets span {
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: #101828;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #b8c2d1;
  padding: 8px 10px;
  background: #fff;
  color: #101828;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.svg-admin {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
}

.svg-picker {
  min-width: 0;
}

.svg-picker-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.svg-picker-actions button {
  min-height: 32px;
  padding: 0 12px;
}

.svg-source {
  display: grid;
  gap: 8px;
  max-width: 560px;
  margin: 0 0 16px;
  color: #101828;
  font-weight: 800;
}

.svg-tree {
  overflow: auto;
  max-height: 650px;
  border: 1px solid #98a2b3;
  background: #fff;
  padding: 12px;
  font-family: Consolas, monospace;
  font-size: 13px;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  border-bottom: 1px solid #e4e7ec;
  color: #101828;
}

.tree-group.is-selected {
  background: #fff7ed;
}

.tree-toggle {
  display: inline-grid;
  place-items: center;
  width: 24px;
  min-height: 24px;
  border: 1px solid #98a2b3;
  background: #f2f4f7;
  font-weight: 800;
}

.tree-toggle:disabled {
  color: transparent;
  cursor: default;
}

.tree-select {
  color: #101828;
  min-height: 24px;
  border: 0;
  background: transparent;
  font-family: Consolas, monospace;
  text-align: left;
}

.tree-group.is-selected .tree-select {
  color: var(--accent);
  font-weight: 800;
}

.tree-row input[type="color"] {
  width: 32px;
  min-height: 26px;
  padding: 0;
}

.tree-check {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.shirt-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid #b8c2d1;
  background: #fff;
}

.shirt-frame.large {
  min-height: 680px;
}

.selected-snippet {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.snippet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.snippet-actions button {
  min-height: 30px;
  padding: 0 10px;
}

.selected-snippet-preview {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px solid #b8c2d1;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #eef1f5 25%, transparent 25%),
    linear-gradient(-45deg, #eef1f5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef1f5 75%),
    linear-gradient(-45deg, transparent 75%, #eef1f5 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.selected-snippet-preview svg {
  width: 100%;
  max-height: 520px;
}

.design-builder {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #b8c2d1;
  background: #f8fafc;
}

.design-list {
  display: grid;
  gap: 8px;
}

.design-row {
  display: grid;
  grid-template-columns: 48px minmax(160px, 1fr) minmax(220px, auto) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid #b8c2d1;
  background: #fff;
}

.design-row.is-active {
  border-color: var(--accent);
  background: #fff7ed;
}

.design-row small {
  color: var(--muted);
}

.design-row button {
  min-height: 32px;
  padding: 0 12px;
}

.design-builder h3 {
  margin: 0;
  font-size: 18px;
}

.design-builder-head {
  display: grid;
  grid-template-columns: auto minmax(180px, 280px);
  gap: 12px;
  align-items: center;
}

.design-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.design-actions button {
  min-height: 32px;
  padding: 0 12px;
}

.design-snippets {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.code-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
}

.design-code {
  min-height: 260px;
  color: #d92d20;
  background: #fff;
}

.section-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 38px;
  margin-top: 6px;
  padding: 8px;
  border: 1px dashed #98a2b3;
  background: #fff;
  color: #475467;
}

.section-list span {
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #b8c2d1;
  background: #eef1f5;
  padding: 4px 7px;
  color: #101828;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-snippet textarea,
.snippet-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  padding: 10px;
  font-family: Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}

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

.snippet-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.snippet-heading button {
  min-height: 32px;
  padding: 0 12px;
}

.shirt-layer,
.shadow-layer,
.badge-layer,
.text-layer {
  position: absolute;
  inset: 4%;
  width: 92%;
  height: 92%;
  object-fit: contain;
}

.shirt-layer svg {
  width: 100%;
  height: 100%;
  display: block;
}

.shadow-layer {
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.74;
}

.badge-layer {
  inset: 29% auto auto 36%;
  width: 11%;
  height: auto;
  z-index: 4;
}

.text-layer {
  inset: auto auto 20% 50%;
  width: auto;
  height: auto;
  transform: translateX(-50%);
  z-index: 4;
  color: #111827;
  text-align: center;
  font-weight: 900;
  letter-spacing: 0;
}

.text-layer strong {
  display: block;
  font-size: 42px;
  line-height: 1;
}

.text-layer span {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.view-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.view-actions .is-selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.customizer {
  min-width: 0;
}

.steps {
  display: flex;
  align-items: end;
  gap: 4px;
  min-height: 44px;
}

.step {
  border: 0;
  background: transparent;
  padding: 0 18px;
  font-weight: 700;
  text-transform: uppercase;
}

.step.is-current {
  background: #e4e7ec;
  color: var(--accent);
}

.control-panel {
  padding: 22px;
  background: #d9dee7;
  color: #101828;
}

.control-panel h1,
.control-panel label,
.control-panel .step {
  color: #101828;
}

.colour-controls {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.colour-control {
  display: grid;
  grid-template-columns: 170px 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid #667085;
  background: #fff;
  color: #101828;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.swatch {
  width: 24px;
  height: 24px;
  min-height: 24px;
  border: 1px solid #344054;
}

.extras {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

@media (max-width: 980px) {
  .topbar,
  .split,
  .customer-shell,
  .svg-admin,
  .form-grid,
  .extras,
  .snippet-grid,
  .code-editor-grid,
  .design-builder-head,
  .design-snippets {
    grid-template-columns: 1fr;
  }

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

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  nav {
    overflow-x: auto;
  }

  main {
    padding: 14px;
  }

  .shirt-frame,
  .shirt-frame.large {
    min-height: 520px;
  }

  #logoutButton,
  .topbar nav {
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 18px;
  }

  .hero-copy p {
    font-size: 17px;
  }

  .contact-link {
    width: 100%;
    min-width: 0;
  }
}
