/* ==========================================================================
   AI Hub round 2: USE-CASE PAGES (library L-26 and detail page T07).
   Loads after system.css.  The detail page also loads product.css, for the
   timeline (.ptl), the trust strip (.pfacts), .inline-link and .pfaq__more.

   Contents
    1  Shared: chip variants, use-case card (.uc-card)
    2  Library title bar and stats                .ucl-hero  .ucl-stats
    3  Filter bar: industry chips and search      .ucl-bar  .fchip  .ucl-search
    4  Sidebar: departments and product           .ucl-side  .dopt  .ucl-prod
    5  Results: count, grid, empty state          .ucl-results  .ucl-grid  .ucl-empty
    6  Detail hero, breadcrumb, at-a-glance       .ucd-hero  .crumbs  .ucd-glance
    7  The problem today                          .ucd-problem  .ucd-today
    8  Product screens (tabs + frame)             .ucd-pills  .ucd-shot
    9  What changes (outcome cards)               .ocards  .ocard
   10  Related use cases                          .ucd-related
   11  Closing band microcopy
   12  Responsive
   ========================================================================== */

/* ---------- 1. Shared ---------- */
.chip--quiet { background: var(--tan); color: var(--ink-2); }
.chip--line { background: transparent; border: 1px solid var(--line-dark-strong); color: var(--on-dark-2); }

/* Use-case card: department, title, one-line outcome, product chips, industries.
   Linked cards (P1) are whole-card links; summary (P2) cards are plain, not clickable, no label (D-04DI). */
.uc-card { position: relative; display: flex; flex-direction: column; gap: 14px; height: 100%; padding: clamp(26px, 2.6vw, 34px); background: var(--white); border: 1px solid var(--line); border-radius: 16px; transition: border-color var(--t), background var(--t); }
.uc-card__dept { font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--coral-text); }
.uc-card__title { margin-top: -2px; font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.25rem, .6vw + 1.1rem, 1.4375rem); line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; }
.uc-card__link::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: 16px; }   /* whole card is the link */
.uc-card__link:focus-visible { outline: none; }
.uc-card:has(.uc-card__link:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.uc-card__line { color: var(--ink-2); font-size: 1rem; line-height: 1.6; text-wrap: pretty; }
.uc-card__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.uc-card__foot { margin-top: auto; padding-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); }
.uc-card__ind { font-size: .8125rem; line-height: 1.5; color: var(--ink-3); }
.uc-card__ind span:not(.visually-hidden) { white-space: nowrap; }
.uc-card__go { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--paper-2); color: var(--ink); transition: background var(--t), color var(--t); }
.uc-card__go .icon { width: 18px; height: 18px; transition: transform var(--t); }
.uc-card:hover .uc-card__go { background: var(--ink); color: var(--paper); }
.uc-card:hover .uc-card__go .icon { transform: translateX(2px); }
.uc-card--soon { background: transparent; border-style: dashed; border-color: var(--line-strong); }

/* ---------- 2. Library title bar (L-26): dark, with true counts ---------- */
.ucl-hero { padding-block: clamp(48px, 5vw, 72px) clamp(52px, 6vw, 88px); }
.ucl-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: end; }
.ucl-hero__copy { display: grid; gap: 24px; justify-items: start; max-width: 720px; }
.ucl-hero .display { font-size: clamp(2.375rem, 2.8vw + 1.1rem, 3.625rem); }
.ucl-hero .lead { max-width: 30em; }
.ucl-stats { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); border: 1px solid var(--line-dark-strong); border-radius: var(--r-lg); background: rgba(242, 239, 230, .03); overflow: hidden; }
.ucl-stats > div { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 10px; padding: 26px clamp(22px, 2.4vw, 34px); border-left: 1px solid var(--line-dark); }
.ucl-stats > div:nth-child(odd) { border-left: 0; }
.ucl-stats > div:nth-child(n+3) { border-top: 1px solid var(--line-dark); }
.ucl-stats dd { font-family: var(--font-serif); font-style: italic; font-weight: 500; font-size: clamp(2.25rem, 1.8vw + 1.2rem, 3rem); line-height: 1; color: var(--coral); font-variant-numeric: lining-nums; }
.ucl-stats dt { font-size: .6875rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--on-dark-2); }

/* ---------- 3. Filter bar: industry chips (radio group) and search ---------- */
.ucl { display: block; }
.ucl fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ucl-bar { background: var(--paper); border-bottom: 1px solid var(--line); }
.ucl-bar__row { display: flex; align-items: center; justify-content: space-between; gap: 20px 32px; padding-block: 22px; }
.ucl-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.fchip { position: relative; display: inline-flex; }
.fchip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.fchip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); font-size: .9375rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; transition: background var(--t), color var(--t), border-color var(--t); }
.fchip:hover span { border-color: var(--line-strong); color: var(--ink); }
.fchip input:checked + span { background: var(--coral-fill); border-color: var(--coral-fill); color: #fff; }
.fchip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.ucl-search { position: relative; flex: 0 1 320px; min-width: 220px; margin-left: auto; }
.ucl-search .icon { position: absolute; left: 18px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--ink-3); pointer-events: none; }
.ucl-search input { width: 100%; min-height: 48px; padding: 0 18px 0 46px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--white); font: inherit; font-size: .9375rem; color: var(--ink); -webkit-appearance: none; appearance: none; }
.ucl-search input::placeholder { color: var(--ink-3); }
.ucl-search input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.ucl-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ---------- 4. Sidebar: department radio list (with live counts) and a product select ---------- */
.ucl-main { padding-block: clamp(40px, 5vw, 72px) var(--section-y); }
.ucl-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: clamp(40px, 5vw, 80px); align-items: start; }
.ucl-side { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 40px; }
.ucl-label { display: block; padding: 0; margin-bottom: 14px; font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.ucl-dept__rows { display: grid; gap: 2px; }
.dopt { position: relative; display: block; }
.dopt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.dopt__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font-size: 1rem; color: var(--ink-2); transition: background var(--t), color var(--t), border-color var(--t); }
.dopt__n { font-size: .875rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dopt:hover .dopt__row { background: var(--paper-2); color: var(--ink); }
.dopt input:checked + .dopt__row { background: var(--white); border-color: var(--line-strong); box-shadow: inset 3px 0 0 var(--coral); color: var(--ink); font-weight: 600; }
.dopt input:focus-visible + .dopt__row { outline: 3px solid var(--focus); outline-offset: 2px; }
.ucl-prod select { width: 100%; min-height: 48px; padding: 0 44px 0 18px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A4741' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center / 16px; font: inherit; font-size: .9375rem; color: var(--ink); -webkit-appearance: none; appearance: none; cursor: pointer; }
.ucl-prod select:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* ---------- 5. Results: count line, two-column grid, empty state ---------- */
.ucl-results__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 24px; }
.ucl-results__status { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 20px; min-height: 48px; }
.ucl-count { font-size: var(--fs-small); color: var(--ink-3); }
.ucl-count b { font-weight: 600; color: var(--ink); }
.ucl-clear { display: inline-flex; align-items: center; min-height: 44px; font-size: .9375rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--coral); color: var(--ink); }
.ucl-clear:hover { color: var(--coral-text); }
.ucl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.ucl-item { display: flex; min-width: 0; }
.ucl-item > .uc-card { flex: 1; }
.ucl-empty { display: grid; justify-items: start; gap: 18px; padding: clamp(36px, 5vw, 64px); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--paper-2); }
.ucl-empty .lead { max-width: 30em; }
.ucl-empty .btn-row { margin-top: 6px; }
.ucl-empty[hidden] { display: none; }

/* ---------- 6. Detail hero: breadcrumb, headline, framed product screen, three facts ---------- */
.ucd-hero { padding-block: clamp(32px, 4vw, 56px) clamp(56px, 7vw, 96px); }
.crumbs { margin-bottom: clamp(32px, 4.4vw, 60px); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: .875rem; color: var(--on-dark-3); }
.crumbs li + li::before { content: '/'; margin-right: 10px; opacity: .55; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; padding-block: 8px; transition: color var(--t); }
.crumbs a:hover { color: #fff; }
.crumbs [aria-current] { display: inline-flex; align-items: center; min-height: 44px; padding-block: 8px; color: var(--on-dark-2); }
.ucd-hero__grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: clamp(40px, 6vw, 88px); align-items: center; }
.ucd-hero__copy { display: grid; gap: 28px; justify-items: start; }
.ucd-hero .display { font-size: clamp(2.25rem, 2.2vw + 1.1rem, 3.125rem); line-height: 1.08; }
.ucd-hero .lead { max-width: 30em; }
.ucd-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ucd-tags .chip { min-height: 30px; }
.ucd-hero__media .frame__body { overflow: hidden; background: var(--dark); }
/* the frame follows the image's own aspect, so no still is cropped and text near the edges stays whole */
.ucd-hero__media .frame__body img { display: block; width: 100%; max-width: none; height: auto; aspect-ratio: auto; object-fit: contain; }
.ucd-hero__media .frame { border-color: var(--line-dark-strong); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .65); }
.ucd-glance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(48px, 6vw, 88px); border-top: 1px solid var(--line-dark); }
.ucd-glance > div { padding: clamp(24px, 3vw, 36px) clamp(16px, 3vw, 40px) 0; border-left: 1px solid var(--line-dark); }
.ucd-glance > div:first-child { padding-left: 0; border-left: 0; }
.ucd-glance dt { font-size: .6875rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--coral-lt); }
.ucd-glance dd { margin-top: 10px; color: var(--on-dark); font-size: 1.0625rem; line-height: 1.55; max-width: 24em; }

/* ---------- 7. The problem today ---------- */
.ucd-problem { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 112px); align-items: start; }
.ucd-problem__copy { display: grid; gap: 22px; justify-items: start; }
.ucd-problem__copy .lead { max-width: 28em; }
.ucd-who { margin-top: 14px; padding-top: 24px; border-top: 1px solid var(--line-strong); max-width: 28em; }
.ucd-who dt { font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.ucd-who dd { margin-top: 8px; color: var(--ink); font-size: 1.0625rem; }
.ucd-today { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(24px, 3vw, 40px); }
.ucd-today__label { font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 8px; }
.ucd-today ol { counter-reset: today; }
.ucd-today li { counter-increment: today; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 22px 0; border-top: 1px solid var(--line); font-size: 1.125rem; line-height: 1.5; color: var(--ink); }
.ucd-today li::before { content: counter(today, decimal-leading-zero); font-family: var(--font-serif); font-size: 1.125rem; color: var(--coral-text); }
.ucd-today li:last-child { padding-bottom: 4px; }

/* ---------- 8. Product screens: pill tabs over one framed window, caption underneath ---------- */
.ucd-pills { justify-content: flex-start; margin-bottom: clamp(28px, 3.4vw, 44px); }
.ucd-shot { max-width: none; }
.ucd-shot .frame__body img { aspect-ratio: 16 / 9; object-fit: cover; object-position: left top; }
.ucd-shot figcaption { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px clamp(24px, 4vw, 56px); margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--ink-2); }
.ucd-shot figcaption strong { font-family: var(--font-serif); font-weight: 600; font-size: 1.3125rem; line-height: 1.3; color: var(--ink); }
.ucd-shot figcaption span { font-size: 1.0625rem; line-height: 1.6; }
.ucd-shot__note { margin-top: 20px; }
.ucd-products-note { margin-top: 28px; max-width: 46em; }

/* ---------- 8b. Steps strip: used instead of the screen tabs when a page has no screens (D-04CS) ---------- */
.ucd-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); counter-reset: strip; }
.ucd-strip__step { display: grid; align-content: start; gap: 12px; padding: clamp(24px, 3vw, 36px) clamp(16px, 3vw, 40px) 0; border-left: 1px solid var(--line); }
.ucd-strip__step:first-child { padding-left: 0; border-left: 0; }
.ucd-strip__n { font-family: var(--font-serif); font-size: 1.125rem; color: var(--coral-text); }
.ucd-strip__n::before { content: '0'; }
.ucd-strip h3 { font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.4375rem, .8vw + 1.2rem, 1.75rem); line-height: 1.2; letter-spacing: -.01em; }
.ucd-strip p { color: var(--ink-2); font-size: 1.0625rem; line-height: 1.6; max-width: 26em; }
/* a page with no hero screen: the copy takes the row */
.ucd-hero__media--tile { display: flex; justify-content: center; }
.ucd-hero__tile { width: clamp(120px, 14vw, 180px); height: clamp(120px, 14vw, 180px); border-radius: 36px; }
.ucd-hero__tile .icon { width: 44%; height: 44%; }
.ucd-hero__grid--solo { grid-template-columns: minmax(0, 1fr); }
.ucd-hero__grid--solo .ucd-hero__copy { max-width: 52em; }

/* ---------- 9. What changes: three cards, each labelled product fact or illustrative scenario (U-23 pattern) ---------- */
.ocards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.ocard { display: flex; flex-direction: column; gap: 16px; min-height: 340px; padding: clamp(28px, 3vw, 40px); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); }
.ocard h3 { font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.4375rem, .8vw + 1.2rem, 1.75rem); line-height: 1.2; letter-spacing: -.01em; text-wrap: balance; }
.ocard p { color: var(--ink-2); }
.ocard__basis { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.ocard--dark { background: var(--dark); border-color: var(--dark); color: var(--on-dark); --focus: #F2EFE6; }
.ocard--dark p { color: var(--on-dark-2); }
.ocard--dark .ocard__basis { border-top-color: var(--line-dark); color: var(--coral-lt); }
.ocard__fig { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-family: var(--font-serif); }
.ocard__num { font-weight: 500; font-size: clamp(3.5rem, 3.4vw + 1.5rem, 5rem); line-height: 1; color: var(--coral); font-variant-numeric: lining-nums; }
.ocard__unit { font-size: 1.125rem; font-style: italic; color: var(--on-dark-2); }
.ocard__note { font-size: .875rem; color: var(--on-dark-3); }

/* ---------- 10. Related use cases ---------- */
.ucd-related__head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px 32px; margin-bottom: var(--gap-head); }
.ucd-related__head .section__head { margin-bottom: 0; }
.ucd-related__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.ucd-related__grid > li { display: flex; min-width: 0; }
.ucd-related__grid > li > .uc-card { flex: 1; }

/* ---------- 11. Closing band microcopy (same rule as product.css) ---------- */
.cta-line { margin-top: 36px; font-size: .8125rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--on-dark-2); }

/* ---------- 11b. Without JavaScript: the Apply button submits the GET form; the script filters live and hides it ---------- */
.ucl-apply { justify-self: start; }
.js .ucl-apply { display: none; }

/* ---------- 12. Responsive ---------- */
@media (max-width: 1100px) {
  .ucl-hero__grid { grid-template-columns: 1fr; align-items: start; }
  .ucl-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 720px; }
  .ucl-stats > div:nth-child(n) { border-top: 0; border-left: 1px solid var(--line-dark); padding-inline: clamp(16px, 3vw, 28px); }
  .ucl-stats > div:first-child { border-left: 0; }
}
@media (max-width: 1000px) {
  .ucd-hero__grid { grid-template-columns: 1fr; }
  .ucd-hero__media { max-width: 680px; }
  .ucd-problem { grid-template-columns: 1fr; }
  .ucd-strip { grid-template-columns: 1fr; border-top: 0; }
  .ucd-strip__step, .ucd-strip__step:first-child { padding: 24px 0 0; margin-top: 24px; border-left: 0; border-top: 1px solid var(--line-strong); }
  .ocards { grid-template-columns: 1fr; }
  .ocard { min-height: 0; }
  .ucd-related__grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  /* sidebar folds into a row above the grid: departments become scrolling pills */
  .ucl-layout { grid-template-columns: 1fr; gap: 28px; }
  .ucl-side { position: static; gap: 24px; }
  .ucl-label { margin-bottom: 10px; }
  .ucl-dept__rows { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding: 4px var(--gutter); }
  .ucl-dept__rows::-webkit-scrollbar { display: none; }
  .dopt { flex: none; }
  .dopt__row { min-height: 44px; padding: 0 18px; border-radius: 999px; border-color: var(--line); background: var(--white); white-space: nowrap; font-size: .9375rem; }
  .dopt input:checked + .dopt__row { background: var(--coral-fill); border-color: var(--coral-fill); color: #fff; box-shadow: none; }
  .dopt input:checked + .dopt__row .dopt__n { color: #fff; }
  .dopt__n { margin-left: 4px; }
  .ucl-prod select { min-height: 48px; }
  .ucd-shot figcaption { grid-template-columns: 1fr; }
  .ucd-glance { grid-template-columns: 1fr; }
  .ucd-glance > div, .ucd-glance > div:first-child { padding: 24px 0 0; border-left: 0; }
  .ucd-glance > div + div { margin-top: 24px; border-top: 1px solid var(--line-dark); }
}
@media (max-width: 640px) {
  .ucl-hero { padding-bottom: 48px; }
  .ucl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ucl-stats > div:nth-child(n) { padding: 20px 20px; border-left: 1px solid var(--line-dark); border-top: 0; }
  .ucl-stats > div:nth-child(odd) { border-left: 0; }
  .ucl-stats > div:nth-child(n+3) { border-top: 1px solid var(--line-dark); }
  .ucl-bar__row { flex-direction: column; align-items: stretch; padding-block: 18px; gap: 14px; }
  .ucl-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding: 4px var(--gutter); }
  .ucl-chips::-webkit-scrollbar { display: none; }
  .fchip { flex: none; }
  .ucl-search { flex: none; min-width: 0; width: 100%; }
  .ucl-grid { grid-template-columns: 1fr; gap: 16px; }
  .uc-card { padding: 24px; }
  .ucl-empty .btn-row .btn { width: auto; }
  .ucd-pills { flex-wrap: nowrap; }
  .ucd-today li { grid-template-columns: 36px minmax(0, 1fr); font-size: 1.0625rem; }
}
@media (max-width: 640px) { .crumbs li:last-child { display: none; } .ucd-pills { margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); } }
