/* Subject marks, accents and availability controls over the original Technology stylesheet. */
@font-face{font-family:Archivo;src:url('/assets/Archivo-600.ttf');font-weight:600;font-display:swap}
@font-face{font-family:Archivo;src:url('/assets/Archivo-800.ttf');font-weight:800;font-display:swap}
@font-face{font-family:Inter;src:url('/assets/Inter-400.ttf');font-weight:400;font-display:swap}
@font-face{font-family:Inter;src:url('/assets/Inter-600.ttf');font-weight:600 800;font-display:swap}
@font-face{font-family:'IBM Plex Mono';src:url('/assets/IBMPlexMono-500.ttf');font-weight:500;font-display:swap}
/* Catalog controls share each subject's paper, ink, accent and type. */
:where(.l9-format-bar, .l9-field-filters, .l9-filter-choices, .tech-search-field) {
  --l9f-edge: color-mix(in srgb, var(--navy) 54%, var(--paper));
  --l9f-active: color-mix(in srgb, var(--otext) 9%, var(--white));
  --l9f-hover: color-mix(in srgb, var(--navy) 6%, var(--white));
  --l9f-gap: .5rem;
}

.l9-filter-name,
.l9-format-value {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.l9-filter-choices .l9-filter-count,
#shop.l9-format-bar .l9-filter-count,
#shop.l9-format-bar .l9-format-total {
  display: inline-block;
  flex: none;
  min-inline-size: 2ch;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--slate);
  font: 500 .8125rem/1.2 var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: end;
  white-space: nowrap;
}

#shop.l9-format-bar [hidden],
.l9-filter-choices [hidden] {
  display: none !important;
}

/* Wide catalog navigation. Compact screens use the native disclosure below. */
#shop .l9-format-picker {
  display: none;
}

#shop .l9-format-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .375rem;
  margin: 0;
  padding: .625rem 0;
  overflow: visible;
}

#shop .l9-format-tabs .tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .625rem;
  max-inline-size: none;
  min-inline-size: 0;
  min-block-size: 44px;
  padding: .55rem .625rem;
  border: 1px solid transparent;
  border-radius: .375rem;
  background: transparent;
  color: var(--navy);
  font: 600 1rem/1.3 var(--body);
  text-align: center;
  white-space: normal;
}

#shop .l9-format-tabs .tab[aria-selected="true"],
.l9-filter-choices .l9-filter-choice[aria-pressed="true"] {
  border-color: var(--otext);
  background: var(--l9f-active);
  color: var(--navy);
}

#shop .l9-format-tabs .tab[aria-selected="true"] .l9-filter-name,
.l9-filter-choices .l9-filter-choice[aria-pressed="true"] .l9-filter-name {
  text-decoration: underline;
  text-decoration-color: var(--otext);
  text-underline-offset: .22em;
  text-decoration-thickness: 2px;
}

#shop .tab[aria-selected="true"] .l9-filter-count,
.l9-filter-choices .l9-filter-choice[aria-pressed="true"] .l9-filter-count {
  color: var(--otext);
}

/* Search remains first, with additional choices only where the inventory needs them. */
.filters-ready .l9-field-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .75rem 1.25rem;
  margin: 0 0 .65rem;
}

.l9-field-filters .l9-filter-field {
  flex: 0 1 var(--l9-catalog-search-width);
  max-inline-size: 100%;
}

.l9-filter-label,
.l9-format-caption {
  color: var(--slate);
  font: 600 .875rem/1.35 var(--body);
}

.l9-field-filters .l9-filter-input {
  display: block;
  box-sizing: border-box;
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 46px;
  padding: .625rem .875rem;
  border: 1px solid var(--l9f-edge, var(--navy));
  border-radius: .375rem;
  background: var(--white);
  color: var(--navy);
  caret-color: var(--otext);
  font: 400 1rem/1.35 var(--body);
}

.l9-filter-input::placeholder {
  color: var(--slate);
  opacity: 1;
}

.tabsjs .filters.l9-filter-choices,
.l9-field-filters .l9-filter-choices {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--l9f-gap);
  min-inline-size: 0;
  margin: 0;
}

.tabsjs .filters.l9-filter-choices {
  margin-block-end: .875rem;
}

.l9-filter-choices .l9-filter-choice {
  box-sizing: border-box;
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: .625rem;
  min-inline-size: 44px;
  max-inline-size: 100%;
  min-block-size: 44px;
  padding: .5rem .75rem;
  border: 1px solid var(--l9f-edge, var(--navy));
  border-radius: .375rem;
  background: var(--white);
  color: var(--navy);
  font: 600 .9375rem/1.3 var(--body);
  text-align: start;
  touch-action: manipulation;
  cursor: pointer;
}

.l9-filter-choices .l9-filter-reset {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-block-size: 44px;
  padding: .5rem .375rem;
  border: 0;
  border-radius: .25rem;
  background: transparent;
  color: var(--otext);
  font: 600 .9375rem/1.3 var(--body);
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}

.l9-filter-choices + .fcount:empty {
  min-block-size: 0;
  margin: 0;
}

@media (hover: hover) {
  #shop .l9-format-tabs .tab:not([aria-selected="true"]):hover,
  #shop .l9-format-summary:hover,
  #shop .l9-format-option:not([aria-current="true"]):hover,
  .l9-filter-choices .l9-filter-choice:not([aria-pressed="true"]):hover {
    background: var(--l9f-hover);
    color: var(--navy);
  }
}

@media (max-width: 50rem) {
  #shop.l9-format-bar {
    position: static;
    inset-block-start: auto;
  }

  #shop.l9-format-bar ~ .panel[role="tabpanel"] {
    --tech-tabs-height: 0px;
  }

  #shop .l9-format-tabs {
    display: none;
  }

  #shop .l9-format-picker {
    display: block;
    padding-block: .625rem;
    container: l9-format / inline-size;
  }

  #shop .l9-format-summary {
    display: flex;
    align-items: center;
    gap: .75rem;
    box-sizing: border-box;
    min-block-size: 46px;
    padding: .6rem .875rem;
    border: 1px solid var(--l9f-edge, var(--navy));
    border-radius: .375rem;
    background: var(--white);
    color: var(--navy);
    font: 600 1rem/1.35 var(--body);
    cursor: pointer;
    list-style: none;
    touch-action: manipulation;
  }

  #shop .l9-format-summary::-webkit-details-marker {
    display: none;
  }

  #shop .l9-format-caption {
    border-inline-end: 1px solid var(--rule);
    padding-inline-end: .75rem;
  }

  #shop .l9-format-value {
    flex: 1 1 auto;
  }

  #shop .l9-format-chevron {
    flex: none;
    inline-size: .48em;
    block-size: .48em;
    margin-inline: .15rem;
    border: solid currentColor;
    border-width: 0 1.75px 1.75px 0;
    transform: translateY(-.12em) rotate(45deg);
  }

  #shop .l9-format-picker[open] .l9-format-chevron {
    transform: translateY(.12em) rotate(225deg);
  }

  #shop .l9-format-picker[open] .l9-format-summary {
    border-end-start-radius: 0;
    border-end-end-radius: 0;
  }

  #shop .l9-format-options {
    display: grid;
    gap: 0;
    padding: .25rem;
    border: 1px solid var(--l9f-edge, var(--navy));
    border-block-start: 0;
    border-radius: 0 0 .375rem .375rem;
    background: var(--white);
  }

  #shop .l9-format-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    gap: .75rem;
    min-block-size: 44px;
    padding: .5rem .625rem;
    box-sizing: border-box;
    border-radius: .25rem;
    color: var(--navy);
    font: 500 1rem/1.35 var(--body);
    text-decoration: none;
    touch-action: manipulation;
  }

  #shop .l9-format-option[aria-current="true"] {
    background: var(--l9f-active);
    font-weight: 600;
  }

  #shop .l9-format-option[aria-current="true"] .l9-filter-name::after {
    content: "";
    display: inline-block;
    inline-size: .38em;
    block-size: .68em;
    margin-inline-start: .6em;
    border: solid var(--otext);
    border-width: 0 2px 2px 0;
    transform: translateY(-.04em) rotate(45deg);
  }
}

/* Keep full words together when the reader enlarges type on a narrow phone. */
@container l9-format (max-width: 16.5rem) {
  #shop .l9-format-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    grid-template-areas: "caption arrow" "value count";
    gap: .22em 10px;
    padding: 10px 12px;
  }

  #shop .l9-format-caption {
    grid-area: caption;
    border: 0;
    padding: 0;
  }

  #shop .l9-format-value {
    grid-area: value;
    overflow-wrap: break-word;
  }

  #shop .l9-format-total {
    grid-area: count;
    align-self: baseline;
  }

  #shop .l9-format-chevron {
    grid-area: arrow;
    justify-self: end;
  }
}

@container l9-format (max-width: 8rem) {
  #shop .l9-format-summary {
    grid-template-columns: minmax(0, 1fr) max-content max-content;
    grid-template-areas: "caption count arrow" "value value value";
    column-gap: 6px;
  }

  #shop .l9-format-caption {
    min-inline-size: 0;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 40rem) {
  .filters-ready .l9-field-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .tabsjs .filters.l9-filter-choices,
  .l9-field-filters .l9-filter-choices {
    display: grid;
    /* Keep pairs at ordinary phone widths; larger type naturally gets a full row. */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, max(8.25rem, 42%)), 1fr));
  }

  .l9-filter-choices .l9-filter-reset {
    grid-column: 1 / -1;
  }
}

#shop.l9-format-bar :is(summary, a):focus-visible,
.l9-field-filters .l9-filter-input:focus-visible,
.l9-filter-choices button:focus-visible {
  outline: 2px solid var(--otext);
  outline-offset: 2px;
}

@media (forced-colors: active) {
  #shop .l9-format-tabs .tab[aria-selected="true"],
  #shop .l9-format-option[aria-current="true"],
  .l9-filter-choices .l9-filter-choice[aria-pressed="true"] {
    outline: 1px solid Highlight;
    outline-offset: -2px;
  }
}

/* Use the container's line height so native font enlargement and reflow
   agree even before web fonts load. Longer intros can grow naturally. */
.hero > .wrap {
  container: catalog-intro / inline-size;
}
.hero .lede {
  min-block-size: calc(var(--l9-intro-lines, 2) * 1lh);
  max-inline-size: max(800px, 29lh);
  align-content: center;
}
@container catalog-intro (max-width: 25.5lh) { .hero .lede { --l9-intro-lines: 3; } }
@container catalog-intro (max-width: 17lh) { .hero .lede { --l9-intro-lines: 4; } }
@container catalog-intro (max-width: 13.5lh) { .hero .lede { --l9-intro-lines: 5; } }
@container catalog-intro (max-width: 11lh) { .hero .lede { --l9-intro-lines: 6; } }
@container catalog-intro (max-width: 8.8lh) { .hero .lede { --l9-intro-lines: 8; } }
@container catalog-intro (max-width: 6.8lh) { .hero .lede { --l9-intro-lines: 10; } }
@container catalog-intro (max-width: 5.4lh) { .hero .lede { --l9-intro-lines: 12; } }

:root {
  --l9-catalog-inset: 64px;
  --l9-catalog-search-width: 18rem;
}
@media (max-width: 560px) {
  :root { --l9-catalog-inset: 48px; }
}
@media (max-width: 40rem) {
  :root { --l9-catalog-search-width: 20rem; }
}
.tech-catalog, .sec.field-catalog {
  padding-block-start: var(--l9-catalog-inset);
}
.tech-search-field, .tech-format-field, .l9-field-filters .l9-filter-field {
  display: grid;
  gap: .375rem;
  min-inline-size: 0;
}
.tech-search-field, .l9-field-filters .l9-filter-field {
  inline-size: min(100%, var(--l9-catalog-search-width));
}

/* Shared catalog search and the single resource link beneath the hero. */
.l9-hero-resource { display: grid; justify-items: center; margin: .75rem 0 0; }
.l9-hero-resource a { display:inline-flex; align-items:center; max-inline-size:100%; min-height:44px; color:var(--otext); font:600 .9375rem/1.4 var(--body); text-underline-offset:.2em; }
@container catalog-intro (max-width: 6.4lh) {
  .l9-hero-resource a { min-block-size: max(44px, 2lh); }
}
.l9-filter-input, .l9-field-filters .l9-filter-input {
  display:block; box-sizing:border-box; width:100%; min-width:0; min-height:44px;
  padding:.45rem clamp(8px,.75rem,12px); border:1px solid var(--l9f-edge,var(--rule)); border-radius:.375rem;
  background:var(--white); color:var(--navy); caret-color:var(--otext);
  font:400 max(16px,1rem)/1.35 var(--body);
}
/* Technology uses the same controls at every width. Native fragment links remain available without a script. */
.tech-catalog {position:relative;z-index:2;padding-block-end:.15rem;scroll-margin-block-start:var(--l9-header-height,65px);}
.tech-catalog [hidden] {display:none!important;}
.tech-catalog-tools {display:grid;grid-template-columns:minmax(0,var(--l9-catalog-search-width)) minmax(0,9.25rem) minmax(0,10rem);align-items:start;gap:.55rem .8rem;max-width:100%;}
/* Container thresholds follow the actual catalog type size, including text-only zoom. */
.tech-catalog > .wrap {font-size:1rem;container:tech-controls / inline-size;}
[data-catalog-picker] {position:relative;width:100%;min-width:0;}
[data-catalog-picker] summary {
  box-sizing:border-box;display:flex;justify-content:space-between;align-items:center;gap:.45rem;
  min-height:44px;padding:.45rem .75rem;list-style:none;cursor:pointer;border:1px solid var(--l9f-edge,var(--rule));
  border-radius:.375rem;background:var(--white);color:var(--navy);font:600 max(16px,1rem)/1.35 var(--body);
  overflow-wrap:break-word;touch-action:manipulation;
}
[data-catalog-picker] summary::-webkit-details-marker {display:none;}
.tech-format-current {min-width:0;}
.tech-chevron {width:.49em;height:.49em;flex:0 0 auto;margin-inline:.12rem;border:solid currentColor;border-width:0 1.7px 1.7px 0;transform:translateY(-.12em) rotate(45deg);}
[data-catalog-picker][open] .tech-chevron {transform:translateY(.12em) rotate(225deg);}
.tech-format-surface {
  position:absolute;z-index:2;inset-block-start:calc(100% + 4px);inset-inline-start:var(--tech-menu-left,0);
  box-sizing:border-box;inline-size:min(16.5rem,var(--tech-menu-width,calc(100vw - 16px)));
  max-block-size:var(--tech-menu-space,50dvh);overflow:auto;overscroll-behavior:contain;
  border:1px solid var(--l9f-edge,var(--rule));border-radius:.375rem;background:var(--white);
  box-shadow:0 .4rem 1.3rem rgb(10 27 48 / 18%);
}
[data-catalog-picker][data-placement="above"] .tech-format-surface {inset-block-start:auto;inset-block-end:calc(100% + 4px);}
.tech-format-list {box-sizing:border-box;min-inline-size:0;margin:0;padding:.2rem;border:0;}
.tech-format-option {display:grid;grid-template-columns:auto minmax(0,1fr) max-content;align-items:center;gap:.55rem;
  box-sizing:border-box;min-height:44px;padding:.35rem .55rem;cursor:pointer;border-radius:.25rem;color:var(--navy);
  font:500 max(16px,1rem)/1.35 var(--body);touch-action:manipulation;}
.tech-format-option input {inline-size:1.05em;block-size:1.05em;margin:0;accent-color:var(--otext);}
.tech-format-option:has(:checked),.tech-format-option:has(:indeterminate) {background:color-mix(in srgb,var(--otext) 7%,var(--white));}
.tech-format-option span {min-width:0;overflow-wrap:break-word;}
.tech-total {color:var(--slate);font:500 .8125rem/1.2 var(--mono);font-variant-numeric:tabular-nums;}
.tech-format-all {margin-bottom:.14rem;border-bottom:1px solid var(--rule);}
.tech-format-option:focus-within,[data-catalog-picker] summary:focus-visible,.tech-catalog .l9-filter-input:focus-visible,.tech-recovery button:focus-visible {outline:2px solid var(--otext);outline-offset:2px;}
.tech-format-jumps {display:flex;gap:.25rem .9rem;flex-wrap:wrap;}
.tech-format-jumps a,.tech-recovery button {display:inline-flex;align-items:center;min-height:44px;padding:0 .15rem;border:0;background:transparent;color:var(--otext);font:600 .9375rem/1.4 var(--body);text-decoration:underline;text-underline-offset:.2em;cursor:pointer;}
.tech-results,.tech-catalog-empty p {margin:.65rem 0 0;color:var(--slate);font:400 .95rem/1.45 var(--body);}
.tech-recovery {display:flex;flex-wrap:wrap;gap:0 .8rem;}
.tech-catalog ~ section[data-format-section] {min-height:0;scroll-margin-block-start:var(--l9-header-height,65px);padding-top:2.1rem;}
@container tech-controls (max-width:39em) {
  .tech-catalog-tools {grid-template-columns:repeat(2,minmax(0,1fr));max-width:33rem;}
  .tech-search-field {grid-column:1 / -1;}
}
@container tech-controls (max-width:16.5em) or (max-width:10.4lh) {
  .tech-catalog-tools {grid-template-columns:minmax(0,1fr);}
  .tech-search-field {grid-column:auto;}
}
/* Allow long controls and cards to reflow when the reader enlarges type. */
:is(#early, #suggest) .btn { max-inline-size: 100%; white-space: normal; overflow-wrap: anywhere; }
.foot .brand { max-inline-size: 100%; }
.foot .brand .bw { min-inline-size: 0; white-space: normal; }

@media (max-width: 560px) {
  section[data-format-section] > .wrap { container: catalog-products / inline-size; }
  .study-pack-card:only-child { container: catalog-pack / inline-size; }
  @container catalog-products (max-width: 10.4lh) {
    section[data-format-section] .grid { grid-template-columns: minmax(0, 1fr); }
    section[data-format-section] .cardbody { overflow-wrap: anywhere; }
  }
  @container catalog-pack (max-width: 10.4lh) {
    .study-pack-card:only-child .cardlink { grid-template-columns: minmax(0, 1fr); }
    .study-pack-card:only-child .cardbody { min-inline-size: 0; overflow-wrap: anywhere; }
  }
}

@media(forced-colors:active){.tech-format-surface{border-color:CanvasText;box-shadow:none;}.tech-format-option:focus-within,[data-catalog-picker] summary:focus-visible{outline-color:Highlight;}}
@media(prefers-reduced-motion:reduce){.tech-catalog *, .tech-format-option{scroll-behavior:auto;}}
