/* Petromix · Log critical fluid sample (field PWA screen)
   Scoped under .fs. Built for rugged phones in bright light: high contrast, 48 px+ targets, one-hand use.
   Design tokens live on .fs — see README "Design system".

   IN THE APP: the supplied sample-log.css, with these changes.
     1. No Google Fonts @import. Barlow, Barlow Condensed and IBM Plex Mono are
        self-hosted; their @font-face rules are in advisor.css, which the rep
        app already loads, so nothing is fetched and the screen works offline.
     2. The screen opens as a full-screen sheet over the app (.fs-sheet), up to
        560 px wide on a desktop, with the page behind it held still.
     3. Logical properties (inset-inline, padding-inline, text-align: start…),
        so the layout mirrors in Arabic; the back arrow flips.
     4. Colours used as TEXT have their own tokens (--fs-brand-text,
        --fs-ok-text, --fs-amber-text, --fs-crit-text). The fills stay the
        design's, so a yellow button is still yellow while yellow text on a
        light background is darkened enough to read.
     5. A light theme, keyed off the app's :root[data-scheme="light"]. The
        dark values are the design's.
     6. Measured: every text colour in both themes is at least 4.5:1 on its
        background (the design's placeholder grey #6E7C89 is 4.53:1 on the
        input well, so it stays).
     7. Additions for the app's fields: smaller sample-point quick picks
        (.fs-tag--sm), the live camera inside the scanner (.fs-cam), and
        "Take a photo of the tag" when there is no camera (.fs-scan-photo). */

.fs {
  /* surfaces: Petromix dark slate / navy */
  --fs-bg: #0B121A;
  --fs-surface: #121C26;
  --fs-raised: #1A2733;
  --fs-sunk: #080E14;
  --fs-line: rgba(255,255,255,.13);
  --fs-line-2: rgba(255,255,255,.24);
  --fs-glass: rgba(11,18,26,.96);
  --fs-glass-2: rgba(11,18,26,.97);
  --fs-ic-bg: rgba(255,255,255,.06);
  /* text: every pairing ≥ 4.5:1 on --fs-surface */
  --fs-text: #FFFFFF;
  --fs-text-2: #D2DAE2;
  --fs-muted: #9DAAB7;
  --fs-placeholder: #6E7C89;
  /* brand + signals (fills) */
  --fs-brand: #FFC20E;          /* Petromix yellow: primary action, selection */
  --fs-brand-ink: #111417;
  --fs-crit: #FF6A1A;           /* safety orange: critical sample, urgent */
  --fs-amber: #FFB020;          /* offline, warnings */
  --fs-ok: #3DD68C;             /* online, done */
  --fs-err: #FF7A7A;
  /* 4. the same signals as text */
  --fs-brand-text: #FFC20E;
  --fs-ok-text: #3DD68C;
  --fs-amber-text: #FFB020;
  --fs-crit-text: #FF6A1A;
  --fs-crit-soft: #FFD2B8;
  --fs-crit-soft-2: #FFB38A;
  --fs-crit-head: #FFFFFF;
  /* type */
  --fs-font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-cond: "Barlow Condensed", "Barlow", sans-serif;
  --fs-mono: "IBM Plex Mono", ui-monospace, monospace;
  /* sizing */
  --fs-tap: 48px;               /* minimum touch target */
  --fs-tap-lg: 56px;            /* primary actions */
  --fs-r: 14px;

  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--fs-bg);
  color: var(--fs-text);
  font-family: var(--fs-font), "Noto Sans Arabic", Tahoma, sans-serif;
  font-size: 16px;
  line-height: normal;
  text-align: start;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
/* 5. light theme: white sections, dark text, darker signal inks */
:root[data-scheme="light"] .fs {
  --fs-bg: #EEF1F4;
  --fs-surface: #FFFFFF;
  --fs-raised: #F4F6F8;
  --fs-sunk: #FFFFFF;
  --fs-line: rgba(15,23,32,.14);
  --fs-line-2: rgba(15,23,32,.30);
  --fs-glass: rgba(255,255,255,.96);
  --fs-glass-2: rgba(255,255,255,.97);
  --fs-ic-bg: rgba(15,23,32,.06);
  --fs-text: #0F1720;
  --fs-text-2: #2C3A48;
  --fs-muted: #556372;
  --fs-placeholder: #6B7785;
  --fs-err: #B42318;
  --fs-brand-text: #7A5600;
  --fs-ok-text: #11703F;
  --fs-amber-text: #8A5300;
  --fs-crit-text: #B13A00;
  --fs-crit-soft: #5A2200;
  --fs-crit-soft-2: #9A3300;
  --fs-crit-head: #0F1720;
}
.fs *, .fs *::before, .fs *::after { box-sizing: border-box; }
:where(.fs) :where(button, input, textarea, select) { font-family: inherit; }
:where(.fs) :where(h1, h2, p, figure) { margin: 0; }
.fs button { touch-action: manipulation; }
.fs [data-slot] { display: contents; }
.fs :focus-visible { outline: 3px solid var(--fs-brand-text); outline-offset: 2px; }
.fs bdi { unicode-bidi: isolate; }

/* 2. the sheet the app opens the screen in */
.fs-sheet { position: fixed; inset: 0; z-index: 9000; overflow-y: auto; overscroll-behavior: contain; background: rgba(5,9,13,.72); }
.fs-sheet > .fs { max-width: 560px; margin-inline: auto; min-height: 100%; box-shadow: 0 0 60px rgba(0,0,0,.45); }
html.fs-open { overflow: hidden; }

/* ---------- top bar ---------- */
.fs-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--fs-glass); border-bottom: 1px solid var(--fs-line); backdrop-filter: blur(8px); }
.fs-top-t { flex: 1; min-width: 0; }
.fs-top-t h1 { font-size: 19px; font-weight: 800; line-height: 1.15; }
.fs-top-t span { display: block; font-size: 13px; font-weight: 600; color: var(--fs-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-iconbtn { width: var(--fs-tap); height: var(--fs-tap); flex: none; border-radius: 12px; border: 1px solid var(--fs-line); background: var(--fs-surface); color: var(--fs-text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
[dir="rtl"] .fs-top .fs-iconbtn svg { transform: scaleX(-1); }    /* 3. */
.fs-net-pill { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.fs-net-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.fs-net-pill.is-on { background: rgba(61,214,140,.12); color: var(--fs-ok-text); }
.fs-net-pill.is-off { background: rgba(255,176,32,.16); color: var(--fs-amber-text); }

/* ---------- offline / sync banner ---------- */
.fs-net { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; font-size: 14px; line-height: 1.4; }
.fs-net svg { flex: none; margin-top: 1px; }
.fs-net b { display: block; font-size: 15px; font-weight: 800; }
.fs-net span { color: inherit; opacity: .92; font-weight: 600; }
.fs-net em { font-style: normal; font-weight: 800; padding: 1px 7px; margin-inline-start: 4px; border-radius: 6px; background: rgba(0,0,0,.18); white-space: nowrap; }
.fs-net.is-off { background: var(--fs-amber); color: #1A1200; }
.fs-net.is-sync { background: rgba(61,214,140,.14); color: var(--fs-ok-text); border-bottom: 1px solid rgba(61,214,140,.3); }

/* ---------- main ---------- */
.fs-main { flex: 1; padding: 14px 12px 24px; display: flex; flex-direction: column; gap: 12px; }
.fs-draft { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: var(--fs-tap); padding-block: 4px; padding-inline: 14px 4px; border-radius: 12px; border: 1px dashed var(--fs-line-2); font-size: 14px; font-weight: 600; color: var(--fs-text-2); }

/* scan hero */
.fs-scan-hero { width: 100%; min-height: 76px; padding: 14px 16px; border-radius: 16px; border: 0; background: var(--fs-brand); color: var(--fs-brand-ink); display: flex; align-items: center; gap: 14px; text-align: start; cursor: pointer; box-shadow: 0 8px 24px -10px rgba(255,194,14,.55); }
.fs-scan-hero:active { transform: translateY(1px); }
.fs-scan-ic { width: 48px; height: 48px; flex: none; border-radius: 12px; background: rgba(0,0,0,.12); display: flex; align-items: center; justify-content: center; }
.fs-scan-hero b { display: block; font-size: 19px; font-weight: 800; }
.fs-scan-hero small { display: block; margin-top: 2px; font-size: 14px; font-weight: 600; opacity: .8; }
.fs-or { display: flex; align-items: center; gap: 10px; margin: 2px 4px -2px; font-size: 13px; font-weight: 700; color: var(--fs-muted); text-transform: uppercase; letter-spacing: .08em; }
.fs-or::before, .fs-or::after { content: ""; flex: 1; height: 1px; background: var(--fs-line); }

/* sections */
.fs-sec { padding: 14px 14px 16px; border-radius: var(--fs-r); background: var(--fs-surface); border: 1px solid var(--fs-line); display: flex; flex-direction: column; gap: 12px; scroll-margin: 90px 0 120px; }
.fs-sec.is-bad { border-color: var(--fs-err); box-shadow: 0 0 0 1px var(--fs-err); }
.fs-sec.is-crit { border-color: var(--fs-crit); }
.fs-sh { display: flex; align-items: center; gap: 10px; }
.fs-sh h2 { flex: 1; font-size: 17px; font-weight: 800; line-height: 1.2; }
.fs-num { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid var(--fs-line-2); display: flex; align-items: center; justify-content: center; font-family: var(--fs-cond); font-size: 15px; font-weight: 800; color: var(--fs-text-2); }
.fs-num.is-done { border-color: var(--fs-ok); background: var(--fs-ok); color: #06210F; }
.fs-num.is-done svg { width: 16px; height: 16px; stroke-width: 3; }
.fs-opt { font-size: 12px; font-weight: 700; color: var(--fs-muted); text-transform: uppercase; letter-spacing: .08em; }

.fs-hint { font-size: 14px; font-weight: 500; line-height: 1.45; color: var(--fs-muted); }
.fs-hint--ok { color: var(--fs-text-2); }
.fs-err { font-size: 14px; font-weight: 700; color: var(--fs-err); }
.fs-warn { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--fs-amber-text); }
.fs-warn svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.fs-empty { padding: 10px 2px; font-size: 14px; color: var(--fs-muted); }
.fs-list-label { margin-bottom: -6px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--fs-muted); }
.fs-link { min-height: var(--fs-tap); padding: 0 8px; border: 0; background: none; color: var(--fs-brand-text); font-size: 15px; font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; white-space: nowrap; }

/* inputs */
.fs-input { width: 100%; min-height: var(--fs-tap-lg); padding: 0 14px; border-radius: 12px; border: 2px solid var(--fs-line-2); background: var(--fs-sunk); color: var(--fs-text); font-size: 17px; font-weight: 600; }
.fs-input::placeholder { color: var(--fs-placeholder); font-weight: 500; }
.fs-input:focus { outline: none; border-color: var(--fs-brand); }
.fs-input[type="datetime-local"] { color-scheme: dark; }
:root[data-scheme="light"] .fs-input[type="datetime-local"] { color-scheme: light; }
.fs-input--big { font-family: var(--fs-cond); font-size: 28px; font-weight: 800; letter-spacing: .02em; }
.fs-text { min-height: 96px; padding: 12px 14px; line-height: 1.45; resize: vertical; }
.fs-field { display: flex; flex-direction: column; gap: 6px; }
.fs-field > span { font-size: 14px; font-weight: 700; color: var(--fs-text-2); }
.fs-search { position: relative; display: block; }
.fs-search svg { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--fs-muted); pointer-events: none; }
.fs-search input { width: 100%; min-height: var(--fs-tap-lg); padding-block: 0; padding-inline: 44px 14px; border-radius: 12px; border: 2px solid var(--fs-line-2); background: var(--fs-sunk); color: var(--fs-text); font-size: 17px; font-weight: 600; -webkit-appearance: none; appearance: none; }
.fs-search input::placeholder { color: var(--fs-placeholder); font-weight: 500; }
.fs-search input:focus { outline: none; border-color: var(--fs-brand); }
.fs-inline { display: flex; gap: 8px; align-items: stretch; }
.fs-inline .fs-input { flex: 1; min-width: 0; }

/* rows & summaries */
.fs-rows { display: flex; flex-direction: column; gap: 6px; }
.fs-row { width: 100%; min-height: 60px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--fs-line); background: var(--fs-raised); color: var(--fs-text); text-align: start; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.fs-row:active { border-color: var(--fs-brand); }
.fs-row-ic { width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--fs-ic-bg); display: flex; align-items: center; justify-content: center; color: var(--fs-text-2); }
.fs-row-ic svg { width: 24px; height: 24px; }
.fs-row-t { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fs-row-t b { font-size: 16px; font-weight: 800; line-height: 1.25; }
.fs-row-t span { font-size: 14px; font-weight: 500; color: var(--fs-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-sum { display: flex; align-items: center; gap: 12px; padding-block: 8px; padding-inline: 12px 4px; border-radius: 12px; background: var(--fs-raised); border: 1px solid var(--fs-line); }
.fs-sum-ic { width: 40px; height: 40px; flex: none; border-radius: 10px; background: rgba(255,194,14,.14); color: var(--fs-brand-text); display: flex; align-items: center; justify-content: center; }
.fs-sum-t { flex: 1; min-width: 0; }
.fs-sum-t b { display: block; font-size: 16px; font-weight: 800; line-height: 1.25; }
.fs-sum-t span { display: block; font-size: 14px; font-weight: 600; color: var(--fs-text-2); }
.fs-last { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; font-weight: 600; color: var(--fs-muted); }
.fs-last b { color: var(--fs-ok-text); }
.fs-last b.is-warn { color: var(--fs-amber-text); }
.fs-choices { display: grid; grid-template-columns: 1fr; gap: 6px; }
.fs-choice { min-height: var(--fs-tap-lg); padding: 0 14px; border-radius: 12px; border: 2px solid var(--fs-line-2); background: transparent; color: var(--fs-text); font-size: 16px; font-weight: 700; text-align: start; cursor: pointer; }
.fs-choice:active { border-color: var(--fs-brand); }

/* buttons */
.fs-btn { min-height: var(--fs-tap-lg); padding: 0 18px; border-radius: 14px; border: 2px solid transparent; font-size: 17px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap; }
.fs-btn:disabled { opacity: .55; cursor: default; }
.fs-btn--pri { background: var(--fs-brand); color: var(--fs-brand-ink); }
.fs-btn--pri.is-urgent { background: var(--fs-crit); color: #1A0A00; }
.fs-btn--pri.is-pending { background: var(--fs-raised); border-color: var(--fs-line-2); color: var(--fs-text); }   /* turns yellow once ready */
.fs-btn--sec { background: var(--fs-raised); border-color: var(--fs-line-2); color: var(--fs-text); }
.fs-btn--ghost { background: transparent; border-color: var(--fs-line-2); color: var(--fs-text); }
.fs-btn--scan { padding: 0 14px; }
.fs-btn--scan svg { width: 22px; height: 22px; }

/* fluid cards */
.fs-fluids { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fs-fluid { min-height: 72px; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--fs-line); background: var(--fs-raised); color: var(--fs-text-2); display: flex; align-items: center; gap: 10px; text-align: start; font-size: 15px; font-weight: 700; line-height: 1.2; cursor: pointer; }
.fs-fluid svg { flex: none; }
.fs-fluid[aria-checked="true"] { border-color: var(--fs-brand); background: rgba(255,194,14,.12); color: var(--fs-text); }
.fs-fluid[aria-checked="true"] svg { color: var(--fs-brand-text); }

/* segmented */
.fs-seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--fs-sunk); border: 2px solid var(--fs-line-2); flex: none; }
.fs-seg button { min-width: 64px; min-height: 44px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent; color: var(--fs-text-2); font-size: 15px; font-weight: 800; cursor: pointer; }
.fs-seg button[aria-checked="true"] { background: var(--fs-text); color: var(--fs-bg); }
.fs-seg button.is-urgent[aria-checked="true"] { background: var(--fs-crit); color: #1A0A00; }
.fs-seg button:disabled { opacity: .45; }

/* condition tags */
.fs-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.fs-tag { min-height: var(--fs-tap); padding: 0 16px; border-radius: 999px; border: 2px solid var(--fs-line-2); background: transparent; color: var(--fs-text); font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.fs-tag svg { width: 16px; height: 16px; stroke-width: 3; margin-inline-start: -4px; }
.fs-tag[aria-pressed="true"] { background: var(--fs-text); border-color: var(--fs-text); color: var(--fs-bg); }
.fs-tag.is-normal[aria-pressed="true"] { background: var(--fs-ok); border-color: var(--fs-ok); color: #06210F; }
.fs-tag.is-crit { border-color: rgba(255,106,26,.55); }
.fs-tag.is-crit[aria-pressed="true"] { background: var(--fs-crit); border-color: var(--fs-crit); color: #1A0A00; }
.fs-tag--sm { padding: 0 14px; font-size: 14px; }           /* 7. sample-point quick picks: still 48 px tall */
.fs-tags--points { margin-top: -4px; }
.fs-crit { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: rgba(255,106,26,.14); border: 2px solid var(--fs-crit); color: var(--fs-crit-soft); font-size: 14px; font-weight: 600; line-height: 1.4; }
.fs-crit svg { flex: none; color: var(--fs-crit-text); }
.fs-crit b { display: block; font-size: 16px; font-weight: 800; color: var(--fs-crit-head); }
.fs-pri { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 12px; border-top: 1px solid var(--fs-line); font-size: 15px; font-weight: 700; color: var(--fs-text-2); }
.fs-pri .fs-seg button { min-width: 0; padding: 0 10px; }

/* photos */
.fs-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fs-ph { position: relative; margin: 0; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--fs-line-2); background: var(--fs-sunk); }
.fs-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fs-ph figcaption { position: absolute; inset-inline: 0; bottom: 0; padding: 14px 8px 6px; background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #FFFFFF; font-size: 12px; font-weight: 700; }
.fs-ph-del { position: absolute; top: 4px; inset-inline-end: 4px; width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(0,0,0,.65); color: #FFFFFF; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.fs-ph-del::after { content: ""; position: absolute; inset: -6px; }   /* 48px hit area */
.fs-ph-add { aspect-ratio: 1; border-radius: 12px; border: 2px dashed var(--fs-line-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; text-align: center; font-size: 13px; font-weight: 700; color: var(--fs-text-2); cursor: pointer; position: relative; }
.fs-ph-add:first-child { grid-column: span 3; aspect-ratio: auto; min-height: 96px; flex-direction: row; gap: 12px; font-size: 16px; }
.fs-ph-add:focus-within { border-color: var(--fs-brand); }
.fs-ph-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* lab analysis */
.fs-lab-open { width: 100%; min-height: 72px; padding: 12px 14px; border-radius: 12px; border: 2px dashed var(--fs-line-2); background: transparent; color: var(--fs-text); display: flex; align-items: center; gap: 12px; text-align: start; cursor: pointer; }
.fs-lab-open b { display: block; font-size: 16px; font-weight: 800; }
.fs-lab-open small { display: block; margin-top: 3px; font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--fs-muted); }
.fs-lab-ic { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--fs-ic-bg); display: flex; align-items: center; justify-content: center; color: var(--fs-text-2); }
.fs-lab-src .fs-input { min-height: 52px; font-size: 16px; }
.fs-lab-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 10px 14px; border-radius: 12px; border: 2px solid; font-size: 14px; font-weight: 600; }
.fs-lab-sum b { font-size: 16px; font-weight: 800; }
.fs-lab-sum em { flex-basis: 100%; font-style: normal; color: var(--fs-text-2); }
.fs-lab-sum.is-ok { border-color: rgba(61,214,140,.5); color: var(--fs-ok-text); }
.fs-lab-sum.is-warn { border-color: rgba(255,176,32,.6); color: var(--fs-amber-text); }
.fs-lab-sum.is-crit { border-color: var(--fs-crit); background: rgba(255,106,26,.1); color: var(--fs-crit-soft-2); }
.fs-lab-sum.is-crit b { color: var(--fs-crit-text); }
.fs-lg { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fs-lg legend { padding: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--fs-muted); }
.fs-lr { display: grid; grid-template-columns: minmax(0, 1fr) 132px; align-items: center; gap: 10px; padding-block: 8px; padding-inline: 12px 8px; border-radius: 12px; background: var(--fs-raised); border-inline-start: 4px solid transparent; }
.fs-lr.is-ok { border-inline-start-color: var(--fs-ok); }
.fs-lr.is-warn { border-inline-start-color: var(--fs-amber); }
.fs-lr.is-crit { border-inline-start-color: var(--fs-crit); background: rgba(255,106,26,.08); }
.fs-lr.is-info { border-inline-start-color: var(--fs-line-2); }
.fs-lr-t { min-width: 0; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.fs-lr-t b { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 15px; font-weight: 700; line-height: 1.25; }
.fs-lr-t b > span:not(.fs-lr-chip) { font-family: var(--fs-mono); font-size: 12px; font-weight: 600; color: var(--fs-muted); }
.fs-lr-t small { font-size: 12px; font-weight: 500; line-height: 1.35; color: var(--fs-muted); }
.fs-lr-chip:empty { display: none; }
.fs-lr-chip { padding: 1px 7px; border-radius: 6px; font-family: var(--fs-font); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.fs-lr.is-ok .fs-lr-chip { background: rgba(61,214,140,.16); color: var(--fs-ok-text); }
.fs-lr.is-warn .fs-lr-chip { background: rgba(255,176,32,.18); color: var(--fs-amber-text); }
.fs-lr.is-crit .fs-lr-chip { background: var(--fs-crit); color: #1A0A00; }
.fs-lr.is-info .fs-lr-chip { background: var(--fs-ic-bg); color: var(--fs-text-2); }
.fs-lr-in { position: relative; }
.fs-input--lab { min-height: var(--fs-tap); padding: 0 10px; font-family: var(--fs-cond); font-size: 22px; font-weight: 800; text-align: end; }
.fs-lr-in:has(.fs-lr-u) .fs-input--lab { padding-inline-end: 52px; }
.fs-lr-u { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); width: 40px; text-align: start; font-size: 11px; font-weight: 700; line-height: 1.1; color: var(--fs-muted); pointer-events: none; }
.fs-lr.is-warn .fs-input--lab { border-color: var(--fs-amber); }
.fs-lr.is-crit .fs-input--lab { border-color: var(--fs-crit); }
.fs-lab-close { width: 100%; }

/* bottom bar */
.fs-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); background: var(--fs-glass-2); border-top: 1px solid var(--fs-line-2); backdrop-filter: blur(8px); }
.fs-bar-p { flex: 1; min-width: 110px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--fs-muted); }
.fs-bar-p b { color: var(--fs-ok-text); font-size: 15px; text-transform: capitalize; }
.fs-bar-p b.is-crit { color: var(--fs-crit-text); }
.fs-prog { display: block; height: 6px; border-radius: 3px; background: var(--fs-raised); overflow: hidden; }
.fs-prog i { display: block; height: 100%; background: var(--fs-ok); border-radius: 3px; transition: width .3s; }
.fs-bar .fs-btn { flex: 0 0 auto; min-width: 190px; }
.fs-err--bar { flex-basis: 100%; }

/* scanner */
.fs-scanner { position: fixed; inset: 0; z-index: 20; background: #000; color: #FFFFFF; display: flex; flex-direction: column; align-items: center; padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); gap: 22px; }
.fs-scan-top { width: 100%; max-width: 560px; display: flex; align-items: center; justify-content: space-between; font-size: 18px; }
.fs-scan-top .fs-iconbtn { background: rgba(255,255,255,.1); border-color: transparent; color: #FFFFFF; }
.fs-scanner .fs-btn--ghost { color: #FFFFFF; border-color: rgba(255,255,255,.4); }
.fs-view { position: relative; width: min(78vw, 300px); aspect-ratio: 1; margin-top: 6vh; border-radius: 18px; background: radial-gradient(circle at 50% 45%, #2A3440, #0D1217 70%); overflow: hidden; }
.fs-cam { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }   /* 7. */
/* 7. no camera: a photo of the tag instead, in the middle of the viewfinder */
.fs-view.is-photo .fs-laser { display: none; }
.fs-scan-photo { position: absolute; inset: 0; z-index: 2; margin: auto; width: max-content; max-width: calc(100% - 48px); height: var(--fs-tap-lg); padding: 0 18px; border-radius: 14px; background: var(--fs-brand); color: var(--fs-brand-ink); display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; cursor: pointer; }
.fs-scan-photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.fs-scan-photo:focus-within { outline: 3px solid #FFFFFF; outline-offset: 3px; }
.fs-view i { position: absolute; width: 44px; height: 44px; border: 4px solid var(--fs-brand); z-index: 1; }
.fs-view .c1 { top: 14px; left: 14px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.fs-view .c2 { top: 14px; right: 14px; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.fs-view .c3 { bottom: 14px; left: 14px; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.fs-view .c4 { bottom: 14px; right: 14px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.fs-laser { position: absolute; left: 24px; right: 24px; height: 3px; top: 20%; background: var(--fs-crit); box-shadow: 0 0 12px var(--fs-crit); animation: fs-laser 1.4s ease-in-out infinite alternate; z-index: 1; }
@keyframes fs-laser { to { top: 78%; } }
.fs-scan-msg { max-width: 300px; text-align: center; font-size: 16px; font-weight: 600; color: #E6EBF0; }

/* success */
.fs-done { flex: 1; padding: 36px 20px 28px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.fs-done-ic { color: var(--fs-ok-text); }
.fs-done-ic.is-urgent { color: var(--fs-crit-text); }
.fs-done h1 { font-size: 26px; font-weight: 800; }
.fs-done p { max-width: 320px; font-size: 16px; font-weight: 500; line-height: 1.45; color: var(--fs-text-2); }
.fs-label { width: 100%; margin: 6px 0 8px; padding: 16px; border-radius: 16px; border: 2px dashed var(--fs-brand); background: rgba(255,194,14,.06); display: flex; flex-direction: column; gap: 4px; }
.fs-label span { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--fs-muted); }
.fs-label b { font-family: var(--fs-mono); font-size: 26px; font-weight: 600; letter-spacing: .02em; color: var(--fs-brand-text); }
.fs-label small { font-size: 14px; font-weight: 600; color: var(--fs-text-2); }
.fs-done .fs-btn { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .fs-laser { animation: none; top: 50%; }
  .fs *, .fs *::before, .fs *::after { transition: none !important; }
}
@media (forced-colors: active) {
  .fs-tag[aria-pressed="true"], .fs-fluid[aria-checked="true"], .fs-seg button[aria-checked="true"] { outline: 3px solid Highlight; }
}
