[hidden]{display:none!important}
:root {
  --teal: #0f5c63;
  --teal-d: #0a454a;
  --mint: #e3f1ef;
  --sand: #f6f2ec;
  --ink: #1d2a2e;
  --mute: #5b6b70;
  --line: #dce3e2;
  --r: 12px;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  background: var(--sand);
  color: var(--ink);
  font:
    15px/1.5 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
h1,
h2 {
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.4em;
}
h1 {
  font-size: 1.7rem;
}
h2 {
  font-size: 1.2rem;
}
p {
  margin: 0 0 0.8em;
}
.muted {
  color: var(--mute);
}
.small {
  font-size: 0.86rem;
}
.test-strip {
  background: #f2c14e;
  color: #1d2a2e;
  font-weight: 600;
  font-size: 12px;
  text-align: center;
  padding: 4px 10px;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding-top: max(8px, env(safe-area-inset-top));
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.04em;
  text-decoration: none;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  border: 2px solid var(--teal);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
}
.btn:hover {
  background: var(--teal-d);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn--ghost {
  background: #fff;
  color: var(--teal);
}
.btn--ghost:hover {
  background: var(--mint);
}
.btn--sm {
  min-height: 40px;
  padding: 6px 14px;
  font-size: 0.9rem;
}
.app {
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}
.stage {
  background: #22302f;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 46vh;
}
.empty {
  background: var(--sand);
  width: 100%;
  align-self: stretch;
  padding: 28px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.empty__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 8px 0 18px;
}
.samples {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.samples button {
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: none;
  width: 84px;
  height: 120px;
}
.samples button:hover,
.samples button:focus-visible {
  border-color: var(--teal);
}
.samples img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.resume {
  margin-top: 22px;
  background: #fff;
  border-radius: var(--r);
  padding: 14px 18px;
}
.resume .btn {
  margin: 0 4px;
}
.canvas-wrap {
  position: relative;
  max-width: 100%;
  line-height: 0;
  touch-action: none;
}
#view {
  display: block;
  max-width: 100vw;
  max-height: 58vh;
  width: auto;
  height: auto;
}
.handles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.handle {
  position: absolute;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  display: grid;
  place-items: center;
}
.handle::after {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--teal);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.handle.glass::after {
  border-color: #3ba7b5;
}
.busy {
  position: absolute;
  inset: 0;
  background: rgba(15, 40, 42, 0.55);
  display: grid;
  place-content: center;
  justify-items: center;
  color: #fff;
  line-height: 1.4;
  gap: 10px;
  font-weight: 600;
}
.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.panel {
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.steps {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.steps button {
  flex: 1 0 auto;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 10px 10px 8px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mute);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 64px;
}
.steps button span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink);
  font-size: 0.8rem;
}
.steps button.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}
.steps button.active span {
  background: var(--teal);
  color: #fff;
}
.pane {
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  margin: 6px 0 12px;
}
.row input[type="range"] {
  flex: 1;
  accent-color: var(--teal);
}
.btnrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}
.next {
  margin-top: 14px;
  width: 100%;
}
.field {
  display: grid;
  gap: 5px;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 0 12px;
}
.field input,
.field select {
  font: inherit;
  font-weight: 400;
  min-height: 44px;
  padding: 8px 10px;
  border: 1.5px solid #b9c6c5;
  border-radius: 10px;
  background: #fff;
  width: 100%;
  color: var(--ink);
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 4px 0 10px;
}
.tabs button {
  border: 1.5px solid #b9c6c5;
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
}
.tabs button.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chips button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 1.5px solid #b9c6c5;
  background: #fff;
  border-radius: 10px;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  min-width: 62px;
}
.chips button svg {
  width: 36px;
  height: 24px;
}
.chips button.active {
  border-color: var(--teal);
  background: var(--mint);
  color: var(--teal);
}
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.swatches button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  padding: 0;
}
.swatches--sm button {
  width: 28px;
  height: 28px;
}
.swatches button.active {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}
.warn {
  background: #fff4d6;
  color: #6b4f00;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.86rem;
}
.calc {
  background: var(--mint);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.88rem;
}
.items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.items button {
  border: 1.5px solid #b9c6c5;
  background: #fff;
  border-radius: 10px;
  padding: 6px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.items img {
  height: 52px;
  width: auto;
  object-fit: contain;
}
.summary {
  padding-left: 18px;
  margin: 0 0 10px;
}
.ok {
  background: #e6f4ea;
  border: 1px solid #9bd3ae;
  border-radius: var(--r);
  padding: 14px;
  margin-top: 10px;
}
.ok .btn {
  width: 100%;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #1d2a2e;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  max-width: calc(100% - 32px);
  z-index: 50;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
@media (min-width: 900px) {
  .app {
    grid-template-rows: none;
    grid-template-columns: 1fr 380px;
    height: calc(100vh - 80px);
  }
  .stage {
    min-height: 0;
  }
  #view {
    max-height: calc(100vh - 110px);
    max-width: calc(100vw - 420px);
  }
  .panel {
    border-left: 1px solid var(--line);
    overflow-y: auto;
  }
}
.steps{flex-shrink:0}
.steps button{min-width:54px;padding:10px 4px 8px}
.swatches button[data-c]{width:34px;height:34px}
/* Mobil: fotoet bliver stående øverst, mens panelet rulles — man ser farve/fliser skifte med det samme. */
@media (max-width:899px){
  .stage:has(#canvas-wrap:not([hidden])){position:sticky;top:0;z-index:5;min-height:0;padding:4px 0}
  #view{max-height:44vh}
}
.tabs--sw button{display:inline-flex;align-items:center;gap:6px}
.tabs--sw i,.sw{display:inline-block;width:14px;height:14px;border-radius:4px;border:1px solid rgba(0,0,0,.25);vertical-align:-2px;margin:0 3px}
.tabs--sw button.active i{border-color:#fff}
