/* ── Neuraum ── Preisschild-Ästhetik: warmes Papier, Video-Gelb, weiße Tags ── */

@font-face {
  font-family: 'Archivo Black';
  src: url('/fonts/ArchivoBlack-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('/fonts/InstrumentSans-400.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Space Mono';
  src: url('/fonts/SpaceMono-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #221d16;
  --ink-soft: #55503f;
  --paper: #fbf7ef;
  --card: #ffffff;
  --field: #f3d97d;       /* das Gelb aus dem Video */
  --field-deep: #e2bd45;
  --olive: #6e6a44;
  --line: #e6dfd0;
  --danger: #b3401e;
  --radius: 14px;
  --shadow: 0 2px 6px rgba(34, 29, 22, .08), 0 12px 32px rgba(34, 29, 22, .10);
  --display: 'Archivo Black', 'Arial Black', sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'Space Mono', ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main {
  width: min(720px, 100% - 40px);
  margin: 0 auto;
  flex: 1;
}

button { font: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

:focus-visible { outline: 3px solid var(--field-deep); outline-offset: 2px; }

/* ── Topbar ── */
.topbar {
  width: min(720px, 100% - 40px);
  margin: 0 auto;
  padding: 22px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wordmark {
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: .02em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark span {
  background: var(--field);
  padding: 0 .18em;
  border-radius: 6px;
}

/* Preisschild-Anhänger: Signature-Element, überall wiederverwendet */
.hangtag {
  font-family: var(--mono);
  font-weight: 700;
  font-size: .68rem;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  padding: 4px 10px 4px 18px;
  position: relative;
  transform: rotate(2deg);
  white-space: nowrap;
}
.hangtag::before {
  content: '';
  position: absolute;
  left: 7px; top: 50%;
  width: 5px; height: 5px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  transform: translateY(-50%);
}

/* ── Hero ── */
.hero { padding: 34px 0 8px; }
h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 7vw, 3.1rem);
  line-height: 1.04;
  letter-spacing: -.01em;
}
h1 em {
  font-style: normal;
  background: linear-gradient(0deg, var(--field) 42%, transparent 42%);
}
.hero-sub {
  margin-top: 14px;
  font-size: 1.06rem;
  color: var(--ink-soft);
  max-width: 46ch;
}

/* ── Schritte ── */
.step { margin-top: 30px; }
.step-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.step-num {
  font-family: var(--mono);
  background: var(--ink);
  color: var(--paper);
  width: 20px; height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .68rem;
}
.step-hint { font-weight: 500; color: var(--ink-soft); text-transform: none; letter-spacing: 0; }

/* Dropzone */
.dropzone {
  background: var(--card);
  border: 2px dashed var(--taupe, #b9ad99);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--ink); background: #fffdf7; }
.dz-idle {
  padding: 38px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.dz-icon { width: 44px; height: 44px; color: var(--olive); margin-bottom: 6px; }
.dz-idle span { font-size: .88rem; color: var(--ink-soft); }
.dz-preview { padding: 10px; position: relative; }
.dz-preview img { border-radius: 10px; width: 100%; max-height: 340px; object-fit: cover; }
.dz-preview .btn { position: absolute; right: 18px; bottom: 18px; }

/* Stil-Chips als kleine Anhänger */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-family: var(--body);
  font-weight: 600;
  font-size: .92rem;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 9px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  transition: transform .12s, border-color .12s, background .12s;
}
.chip small { font-weight: 500; font-size: .72rem; color: var(--ink-soft); }
.chip[aria-pressed="true"] {
  background: var(--field);
  border-color: var(--ink);
  transform: rotate(-1.2deg);
}
.chip[aria-pressed="true"] small { color: var(--ink); }
.chip:nth-child(even)[aria-pressed="true"] { transform: rotate(1.2deg); }

/* Budget-Segmente */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg button {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 6px;
  font-weight: 700;
  font-size: .92rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: center;
}
.seg button small { font-weight: 500; font-size: .7rem; color: var(--ink-soft); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.seg button[aria-checked="true"] small { color: #cfc8b8; }

/* ── Buttons ── */
.btn {
  border: none;
  border-radius: 12px;
  font-weight: 700;
  padding: 12px 18px;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 3px 0 var(--field-deep);
  transition: transform .1s, box-shadow .1s;
}
.btn-primary:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--field-deep); }
.btn-primary:not(:disabled):active { transform: translateY(2px); box-shadow: 0 0 0 var(--field-deep); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn-big { width: 100%; margin-top: 34px; padding: 16px; font-size: 1.05rem; }
.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
}
.btn-ghost:hover { border-color: var(--ink); background: var(--card); }

.error-note {
  margin-top: 14px;
  background: #fdeee7;
  border: 1.5px solid var(--danger);
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: .92rem;
}

/* ── Ergebnisse ── */
.results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 30px;
}
.results-title { font-size: clamp(1.6rem, 5vw, 2.2rem); }
.results-sub { color: var(--ink-soft); margin-top: 6px; font-size: .95rem; }

.result-cards { display: flex; flex-direction: column; gap: 26px; margin-top: 22px; }

.result-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.rc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}
.rc-style {
  font-family: var(--display);
  font-size: 1.05rem;
}
.rc-status { font-family: var(--mono); font-weight: 700; font-size: .7rem; color: var(--ink-soft); }

/* Vorher/Nachher-Slider */
.ba {
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.ba img { width: 100%; display: block; pointer-events: none; }
.ba .ba-before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: inset(0 calc(100% - var(--cut, 50%)) 0 0);
}
.ba-handle {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--cut, 50%);
  width: 3px;
  background: var(--field);
  transform: translateX(-50%);
  pointer-events: none;
}
.ba-handle::after {
  content: '⇄';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--field);
  color: var(--ink);
  font-weight: 700;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(34,29,22,.3);
}
.ba-label {
  position: absolute;
  top: 10px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: .62rem;
  background: rgba(255,255,255,.92);
  border-radius: 6px;
  padding: 3px 8px;
  pointer-events: none;
}
.ba-label.before { left: 10px; }
.ba-label.after { right: 10px; }
.ba input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
}

/* Skeleton während die KI arbeitet */
.rc-skeleton {
  aspect-ratio: 4 / 3;
  background: linear-gradient(100deg, #efe9db 40%, #f8f3e7 50%, #efe9db 60%);
  background-size: 240% 100%;
  animation: shimmer 1.4s infinite linear;
  display: flex;
  align-items: center;
  justify-content: center;
}
@keyframes shimmer { to { background-position: -140% 0; } }
.rc-skeleton span {
  font-family: var(--mono);
  font-weight: 700;
  font-size: .74rem;
  color: var(--olive);
  background: rgba(255,255,255,.75);
  padding: 6px 12px;
  border-radius: 8px;
}

.rc-actions {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  flex-wrap: wrap;
}
.rc-actions .btn-primary { flex: 1; min-width: 170px; }

/* ── Einkaufsliste: die Video-Bühne ── */
#view-checklist { padding-top: 24px; }
.checklist-stage {
  margin-top: 18px;
  background: var(--field);
  border-radius: var(--radius);
  padding: clamp(18px, 5vw, 44px);
  box-shadow: var(--shadow);
}
.stage-inner { position: relative; max-width: 560px; margin: 0 auto; }
.stage-inner img { border-radius: 6px; box-shadow: 0 10px 40px rgba(34,29,22,.28); }

.tag-layer { position: absolute; inset: 0; }
.price-tag {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  animation: tag-pop .35s cubic-bezier(.3, 1.4, .5, 1) backwards;
}
.price-tag .pt-card {
  background: var(--card);
  border-radius: 8px;
  padding: 4px 9px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(34,29,22,.25);
  white-space: nowrap;
}
.price-tag .pt-price {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(.72rem, 2.4vw, .95rem);
  display: block;
  line-height: 1.15;
}
.price-tag .pt-name {
  font-size: clamp(.58rem, 1.9vw, .74rem);
  font-weight: 600;
  color: var(--ink-soft);
  display: block;
  line-height: 1.2;
}
.price-tag .pt-dot {
  width: 7px; height: 7px;
  background: var(--ink);
  border: 2px solid var(--card);
  border-radius: 50%;
  margin-top: 4px;
  box-shadow: 0 1px 4px rgba(34,29,22,.4);
}
@keyframes tag-pop {
  from { opacity: 0; transform: translate(-50%, -100%) scale(.6); }
}
.price-tag.flip {
  transform: translate(-50%, 0);
  flex-direction: column-reverse;
  animation: none;
}
.price-tag.flip .pt-dot { margin: 0 0 4px; }

.stage-caption {
  text-align: center;
  margin-top: 16px;
  font-family: var(--display);
  font-size: 1.05rem;
}

/* Liste */
#checklistBody { margin-top: 26px; }
.loading-note {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 18px 0;
}
.spinner {
  width: 22px; height: 22px;
  border: 3px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.list-head h2 { font-family: var(--display); font-size: 1.4rem; }
.total-tag {
  font-size: .9rem;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  padding: 6px 12px;
  transform: rotate(-1.5deg);
}
.total-tag strong { font-family: var(--mono); font-size: 1.02rem; }

.item-list { list-style: none; margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.item {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(34,29,22,.07);
  overflow: hidden;
}
.item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
}
.item-check {
  width: 22px; height: 22px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  background: var(--card);
  transition: background .12s;
}
.item.done .item-check { background: var(--field); }
.item.done .item-name { text-decoration: line-through; color: var(--ink-soft); }
.item-name { font-weight: 600; flex: 1; }
.item-price { font-family: var(--mono); font-weight: 700; font-size: .95rem; }
.item-caret { color: var(--ink-soft); transition: transform .15s; font-size: .8rem; }
.item.open .item-caret { transform: rotate(180deg); }

.item-detail {
  display: none;
  border-top: 1.5px solid var(--line);
  padding: 12px 14px 14px;
}
.item.open .item-detail { display: block; }
.product {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .92rem;
  padding: 5px 0;
}
.product span:last-child { font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.product small { color: var(--ink-soft); font-weight: 600; }
.shop-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.shop-links a {
  text-decoration: none;
  font-weight: 700;
  font-size: .82rem;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  padding: 6px 11px;
}
.shop-links a:hover { background: var(--field); }

.fineprint { margin-top: 18px; font-size: .8rem; color: var(--ink-soft); }

/* ── Gate ── */
.gate {
  position: fixed;
  inset: 0;
  background: var(--field);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.gate-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 26px;
  max-width: 380px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.gate-card form { display: flex; flex-direction: column; gap: 10px; }
.gate-card input {
  font: inherit;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
}
.gate-card input:focus { border-color: var(--ink); outline: none; }
.gate-error { color: var(--danger); font-weight: 600; font-size: .9rem; }

.footer {
  text-align: center;
  font-size: .74rem;
  color: var(--ink-soft);
  padding: 40px 20px 26px;
}

@media (min-width: 700px) {
  .rc-actions .btn-primary { flex: 0 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .price-tag { animation: none; }
  .rc-skeleton { animation: none; }
  * { transition: none !important; }
}
