/* v59: isolated Blueprint and Blackjack Table themes. Existing theme CSS is untouched. */
html[data-theme="blueprint"],.theme-choice[data-theme-choice="blueprint"]{
  --bg:#0a2a43;--sidebar:#061c2d;--surface:#0c304b;--surface2:#123d59;--surface3:#174a6e;
  --text:#f2f7fa;--muted:#afc7d4;--accent:#9fd8e8;--accent2:#79bdd4;--border:#6e9fb6;
  --good:#a5e3cb;--warn:#f4d79f;--danger:#ffb4b6;--shadow:none;
  --theme-top:#082238;--theme-paper:#08283f;--theme-paper-text:#f2f7fa;--theme-paper-muted:#afc7d4;
  --theme-panel:#061c2d;--theme-highlight:#bcecf7;--theme-primary:#9fd8e8;--theme-primary-ink:#061c2d;
  --theme-wash:#9fd8e80a;--theme-mark:#9fd8e8;--theme-font:ui-sans-serif,system-ui,-apple-system,sans-serif;
  --swatch-bg:#0a2a43;--swatch-side:#061c2d;--swatch-top:#174a6e;--swatch-panel:#0c304b;
  --swatch-paper:#08283f;--swatch-line:#6e9fb6;--swatch-accent:#9fd8e8;
}
html[data-theme="blackjack-table"],.theme-choice[data-theme-choice="blackjack-table"]{
  --bg:#0b4a32;--sidebar:#06291d;--surface:#073524;--surface2:#0b402c;--surface3:#12513a;
  --text:#f3e8cf;--muted:#c6bfa8;--accent:#c8a24d;--accent2:#e5c887;--border:#8f783d;
  --good:#b6dfb2;--warn:#f2d799;--danger:#ffb6a8;--shadow:0 10px 24px #00170f55;
  --theme-top:#0b0b0b;--theme-paper:#052b1d;--theme-paper-text:#f3e8cf;--theme-paper-muted:#c6bfa8;
  --theme-panel:#062319;--theme-highlight:#e5c887;--theme-primary:#c8a24d;--theme-primary-ink:#0b0b0b;
  --theme-wash:#c8a24d0b;--theme-mark:#8c1d1d;--theme-font:ui-sans-serif,system-ui,-apple-system,sans-serif;
  --swatch-bg:#0b4a32;--swatch-side:#06291d;--swatch-top:#0b0b0b;--swatch-panel:#073524;
  --swatch-paper:#052b1d;--swatch-line:#8f783d;--swatch-accent:#c8a24d;
}

/* Stable dark surfaces, including inputs, tables, dialogs, and mobile sheets.
   Specificity beats the old non-Archival material rules; geometry stays intact. */
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]){
  color-scheme:dark;font-family:var(--theme-font);--mobile-dialog-background:var(--surface);
}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) body{
  background:var(--bg);color:var(--text);
}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) :is(.main-shell,.sidebar,.topbar){
  background-image:none;
}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) .sidebar{
  background-color:var(--sidebar);border-color:var(--border);box-shadow:inset -1px 0 #0008;
}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) .topbar{
  background-color:var(--theme-top);box-shadow:0 4px 14px #0005;
}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) .card{
  background:var(--surface);color:var(--text);border-style:solid;box-shadow:var(--shadow);
}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) :is(.page-head h1,.card-title,.item-card h3,.block-head strong,.big-status,.metric .value,dialog h2){
  font-family:var(--theme-font);color:var(--text);
}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) :is(.metric-grid,.feed,.list-plain,.table-wrap,.input,textarea,select){
  background:var(--theme-paper);color:var(--theme-paper-text);box-shadow:inset 0 1px 5px #0005;
}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) :is(.toggle-row,.checkbox-row,.scope-group legend,.channel-option,.attachment-chip,.empty){color:var(--text)}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) :is(.item-card p,.feed time,.log-details,dialog p,.channel-option small){color:var(--muted)}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) :is(.channel-results,.log-details,.emoji-picker,.mode-panel,.plan-tile,.emoji-choice,.month-day-choice){
  background:var(--surface2);color:var(--text);border-color:var(--border);
}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) :is(.plan-tile.selected,.emoji-choice[aria-pressed="true"]){
  background:var(--surface3);color:var(--text);border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent);
}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) .btn{
  transform:none;box-shadow:inset 0 1px #ffffff14,0 2px 3px #0008;
}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) .btn.primary{
  background:var(--theme-primary);color:var(--theme-primary-ink);box-shadow:inset 0 1px #ffffff25,0 2px 4px #0008;
}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) .btn.danger{
  background:var(--theme-panel);color:var(--danger);border-color:var(--danger);
}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) .warning{
  background:var(--theme-panel);color:var(--warn);border-color:var(--warn);
}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) .mock-notice{
  background:var(--surface2);color:var(--text);border-color:var(--border);box-shadow:none;
}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) .mock-notice b{color:var(--accent);border-color:var(--border)}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) dialog{
  background:var(--surface);color:var(--text);border-color:var(--border);box-shadow:var(--shadow);
}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) dialog::backdrop{background:#000c}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) .toast{
  background:var(--surface2);color:var(--text);border-color:var(--border);border-left-color:var(--accent);
}
/* Discord message previews retain their familiar, readable Discord surface. */
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) .preview-card{
  background:#303237;color:#dbdee4;text-shadow:none;
}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) .preview-card :is(.micro,.hint){color:#bec5d0;text-shadow:none}
html:root:is([data-theme="blueprint"],[data-theme="blackjack-table"]) .preview-card .discord-text{color:#dbdee4}

/* BLUEPRINT: drafting grid and thin drawn frames; all measurement marks are decorative. */
html:root[data-theme="blueprint"] body,
html:root[data-theme="blueprint"] .main-shell{
  background-color:#0a2a43;
  background-image:linear-gradient(#9fd8e809 1px,transparent 1px),linear-gradient(90deg,#9fd8e809 1px,transparent 1px),
    linear-gradient(#9fd8e810 1px,transparent 1px),linear-gradient(90deg,#9fd8e810 1px,transparent 1px);
  background-size:24px 24px,24px 24px,120px 120px,120px 120px;
}
html:root[data-theme="blueprint"] .sidebar{background:#061c2d;border-right-color:transparent;box-shadow:inset -1px 0 #6e9fb6}
html:root[data-theme="blueprint"] .topbar{background:#082238;border-bottom-color:transparent;box-shadow:inset 0 -1px #6e9fb6}
html:root[data-theme="blueprint"] .card{
  background:#0c304bf5;border-color:transparent;border-radius:0;
  outline:1px solid #6e9fb6;outline-offset:-1px;box-shadow:none;
}
html:root[data-theme="blueprint"] .card.danger-zone{outline-color:var(--danger)}
html:root[data-theme="blueprint"] .card::before,
html:root[data-theme="blueprint"] .card::after{
  background:none;border-color:#9fd8e8;width:12px;height:12px;pointer-events:none;
}
html:root[data-theme="blueprint"] .card-header{border-bottom-color:transparent;box-shadow:inset 0 -1px #6e9fb6}
html:root[data-theme="blueprint"] .page-head{border-bottom-color:transparent;box-shadow:inset 0 -1px #6e9fb6}
html:root[data-theme="blueprint"] .page-head::after{
  background:none;border:0;border-left:1px solid #9fd8e8;border-right:1px solid #9fd8e8;
  border-top:1px solid #9fd8e8;transform:none;width:54px;height:7px;bottom:-3px;
}
html:root[data-theme="blueprint"] :is(.page-head h1,.card-title,.section-label,dialog h2){
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;text-shadow:none;font-variant:normal;
}
html:root[data-theme="blueprint"] :is(.btn,.input,select,textarea,.tabbar,.composer-block,.plan-tile,dialog){border-radius:1px;box-shadow:none}
html:root[data-theme="blueprint"] .btn.primary{background:#9fd8e8;color:#061c2d;box-shadow:none}
html:root[data-theme="blueprint"] .btn.secondary{background:#174a6e}
html:root[data-theme="blueprint"] .nav-item.active{background:#174a6e;color:#f2f7fa;box-shadow:inset 0 0 0 1px #9fd8e8}
html:root[data-theme="blueprint"] .nav-item.active span{color:#f2f7fa}
html:root[data-theme="blueprint"] .brandmark{background:#061c2d;color:#9fd8e8;box-shadow:inset 0 0 0 1px #9fd8e8}
html:root[data-theme="blueprint"] :is(.metric-grid,.feed,.list-plain,.table-wrap){box-shadow:none}
html:root[data-theme="blueprint"] .divider{border-top-color:#6e9fb6}

/* BLACKJACK TABLE: quiet felt grain, betting-zone outlines, and restrained gold hardware. */
html:root[data-theme="blackjack-table"] body,
html:root[data-theme="blackjack-table"] .main-shell{
  background-color:#0b4a32;
  background-image:radial-gradient(#f3e8cf0a .5px,transparent .8px),
    radial-gradient(#0000000c .5px,transparent .8px),
    radial-gradient(ellipse at 50% 0,#23715130,transparent 70%);
  background-size:3px 3px,4px 4px,auto;background-position:0 0,1px 1px,0 0;
}
html:root[data-theme="blackjack-table"] .sidebar{background:linear-gradient(90deg,#062319,#073524);border-right-color:#8f783d;box-shadow:inset -1px 0 #0008}
html:root[data-theme="blackjack-table"] .topbar{background:linear-gradient(#1b1a16,#0b0b0b);border-bottom-color:#8f783d;box-shadow:0 4px 12px #00170f50}
html:root[data-theme="blackjack-table"] .card{
  background:radial-gradient(#f3e8cf07 .5px,transparent .8px) 0 0 / 3px 3px,#073524;
  border-radius:18px;border-color:#8f783d;box-shadow:inset 0 0 0 4px #c8a24d12,0 9px 20px #00170f45;
}
html:root[data-theme="blackjack-table"] .card::before,
html:root[data-theme="blackjack-table"] .card::after{display:none}
html:root[data-theme="blackjack-table"] .card.danger-zone{border-color:#ba7770}
html:root[data-theme="blackjack-table"] .card-header{border-bottom-color:#8f783d}
html:root[data-theme="blackjack-table"] :is(.page-head h1,.card-title,.item-card h3,dialog h2){
  font-family:Georgia,"Times New Roman",serif;font-variant:normal;text-shadow:none;
}
html:root[data-theme="blackjack-table"] .page-head{border-bottom-color:#8f783d}
html:root[data-theme="blackjack-table"] .page-head::after{
  content:"♠";width:24px;height:24px;bottom:-12px;transform:none;border:0;
  background:#0b4a32;color:#c8a24d;font:20px/24px Georgia,serif;text-align:center;pointer-events:none;
}
html:root[data-theme="blackjack-table"] .btn{
  border-radius:999px;background:#0b402c;border-color:#8f783d;box-shadow:inset 0 0 0 2px #f3e8cf0d,0 2px 3px #00170f70;
}
html:root[data-theme="blackjack-table"] .btn.primary{background:#c8a24d;color:#0b0b0b;box-shadow:inset 0 0 0 2px #f3e8cf44,0 2px 3px #00170f70}
html:root[data-theme="blackjack-table"] .auth-submit{background:#c8a24d;color:#0b0b0b}
html:root[data-theme="blackjack-table"] .btn.danger{background:#8c1d1d;color:#f3e8cf;border-color:#ba7770}
html:root[data-theme="blackjack-table"] :is(.input,select,textarea){border-radius:7px;background:#052b1d}
html:root[data-theme="blackjack-table"] :is(.tabbar,.composer-block,.plan-tile,dialog){border-radius:12px}
html:root[data-theme="blackjack-table"] .tabbar button{border-radius:9px}
html:root[data-theme="blackjack-table"] .nav-item.active{background:#c8a24d;color:#0b0b0b;box-shadow:inset 0 0 0 1px #f3e8cf88}
html:root[data-theme="blackjack-table"] .nav-item.active span{color:#0b0b0b}
html:root[data-theme="blackjack-table"] .brandmark{background:#8c1d1d;color:#f3e8cf;box-shadow:inset 0 0 0 2px #c8a24d}
html:root[data-theme="blackjack-table"] :is(.metric-grid,.feed,.list-plain,.table-wrap){border-radius:10px;box-shadow:none}
html:root[data-theme="blackjack-table"] .table th{background:#0b0b0b;color:#f3e8cf}
html:root[data-theme="blackjack-table"] .divider{border-top-color:#8f783d}

/* Picker-local tokens keep these previews independent of the active global theme. */
.themes-gallery .theme-choice:is([data-theme-choice="blueprint"],[data-theme-choice="blackjack-table"]){
  background:var(--surface);color:var(--text);border-color:var(--border);
  font-family:var(--theme-font);box-shadow:var(--shadow);transform:none;
}
.themes-gallery .theme-choice:is([data-theme-choice="blueprint"],[data-theme-choice="blackjack-table"]) strong{font-family:var(--theme-font)}
.themes-gallery .theme-choice:is([data-theme-choice="blueprint"],[data-theme-choice="blackjack-table"]):is(:hover,[aria-pressed="true"]){
  border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent);
}
.themes-gallery .theme-choice[data-theme-choice="blueprint"]{border-radius:0;box-shadow:none}
.themes-gallery .theme-choice[data-theme-choice="blueprint"] strong{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.theme-choice[data-theme-choice="blueprint"] .theme-swatch{
  background:linear-gradient(#9fd8e812 1px,transparent 1px),linear-gradient(90deg,#9fd8e812 1px,transparent 1px),#0a2a43;
  background-size:12px 12px;border-radius:0;
}
.theme-choice[data-theme-choice="blueprint"] .theme-swatch i{border-radius:0;box-shadow:none}
.themes-gallery .theme-choice[data-theme-choice="blackjack-table"]{border-radius:16px}
.themes-gallery .theme-choice[data-theme-choice="blackjack-table"] strong{font-family:Georgia,"Times New Roman",serif}
.theme-choice[data-theme-choice="blackjack-table"] .theme-swatch{
  background:radial-gradient(#f3e8cf14 .5px,transparent .8px) 0 0 / 3px 3px,#0b4a32;border-radius:10px;
}
.theme-choice[data-theme-choice="blackjack-table"] .theme-swatch i{
  border-radius:12px 12px 5px 5px;border-color:#c8a24d;box-shadow:inset 0 0 0 2px #f3e8cf12;
}
