html,
body {
  background-color: #f8f3e8;
}

body {
  background-image: none;
}

.masthead .brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
  display: block;
  object-fit: contain;
}

#cash-slogan-field {
  margin-top: 16px;
}

#cash-slogan {
  width: 100%;
  height: 52px;
  padding: 0 13px;
  border: 1px solid #756750;
  border-radius: 0;
  color: #29251f;
  background: #efe4ce;
  font: 800 13px Mono, monospace;
}

#cash-format-note {
  padding-left: 10px;
  border-left: 3px solid #b8893c;
}

.studio-workbench {
  display: grid;
  grid-template-columns: minmax(310px, 360px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(32px, 4vw, 66px);
}

.studio-controls {
  min-width: 0;
}

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

.studio-controls .product-cards h3 {
  font-size: clamp(28px, 2.5vw, 36px);
}

.admin-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr);
  gap: 28px;
  margin-top: 22px;
  padding: 22px;
  color: #e9dcc2;
  background: #29251f;
  border: 3px solid #b8893c;
}

.admin-card span,
.admin-card label,
.admin-card #admin-status {
  font: 800 8px/1.35 Mono, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-card h3 { margin: 7px 0; font: 900 25px/.9 var(--sans); text-transform: uppercase; }
.admin-card p { margin: 0; color: #cfc1a5; font-size: 11px; line-height: 1.45; }
.admin-card .admin-form { align-self: center; }
.admin-card .admin-form > div { display: flex; margin: 7px 0; }
.admin-card button { min-height: 42px; width: 100%; padding: 0 13px; border: 1px solid #e9dcc2; color: #29251f; background: #b8893c; font: 800 9px/1 Mono, monospace; text-transform: uppercase; cursor: pointer; }
.admin-card[data-unlocked="true"] { border-color: #3f6863; }
.admin-card[data-unlocked="true"] button { background: #3f6863; color: #fff; }
.admin-card[data-unlocked="true"] #admin-status { color: #b9dfd5; }

.product-choice article {
  border-width: 3px;
}

.identity-choice article {
  border-color: #8a4fff;
}

.wallet-choice article {
  border-color: #f7931a;
}

.product-cards .identity-choice input:checked + article {
  box-shadow: 7px 7px 0 #8a4fff, 10px 10px 0 #4d277d;
}

.product-cards .wallet-choice input:checked + article {
  box-shadow: 7px 7px 0 #f2b632, 10px 10px 0 #f7931a;
}

.product-cards .identity-choice input:focus-visible + article {
  outline-color: #8a4fff;
}

.product-cards .wallet-choice input:focus-visible + article {
  outline-color: #f7931a;
}

.product-icon.ostrich {
  overflow: hidden;
  background: transparent;
}

.product-icon.ostrich img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-icon.sats {
  overflow: visible;
  background: transparent;
  border: 0;
}

.product-icon.sats img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.studio-controls .essential-fields {
  grid-template-columns: minmax(210px, .85fr) minmax(250px, 1fr) 220px;
}

.identity-wallet-option {
  display: grid !important;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 11px !important;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #756750;
  cursor: pointer;
}

.identity-wallet-option input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: #3f6863;
}

.identity-wallet-option span,
.identity-wallet-option b,
.identity-wallet-option small {
  display: block;
}

.identity-wallet-option b {
  font: 850 12px var(--sans);
}

.identity-wallet-option small {
  margin-top: 5px;
  color: #665e50;
  font: 500 10px/1.45 "Avenir Next", Arial, sans-serif;
  text-transform: none;
}

.live-preview {
  position: sticky;
  top: 24px;
  container-type: inline-size;
}

.live-preview > header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid #756750;
  font: 800 8px/1 Mono, monospace;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.live-preview > header b {
  color: #875044;
}

.live-preview > p {
  margin: 12px 0 0;
  color: #665e50;
  font: 600 9px/1.5 Mono, monospace;
}

.live-snippet {
  width: 100%;
  aspect-ratio: 57 / 83.68;
  position: relative;
  color: #29251f;
  background: #efe4ce;
  border: 0;
  box-shadow: 8px 8px 0 rgba(41, 37, 31, .16);
}

.live-snippet[data-flippable="true"] {
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
}

.live-snippet[data-flippable="true"]:hover {
  transform: translate(-2px, -2px);
  box-shadow: 10px 10px 0 rgba(63, 104, 99, .28);
}

.live-snippet[data-flippable="true"]:focus-visible {
  outline: 3px solid #3f6863;
  outline-offset: 4px;
}

.live-panel {
  position: relative;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.live-panel-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.live-panel:has(.live-panel-canvas) > :not(.live-panel-canvas) {
  display: none !important;
}

.live-panel:has(.live-panel-canvas)::after {
  display: none;
}

.live-panel[hidden] {
  display: none;
}

.live-panel::after {
  content: "";
  position: absolute;
  inset: 6.14cqw;
  z-index: 4;
  border: 1px solid #29251f;
  pointer-events: none;
}

.live-panel small {
  display: block;
  font: 800 clamp(6px, 2.2cqw, 8px)/1.25 Mono, monospace;
  letter-spacing: .04em;
}

.live-secret {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  text-align: center;
}

.live-secret-meta {
  width: auto;
  position: absolute;
  top: 11.05cqw;
  left: 10.53cqw;
  right: 10.53cqw;
  display: flex;
  justify-content: space-between;
  gap: 3cqw;
}

.live-secret-meta small {
  font: 400 2.97cqw/1 Mono, monospace;
  letter-spacing: 0;
}

.live-secret-meta small:last-child { text-align: right; }

.live-secret > strong {
  margin-top: 17cqw;
  font: 800 clamp(18px, 6.6cqw, 24px)/1 Mono, monospace;
}

.live-mnemonic {
  width: calc(100% - 21cqw);
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(4, auto);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1cqw 2cqw;
  margin: 5cqw 0 4cqw;
  padding: 0;
  list-style-position: inside;
  text-align: left;
  font: 800 clamp(6px, 2.1cqw, 8px)/1.2 Mono, monospace;
}

.live-secret-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 4cqw;
  margin: auto 0;
}

.live-secret-grid:has(figure[hidden]) {
  grid-template-columns: minmax(0, 64%);
  justify-content: center;
}

.live-secret figure {
  min-width: 0;
  margin: 0;
}

.live-secret figure[hidden] { display: none; }

.live-secret img {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  background: transparent;
  mix-blend-mode: multiply;
}

.live-secret figcaption {
  margin-top: 2.5cqw;
  font: 800 clamp(7px, 2.4cqw, 9px)/1.2 Mono, monospace;
}

.live-secret code {
  display: block;
  margin-top: 1.5cqw;
  overflow-wrap: anywhere;
  font: 700 clamp(4px, 1.55cqw, 6px)/1.25 Mono, monospace;
  text-align: left;
}

.live-secret p {
  margin: 0 8cqw 7cqw;
  font: 800 clamp(8px, 2.7cqw, 10px)/1.35 Mono, monospace;
  text-transform: uppercase;
}

.live-public {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.live-public > small {
  align-self: stretch;
  text-align: left;
}

.live-fake-qr {
  width: 72px;
  aspect-ratio: 1;
  margin: auto 0 10px;
  border: 6px solid #efe4ce;
  outline: 1px solid #29251f;
  background: conic-gradient(from 90deg, #29251f 25%, transparent 0 50%, #29251f 0 75%, transparent 0) 0 / 12px 12px,
    repeating-linear-gradient(45deg, transparent 0 4px, #29251f 4px 7px);
}

.live-public strong {
  max-width: 100%;
  overflow: hidden;
  font: 900 19px/.9 var(--sans);
  text-overflow: ellipsis;
}

.live-public span {
  max-width: 100%;
  margin-top: 6px;
  overflow: hidden;
  font: 700 6px/1.2 Mono, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-front {
  display: block;
}

.live-front > * {
  position: absolute;
  z-index: 2;
}

.live-front > #preview-number,
.live-front > .preview-note {
  top: 11.05cqw;
  font: 400 2.97cqw/1 Mono, monospace;
  letter-spacing: 0;
}

.live-front > #preview-number { left: 10.53cqw; }
.live-front > .preview-note { right: 10.53cqw; }

.live-front > #preview-alias {
  display: none;
}

.live-front > #preview-alias {
  margin-top: clamp(14px, 5cqw, 19px);
  font: 900 clamp(22px, 8.5cqw, 31px)/.9 var(--sans);
  text-transform: uppercase;
}

.live-preview-art {
  width: 59.65cqw;
  height: 59.65cqw;
  left: 20.18cqw;
  top: calc(17cqw + 20px);
  display: grid;
  place-items: center;
  margin: 0;
  overflow: hidden;
  color: #e9dcc2;
  background: #29251f;
}

.live-preview-art i {
  position: absolute;
  width: 90px;
  height: 90px;
  border: 2px solid currentColor;
  transform: rotate(45deg);
}

.live-preview-art i:nth-child(2) { width: 58px; height: 58px; }
.live-preview-art i:nth-child(3) { width: 27px; height: 27px; }
.live-preview-art.art-paper { background: transparent url("/assets/nostrsun.png") center / contain no-repeat; }
.live-snippet[data-mode="identity"] .mode-art { background: transparent url("/assets/card-nostr-ostrich.png") center / contain no-repeat; }
.live-snippet[data-mode="wallet"] .mode-art { background: transparent url("/assets/card-sats.png") center / auto 115% no-repeat; }
.live-snippet[data-mode="both"] .mode-art { background: transparent url("/assets/nostrsun.png") center / contain no-repeat; }
.live-snippet .mode-art i { display: none; }

.live-wallet-qr {
  width: 26cqw;
  height: 26cqw;
  position: absolute;
  right: 10.53cqw;
  bottom: 7.6cqw;
  z-index: 2;
  border: 0;
  outline: 0;
  background: transparent;
  mix-blend-mode: multiply;
  image-rendering: pixelated;
}

.live-wallet-qr[hidden] { display: none; }

.live-snippet .live-preview-art {
  width: 59.65cqw;
  height: 59.65cqw;
  margin: 0;
}

.live-snippet .live-preview-art.art-paper {
  background-size: contain;
}

.live-snippet .live-front > #preview-slogan {
  left: 10.53cqw;
  top: calc(80.5cqw + 35px);
  max-width: 78.94cqw;
  font: 800 calc(5.88cqw + 1px)/.985 Mono, monospace;
  white-space: pre-line;
}

.live-snippet .live-front > #preview-amount {
  left: 10.53cqw;
  right: 10.53cqw;
  top: 101cqw;
  max-width: none;
  margin: 0;
  color: #111;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 3.2cqw;
  font: 800 10.5cqw/1 Mono, monospace;
  letter-spacing: 0;
}

.live-snippet #preview-amount-unit {
  position: static;
  font: 800 3cqw/1 Mono, monospace;
  letter-spacing: 0;
}

.live-snippet #preview-amount-unit[hidden] { display: none; }
.live-snippet #preview-amount[hidden] { display: none; }

.live-snippet[data-mode="both"] .live-front > #preview-amount {
  top: auto;
  bottom: 10.53cqw;
}

.live-snippet[data-mode="both"] .live-secret-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3cqw;
  margin: 0 0 auto;
}

.live-snippet[data-mode="both"] .live-secret figcaption {
  margin-top: 1.2cqw;
}

.cash-slip-art {
  background: #e9dcc2 url("/assets/nostrsun.png") center / contain no-repeat;
}

.cash-slip-art i,
.cash-slip-art b {
  display: none;
}

.cash-demo-qr {
  width: 76px;
  height: 76px;
  display: block;
  margin: 14px auto 9px;
  border: 6px solid #e9dcc2;
  outline: 1px solid #29251f;
  background: #e9dcc2;
  image-rendering: pixelated;
}

/* Hero-Demo: dieselbe Frontpanel-Geometrie wie Identity + Wallet im Studio. */
.cash-slip-visual {
  padding: 0;
  container-type: inline-size;
}

.cash-slip-frame {
  position: absolute;
  inset: 6.14cqw;
  z-index: 4;
  border: 1px solid #29251f;
  pointer-events: none;
}

.cash-slip-visual .cash-slip-top { margin: 0; }

.cash-slip-visual .cash-slip-top span {
  position: absolute;
  top: 11.05cqw;
  z-index: 2;
  font: 400 2.97cqw/1 Mono, monospace;
  letter-spacing: 0;
}

.cash-slip-visual .cash-slip-top span:first-child { left: 10.53cqw; }
.cash-slip-visual .cash-slip-top span:last-child { right: 10.53cqw; }

.cash-slip-visual .cash-slip-art {
  width: 59.65cqw;
  height: 59.65cqw;
  position: absolute;
  left: 20.18cqw;
  top: calc(17cqw + 20px);
  background: transparent url("/assets/nostrsun.png") center / contain no-repeat;
}

.cash-slip-visual .cash-slip-title {
  position: absolute;
  left: 10.53cqw;
  top: calc(80.5cqw + 35px);
  z-index: 2;
  max-width: 78.94cqw;
  margin: 0;
  font: 800 calc(5.88cqw + 1px)/.985 Mono, monospace;
  letter-spacing: 0;
}

.cash-slip-visual .cash-slip-value {
  position: absolute;
  left: 10.53cqw;
  right: 10.53cqw;
  top: 101cqw;
  z-index: 2;
  justify-content: flex-end;
  gap: 3.2cqw;
  margin: 0;
}

.cash-slip-visual .cash-slip-value strong {
  font: 800 10.5cqw/1 Mono, monospace;
  letter-spacing: 0;
}

.cash-slip-visual .cash-slip-value span {
  font: 800 3cqw/1 Mono, monospace;
  letter-spacing: 0;
}

.cash-slip-visual .cash-demo-qr {
  width: 26cqw;
  height: 26cqw;
  position: absolute;
  right: 10.53cqw;
  bottom: 7.6cqw;
  z-index: 2;
  margin: 0;
  border: 0;
  outline: 0;
  background: transparent;
  mix-blend-mode: multiply;
}
.live-preview-art.art-paper i { display: none; }

.live-front > strong {
  font: 900 clamp(16px, 6cqw, 22px)/.9 var(--sans);
  text-transform: uppercase;
}

.live-front > b {
  margin-top: 8px;
  color: #875044;
  font: 900 clamp(17px, 6.5cqw, 24px)/.9 var(--sans);
}

.live-front > span {
  margin-top: auto;
  font: 800 clamp(7px, 2.5cqw, 9px)/1 Mono, monospace;
}

.live-back {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.live-back > small {
  align-self: stretch;
  margin-top: 8cqw;
  font: 900 clamp(11px, 4cqw, 15px)/1 var(--sans);
  letter-spacing: .04em;
  text-align: center;
}

.live-back-visuals {
  width: calc(100% - 21.06cqw);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5cqw;
  margin: auto 0 0;
}

.live-back .live-profile-qr,
.live-back .live-profile-avatar {
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  outline: 0;
  background: transparent;
}

.live-back .live-profile-qr {
  mix-blend-mode: multiply;
}

.live-back .live-back-npub {
  width: calc(100% - 21.06cqw);
  margin: 16px 0 18px;
  padding: 0;
  color: #29251f;
  background: transparent;
  font: 700 clamp(5.5px, 1.85cqw, 7px)/1 Mono, monospace;
  letter-spacing: 0;
  text-align: justify;
  text-align-last: justify;
  text-transform: lowercase;
  white-space: nowrap;
}

.live-back strong {
  font: 800 clamp(15px, 5.4cqw, 20px)/.985 Mono, monospace;
  text-transform: uppercase;
}

.live-back span {
  margin-top: 12px;
  margin-bottom: auto;
  font: 800 clamp(9px, 3.2cqw, 12px)/1.2 Mono, monospace;
  letter-spacing: .04em;
}

@media (max-width: 1100px) {
  .studio-workbench {
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  }

  .studio-controls .essential-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .studio-workbench {
    grid-template-columns: 1fr;
  }

  .live-preview {
    position: static;
  }

  .live-snippet {
    width: min(100%, 300px);
  }

  .admin-card { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .studio-controls .product-cards {
    grid-template-columns: 1fr;
  }
}
