/* ---------- deck workshop ---------- */
main:has(.db-shell) { max-width: 1320px; padding-top: 22px; }
.db-shell { display: grid; gap: 14px; }
.db-hero { position: relative; overflow: hidden; padding: 24px;
  border: 1px solid #4b4774; border-radius: 18px;
  background:
    radial-gradient(circle at 92% 10%, rgba(187,154,247,.24), transparent 34%),
    radial-gradient(circle at 72% 120%, rgba(122,162,247,.18), transparent 38%),
    linear-gradient(145deg, #25263a, #191d2a 68%); }
.db-hero::after { content: ""; position: absolute; right: -40px; bottom: -75px;
  width: 230px; height: 230px; border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%; box-shadow: 0 0 0 26px rgba(255,255,255,.025),
    0 0 0 54px rgba(255,255,255,.018); pointer-events: none; }
.db-eyebrow { color: var(--plan); font-size: 10px; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; }
.db-hero h2 { margin: 4px 0 4px; font-size: clamp(25px, 4vw, 38px);
  line-height: 1.08; letter-spacing: -.025em; }
.db-hero p { max-width: 640px; margin: 0; color: #b8bdca; }
.db-hero-actions { display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap; margin-top: 18px; position: relative; z-index: 1; }
.db-stats { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.db-stat { display: inline-flex; gap: 5px; align-items: baseline; padding: 5px 9px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.11);
  background: rgba(8,10,18,.27); color: var(--dim); font-size: 11px; }
.db-stat b { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.db-panel { background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px; min-width: 0; }
.db-panel-head { display: flex; gap: 12px; align-items: flex-end;
  justify-content: space-between; margin-bottom: 12px; }
.db-panel-head h2, .db-panel-head h3 { margin: 0; }
.db-panel-head .sub { max-width: 600px; }
.db-list-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr);
  gap: 14px; align-items: start; }
.db-deck-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px; }
.db-deck-tile { display: flex; flex-direction: column; min-height: 125px;
  border: 1px solid var(--border2); border-radius: 12px; padding: 13px;
  background: linear-gradient(145deg, var(--panel2), #1d2230);
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease; }
.db-deck-tile:hover { transform: translateY(-2px); border-color: #59627f;
  box-shadow: 0 9px 25px rgba(5,7,12,.23); }
.db-deck-title { font-weight: 760; line-height: 1.25; font-size: 14px; }
.db-deck-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  margin-top: 5px; color: var(--faint); font-size: 11px; }
.db-deck-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto;
  padding-top: 12px; }
.db-deck-actions button { min-height: 28px; padding: 4px 9px; }
.db-card-link { appearance: none; min-height: 0; padding: 0; border: 0;
  background: none; color: var(--accent); font: inherit; text-align: left;
  cursor: pointer; text-decoration: underline; text-decoration-style: dotted;
  text-underline-offset: 3px; }
.db-card-link:hover { color: #a9c2fa; }
.db-search { position: relative; }
.db-search input, .dbfield input { width: 100%; min-height: 40px; padding: 9px 11px;
  background: var(--panel2); color: var(--text); border: 1px solid var(--border2);
  border-radius: 10px; font: inherit; }
.db-search input:focus, .dbfield input:focus, .dbtext:focus { outline: none;
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(122,162,247,.12); }
.db-result-list { display: grid; gap: 5px; margin-top: 8px; }
.db-result { display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px; align-items: center; min-height: 38px; padding: 7px 9px;
  background: var(--panel2); border: 1px solid var(--border); border-radius: 9px; }
.db-result .db-card-link { white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; text-decoration: none; }
.db-result-add { min-height: 25px; padding: 2px 8px; border-radius: 8px;
  color: var(--good); }
.db-empty { padding: 18px; border: 1px dashed var(--border2); border-radius: 11px;
  color: var(--dim); text-align: center; }
.db-editor-head { display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px; align-items: end; }
.db-editor-head h2 { margin: 0; }
.dbfield { display: block; font-size: 12px; color: var(--dim); }
.dbfield input { display: block; margin-top: 5px; color: var(--text); }
.db-workbench { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .75fr);
  gap: 14px; align-items: start; }
.db-compose, .db-inspector { min-width: 0; }
.db-inspector { display: grid; gap: 12px; position: sticky;
  top: calc(12px + env(safe-area-inset-top)); }
.dbtext { width: 100%; min-height: 480px; margin-top: 8px; padding: 14px;
  font-family: ui-monospace, "Cascadia Code", monospace; font-size: 13px;
  line-height: 1.65; resize: vertical; background: #151925; color: var(--text);
  border: 1px solid var(--border2); border-radius: 11px; }
.db-section-label { margin: 0 0 7px; color: var(--faint); font-size: 10px;
  font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.db-entry-list { display: grid; gap: 5px; max-height: 430px; overflow: auto;
  padding-right: 3px; }
.db-entry { display: grid; grid-template-columns: 27px minmax(0, 1fr) auto;
  gap: 7px; align-items: center; min-height: 38px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--panel2); }
.db-entry + .db-section-label { margin-top: 8px; }
.db-count { display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 8px; background: rgba(122,162,247,.1); color: var(--accent);
  font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.db-tier { width: 8px; height: 8px; border-radius: 50%; background: var(--good);
  box-shadow: 0 0 0 3px rgba(158,206,106,.1); }
.db-tier.experimental { background: var(--warn); box-shadow: 0 0 0 3px rgba(224,175,104,.1); }
.db-tier.unmodeled, .db-tier.unknown, .db-tier.uncheckable {
  background: var(--bad); box-shadow: 0 0 0 3px rgba(247,118,142,.1); }
#db-report:not(:empty) { margin-top: 12px; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: rgba(8,10,16,.24); }
.dbgood { color: var(--good); font-size: 13px; }
.dbbad { color: var(--bad); font-size: 13px; }
.dbbad ul { margin: 6px 0 0; padding-left: 20px; columns: 2; }
.dbwarn { color: var(--warn); font-size: 13px; margin-top: 8px; }
@media (max-width: 900px) {
  .db-list-layout, .db-workbench { grid-template-columns: 1fr; }
  .db-inspector { position: static; }
}
@media (max-width: 620px) {
  main:has(.db-shell) { padding: 10px 10px 180px; }
  .db-shell { gap: 10px; }
  .db-hero, .db-panel { padding: 15px; border-radius: 13px; }
  .db-deck-grid { grid-template-columns: 1fr; }
  .db-deck-tile { min-height: 112px; }
  .db-panel-head, .db-editor-head { display: grid; grid-template-columns: 1fr; }
  .dbtext { min-height: 380px; }
  .dbbad ul { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .db-deck-tile { transition: none; }
  .db-deck-tile:hover { transform: none; }
}
/* ---- Netrunner deck builder (/decks, Netrunner tab). Own prefix, own rules:
   the .db-* shell above is reused as-is, so a change here can never reach the
   Magic workshop. Anything toggled with el.hidden gets an explicit override —
   an author display: rule outranks the UA's [hidden] (ISS-wt87-1). ---- */
.nrdb-workbench { display: grid; gap: 12px; align-items: start;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(260px, .7fr); }
.nrdb-col { min-width: 0; }
.nrdb-side { position: sticky; top: 14px; }
.nrdb-decklist { max-height: 520px; }
.nrdb-entry { grid-template-columns: 27px minmax(0, 1fr) auto auto auto; }
.nrdb-entry button.quick { min-height: 24px; padding: 1px 8px; border-radius: 8px; }
.nrdb-entry-inf { color: var(--plan); font-size: 11px; letter-spacing: .1em; }
.nrdb-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px; align-items: center; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--panel2); }
.nrdb-card[hidden] { display: none; }
.nrdb-thumb { width: 44px; height: 44px; object-fit: cover; object-position: top center;
  border-radius: 7px; border: 1px solid var(--border2); background: var(--panel3); }
.nrdb-thumb-blank { display: inline-block; }
.nrdb-card-main { min-width: 0; display: grid; gap: 2px; }
.nrdb-card-meta { color: var(--dim); font-size: 11px; overflow: hidden;
  text-overflow: ellipsis; }
.nrdb-card-actions { display: flex; gap: 5px; align-items: center; }
.nrdb-card-actions button.quick { min-height: 30px; min-width: 32px; padding: 2px 9px; }
.nrdb-pips { color: var(--plan); letter-spacing: .08em; font-size: 10px; }
.nrdb-results { max-height: 620px; overflow: auto; }
.nrdb-bundled .db-deck-tile { min-height: 0; }
.nrdb-filters { display: grid; gap: 7px; }
.nrdb-filter-row { display: flex; gap: 6px; flex-wrap: wrap; }
.nrdb-filter-row[hidden] { display: none; }
.nrdb-filter-row select, .nrdb-filter-row input { flex: 1 1 130px; min-width: 0;
  min-height: 36px; padding: 7px 9px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; font-family: inherit;
  font-size: 13px; }
.nrdb-check { display: flex; gap: 7px; align-items: center; color: var(--dim);
  font-size: 12px; }
.nrdb-meter.nrdb-bad b { color: var(--bad); }
.nrdb-meter.nrdb-warn b { color: var(--warn); }
.nrdb-issues:not(:empty) { margin-top: 11px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: rgba(8,10,16,.24); }
.nrdb-issues ul { margin: 6px 0 0; padding-left: 20px; }
.nrdb-io { margin-top: 12px; }
.nrdb-io > summary { cursor: pointer; color: var(--dim); font-size: 13px; }
.nrdb-iotext { min-height: 190px; margin-top: 8px; }
.nrdb-identity-chosen { margin-bottom: 9px; }
.nrdb-idpick > summary { cursor: pointer; color: var(--dim); font-size: 12px;
  margin-bottom: 7px; }
.nrdb-idpick[hidden] { display: none; }
.nrdb-preview img { width: 100%; border-radius: 10px; border: 1px solid var(--border2); }
.nrdb-preview-title { font-weight: 760; margin-top: 8px; }
.nrdb-preview-text { margin-top: 8px; font-size: 13px; line-height: 1.55;
  white-space: pre-wrap; }
#nrdb-save[disabled] { opacity: .5; cursor: not-allowed; }
/* The identity picker lists every identity of a side (81 of them): it scrolls
   inside its own panel at every width instead of pushing the card search away. */
#nrdb-idresults { max-height: 50vh; overflow-y: auto; overscroll-behavior: contain; }
/* Phone-only pieces: the pinned summary bar and the card-preview dialog. */
.nrdb-sumbar { display: none; }
.nrdb-dialog { width: min(420px, 94vw); max-height: 88vh; padding: 0; overflow: auto;
  background: var(--panel); color: var(--text); border: 1px solid var(--border2);
  border-radius: 14px; box-shadow: 0 18px 60px rgba(0,0,0,.6); }
.nrdb-dialog::backdrop { background: rgba(8,10,14,.72); }
.nrdb-dialog-bar { position: sticky; top: 0; z-index: 1; display: flex;
  justify-content: flex-end; padding: 8px 10px; background: var(--panel);
  border-bottom: 1px solid var(--border); }
.nrdb-dialog-bar button.quick { min-height: 40px; min-width: 88px; }
#nrdb-dialog-body { padding: 12px 14px 16px; }
.nrdb-dialog .nrdb-preview img { display: block; width: auto; max-width: 100%;
  max-height: 55vh; margin: 0 auto; }
@media (max-width: 1100px) {
  .nrdb-workbench { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .nrdb-side { grid-column: 1 / -1; position: static; }
}
@media (max-width: 780px) {
  .nrdb-workbench { grid-template-columns: 1fr; }
  .nrdb-side { grid-column: auto; }
  .nrdb-decklist { max-height: none; }
  /* 188 result rows made the page 25,000px tall: the list scrolls in its panel. */
  .nrdb-results { max-height: 65vh; overscroll-behavior: contain; }
  .nrdb-card-main .db-card-link, .nrdb-entry .db-card-link { display: flex;
    align-items: center; min-height: 38px; }
  /* What the player is building stays on screen while they search. */
  .nrdb-sumbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
    position: sticky; top: env(safe-area-inset-top); z-index: 4;
    min-width: 0;
    padding: 6px 10px; background: var(--panel); border: 1px solid var(--border2);
    border-radius: 12px; box-shadow: 0 6px 18px rgba(5,7,12,.4); }
  .nrdb-sum-text { display: contents; }
  .nrdb-sum-name { flex: 1 1 100%; min-width: 0; overflow: hidden; white-space: nowrap;
    text-overflow: ellipsis; color: var(--text); font-weight: 700; font-size: 12px; }
  .nrdb-sum-bits { display: flex; flex-wrap: wrap; gap: 2px 10px; flex: 1 1 0; min-width: 0;
    font-size: 12px; color: var(--dim); }
  .nrdb-sum-bit { white-space: nowrap; font-variant-numeric: tabular-nums; }
  .nrdb-sum-bit b { color: var(--text); font-size: 13px; }
  .nrdb-sum-bit.nrdb-bad b { color: var(--bad); }
  .nrdb-sum-bit.nrdb-warn b { color: var(--warn); }
  .nrdb-sumbar button.quick { min-height: 38px; padding: 4px 10px; flex: 0 0 auto; }
  #nrdb-deckcol, #nrdb-searchcol { scroll-margin-top: 92px; }
  .nrdb-card { grid-template-columns: auto minmax(0, 1fr); }
  .nrdb-card-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .nrdb-card-actions button.quick { min-height: 38px; min-width: 44px; }
  .nrdb-entry button.quick { min-height: 34px; min-width: 34px; }
}
@media (max-width: 760px) {
  /* The preview opens as a dialog here, so the inline panel would only sit at the
     bottom of the page promising a preview it never shows. */
  .nrdb-side { display: none; }
}
.pftext { min-height: 480px; }
.pfmeta { display:flex; gap:7px; flex-wrap:wrap; margin-top:5px; }
