/* Tekfile demo portal — taste-skill app run, style "framed-sheet" (seed 1682957941), brand palette and type kept
   from site/assets/site.css (one ink, one petrol accent, IBM Plex Sans, Noto Sans Arabic, citation chips).
   Shell: one tinted L-frame (top bar 48px + sidebar 240px, no rule between them); the work sits on a white
   sheet inset 8px from the window's right and bottom edges, 1px edge, 16px corners, no shadow.
   Grid arithmetic at 1440: sheet 1440 − 240 − 8 = 1192; minus 2 × 24 padding = 1144;
   12 columns, gap 16: 12 × 80.67 + 11 × 16 = 1144; viewer 8 cols = 757.3, side column 4 cols = 370.7,
   757.3 + 16 + 370.7 = 1144. Radii: 16 (sheet), 8 (cards, viewer), 6 (controls). */
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url('/site/assets/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url('/site/assets/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url('/site/assets/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); } /* taste-skill-ignore: mono has one job here: serials, refs, hashes, URLs and citation tags */
@font-face { font-family: 'Noto Sans Arabic'; font-weight: 400; font-display: swap; src: url('/portal/fonts/noto-sans-arabic-arabic-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Noto Sans Arabic'; font-weight: 600 700; font-display: swap; src: url('/site/assets/fonts/noto-sans-arabic-arabic-700-normal.woff2') format('woff2'); }

:root {
  --frame: #e6ebed;        /* the L-frame: one low-chroma step of the petrol hue (the face) */
  --surface: #ffffff;      /* the sheet */
  --raised: #f3f5f6;       /* inner wells, hover rows */
  --active: #d7dfe2;       /* active nav pill, on the frame */
  --border: #e3e6e8;       /* sheet and card edges */
  --rule: #eef0f1;
  --control: #c9d0d4;
  --text: #15191d;
  --muted: #4f5860;
  --accent: #0f4c5c;       /* petrol: the primary action, the pinned version, the selected part */
  --accent-tint: #dbe8eb;
  --flag: #8a5a00;         /* the one warning hue: "a newer version exists" */
  --flag-tint: #fbf1dc;
  --sans: 'IBM Plex Sans', 'Noto Sans Arabic', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace; /* taste-skill-ignore: IDs and citation tags only */
  --fs-title: 24px; --fs-section: 15px; --fs-body: 14px; --fs-small: 12.5px;
  --side: 240px; --top: 48px; --pad: 24px; --gap: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--frame); color: var(--text); font: 400 var(--fs-body)/1.45 var(--sans); font-variant-numeric: tabular-nums; }
[dir=rtl] { font-family: 'Noto Sans Arabic', 'IBM Plex Sans', sans-serif; line-height: 1.6; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--fs-title); font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
h2 { font-size: var(--fs-section); font-weight: 600; }
h3 { font-size: var(--fs-body); font-weight: 600; }
[dir=rtl] h1, [dir=rtl] h2 { letter-spacing: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: 0.92em; overflow-wrap: break-word; } /* taste-skill-ignore: mono only for serials, refs, hashes and citation tags */
[dir=rtl] .mono, [dir=rtl] code.ref, [dir=rtl] .ref-no { direction: ltr; unicode-bidi: isolate; }
.small { font-size: var(--fs-small); }
.hint, .meta, .sub { color: var(--muted); font-size: var(--fs-small); }
.state { color: var(--muted); padding: 12px 0; }
.tl { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.tl:hover { color: var(--accent); }
.tl.strong { font-weight: 600; }
code.ref { font-family: var(--mono); font-size: 11.5px; color: var(--accent); background: var(--accent-tint); padding: 0 4px; white-space: nowrap; display: inline-block; }
[hidden] { display: none !important; }

/* ---------- frame: top bar + sidebar ---------- */
.top { height: var(--top); display: flex; align-items: center; gap: 16px; padding: 0 16px 0 20px; }
.mark { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; text-decoration: none; color: var(--accent); }
.mark svg { width: 18px; height: 21px; }
.mark span { color: var(--text); }
.scope { color: var(--muted); font-size: var(--fs-small); border-inline-start: 1px solid var(--control); padding-inline-start: 16px; }
.langs { margin-inline-start: auto; display: flex; gap: 2px; background: var(--active); border-radius: 6px; padding: 2px; }
.langs button { border: 0; background: transparent; min-width: 44px; height: 32px; border-radius: 6px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); transition: background-color .15s var(--ease); }
.langs button[aria-pressed=true] { background: var(--surface); color: var(--text); }
.langs button:hover { color: var(--text); }

.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - var(--top)); padding-inline-end: 8px; padding-bottom: 8px; }
.side { padding: 16px 16px 16px 20px; display: flex; flex-direction: column; gap: 20px; }
[dir=rtl] .side { padding: 16px 20px 16px 16px; }
.unit .k { font-size: var(--fs-small); color: var(--muted); }
.unit .oem { font-weight: 600; margin-top: 6px; }
.unit .des { color: var(--muted); font-size: var(--fs-small); margin-top: 2px; }
.ids { margin: 12px 0 0; display: grid; gap: 8px; }
.ids div { display: grid; gap: 1px; }
.ids dt { font-size: var(--fs-small); color: var(--muted); }
.ids dd { margin: 0; font-weight: 600; }
.ids dd.mono { font-size: 15px; color: var(--accent); }
.views { display: grid; gap: 2px; }
.views a { display: flex; align-items: center; justify-content: space-between; min-height: 34px; padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); transition: background-color .15s var(--ease); }
.views a:hover { color: var(--text); }
.views a[aria-current=page] { background: var(--active); color: var(--text); font-weight: 600; }
.count { font-size: var(--fs-small); color: var(--muted); font-weight: 400; }

/* ---------- the sheet ---------- */
.sheet { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: var(--pad); min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.titlerow { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.tt { display: grid; gap: 6px; max-width: 72ch; }
.finding { color: var(--text); }
.finding .flag { display: inline-block; background: var(--flag-tint); color: var(--flag); padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.finding .pin { color: var(--accent); font-weight: 600; }
.nw { white-space: nowrap; }
[dir=rtl] .nw { direction: ltr; unicode-bidi: isolate; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--control); background: var(--surface); text-decoration: none; font-weight: 600; font-size: 13.5px; cursor: pointer; transition: background-color .15s var(--ease), transform .12s var(--ease); }
.btn:hover { background: var(--raised); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #0b3a47; }
.btn[aria-disabled=true], .btn:disabled { opacity: .5; pointer-events: none; }
.perma { font-size: var(--fs-small); color: var(--muted); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.perma a { color: var(--text); }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: stretch; }
.grid > .col { align-content: start; }
.grid > .viewer, .grid > .stage { grid-column: span 8; }
.grid > .col { grid-column: span 4; display: grid; gap: var(--gap); }
.card { border: 1px solid var(--border); border-radius: 8px; padding: 16px; min-width: 0; }
.ch { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.viewer, .stage { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.viewer .ch { padding: 12px 16px 0; }
.pdfbox { position: relative; flex: 1; min-height: max(560px, calc(100vh - 300px)); background: var(--raised); border-top: 1px solid var(--border); }
.pdfbox object { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border: 0; }
.pdfbox .state { padding: 16px; }
.fallback { height: 100%; display: grid; align-content: center; justify-items: center; gap: 8px; padding: 24px; text-align: center; }
.fallback .fb-t { font-weight: 600; font-size: var(--fs-section); }
.fallback p { max-width: 46ch; }
.fallback .fb-a { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.row-link { margin-bottom: 4px; }
.cites { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }

/* version timeline: the signature element. Each published version keeps its URL and its hash;
   the one delivered with this serial is marked in the accent. */
.versions { list-style: none; margin: 0; padding: 0; display: grid; }
.versions li { position: relative; padding: 8px 0 10px 22px; border-top: 1px solid var(--rule); }
[dir=rtl] .versions li { padding: 8px 22px 10px 0; }
.versions li:first-child { border-top: 0; padding-top: 2px; }
.versions li::before { content: ''; position: absolute; inset-inline-start: 4px; top: 14px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--control); background: var(--surface); }
.versions li:first-child::before { top: 8px; }
.versions li.cur::before { border-color: var(--accent); background: var(--accent); }
.versions .vh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.versions .vh a { font-weight: 600; }
.versions .tag { font-size: 11.5px; padding: 0 6px; border-radius: 4px; background: var(--raised); color: var(--muted); }
.versions .tag.pin { background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.versions .note { font-size: var(--fs-small); color: var(--muted); }
.versions .sha { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; } /* taste-skill-ignore: mono only for serials, refs, hashes and citation tags */
.versions li.cur .sha { color: var(--text); }

.qrrow { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: start; }
.qrrow img { width: 112px; height: 112px; image-rendering: pixelated; border: 1px solid var(--border); border-radius: 4px; }
.qrrow .btn { margin-top: 8px; }
.qrrow .mono { margin-top: 4px; }

/* ---------- 3D parts ---------- */
.mv { flex: 1; min-height: max(520px, calc(100vh - 230px)); background: var(--raised); position: relative; }
model-viewer:not(:defined) > .hs { display: none; }  /* until the viewer upgrades, or if its script is blocked */
.mv model-viewer { position: absolute; inset: 0; width: 100%; height: 100%; --poster-color: transparent; direction: ltr; }
/* model-viewer's shadow .annotation-wrapper is position:absolute with no `left` and placed by translate(x, y) from
   the top-left; an inherited RTL direction moves its static position to the right edge and every hotspot off the
   parts. The viewer stays LTR; the Arabic UI around it stays RTL. */
[dir=rtl] .mv .state { direction: rtl; }
.mv .state { padding: 16px; }
.hs { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; background: var(--text); color: #fff; font: 600 11px/1 var(--mono); display: grid; place-items: center; cursor: pointer; padding: 0; box-shadow: 0 0 0 1px rgba(21,25,29,.25); transition: transform .12s var(--ease); } /* taste-skill-ignore: ring that keeps a hotspot visible over any part of the 3D model */
.hs:hover { transform: scale(1.12); }
.hs[aria-pressed=true] { background: var(--accent); transform: scale(1.18); }
.hs[data-visible=false] { opacity: .35; }
.partcard h2 { font-size: 18px; margin: 2px 0 4px; }
.ref-no { color: var(--accent); }
#rq { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
#rq h3, #rq label:not(.half), #rq button, #rq .formmsg { grid-column: 1 / -1; }
#pq { margin-top: 10px; display: grid; gap: 10px; }
#rq label, #pq label { display: grid; gap: 4px; font-size: var(--fs-small); color: var(--muted); }
#rq input, #rq textarea, #pq input { border: 1px solid var(--control); border-radius: 6px; padding: 7px 9px; min-height: 36px; color: var(--text); background: #fff; font-size: 14px; }
#rq textarea { resize: vertical; }
#rq input:focus-visible, #rq textarea:focus-visible, #pq input:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
#rq button, #pq button { justify-self: start; }
#rq .hp, #pq .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.formmsg { font-size: var(--fs-small); min-height: 1em; }
.formmsg.ok { color: var(--accent); font-weight: 600; }
.formmsg.err { color: #a12b1f; font-weight: 600; }
table.parts { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.parts th { text-align: start; font-size: var(--fs-small); color: var(--muted); font-weight: 400; padding: 0 6px 6px; border-bottom: 1px solid var(--border); }
.parts td { padding: 7px 6px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.parts .n { text-align: end; }
.parts td:first-child { font-family: var(--mono); font-size: 12px; white-space: nowrap; color: var(--muted); } /* taste-skill-ignore: mono only for serials, refs, hashes and citation tags */
.parts tbody tr { cursor: pointer; transition: background-color .12s var(--ease); }
.parts tbody tr:hover { background: var(--raised); }
.parts tbody tr[aria-selected=true] { background: var(--accent-tint); }
.parts tbody tr[aria-selected=true] td:first-child { color: var(--accent); }

.foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; font-size: var(--fs-small); color: var(--muted); }

/* ---------- tablet and phone ---------- */
@media (max-width: 1080px) {
  .grid > .viewer, .grid > .stage, .grid > .col { grid-column: 1 / -1; }
  .grid > .col { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "doc ver" "qr ver"; align-items: stretch; }
  .grid > .col > .c-doc { grid-area: doc; } .grid > .col > .c-ver { grid-area: ver; } .grid > .col > .qrcard { grid-area: qr; }
  #view-parts .grid > .col { grid-template-columns: 1fr; grid-template-areas: none; align-items: start; }
  .pdfbox { min-height: 640px; }
  .mv { min-height: 460px; }
}
/* the frame folds at 900px: the sheet becomes the screen, the machine card and the two views sit above it */
@media (max-width: 900px) {
  .top { padding: 0 16px; gap: 10px; }
  .scope { display: none; }
  .app { display: block; padding: 0; }
  .side, [dir=rtl] .side { padding: 4px 16px 12px; gap: 12px; }
  .unit { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; }
  .unit .k { grid-column: 1 / -1; }
  .ids { margin: 0; grid-row: 2 / 4; grid-column: 2; text-align: end; }
  [dir=rtl] .ids { text-align: start; }
  .views { grid-template-columns: 1fr 1fr; background: var(--active); border-radius: 8px; padding: 2px; }
  .views a { justify-content: center; gap: 6px; border-radius: 6px; }
  .views a[aria-current=page] { background: var(--surface); }
  .sheet { border-radius: 16px 16px 0 0; border-inline: 0; border-bottom: 0; padding: 20px 16px 20px; }
}
@media (max-width: 760px) {
  h1 { font-size: 21px; }
  .acts, .acts .btn { width: 100%; }
  .grid > .col, #view-parts .grid > .col { grid-template-columns: 1fr; grid-template-areas: none; }
  .grid > .col > .c-doc, .grid > .col > .c-ver, .grid > .col > .qrcard { grid-area: auto; }
  .pdfbox { min-height: 520px; }
  .mv { min-height: 420px; }
  .hs { width: 22px; height: 22px; font-size: 10px; border-width: 1.5px; }
  .qrrow { grid-template-columns: 96px minmax(0, 1fr); }
  .qrrow img { width: 96px; height: 96px; }
}

/* ---------- label print: only the label sheet is printed ---------- */
.label-print { display: none; }
@media print {
  body { background: #fff; }
  .top, .app { display: none !important; }
  .label-print { display: block; }
  .label-print .lbl { width: 90mm; border: 0.4mm solid #15191d; padding: 4mm; display: grid; grid-template-columns: 30mm 1fr; gap: 4mm; font: 9pt/1.3 'IBM Plex Sans', 'Noto Sans Arabic', sans-serif; }
  .label-print img { width: 30mm; height: 30mm; }
  .label-print b { display: block; font-size: 10pt; }
  .label-print .u { font-family: var(--mono); font-size: 7pt; overflow-wrap: anywhere; } /* taste-skill-ignore: mono only for serials, refs, hashes and citation tags */
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
