
/* Presentation only. Existing controls and breakpoints remain. */
section.card[aria-labelledby="category-title"]{
  padding:0;
  overflow:hidden;
  border-color:#dce5f5;
  border-radius:22px;
  box-shadow:0 12px 35px #263d7110;
}
.reference-banner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  padding:22px 24px;
  background:linear-gradient(120deg,#edf3ff,#fafcff);
  border-bottom:1px solid #dce5f5;
}
.reference-caption{
  margin:0 0 5px;
  font-size:11px;
  font-weight:700;
  letter-spacing:1px;
  color:#4269bf;
}
.reference-banner h2{
  margin:0;
  font-size:25px;
  line-height:1.25;
}
.reference-detail{margin:7px 0 0;font-size:13px}
.reference-list{
  flex-shrink:0;
  min-width:165px;
  padding:12px 16px;
  background:white;
  border-color:#dbe5f7;
  text-align:left;
  box-shadow:0 4px 14px #294a8310;
}
.reference-list strong,.reference-list span{display:block}
.reference-list strong{font-size:12px;font-weight:600}
.reference-list span{font-size:18px;font-weight:700;color:var(--blue)}
#builder{padding:22px 24px}
#builder fieldset{
  padding:0 0 18px;
  margin-bottom:18px;
  border-bottom:1px solid #e8edf6;
}
#builder legend{font-size:18px}
#categories button,#rulings button{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  padding:16px 10px;
  background:#fff;
  border:1px solid #dce5f3;
  border-radius:14px;
  font-weight:600;
  box-shadow:0 3px 10px #21396605;
}
#categories button::before{
  content:"";
  display:block;
  width:42px;
  height:52px;
  border:1px solid #426bc3;
  border-left:6px solid #3259ad;
  border-radius:3px 7px 7px 3px;
  background:linear-gradient(145deg,#cbdcff,#7b9fe9);
  box-shadow:4px 3px 0 #e2eafa;
}
#categories button:nth-child(2)::before{
  background:linear-gradient(145deg,#bfe4dd,#6aa99b);
  border-color:#558d80;
  border-left-color:#407466;
}
#categories button:nth-child(3)::before{
  background:linear-gradient(145deg,#e0d7f6,#a896d6);
  border-color:#8c77b7;
  border-left-color:#735c9d;
}
#categories button:nth-child(4)::before{
  background:linear-gradient(145deg,#f6e3c5,#dbb780);
  border-color:#b79768;
  border-left-color:#967344;
}
#rulings button::before{
  content:"";
  display:block;
  width:48px;
  height:52px;
  border:1px solid #cad7ed;
  border-radius:5px;
  background:repeating-linear-gradient(
    to bottom,#fff 0 9px,#cbd8ed 9px 10px);
}
#rulings button[data-paper="square"]::before{
  background-color:#fff;
  background-image:
    linear-gradient(#d1ddef 1px,transparent 1px),
    linear-gradient(90deg,#d1ddef 1px,transparent 1px);
  background-size:9px 9px;
}
#rulings button[data-paper="plain"]::before{background:#fff}
#rulings button[data-paper="double"]::before{
  background:repeating-linear-gradient(
    to bottom,#fff 0 9px,#cbd8ed 9px 10px,
    #fff 10px 13px,#cbd8ed 13px 14px,#fff 14px 23px);
}
#categories button.selected,#rulings button.selected,
#brands button.selected{
  background:#edf3ff;
  border-color:var(--blue);
  box-shadow:0 0 0 1px var(--blue);
}
#categories button.selected::after,#rulings button.selected::after{
  content:"✓";
  position:absolute;
  top:7px;
  right:8px;
  color:var(--blue);
  font-size:14px;
}
#quantities .quantity-tile{
  background:#fff;
  border-color:#dce5f3;
  border-radius:12px;
  box-shadow:0 3px 10px #21396605;
}
#quantities .quantity-tile.selected{
  background:#edf3ff;
  border-color:var(--blue);
}
#quantities .quantity-tile>label{color:#24477d}
#brands button{
  background:#fff;
  font-weight:700;
  border-radius:12px;
}
#selection-total{
  padding:12px;
  border:1px solid #dce5f5;
  border-radius:10px;
  background:#f6f9ff;
  font-size:14px;
}
#continue-brand,#add{
  border-color:var(--blue);
  box-shadow:0 5px 12px #3d6ce720;
}
#status:empty{margin:0}
@media(max-width:767px){
  section.card[aria-labelledby="category-title"]{border-radius:17px}
  .reference-banner{padding:14px 12px;gap:10px;align-items:flex-start}
  .reference-banner h2{font-size:18px}
  .reference-caption{font-size:9px;letter-spacing:.6px}
  .reference-detail{font-size:11px;margin-top:5px}
  .reference-list{
    min-width:0;
    width:128px;
    padding:8px;
    border-radius:10px;
  }
  .reference-list strong{font-size:10px}
  .reference-list span{font-size:14px}
  #builder{padding:12px}
  #builder fieldset{margin-bottom:8px;padding-bottom:8px}
  #categories button,#rulings button{
    padding:10px 7px;
    gap:7px;
    font-size:12px;
    border-radius:11px;
  }
  #categories button::before{width:28px;height:35px;border-left-width:4px}
  #rulings button::before{width:32px;height:35px}
  #builder legend{font-size:15px}
  #brands button{font-size:13px}
}
@media(prefers-reduced-motion:no-preference){
  #categories button,#rulings button,#brands button{
    transition:background-color .15s,border-color .15s;
  }
}


/* COMPACT_SELECTED_CARD_V2 */
.reference-edit-controls{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:9px;
}
.reference-edit-controls button{
  min-height:32px;
  padding:5px 9px;
  border:1px solid #cbdaf5;
  border-radius:8px;
  background:#ffffff;
  color:#315bb5;
  font-size:11px;
}
#builder.reference-quantity-mode:not(.reference-edit-book)
  >fieldset:first-of-type{
  display:none;
}
#builder.reference-quantity-mode:not(.reference-edit-ruling)
  >#ruling-section{
  display:none;
}
#builder.reference-quantity-mode{
  padding-top:14px;
}
#builder.reference-quantity-mode #quantity-section{
  border-bottom:0;
  margin-bottom:8px;
  padding-bottom:0;
}
#builder.reference-quantity-mode #quantity-section legend{
  font-size:15px;
}
#builder.reference-quantity-mode
  #quantity-section .accordion-content>p{
  font-size:12px;
  margin:2px 0 8px;
}
#quantities .quantity-tile{
  padding:12px 8px;
  text-align:center;
  background:linear-gradient(180deg,#fff,#f8faff);
}
#quantities .quantity-tile>label{
  font-size:20px;
  font-weight:700;
  margin-bottom:9px;
}
#quantities .quantity-tile.selected{
  background:linear-gradient(145deg,#3d6ce7,#2453cf);
  border-color:#315fd8;
  box-shadow:0 5px 12px #3d6ce726;
}
#quantities .quantity-tile.selected>label{
  color:#fff;
}
#quantities .quantity-controls input{
  border-color:#d4e0f6;
  background:#fff;
  color:#183b77;
}
#builder.reference-quantity-mode #continue-brand{
  margin-top:10px;
  min-height:44px;
  padding:10px 18px;
}
@media(max-width:767px){
  #builder.reference-quantity-mode{padding:10px 12px}
  #quantities .quantity-tile{padding:6px}
  #quantities .quantity-tile>label{
    font-size:17px;
    margin-bottom:5px;
  }
  .reference-edit-controls{gap:5px;margin-top:7px}
  .reference-edit-controls button{
    font-size:10px;
    padding:5px 7px;
  }
}


/* SINGLE_CARD_FLOW_V3 */

/* Category is replaced by ruling in the same space. */
#builder[data-card-stage="ruling"]:not(.reference-edit-book)
  >fieldset:first-of-type{
  display:none;
}
#builder[data-card-stage="ruling"]>#ruling-section
  .accordion-content[hidden]{
  display:block!important;
}

/* After ruling, keep quantities and brands together. */
#builder[data-card-stage="configure"]:not(.reference-edit-book)
  >fieldset:first-of-type{
  display:none;
}
#builder[data-card-stage="configure"]:not(.reference-edit-ruling)
  >#ruling-section{
  display:none;
}
#builder[data-card-stage="configure"]>#quantity-section
  .accordion-content[hidden],
#builder[data-card-stage="configure"]>#brand-section
  .accordion-content[hidden]{
  display:block!important;
}
#builder[data-card-stage="configure"] #continue-brand{
  display:none;
}
#builder[data-card-stage="configure"]>#quantity-section,
#builder[data-card-stage="configure"]>#brand-section{
  border:0;
  padding-bottom:0;
  margin-bottom:12px;
}
#builder[data-card-stage="configure"]>#brand-section{
  border-top:1px solid #e8edf6;
  padding-top:10px;
}
#builder[data-card-stage="configure"]>#quantity-section legend,
#builder[data-card-stage="configure"]>#brand-section legend{
  display:none;
}
#builder[data-card-stage="configure"]
  #quantity-section .accordion-content>p{
  font-size:0;
  margin:0 0 8px;
}
#builder[data-card-stage="configure"]
  #quantity-section .accordion-content>p::before{
  content:"Pages and quantities";
  font-size:14px;
  font-weight:600;
  color:var(--ink);
}
#builder[data-card-stage="configure"]
  #brand-section .accordion-content>p:first-child{
  font-size:0;
  margin:0 0 8px;
}
#builder[data-card-stage="configure"]
  #brand-section .accordion-content>p:first-child::before{
  content:"Choose your brand";
  font-size:14px;
  font-weight:600;
  color:var(--ink);
}
#builder[data-card-stage="configure"] #brands{
  margin-top:0;
  grid-template-columns:repeat(2,minmax(0,1fr));
}
#builder[data-card-stage="configure"] #brands button{
  min-height:48px;
  padding:10px;
}
#builder[data-card-stage="configure"] #add{
  width:100%;
  margin-top:8px;
}
#builder[data-card-stage="configure"] #selection-total{
  margin:10px 0 0;
}
@media(min-width:768px){
  #builder[data-card-stage="configure"] #brands{
    max-width:420px;
  }
}


/* REFERENCE_FINISH_V4 */
.card[data-reference-stage="configure"] .reference-banner{
  background:linear-gradient(120deg,#164bb6,#087ee7);
  border-bottom:0;
  color:white;
}
.card[data-reference-stage="configure"] .reference-caption{
  color:#d9e8ff;
}
.card[data-reference-stage="configure"] .reference-banner h2{
  color:white;
  font-size:30px;
}
.card[data-reference-stage="configure"] .reference-detail{
  color:#e3eeff;
  font-size:15px;
}
.card[data-reference-stage="configure"] .reference-edit-controls button{
  background:#ffffff16;
  border-color:#ffffff55;
  color:white;
}
.card[data-reference-stage="configure"] .reference-list{
  background:#edf5ff;
  border-color:#d8e8ff;
}
.card[data-reference-stage="configure"] .reference-list strong{
  color:#41638c;
}
.reference-rule-preview{
  display:none;
  text-align:center;
  border-radius:16px;
  padding:20px 12px;
  background:linear-gradient(160deg,#edf4ff,#f7faff);
  border:1px solid #e2ebf8;
}
.reference-rule-preview strong{
  display:block;
  margin-top:18px;
  font-size:21px;
  line-height:1.3;
}
.reference-rule-preview small{
  display:block;
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid #cfdff5;
  color:#58779f;
  font-size:10px;
  letter-spacing:.6px;
}
.reference-paper{
  width:76px;
  height:96px;
  margin:auto;
  border:1px solid #c9d9ef;
  border-radius:5px;
  background:
    linear-gradient(90deg,transparent 13px,#ed9b9b 13px 15px,transparent 15px),
    repeating-linear-gradient(to bottom,#fff 0 11px,#c8ddf6 11px 12px);
  box-shadow:4px 5px 0 #dce7f6;
}
.reference-rule-preview[data-paper="square"] .reference-paper{
  background-color:#fff;
  background-image:
    linear-gradient(90deg,transparent 13px,#ed9b9b 13px 15px,transparent 15px),
    linear-gradient(#c8ddf6 1px,transparent 1px),
    linear-gradient(90deg,#c8ddf6 1px,transparent 1px);
  background-size:auto,12px 12px,12px 12px;
}
.reference-rule-preview[data-paper="plain"] .reference-paper{
  background:#fff;
}
#builder[data-card-stage="configure"] #brands button{
  min-height:64px;
  font-size:17px;
  background:#fff;
}
#builder[data-card-stage="configure"] #brands button.selected{
  background:#e9f3ff;
  border-color:#3185e9;
  box-shadow:0 0 0 1px #3185e9;
}
#builder[data-card-stage="configure"] #add{
  background:linear-gradient(120deg,#1662e5,#0750d3);
  min-height:56px;
  font-size:18px;
  font-weight:700;
}
@media(min-width:900px){
  #builder[data-card-stage="configure"]
    :is(#quantity-section,#brand-section){min-width:0}
  #builder[data-card-stage="configure"]:not(.reference-edit-book):not(.reference-edit-ruling){
    display:grid;
    grid-template-columns:140px minmax(0,1fr);
    gap:12px 18px;
    padding:22px;
  }
  #builder[data-card-stage="configure"]:not(.reference-edit-book):not(.reference-edit-ruling)
    .reference-rule-preview{
    display:block;
    grid-column:1;
    grid-row:1 / 3;
  }
  #builder[data-card-stage="configure"]:not(.reference-edit-book):not(.reference-edit-ruling)
    #quantity-section{grid-column:2;grid-row:1;margin:0}
  #builder[data-card-stage="configure"]:not(.reference-edit-book):not(.reference-edit-ruling)
    #brand-section{grid-column:2;grid-row:2;margin:0}
  #builder[data-card-stage="configure"] #status{grid-column:1 / -1}
  #builder[data-card-stage="configure"] #brand-section .accordion-content{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 220px;
    gap:8px 14px;
    align-items:center;
  }
  #builder[data-card-stage="configure"]
    #brand-section .accordion-content>p:first-child{
    grid-column:1 / -1;
    margin:0;
  }
  #builder[data-card-stage="configure"] #brands{
    grid-column:1;
    max-width:none;
  }
  #builder[data-card-stage="configure"] #add{
    grid-column:2;
    margin:0;
    min-height:64px;
  }
  #builder[data-card-stage="configure"] #selection-total{
    grid-column:1 / -1;
    grid-row:3;
    margin:0;
    padding:6px 0;
    border:0;
    background:transparent;
    font-size:12px;
  }
}
@media(max-width:767px){
  .card[data-reference-stage="configure"] .reference-banner h2{
    font-size:20px;
  }
  .card[data-reference-stage="configure"] .reference-detail{
    font-size:12px;
  }
  #builder[data-card-stage="configure"] #brands button{
    min-height:48px;
    font-size:14px;
  }
  #builder[data-card-stage="configure"] #add{
    min-height:48px;
    font-size:16px;
  }
}


/* COMPACT_HEIGHT_V5 */
.card[data-reference-stage="configure"] .reference-banner{
  padding:12px 16px;
  gap:12px;
}
.card[data-reference-stage="configure"] .reference-caption{
  display:none;
}
.card[data-reference-stage="configure"] .reference-banner h2{
  font-size:24px;
  line-height:1.15;
}
.card[data-reference-stage="configure"] .reference-detail{
  font-size:12px;
  line-height:1.3;
  margin-top:4px;
}
.card[data-reference-stage="configure"] .reference-list{
  padding:8px 12px;
  min-width:145px;
  min-height:48px;
}
.card[data-reference-stage="configure"] .reference-list span{
  font-size:17px;
}
#builder[data-card-stage="configure"] #quantities{
  margin-top:6px;
  gap:8px;
  padding:0;
}
#builder[data-card-stage="configure"] #quantities .quantity-tile{
  padding:6px;
  border-radius:10px;
}
#builder[data-card-stage="configure"] .quantity-tile>label{
  font-size:18px;
  line-height:1.2;
  margin-bottom:5px;
}
#builder[data-card-stage="configure"] .quantity-controls input{
  min-height:44px;
  font-size:16px;
}
#builder[data-card-stage="configure"] #brand-section{
  padding-top:6px;
}
#builder[data-card-stage="configure"] #brands button{
  min-height:44px;
  padding:7px 10px;
  font-size:15px;
}
#builder[data-card-stage="configure"] #add{
  min-height:44px;
  padding:8px 12px;
  font-size:16px;
}
#builder[data-card-stage="configure"] #status:not(:empty){
  margin:3px 0 0;
  font-size:11px;
  line-height:1.3;
}
#builder[data-card-stage="configure"]
  #quantity-section .accordion-content>p::before,
#builder[data-card-stage="configure"]
  #brand-section .accordion-content>p:first-child::before{
  font-size:12px;
}
.reference-rule-preview{
  align-self:start;
  padding:12px 8px;
  border-radius:12px;
}
.reference-paper{
  width:48px;
  height:60px;
  box-shadow:3px 3px 0 #dce7f6;
}
.reference-rule-preview strong{
  margin-top:10px;
  font-size:16px;
}
.reference-rule-preview small{
  margin-top:8px;
  padding-top:7px;
  font-size:9px;
}
@media(min-width:900px){
  .card[data-reference-stage="configure"]
    .reference-banner>div:first-child{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:0 16px;
    align-items:center;
    flex:1;
  }
  .card[data-reference-stage="configure"] .reference-banner h2,
  .card[data-reference-stage="configure"] .reference-detail{
    grid-column:1;
  }
  .card[data-reference-stage="configure"] .reference-edit-controls{
    grid-column:2;
    grid-row:1 / 3;
    margin:0;
  }
  #builder[data-card-stage="configure"]:not(.reference-edit-book):not(.reference-edit-ruling){
    grid-template-columns:112px minmax(0,1fr);
    padding:12px 16px;
    gap:6px 14px;
  }
  #builder[data-card-stage="configure"]
    #brand-section .accordion-content{
    grid-template-columns:minmax(0,1fr) 190px;
    gap:4px 10px;
    padding-top:0;
  }
  #builder[data-card-stage="configure"] #add{
    min-height:44px;
  }
  #builder[data-card-stage="configure"] #selection-total{
    padding:2px 0;
    font-size:11px;
    line-height:1.3;
  }
}
@media(max-width:767px){
  .card[data-reference-stage="configure"] .reference-banner{
    padding:10px 12px;
    gap:8px;
  }
  .card[data-reference-stage="configure"] .reference-banner h2{
    font-size:18px;
  }
  .card[data-reference-stage="configure"] .reference-detail{
    font-size:11px;
  }
  .card[data-reference-stage="configure"] .reference-list{
    min-width:0;
    width:118px;
    padding:8px;
  }
  .card[data-reference-stage="configure"] .reference-list span{
    font-size:14px;
  }
  #builder[data-card-stage="configure"]{
    padding:8px 12px;
  }
  #builder[data-card-stage="configure"] #quantity-section,
  #builder[data-card-stage="configure"] #brand-section{
    margin-bottom:6px;
  }
  #builder[data-card-stage="configure"] #selection-total{
    margin-top:6px;
    padding:7px 8px;
    font-size:12px;
  }
  #builder[data-card-stage="configure"] #brands{
    gap:7px;
  }
}


/* GROUPED_MY_LIST_V6 */
#review{padding:14px}
.list-group{
  overflow:hidden;
  margin:12px 0;
  border:1px solid #dce7f4;
  border-radius:14px;
  background:white;
}
.list-group-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 14px;
  background:linear-gradient(120deg,#1456b8,#178dbe);
  color:white;
}
.list-group-header h3{
  margin:0;
  font-size:19px;
  line-height:1.2;
}
.list-group-brand{
  padding:5px 9px;
  border-radius:8px;
  background:#ffffff20;
  font-size:12px;
  font-weight:600;
}
.list-group-body{
  display:grid;
  grid-template-columns:100px minmax(0,1fr);
  gap:10px;
  padding:10px;
}
.list-group-rule{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px;
  border-radius:9px;
  background:linear-gradient(150deg,#176aa6,#125575);
  color:white;
  text-align:center;
  font-size:17px;
  font-weight:700;
}
.list-group-pages{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:7px;
  min-width:0;
}
#review .list-group .list-row{
  display:flex;
  flex-direction:column;
  gap:5px;
  padding:7px 4px;
  border:1px solid #d9e6f5;
  border-radius:8px;
  background:linear-gradient(180deg,#eef6ff,#fff);
}
#review .list-group .list-row p{
  font-size:15px;
  font-weight:700;
  color:#184879;
}
#review .list-group .list-row label{
  display:flex;
  flex-direction:column;
  gap:2px;
  font-size:10px;
}
#review .list-group .list-row input{
  width:100%;
  max-width:64px;
  min-height:44px;
  font-size:16px;
}
#review .list-group .list-row button{
  min-height:32px;
  padding:4px 6px;
  font-size:10px;
  border-color:#e3e8ef;
  background:#fff;
}
.list-group-total{
  grid-column:2;
  margin:0;
  padding:7px 9px;
  border-radius:8px;
  background:#edf5ff;
  color:#24466f;
  font-size:12px;
  font-weight:600;
}
@media(max-width:767px){
  .list-group-header{padding:9px 10px}
  .list-group-header h3{font-size:16px}
  .list-group-brand{font-size:11px}
  .list-group-body{
    grid-template-columns:minmax(0,1fr);
    gap:7px;
    padding:8px;
  }
  .list-group-rule{
    justify-content:flex-start;
    padding:6px 9px;
    font-size:12px;
  }
  .list-group-pages{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:6px;
  }
  .list-group-total{grid-column:1}
}


/* ADD_MORE_FLOW_V7 */
#review #more{
  background:#edf4ff;
  border-color:#c7dafa;
  color:#2355b5;
  font-weight:600;
  min-height:44px;
}
#review #checkout{
  min-height:44px;
  font-weight:600;
}
@media(max-width:767px){
  #review #more,#review #checkout{
    width:100%;
    margin-top:8px;
  }
}


/* CHECKOUT_PREVIEW_V9 */
.checkout-preview{
  padding:0;
  overflow:hidden;
  scroll-margin-top:16px;
}
.checkout-preview-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 16px;
  background:linear-gradient(120deg,#1456b8,#178dbe);
  color:white;
}
.checkout-preview-header h2{
  margin:0;
  font-size:20px;
  color:white;
}
.checkout-preview-header>span{
  font-size:11px;
  padding:4px 8px;
  border-radius:8px;
  background:#ffffff20;
}
.checkout-preview-body{padding:14px 16px}
.checkout-preview-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:9px 0;
  border-bottom:1px solid #e4ecf7;
  font-size:14px;
}
.checkout-preview-row strong{color:#235bbd}
.checkout-preview-actions{
  display:flex;
  gap:8px;
  margin-top:12px;
}
.checkout-preview-actions button{
  flex:1;
  min-height:44px;
  padding:9px 12px;
  font-size:13px;
}
#checkout-more{
  background:var(--blue);
  color:white;
  border-color:var(--blue);
}
.checkout-preview .note{margin-top:9px}
@media(max-width:767px){
  .checkout-preview-header{padding:10px 12px}
  .checkout-preview-header h2{font-size:18px}
  .checkout-preview-body{padding:10px 12px}
}


/* ADD_MORE_ACTION_VISIBILITY_V10 */
#review.adding-more>#more,
#review.adding-more>#checkout,
#review.adding-more>#checkout-message{
  display:none;
}
.back-to-list{
  margin:0 12px 12px;
  min-height:44px;
  padding:8px 12px;
  background:#fff;
  color:#315bb5;
  font-size:12px;
}


/* CHECKOUT_BOOK_DETAILS_V11 */
.checkout-book-details .list-group:first-child{margin-top:0}
.checkout-book-tile{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  padding:8px 5px;
  border:1px solid #d9e6f5;
  border-radius:8px;
  background:linear-gradient(180deg,#eef6ff,#fff);
}
.checkout-book-tile strong{
  font-size:15px;
  color:#184879;
}
.checkout-book-tile span{
  font-size:10px;
  color:#49688c;
}
.checkout-book-tile b{
  display:block;
  min-width:42px;
  padding:6px 8px;
  border:1px solid #d9e6f5;
  border-radius:7px;
  background:white;
  color:#184879;
  text-align:center;
  font-size:16px;
}
.checkout-book-details{margin-bottom:10px}


/* STUDIO_VISUAL_POLISH_V12 */
:root{
  --blue:#3D6CE7;
  --ink:#18243c;
  --muted:#596579;
  --studio-line:#e2e7ef;
  --studio-soft:#f3f6fd;
}
body{
  background:#f6f7f9;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3{letter-spacing:-.025em}
button,input{font-variant-numeric:tabular-nums}
.header{border-bottom-color:var(--studio-line)}
.badge{
  background:var(--studio-soft);
  color:#3159bd;
}
.steps span{
  background:#edf2fc;
  color:#365ba9;
}
.card,
section.card[aria-labelledby="category-title"]{
  border-color:var(--studio-line);
  box-shadow:0 2px 4px #18243c03,0 12px 30px #18243c07;
}
.reference-banner{
  background:linear-gradient(110deg,#eef3fd,#fafbfd);
  border-bottom-color:var(--studio-line);
}
.reference-caption{color:#4664a4}
.reference-detail{color:var(--muted)}
.reference-list{
  background:#fff;
  border-color:var(--studio-line);
  box-shadow:0 3px 10px #18243c08;
}
.reference-list span{color:var(--blue)}
.card[data-reference-stage="configure"] .reference-banner{
  background:linear-gradient(110deg,#315cc8,#3D6CE7);
}
.card[data-reference-stage="configure"] .reference-list{
  background:#fff;
  border-color:#ffffff80;
}
.card[data-reference-stage="configure"] .reference-list strong{
  color:var(--muted);
}
.card[data-reference-stage="configure"] .reference-edit-controls button{
  background:#ffffff12;
  border-color:#ffffff65;
}
#categories button,#rulings button,#brands button{
  background:#fff;
  border-color:var(--studio-line);
  box-shadow:0 2px 5px #18243c04;
}
#categories button.selected,#rulings button.selected,
#builder[data-card-stage="configure"] #brands button.selected{
  background:#eef3ff;
  border-color:var(--blue);
  box-shadow:inset 0 0 0 1px var(--blue);
}
#quantities .quantity-tile{
  background:#fafbfd;
  border-color:var(--studio-line);
  box-shadow:none;
}
#quantities .quantity-tile>label{color:var(--ink)}
#quantities .quantity-tile.selected{
  background:var(--blue);
  border-color:var(--blue);
  box-shadow:0 3px 8px #3d6ce718;
}
#quantities .quantity-tile.selected>label{color:#fff}
#quantities .quantity-controls input,
#review .list-group .list-row input{
  color:var(--ink);
  background:#fff;
  border-color:#dce3ee;
  box-shadow:inset 0 1px 2px #18243c04;
}
.reference-rule-preview{
  background:#f3f6fc;
  border-color:var(--studio-line);
}
.reference-rule-preview strong{color:var(--ink)}
#selection-total{
  background:var(--studio-soft);
  border-color:var(--studio-line);
}
#builder[data-card-stage="configure"] #add,
#review #checkout,#checkout-more,.summary button{
  background:var(--blue);
  border-color:var(--blue);
  color:#fff;
  box-shadow:0 3px 8px #3d6ce718;
}
.list-group{
  border-color:var(--studio-line);
  box-shadow:0 2px 5px #18243c03;
}
.list-group-header,.checkout-preview-header{
  background:linear-gradient(110deg,#315cc8,#3D6CE7);
}
.list-group-brand,.checkout-preview-header>span{
  background:#ffffff18;
  border:1px solid #ffffff25;
}
.list-group-rule{
  background:#edf2fc;
  color:#2d4f9c;
  border:1px solid #dce5f6;
}
#review .list-group .list-row,.checkout-book-tile{
  background:#fafbfd;
  border-color:var(--studio-line);
}
#review .list-group .list-row p,
.checkout-book-tile strong,.checkout-book-tile b{
  color:var(--ink);
}
#review .list-group .list-row button{
  background:#fff;
  color:#a43e49;
  border-color:#efdde0;
  box-shadow:none;
}
.list-group-total{
  background:#f0f4fc;
  color:#334b79;
}
#review #more,.back-to-list,#checkout-edit{
  background:#fff;
  color:#3159bd;
  border-color:#cad7f3;
  box-shadow:none;
}
.checkout-preview-row{border-bottom-color:var(--studio-line)}
.checkout-preview-row strong{color:var(--blue)}
.checkout-book-tile b{border-color:var(--studio-line)}
.summary{
  border-top-color:var(--studio-line);
  box-shadow:0 -4px 18px #18243c07;
}
button:focus-visible,input:focus-visible{
  outline:3px solid #234cae;
  outline-offset:3px;
}
@media(hover:hover){
  #categories button:not(.selected):hover,
  #rulings button:not(.selected):hover,
  #brands button:not(.selected):hover{
    background:#f5f8fe;
    border-color:#b9c9e9;
  }
  #builder[data-card-stage="configure"] #add:not(:disabled):hover,
  #review #checkout:not(:disabled):hover,
  #checkout-more:hover{
    background:#315cc8;
    border-color:#315cc8;
  }
}


/* MOBILE_MY_LIST_COMPACT_V13 */
@media(max-width:767px){
  #review .list-group-pages{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:5px;
  }
  #review .list-group .list-row{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    align-items:center;
    gap:3px 4px;
    padding:5px;
    border-radius:8px;
  }
  #review .list-group .list-row p{
    margin:0;
    grid-column:1;
    grid-row:1;
    font-size:14px;
    line-height:1.2;
    text-align:center;
  }
  #review .list-group .list-row label{
    grid-column:2;
    grid-row:1;
    gap:1px;
    margin:0;
    min-width:0;
    font-size:8px;
    line-height:1.1;
  }
  #review .list-group .list-row input{
    width:100%;
    max-width:46px;
    min-height:30px;
    height:30px;
    padding:2px;
    border-radius:6px;
    font-size:16px;
  }
  #review .list-group .list-row button{
    grid-column:1 / -1;
    grid-row:2;
    justify-self:stretch;
    width:100%;
    min-height:28px;
    margin:0;
    padding:3px 5px;
    border-radius:6px;
    font-size:9px;
    line-height:1.2;
  }
  #review .list-group-body{
    padding:6px;
    gap:5px;
  }
  #review .list-group-rule{
    padding:5px 8px;
    font-size:11px;
  }
  #review .list-group-total{
    padding:5px 8px;
    font-size:11px;
  }
}

/* NATURAL_VISUAL_POLISH_V15: presentation only */
body { background:#f7f8fa; }
.card,
section.card[aria-labelledby="category-title"] {
  border-color:#e1e6ed;
  box-shadow:0 4px 20px rgba(24,36,60,.045);
}
.reference-banner {
  background:#f5f7fc;
}
.card[data-reference-stage="configure"] .reference-banner {
  background:#f1f5ff;
}
.card[data-reference-stage="configure"] .reference-banner h2 {
  color:var(--ink);
}
.card[data-reference-stage="configure"] .reference-detail {
  color:var(--muted);
}
.card[data-reference-stage="configure"] .reference-edit-controls button {
  background:#fff;
  border-color:#ccd8ee;
  color:#3159bd;
}
.reference-list { box-shadow:none; }
#categories button,
#rulings button,
#brands button {
  box-shadow:none;
  line-height:1.35;
}
#quantities .quantity-tile.selected {
  background:#edf3ff;
  border-color:var(--blue);
  box-shadow:inset 0 0 0 1px var(--blue);
}
#quantities .quantity-tile.selected>label {
  color:#244fb7;
}
.list-group-header,
.checkout-preview-header {
  background:#315fcf;
}
.reference-edit-controls button {
  min-height:36px;
}
button,input { touch-action:manipulation; }
button:disabled { opacity:.6; }

@media(max-width:767px) {
  .quantity-controls {
    grid-template-columns:minmax(0,1fr) 32px;
    grid-template-rows:32px 32px;
  }
  .quantity-controls button {
    width:32px;
    min-width:32px;
    height:32px;
    min-height:32px;
  }
  #quantities .quantity-controls input {
    height:66px;
  }
  #review .list-group .list-row input {
    min-height:36px;
    height:36px;
  }
  #review .list-group .list-row button {
    min-height:32px;
    font-size:10px;
  }
  #review .list-group .list-row label {
    font-size:10px;
  }
  .reference-edit-controls button {
    font-size:11px;
  }
}
@media(prefers-reduced-motion:no-preference) {
  button {
    transition:background-color .15s ease,
      border-color .15s ease,box-shadow .15s ease;
  }
}


/* CATEGORY_VISUAL_POLISH_V16: category presentation only */
#builder #categories {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-top:8px;
}
#builder #categories > button {
  box-sizing:border-box;
  width:100%;
  min-width:0;
  min-height:96px;
  height:auto;
  padding:12px 10px;
  gap:8px;
  border-radius:12px;
  background:#fff;
  color:var(--ink,#18243c);
  font-size:14px;
  font-weight:600;
  line-height:1.35;
  white-space:normal;
  box-shadow:none;
}
#builder #categories > button::before {
  flex-shrink:0;
  width:32px;
  height:40px;
  border-left-width:4px;
  border-radius:4px;
  box-shadow:3px 2px 0 #e7edf7;
}
#builder #categories > button.selected {
  background:#eef3ff;
  border-color:var(--blue,#3d6ce7);
  box-shadow:inset 0 0 0 1px var(--blue,#3d6ce7);
}
#builder #categories > button.selected::after {
  top:6px;
  right:8px;
  font-size:14px;
  line-height:1;
}
#builder #categories > button:focus-visible {
  outline:2px solid var(--blue,#3d6ce7);
  outline-offset:3px;
}
@media (hover:hover) {
  #builder #categories > button:not(.selected):hover {
    background:#f7f9fd;
    border-color:#b9c9e9;
  }
}
@media (max-width:767px) {
  #builder #categories {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    margin-top:6px;
  }
  #builder #categories > button {
    min-height:82px;
    padding:10px 8px;
    gap:6px;
    font-size:13px;
    border-radius:10px;
  }
  #builder #categories > button::before {
    width:24px;
    height:30px;
    border-left-width:3px;
    box-shadow:2px 2px 0 #e7edf7;
  }
}


/* MOBILE_COMPACT_LABELS_V17: visual labels only */
@media (max-width:767px) {
  #builder #categories,
  #builder #rulings {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:6px;
    margin-top:6px;
  }

  #builder #categories > button[data-compact-label],
  #builder #rulings > button[data-compact-label] {
    box-sizing:border-box;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    width:100%;
    min-width:0;
    min-height:76px;
    height:auto;
    padding:9px 3px;
    gap:0;
    font-size:0;
    line-height:0;
    border-radius:10px;
  }

  #builder #categories > button[data-compact-label]::before {
    width:22px;
    height:28px;
    flex-shrink:0;
    margin-bottom:7px;
    border-left-width:3px;
  }

  #builder #rulings > button[data-compact-label]::before {
    width:25px;
    height:28px;
    flex-shrink:0;
    margin-bottom:7px;
  }

  #builder #categories > button[data-compact-label]::after,
  #builder #rulings > button[data-compact-label]::after {
    content:attr(data-compact-label);
    position:static;
    display:block;
    margin:0;
    color:var(--ink,#18243c);
    font-size:12px;
    font-weight:600;
    line-height:1.3;
    white-space:nowrap;
  }

  #builder #categories > button[data-compact-label].selected::after,
  #builder #rulings > button[data-compact-label].selected::after {
    content:attr(data-compact-label) " ✓";
    color:var(--blue,#3d6ce7);
  }
}

/* BOOK_COMPACT_ROWS_V24: desktop/tablet one row, mobile two rows. */
#builder[data-card-stage="configure"] #quantities {
  display:grid;
  grid-template-columns:repeat(var(--page-count,8),minmax(0,1fr));
  gap:6px;
}
#builder[data-card-stage="configure"] #quantities .quantity-tile {
  min-width:0;
  padding:5px;
  border-radius:9px;
}
#builder[data-card-stage="configure"] #quantities .quantity-tile>label {
  font-size:17px;
  line-height:1.1;
  margin-bottom:4px;
}
#builder[data-card-stage="configure"] #quantities .quantity-controls {
  min-width:0;
}
#builder[data-card-stage="configure"] #quantities .quantity-controls input {
  width:100%;min-width:0;min-height:36px;
  padding:3px 1px;font-size:15px;height:36px;
}
#builder[data-card-stage="configure"] #brands {
  display:flex;flex-wrap:wrap;gap:6px;
}
#builder[data-card-stage="configure"] #brands button {
  flex:1 1 0;min-width:0;min-height:40px;
  padding:6px 8px;font-size:14px;
}
@media(max-width:767px) {
  #builder[data-card-stage="configure"] #quantities {
    grid-template-columns:repeat(var(--mobile-page-columns,4),minmax(0,1fr));
    gap:5px;
  }
  #builder[data-card-stage="configure"] #quantities .quantity-tile {
    padding:4px;border-radius:8px;
  }
  #builder[data-card-stage="configure"] #quantities .quantity-tile>label {
    font-size:15px;margin-bottom:3px;
  }
  #builder[data-card-stage="configure"] #quantities .quantity-controls {
    display:grid;grid-template-columns:minmax(0,1fr) 24px;
    grid-template-rows:24px 24px;gap:0 2px;
  }
  #builder[data-card-stage="configure"] #quantities .quantity-controls input {
    grid-column:1;grid-row:1 / 3;min-height:48px;height:48px;font-size:14px;
  }
  #builder[data-card-stage="configure"] #quantities .quantity-controls button {
    min-width:24px;min-height:24px;width:24px;height:24px;padding:0;
  }
  #builder[data-card-stage="configure"] #quantities .quantity-controls button:first-child {
    grid-column:2;grid-row:2;
  }
  #builder[data-card-stage="configure"] #quantities .quantity-controls button:last-child {
    grid-column:2;grid-row:1;
  }
}

/* RULING_BADGE_V24: keep selected ruling visible on compact screens. */
.card[data-reference-stage="configure"] .reference-detail {
  display:flex;align-items:center;flex-wrap:wrap;gap:6px 9px;
}
.reference-ruling-badge {
  display:inline-flex;align-items:center;gap:6px;
  padding:4px 8px;border:1px solid #cedafa;border-radius:7px;
  background:#fff;color:#244fae;font-size:12px;font-weight:600;
  line-height:1.2;white-space:nowrap;
}
.reference-ruling-icon {
  display:block;flex:0 0 20px;width:20px;height:20px;
  border:1px solid #b9caf2;border-radius:3px;background-color:#fff;
  background-image:repeating-linear-gradient(to bottom,transparent 0 4px,#8ca9e8 4px 5px);
}
.reference-ruling-icon[data-paper="square"] {
  background-image:repeating-linear-gradient(to bottom,transparent 0 4px,#8ca9e8 4px 5px),repeating-linear-gradient(to right,transparent 0 4px,#8ca9e8 4px 5px);
}
.reference-ruling-icon[data-paper="double"] {
  background-image:repeating-linear-gradient(to bottom,transparent 0 3px,#8ca9e8 3px 4px,transparent 4px 6px,#8ca9e8 6px 7px,transparent 7px 11px);
}
.reference-ruling-icon[data-paper="plain"] {background-image:none;}
@media(max-width:1023px) {
  .reference-ruling-hint {display:none;}
  .card[data-reference-stage="configure"] .reference-detail {margin-top:6px;}
  .reference-ruling-badge {font-size:12px;}
}

/* COMPACT_MY_LIST_V29: visual presentation only. */
#review {padding:16px;}
#review>h2 {margin:0 0 12px;font-size:20px;letter-spacing:-.3px;}
#review .list-group {margin:0 0 9px;border:1px solid #e0e6f0;border-radius:11px;overflow:hidden;background:#fff;box-shadow:0 2px 8px rgba(25,48,91,.025);}
#review .list-group-header {padding:10px 12px;background:#f5f7fc;color:#18243c;border-bottom:1px solid #e8edf5;}
#review .list-group-header h3 {color:#18243c;font-size:15px;line-height:1.25;margin:0;letter-spacing:-.15px;}
#review .list-group-brand {padding:3px 8px;background:#fff;color:#315fcf;border:1px solid #dce5f5;border-radius:6px;font-size:11px;}
#review .list-group-body {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px 12px;padding:10px 12px;align-items:center;}
#review .list-group-rule {grid-column:1 / -1;grid-row:1;display:block;min-height:0;width:auto;margin:0;padding:0;background:transparent;border:0;border-radius:0;font-size:11px;line-height:1.3;font-weight:500;color:#69758b;text-align:left;}
#review .list-group-pages {grid-column:1;grid-row:2;display:flex;flex-wrap:wrap;gap:6px;min-width:0;}
#review .list-group-pages .list-row {display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:9px;flex:1 1 205px;width:auto;min-width:0;margin:0;padding:7px 9px;background:#fff;border:1px solid #e6ebf3;border-radius:8px;}
#review .list-group-pages .list-row>p {margin:0;font-size:14px;line-height:1.3;font-weight:600;color:#18243c;text-align:left;min-width:0;overflow-wrap:anywhere;}
.list-item-model {display:block;color:#647188;font-size:10px;line-height:1.3;font-weight:500;margin-bottom:3px;}
#review .list-group-pages .list-row>label {display:flex;align-items:center;gap:5px;margin:0;font-size:10px;line-height:1.3;color:#69758b;text-align:left;max-width:135px;}
#review .list-group-pages .list-row input {width:44px;min-width:44px;height:36px;min-height:36px;padding:3px;font-size:14px;border:1px solid #d9e2f2;border-radius:7px;text-align:center;}
#review .list-group-pages .list-row>button {width:auto;margin:0;min-height:36px;padding:5px 8px;border:1px solid #ecdfe0;border-radius:7px;background:#fff;color:#9b5157;font-size:10px;}
#review .list-group-total {grid-column:2;grid-row:2;margin:0;padding:0;background:transparent;border:0;font-size:12px;line-height:1.3;color:#31518d;font-weight:600;white-space:nowrap;}
#review #list-total {margin:14px 0 8px;padding-top:12px;border-top:1px solid #e5eaf2;font-size:17px;letter-spacing:-.2px;}
#review>.note {font-size:11px;line-height:1.45;color:#748096;}
#review>#more,#review>#checkout {min-height:42px;border-radius:9px;padding:8px 12px;font-size:13px;}
.checkout-book-details .list-item-model {font-size:10px;}
@media(max-width:767px) {
  #review {padding:12px;}
  #review>h2 {font-size:18px;margin-bottom:9px;}
  #review .list-group-header {padding:8px 9px;}
  #review .list-group-header h3 {font-size:14px;}
  #review .list-group-body {grid-template-columns:minmax(0,1fr);gap:6px;padding:8px 9px;}
  #review .list-group-pages {grid-column:1;gap:5px;}
  #review .list-group-pages .list-row {grid-template-columns:minmax(0,1fr) auto auto;gap:6px;flex-basis:100%;padding:6px 7px;}
  #review .list-group-pages .list-row>p {font-size:13px;}
  #review .list-group-pages .list-row>label {font-size:9px;gap:4px;max-width:115px;}
  #review .list-group-pages .list-row input {width:38px;min-width:38px;font-size:13px;}
  #review .list-group-pages .list-row>button {padding:5px 6px;font-size:9px;}
  #review .list-group-total {grid-column:1;grid-row:3;text-align:right;font-size:11px;}
}

/* BORDERLESS_BOOK_CATEGORIES_V32: presentation only. */
#builder #categories>button,
#builder #categories>button[data-compact-label] {
  border:0;
  background:transparent;
  box-shadow:none;
}
#builder #categories>button.selected,
#builder #categories>button[data-compact-label].selected {
  border:0;
  background:#eef3ff;
  box-shadow:none;
}
@media(hover:hover) {
  #builder #categories>button:not(.selected):hover {
    border:0;
    background:#f3f6fc;
    box-shadow:none;
  }
}
#builder #categories>button:focus-visible {
  outline:2px solid var(--blue,#3d6ce7);
  outline-offset:3px;
}

/* SHARED_SELECTION_TEMPLATE_V32: presentation only */
#builder #categories {grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;}
#builder #categories>button,#builder #categories>button[data-compact-label] {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;border:0;background:transparent;box-shadow:none;padding:10px 4px;min-height:104px;font-size:14px;line-height:1.3;}
#builder #categories>button::before {width:36px;height:44px;background-color:#eef3ff;border-radius:8px;box-shadow:none;}
#builder #categories>button.selected {background:#eef3ff;box-shadow:none;}
#builder #rulings>button,#builder #rulings>button[data-compact-label],#builder[data-card-stage="configure"] #brands>button {border:0;background:transparent;box-shadow:none;}
#builder #rulings>button.selected,#builder[data-card-stage="configure"] #brands>button.selected {background:#eef3ff;box-shadow:none;}
@media(max-width:767px){
 #builder #categories {grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;}
 #builder #categories>button,#builder #categories>button[data-compact-label] {min-height:88px;font-size:12px;gap:8px;padding:8px 3px;}
 #builder #categories>button::before,#builder #categories>button[data-compact-label]::before {width:30px;height:36px;}
}

/* SHARED_SELECTION_TEMPLATE_V33: presentation only */
#builder #categories {grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;}
#builder #categories>button,#builder #categories>button[data-compact-label] {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;border:0;background:transparent;box-shadow:none;padding:10px 4px;min-height:104px;font-size:14px;line-height:1.3;}
#builder #categories>button::before {width:36px;height:44px;background-color:#eef3ff;border-radius:8px;box-shadow:none;}
#builder #categories>button.selected {background:#eef3ff;box-shadow:none;}
#builder #rulings>button,#builder #rulings>button[data-compact-label],#builder[data-card-stage="configure"] #brands>button {border:0;background:transparent;box-shadow:none;}
#builder #rulings>button.selected,#builder[data-card-stage="configure"] #brands>button.selected {background:#eef3ff;box-shadow:none;}
@media(max-width:767px){
 #builder #categories {grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;}
 #builder #categories>button,#builder #categories>button[data-compact-label] {min-height:88px;font-size:12px;gap:8px;padding:8px 3px;}
 #builder #categories>button::before,#builder #categories>button[data-compact-label]::before {width:30px;height:36px;}
}
