/* ============================================================
   17-detail.css — 5 Oct 2026, later: the card detail in three tabs
   (Info / Printings / Rules) with the deck view's tab bar and the larger,
   squarer controls of the filter sheet; the binder picker as tiles; the
   scanner's "Add to" with binders and decks. Loads last and overrides,
   like 16-tidy.css.
   ============================================================ */

/* ============================================================
   CARD DETAIL (js/search.js buildDetail)
   ============================================================ */
.detail h3{font-size:24px; line-height:1.15; margin-bottom:6px;}
.detail .dtype{font-size:14.5px; margin-bottom:0;}
.detail .dtype .mana-sym{width:19px; height:19px;}
.detail-back.btn{margin-bottom:10px;}

/* the tab bar: .ui-tabs in 16-tidy.css, three equal tabs here at any width */
.dtabs{margin:14px 0 18px;}
.dpane[hidden]{display:none;}
.detail .dtext{font-size:15px; line-height:1.6; color:var(--text); margin-bottom:16px;}

/* small capitals over each block, a size up */
.detail .dm-title{font-size:12.5px; margin-bottom:10px;}
.dsec{margin-bottom:22px;}
.dsec .dm-title{margin-bottom:10px;}
.dtags{gap:8px; margin-bottom:18px;}
.dtag{font-size:12.5px; padding:5px 12px; border-radius:8px;}

.dprices{border-radius:10px;}
.dp-row{grid-template-columns:minmax(0,1fr) minmax(62px,auto) minmax(62px,auto); gap:14px; padding:11px 14px; font-size:15px;}
.dp-head{padding:8px 14px; font-size:11.5px;}
.dfacts{gap:10px 18px; font-size:15px;}
.dset-icon{width:18px; height:18px;}
.dlegal{gap:8px;}
.lg-cell{padding:11px 13px; border-radius:10px; font-size:14.5px;}
.lg-st{font-size:12.5px;}

/* your copies, adding one, the deck the card is in */
.detail-manage{padding:16px; border-radius:var(--r2); margin-bottom:18px;}
.dm-fields{gap:12px;}
.dm-field{min-height:48px; gap:14px;}
.dm-label{flex-basis:96px; font-size:14.5px;}
.dm-binder-name{font-size:15px;}
.detail .btn{padding:11px 18px; font-size:15px; border-radius:10px;}
.detail .btn.sm{padding:10px 16px; font-size:14.5px;}
.detail-manage .qedit-select{min-height:46px; padding:10px 14px; border-radius:10px; font-size:15px;}
.detail .seg{border-radius:10px;}
.detail .seg button{padding:11px 18px; font-size:14.5px;}
.detail .qty-box{gap:6px;}
.detail .qty-btn{width:40px; height:40px; border-radius:10px; font-size:20px; color:var(--text);}
.detail .qty-box .q{min-width:32px; font-size:16px; font-weight:600; color:var(--text);}
.detail .add-toggle{font-size:14.5px; gap:9px; color:var(--text);}
.detail .add-toggle input{width:20px; height:20px;}
.detail .flag-row{gap:12px 22px; margin-top:16px; padding-top:16px;}
.dm-remove{margin-top:16px;}
.add-box .add-go{margin-top:16px; width:100%;}
.add-box .add-have{margin-top:10px;}
.detail-manage .col-note, .detail .dk-fit{font-size:13.5px; line-height:1.5;}
.board-seg{margin-bottom:12px;}

.dk-count{font-size:13px;}
.dk-list{border-radius:10px;}
.dk-row{padding:10px 10px 10px 9px; gap:13px;}
.dk-art{width:58px; height:42px; flex-basis:58px; border-radius:7px;}
.dk-name{font-size:15px;}
.dk-sub{font-size:13px;}
.dk-actions{gap:10px; margin-top:14px;}
/* opened from a /commanders/ page (landing.js): the box with the build buttons is marked */
.dactions .detail-manage.dk-box.from-link{padding:14px; margin:0 -14px 18px; max-width:none; border-radius:var(--r2); background:rgba(var(--accent-rgb),.07); box-shadow:inset 0 0 0 1px rgba(var(--accent-rgb),.55);}
.dk-link{margin-top:8px; color:var(--text-dim);}
.dk-link b{color:var(--text);}

/* the Printings tab: the whole list, the sheet scrolls */
.print-note{margin:0 0 12px;}
.print-note[hidden]{display:none;}
.detail .print-list{max-height:none; border-radius:10px; overflow:visible;}
.detail .print-row{padding:10px 12px; gap:13px;}
.detail .print-row img{width:52px; height:72px; flex-basis:52px; border-radius:6px;}
.detail .pr-set{
  font-size:15px; line-height:1.3; white-space:normal;
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2;
}
/* year · rarity, and the Owned / This one badge on its own line when narrow */
.detail .pr-sub{font-size:13px; margin-top:3px; display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px;}
.detail .pr-sub .badge{font-size:10.5px; padding:2px 8px; margin:0; vertical-align:0;}
.detail .pr-price{font-size:14.5px;}
.detail .print-row .qty-btn{width:40px; height:40px; flex:0 0 40px;}

/* the Rules tab: the official rulings, newest first */
.drulings{display:flex; flex-direction:column;}
.druling{padding:13px 0; border-top:1px solid var(--line);}
.druling:first-child{border-top:none; padding-top:2px;}
.druling-date{font-size:12.5px; color:var(--text-faint); margin-bottom:5px; font-variant-numeric:tabular-nums;}
.druling-text{font-size:15px; line-height:1.6; color:var(--text);}

/* the foot: shop, Scryfall, close */
.detail .modal-foot{margin-top:8px; gap:10px;}
.detail .modal-foot .btn{padding:13px 20px;}

@media(max-width:960px){
  .detail h3{font-size:23px;}
  .dtabs{margin:12px 0 16px;}
  .dm-label{flex-basis:88px;}
  .dlegal{gap:7px;}
}

/* ============================================================
   PICKERS: binders (collection.js binderPicker) and the scanner's
   "Add to" with its decks (scanner.js openAddTo)
   ============================================================ */
.pick-modal{gap:16px;}
@media(min-width:961px){ .pick-modal{overflow-y:auto;} }
.pick-tabs{margin:-6px 0 0;}
.pick-tabs button{flex:1;}

.bpick-grid{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px;}
.bpick-tile, .dpick-row{
  display:flex; align-items:center; gap:12px; min-width:0; width:100%; min-height:66px;
  padding:10px 12px; border-radius:10px; border:1px solid var(--line-2); background:var(--surface-2);
  color:var(--text); font:inherit; text-align:left; cursor:pointer;
  transition:background .13s, border-color .13s;
}
.bpick-tile:hover:not(:disabled), .dpick-row:hover:not(:disabled){background:var(--surface-3); border-color:var(--line-3);}
.bpick-tile:focus-visible, .dpick-row:focus-visible{outline:2px solid var(--accent); outline-offset:1px;}
.bpick-tile.on{border-color:var(--accent); background:var(--accent-soft); box-shadow:inset 0 0 0 1px var(--accent);}
.bpick-tile:disabled, .dpick-row:disabled{opacity:.5; cursor:default;}
.bpick-art{
  width:44px; height:44px; flex:0 0 44px; border-radius:8px; overflow:hidden; background:var(--surface-3);
  display:flex; align-items:center; justify-content:center; color:var(--text-faint);
}
.bpick-art img, .dpick-art img{width:100%; height:100%; object-fit:cover; display:block;}
.bpick-art .ico, .dpick-art.plus svg{width:22px; height:22px; display:block;}
.bpick-art .ico svg{width:100%; height:100%; display:block;}
.bpick-text, .dpick-text{display:flex; flex-direction:column; gap:3px; min-width:0; flex:1;}
.bpick-name, .dpick-name{font-size:15px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.bpick-sub, .dpick-sub{font-size:13px; color:var(--text-dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}

/* a new binder: label, field and button as in the filter sheet */
.bpick-new{margin-top:18px;}
.bpick-label{display:block; font-size:14.5px; color:var(--text-dim); margin-bottom:8px;}
.bpick-row{display:flex; gap:10px;}
.bpick-row input{
  flex:1; min-width:0; min-height:48px; padding:11px 14px; border-radius:10px;
  border:1px solid var(--line-2); background:var(--bg-2); color:var(--text); font-family:inherit; font-size:16px;
}
.bpick-row input:focus{outline:none; border-color:var(--accent);}
.bpick-row .btn{min-height:48px; padding:0 22px; border-radius:10px; font-size:15px;}

/* decks */
.dpick{display:flex; flex-direction:column; gap:10px;}
.dpick-art{width:60px; height:44px; flex:0 0 60px; border-radius:8px; overflow:hidden; background:var(--surface-3); position:relative;}
.dpick-art.plus{display:flex; align-items:center; justify-content:center; background:var(--accent-soft); color:var(--accent-hi);}
.dpick-row.dpick-new{border-style:dashed;}
/* a reason why nothing fits may take two lines */
.dpick-row:disabled .dpick-sub, .dpick-new .dpick-sub{
  white-space:normal; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-height:1.35;
}
.dpick-sep{
  font-family:'Barlow Condensed',sans-serif; font-size:12.5px; font-weight:600; text-transform:uppercase;
  letter-spacing:.13em; color:var(--text-label); margin:8px 0 -2px 2px;
}
.dpick-also{display:flex; flex-direction:column; gap:10px; margin-top:6px; padding-top:16px; border-top:1px solid var(--line);}
.dpick-also .add-toggle{font-size:15px; color:var(--text); gap:10px;}
.dpick-also .add-toggle input{width:20px; height:20px;}
.dpick-where{display:flex; align-items:center; gap:10px; padding-left:30px;}
.dpick-where[hidden]{display:none;}
.dpick-wname{flex:1; min-width:0; font-size:14px; color:var(--text-dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.dpick-where .btn{padding:9px 14px; font-size:14px; border-radius:10px;}

@media(max-width:400px){
  .bpick-grid{gap:8px;}
  .bpick-tile{gap:10px; padding:9px 10px;}
  .bpick-art{width:38px; height:38px; flex-basis:38px;}
}

/* ============================================================
   SCANNER — with a default binder, "Add to Bulk" and an arrow beside it
   that opens the choice of binder or deck
   ============================================================ */
.qcommit-pair{flex:1 1 0; min-width:0; max-width:230px; display:flex; gap:1px;}
.qfoot .qcommit-pair .btn{max-width:none;}
.qfoot .qcommit-pair .qcommit{flex:1 1 auto; border-radius:23px 0 0 23px;}
.qfoot .qcommit-pair .qcommit-more{flex:0 0 46px; padding:0 4px 0 0; border-radius:0 23px 23px 0;}
.qfoot .qcommit-more svg{transform:rotate(90deg);}

/* ============================================================
   NEW DECK — "Build the deck | Only the commander" over the commander
   list (decks.js renderCmdFill), and the deck that holds only its
   commander (emptyDeckNote)
   ============================================================ */
.cmd-fill{display:inline-flex; margin:-10px 0 18px; border-radius:10px;}
.cmd-fill[hidden]{display:none;}
.cmd-fill button{padding:10px 18px; font-size:14px;}
#view-commander .toolbar select[hidden]{display:none;}
@media(max-width:960px){
  .cmd-fill{display:flex; margin:-6px 0 14px;}
  .cmd-fill button{flex:1 1 0; padding:11px 8px; font-size:14.5px;}
}
.deck-empty{margin:4px 0 22px;}
.deck-empty p{max-width:460px; margin:0 auto;}
.deck-empty .de-acts{display:flex; flex-wrap:wrap; justify-content:center; gap:10px; margin-top:18px;}

/* ============================================================
   9 Oct 2026: the deck's printing of a card, in the detail's "In this deck"
   box (search.js deckPrintingRow; decks.js setDeckPrinting). The row is the
   one "Edit deck" uses for the commanders (.de-print, 09-refresh.css).
   ============================================================ */
.dk-print{margin-top:14px; padding-top:14px; border-top:1px solid var(--line); display:flex; flex-direction:column; gap:10px;}
.dk-print-label{font-size:13.5px; color:var(--text-dim);}
.detail .dk-print .de-print{padding:10px 12px; border-radius:10px;}
.detail .dk-print .de-print-name{font-size:15px; white-space:normal; overflow-wrap:anywhere;}
.detail .dk-print .de-print-sub{font-size:13px; white-space:normal;}
.detail .dk-print .de-print-note{font-size:13px;}
.de-print-note.none{color:var(--text-faint);}
.dk-print-acts{display:flex; flex-wrap:wrap; gap:10px;}
.dk-print-acts .btn{flex:1 1 160px;}
.badge.in-deck{background:var(--info-soft); color:var(--info); border:1px solid rgba(90,169,240,.32);}

/* ============================================================
   14 Oct 2026: the card detail in the layout of the ChatGPT mockup
   (search.js buildDetail) — our colours and our control sizes.
   Head across the top (name, type, ‹ n / N ›), picture beside the tabs,
   one band with "In this deck" | "Your collection", links + Close below.
   ============================================================ */
.detail-modal{--dpad:24px;}
.detail{display:flex; flex-direction:column; align-items:stretch; gap:0;}

/* head */
.dhead{
  display:flex; align-items:center; justify-content:space-between; gap:18px;
  margin:0 calc(-1 * var(--dpad)) 22px; padding:0 calc(var(--dpad) + 46px) 18px var(--dpad);
  border-bottom:1px solid var(--line-2);
}
.dhead-text{min-width:0;}
.detail .dhead h3{margin:0 0 6px;}
.dhead-nav{display:flex; align-items:center; gap:8px; flex:0 0 auto;}
.dnav-btn{
  width:34px; height:34px; border-radius:10px;
  background:var(--surface-2); border:1px solid var(--line-2); color:var(--text-dim);
  display:flex; align-items:center; justify-content:center; font-size:20px; line-height:1; padding:0 0 2px;
}
.dnav-btn:hover{color:var(--text); border-color:var(--line-3);}
.dnav-pos{font-size:13px; color:var(--text-dim); font-variant-numeric:tabular-nums; min-width:46px; text-align:center;}
/* the head has the arrows now, so the chevrons at the sides and the count
   under the picture go */
.detail-modal:has(.dhead-nav) > .detail-nav{display:none;}
@media(min-width:961px){
  .detail-figure.has-carousel .detail-pos{display:none;}
}

/* picture and tabs */
.dmain{display:flex; gap:26px; align-items:flex-start; margin-bottom:24px;}
.dmain .dbody{flex:1; min-width:0;}
.dartnote{text-align:center; margin-top:10px; font-size:12px; color:var(--text-faint); font-variant-numeric:tabular-nums;}
.dtabs{justify-content:flex-start; gap:22px; margin:0 0 18px;}
.dtabs button{flex:0 0 auto; padding:4px 0 11px;}

/* the facts under the text, the prices as a plain table with lines */
.detail .dfacts.dsec{margin-bottom:22px;}
.dprices{border:0; border-radius:0; overflow:visible;}
.dp-row{padding:10px 0; border-top:1px solid var(--line-2);}
.dp-head{padding:0 0 8px; border-top:0; background:none;}
.dp-head + .dp-row{border-top-color:var(--line-2);}
.dp-row.sel{background:none;}

/* the band: the open deck | your collection */
.dactions{
  display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);
  margin:0 calc(-1 * var(--dpad)); background:var(--bg-2);
  border-top:1px solid var(--line-2); border-bottom:1px solid var(--line-2);
}
.dact{padding:22px var(--dpad); min-width:0;}
.dact-coll{border-left:1px solid var(--line-2);}
.dact:empty{display:none;}
.dact-coll:empty + *, .dactions:has(.dact-coll:empty){grid-template-columns:1fr;}
.dactions .detail-manage{background:none; border:0; border-radius:0; padding:0; margin:0;}

/* section heads with a note on the right */
.dactions .dk-head{display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin-bottom:10px;}
.dactions .dk-head .dm-title{margin:0;}
.dk-role{font-size:13px; color:var(--text-dim);}

/* links that look like links */
.dlink{
  background:none; border:0; padding:0; font:inherit; color:var(--accent-hi); cursor:pointer; text-align:left;
}
.dlink:hover{text-decoration:underline; text-underline-offset:3px;}
.dk-deckname{font-size:16px; font-weight:600;}
.dk-cmdr{font-size:13.5px; color:var(--text-dim); margin:4px 0 0;}
.dk-this .board-seg{display:inline-flex; margin:14px 0 8px;}
.dk-this .dk-actions .btn{flex:1 1 150px;}
.dk-remove{color:var(--bad); border-color:rgba(239,95,95,.45);}
.dk-remove:hover{background:var(--bad-soft); border-color:var(--bad);}
.dk-print-head{display:flex; align-items:baseline; justify-content:space-between; gap:10px;}
.dk-print-head .dlink{font-size:13.5px;}

/* every deck with the card, folded */
.dk-all{margin-top:16px; padding-top:14px; border-top:1px solid var(--line-2);}
.dk-all > summary{cursor:pointer; color:var(--accent-hi); font-size:14px; padding:2px 0; list-style-position:inside;}
.dk-all[open] > summary{margin-bottom:12px;}
.dk-all .dk-box > .dk-head{display:none;}

/* your collection: status, binder and finish, then stepper + button */
.dact-coll .dm-fields{gap:14px;}
.dact-coll .dm-field{flex-direction:column; align-items:stretch; gap:7px; min-height:0;}
.dact-coll .dm-label{flex-basis:auto; font-size:13px; color:var(--text-dim);}
.dact-coll .dm-binder{display:flex; align-items:center; justify-content:space-between; gap:10px;}
.dact-coll .dm-seg{align-self:flex-start;}
.add-box .add-have{margin:0 0 14px; font-size:14px; color:var(--ok);}
.add-box .add-have.none{color:var(--accent-hi);}
.add-go-row{display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:16px;}
.add-box .add-go-row .add-go{margin:0; width:auto; flex:1 1 auto;}
.dact-coll .flag-row{display:flex; flex-wrap:wrap;}
/* the quantity as one compact control, as in the mockup: − n + in a single
   frame, as tall as the Add button beside it */
.dactions .qty-box{
  display:inline-flex; align-self:flex-start; gap:0; height:40px;
  border:1px solid var(--line-2); border-radius:10px; background:var(--surface-2); overflow:hidden;
}
.dactions .qty-btn{width:32px; height:100%; border:0; border-radius:0; background:none; font-size:17px; color:var(--text-dim);}
.dactions .qty-btn:hover:not(:disabled){color:var(--text); background:var(--surface-3);}
.dactions .qty-btn:disabled{opacity:.35;}
.dactions .qty-box .q{min-width:26px; font-size:15px;}

/* foot */
.dfoot{display:flex; align-items:center; justify-content:space-between; gap:10px 16px; flex-wrap:wrap; padding-top:16px;}
.dfoot-links{display:flex; gap:6px; flex-wrap:wrap;}
.detail .dfoot-link{color:var(--accent-hi); border-color:transparent; padding-left:6px; padding-right:6px;}
.detail .dfoot-link:hover{background:none; text-decoration:underline; text-underline-offset:3px;}
.dfoot .btn:not(.dfoot-link){padding:13px 20px;}   /* the foot's buttons keep their old size */
.dfoot-links{align-items:center;}
.dfoot .aff-note{flex:1 0 100%; margin:2px 0 0; text-align:left;}

@media(max-width:960px){
  .detail-modal{--dpad:18px;}
  .dhead{margin-bottom:16px; padding-right:calc(var(--dpad) + 46px);}
  .dhead-nav{display:none;}
  .dmain{flex-direction:column; align-items:stretch; gap:16px; margin-bottom:20px;}
  .dartnote{display:none;}
  .dtabs{justify-content:space-between; gap:0;}
  .dtabs button{flex:1; padding:12px 8px 11px;}
  .dactions{grid-template-columns:1fr;}
  .dact-coll{border-left:0; border-top:1px solid var(--line-2);}
  .dk-this .board-seg{display:flex;}
  .dfoot .btn{flex:1 1 auto;}
}
