:root {
  --navy: #062a4d;
  --navy-2: #0b3765;
  --gold: #c8942d;
  --green: #087f69;
  --ink: #111827;
  --muted: #667085;
  --line: #d7dde7;
  --panel: #ffffff;
  --bg: #f3f6fb;
  --soft: #eaf0f8;
  --danger: #a74333;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 10%, rgba(200, 148, 45, 0.12), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #eef3f9 100%);
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px clamp(14px, 3vw, 28px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 260px;
}

.brand img {
  display: block;
  width: clamp(210px, 22vw, 330px);
  height: 58px;
  object-fit: contain;
  object-position: left center;
}

.nav {
  flex: 1;
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: 6px;
  border-radius: 999px;
  background: #e9edf5;
}

.nav button,
.icon-btn,
.primary,
.secondary,
.ghost,
.danger {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.nav button {
  padding: 0 20px;
  color: var(--navy);
  background: transparent;
}

.nav button.active {
  color: #0585d5;
  background: #fff;
  box-shadow: 0 8px 24px rgba(6, 42, 77, 0.12);
}

.sync-pill {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  background: #fff;
  white-space: nowrap;
}

.page {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 22px clamp(14px, 3vw, 28px) 42px;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 22px;
}

.hero-panel,
.panel,
.card,
.tool-panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(6, 42, 77, 0.08);
}

.hero-panel {
  padding: clamp(22px, 4vw, 44px);
  overflow: hidden;
}

.eyebrow {
  color: var(--gold);
  font-weight: 900;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  font-size: 12px;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--navy);
  letter-spacing: 0;
}

h1 {
  margin-top: 10px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 0.96;
}

h2 {
  font-size: clamp(24px, 3vw, 34px);
}

h3 {
  font-size: 19px;
}

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

.hero-actions,
.row,
.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary,
.secondary,
.ghost,
.danger {
  padding: 0 16px;
}

.primary {
  color: #fff;
  background: var(--green);
}

.secondary {
  color: #fff;
  background: var(--navy);
}

.ghost {
  color: var(--navy);
  background: var(--soft);
}

.danger {
  color: #fff;
  background: var(--danger);
}

.icon-btn {
  width: 44px;
  color: var(--navy);
  border: 1px solid var(--line);
  background: #fff;
}

.visual-card {
  position: relative;
  min-height: 330px;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(6, 42, 77, 0.1), transparent),
    #fff;
}

.wall-preview {
  position: absolute;
  inset: 26px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 0 14%, rgba(7, 127, 105, 0.18) 14% 28%, transparent 28% 42%, rgba(200, 148, 45, 0.35) 42% 55%, transparent 55% 70%, rgba(6, 42, 77, 0.12) 70% 86%, transparent 86%),
    #f9fafb;
}

.wall-preview::before {
  content: "";
  position: absolute;
  left: 12%;
  top: 38%;
  width: 36%;
  height: 46%;
  border: 28px solid #0e9481;
  border-bottom: 0;
  border-radius: 220px 220px 0 0;
}

.wall-preview::after {
  content: "";
  position: absolute;
  right: 11%;
  top: 18%;
  width: 30%;
  height: 52%;
  border-radius: 220px 220px 0 0;
  background: #f1c7aa;
}

.stats-grid,
.quick-grid,
.project-grid,
.colour-grid,
.inspiration-grid {
  display: grid;
  gap: 14px;
}

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

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

.stat,
.quick-action,
.project-card,
.inspiration,
.colour-card {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.project-card {
  display: grid;
  gap: 12px;
}

.project-card.active {
  border-color: var(--gold);
  box-shadow: inset 4px 0 0 var(--gold);
}

.project-select {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.project-delete {
  justify-self: start;
}

.project-chooser {
  border-color: rgba(200, 148, 45, 0.55);
}

.project-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.project-choice {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  background: #fff;
  text-align: left;
}

.project-choice.active {
  border-color: var(--gold);
  box-shadow: inset 4px 0 0 var(--gold);
}

.project-choice strong,
.project-choice span {
  display: block;
}

.project-choice span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  color: var(--navy);
  font-size: 28px;
}

.quick-action {
  min-height: 280px;
  padding: 0;
  text-align: left;
  overflow: hidden;
}

.feature-card {
  display: grid;
  grid-template-rows: 170px auto;
  width: 100%;
}

.feature-art {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.feature-art span,
.feature-art::before,
.feature-art::after {
  content: "";
  position: absolute;
  display: block;
}

.feature-art-visualizer {
  background:
    linear-gradient(90deg, rgba(8, 127, 105, 0.16), transparent 38%),
    #eef3ed;
}

.feature-art-visualizer::before {
  left: 10%;
  bottom: 0;
  width: 34%;
  height: 68%;
  border-radius: 180px 180px 0 0;
  background: #0b3765;
}

.feature-art-visualizer::after {
  right: 12%;
  bottom: 0;
  width: 36%;
  height: 78%;
  border-radius: 190px 190px 0 0;
  background: #c96d4e;
}

.feature-art-visualizer span {
  left: 42%;
  bottom: 0;
  width: 16%;
  height: 92%;
  background: #0e9481;
}

.feature-art-finder {
  background:
    linear-gradient(90deg, rgba(200, 148, 45, 0.18), transparent 32%),
    #f3dfc9;
}

.feature-art-finder::before {
  left: 18%;
  top: 48%;
  width: 42%;
  height: 30%;
  border-radius: 999px;
  background: #fff;
}

.feature-art-finder::after {
  right: 12%;
  top: 16%;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(200, 148, 45, 0.55);
}

.feature-art-matching {
  background:
    linear-gradient(180deg, #b8c7a2 0 45%, #607637 45% 100%);
}

.feature-art-matching::before {
  left: 10%;
  bottom: 34%;
  width: 21%;
  height: 30%;
  border-radius: 90px 90px 8px 8px;
  background: #fff;
}

.feature-art-matching::after {
  right: 10%;
  top: 20%;
  width: 34%;
  height: 20%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.feature-art-projects {
  background:
    linear-gradient(135deg, #ede9dc 0 34%, #b8c1b1 34% 52%, #1f2528 52% 68%, #6d533e 68% 100%);
}

.feature-art-projects::before {
  left: 11%;
  bottom: 18%;
  width: 26%;
  height: 24%;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.feature-art-projects::after {
  right: 10%;
  top: 12%;
  width: 20%;
  height: 58%;
  border-radius: 8px;
  background: rgba(200, 148, 45, 0.82);
}

.feature-copy {
  padding: 16px;
}

.feature-copy h3 {
  font-size: 24px;
}

.feature-copy p {
  margin-bottom: 0;
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.notice {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(200, 148, 45, 0.5);
  border-radius: 8px;
  color: var(--navy);
  background: rgba(200, 148, 45, 0.12);
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

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

textarea {
  min-height: 96px;
  resize: vertical;
}

.searchbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--navy);
  background: #fff;
  font-weight: 800;
}

.chip.active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.colour-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  max-height: 660px;
  overflow: auto;
  padding-right: 4px;
}

.colour-card {
  text-align: left;
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.colour-card.active {
  outline: 3px solid var(--gold);
}

.swatch {
  height: 86px;
  border-bottom: 1px solid var(--line);
}

.colour-meta {
  padding: 12px;
}

.colour-meta strong,
.project-card strong {
  display: block;
  color: var(--navy);
}

.colour-meta span,
.project-card span,
.small {
  color: var(--muted);
  font-size: 13px;
}

.studio-layout {
  display: grid;
  grid-template-columns: minmax(250px, 330px) 1fr;
  gap: 16px;
  align-items: start;
}

.tool-panel {
  padding: 14px;
}

.photo-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  align-items: center;
}

.photo-tab {
  display: grid;
  grid-template-columns: 58px minmax(70px, 120px);
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  background: #fff;
  font-weight: 800;
  text-align: left;
}

.photo-tab.active {
  border-color: var(--gold);
  box-shadow: inset 4px 0 0 var(--gold);
}

.photo-tab img {
  width: 58px;
  height: 46px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--soft);
}

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

.tool-grid button {
  min-height: 46px;
}

.canvas-shell {
  position: relative;
  min-height: 560px;
  background: #182535;
  border-radius: 8px;
  overflow: auto;
  border: 1px solid var(--line);
}

.canvas-shell.can-pan canvas {
  cursor: grab;
}

.canvas-shell.can-pan canvas:active {
  cursor: grabbing;
}

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

.zoom-table {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  display: grid;
  grid-template-columns: 44px minmax(58px, auto) 44px auto;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(215, 221, 231, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(6, 42, 77, 0.14);
}

.zoom-table strong {
  color: var(--navy);
  text-align: center;
  white-space: nowrap;
}

.connection-prompt {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 7;
  width: min(360px, calc(100% - 28px));
  padding: 14px;
  border: 1px solid rgba(200, 148, 45, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(6, 42, 77, 0.2);
  transform: translateX(-50%);
}

.connection-prompt strong {
  display: block;
  margin-bottom: 10px;
  color: var(--navy);
}

.canvas-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  color: #fff;
  text-align: center;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(200, 148, 45, 0.22), transparent 48%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07), transparent);
}

.layer-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.layer-btn {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  color: var(--navy);
  background: #fff;
}

.layer-btn.active {
  border-color: var(--gold);
  box-shadow: inset 4px 0 0 var(--gold);
}

.match-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 16px;
}

.match-canvas-wrap {
  min-height: 360px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  overflow: hidden;
}

.match-canvas-wrap canvas {
  max-height: 620px;
}

.result-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.result-swatch {
  height: 120px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.hidden {
  display: none !important;
}

@media (max-width: 920px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .brand {
    min-width: 0;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .nav button {
    white-space: nowrap;
  }

  .hero,
  .studio-layout,
  .match-layout,
  .form-grid,
  .stats-grid,
  .quick-grid,
  .project-grid,
  .inspiration-grid {
    grid-template-columns: 1fr;
  }

  .visual-card {
    min-height: 250px;
  }
}

@media (max-width: 560px) {
  .brand img {
    width: 210px;
    height: 50px;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }
}
