:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #070b14;
  color: #edf2ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #0b1020 0%, #070b14 100%);
}

button, a { font: inherit; }

.shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 14px calc(32px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.eyebrow {
  color: #9aabcf;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 { margin: 4px 0 0; font-size: clamp(1.45rem, 6vw, 2rem); }
h2 { margin: 0 0 14px; font-size: 1.05rem; }
h3 { margin: 18px 0 10px; font-size: 0.92rem; color: #c7d2ee; }

.status {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: #19223a;
  color: #aebddd;
  font-size: 0.78rem;
}

.card {
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #202b46;
  border-radius: 18px;
  background: rgba(15, 21, 36, 0.94);
  box-shadow: 0 12px 36px rgba(0,0,0,0.18);
}

.viewer-card { padding: 8px; overflow: hidden; }

model-viewer {
  width: 100%;
  height: min(64vh, 620px);
  min-height: 420px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 35%, #27324d 0%, #11182a 62%, #0a0f1d 100%);
  --poster-color: transparent;
}

.viewer-actions {
  display: flex;
  gap: 8px;
  padding: 10px 4px 2px;
}

button, .button-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid #31415f;
  border-radius: 12px;
  background: #18223a;
  color: #edf2ff;
  text-decoration: none;
  cursor: pointer;
}

button:active, .button-link:active { transform: translateY(1px); }

.reset { display: none; }

.hint, .empty, .contract p {
  color: #9daccc;
  line-height: 1.5;
  font-size: 0.9rem;
}

.hint { padding: 0 5px 6px; }

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

figure { margin: 0; }
figure img {
  width: 100%;
  display: block;
  border-radius: 12px;
  background: #0a0f1d;
}
figcaption { margin-top: 6px; color: #9daccc; font-size: 0.82rem; text-align: center; }

.summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 12px;
  margin: 0;
  font-size: 0.9rem;
}
.summary dt { color: #91a3c7; }
.summary dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 7px 9px;
  border-radius: 10px;
  background: #17233b;
  color: #dce6ff;
  font-size: 0.82rem;
}

.warning {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #655329;
  border-radius: 12px;
  background: #2b2518;
  color: #f5df9a;
  font-size: 0.86rem;
  line-height: 1.45;
}

.warning strong { color: #fff0ba; }

.contract summary { cursor: pointer; font-weight: 700; }
.contract code, .hint code, .empty code { color: #bdcbec; overflow-wrap: anywhere; }

.hidden { display: none !important; }

@media (max-width: 460px) {
  .shell { padding-left: 10px; padding-right: 10px; }
  .card { border-radius: 15px; }
  model-viewer { min-height: 390px; height: 58vh; }
  .preview-grid { grid-template-columns: 1fr 1fr; }
}
