/* Deck builder header dialogs (.prd/19 H2 Import, H3 Export + wallpaper, H6 Guide, H8 Discard + library, L6
   Show deck only) — WU3, R2. Sizes are the reference's: rects from tests/fixtures/riftatlas-deck-builder.json
   (workspace.importDialog / guideDialog / exportMenu / wallpaperDialog / deckOnlyMode) and the Tailwind
   classes the dialogs render (tests/fixtures/riftatlas-deck-builder-dialogs.json `classes`, read 2026-10-06),
   in the builder's dark tokens (L7, T4). Tailwind: --spacing .25rem, text-sm 14/20, text-xs 12/16,
   rounded-md 6, rounded-lg 8, rounded-xl 12, rounded-2xl 16. */

/* ------------------------------------------------------------------ modal */

.db-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
  color: var(--foreground);
  font-size: 16px;
  line-height: 1.5;
}

.db-modal-backdrop {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(8px);
}

.db-modal.is-import .db-modal-backdrop {
  background: rgba(3, 8, 17, 0.76);
}

.db-modal.is-guide {
  z-index: 132;
}

.db-modal.is-guide .db-modal-backdrop {
  background: rgba(3, 8, 17, 0.68);
}

.db-modal.is-confirm {
  z-index: 130;
}

.db-modal.is-confirm .db-modal-backdrop {
  background: rgba(3, 8, 17, 0.58);
}

.db-modal.is-wallpaper {
  z-index: 160;
  padding: 0;
}

.db-modal.is-wallpaper .db-modal-backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

/* .btn-intent [CSS 3tkmg3opueqaw.css]: inline-flex, gap 8, radius var(--radius) − 2, 1px border/80, padding
   8 × 16, 14/20 semibold → 38 tall (fixture importDialog Cancel 81 × 38, Import Deck 139 × 38). */
.deck-builder .db-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid color-mix(in oklab, var(--border) 80%, transparent);
  border-radius: calc(var(--radius) - 2px);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
}

.deck-builder .db-btn.is-primary {
  border-color: transparent;
  background: var(--primary);
  color: var(--primary-foreground);
}

.deck-builder .db-btn.is-secondary {
  background: var(--secondary);
  color: var(--foreground);
}

/* .btn-intent:disabled only drops the hover lift — no dimming (screenshot 46: Import Deck disabled, full blue). */
.deck-builder .db-btn:disabled {
  cursor: not-allowed;
}

/* styles.css styles every label (11px / 850 / uppercase / muted) and every input / textarea (560 weight,
   radius 7); the dialogs' own labels and fields start from plain text (:where = no weight, so the
   dialogs' class rules below still win). */
:where(.db-modal) label {
  gap: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  text-transform: none;
}

:where(.db-modal) input,
:where(.db-modal) textarea {
  min-height: 0;
  font-weight: 400;
}

/* Icon-button tooltips (the shell's role=tooltip, WU3 "tooltips as the record says"): the reference's
   class is rounded-md border border-border/60 bg-popover px-2 py-1 text-[11px] font-semibold shadow-lg
   shadow-black/25 (export-menu chunk) → 81.8 × 26.5 for "Import deck" (fixture hoverTooltips). */
.deck-builder .db-tooltip {
  padding: 4px 8px;
  border-color: color-mix(in oklab, var(--border) 60%, transparent);
  border-radius: 6px;
  background: var(--popover);
  color: var(--foreground);
  font-weight: 600;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.25), 0 4px 6px -4px rgba(0, 0, 0, 0.25);
}

/* ------------------------------------------------- H3 Export Deck popover */

/* 224 × 221 at 1920, right-aligned to the trigger, 0.4rem under it (fixture workspace.exportMenu; the
   script sets top / right from the trigger's box). */
.db-export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 70;
  width: 224px;
  padding: 8px;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 12px;
  background: var(--popover);
  color: var(--foreground);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.25);
  line-height: 1.5;
  text-align: left;
}

.db-export-heading {
  margin: 0;
  padding: 0 4px 8px;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.db-export-list {
  display: grid;
  gap: 6px;
}

/* Items 206 × 40 (the wallpaper item 41: its 11px subtitle keeps line-height 1.5). */
.deck-builder .db-export-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  border-radius: 8px;
  background: color-mix(in oklab, var(--background) 72%, transparent);
  color: var(--foreground);
  text-align: left;
}

.deck-builder .db-export-option:hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: color-mix(in oklab, var(--foreground) 18%, transparent);
  background: var(--background);
}

.deck-builder .db-export-option:disabled,
.deck-builder .db-export-option[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.deck-builder .db-export-option svg.db-export-icon {
  width: 16px;
  height: 16px;
}

.db-export-copy {
  display: grid;
  gap: 2px;
}

.db-export-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.db-export-sub {
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 1.5;
}

[data-deck-export-option="deckCode"] .db-export-sub {
  line-height: 1.375;
}

/* ------------------------------------------------- H3 Export wallpaper dialog */

/* 1312 × 664.9 at 1920 (max-w-[82rem]), rounded-xl, popover surface (fixture workspace.wallpaperDialog). */
.db-wp-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: calc(100% - 2rem);
  max-width: 82rem;
  max-height: calc(100dvh - 2rem);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 12px;
  background: var(--popover);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

.db-wp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
}

.db-wp-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.deck-builder .db-wp-close {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--muted-foreground);
}

.deck-builder .db-wp-close:hover {
  background: var(--secondary);
  color: var(--foreground);
}

.deck-builder .db-wp-close svg.lucide,
.deck-builder .db-guide-close svg.lucide,
.deck-builder .db-confirm-close svg.lucide,
.deck-builder .db-im-close svg.lucide {
  width: 16px;
  height: 16px;
}

.db-wp-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px;
}

/* Preview | 19rem settings column (border-left, 24px padding), 24px apart. */
.db-wp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 19rem;
  align-items: stretch;
  gap: 24px;
}

.db-wp-settings {
  order: 2;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding-left: 24px;
  border-left: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
}

.db-wp-preview {
  order: 1;
  min-width: 0;
  align-self: start;
}

.db-wp-preview-title,
.db-wp-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0;
  color: var(--foreground);
  font-weight: 600;
}

.db-wp-preview-title {
  font-size: 14px;
  line-height: 20px;
}

.db-wp-legend {
  width: 100%;
  font-size: 12px;
  line-height: 16px;
}

.deck-builder .db-wp-dialog svg.db-wp-legend-icon {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.db-wp-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #050914;
  box-shadow: 0 22px 65px -32px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.db-wp-frame[aria-busy="true"]::after {
  content: "Updating";
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}

.db-wp-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.db-wp-resolution {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.db-wp-res-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  border-radius: 8px;
  background: color-mix(in oklab, var(--secondary) 35%, transparent);
}

.db-wp-res-option {
  position: relative;
  display: block;
  color: var(--foreground);
  cursor: pointer;
}

.deck-builder .db-wp-radio {
  position: absolute;
  inset: 0;
  z-index: 10;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.db-wp-res {
  position: relative;
  display: flex;
  min-height: 56px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  text-align: center;
}

.db-wp-res.is-checked {
  border-color: color-mix(in oklab, var(--primary) 35%, transparent);
  background: var(--background);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

.db-wp-radio:focus-visible + .db-wp-res {
  outline: 2px solid var(--ring);
}

.deck-builder .db-wp-res svg.db-wp-res-check {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
  width: 12px;
  height: 12px;
  color: var(--primary);
}

.deck-builder .db-wp-res.is-checked svg.db-wp-res-check {
  display: block;
}

.db-wp-res-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.db-wp-res-size {
  color: var(--muted-foreground);
  font-size: 9px;
  line-height: 1.5;
}

.db-wp-fields {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
}

.db-wp-field {
  display: grid;
  gap: 6px;
  color: var(--foreground);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.db-wp-control {
  position: relative;
  display: block;
}

.deck-builder .db-wp-select {
  width: 100%;
  height: 44px;
  padding: 0 36px 0 40px;
  appearance: none;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 8px;
  background: var(--background);
  color: var(--foreground);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.deck-builder .db-wp-select option {
  background: var(--popover);
}

.deck-builder .db-wp-control svg.lucide {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  color: var(--muted-foreground);
  transform: translateY(-50%);
  pointer-events: none;
}

.deck-builder .db-wp-control svg.db-wp-control-icon {
  left: 12px;
}

.deck-builder .db-wp-control svg.db-wp-chevron {
  right: 12px;
}

.deck-builder .db-wp-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  height: 44px;
  padding: 0 14px 0 12px;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 8px;
  background: var(--background);
  color: var(--foreground);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.db-wp-switch-text {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.deck-builder .db-wp-switch-text svg.lucide {
  width: 16px;
  height: 16px;
  color: var(--muted-foreground);
}

.db-wp-track {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--foreground) 16%, transparent);
}

.db-wp-thumb {
  position: absolute;
  top: 2px;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--background);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transform: translateX(2px);
  transition: transform 150ms;
}

.db-wp-switch[aria-checked="true"] .db-wp-track {
  background: var(--primary);
}

.db-wp-switch[aria-checked="true"] .db-wp-thumb {
  transform: translateX(18px);
}

.db-wp-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
}

.deck-builder .db-wp-cancel,
.deck-builder .db-wp-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.deck-builder .db-wp-cancel {
  padding: 0 16px;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  background: var(--background);
  color: var(--foreground);
}

.deck-builder .db-wp-download {
  min-width: 0;
  padding: 0 12px;
  background: var(--primary);
  color: #020618;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.deck-builder .db-wp-download:disabled {
  opacity: 0.6;
  cursor: progress;
}

.deck-builder .db-wp-download svg.lucide {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------- H2 Import Deck */

/* 1024 × 638.7 (max-w-5xl), square, dark in either theme (fixture workspace.importDialog). */
.db-im-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 64rem;
  max-height: min(90vh, 52rem);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: linear-gradient(180deg, rgba(11, 18, 29, 0.98), rgba(7, 12, 22, 0.98));
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.36);
}

.db-im-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(132, 150, 184, 0.18);
}

.db-im-eyebrow,
.db-guide-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.db-im-eyebrow {
  color: #8ea2c0;
}

.db-im-title,
.db-guide-title {
  margin: 4px 0 0;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
}

.db-im-title {
  color: #fff;
}

.db-im-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.db-im-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.db-im-chip.is-error {
  border-color: rgba(242, 138, 138, 0.32);
  background: rgba(72, 20, 28, 0.44);
  color: #ffe3e3;
}

.db-im-chip.is-warning {
  border-color: rgba(230, 182, 112, 0.3);
  background: rgba(68, 49, 18, 0.34);
  color: #f7e7c5;
}

.db-im-chip.is-ok {
  border-color: rgba(116, 239, 173, 0.24);
  background: rgba(20, 54, 41, 0.44);
  color: #def8ea;
}

.db-im-code-wrap {
  position: relative;
}

/* USE DECK CODE 122 × 36, × 36 × 36, 12px apart (fixture importDialog controls). */
.deck-builder .db-im-code-toggle,
.deck-builder .db-im-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border: 1px solid rgba(132, 150, 184, 0.22);
  background: rgba(10, 16, 26, 0.68);
  color: #dce7f5;
}

.deck-builder .db-im-code-toggle {
  padding: 0 10px;
  font-size: 0.67rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.deck-builder .db-im-close {
  flex: none;
  width: 36px;
  border-color: rgba(132, 150, 184, 0.26);
}

.deck-builder .db-im-code-toggle:hover,
.deck-builder .db-im-close:hover {
  border-color: rgba(182, 229, 255, 0.34);
  background: rgba(18, 28, 44, 0.82);
  color: #fff;
}

.db-im-code-panel {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  z-index: 5;
  width: 320px;
  padding: 12px;
  border: 1px solid rgba(132, 150, 184, 0.26);
  background: linear-gradient(180deg, rgba(10, 16, 26, 0.98), rgba(7, 12, 22, 0.98));
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.34);
}

.db-im-code-panel[hidden] {
  display: none;
}

.db-im-code-label,
.db-im-panel-title {
  color: #9fdff2;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.db-im-panel-title {
  margin: 0;
  font-size: 0.72rem;
}

.db-im-code-help {
  margin: 4px 0 0;
  color: #94a3b8;
  font-size: 0.78rem;
  line-height: 1.5;
}

.deck-builder .db-im-code-input {
  width: 100%;
  border-radius: 0;
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(132, 150, 184, 0.24);
  background: rgba(9, 15, 24, 0.94);
  color: #ebf2ff;
  font-size: 0.86rem;
  outline: none;
}

.deck-builder .db-im-code-input:focus {
  border-color: rgba(120, 196, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(120, 196, 255, 0.12);
}

.db-im-code-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.deck-builder .db-im-code-cancel,
.deck-builder .db-im-code-load {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(132, 150, 184, 0.2);
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.deck-builder .db-im-code-load {
  border-color: rgba(107, 178, 255, 0.34);
  background: rgba(26, 52, 90, 0.72);
  color: #e2f1ff;
  letter-spacing: 0.1em;
}

.deck-builder .db-im-code-load:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Body: list | 18rem panel, 16px apart, 20 × 16 padding. The textarea measures 676 × 455 (fixture); the
   reference's class says min-h-[28rem] — we draw the measured box. */
.db-im-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18rem;
  gap: 16px;
  min-height: 0;
  flex: 1 1 auto;
  padding: 16px 20px;
}

.db-im-frame {
  position: relative;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(112, 196, 214, 0.22);
  background: linear-gradient(180deg, rgba(8, 13, 26, 0.92), rgba(10, 16, 31, 0.98));
  box-shadow: inset 0 0 0 1px rgba(119, 231, 255, 0.05), 0 0 0 1px rgba(120, 160, 220, 0.04);
}

.db-im-frame.is-error {
  border-color: rgba(242, 138, 138, 0.36);
  box-shadow: inset 0 0 0 1px rgba(255, 126, 126, 0.08), 0 0 0 1px rgba(120, 160, 220, 0.04);
}

.db-im-frame.is-warning {
  border-color: rgba(230, 182, 112, 0.28);
  background: linear-gradient(180deg, rgba(14, 13, 18, 0.94), rgba(12, 12, 18, 0.98));
  box-shadow: inset 0 0 0 1px rgba(255, 210, 140, 0.05), 0 0 0 1px rgba(120, 160, 220, 0.04);
}

.deck-builder .db-im-textarea {
  position: relative;
  display: block;
  width: 100%;
  height: 455px;
  margin: 0;
  padding: 16px;
  resize: none;
  border: 0;
  background: transparent;
  color: #ebf2ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.52;
  outline: none;
}

/* Tailwind v4 preflight: placeholder = currentColor at 50 %. */
.db-im-textarea::placeholder {
  color: color-mix(in oklab, #ebf2ff 50%, transparent);
}

.db-im-markers {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.db-im-marker {
  position: absolute;
  left: 8px;
  height: 1.444rem;
  border-left: 2px solid rgba(255, 124, 124, 0.95);
  border-radius: 0 2px 2px 0;
  background: linear-gradient(90deg, rgba(120, 24, 24, 0.42), rgba(120, 24, 24, 0.18) 78%, rgba(120, 24, 24, 0.04));
  box-shadow: inset 0 0 0 1px rgba(255, 140, 140, 0.08);
}

.db-im-panel {
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid rgba(116, 239, 173, 0.22);
  background: linear-gradient(180deg, rgba(20, 54, 41, 0.52), rgba(11, 28, 21, 0.72));
}

.db-im-panel.is-error {
  border-color: rgba(242, 138, 138, 0.32);
  background: linear-gradient(180deg, rgba(55, 18, 24, 0.78), rgba(30, 11, 17, 0.86));
}

.db-im-panel.is-warning {
  border-color: rgba(230, 182, 112, 0.28);
  background: linear-gradient(180deg, rgba(54, 40, 18, 0.64), rgba(28, 21, 10, 0.78));
}

.db-im-message {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(120, 196, 255, 0.24);
  background: rgba(18, 36, 64, 0.34);
  color: #dbeeff;
  font-size: 0.82rem;
}

.db-im-message.is-error {
  border-color: rgba(242, 138, 138, 0.34);
  background: rgba(72, 20, 28, 0.44);
  color: #ffe3e3;
}

.db-im-message[hidden] {
  display: none;
}

.db-im-empty,
.db-im-result {
  display: grid;
  margin-top: 12px;
  color: #c0c9d6;
  font-size: 0.84rem;
  line-height: 1.5;
}

.db-im-empty {
  gap: 8px;
}

.db-im-result {
  gap: 12px;
}

.db-im-empty p,
.db-im-counts p,
.db-im-box p,
.db-im-box ul {
  margin: 0;
}

.db-im-primary {
  color: #d7e5f5;
}

.db-im-secondary {
  color: #94a3b8;
  font-size: 0.78rem;
}

.db-im-counts {
  display: grid;
  gap: 4px;
  color: #d7e5f5;
  font-size: 0.8rem;
}

.db-im-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(242, 138, 138, 0.34);
  background: rgba(72, 20, 28, 0.44);
}

.db-im-box.is-warnings {
  border-color: rgba(230, 182, 112, 0.3);
  background: rgba(68, 49, 18, 0.34);
}

.db-im-box-title {
  color: #ffe3e3;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.db-im-box.is-warnings .db-im-box-title {
  color: #ffe6b9;
}

.db-im-box ul {
  display: grid;
  gap: 4px;
  padding: 0;
  list-style: none;
  color: #ffe3e3;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.db-im-box.is-warnings ul {
  color: #f7e7c5;
}

.db-im-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid rgba(132, 150, 184, 0.18);
}

.db-im-footer-text {
  margin: 0;
  color: #94a3b8;
  font-size: 0.8rem;
}

.db-im-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* The reference's two-column bodies are lg: (≥ 64rem); below that the panel goes under the list. */
@media (width < 64rem) {
  .db-im-body,
  .db-wp-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .db-wp-settings {
    padding-left: 0;
    border-left: 0;
  }

  .deck-builder .db-im-textarea {
    height: 18rem;
  }
}

/* --------------------------------------------------------------- H6 Guide */

/* 896 × 473.7 (max-w-4xl), rounded-2xl, the builder's background (fixture workspace.guideDialog). */
.db-guide-dialog {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 56rem;
  max-height: min(90vh, 56rem);
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 16px;
  background: var(--background);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.36);
  outline: none;
}

.db-guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
}

.db-guide-eyebrow,
.db-guide-description,
.db-guide-footer-text {
  color: var(--muted-foreground);
}

.db-guide-title {
  color: var(--foreground);
}

.db-guide-description {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 20px;
}

.deck-builder .db-guide-close {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 6px;
  background: var(--background);
  color: var(--muted-foreground);
}

.db-guide-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 20px;
}

.db-guide-stack {
  display: grid;
  gap: 8px;
}

/* Ten 32 × 32 tools, 6px apart (fixture: x 533, 571, … 875). */
.db-guide-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.deck-builder .db-guide-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 0.35rem;
  background: color-mix(in oklab, var(--background) 95%, transparent);
  color: color-mix(in oklab, var(--foreground) 72%, transparent);
}

.deck-builder .db-guide-tool:hover {
  border-color: color-mix(in oklab, var(--foreground) 12%, transparent);
  color: var(--foreground);
}

.deck-builder .db-guide-tool svg.lucide {
  width: 16px;
  height: 16px;
}

.db-guide-field {
  position: relative;
}

.db-guide-placeholder {
  position: absolute;
  inset: 0 0 auto;
  padding: 12px 16px;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 20px;
  pointer-events: none;
}

.db-guide-placeholder[hidden] {
  display: none;
}

/* The editor: 854 × 224 (min-h-[14rem]), rounded-xl. */
.db-guide-editor {
  min-height: 14rem;
  padding: 12px 16px;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 12px;
  background: color-mix(in oklab, var(--background) 95%, transparent);
  color: var(--foreground);
  font-size: 14px;
  line-height: 20px;
  outline: none;
  overflow-wrap: anywhere;
}

.db-guide-editor:focus {
  border-color: color-mix(in oklab, var(--foreground) 20%, transparent);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--ring) 20%, transparent);
}

.db-guide-editor > :first-child {
  margin-top: 0;
}

.db-guide-editor p,
.db-guide-editor ul,
.db-guide-editor ol,
.db-guide-editor blockquote {
  margin: 0 0 8px;
}

.db-guide-editor h2 {
  margin: 12px 0 6px;
  font-size: 18px;
  line-height: 26px;
}

.db-guide-editor h3 {
  margin: 10px 0 4px;
  font-size: 15px;
  line-height: 22px;
}

.db-guide-editor blockquote {
  padding-left: 12px;
  border-left: 2px solid var(--border);
  color: var(--muted-foreground);
}

.db-guide-editor ul,
.db-guide-editor ol {
  padding-left: 22px;
}

.db-guide-editor a {
  color: var(--primary);
}

.db-guide-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
}

.db-guide-footer-text {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
}

/* The Link tool's address dialog (reference: max-w-sm rounded-xl p-4, "Add link"). */
.db-link-layer {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
}

.db-link-layer .db-modal-backdrop {
  background: rgba(3, 8, 17, 0.62);
}

.db-link-dialog {
  position: relative;
  z-index: 10;
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 24rem;
  padding: 16px;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 12px;
  background: var(--background);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.db-link-copy h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.db-link-copy p,
.db-link-error {
  margin: 4px 0 0;
  color: var(--muted-foreground);
  font-size: 14px;
}

.db-link-field {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

.deck-builder .db-link-input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 8px;
  background: var(--background);
  color: var(--foreground);
  font-size: 14px;
}

.db-link-error {
  color: var(--rose-300);
}

.db-link-error[hidden] {
  display: none;
}

.db-link-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ------------------------------------------------------- H8 Discard Draft */

/* Dark in either theme (screenshot 53): 448 wide (max-w-md), rounded-xl, gold eyebrow. */
.db-confirm {
  position: relative;
  z-index: 10;
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 28rem;
  max-height: calc(100dvh - 3rem);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 22, 32, 0.98), rgba(12, 15, 24, 0.99));
  color: #f3e7c8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 60px rgba(0, 0, 0, 0.38);
  outline: none;
}

.db-confirm-glow {
  position: absolute;
  top: 0;
  right: 20px;
  left: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 214, 143, 0.18) 24%, rgba(255, 214, 143, 0.06) 58%, transparent);
  opacity: 0.7;
  pointer-events: none;
}

.db-confirm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.db-confirm-copy {
  display: grid;
  gap: 6px;
}

.db-confirm-copy p,
.db-confirm-copy h2 {
  margin: 0;
}

.db-confirm-eyebrow {
  color: #caa66a;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.db-confirm-title {
  color: #f7edd8;
  font-size: 18px;
  font-weight: 600;
  line-height: 28px;
}

.db-confirm-body {
  color: #d9ccb3;
  font-size: 14px;
  line-height: 1.625;
}

.deck-builder .db-confirm-close {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(204, 172, 118, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: #dce7f5;
}

.db-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.deck-builder .db-confirm-cancel,
.deck-builder .db-confirm-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 20px;
}

.deck-builder .db-confirm-cancel {
  color: #b9aa8e;
  font-weight: 500;
}

.deck-builder .db-confirm-cancel:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f0e4cc;
}

.deck-builder .db-confirm-danger {
  border: 1px solid rgba(244, 114, 114, 0.3);
  background: rgba(127, 29, 29, 0.42);
  color: #ffe3e3;
  font-weight: 600;
}

.deck-builder .db-confirm-danger:hover {
  border-color: rgba(252, 165, 165, 0.38);
  background: rgba(127, 29, 29, 0.54);
}

/* ------------------------------------------------- H8 the deck library view */

/* [local policy 2026-10-06] a view of /decks/ (?view=library) after screenshot 54: eyebrow + title, New
   Deck on the right, then the saved decks or the sign-in card. */
.deck-builder.is-library > :not(.db-library):not(.db-toaster):not(.db-modal) {
  display: none !important;
}

.db-library {
  display: grid;
  gap: 16px;
  max-width: 1856px;
  margin: 0 auto;
  padding: 16px 0 48px;
}

.db-library[hidden] {
  display: none;
}

.db-library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.db-library-titles {
  display: flex;
  align-items: center;
  gap: 16px;
}

.db-library-eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.db-library-title {
  margin: 0;
  color: var(--foreground);
  font-size: 36px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.deck-builder .db-library-new {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border-radius: 6px;
  background: var(--primary);
  color: #020618;
  font-size: 15px;
  font-weight: 600;
}

.deck-builder .db-library-new svg.lucide,
.deck-builder .db-library-signin svg.lucide {
  width: 16px;
  height: 16px;
}

.db-library-list {
  display: grid;
  gap: 8px;
}

.db-library-note {
  margin: 0;
  padding: 24px;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 16px;
  color: var(--muted-foreground);
  font-size: 14px;
}

.db-library-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 24px;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 16px;
  background: color-mix(in oklab, var(--card) 80%, transparent);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.6);
}

.db-library-lock {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 8px;
  background: var(--secondary);
  color: var(--muted-foreground);
}

.db-library-copy {
  flex: 1 1 auto;
  max-width: 44rem;
}

.db-library-copy h2 {
  margin: 0;
  color: var(--foreground);
  font-size: 18px;
  font-weight: 600;
  line-height: 28px;
}

.db-library-copy p {
  margin: 4px 0 0;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 24px;
}

.db-library-signin,
.db-library-row {
  color: var(--foreground);
  text-decoration: none;
}

.db-library-signin {
  display: inline-flex;
  flex: none;
  align-self: center;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin-left: auto;
  padding: 0 16px;
  border: 1px solid color-mix(in oklab, var(--border) 80%, transparent);
  border-radius: 4px;
  background: var(--secondary);
  font-size: 14px;
  font-weight: 600;
}

.db-library-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 12px;
  background: color-mix(in oklab, var(--card) 80%, transparent);
}

.db-library-row:hover {
  border-color: color-mix(in oklab, var(--foreground) 20%, transparent);
}

.db-library-art {
  width: 48px;
  height: 67px;
  border-radius: 4px;
  background: var(--secondary);
  object-fit: cover;
}

.db-library-row-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--muted-foreground);
  font-size: 13px;
}

.db-library-row-text strong {
  overflow: hidden;
  color: var(--foreground);
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-library-status {
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.db-library-status.is-ready {
  color: lab(75.0771% -60.7313 19.4147); /* emerald-400 [DOM theme.dark.vars] */
}

.db-library-status.is-incomplete {
  color: var(--amber-300);
}

.db-library-edit {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

/* ---------------------------------------------------- L6 Show deck only */

/* The site header, catalog and splitter go; the workspace fills the viewport (1856 × 1080 at 1920) under
   one 47px toolbar row: name 256 × 34, view tabs, then Save · Import · Export · Private · Guide (icon) ·
   Try It Out · Discard (icon) · Show card browser, 8px apart, 12px side padding (fixture
   workspace.deckOnlyMode). Two columns and four Main rows per line come from L5 (WU2) at this width. */
@media (min-width: 64rem) {
  body.db-deck-only .site-header {
    display: none;
  }

  .deck-builder.is-deck-only {
    --db-header-h: 0px !important;
    min-height: 100vh;
  }

  .deck-builder.is-deck-only .db-split {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .deck-builder.is-deck-only .db-catalog-pane,
  .deck-builder.is-deck-only .db-splitter {
    display: none !important;
  }

  .deck-builder.is-deck-only .db-workspace-pane {
    top: 0;
    height: 100vh;
  }

  .deck-builder.is-deck-only .db-ws-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
  }

  .deck-builder.is-deck-only .db-ws-row,
  .deck-builder.is-deck-only .db-ws-toolbar {
    display: contents;
  }

  .deck-builder.is-deck-only .db-ws-heading {
    display: none;
  }

  .deck-builder.is-deck-only .db-ws-name {
    flex: 0 0 256px;
    order: 1;
  }

  .deck-builder.is-deck-only .db-view-tabs {
    order: 2;
  }

  .deck-builder.is-deck-only .db-issues-wrap {
    order: 3;
  }

  .deck-builder.is-deck-only [data-deck-workspace-toolbar-action="save"] {
    order: 4;
    margin-left: auto;
  }

  .deck-builder.is-deck-only [data-deck-workspace-toolbar-action="importDeck"] {
    order: 5;
  }

  .deck-builder.is-deck-only [data-deck-workspace-toolbar-action="exportDeck"] {
    order: 6;
  }

  .deck-builder.is-deck-only [data-deck-workspace-toolbar-action="private"] {
    order: 7;
  }

  .deck-builder.is-deck-only [data-deck-workspace-toolbar-action="guide"] {
    order: 8;
    width: 28px;
    padding: 0;
  }

  .deck-builder.is-deck-only [data-deck-workspace-toolbar-action="guide"] .db-tool-text,
  .deck-builder.is-deck-only .db-discard > span {
    display: none;
  }

  .deck-builder.is-deck-only .db-try {
    order: 9;
  }

  .deck-builder.is-deck-only .db-discard {
    order: 10;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: 0;
    padding: 0;
    border: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
    border-radius: calc(var(--radius) - 2px);
    background: color-mix(in oklab, var(--background) 78%, transparent);
    color: color-mix(in oklab, var(--foreground) 82%, transparent);
  }

  .deck-builder.is-deck-only [data-deck-workspace-toolbar-action="deckOnly"] {
    order: 11;
    border-color: color-mix(in oklab, var(--primary) 35%, transparent);
    background: color-mix(in oklab, var(--primary) 12%, transparent);
  }
}
