/* Prototype design system: semantic tokens + component classes.
   Components use semantic tokens only; a bank's branding is a token override block.
   The product defaults follow Makasib Tech's shared digital language (brand handbook of 30 October 2026, pp. 35-37):
   navy text and actions, lime kept to brand moments, Almarai for Arabic and Plus Jakarta Sans for Latin.
   The look is light glass over a soft wash of the bank's two colours; every gradient, tint and shadow is
   derived from the bank tokens, so a re-brand changes the whole look. */

:root {
  --color-bg-app: #f4f7f9;
  --color-bg-surface: #ffffff;
  --color-bg-subtle: #eef2f5;
  --color-border: #dee5e8;
  --color-border-strong: #70808d; /* control boundary: inputs and outline buttons, 4:1 on white */
  --color-text: #24384a;
  --color-text-muted: #526674;
  --color-action-primary: #24384a;
  --color-action-primary-hover: #1b2d3c;
  --color-action-primary-fg: #ffffff;
  --color-action-primary-soft: #e6edf2;
  --color-focus: #24384a;
  --color-accent: #bdec3f; /* Makasib lime: brand moments only, never small text on white and never a status */
  --color-accent-fg: #24384a;
  --color-on-brand-field: #ffffff;
  --color-on-brand-field-muted: #c9d6df; /* 5.4:1 on the darkest bank colour we theme, teal */
  --color-on-brand-field-hover: rgba(255, 255, 255, 0.1);
  --color-backdrop: rgba(16, 34, 44, 0.38);
  --color-status-info: #175cd3;
  --color-status-info-bg: #eff8ff;
  --color-status-success: #067647;
  --color-status-success-bg: #ecfdf3;
  --color-status-warning: #8a4b08;
  --color-status-warning-bg: #fffaeb;
  --color-status-danger: #b42318;
  --color-status-danger-bg: #fef3f2;
  --color-status-neutral: #526674;
  --color-status-neutral-bg: #eef2f5;
  --color-alert-info-border: #b2ddff;
  --color-alert-info-text: #1849a9;
  --color-alert-success-border: #abefc6;
  --color-alert-success-text: #085d3a;
  --color-alert-warning-border: #fedf89;
  --color-alert-warning-text: #7a2e0e;
  --color-alert-danger-border: #fecdca;
  --color-alert-danger-text: #912018;
  --color-on-status: #ffffff;
  --color-paper: #ffffff;
  --color-paper-line: #dee5e8;
  --color-toast-fg: #ffffff;
  --color-skeleton: #e6edf2;
  --color-skeleton-shine: #f4f7f9;
  --radius-control: 0.5rem;
  --radius-card: 1rem;
  --font-body: "Almarai", "Plus Jakarta Sans", "Segoe UI", Tahoma, sans-serif;
  --font-latin: "Plus Jakarta Sans", var(--font-body);
  /* Derived from the bank tokens: the backdrop, glass and gradients. The page sits on a soft mesh of the bank's two
     colours; cards, bars and the sidebar are translucent and blur it, so the glass is visible on every screen. */
  --color-wash-primary: color-mix(in srgb, color-mix(in srgb, var(--color-action-primary) 60%, #fff) 40%, transparent);
  --color-wash-primary-soft: color-mix(in srgb, color-mix(in srgb, var(--color-action-primary) 50%, #fff) 30%, transparent);
  --color-wash-accent: color-mix(in srgb, var(--color-accent) 46%, transparent);
  --color-glass: color-mix(in srgb, var(--color-bg-surface) 52%, transparent);
  --color-glass-strong: color-mix(in srgb, var(--color-bg-surface) 68%, transparent);
  --color-glass-solid: color-mix(in srgb, var(--color-bg-surface) 86%, transparent); /* bars and dialogs that sit over content */
  --color-glass-border: color-mix(in srgb, var(--color-bg-surface) 72%, transparent);
  --color-divider: color-mix(in srgb, var(--color-border) 65%, transparent);
  --color-toast-bg: color-mix(in srgb, var(--color-text) 90%, transparent);
  --blur-glass: blur(20px) saturate(180%);
  --gradient-primary: linear-gradient(135deg, color-mix(in srgb, var(--color-action-primary) 72%, var(--color-accent)) 0%, var(--color-action-primary) 48%, color-mix(in srgb, var(--color-action-primary) 78%, #000) 100%);
  --color-brand-deep: var(--color-action-primary); /* the bank's own (dark) colour, for the colour field; stays dark in dark mode */
  --gradient-brand: linear-gradient(165deg, var(--color-brand-deep) 0%, color-mix(in srgb, var(--color-brand-deep) 72%, #000) 100%);
  --gradient-tint: linear-gradient(135deg, color-mix(in srgb, var(--color-bg-surface) 78%, transparent) 0%, color-mix(in srgb, var(--color-action-primary-soft) 70%, transparent) 100%);
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(16, 34, 44, 0.04), 0 14px 34px -16px rgba(16, 34, 44, 0.2);
  --shadow-raised: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 18px 44px -18px rgba(16, 34, 44, 0.34);
  --shadow-primary: 0 10px 22px -10px color-mix(in srgb, var(--color-action-primary) 75%, transparent);
  --shadow-dialog: 0 30px 60px -20px rgba(16, 34, 44, 0.4);
}

/* Tadhamun Bank (مصرف التضامن), the bank this prototype is presented to; colours from its public website
   (tadhamunbank.ly, 2026-10-31). To re-brand, change the two bank colours here and the logo files in
   assets/banks/tadamun/ (paths in MOCK.banks); every shade, gradient and glow follows from the two colours. */
[data-theme="tadamun"] {
  --bank-primary: #165a58; /* teal of the wordmark: actions, selected states, the brand band and sidebar */
  --bank-secondary: #b7d43a; /* lime of the emblem: accents on the primary colour (4.7:1 on it) */
  --color-action-primary: var(--bank-primary);
  --color-action-primary-hover: color-mix(in srgb, var(--bank-primary) 80%, #000);
  --color-action-primary-fg: #ffffff;
  --color-action-primary-soft: color-mix(in srgb, var(--bank-primary) 10%, #fff);
  --color-focus: var(--bank-primary);
  --color-accent: var(--bank-secondary);
  --color-accent-fg: var(--bank-primary);
}

/* Second demo bank: same components, different brand tokens. */
[data-theme="bank-b"] {
  --color-action-primary: #1e3a8a;
  --color-action-primary-hover: #172e6e;
  --color-action-primary-soft: #e8edfb;
  --color-focus: #3b82f6;
  --radius-control: 0.25rem;
  --radius-card: 0.5rem;
}

/* On :root rather than html or body, so Tailwind's base styles (loaded later) cannot reset them. */
:root { font-family: var(--font-body); font-synthesis: none; line-height: 1.75; }
:root[lang="en"] { font-family: var(--font-latin); line-height: 1.55; }
body {
  color: var(--color-text);
  background-color: var(--color-bg-app);
  background-image:
    radial-gradient(42rem 28rem at 24% -8%, var(--color-wash-accent), transparent 70%),
    radial-gradient(40rem 36rem at 100% 34%, var(--color-wash-primary-soft), transparent 70%),
    radial-gradient(56rem 40rem at -6% 96%, var(--color-wash-primary), transparent 70%),
    linear-gradient(160deg, color-mix(in srgb, var(--color-accent) 6%, #fff) 0%, color-mix(in srgb, var(--color-action-primary) 7%, #fff) 100%);
  background-attachment: fixed;
}
/* Latin runs inside Arabic text (references, amounts, codes) use the Latin brand face, as in Makasib's own pages. */
[dir="ltr"], .ref-id, .num, .tabular { font-family: var(--font-latin); }
::selection { background: var(--color-accent); color: var(--color-accent-fg); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
/* Primary is also the text colour, so text links keep a permanent underline. */
a.text-primary { text-decoration: underline; text-underline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.ref-id { white-space: nowrap; } /* reference numbers inside sentences: see refs() in app.js */
html[dir="rtl"] .rtl-mirror { transform: scaleX(-1); }
html[dir="ltr"] .ltr-mirror { transform: scaleX(-1); } /* for icons drawn pointing left, like arrow */
.num, .tabular { font-variant-numeric: tabular-nums; }
[x-cloak] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Buttons: 44 px targets and 120 ms feedback (Makasib handbook). */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.75rem; padding: 0.5rem 1.125rem; border-radius: var(--radius-control); font-weight: 600; font-size: 0.875rem; line-height: 1.4; border: 1px solid transparent; cursor: pointer; transition: background-color 120ms, border-color 120ms, color 120ms, box-shadow 120ms, transform 120ms, filter 120ms; white-space: nowrap; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--gradient-primary); color: var(--color-action-primary-fg); box-shadow: var(--shadow-primary), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.btn-outline { background: var(--color-glass-strong); border-color: var(--color-border-strong); color: var(--color-text); }
.btn-outline:hover { background: var(--color-bg-surface); border-color: var(--color-action-primary); color: var(--color-action-primary); }
.btn-ghost { background: transparent; color: var(--color-text); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-action-primary) 8%, transparent); }
.btn-danger { background: var(--color-status-danger); color: var(--color-on-status); }
.btn-danger:hover { filter: brightness(0.92); }
.btn-success { background: var(--color-status-success); color: var(--color-on-status); }
.btn-success:hover { filter: brightness(0.92); }
.btn-sm { min-height: 2.25rem; padding: 0.25rem 0.875rem; font-size: 0.8125rem; }
.btn-lg { min-height: 3rem; padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-icon { min-width: 2.75rem; padding: 0.5rem; }
.btn-sm.btn-icon { min-width: 2.25rem; }

/* Cards: frosted glass over the page's colour mesh; a white rim instead of a grey outline. */
.card { background: var(--color-glass-strong); -webkit-backdrop-filter: var(--blur-glass); backdrop-filter: var(--blur-glass); border: 1px solid var(--color-glass-border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.card-header { padding: 1rem 1.25rem; border-block-end: 1px solid var(--color-divider); display: flex; align-items: center; gap: 0.75rem; }
.card-title { font-weight: 700; font-size: 1.0625rem; }
.card-body { padding: 1.25rem; }
.card-footer { padding: 0.875rem 1.25rem; border-block-start: 1px solid var(--color-divider); display: flex; gap: 0.5rem; justify-content: flex-end; }

/* Icon tiles: one icon in a gradient (or soft, or status) tile, for page titles, sections, list rows and empty states. */
.icon-chip { width: 2.5rem; height: 2.5rem; border-radius: 0.75rem; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--color-action-primary-fg); background: var(--gradient-primary); box-shadow: var(--shadow-primary); }
.icon-chip > svg { width: 1.25rem; height: 1.25rem; }
.icon-chip-sm { width: 2rem; height: 2rem; border-radius: 0.625rem; }
.icon-chip-sm > svg { width: 1rem; height: 1rem; }
.icon-chip-lg { width: 3.5rem; height: 3.5rem; border-radius: 1rem; }
.icon-chip-lg > svg { width: 1.75rem; height: 1.75rem; }
.icon-chip-soft { background: var(--color-action-primary-soft); color: var(--color-action-primary); box-shadow: none; }
.icon-chip-success { background: var(--color-status-success-bg); color: var(--color-status-success); box-shadow: none; }
.icon-chip-warning { background: var(--color-status-warning-bg); color: var(--color-status-warning); box-shadow: none; }
.icon-chip-danger { background: var(--color-status-danger-bg); color: var(--color-status-danger); box-shadow: none; }
.icon-chip-info { background: var(--color-status-info-bg); color: var(--color-status-info); box-shadow: none; }

/* Compact page header: icon tile, title and one line of context, actions at the end. */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.page-head > .min-w-0 { flex: 1 1 14rem; } /* the title block takes the room, so a long subtitle never pushes the icon tile onto its own line */
.page-head > .ms-auto { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.page-title { font-size: 1.625rem; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; }
.page-subtitle { color: var(--color-text-muted); font-size: 0.9375rem; line-height: 1.5; }

/* Case bar: one line with reference, company, amount, stage and deadline on every case desk; the full case
   details and the stepper open on demand. The reference is the largest fact on the line, on a tinted glass. */
.case-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 1.25rem; padding: 0.875rem 1.25rem; border-radius: var(--radius-card); background: var(--gradient-tint); -webkit-backdrop-filter: var(--blur-glass); backdrop-filter: var(--blur-glass); border: 1px solid var(--color-glass-border); box-shadow: var(--shadow-card); font-size: 0.9375rem; }
.case-bar .case-ref { font-weight: 700; font-size: 1.25rem; letter-spacing: 0.01em; }
.case-bar .sep { display: none; } /* spacing separates the facts; a drawn separator would dangle at the end of a wrapped line */

/* Decision bar: the desk's main actions stay in view at the bottom of the screen, with what is still missing. Pages
   scroll a focused field or a check above it, never behind it (WCAG 2.2 focus not obscured). */
html { scroll-padding-block-end: 7rem; }
.decision-bar { position: sticky; inset-block-end: 0.75rem; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.75rem 1rem; border-radius: var(--radius-card); background: var(--color-glass-solid); -webkit-backdrop-filter: var(--blur-glass); backdrop-filter: var(--blur-glass); border: 1px solid var(--color-glass-border); box-shadow: var(--shadow-raised); }
.decision-bar .remaining { flex: 1 1 18rem; font-size: 0.875rem; color: var(--color-text-muted); } /* on phones the buttons wrap below the text */

/* ---- Desk pattern, the same on every case desk (prototype/README.md "Desk pattern"):
   the LC's progress in the case bar; checks that fold to one line once done; system notes as small icons with a
   tooltip; the document viewer as a drawer; the second-person confirmation inside the decision bar. */

/* A desk whose documents open in a drawer keeps one readable column, centred on wide screens. */
#content.desk { max-width: 78rem; margin-inline: auto; }

/* LC progress (PROTO.progress): one segment per stage of the whole cycle; finished segments in the bank's gradient,
   the current one in the accent colour, red where the LC stopped. */
.lc-progress { display: inline-flex; align-items: center; gap: 0.625rem; font-size: 0.8125rem; color: var(--color-text-muted); white-space: nowrap; }
.lc-progress-bar { display: inline-flex; align-items: center; gap: 3px; }
.lc-progress-bar > i { width: 0.875rem; height: 0.375rem; border-radius: 999px; background: color-mix(in srgb, var(--color-text-muted) 22%, transparent); }
.lc-progress-bar > i[data-s="done"] { background: var(--gradient-primary); }
.lc-progress-bar > i[data-s="current"] { width: 1.5rem; background: var(--color-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 30%, transparent); }
.lc-progress-bar > i[data-s="stopped"] { width: 1.5rem; background: var(--color-status-danger); }

/* Checks (app.js): only the check to do now is open (data-current), with a soft ring. A finished check (data-done
   "true") folds to its header line: title, a short .check-summary and the status badge. An unfinished check further
   down (data-later) waits as one line until its turn. The chevron button, or a click on the header, opens any of them. */
[data-check][data-done="true"]:not(.is-open) > :not(.card-header),
[data-check][data-later]:not(.is-open) > :not(.card-header) { display: none !important; }
[data-check][data-done="true"] > .card-header, [data-check][data-later] > .card-header { cursor: pointer; }
[data-check][data-done="true"]:not(.is-open) > .card-header,
[data-check][data-later]:not(.is-open) > .card-header { border-block-end-color: transparent; padding-block: 0.75rem; }
[data-check][data-later]:not(.is-open) .card-title { color: var(--color-text-muted); }
[data-check][data-current] { box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-action-primary) 28%, transparent), var(--shadow-card); }
.check-summary { display: none; min-width: 0; font-size: 0.8125rem; color: var(--color-text-muted); }
[data-check][data-done="true"]:not(.is-open) .check-summary { display: inline; }
.check-toggle { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 999px; color: var(--color-text-muted); }
.check-toggle:hover { color: var(--color-action-primary); background: var(--color-action-primary-soft); }
.check-toggle[hidden] { display: none; }
.check-toggle > svg { width: 1rem; height: 1rem; transform: rotate(90deg); transition: transform 120ms; }
.check-toggle[aria-expanded="true"] > svg { transform: rotate(-90deg); }
.card:not([data-check]) > .card-header > .check-toggle { display: none; } /* a card that stops being a check keeps no fold button */

/* System notes (who checked what and when, rule references, manual mode): an icon whose aria-label shows as a
   tooltip on hover and keyboard focus. .note-icon-end opens the tooltip towards the start, for icons at a line end. */
.note-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 1.5rem; height: 1.5rem; border-radius: 999px; color: var(--color-text-muted); background: color-mix(in srgb, var(--color-text-muted) 10%, transparent); cursor: help; }
.note-icon > svg { width: 0.875rem; height: 0.875rem; }
.note-icon-success { color: var(--color-status-success); background: var(--color-status-success-bg); }
.note-icon[aria-label]:hover::after, .note-icon[aria-label]:focus-visible::after { content: attr(aria-label); position: absolute; z-index: 30; inset-block-end: calc(100% + 0.375rem); inset-inline-start: -0.5rem; width: max-content; max-width: min(20rem, 70vw); padding: 0.375rem 0.625rem; border-radius: 0.5rem; background: var(--color-text); color: var(--color-bg-surface); font-size: 0.75rem; font-weight: 500; line-height: 1.5; white-space: normal; text-align: start; box-shadow: var(--shadow-raised); pointer-events: none; }
.note-icon-end[aria-label]:hover::after, .note-icon-end[aria-label]:focus-visible::after { inset-inline-start: auto; inset-inline-end: -0.5rem; }

/* Documents and help. .doc-drawer (documents) and .drawer (help, details) are always drawers; .doc-pane is a
   column from 1280 px and a drawer below. All open with .is-open from the far edge of the page, over the backdrop
   app.js adds (PROTO.openDrawer). .narrow-only hides from 1280 px (the button that opens a pane). The viewer
   (.doc-fill) grows to the drawer's height. */
.drawer-backdrop { position: fixed; inset: 0; z-index: 44; background: var(--color-backdrop); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.doc-drawer, .drawer { position: fixed; inset-block: 0; inset-inline-end: 0; z-index: 45; width: min(46rem, 94vw); display: none; flex-direction: column; border-radius: 0; background: var(--color-glass-solid); border: 0; border-inline-start: 1px solid var(--color-glass-border); box-shadow: var(--shadow-dialog); }
.doc-drawer.is-open, .drawer.is-open { display: flex; }
.doc-drawer, .drawer { margin: 0 !important; } /* a page's space-y-* gap must not push a drawer below the top edge */
.drawer { width: min(30rem, 94vw); overflow-y: auto; } /* a narrower side panel for help and details */
.doc-drawer > .card-header, .drawer > .card-header, .doc-pane > .card-header { flex-shrink: 0; }
.doc-drawer .doc-fill { flex: 1 1 auto; min-height: 0; max-height: none; }
@media (max-width: 1279.98px) {
  .doc-pane { position: fixed !important; inset-block: 0 !important; inset-inline-end: 0; z-index: 45; width: min(46rem, 94vw); display: none; flex-direction: column; border-radius: 0 !important; background: var(--color-glass-solid); border: 0; border-inline-start: 1px solid var(--color-glass-border); box-shadow: var(--shadow-dialog); }
  .doc-pane.is-open { display: flex; }
  .doc-pane { margin: 0 !important; }
  .doc-pane .doc-fill { flex: 1 1 auto; min-height: 0; max-height: none; }
}
@media (min-width: 1280px) { .narrow-only { display: none !important; } }

/* The second-person confirmation (FLOW.mountConfirmBar) sits inside the decision bar, above the desk's buttons, so
   every decision on a desk is made in one place. */
#flow-confirm-bar > div > .flex-1 { flex-basis: 16rem; } /* on a phone a record keeps a readable width; its buttons go below */
.decision-bar > #flow-confirm-bar { flex: 1 1 100%; margin: 0; padding: 0 0 0.75rem; border: 0; border-block-end: 1px solid var(--color-divider); border-radius: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* Disclosure: help, rules and finished steps stay one click away instead of always open. */
.disclosure > summary { display: flex; align-items: center; gap: 0.5rem; min-height: 2.5rem; cursor: pointer; list-style: none; font-size: 0.875rem; font-weight: 600; color: var(--color-text-muted); }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary:hover { color: var(--color-action-primary); }
.disclosure[open] > summary { color: var(--color-text); }

/* Empty, loading and error states. */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.5rem; padding: 2.5rem 1rem; color: var(--color-text-muted); }
.empty-state .empty-title { color: var(--color-text); font-weight: 700; }

/* Badges: a pill with a status dot; text + colour, never colour alone. */
.badge { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.125rem 0.625rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.badge:not(:has(svg))::before { content: ""; width: 0.375rem; height: 0.375rem; border-radius: 999px; background: currentColor; flex-shrink: 0; }
.badge-info { background: var(--color-status-info-bg); color: var(--color-status-info); }
.badge-success { background: var(--color-status-success-bg); color: var(--color-status-success); }
.badge-warning { background: var(--color-status-warning-bg); color: var(--color-status-warning); }
.badge-danger { background: var(--color-status-danger-bg); color: var(--color-status-danger); }
.badge-neutral { background: var(--color-status-neutral-bg); color: var(--color-status-neutral); }
.badge-primary { background: var(--color-action-primary-soft); color: var(--color-action-primary); }

/* Alerts */
.alert { display: flex; gap: 0.75rem; padding: 0.75rem 1rem; border-radius: var(--radius-control); border: 1px solid; font-size: 0.875rem; }
.alert-info { background: var(--color-status-info-bg); border-color: var(--color-alert-info-border); color: var(--color-alert-info-text); }
.alert-success { background: var(--color-status-success-bg); border-color: var(--color-alert-success-border); color: var(--color-alert-success-text); }
.alert-warning { background: var(--color-status-warning-bg); border-color: var(--color-alert-warning-border); color: var(--color-alert-warning-text); }
.alert-danger { background: var(--color-status-danger-bg); border-color: var(--color-alert-danger-border); color: var(--color-alert-danger-text); }

/* Forms. Fields use 16 px text so phones do not zoom in on focus. */
.label { display: block; font-size: 0.875rem; font-weight: 600; margin-block-end: 0.25rem; }
.hint { font-size: 0.75rem; color: var(--color-text-muted); margin-block-start: 0.25rem; }
.error-text { font-size: 0.75rem; color: var(--color-status-danger); margin-block-start: 0.25rem; }
.input, .select, .textarea { width: 100%; min-height: 2.75rem; border: 1px solid var(--color-border-strong); border-radius: var(--radius-control); padding: 0.5rem 0.75rem; background: var(--color-bg-surface); color: var(--color-text); font-size: 1rem; line-height: 1.5; transition: border-color 120ms, box-shadow 120ms; }
/* Our own arrow, inside the field at the end side with room around it (the browser's sits against the edge). */
.select:not([multiple]) { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 1rem; background-position: left 0.75rem center; padding-inline-end: 2.5rem; }
[dir="ltr"] .select:not([multiple]) { background-position: right 0.75rem center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--color-focus); box-shadow: 0 0 0 1px var(--color-focus), 0 0 0 5px var(--color-action-primary-soft); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--color-status-danger); }
.input-ltr { direction: ltr; text-align: start; font-family: var(--font-latin); }
.checkbox { width: 1rem; height: 1rem; accent-color: var(--color-action-primary); }
.field { margin-block-end: 1rem; }
/* Date fields (app.js): a left-to-right text field that shows and takes dd/mm/yyyy (dd/mm/yyyy hh:mm) in both languages,
   whatever the computer's locale. The calendar button at its end opens the browser's own picker, which waits invisible
   under the field so its calendar opens below it. The wrapper takes the input's place in the layout. */
.date-field { position: relative; display: block; }
.date-field > input[data-date] { display: block; padding-inline-end: 2.75rem; }
.date-field-btn { position: absolute; inset-block: 1px; inset-inline-end: 1px; width: 2.5rem; display: inline-flex; align-items: center; justify-content: center; border-radius: calc(var(--radius-control) - 1px); color: var(--color-text-muted); cursor: pointer; transition: color 120ms, background-color 120ms; }
.date-field-btn:hover { color: var(--color-action-primary); background: var(--color-action-primary-soft); }
.date-field-btn > svg { width: 1.125rem; height: 1.125rem; }
.date-field-btn:disabled { opacity: 0.45; cursor: not-allowed; background: none; }
.date-field-native { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.date-field:has(> input[data-date][style*="display: none"]) { display: none; } /* an x-show on the input hides its button too */

/* Toolbar: search and filters in one compact row above a list (no labels above; each control has aria-label). */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.search-field { position: relative; flex: 1 1 15rem; min-width: 0; max-width: 28rem; }
.search-field > svg { position: absolute; inset-inline-start: 0.875rem; top: 50%; transform: translateY(-50%); width: 1.125rem; height: 1.125rem; color: var(--color-text-muted); pointer-events: none; }
.search-field > .input { min-height: 2.5rem; padding-inline-start: 2.625rem; border-radius: var(--radius-control); border-color: var(--color-border); background: var(--color-glass-strong); box-shadow: inset 0 1px 2px rgba(16, 34, 44, 0.05); }
.search-field > .input::placeholder { color: var(--color-text-muted); opacity: 1; }
.select-sm { width: auto; min-height: 2.5rem; padding: 0.375rem 0.875rem; font-size: 0.875rem; border-radius: var(--radius-control); border-color: var(--color-border); background-color: var(--color-glass-strong); }

/* Tables: only the columns a person scans; details live one click away. */
.table-wrap { overflow-x: auto; position: relative; } /* positioned so hidden .sr-only labels stay inside on phones */
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th { text-align: start; font-weight: 600; font-size: 0.75rem; color: var(--color-text-muted); background: color-mix(in srgb, var(--color-bg-subtle) 45%, transparent); padding: 0.625rem 0.5rem; border-block-end: 1px solid var(--color-divider); white-space: nowrap; }
.table td { padding: 0.75rem 0.5rem; border-block-end: 1px solid var(--color-divider); vertical-align: middle; }
.table tr > :first-child { padding-inline-start: 1.125rem; } /* lines up with the card header and body */
.table tr > :last-child { padding-inline-end: 1.125rem; }
.table tbody tr { transition: background-color 120ms; }
.table tbody tr:hover { background: color-mix(in srgb, var(--color-action-primary) 5%, transparent); }
.table tbody tr:last-child td { border-block-end: 0; }
.table .num { text-align: end; }
.table a [dir="ltr"], .table a[dir="ltr"] { white-space: nowrap; } /* references in table links stay on one line */
.table .badge { white-space: normal; } /* a long status wraps inside its cell instead of widening the table */

/* Tabs: a segmented control; the selected segment is a raised white pill. */
.tabs { display: flex; width: fit-content; max-width: 100%; gap: 0.25rem; padding: 0.25rem; border-radius: 999px; background: color-mix(in srgb, var(--color-bg-subtle) 80%, transparent); border: 1px solid var(--color-border); overflow-x: auto; position: relative; }
.tab { min-height: 2.25rem; padding: 0.375rem 1rem; border-radius: 999px; color: var(--color-text-muted); font-weight: 600; font-size: 0.875rem; background: none; cursor: pointer; white-space: nowrap; transition: background-color 120ms, color 120ms, box-shadow 120ms; }
.tab:hover { color: var(--color-text); }
.tab[aria-selected="true"] { background: var(--color-bg-surface); color: var(--color-action-primary); box-shadow: 0 1px 2px rgba(16, 34, 44, 0.08), 0 6px 14px -8px rgba(16, 34, 44, 0.25); }

/* Stepper */
.stepper { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--color-text-muted); }
.step-dot { width: 1.75rem; height: 1.75rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8125rem; border: 2px solid var(--color-border-strong); background: var(--color-bg-surface); }
.step[data-state="current"] { color: var(--color-text); font-weight: 600; }
.step[data-state="current"] .step-dot { border-color: var(--color-action-primary); color: var(--color-action-primary); box-shadow: 0 0 0 4px var(--color-action-primary-soft); }
.step[data-state="done"] .step-dot { background: var(--gradient-primary); border-color: transparent; color: var(--color-action-primary-fg); }
.step-sep { flex: 0 0 1.5rem; height: 2px; background: var(--color-border-strong); align-self: center; }

/* Timeline (vertical) */
.timeline { position: relative; padding-inline-start: 1.5rem; }
.timeline::before { content: ""; position: absolute; inset-block: 0.5rem; inset-inline-start: 0.4375rem; width: 2px; background: var(--color-border); }
.timeline-item { position: relative; padding-block-end: 1rem; }
.timeline-item::before { content: ""; position: absolute; inset-inline-start: -1.375rem; inset-block-start: 0.45rem; width: 0.875rem; height: 0.875rem; border-radius: 999px; background: var(--color-bg-surface); border: 2px solid var(--color-border-strong); }
.timeline-item[data-state="done"]::before { background: var(--gradient-primary); border-color: transparent; }
.timeline-item[data-state="current"]::before { border-color: var(--color-action-primary); box-shadow: 0 0 0 4px var(--color-action-primary-soft); }
.timeline-item[data-state="problem"]::before { border-color: var(--color-status-danger); background: var(--color-status-danger-bg); }

/* Upload */
.dropzone { border: 2px dashed var(--color-border-strong); border-radius: var(--radius-card); padding: 1.5rem; text-align: center; background: var(--color-glass); cursor: pointer; transition: border-color 120ms, background-color 120ms; }
.dropzone:hover, .dropzone[data-over="true"] { border-color: var(--color-action-primary); background: var(--color-action-primary-soft); }
.progress { height: 0.5rem; background: var(--color-bg-subtle); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--gradient-primary); transition: width 0.3s; }

/* Document thumbnails and viewer placeholders */
.doc-thumb { aspect-ratio: 3 / 4; border: 1px solid var(--color-border); border-radius: 0.375rem; background: var(--color-paper); padding: 0.5rem; display: flex; flex-direction: column; gap: 0.25rem; cursor: pointer; }
.doc-thumb[aria-current="true"] { outline: 2px solid var(--color-action-primary); }
.doc-thumb i { display: block; height: 0.25rem; border-radius: 2px; background: var(--color-paper-line); }
.doc-page { position: relative; background: var(--color-paper); border: 1px solid var(--color-border); border-radius: 0.375rem; aspect-ratio: 1 / 1.414; padding: 2rem; box-shadow: var(--shadow-card); }

/* App shell: a frosted header and a light glass sidebar over the page's colour mesh. The bank's colour stays on
   the current page and the menu icons, so the navigation frames the work instead of competing with it.
   Widths: full sidebar from 1280 px; an icon rail from 1024 to 1279 px (labels become tooltips); below 1024 px a
   menu button opens the sidebar over the page. */
.shell-header { height: 3.5rem; background: var(--color-glass); -webkit-backdrop-filter: var(--blur-glass); backdrop-filter: var(--blur-glass); border-block-end: 1px solid var(--color-glass-border); box-shadow: 0 8px 24px -20px rgba(16, 34, 44, 0.35); display: flex; align-items: center; gap: 0.75rem; padding-inline: 1rem; position: sticky; inset-block-start: 0; z-index: 30; }
.bank-logo { width: 2rem; height: 2rem; border-radius: var(--radius-control); background: var(--gradient-primary); color: var(--color-action-primary-fg); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.bank-mark { display: block; block-size: 2.25rem; inline-size: auto; max-inline-size: none; aspect-ratio: auto; object-fit: contain; flex-shrink: 0; }
.bank-logo-full { display: block; height: 2.25rem; width: auto; max-width: none; object-fit: contain; flex-shrink: 0; } /* the bank's own logo file, never recoloured */
.bank-emblem { display: block; height: 2.5rem; width: auto; flex-shrink: 0; }
.shell-aside { width: 15.5rem; flex-shrink: 0; display: flex; flex-direction: column; background: var(--color-glass); -webkit-backdrop-filter: var(--blur-glass); backdrop-filter: var(--blur-glass); border-inline-end: 1px solid var(--color-glass-border); box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.5); color: var(--color-text); }
@media (min-width: 1024px) { .shell-aside { position: sticky; inset-block-start: 3.5rem; height: calc(100vh - 3.5rem); overflow-y: auto; } }
.shell-aside.fixed { background: var(--color-glass-solid); box-shadow: var(--shadow-dialog); } /* opened over the page on small screens */
/* Group labels, menu icons and the product lockup all start 1.375 rem from the sidebar edge. */
.nav-group { font-size: 0.75rem; font-weight: 700; color: var(--color-text-muted); padding: 1rem 1.375rem 0.25rem; }
.nav-link { position: relative; display: flex; align-items: center; gap: 0.625rem; min-height: 2.5rem; padding: 0.5rem 0.75rem; margin: 0.125rem 0.625rem; border-radius: var(--radius-control); color: var(--color-text); font-size: 0.875rem; font-weight: 500; transition: background-color 120ms, color 120ms, box-shadow 120ms; }
.nav-link svg { color: var(--color-action-primary); }
.nav-link:hover { background: color-mix(in srgb, var(--color-action-primary) 9%, transparent); }
/* Current page: the bank's gradient pill with the accent icon, the two bank colours together. */
.nav-link[aria-current="page"] { background: var(--gradient-primary); color: var(--color-action-primary-fg); box-shadow: var(--shadow-primary), inset 0 1px 0 rgba(255, 255, 255, 0.18); font-weight: 700; }
.nav-link[aria-current="page"] svg { color: var(--color-accent); }
.header-bell { position: relative; }
.header-bell[aria-current="page"] { border-color: var(--color-action-primary); color: var(--color-action-primary); }
.header-bell .nav-count { position: absolute; inset-block-start: -0.375rem; inset-inline-end: -0.375rem; margin: 0; line-height: 1.3; min-width: 1.125rem; text-align: center; }
.nav-count { margin-inline-start: auto; background: var(--color-status-danger); color: var(--color-on-status); border-radius: 999px; font-size: 0.6875rem; padding: 0 0.4rem; font-weight: 700; }
.aside-foot { margin-block-start: auto; padding: 1rem 1.375rem; border-block-start: 1px solid var(--color-divider); }
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .shell-aside { width: 4.5rem; }
  .shell-aside .nav-group { height: 1px; margin: 0.625rem 1rem; padding: 0; overflow: hidden; color: transparent; background: var(--color-divider); }
  .shell-aside .nav-link { justify-content: center; padding: 0.5rem; margin: 0.25rem 0.75rem; }
  .shell-aside .nav-link > span:not(.nav-count) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .shell-aside .nav-count { position: absolute; inset-block-start: 0.125rem; inset-inline-end: 0.125rem; margin: 0; line-height: 1.2; }
  .shell-aside .aside-foot { padding: 1rem 0; display: flex; justify-content: center; }
  .shell-aside .aside-foot .product-lockup > .min-w-0 { display: none; }
}
/* Header controls: one height (36 px), one corner, one border and one type size, whatever the control. */
.shell-header .btn, .shell-header .select, .header-chip { min-height: 2.25rem; height: 2.25rem; border-radius: var(--radius-control); font-size: 0.8125rem; font-weight: 600; }
.shell-header .select { width: auto; padding-block: 0; border-color: var(--color-border-strong); background-color: var(--color-glass-strong); }
.shell-header .btn { padding-inline: 0.875rem; }
.shell-header .btn-icon { width: 2.25rem; min-width: 2.25rem; padding: 0; }
.header-chip { display: inline-flex; align-items: center; gap: 0.5rem; max-width: 14rem; padding-inline: 0.25rem 0.75rem; border: 1px solid var(--color-border-strong); background: var(--color-glass-strong); }
/* Who is on screen (PROTO.persona): the company in lime, the bank in blue. */
.persona { display: inline-flex; align-items: center; justify-content: center; inline-size: 100%; block-size: 100%; border-radius: 999px; }
.persona .persona-icon { inline-size: 55%; block-size: 55%; }
.persona-company { background: var(--color-accent); color: var(--color-accent-fg); }
.persona-bank { background: var(--color-status-info); color: #fff; }
.avatar-persona { background: none; overflow: visible; }
.avatar { width: 1.75rem; height: 1.75rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--gradient-primary); color: var(--color-action-primary-fg); font-size: 0.75rem; font-weight: 700; }

/* Product identity (assets/brand/README.md): the mark, the live product name and Makasib's endorsement line.
   The mark keeps its orientation in both languages; only the layout follows the reading direction. */
.product-lockup { display: inline-flex; align-items: center; gap: 0.75rem; min-width: 0; }
.product-mark { width: 2.25rem; height: 2.25rem; flex-shrink: 0; }
.product-name { display: block; font-weight: 700; line-height: 1.3; }
.product-endorsement { display: block; font-size: 0.75rem; line-height: 1.5; color: var(--color-text-muted); }
.product-lockup-sm { gap: 0.5rem; }
.product-lockup-sm .product-mark { width: 1.5rem; height: 1.5rem; }
.product-lockup-sm .product-name { font-size: 0.8125rem; }
.product-lockup-sm .product-endorsement { font-size: 0.6875rem; }
.shell-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.75rem 1rem; border-block-start: 1px solid var(--color-glass-border); background: var(--color-glass); -webkit-backdrop-filter: var(--blur-glass); backdrop-filter: var(--blur-glass); }

/* Brand band: the bank's gradient with a soft accent glow and the mark's lobes cropped at its outer edge
   (launcher and sign-in pages). The artwork bleeds off the bottom only, so one file serves both reading
   directions without mirroring. */
.brand-band { position: relative; isolation: isolate; overflow: hidden; background: var(--gradient-brand); color: var(--color-on-brand-field); }
.brand-band::before { content: ""; position: absolute; inset-block-end: -10rem; inset-inline-end: -6rem; width: 30rem; height: 30rem; border-radius: 999px; background: radial-gradient(closest-side, color-mix(in srgb, var(--color-accent) 30%, transparent), transparent); pointer-events: none; }
.brand-band::after { content: ""; position: absolute; inset-block: 0; inset-inline-end: 0; width: min(42%, 24rem); background: url("brand/edge.svg") no-repeat center bottom / contain; pointer-events: none; }
.brand-band > * { position: relative; z-index: 1; }
.brand-band .product-endorsement, .brand-band .on-brand-muted { color: var(--color-on-brand-field-muted); }
.brand-band :focus-visible { outline-color: var(--color-accent); }
.brand-band .btn-outline { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.4); color: var(--color-on-brand-field); }
.brand-band .btn-outline:hover { background: var(--color-on-brand-field-hover); }
.brand-band .bank-logo { background: var(--color-on-brand-field); color: var(--color-action-primary); }
.brand-band .bank-emblem { background: var(--color-bg-surface); padding: 0.25rem; border-radius: 0.75rem; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.4); }
/* A glass panel sitting on the brand band or the page wash (sign-in card, launcher panels). */
.glass-panel { background: var(--color-glass-strong); -webkit-backdrop-filter: var(--blur-glass); backdrop-filter: var(--blur-glass); border: 1px solid var(--color-glass-border); border-radius: calc(var(--radius-card) + 0.25rem); box-shadow: var(--shadow-raised); }

/* Dialog and toast */
.dialog-backdrop { position: fixed; inset: 0; background: var(--color-backdrop); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 1rem; }
.dialog { background: var(--color-glass-solid); -webkit-backdrop-filter: var(--blur-glass); backdrop-filter: var(--blur-glass); border: 1px solid var(--color-glass-border); border-radius: var(--radius-card); max-width: 32rem; width: 100%; box-shadow: var(--shadow-dialog); }
/* The toast host sits above a sticky decision bar (app.js sets --toast-lift to its height) and lets clicks through, so a
   message never covers the button the person needs next (EN-20). */
.toast-host { position: fixed; inset-block-end: calc(1rem + var(--toast-lift, 0px)); inset-inline-start: 1rem; z-index: 60; display: flex; flex-direction: column; gap: 0.5rem; max-width: min(28rem, calc(100vw - 2rem)); pointer-events: none; }
.toast { pointer-events: none; background: var(--color-toast-bg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--color-toast-fg); padding: 0.625rem 1rem; border-radius: var(--radius-control); font-size: 0.875rem; box-shadow: var(--shadow-raised); }

/* Loading skeleton */
.skeleton { background: linear-gradient(90deg, var(--color-skeleton) 25%, var(--color-skeleton-shine) 50%, var(--color-skeleton) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 0.375rem; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Launcher: walk-through steps and screen tiles. */
.walk-step { display: flex; align-items: center; gap: 0.75rem; min-height: 2.5rem; padding: 0.375rem 0.75rem; border-radius: var(--radius-control); font-size: 0.875rem; transition: background-color 120ms, color 120ms; }
.walk-step:hover { background: var(--color-action-primary-soft); color: var(--color-action-primary); }
.walk-num { width: 1.5rem; height: 1.5rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.75rem; font-weight: 700; background: var(--color-action-primary-soft); color: var(--color-action-primary); }
.screen-tile { display: flex; align-items: center; gap: 0.625rem; min-height: 3.5rem; padding: 0.625rem 0.75rem; border-radius: var(--radius-card); background: var(--color-glass-strong); border: 1px solid var(--color-glass-border); box-shadow: var(--shadow-card); font-size: 0.875rem; font-weight: 600; transition: transform 120ms, box-shadow 120ms, border-color 120ms; }
.screen-tile:hover { transform: translateY(-2px); border-color: var(--color-action-primary); box-shadow: var(--shadow-raised); }

/* Attachment previews (app.js PROTO.fileThumb / viewFile): every upload shows the file it holds, and opens full size. */
.file-thumb { display: inline-flex; align-items: center; gap: 0.75rem; max-inline-size: 100%; padding: 0.5rem; padding-inline-end: 0.875rem; border-radius: var(--radius-card); background: var(--color-glass-strong); border: 1px solid var(--color-border); text-align: start; transition: border-color 120ms, box-shadow 120ms; }
.file-thumb:hover { border-color: var(--color-action-primary); box-shadow: var(--shadow-card); }
.file-thumb-img { position: relative; flex-shrink: 0; inline-size: 4.5rem; block-size: 6rem; overflow: hidden; border-radius: 0.375rem; border: 1px solid var(--color-divider); background: var(--color-paper); color: var(--color-action-primary); }
.file-thumb-img img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.file-thumb-img object { inline-size: 200%; block-size: 200%; transform: scale(0.5); transform-origin: 0 0; pointer-events: none; border: 0; }
html[dir="rtl"] .file-thumb-img object { transform-origin: 100% 0; }
.file-thumb-img .file-paper { inline-size: 100%; block-size: 100%; }
.file-thumb-cap { display: flex; flex-direction: column; min-inline-size: 0; gap: 0.125rem; }
.file-thumb-name { font-size: 0.8125rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-inline-size: 16rem; }
.file-thumb-meta { font-size: 0.75rem; color: var(--color-action-primary); font-weight: 600; }
.file-view-body { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 1rem; overflow: auto; background: var(--color-bg-app); }
.file-view-body img { max-inline-size: 100%; block-size: auto; box-shadow: var(--shadow-card); }
.file-view-body object { inline-size: 100%; flex: 1 1 auto; min-block-size: 70vh; border: 0; }
.file-view-body .file-paper { inline-size: min(26rem, 100%); block-size: auto; color: var(--color-action-primary); box-shadow: var(--shadow-card); }
.file-view-note { font-size: 0.8125rem; color: var(--color-text-muted); }

/* A 3D icon model (icon3d() in app.js): SVG layers in depth. It rests at an angle (--rx/--ry) and turns once when its
   link is hovered or focused; only an icon marked .i3d-auto (the home greeting) turns on its own. */
.icon3d { display: block; flex-shrink: 0; inline-size: 3rem; block-size: 3rem; container-type: size; perspective: 15rem; }
.i3d-scene { position: relative; display: block; inline-size: 100%; block-size: 100%; transform-style: preserve-3d; transform: rotateX(var(--rx, 8deg)) rotateY(var(--ry, -14deg)); }
.i3d-auto .i3d-scene { animation: i3d-idle 9s ease-in-out infinite; }
.i3d-l { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; overflow: visible; }
a:hover .i3d-scene, a:focus-visible .i3d-scene { animation: i3d-turn 1.1s cubic-bezier(0.5, 0, 0.3, 1) 1; }
@keyframes i3d-idle { 0%, 100% { transform: rotateX(10deg) rotateY(-20deg); } 35% { transform: rotateX(6deg) rotateY(20deg); } 70% { transform: rotateX(10deg) rotateY(-20deg); } 85% { transform: rotateX(8deg) rotateY(160deg); } 99.9% { transform: rotateX(10deg) rotateY(340deg); } }
@keyframes i3d-turn { from { transform: rotateX(8deg) rotateY(0deg); } to { transform: rotateX(8deg) rotateY(360deg); } }
@media (prefers-reduced-motion: reduce) { .i3d-scene, a:hover .i3d-scene, a:focus-visible .i3d-scene { animation: none; } }

/* The company logo beside the company picker in the merchant header. */
.company-pick { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; }
.company-logo { inline-size: 2.25rem; block-size: 2.25rem; flex-shrink: 0; border-radius: 0.625rem; box-shadow: 0 2px 6px -2px rgba(0, 0, 0, 0.25); }

/* The header controls: one glass pill, borderless controls inside, hover tint, a hairline between groups. */
.header-tools { display: flex; align-items: center; gap: 0.125rem; min-width: 0; margin-inline-start: auto; padding: 0.1875rem; border-radius: 999px; background: var(--color-glass-strong); border: 1px solid var(--color-glass-border); box-shadow: 0 8px 20px -16px rgba(16, 34, 44, 0.5); }
.header-tools .btn, .header-tools .select, .header-tools .header-chip { border: 0; border-radius: 999px; background-color: transparent; box-shadow: none; }
.header-tools .btn:hover, .header-tools .select:hover { background-color: color-mix(in srgb, var(--color-action-primary) 8%, transparent); }
.header-tools .header-chip { padding-inline: 0.25rem 0.5rem; }
.header-tools .header-locale { min-inline-size: 2.25rem; padding-inline: 0.5rem; font-family: var(--font-latin); }
.header-tools .header-bell[aria-current="page"] { background-color: var(--color-action-primary-soft); }
.header-tools .header-bell .nav-count { inset-block-start: -0.125rem; inset-inline-end: -0.125rem; }
.header-tools .company-pick { position: relative; padding-inline-start: 0.125rem; }
.header-tools .company-logo { inline-size: 2rem; block-size: 2rem; border-radius: 999px; }
.company-pick-caret { display: none; }
@media (max-width: 639.98px) {
  .shell-header { height: 3.25rem; gap: 0.5rem; padding-inline: 0.75rem; }
  /* Phones: the logo stands for the company; the picker opens from it. */
  .header-tools .company-pick { gap: 0.125rem; padding-inline-end: 0.25rem; }
  .header-tools .company-pick .select { position: absolute; inset: 0; inline-size: 100%; max-width: none !important; opacity: 0; cursor: pointer; }
  .company-pick-caret { display: inline-flex; color: var(--color-text-muted); }
  .header-tools #proto-role { max-width: 7rem !important; } /* leaves room for the light/dark toggle at 375 px */
  .page-title { font-size: 1.3125rem; }
  .page-subtitle { font-size: 0.8125rem; }
  .page-head { gap: 0.5rem; }
}

/* ---- Dark mode (data-mode="dark" on <html>; set before the first paint by tw-config.js, toggled by PROTO.setMode).
   Only the tokens change: a deep slate page under a dimmer mesh of the bank's two colours, dark glass with a faint
   light rim, lighter shades of the bank's colour for actions (with dark text on them, so text on the page and text on
   a button both keep 4.5:1), and light status colours on dark tints. The colour field of the entry pages keeps the
   bank's own dark colour (--color-brand-deep). The bank's logo files are never recoloured: they sit on a light plate.
   Screen only: printing always uses the light tokens. */
.mode-toggle .mode-sun { display: none; }
:root[data-mode="dark"] .mode-toggle .mode-sun { display: block; }
:root[data-mode="dark"] .mode-toggle .mode-moon { display: none; }
[data-theme="tadamun"] { --color-brand-deep: var(--bank-primary); }
[data-theme="bank-b"] { --color-brand-deep: #1e3a8a; }
@media screen {
  :root[data-mode="dark"] {
    color-scheme: dark;
    --color-bg-app: #0b1419;
    --color-bg-surface: #14222b;
    --color-bg-subtle: #1b2b35;
    --color-border: #2b3c47;
    --color-border-strong: #66798a; /* 3.3:1 on the surface */
    --color-text: #e4ebf0;
    --color-text-muted: #a2b2be; /* 7:1 on the surface */
    --color-action-primary: #9fc0db; /* Makasib navy, lightened for dark */
    --color-action-primary-hover: #b9d3e8;
    --color-action-primary-fg: #0f1d29;
    --color-action-primary-soft: color-mix(in srgb, var(--color-action-primary) 16%, var(--color-bg-surface));
    --color-focus: var(--color-action-primary);
    --color-brand-deep: #24384a;
    --color-backdrop: rgba(2, 8, 12, 0.62);
    --color-status-info: #8ec2ff;
    --color-status-info-bg: #142a45;
    --color-status-success: #5fd39a;
    --color-status-success-bg: #0f2f22;
    --color-status-warning: #f5c065;
    --color-status-warning-bg: #32270f;
    --color-status-danger: #ff8f85;
    --color-status-danger-bg: #3a1a1a;
    --color-status-neutral: #a9b8c3;
    --color-status-neutral-bg: #1f2d37;
    --color-alert-info-border: #2c5482;
    --color-alert-info-text: #a9d0ff;
    --color-alert-success-border: #1f5e43;
    --color-alert-success-text: #7fe0b0;
    --color-alert-warning-border: #6b5220;
    --color-alert-warning-text: #f8cf86;
    --color-alert-danger-border: #7a3530;
    --color-alert-danger-text: #ffaaa2;
    --color-on-status: #0b1419; /* dark text on the light status colours (danger and success buttons, counts) */
    --color-paper: #192831;
    --color-paper-line: #2e404b;
    --color-toast-fg: #e4ebf0;
    --color-toast-bg: rgba(38, 56, 68, 0.95);
    --color-skeleton: #1d2c36;
    --color-skeleton-shine: #283a45;
    --color-wash-primary: color-mix(in srgb, var(--color-action-primary) 26%, transparent);
    --color-wash-primary-soft: color-mix(in srgb, var(--color-action-primary) 15%, transparent);
    --color-wash-accent: color-mix(in srgb, var(--color-accent) 16%, transparent);
    --color-glass: color-mix(in srgb, var(--color-bg-surface) 60%, transparent);
    --color-glass-strong: color-mix(in srgb, var(--color-bg-surface) 74%, transparent);
    --color-glass-solid: color-mix(in srgb, var(--color-bg-surface) 92%, transparent);
    --color-glass-border: rgba(255, 255, 255, 0.09);
    --color-divider: rgba(255, 255, 255, 0.08);
    --gradient-tint: linear-gradient(135deg, color-mix(in srgb, var(--color-bg-surface) 80%, transparent) 0%, color-mix(in srgb, var(--color-action-primary-soft) 80%, transparent) 100%);
    --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 34px -16px rgba(0, 0, 0, 0.65);
    --shadow-raised: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 44px -18px rgba(0, 0, 0, 0.75);
    --shadow-primary: 0 10px 22px -12px color-mix(in srgb, var(--color-action-primary) 40%, transparent);
    --shadow-dialog: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
    /* 3D icons (icon3d in app.js): a dark glass pane, a soft shine and a darker block edge. */
    --i3d-pane: #0e1b22;
    --i3d-pane-op: 0.5;
    --i3d-shine-op: 0.12;
    --i3d-edge: #000;
  }
  /* The bank's colours, lightened for dark; its own colour stays on the colour field. */
  :root[data-mode="dark"][data-theme="tadamun"] {
    --color-action-primary: #5cc0b5;
    --color-action-primary-hover: #7fd2c8;
    --color-action-primary-fg: #052523;
    --color-brand-deep: var(--bank-primary);
  }
  :root[data-mode="dark"][data-theme="bank-b"] {
    --color-action-primary: #93abf5;
    --color-action-primary-hover: #b0c3fa;
    --color-action-primary-fg: #0b1735;
    --color-brand-deep: #1e3a8a;
  }

  :root[data-mode="dark"] body {
    background-image:
      radial-gradient(42rem 28rem at 24% -8%, var(--color-wash-accent), transparent 70%),
      radial-gradient(40rem 36rem at 100% 34%, var(--color-wash-primary-soft), transparent 70%),
      radial-gradient(56rem 40rem at -6% 96%, var(--color-wash-primary), transparent 70%),
      linear-gradient(160deg, color-mix(in srgb, var(--color-accent) 3%, var(--color-bg-app)) 0%, color-mix(in srgb, var(--color-brand-deep) 28%, var(--color-bg-app)) 100%);
  }
  :root[data-mode="dark"] .input, :root[data-mode="dark"] .select, :root[data-mode="dark"] .textarea { background-color: color-mix(in srgb, var(--color-bg-app) 65%, var(--color-bg-surface)); }
  :root[data-mode="dark"] .search-field > .input, :root[data-mode="dark"] .select-sm, :root[data-mode="dark"] .shell-header .select { background-color: var(--color-glass-strong); }
  :root[data-mode="dark"] .header-tools .select { background-color: transparent; }
  :root[data-mode="dark"] .tab[aria-selected="true"] { background: color-mix(in srgb, var(--color-bg-surface) 84%, #fff); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 14px -8px rgba(0, 0, 0, 0.6); }
  :root[data-mode="dark"] .shell-aside { box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04); }
  :root[data-mode="dark"] .shell-header, :root[data-mode="dark"] .header-tools { box-shadow: 0 8px 24px -18px rgba(0, 0, 0, 0.7); }
  :root[data-mode="dark"] .nav-link[aria-current="page"] svg { color: var(--color-action-primary-fg); }
  :root[data-mode="dark"] .persona-bank { color: var(--color-on-status); }
  :root[data-mode="dark"] .company-logo { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 2px 6px -2px rgba(0, 0, 0, 0.5); }
  /* The bank's logo files keep their colours on a light plate; the product mark switches to its on-dark file. */
  :root[data-mode="dark"] .bank-logo-full { background: #f4f7f9; padding: 0.25rem 0.5rem; border-radius: 0.625rem; box-sizing: content-box; }
  :root[data-mode="dark"] .bank-mark { background: #f4f7f9; padding: 0.1875rem; border-radius: 0.625rem; box-sizing: border-box; }
  :root[data-mode="dark"] .brand-band .bank-emblem { background: #f4f7f9; }
  :root[data-mode="dark"] img.product-mark[src$="/mark.svg"] { content: url("brand/mark-on-dark.svg"); }
  /* The full demo (demo.js injects its own styles): its dark card and bar become a raised slate with the lime rim. */
  :root[data-mode="dark"] #demo-bar { background: color-mix(in srgb, #1c2d38 94%, var(--color-action-primary)) !important; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8) !important; }
  :root[data-mode="dark"] #demo-card { background: rgba(2, 8, 12, 0.6); }
  :root[data-mode="dark"] #demo-card .demo-card-box, :root[data-mode="dark"] #demo-ring .demo-ring-tag { background: color-mix(in srgb, #1c2d38 94%, var(--color-action-primary)); }
  :root[data-mode="dark"] .demo-who[data-side="bank"] { color: var(--color-status-info); background: color-mix(in srgb, var(--color-status-info) 14%, transparent); border-color: color-mix(in srgb, var(--color-status-info) 55%, transparent); }
  :root[data-mode="dark"] #demo-card .demo-card-box[data-side="bank"], :root[data-mode="dark"] #demo-card .demo-card-switch[data-side="bank"] { border-color: color-mix(in srgb, var(--color-status-info) 60%, transparent); }
}

/* Less text on screen: a field's help line shows only while the person is in that field (screen readers still read
   it through aria-describedby). */
.field:not(:focus-within) .hint { display: none; }

/* Only the large chip is a button's face. A small or medium chip marks a title or a row: a plain icon in its colour,
   without a box, so it never reads as something to click (Mohamed, 2026-11-22). */
.icon-chip:not(.icon-chip-lg) { background: none !important; box-shadow: none !important; }
.icon-chip:not(.icon-chip-lg):not(.icon-chip-success):not(.icon-chip-warning):not(.icon-chip-danger):not(.icon-chip-info) { color: var(--color-action-primary); }
