:root {
  color-scheme: dark;
  --night: #100c10;
  --night-soft: #191111;
  --lacquer: #43171a;
  --lacquer-bright: #7a2520;
  --jade: #0a7c72;
  --jade-deep: #064842;
  --plum: #432039;
  --vermilion: #d55b35;
  --gold: #d9aa4a;
  --gold-soft: #f2d893;
  --paper: #fbf0db;
  --paper-soft: #f3dfba;
  --ink: #21140d;
  --text: #fff8ea;
  --muted: #d0bea0;
  --muted-strong: #eadbbf;
  --surface: rgba(25, 16, 15, 0.82);
  --surface-strong: rgba(42, 27, 21, 0.92);
  --surface-soft: rgba(255, 248, 234, 0.07);
  --line: rgba(242, 216, 147, 0.24);
  --line-strong: rgba(242, 216, 147, 0.42);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.44);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--night);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: "Noto Sans Myanmar", "Myanmar Text", "Padauk", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(180deg, rgba(11, 8, 10, 0.94), rgba(18, 12, 13, 0.92) 42%, rgba(7, 29, 27, 0.94)),
    linear-gradient(110deg, rgba(122, 37, 32, 0.22), transparent 36%, rgba(10, 124, 114, 0.2) 78%),
    url("assets/table-pattern.svg"),
    var(--night);
  background-attachment: fixed, fixed, fixed, fixed;
  background-size: auto, auto, 560px 560px, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(242, 216, 147, 0.025) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(10, 124, 114, 0.025) 0 1px, transparent 1px 72px);
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app-shell {
  min-height: 100vh;
  padding: clamp(12px, 2vw, 28px);
}

.reading-workspace {
  display: grid;
  grid-template-columns: minmax(288px, 340px) minmax(460px, 1fr) minmax(320px, 400px);
  gap: 16px;
  width: min(100%, 1580px);
  height: calc(100vh - clamp(24px, 4vw, 56px));
  min-height: 660px;
  margin: 0 auto;
}

.control-panel,
.draw-area,
.reading-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 248, 234, 0.08), transparent 28%),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.control-panel::after,
.draw-area::after,
.reading-panel::after {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: 7px;
  border: 1px solid rgba(255, 248, 234, 0.035);
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  padding: 22px;
  overflow: auto;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand-block > div {
  min-width: 0;
}

.help-action {
  min-height: 34px;
  margin-left: auto;
  border: 1px solid rgba(242, 216, 147, 0.34);
  border-radius: 999px;
  padding: 6px 11px;
  color: var(--paper);
  background: rgba(255, 248, 234, 0.07);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.help-action:hover {
  border-color: rgba(242, 216, 147, 0.72);
  background: rgba(255, 248, 234, 0.13);
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(242, 216, 147, 0.56);
  border-radius: 50%;
  color: var(--gold-soft);
  background:
    linear-gradient(145deg, rgba(122, 37, 32, 0.95), rgba(67, 23, 26, 0.78) 48%, rgba(10, 124, 114, 0.78)),
    var(--lacquer);
  box-shadow:
    inset 0 0 0 5px rgba(255, 248, 234, 0.04),
    0 14px 36px rgba(10, 124, 114, 0.22);
  font-size: 1.45rem;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--gold-soft);
  font-size: 0.74rem;
  font-weight: 800;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: #fff3dc;
  font-size: 1.65rem;
  line-height: 1.22;
}

h2 {
  margin-bottom: 0;
  color: #fff5df;
  font-size: 1.18rem;
  line-height: 1.48;
}

.reading-content {
  display: grid;
  gap: 16px;
}

.reading-content > .eyebrow {
  margin-bottom: -10px;
}

.reading-content h2 {
  font-size: 1.1rem;
  line-height: 1.55;
}

.reading-content h2:focus {
  outline: none;
}

.field-group,
.spread-control,
.action-row,
.voice-settings {
  display: grid;
  gap: 10px;
}

label {
  color: var(--paper);
  font-size: 0.9rem;
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 136px;
  resize: vertical;
  border: 1px solid rgba(242, 216, 147, 0.34);
  border-radius: 8px;
  padding: 14px 15px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 248, 234, 0.055), transparent),
    rgba(10, 8, 8, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 248, 234, 0.06);
  line-height: 1.72;
  outline: none;
}

textarea:focus,
select:focus,
input[type="range"]:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(10, 124, 114, 0.72);
  outline-offset: 3px;
}

textarea::placeholder {
  color: rgba(251, 240, 219, 0.48);
}

.field-meta,
.range-labels,
.control-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.76rem;
}

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

.intent-button,
.spread-button,
.secondary-action,
.voice-action {
  min-height: 42px;
  border: 1px solid rgba(242, 216, 147, 0.28);
  border-radius: 8px;
  color: var(--paper);
  background:
    linear-gradient(180deg, rgba(255, 248, 234, 0.075), rgba(255, 248, 234, 0.03)),
    rgba(12, 9, 9, 0.36);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.intent-button:hover,
.spread-button:hover,
.secondary-action:hover,
.voice-action:hover:not(:disabled) {
  border-color: rgba(242, 216, 147, 0.72);
  background: rgba(255, 248, 234, 0.11);
  transform: translateY(-1px);
}

.intent-button.is-active,
.spread-button.is-active {
  border-color: rgba(10, 124, 114, 0.92);
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(10, 124, 114, 0.46), rgba(10, 124, 114, 0.22)),
    rgba(255, 248, 234, 0.06);
  box-shadow: 0 12px 26px rgba(10, 124, 114, 0.16);
}

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

.spread-button {
  display: grid;
  align-content: center;
  min-height: 60px;
  padding: 9px 10px;
  text-align: left;
}

.spread-button strong,
.spread-button small {
  display: block;
  line-height: 1.35;
}

.spread-button strong {
  color: var(--paper);
  font-size: 0.85rem;
}

.spread-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
}

.spread-button.wide {
  grid-column: 1 / -1;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
}

.primary-action,
.secondary-action,
.astromint-action {
  width: 100%;
  padding: 12px 14px;
  font-weight: 900;
}

.primary-action {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #21140c;
  background: linear-gradient(135deg, var(--gold), #ffe9a8 46%, var(--vermilion));
  box-shadow: 0 16px 34px rgba(213, 91, 53, 0.22);
}

.primary-action:hover,
.astromint-action:hover {
  transform: translateY(-1px);
}

.secondary-action {
  min-height: 44px;
}

.astromint-action {
  min-height: 48px;
  border: 1px solid rgba(242, 216, 147, 0.52);
  border-radius: 8px;
  color: #21140c;
  background: linear-gradient(135deg, #f2d893, #fff1b7 42%, #8fd8c7);
  box-shadow:
    0 16px 36px rgba(10, 124, 114, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.astromint-action.is-loading {
  color: rgba(32, 19, 12, 0.7);
}

.reflection-note {
  margin: auto 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.78;
}

.draw-area {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 16px;
  min-height: 0;
  padding: 22px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 248, 234, 0.08), transparent 22%),
    linear-gradient(140deg, rgba(10, 124, 114, 0.16), transparent 38%, rgba(122, 37, 32, 0.15)),
    rgba(18, 12, 11, 0.82);
}

.draw-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.draw-header > div:first-child {
  max-width: 720px;
}

.progress-box {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: baseline;
  min-width: 104px;
  padding: 10px 12px;
  border: 1px solid rgba(242, 216, 147, 0.38);
  border-radius: 8px;
  color: var(--paper);
  background: rgba(8, 7, 7, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 248, 234, 0.06);
  text-align: center;
}

.progress-box strong {
  color: var(--gold-soft);
  font-size: 1.45rem;
}

.progress-box small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.72rem;
}

.spread-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
}

.spread-slot {
  min-height: 82px;
  border: 1px dashed rgba(242, 216, 147, 0.34);
  border-radius: 8px;
  padding: 9px;
  background: rgba(8, 7, 7, 0.26);
}

.spread-slot strong {
  display: block;
  color: var(--paper);
  font-size: 0.77rem;
  line-height: 1.45;
}

.spread-slot span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.5;
}

.spread-slot.is-filled {
  border-style: solid;
  border-color: rgba(10, 124, 114, 0.78);
  background:
    linear-gradient(180deg, rgba(10, 124, 114, 0.22), rgba(10, 124, 114, 0.09)),
    rgba(255, 248, 234, 0.04);
}

.deck-table {
  position: relative;
  min-height: 0;
  max-height: 100%;
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid rgba(10, 124, 114, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 248, 234, 0.06), rgba(0, 0, 0, 0.06)),
    linear-gradient(135deg, rgba(10, 124, 114, 0.18), rgba(67, 32, 57, 0.2) 52%, rgba(122, 37, 32, 0.16)),
    url("assets/table-pattern.svg"),
    rgba(9, 7, 7, 0.58);
  background-size: auto, auto, 460px 460px, auto;
  box-shadow:
    inset 0 0 0 1px rgba(255, 248, 234, 0.04),
    inset 0 28px 80px rgba(0, 0, 0, 0.16);
  overflow: auto;
}

.deck-table::before {
  content: "";
  position: sticky;
  top: 0;
  display: block;
  height: 1px;
  margin-bottom: -1px;
  border-top: 1px solid rgba(242, 216, 147, 0.16);
}

.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(94px, 1fr));
  gap: 12px;
}

.tarot-card {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  min-height: 140px;
  border: 0;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  perspective: 900px;
}

.card-inner {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  transform-style: preserve-3d;
  transition:
    transform 360ms ease,
    filter 180ms ease;
}

.tarot-card.is-selected .card-inner {
  transform: rotateY(180deg);
}

.tarot-card:disabled:not(.is-selected) {
  opacity: 0.38;
}

.card-back,
.card-front {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
  backface-visibility: hidden;
}

.card-back {
  border: 1px solid rgba(242, 216, 147, 0.48);
  background:
    linear-gradient(180deg, rgba(255, 248, 234, 0.08), transparent 38%),
    #451a20 url("assets/card-back.svg") center / cover no-repeat;
  box-shadow:
    inset 0 0 0 4px rgba(255, 248, 234, 0.05),
    0 16px 26px rgba(0, 0, 0, 0.28);
}

.card-front {
  transform: rotateY(180deg);
  border: 1px solid rgba(62, 38, 19, 0.42);
  padding: 10px 8px;
  color: #29180f;
  background:
    linear-gradient(180deg, rgba(255, 248, 234, 0.98), rgba(238, 213, 168, 0.98)),
    var(--paper);
  box-shadow:
    inset 0 0 0 4px rgba(122, 37, 32, 0.04),
    0 16px 26px rgba(0, 0, 0, 0.2);
}

.tarot-card:hover:not(:disabled) .card-inner {
  filter: brightness(1.08);
  transform: translateY(-5px);
}

.tarot-card.is-selected:hover .card-inner {
  transform: rotateY(180deg);
}

.card-symbol {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin-bottom: 8px;
  border: 1px solid rgba(39, 23, 14, 0.08);
  border-radius: 50%;
  color: var(--card-color, var(--lacquer));
  background: rgba(255, 255, 255, 0.58);
  font-size: 1.45rem;
}

.card-name {
  color: #27170e;
  font-size: 0.77rem;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
}

.card-key {
  margin-top: 5px;
  color: #6d4a2b;
  font-size: 0.67rem;
  line-height: 1.35;
  text-align: center;
}

.reading-panel {
  min-height: 0;
  padding: 22px;
  overflow: auto;
}

.reading-empty {
  display: grid;
  min-height: 100%;
  align-content: center;
  gap: 12px;
  color: var(--muted);
}

.empty-symbol {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(242, 216, 147, 0.46);
  border-radius: 50%;
  color: var(--gold-soft);
  background: rgba(255, 248, 234, 0.04);
  font-size: 1.7rem;
}

.reading-empty p,
.question-summary,
.overview-text,
.closing-advice {
  color: var(--muted);
  line-height: 1.82;
}

.question-summary {
  margin: 0;
  padding: 14px 15px;
  border-left: 3px solid var(--jade);
  border-radius: 0 8px 8px 0;
  background: rgba(10, 124, 114, 0.13);
}

.overview-text,
.closing-advice {
  margin-bottom: 0;
}

.overview-text {
  display: grid;
  gap: 14px;
}

.local-reading-hero,
.reading-pattern {
  border: 1px solid rgba(242, 216, 147, 0.24);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(145deg, rgba(122, 37, 32, 0.12), rgba(10, 124, 114, 0.09)),
    rgba(255, 248, 234, 0.045);
}

.local-reading-hero h3,
.reading-pattern h3,
.closing-advice h3 {
  margin: 0 0 8px;
  color: var(--paper);
  font-size: 0.96rem;
  line-height: 1.5;
}

.local-reading-hero p,
.reading-pattern p,
.closing-advice p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.84rem;
  line-height: 1.86;
}

.local-reading-hero .bottom-line,
.astromint-reading .bottom-line-card p {
  color: var(--paper);
  font-weight: 700;
}

.local-reading-hero .bottom-line {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-left: 3px solid rgba(242, 216, 147, 0.86);
  background: rgba(255, 248, 234, 0.07);
}

.reading-pattern p + p,
.closing-advice p + p {
  margin-top: 8px;
}

.reading-pulse-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.reading-pulse {
  display: grid;
  gap: 3px;
  min-width: 0;
  border-left: 2px solid rgba(242, 216, 147, 0.7);
  padding: 7px 9px;
  background: rgba(16, 12, 10, 0.26);
}

.reading-pulse span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.reading-pulse strong {
  color: var(--paper);
  font-size: 0.78rem;
  line-height: 1.45;
}

.closing-advice {
  padding: 13px;
  border: 1px solid rgba(242, 216, 147, 0.2);
  border-radius: 8px;
  background: rgba(255, 248, 234, 0.055);
}

.closing-advice .next-step-line {
  border-left: 3px solid var(--gold);
  padding: 8px 10px;
  color: var(--paper);
  background: rgba(217, 170, 74, 0.1);
  font-weight: 800;
}

.closing-advice .gentle-note {
  color: var(--muted);
  font-size: 0.8rem;
}

.card-readings {
  display: grid;
  gap: 14px;
  margin: 0;
}

.astromint-reading-tools {
  display: grid;
  gap: 14px;
  margin: 2px 0 4px;
}

.privacy-note {
  margin: -2px 0 0;
  color: rgba(221, 211, 190, 0.72);
  font-size: 0.72rem;
  line-height: 1.72;
}

.astromint-reading,
.voice-teller,
.reading-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 248, 234, 0.055);
}

.astromint-reading {
  padding: 15px;
  border-color: rgba(10, 124, 114, 0.46);
  background:
    linear-gradient(180deg, rgba(10, 124, 114, 0.16), rgba(10, 124, 114, 0.08)),
    rgba(255, 248, 234, 0.04);
}

.astromint-reading h3 {
  margin: 0 0 10px;
  color: var(--paper);
  font-size: 1rem;
  line-height: 1.45;
}

.astromint-reading h4 {
  margin: 14px 0 6px;
  color: var(--gold-soft);
  font-size: 0.86rem;
  line-height: 1.45;
}

.astromint-reading p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.84rem;
  line-height: 1.82;
}

.astromint-reading .astromint-card {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(242, 216, 147, 0.18);
}

.astromint-reading .astromint-status {
  color: var(--paper);
}

.astromint-reading .astromint-note {
  margin-top: 10px;
  border-top: 1px solid rgba(242, 216, 147, 0.18);
  padding-top: 10px;
  color: var(--gold-soft);
}

.voice-teller {
  display: grid;
  gap: 12px;
  margin: 18px 0;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(10, 124, 114, 0.12), rgba(67, 32, 57, 0.12)),
    rgba(255, 248, 234, 0.045);
}

.voice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.voice-header h3 {
  margin: 0;
  color: var(--paper);
  font-size: 1rem;
  line-height: 1.4;
}

.voice-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(10, 124, 114, 0.58);
  border-radius: 999px;
  padding: 4px 9px;
  color: #d8fff7;
  background: rgba(10, 124, 114, 0.22);
  font-size: 0.68rem;
  font-weight: 800;
}

.voice-warning,
.voice-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.72;
}

.voice-status[data-type="error"] {
  color: #ffcfb8;
}

.voice-warning {
  border-left: 3px solid var(--gold);
  padding: 9px 11px;
  background: rgba(217, 170, 74, 0.1);
}

.voice-actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 8px;
}

.voice-action {
  min-height: 40px;
  font-weight: 800;
}

.voice-action.primary {
  border-color: rgba(10, 124, 114, 0.74);
  color: #ffffff;
  background: rgba(10, 124, 114, 0.42);
}

.voice-action.primary:hover:not(:disabled) {
  background: rgba(10, 124, 114, 0.58);
}

.voice-action:disabled,
.voice-select:disabled {
  opacity: 0.48;
}

.voice-rate-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.voice-rate-row output {
  color: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.voice-select {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(242, 216, 147, 0.34);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--paper);
  background: rgba(16, 12, 10, 0.62);
}

.voice-select option {
  color: #20130c;
  background: var(--paper);
}

.reading-card {
  padding: 13px;
}

.reading-card h3 {
  margin: 0 0 8px;
  color: var(--paper);
  font-size: 0.94rem;
  line-height: 1.45;
}

.reading-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.78;
}

.card-oracle-line {
  border-left: 3px solid var(--jade);
  padding: 9px 11px;
  color: var(--paper) !important;
  background: rgba(10, 124, 114, 0.12);
  font-weight: 800;
}

.card-reading-sections {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.card-reading-section {
  border-top: 1px solid rgba(242, 216, 147, 0.16);
  padding-top: 10px;
}

.card-reading-section strong {
  display: block;
  margin-bottom: 4px;
  color: var(--gold-soft);
  font-size: 0.75rem;
}

.card-reading-section p {
  margin: 0;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #21140c;
  background: var(--gold-soft);
  font-size: 0.68rem;
  font-weight: 800;
}

.mini-badge.alt {
  color: #fff8ea;
  background: var(--jade);
}

.mini-badge.ghost {
  color: var(--paper);
  background: rgba(255, 248, 234, 0.13);
}

.onboarding-is-open {
  overflow: hidden;
}

.is-first-visit .app-shell {
  animation: appArrival 800ms ease both;
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 25%, rgba(242, 216, 147, 0.14), transparent 34%),
    rgba(6, 4, 5, 0.78);
  backdrop-filter: blur(14px);
}

.onboarding-dialog {
  width: min(100%, 520px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid rgba(242, 216, 147, 0.34);
  border-radius: 8px;
  padding: clamp(18px, 4vw, 28px);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 248, 234, 0.1), transparent 34%),
    linear-gradient(145deg, rgba(67, 23, 26, 0.96), rgba(16, 12, 12, 0.96) 52%, rgba(6, 55, 50, 0.94));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.58);
  animation: onboardingRise 460ms ease both;
}

.onboarding-visual {
  position: relative;
  height: 146px;
  margin-bottom: 16px;
}

.onboarding-card {
  position: absolute;
  left: 50%;
  top: 10px;
  display: grid;
  width: 92px;
  height: 128px;
  place-items: center;
  border: 1px solid rgba(242, 216, 147, 0.48);
  border-radius: 8px;
  color: var(--gold-soft);
  background:
    linear-gradient(145deg, rgba(67, 23, 26, 0.96), rgba(10, 124, 114, 0.56)),
    url("assets/card-back.svg");
  background-size: cover;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 248, 234, 0.06);
  font-size: 1.5rem;
}

.onboarding-card.card-one {
  transform: translateX(-116%) rotate(-12deg);
  animation: cardFanLeft 900ms ease both;
}

.onboarding-card.card-two {
  transform: translateX(-50%);
  animation: cardGlow 1200ms ease both;
}

.onboarding-card.card-three {
  transform: translateX(16%) rotate(12deg);
  animation: cardFanRight 900ms ease both;
}

.onboarding-dialog h2 {
  margin-bottom: 10px;
  color: var(--paper);
  font-size: 1.25rem;
}

.onboarding-dialog p {
  margin-bottom: 18px;
  color: var(--muted-strong);
  font-size: 0.9rem;
  line-height: 1.86;
}

.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.onboarding-steps div {
  display: grid;
  gap: 6px;
  min-height: 84px;
  align-content: center;
  border: 1px solid rgba(242, 216, 147, 0.22);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 248, 234, 0.055);
}

.onboarding-steps strong {
  color: var(--gold-soft);
  font-size: 1rem;
}

.onboarding-steps span {
  color: var(--paper);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.45;
}

.onboarding-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@keyframes onboardingRise {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes appArrival {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardFanLeft {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(24px) rotate(0deg);
  }
  to {
    opacity: 1;
    transform: translateX(-116%) translateY(0) rotate(-12deg);
  }
}

@keyframes cardFanRight {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(24px) rotate(0deg);
  }
  to {
    opacity: 1;
    transform: translateX(16%) translateY(0) rotate(12deg);
  }
}

@keyframes cardGlow {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(18px) scale(0.96);
  }
  60% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@media (max-width: 1180px) {
  .reading-workspace {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    height: auto;
    min-height: auto;
  }

  .reading-panel {
    grid-column: 1 / -1;
    min-height: 320px;
  }

  .deck-table {
    max-height: 560px;
  }
}

@media (max-width: 760px) {
  body {
    background-attachment: scroll, scroll, scroll, scroll;
  }

  .app-shell {
    padding: 12px;
  }

  .reading-workspace {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .control-panel,
  .draw-area,
  .reading-panel {
    padding: 16px;
  }

  .brand-block {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .help-action {
    margin-left: 0;
  }

  .draw-header {
    flex-direction: column;
  }

  .progress-box {
    width: 100%;
  }

  .intent-picker,
  .spread-picker,
  .reading-pulse-grid,
  .onboarding-actions,
  .onboarding-steps,
  .voice-actions {
    grid-template-columns: 1fr;
  }

  .deck-table {
    padding: 12px;
    max-height: 520px;
  }

  .deck-grid {
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 10px;
  }

  .tarot-card {
    min-height: 122px;
  }

  .card-symbol {
    width: 38px;
    height: 38px;
    font-size: 1.25rem;
  }

  .voice-header {
    flex-direction: column;
  }

  .onboarding-overlay {
    align-items: start;
  }

  .onboarding-dialog {
    max-height: none;
  }

  .onboarding-visual {
    height: 118px;
    margin-bottom: 12px;
  }

  .onboarding-card {
    width: 76px;
    height: 106px;
  }

  .onboarding-dialog h2 {
    font-size: 1.08rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
