/* ============================================================
   CROSLYNK · SPECIALIZED MATERIALS PAGE (materials.html only)
   Builds on style.css (periodic-table tiles, wizard), simulation.css
   (hero, jump bar, band, tabs, FAQ, enquiry, lightbox), manufacturing.css
   (route sections, spec grid, comparison tables, QC grid), testing.css
   (dark-zone tables) and tooling.css (tool cards, tick lists, splits).
   ============================================================ */

/* ---------- hero ---------- */
.mat-page .sim-hero .hero-copy h1 { max-width: 14ch; }
.mat-page .sim-stats b { font-size: 1.32rem; white-space: nowrap; }

/* ---------- 3D printing family colour (joins the five in style.css) ---------- */
.f-print { background: rgba(156, 74, 38, 0.92); border-color: #9C4A26; }
.f-print .sym { color: #fff; }
.f-print .nm { color: #f3d2bf; }
.f-print .proc { color: #f0b796; }
.f-print .hd { color: #FFE0B8; }
.f-print::after { background: linear-gradient(150deg, #c9663a, #8a3e1f); color: #fff; box-shadow: 0 14px 30px rgba(120, 50, 20, 0.45), 0 0 20px rgba(255, 150, 90, 0.35); }

/* ---------- filters ---------- */
.pt-filters { display: grid; gap: 10px; margin: 26px 0 22px; }
.pf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pf-k { font: 500 0.62rem/1 'IBM Plex Mono', monospace; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); width: 74px; }
.pf {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font: 500 0.76rem/1 'Poppins', sans-serif; color: var(--ink);
  padding: 9px 13px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.7); transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.pf:hover { border-color: var(--amber); transform: translateY(-1px); }
.pf.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pf:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.pf i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; border: 1px solid rgba(0, 0, 0, 0.12); }
.pf i.f-tpe { background: #F5EBD9; border-color: #C9A24B; }
.pf code { font: 600 0.6rem/1 'IBM Plex Mono', monospace; padding: 3px 5px; border-radius: 5px; background: var(--amber-ghost); color: var(--amber-dark); }
.pf.on code { background: rgba(255, 255, 255, 0.16); color: #FFC64A; }
.pf-shown { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: #fff6e6; border: 1px solid #f0cf94; font-size: 0.84rem; }
.pf-shown[hidden] { display: none; }
.pf-shown b { color: var(--amber-dark); }
.pf-shown button { margin-left: auto; cursor: pointer; font: 500 0.74rem/1 'Poppins', sans-serif; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); }
.pf-shown button:hover { border-color: var(--amber); }

/* ---------- table + panel ---------- */
.pt-shell { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.pt-main { display: grid; gap: 30px; min-width: 0; }
.pgroup[hidden] { display: none; }
.pg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 12px; padding-bottom: 9px; border-bottom: 1px dashed var(--line-strong); }
.pg-head b { font-size: 1.12rem; }
.pg-sw { width: 13px; height: 13px; border-radius: 4px; align-self: center; border: 1px solid rgba(0, 0, 0, 0.1); }
.pg-sw.f-tpe { background: #F5EBD9; }
.pg-sw::after { display: none; }
.pg-meta { font: 400 0.64rem/1.3 'IBM Plex Mono', monospace; letter-spacing: 0.08em; color: var(--muted); }
.pg-link { margin-left: auto; font: 500 0.74rem/1 'Poppins', sans-serif; color: var(--amber-dark); text-decoration: none; }
.pg-link:hover { text-decoration: underline; }
.mat-page .ptable { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }

button.ptile { font: inherit; text-align: left; width: 100%; color: inherit; cursor: pointer; display: block; min-height: 108px; }
.ptile .sym, .ptile .nm, .ptile .hd { display: block; }
.ptile .sym { padding-right: 26px; }
.ptile:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.ptile.on { outline: 2.5px solid #FFB020; outline-offset: 3px; transform: translateY(-4px) !important; box-shadow: 0 16px 34px rgba(186, 117, 23, 0.28); z-index: 3; }
/* .revealed in style.css pins opacity and transform with !important; these win on specificity */
.mat-page .ptile.revealed:hover { transform: translateY(-5px) scale(1.04) !important; }
.ptile.picked::before {
  content: "\2713"; position: absolute; left: auto; right: 8px; bottom: 8px; top: auto; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font: 700 0.7rem/1 'Poppins', sans-serif; color: #fff; background: var(--good);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); z-index: 2; opacity: 1;
}
.ptile.dim { opacity: 0.16 !important; filter: saturate(0.3); }
.ptile.dim:hover { opacity: 0.5 !important; }
.ptile.req { border-style: dashed; border-width: 1.5px; border-color: #E09A3C; }
.ptile.req .hd { color: #FFC97A; }

/* detail panel */
.pt-panel {
  position: sticky; top: 104px; padding: 20px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.82); border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 40px rgba(103, 70, 31, 0.14); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.pp-close { display: none; }
.pp-head { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; margin-bottom: 14px; }
.pp-tile { position: relative; border-radius: 14px; padding: 12px 9px 10px; min-height: 84px; display: flex; flex-direction: column; justify-content: flex-end; box-shadow: 0 8px 20px rgba(103, 70, 31, 0.16); }
.pp-tile .sym { font-weight: 700; font-size: 1rem; line-height: 1.1; }
.pp-tile .proc { position: absolute; top: 7px; right: 8px; font: 400 0.54rem/1 'IBM Plex Mono', monospace; }
.pp-tile .hd { font: 400 0.6rem/1 'IBM Plex Mono', monospace; margin-top: 5px; }
.pp-tile::after { display: none; }
.pp-fam { font: 500 0.6rem/1.2 'IBM Plex Mono', monospace; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber-dark); }
.pt-panel h3 { font-size: 1.04rem; line-height: 1.3; margin: 5px 0 4px; }
.pp-pr { font-size: 0.76rem; color: var(--muted); }
.pp-scale { margin: 0 0 14px; }
.pp-scale[hidden] { display: none; }
.pp-scale .bar { position: relative; height: 8px; border-radius: 99px; background: linear-gradient(90deg, #F5EBD9 0%, #E3B36A 40%, #BA7517 72%, #59616c 100%); }
.pp-scale .bar i { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: left 0.45s var(--ease-premium); }
.pp-scale .ticks { display: flex; justify-content: space-between; margin-top: 6px; font: 400 0.56rem/1 'IBM Plex Mono', monospace; color: var(--muted); }
.pp-rows { margin: 0 0 12px; display: grid; gap: 0; border-top: 1px solid var(--line); }
.pp-rows div { display: grid; grid-template-columns: 104px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.8rem; }
.pp-rows dt { color: var(--muted); font-size: 0.74rem; }
.pp-rows dd { margin: 0; font-weight: 500; color: var(--ink); }
.pp-txt { font-size: 0.82rem; line-height: 1.5; color: #4f4537; margin-bottom: 8px; }
.pp-txt b { display: block; font: 500 0.6rem/1.2 'IBM Plex Mono', monospace; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.pp-actions { display: flex; gap: 8px; margin: 14px 0 10px; }
.pp-add, .pp-tds { flex: 1; cursor: pointer; font: 600 0.76rem/1 'Poppins', sans-serif; padding: 11px 10px; border-radius: 10px; transition: background 0.2s, border-color 0.2s; }
.pp-add { background: var(--amber); border: 1px solid var(--amber); color: #fff; }
.pp-add:hover { background: var(--amber-dark); border-color: var(--amber-dark); }
.pp-add.added { background: var(--good); border-color: var(--good); }
.pp-tds { background: #fff; border: 1px solid var(--line-strong); color: var(--ink); }
.pp-tds:hover { border-color: var(--amber); }
.pp-more { font: 500 0.76rem/1 'Poppins', sans-serif; color: var(--amber-dark); text-decoration: none; }
.pp-more:hover { text-decoration: underline; }
.pp-note { font: 400 0.62rem/1.5 'IBM Plex Mono', monospace; color: var(--muted); margin: 12px 0 0; }
.pt-panel.flash { animation: ppFlash 0.5s var(--ease-premium); }
@keyframes ppFlash { 0% { transform: translateY(6px); opacity: 0.6; } 100% { transform: none; opacity: 1; } }

.pt-foot { margin-top: 26px; display: grid; gap: 8px; }
.pt-codes { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.74rem; color: var(--muted); }
.pt-codes span { display: inline-flex; align-items: center; gap: 6px; }
.pt-codes code { font: 600 0.6rem/1 'IBM Plex Mono', monospace; padding: 3px 5px; border-radius: 5px; background: var(--amber-ghost); color: var(--amber-dark); }
.req-sw { width: 14px; height: 14px; border-radius: 4px; border: 1.5px dashed #E09A3C; background: #2e2b28; display: inline-block; }
.pt-note { font: 400 0.66rem/1.6 'IBM Plex Mono', monospace; color: var(--muted); margin: 0; max-width: 900px; }

/* ---------- material service cards ---------- */
.ms-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 30px; }
.ms-card { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: rgba(255, 255, 255, 0.66); border: 1px solid rgba(255, 255, 255, 0.9); box-shadow: 0 10px 26px rgba(103, 70, 31, 0.08); transition: transform 0.3s var(--ease-premium), box-shadow 0.3s; }
.ms-card:hover { transform: translateY(-4px); box-shadow: 0 18px 36px rgba(103, 70, 31, 0.14); }
.ms-img { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #2a2014; }
.ms-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease-premium); }
.ms-card:hover .ms-img img { transform: scale(1.05); }
.ms-img .svc-src { position: absolute; right: 8px; bottom: 7px; font: 400 0.52rem/1 'IBM Plex Mono', monospace; color: rgba(255, 255, 255, 0.9); background: rgba(0, 0, 0, 0.4); padding: 4px 6px; border-radius: 6px; }
.ms-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; flex: 1; }
.ms-n { font: 600 0.66rem/1 'IBM Plex Mono', monospace; letter-spacing: 0.12em; color: var(--amber-dark); }
.ms-body h3 { font-size: 1.04rem; margin: 0; }
.ms-body p { font-size: 0.84rem; line-height: 1.55; margin: 0; color: #4f4537; }
.ms-foot { margin-top: auto; padding-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ms-foot .svc-add { font-size: 0.72rem; padding: 9px 12px; }

/* ---------- family sections ---------- */
.tool-types.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mat-page .route-copy .spec-grid { margin: 14px 0 4px; }
.mat-page .route-copy .tick-list li b { color: var(--ink); }
.mat-page .steel-split { margin-top: 34px; }
.cmp.poly { min-width: 760px; }
.cmp.poly td:first-child { font-weight: 600; }
.cmp.pu-tab, .cmp.tpu-tab { min-width: 520px; }
.cmp.print-tab { min-width: 480px; }
.cmp.print-tab td:first-child { color: var(--muted); }
.cmp.tpu-tab td[rowspan] { font-size: 0.78rem; line-height: 1.5; vertical-align: middle; }
.rt { display: inline-block; font: 600 0.62rem/1 'IBM Plex Mono', monospace; padding: 5px 7px; border-radius: 6px; white-space: nowrap; }
.rt.r5 { background: #1f7a4d; color: #fff; }
.rt.r4 { background: #dff1e6; color: #1f6b44; }
.rt.r3 { background: #fdf0d6; color: #8a5a10; }
.rt.r2 { background: #fbe6cf; color: #9a4e12; }
.rt.r1 { background: #f6dcd6; color: #9b2c1c; }
.tab-note { font: 400 0.68rem/1.6 'IBM Plex Mono', monospace; color: var(--muted); margin: 8px 0 0; }
.design-note { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: #fff6e6; border: 1px solid #f0cf94; font-size: 0.84rem; line-height: 1.55; color: #4f4537; }
.design-note b { color: var(--amber-dark); }
.go-table {
  cursor: pointer; font: 500 0.78rem/1 'Poppins', sans-serif; padding: 12px 15px; border-radius: 10px;
  background: transparent; border: 1px dashed var(--amber); color: var(--amber-dark); transition: background 0.2s;
}
.go-table:hover { background: var(--amber-ghost); }
.go-table:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.go-table.dk { margin-top: 14px; background: #FFB020; border: 1px solid #FFB020; color: #1a1206; font-weight: 600; }
.go-table.dk:hover { background: #FFC64A; }

/* steels */
.steel-sec { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 32px; align-items: start; }
.steel-fig { margin: 0; border-radius: 20px; overflow: hidden; position: relative; background: #2a2014; box-shadow: 0 20px 44px rgba(103, 70, 31, 0.16); }
.steel-fig button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.steel-fig img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.steel-fig figcaption { position: absolute; right: 10px; bottom: 9px; font: 400 0.56rem/1 'IBM Plex Mono', monospace; color: rgba(255, 255, 255, 0.9); background: rgba(0, 0, 0, 0.4); padding: 4px 6px; border-radius: 6px; }
.steel-sec > *, .wiz-wrap > * { min-width: 0; }
.steel-sec .route-head-row { margin-bottom: 10px; }
.steel-sec .cmp.steel { min-width: 560px; }

/* ---------- selection guide ---------- */
.cmp.sel { min-width: 860px; }
.cmp.sel td:nth-child(2) { font-weight: 600; color: var(--amber-dark); }
.cmp.sel td:nth-child(4) { color: var(--muted); font-size: 0.8rem; }
.cmp.sel td:last-child { width: 70px; text-align: right; }
.sel-show { cursor: pointer; font: 600 0.72rem/1 'Poppins', sans-serif; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--amber); background: #fff; color: var(--amber-dark); transition: background 0.2s, color 0.2s; }
.sel-show:hover { background: var(--amber); color: #fff; }
.cmp.sel tr.on td { background: #fff6e6; }

.wiz-wrap { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 46px; scroll-margin-top: 92px; }
.wiz-intro h3 { font-size: 1.4rem; margin: 6px 0 8px; }
.wiz-intro p { font-size: 0.9rem; }
.wz-res { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wz-card { margin: 0; display: flex; flex-direction: column; }
.wz-card h3 { font-size: 1.18rem; margin: 10px 0 6px; }
.wz-card p { font-size: 0.86rem; }
.wz-show { margin-top: auto; align-self: flex-start; cursor: pointer; font: 600 0.74rem/1 'Poppins', sans-serif; padding: 9px 12px; border-radius: 8px; border: 1px dashed var(--amber); background: transparent; color: var(--amber-dark); }
.wz-show:hover { background: var(--amber-ghost); }
.wz-proto { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: #fff6e6; border: 1px solid #f0cf94; font-size: 0.84rem; }
.wz-proto[hidden] { display: none; }
.wz-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.wz-actions .btn { padding: 11px 18px; }
#wizard .disclaimer { margin-top: 14px; }

/* ---------- sectors (dark, reuses case tabs) ---------- */
#sectors .case-panel.active { grid-template-columns: 1fr 1.15fr; }
#sectors .rail-fig img { aspect-ratio: 3 / 2; }
#sectors .rail-cat td:nth-child(2) { font-family: 'IBM Plex Mono', monospace; font-size: 0.74rem; color: #FFD34D; white-space: nowrap; }
#sectors .rail-cat td:first-child { color: #fff4e0; font-weight: 500; }
#sectors .rail-cat td:last-child { color: #cdbfa6; }
#sectors .sub-h.dk { color: #b8a98f; margin: 16px 0 8px; }
#sectors .spec-chips { margin-top: 0; }

/* ---------- supply ---------- */
.gate-steps.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sup-grid { margin-top: 44px; }
.sup-grid .qc-point .when { font-size: 0.58rem; }
.lab-note a { color: var(--amber-dark); }

/* ---------- enquiry grade chips ---------- */
.grade-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.grade-chips:empty { display: none; }
.grade-chips button { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font: 600 0.68rem/1 'IBM Plex Mono', monospace; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); }
.grade-chips button i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.grade-chips button i.f-tpe { background: #F5EBD9; border: 1px solid #C9A24B; }
.grade-chips button i::after { display: none; }
.grade-chips button span { color: var(--muted); font-weight: 400; }
.grade-chips button:hover { border-color: var(--bad); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .pt-shell { grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
}
@media (max-width: 1100px) {
  .ms-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-types.three { grid-template-columns: 1fr; }
  .wiz-wrap { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 900px) {
  .pt-shell { grid-template-columns: minmax(0, 1fr); }
  .pt-panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 160; max-height: 82vh; overflow-y: auto;
    border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    background: #fdfbf6; transform: translateY(105%); transition: transform 0.35s var(--ease-premium);
    box-shadow: 0 -18px 40px rgba(40, 26, 10, 0.28);
  }
  .pt-panel.open { transform: none; }
  .pt-panel.flash { animation: none; }
  .pp-close { display: grid; place-items: center; position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); background: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--ink); }
  .pp-head { padding-right: 36px; }
  .steel-sec { grid-template-columns: minmax(0, 1fr); }
  .steel-fig img { aspect-ratio: 16 / 9; }
  #sectors .case-panel.active { grid-template-columns: 1fr; }
  .gate-steps.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wz-res { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ms-grid { grid-template-columns: 1fr; }
  .ms-img { aspect-ratio: 2 / 1; }
  .mat-page .ptable { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; }
  button.ptile { min-height: 96px; padding: 12px 9px; }
  .ptile .sym { font-size: 0.96rem; padding-right: 22px; }
  .ptile .nm { font-size: 0.6rem; }
  .pf-k { width: 100%; }
  .pf { padding: 8px 11px; font-size: 0.72rem; }
  .pg-link { margin-left: 0; width: 100%; }
  .mat-page .sim-stats b { font-size: 1.12rem; }
  .gate-steps.four { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .ms-card, .ms-img img, .pp-scale .bar i, .pt-panel { transition: none; }
  .pt-panel.flash { animation: none; }
}

/* ---------- rubber: full-width polymer table + lot strip ---------- */
.sub-h.poly-h { margin-top: 38px; }
.lot-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.6); border: 1px solid var(--line); }
.lot-strip b { font: 600 0.62rem/1.2 'IBM Plex Mono', monospace; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber-dark); margin-right: 6px; }
.lot-strip span { position: relative; padding-left: 22px; font-size: 0.8rem; color: #4f4537; }
.lot-strip span::before {
  content: ""; position: absolute; left: 0; top: 1px; width: 15px; height: 15px; border-radius: 4px;
  background: var(--amber-ghost) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238F5A12' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 10px no-repeat;
  border: 1px solid var(--line-strong);
}
.gate-steps.four::before { right: 26%; }
@media (max-width: 1100px) { .gate-steps.four::before { display: none; } }

/* The shared fadeInPage entrance keeps a transform on <body> (fill-mode both),
   which would trap the fixed bottom sheet and lightbox. Drop it once it ends. */
body.mat-page { animation-fill-mode: backwards; }

/* simplified layout (Oct 2026): one image per family, short copy */
.route-grid { align-items: center; }
.route-media { position: static; }
.steel-sec { align-items: center; grid-template-columns: 420px minmax(0, 1fr); }
.steel-fig img { aspect-ratio: 4 / 3; }
@media (max-width: 900px) { .steel-sec { grid-template-columns: minmax(0, 1fr); } }
