/* material library page: one scrolling family row, a common-grades opening view, reserved heights against load-time shift */
.mat-tools { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.mat-tools input { max-width: 100%; min-width: 0; }
@media (max-width: 640px) { .mat-head { flex-wrap: wrap; } .mat-tools input { flex: 1 1 100%; width: auto; } }
.pr-note { grid-column: 1 / -1; font-size: 11.5px; color: var(--text-2); line-height: 1.35; }

#matCount { min-height: 1.45em; }
/* family chips: a single line that scrolls inside itself, the edge with more chips fades out */
#matFams { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; min-height: 26px; padding: 1px 0; }
#matFams .chip { flex: none; white-space: nowrap; }
#matFams.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
#matFams.fade-l { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px); mask-image: linear-gradient(to right, transparent, #000 40px); }
#matFams.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
/* name and standard get the room they need: the standard no longer repeats the name's prefix */
.mats col.mname { width: 17%; } .mats col.mfam { width: 12%; }
.mat-detail { min-height: 320px; }
@media (max-width: 1100px) { .mat-detail { min-height: 0; } }
/* phones: the standard goes to the tooltip and the detail panel so yield and tensile sit next to the name */
@media (max-width: 640px) {
  .mats col.mfam, .mats th:nth-child(3), .mats td.mstd { display: none; }
  .mats col.mname { width: 132px; }
  table.mats { min-width: 760px; }
  .mat-legend { gap: 4px 12px; font-size: 11.5px; }
}

/* composition: the label column fits its longest label (--lw, set per composition), chips never wrap */
.comp-axis, .comp-row { grid-template-columns: var(--lw, 34px) minmax(0, 1fr) 82px; }
.comp-note { margin-left: calc(var(--lw, 34px) + 8px); }
.comp .el { white-space: nowrap; }
.comp .el-sum { width: auto; padding: 0 6px; background: var(--steel-650); font-size: 11px; justify-self: start; }
.comp .el-word { font-weight: 400; font-style: italic; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* favourites */
.fav { border: 0; background: none; padding: 0 4px 0 0; margin: 0; font-size: 13px; line-height: 1; color: var(--steel-350); cursor: pointer; vertical-align: -1px; }
.fav:hover { color: var(--text-2); }
.fav.on { color: var(--amber); }
.fav.big { font-size: 17px; padding-right: 6px; vertical-align: 0; }
.mats td.mname .fav { opacity: 0; }
.mats tr:hover td.mname .fav, .mats td.mname .fav.on, .mats td.mname .fav:focus-visible { opacity: 1; }
@media (hover: none) { .mats td.mname .fav { opacity: 1; } }
.fav-saved { display: block; font-style: normal; font-size: 11px; color: var(--x-a87618, #a87618); text-align: right; }
.fav-cap { margin: -4px 0 0; font-size: 12px; color: var(--text-2); }

/* stress–strain estimate in the detail panel (axes and labels as in the thread tool's chart) */
.ss-h { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.ss-h .ss-mode { margin-left: auto; }
.ss-h .seg.small button { padding: 2px 8px; font-size: 11.5px; font-weight: 400; }
svg.ss { display: block; width: 100%; height: auto; cursor: ew-resize; touch-action: pan-y; user-select: none; }
svg.ss:focus { outline: none; }
.ss-g { fill: var(--fill-1); stroke: none; }
.ss-t { font-size: 10.5px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.ss-a { font-size: 10.5px; fill: var(--text-2); }
.ss-l { font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ss-l.sm { font-weight: 500; font-size: 10px; }
.ss-line { stroke: var(--sel); stroke-width: 1.2; stroke-dasharray: 3 3; }
.ss-pill rect { fill: var(--surface); stroke: var(--sel); }
.ss-pill text { font-size: 10.5px; font-weight: 600; fill: var(--sel); font-variant-numeric: tabular-nums; }
.ss-cap { margin: 4px 0 0; font-size: 11.5px; color: var(--text-2); line-height: 1.4; }
.ss-src { margin: 2px 0 0; font-size: 10.5px; color: var(--text-3); line-height: 1.35; }
.ss-miss { margin: 0; font-size: 12px; color: var(--text-3); }

/* Ashby chart view: replaces the table inside the same card */
#matView { flex: none; }
.ashby { padding: 12px 14px 14px; }
.ash-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; }
.ash-sel { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.ash-sel select { border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); }
.ash-idx { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ash-il { font-size: 12.5px; color: var(--text-2); }
.ash-idx .chip.on { background: var(--pick-bg); color: var(--pick-ink); border-color: var(--pick-line); }
.ash-main { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 14px; align-items: start; }
.ash-plot { position: relative; min-width: 0; }
#ashSvg { display: block; width: 100%; cursor: crosshair; touch-action: pan-y; user-select: none; }
.ash-g { stroke: var(--fill-1); }
.ash-t { font-size: 10px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.ash-a { font-size: 11px; fill: var(--text-2); }
.ash-bub { fill-opacity: .09; stroke-opacity: .09; stroke-width: 18; stroke-linejoin: round; stroke-linecap: round; }
.ash-ell { fill-opacity: .18; stroke-width: .8; stroke-opacity: .6; }
.ash-star { font-size: 12px; fill: var(--amber); stroke: var(--halo); stroke-width: .6; paint-order: stroke; }
.ash-fl { font-size: 11px; font-weight: 600; }
.ash-line { stroke: var(--sel); stroke-width: 1.4; stroke-dasharray: 6 4; }
.ash-ll { font-size: 11px; font-weight: 600; fill: var(--sel); }
.ash-tip { position: absolute; z-index: 5; pointer-events: none; display: grid; gap: 1px; max-width: 260px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 9px; font-size: 11.5px; color: var(--text-2); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.ash-tip b { color: var(--text); font-weight: 600; font-size: 12px; }
.ash-top h4 { margin: 2px 0 2px; font-size: 12.5px; font-weight: 600; }
.ash-top p { margin: 0 0 6px; font-size: 11.5px; color: var(--text-3); }
.ash-top ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; counter-reset: a; }
.ash-top li button { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; padding: 3px 4px; border-radius: 6px; font: inherit; font-size: 12px; text-align: left; color: var(--text); cursor: pointer; }
.ash-top li button:hover { background: var(--x-f4f4f1, #f4f4f1); }
.ash-top li i { flex: none; width: 7px; height: 7px; border-radius: 50%; }
.ash-top li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ash-note { margin: 10px 0 0; font-size: 11.5px; color: var(--text-3); line-height: 1.45; }
@media (max-width: 820px) { .ash-main { grid-template-columns: minmax(0, 1fr); } .ash-top ol { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .ashby { padding: 10px; } .ash-top ol { grid-template-columns: minmax(0, 1fr); } }
.ash-tip[hidden] { display: none; }
.ash-top, .ash-top li { min-width: 0; }
.ash-top sup, .ash-idx sup { font-size: 70%; line-height: 0; }

/* T092: names and standards wrap instead of ending in an ellipsis; header units fit their column */
.mats td.mname, .mats td.mstd { white-space: normal; overflow: visible; text-overflow: clip; height: auto; padding-top: 5px; padding-bottom: 5px; line-height: 1.3; overflow-wrap: anywhere; }
.mats thead th { padding-left: 3px; padding-right: 3px; }
.mats td.mv { white-space: normal; overflow: visible; text-overflow: clip; height: auto; line-height: 1.25; padding-top: 4px; padding-bottom: 4px; }
/* phones: one card per material (name, then the values in a labelled grid), never a sideways scroll */
@media (max-width: 640px) {
  table.mats { min-width: 0; table-layout: auto; }
  .mats colgroup, .mats thead { display: none; }
  .mats, .mats tbody { display: block; width: 100%; }
  .mats tr { display: grid; grid-template-columns: 30px repeat(3, minmax(0, 1fr)); gap: 2px 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
  .mats td { display: block; height: auto; padding: 0; border: 0; max-width: none; overflow: visible; white-space: normal; text-align: left; }
  .mats td.mcmp { grid-row: 1; grid-column: 1; align-self: center; }
  .mats td.mname { grid-row: 1; grid-column: 2 / -1; }
  .mats td.mv { font-size: 12px; min-width: 0; }
  .mats td.mv:nth-child(3n + 1) { grid-column: 2; } .mats td.mv:nth-child(3n + 2) { grid-column: 3; } .mats td.mv:nth-child(3n) { grid-column: 4; }
  .mats td.mv::before { content: attr(data-h); display: block; font-size: 10.5px; font-style: normal; font-weight: 400; color: var(--text-3); }
  .mats td.mv::after { content: " " attr(data-u); font-size: 10.5px; font-style: normal; color: var(--text-3); }
  .mats tr.sel, .mats tr:hover { background: var(--sel-bg); }
  .mats tr.sel td, .mats tr:hover td { background: transparent; }
  .mats td.mv:empty { display: none; }
}
#matWrap.fade-b { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); }
#matWrap.fade-t { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 36px); mask-image: linear-gradient(to bottom, transparent, #000 36px); }
#matWrap.fade-t.fade-b { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
/* the sheet scrolls in its own wrapper (rounded like the card), so the card itself need not clip */
.mat-sheet { overflow: visible; }
#matWrap { border-radius: inherit; }

/* #matDetail fades out at an edge it scrolls past (fadeBoxes in material.js) */
#matDetail.fade-b { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent); }
#matDetail.fade-t { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px); mask-image: linear-gradient(to bottom, transparent, #000 28px); }
#matDetail.fade-t.fade-b { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 32px), transparent); }

/* theme-auto:start · generated by scripts/theme/hexmap.py: dark values (the rule of scripts/theme/colour.py) for
   colours that are not tokens, written as var(--x-rrggbb, #rrggbb): light is the fallback, unchanged */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --x-2d97b8: #77c4e0; --x-2f9384: #7ac4b6; --x-337a7a: #74abab; --x-3f78ad: #83b2e1; --x-4a64b0: #8ca6e9;
    --x-4c68c4: #8ba8f8; --x-5d6d80: #7b8999; --x-6e9a4e: #a0c687; --x-7c3aed: #af9af8; --x-8064ad: #b7a1e0;
    --x-8a6f57: #99826e; --x-8b5e3c: #c29a7d; --x-8f8a35: #bdba78; --x-94744a: #b89c79; --x-a5793f: #d3ad7e;
    --x-a8534e: #e0958e; --x-a87618: #d7ac6a; --x-b85579: #ea93af; --x-c06c35: #eba277; --x-c26a1d: #eda16b;
    --x-f4f4f1: #292724;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-2d97b8: #77c4e0; --x-2f9384: #7ac4b6; --x-337a7a: #74abab; --x-3f78ad: #83b2e1; --x-4a64b0: #8ca6e9;
    --x-4c68c4: #8ba8f8; --x-5d6d80: #7b8999; --x-6e9a4e: #a0c687; --x-7c3aed: #af9af8; --x-8064ad: #b7a1e0;
    --x-8a6f57: #99826e; --x-8b5e3c: #c29a7d; --x-8f8a35: #bdba78; --x-94744a: #b89c79; --x-a5793f: #d3ad7e;
    --x-a8534e: #e0958e; --x-a87618: #d7ac6a; --x-b85579: #ea93af; --x-c06c35: #eba277; --x-c26a1d: #eda16b;
    --x-f4f4f1: #292724;
  }
}
/* theme-auto:end */
