/* =============================================================================
   MC-Warehouse — design system
   Palette sampled from the approved logo: ink navy #0C121E, lit gold #D69137 → #FED252 and
   silver #E6E4E4. The gold "edge-light" (the logo's glowing edges) is used sparingly: focus,
   active state, scanner frame, balance bars.
   Logical properties throughout so Arabic (RTL) mirrors without overrides.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
    --font: "Readex Pro", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --r-xs: 8px; --r-sm: 10px; --r: 14px; --r-lg: 18px; --r-xl: 24px; --r-pill: 999px;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --appbar-h: 60px;
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --edge: #F5B342;
    --content: 1080px;
}

:root, [data-theme="light"] {
    color-scheme: light;
    --bg: #F2F5F9;
    --bg-tint: #E8EEF6;
    --surface: #FFFFFF;
    --surface-2: #F6F8FB;
    --surface-3: #EDF1F6;
    --line: #E1E7EF;
    --line-strong: #CBD5E1;
    --text: #0A1626;
    --text-2: #34445B;
    --muted: #64748B;
    --faint: #94A3B8;
    --brand: #8A5A10;
    --brand-hover: #74490A;
    --brand-ink: #0C121E;
    --brand-soft: #FBF2E2;
    --brand-soft-2: #F5E3C2;
    --on-brand: #FFFFFF;
    --btn-grad: linear-gradient(180deg, #F7C25A 0%, #DE9530 100%);
    --btn-text: #1B1407;
    --btn-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 8px 20px -10px rgba(214, 145, 55, .8);
    --accent: #C98523;
    --focus: rgba(214, 145, 55, .28);
    --ok: #0B8A65; --ok-soft: #E2F4EC;
    --warn: #A6670C; --warn-soft: #FBF1DE;
    --bad: #C02D44; --bad-soft: #FBE8EB;
    --shadow-1: 0 1px 2px rgba(10, 22, 38, .05), 0 1px 1px rgba(10, 22, 38, .03);
    --shadow-2: 0 12px 32px -14px rgba(8, 28, 58, .22), 0 2px 6px rgba(10, 22, 38, .05);
    --shadow-3: 0 30px 70px -24px rgba(6, 20, 45, .38);
    --scrim: rgba(7, 15, 28, .42);
    --grid-line: rgba(12, 18, 30, .065);
    --appbar-bg: rgba(242, 245, 249, .78);
    --skeleton: linear-gradient(90deg, #E9EEF4 0%, #F5F8FB 50%, #E9EEF4 100%);
    --logo-glow: none;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #060C17;
    --bg-tint: #0A1424;
    --surface: #0C1626;
    --surface-2: #101C30;
    --surface-3: #16253D;
    --line: rgba(148, 172, 206, .12);
    --line-strong: rgba(148, 172, 206, .22);
    --text: #E7EDF6;
    --text-2: #B7C3D4;
    --muted: #8493AA;
    --faint: #5D6B81;
    --brand: #F2B544;
    --brand-hover: #FFC75F;
    --brand-ink: #FFE3A8;
    --brand-soft: rgba(242, 181, 68, .12);
    --brand-soft-2: rgba(242, 181, 68, .2);
    --on-brand: #1B1407;
    --btn-grad: linear-gradient(180deg, #F7C25A 0%, #DE9530 100%);
    --btn-text: #1B1407;
    --btn-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 10px 26px -12px rgba(245, 179, 66, .55);
    --accent: #F5B342;
    --focus: rgba(245, 179, 66, .3);
    --ok: #3DD6A6; --ok-soft: rgba(61, 214, 166, .12);
    --warn: #F0B44C; --warn-soft: rgba(240, 180, 76, .13);
    --bad: #FF7A8E; --bad-soft: rgba(255, 122, 142, .13);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 18px 40px -20px rgba(0, 0, 0, .85), 0 0 0 1px rgba(148, 172, 206, .07);
    --shadow-3: 0 40px 90px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(148, 172, 206, .1);
    --scrim: rgba(1, 5, 12, .7);
    --grid-line: rgba(245, 179, 66, .05);
    --appbar-bg: rgba(6, 12, 23, .74);
    --skeleton: linear-gradient(90deg, #101B2E 0%, #172741 50%, #101B2E 100%);
    --logo-glow: radial-gradient(closest-side, rgba(245, 179, 66, .16), transparent 75%);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.has-modal { overflow: hidden; }
body {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    font-weight: 400;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
::selection { background: var(--brand-soft-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono, code, kbd { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
mark { background: color-mix(in srgb, var(--edge) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
/* Mixed Arabic/English data: bidi order follows the text (dir="auto"), alignment follows the page. */
[dir="ltr"] :is(.row-name, .row-ename, .fs-name, .fs-ename, .bal-item-name, .bal-store span, .link-title, .link-sub) { text-align: left; }
[dir="rtl"] :is(.row-name, .row-ename, .fs-name, .fs-ename, .bal-item-name, .bal-store span, .link-title, .link-sub) { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.i { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 15px; height: 15px; }
.i-lg { width: 26px; height: 26px; }

/* ---------- Buttons ---------- */
.btn {
    --h: 44px;
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: var(--h); padding: 0 18px;
    border: 1px solid transparent; border-radius: var(--r-sm);
    font-weight: 500; font-size: 14.5px; white-space: nowrap;
    background: var(--surface-2); color: var(--text);
    transition: background .18s var(--ease), border-color .18s, box-shadow .18s, transform .12s var(--ease), color .18s;
    -webkit-user-select: none; user-select: none;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-lg { --h: 52px; font-size: 15.5px; border-radius: var(--r); padding: 0 22px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--btn-grad); color: var(--btn-text); font-weight: 600; box-shadow: var(--btn-shadow); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { background: var(--brand-soft-2); }
.btn .spinner { display: none; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading .i, .btn.is-loading .btn-label { visibility: hidden; }
.btn.is-loading .spinner { display: block; position: absolute; inset: 0; margin: auto; border-color: rgba(27, 20, 7, .25); border-top-color: var(--btn-text); }

.btn-icon {
    display: inline-grid; place-items: center;
    width: 42px; height: 42px; padding: 0;
    border: 0; border-radius: var(--r-sm);
    background: transparent; color: var(--text-2);
    transition: background .15s, color .15s;
}
.btn-icon:hover { background: var(--surface-3); color: var(--text); }
.btn-icon-sm { width: 34px; height: 34px; border-radius: var(--r-xs); }
.btn-lang .lang-glyph { font-weight: 600; font-size: 15px; line-height: 1; }
.btn-lang .lang-glyph:lang(ar) { font-size: 18px; transform: translateY(-1px); }

[data-theme="light"] .i-theme-light, [data-theme="dark"] .i-theme-dark { display: none; }

.spinner {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--line-strong); border-top-color: var(--accent);
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Form controls ---------- */
.field { margin-bottom: 16px; }
.label { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.control { position: relative; display: flex; align-items: center; }
.input {
    width: 100%; height: 50px;
    padding-inline: 44px 14px;
    border: 1px solid var(--line-strong); border-radius: var(--r);
    background: var(--surface);
    color: var(--text);
    font-size: 15.5px;
    transition: border-color .15s, box-shadow .2s var(--ease), background .15s;
    -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: var(--faint); }
.input:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line-strong)); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus); }
.input.has-end { padding-inline-end: 48px; }
.input-select { padding-inline-end: 40px; cursor: pointer; }
.control-icon { position: absolute; inset-inline-start: 14px; color: var(--muted); pointer-events: none; }
.control-caret { position: absolute; inset-inline-end: 14px; color: var(--muted); pointer-events: none; width: 18px; height: 18px; }
.control-end { position: absolute; inset-inline-end: 6px; }
.control:focus-within .control-icon { color: var(--accent); }
.field.is-invalid .input { border-color: var(--bad); }
.field.is-invalid .input:focus { box-shadow: 0 0 0 4px var(--bad-soft); }
.field-error { margin-top: 6px; font-size: 12.5px; color: var(--bad); }
.field-hint { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.field-warn { color: var(--warn); }

.check { display: flex; align-items: center; gap: 10px; margin: 4px 0 22px; font-size: 14px; color: var(--text-2); cursor: pointer; -webkit-user-select: none; user-select: none; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box {
    display: grid; place-items: center; width: 20px; height: 20px; flex: 0 0 auto;
    border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--surface);
    transition: background .15s, border-color .15s;
}
.check-box .i { width: 14px; height: 14px; stroke-width: 3; color: var(--on-brand); opacity: 0; transform: scale(.6); transition: .15s var(--ease); }
.check input:checked + .check-box { background: var(--brand); border-color: var(--brand); }
.check input:checked + .check-box .i { opacity: 1; transform: none; }
.check input:focus-visible + .check-box { box-shadow: 0 0 0 4px var(--focus); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 18px; border-radius: var(--r); font-size: 14px; }
.alert .i { margin-top: 1px; }
.alert-danger { background: var(--bad-soft); color: var(--bad); }

.chip {
    display: inline-flex; align-items: center; gap: 5px;
    height: 26px; padding: 0 10px; border-radius: var(--r-pill);
    background: var(--surface-3); color: var(--text-2);
    font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.chip-warn { background: var(--warn-soft); color: var(--warn); }

kbd {
    display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
    border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px;
    background: var(--surface); color: var(--text-2); font-size: 11px; line-height: 1;
}

/* ---------- Brand ---------- */
/* The approved logo carries its own navy name badge and lit gold edges, so it sits directly on
   both themes; dark mode adds only a faint gold glow behind it. */
.logo-plate { position: relative; display: inline-grid; place-items: center; }
.logo-plate::before { content: ""; position: absolute; inset: -18% -12%; background: var(--logo-glow); pointer-events: none; }
.logo-plate img { position: relative; width: 100%; height: auto; }

.iso-grid {
    position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(30deg, var(--grid-line) 1px, transparent 1px),
        linear-gradient(150deg, var(--grid-line) 1px, transparent 1px);
    background-size: 46px 26.5px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
}

/* ---------- Login ---------- */
.login { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100dvh; }
.login-brand {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 48px;
    color: #DCE6F2;
    background:
        radial-gradient(120% 80% at 20% 0%, rgba(245, 179, 66, .14) 0%, transparent 45%),
        radial-gradient(90% 70% at 100% 100%, rgba(40, 58, 92, .45) 0%, transparent 55%),
        linear-gradient(160deg, #111A2C 0%, #070B14 70%);
}
.login-brand::after { /* cyan edge-light, like the logo's lit edges */
    content: ""; position: absolute; inset-block: 0; inset-inline-end: 0; width: 1px;
    background: linear-gradient(180deg, transparent, rgba(245, 179, 66, .6), transparent);
}
.login-brand .iso-grid { --grid-line: rgba(245, 179, 66, .06); }
.login-brand-inner { position: relative; width: min(440px, 100%); }
.login-brand .logo-plate { width: 100%; --logo-glow: radial-gradient(closest-side, rgba(245, 179, 66, .2), transparent 75%); }
.login-tagline { margin: 34px 0 22px; font-size: 22px; font-weight: 500; line-height: 1.35; color: #F2F6FB; letter-spacing: -.01em; }
.login-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.login-points li { display: flex; align-items: center; gap: 14px; font-size: 15px; color: #B9C7D8; }
.point-ico { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px;
    background: rgba(245, 179, 66, .08); color: #FFCB6B; box-shadow: inset 0 0 0 1px rgba(245, 179, 66, .24); }
.login-brand-foot { position: absolute; bottom: 26px; inset-inline-start: 48px; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: #5E7493; }

.login-main { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 88px 24px 32px; background: var(--bg); }
.login-top { position: absolute; top: calc(16px + var(--safe-t)); inset-inline-end: 16px; display: flex; gap: 4px; }
.login-card { width: min(420px, 100%); animation: rise .5s var(--ease-out) both; }
.logo-plate-compact { display: none; }
.login-title { font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.login-sub { margin: 6px 0 28px; color: var(--muted); font-size: 15px; }
.login-foot { margin-top: 32px; font-size: 12.5px; color: var(--faint); }
.btn-trail { margin-inline-start: 2px; }

@media (max-width: 900px) {
    .login { grid-template-columns: 1fr; }
    .login-brand { display: none; }
    .login-main { justify-content: flex-start; padding-top: calc(76px + var(--safe-t)); }
    .logo-plate-compact { display: grid; width: 230px; margin: 0 auto 26px; }
    .login-title, .login-sub { text-align: center; }
}

/* ---------- App bar ---------- */
.appbar {
    position: sticky; top: 0; z-index: 40;
    padding-top: var(--safe-t);
    background: var(--appbar-bg);
    -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
body.is-scrolled .appbar { border-bottom-color: var(--line); }
.appbar-inner { display: flex; align-items: center; justify-content: space-between; height: var(--appbar-h); max-width: var(--content); margin: 0 auto; padding: 0 16px; }
.brand { display: flex; align-items: center; height: 44px; padding: 4px; border-radius: var(--r-sm); opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s var(--ease); pointer-events: none; }
body.is-active .brand { opacity: 1; transform: none; pointer-events: auto; }
.brand-mark { width: auto; height: 36px; }
.appbar-actions { display: flex; align-items: center; gap: 2px; }
.prefs-lang { margin: 0; display: contents; }

.menu { position: relative; margin-inline-start: 6px; }
.avatar-btn { padding: 3px; border: 0; border-radius: 50%; background: transparent; }
.avatar {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(140deg, #26324D, #0C121E); color: #FED252;
    font-size: 13px; font-weight: 600; letter-spacing: .02em;
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px color-mix(in srgb, var(--edge) 55%, transparent);
}
.avatar-lg { width: 42px; height: 42px; font-size: 15px; }
.menu-panel {
    position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 50;
    width: 270px; padding: 8px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--shadow-3);
    transform-origin: top right;
    animation: pop .16s var(--ease-out);
}
[dir="rtl"] .menu-panel { transform-origin: top left; }
.menu-user { display: flex; align-items: center; gap: 12px; padding: 10px 10px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.menu-user-text { display: grid; min-width: 0; }
.menu-user-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-user-sub { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu form { margin: 0; }
.menu-item {
    display: flex; align-items: center; gap: 12px; width: 100%; height: 44px; padding: 0 10px;
    border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); font-size: 14.5px; text-align: start;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item .i { color: var(--muted); }
.menu-item-danger, .menu-item-danger .i { color: var(--bad); }

/* ---------- Search page ---------- */
.app { max-width: var(--content); margin: 0 auto; padding: 0 16px calc(40px + var(--safe-b)); }

.hero {
    position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: clamp(28px, 9vh, 96px) 0 30px;
    transition: opacity .25s var(--ease), transform .3s var(--ease);
}
.hero .iso-grid { inset: -40px -16px 0; }
.hero > :not(.iso-grid) { position: relative; }
.logo-plate-hero { width: clamp(220px, 34vw, 300px); margin-bottom: 22px; animation: rise .6s var(--ease-out) both; }
.hero-title { font-size: clamp(26px, 4.4vw, 38px); font-weight: 600; letter-spacing: -.025em; line-height: 1.15; animation: rise .6s .05s var(--ease-out) both; }
.hero-sub { margin-top: 10px; max-width: 460px; color: var(--muted); font-size: 16px; animation: rise .6s .1s var(--ease-out) both; }
[dir="rtl"] .hero-title, [dir="rtl"] .login-title, [dir="rtl"] .login-tagline { letter-spacing: 0; }

body.is-active .hero { display: none; }

.search-zone {
    position: sticky; top: calc(var(--appbar-h) + var(--safe-t)); z-index: 30;
    max-width: 720px; margin: 0 auto; padding: 4px 0 14px;
    animation: rise .6s .15s var(--ease-out) both;
}
body.is-active .search-zone { max-width: none; padding-top: 10px; background: linear-gradient(var(--bg) 78%, transparent); }

.searchbar {
    position: relative; display: flex; align-items: center;
    height: 62px; padding-inline: 20px 8px;
    background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: var(--r-lg);
    box-shadow: var(--shadow-2);
    transition: border-color .2s, box-shadow .25s var(--ease);
}
.searchbar::before { /* the cyan edge-light, lit on focus */
    content: ""; position: absolute; inset-inline: 22px; top: -1px; height: 1.5px; border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--edge), transparent);
    opacity: 0; transition: opacity .25s;
}
.searchbar:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, var(--line-strong)); box-shadow: 0 0 0 4px var(--focus), var(--shadow-2); }
.searchbar:focus-within::before { opacity: 1; }
.searchbar-icon { width: 22px; height: 22px; color: var(--muted); }
.searchbar:focus-within .searchbar-icon { color: var(--accent); }
.searchbar-input {
    flex: 1; min-width: 0; height: 100%; padding: 0 14px;
    border: 0; outline: 0; background: transparent;
    font-size: 17px; color: var(--text);
}
.searchbar-input::placeholder { color: var(--faint); }
.searchbar-input::-webkit-search-cancel-button, .searchbar-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.searchbar-spin { display: none; margin-inline-end: 8px; }
body.is-loading .searchbar-spin { display: block; }
.searchbar-sep { width: 1px; height: 28px; margin: 0 6px; background: var(--line); }
.scan-btn {
    display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px;
    border: 0; border-radius: 13px; background: var(--brand-soft); color: var(--brand); font-weight: 500;
    transition: background .15s, transform .12s;
}
.scan-btn:hover { background: var(--brand-soft-2); }
.scan-btn:active { transform: scale(.97); }
.scan-btn .i { width: 22px; height: 22px; }

.search-help { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 0 4px; color: var(--muted); font-size: 12.5px; }
.search-help-chips { display: flex; gap: 6px; flex-wrap: nowrap; }
.search-help-chips .chip { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--muted); }
.kbd-hint { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12px; }
.kbd-hint kbd + kbd { margin-inline-start: -2px; }
body.is-active .search-help { display: none; }

/* Results */
.results { margin-top: 2px; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; margin: 4px 4px 10px; }
.results-count { font-size: 13.5px; color: var(--muted); }
.results-count strong { color: var(--text); font-weight: 600; }
.results-cols, .row {
    display: grid; align-items: center; column-gap: 14px;
    grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.3fr) minmax(0, 1.05fr) 64px minmax(0, .65fr) 92px var(--actions-w, 250px);
}
.results.no-price .results-cols, .results.no-price .row { grid-template-columns: minmax(0, 2.5fr) minmax(0, 1.3fr) minmax(0, 1.1fr) 64px minmax(0, .7fr) var(--actions-w, 250px); }
.results.no-price .col-price, .results.no-price .row-price { display: none; }
.results-cols { padding: 0 16px 8px; font-size: 11.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
[dir="rtl"] .results-cols { letter-spacing: 0; font-size: 12.5px; }
.results-cols > :nth-child(6) { text-align: end; }
.results-list { display: grid; gap: 6px; }

.row {
    position: relative; min-height: 66px; padding: 10px 10px 10px 16px;
    padding-inline: 16px 10px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .2s;
    animation: rowIn .32s var(--ease-out) both;
    animation-delay: calc(var(--n, 0) * 18ms);
}
.row:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.row.is-active { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px var(--focus); }
.row.is-active::before { content: ""; position: absolute; inset-block: 12px; inset-inline-start: -1px; width: 3px; border-radius: 3px; background: var(--edge); }
.row-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row-ico { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px; background: var(--surface-3); color: var(--muted); }
.row-text { display: grid; min-width: 0; }
.row-name { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-ename { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-exact { margin-inline-start: 6px; height: 20px; padding: 0 7px; font-size: 11px; background: var(--ok-soft); color: var(--ok); vertical-align: 1px; }
.row-cell { min-width: 0; font-size: 13.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-cell .mono { font-size: 13px; }
.row-cell-label { display: none; }
.row-id { color: var(--muted); }
.row-price { text-align: end; font-weight: 500; color: var(--text); }
.row-empty { color: var(--faint); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions .btn { --h: 38px; padding: 0 12px; font-size: 13.5px; border-radius: var(--r-sm); }
.results-more { margin: 14px 4px 0; text-align: center; font-size: 13px; color: var(--muted); }

@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } }

/* Skeleton */
.skel-row { pointer-events: none; animation: none; }
.skel { display: block; height: 12px; border-radius: 6px; background: var(--skeleton); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skel-ico { width: 38px; height: 38px; border-radius: 11px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* States (empty / error / hint) */
.state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 16px; }
.state-ico { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 16px; border-radius: 20px; background: var(--surface); color: var(--muted); box-shadow: var(--shadow-2); }
.state-ico .i { width: 28px; height: 28px; }
.state-ico.is-bad { color: var(--bad); }
.state h2 { font-size: 18px; font-weight: 600; }
.state p { margin-top: 6px; max-width: 380px; color: var(--muted); }
.state .btn { margin-top: 18px; }
.state-hint { padding: 22px 16px; }
.state .state-ref { margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--faint); direction: ltr; }
.state-hint p { margin: 0; }

/* Phones: results become compact cards — name, identifier chips, two actions */
@media (max-width: 860px) {
    .results-cols { display: none; }
    .row, .results.no-price .row {
        display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
        padding: 12px; padding-inline: 12px;
    }
    .row-main { flex: 1 1 100%; align-items: flex-start; margin-bottom: 4px; }
    .row-ico { width: 34px; height: 34px; border-radius: 10px; }
    .row-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
    .row-cell {
        display: inline-flex; align-items: baseline; gap: 5px; max-width: 100%;
        padding: 4px 9px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px;
    }
    .row-cell .mono { font-size: 12.5px; }
    .row-cell-label { display: inline; font-size: 11px; color: var(--faint); }
    .row-price { background: var(--brand-soft); color: var(--brand); }
    .row-price .row-cell-label { color: inherit; opacity: .75; }
    .row-actions { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
    .row-actions .btn { --h: 42px; }
    .row-empty-cell { display: none; }
}
@media (max-width: 560px) {
    .searchbar { height: 56px; padding-inline: 14px 6px; border-radius: 16px; }
    .searchbar-input { font-size: 16px; padding: 0 10px; }
    .scan-btn { height: 44px; padding: 0 12px; }
    .scan-btn-label { display: none; }
    .kbd-hint { display: none; }
    .search-help { justify-content: center; }
    .hero-sub { font-size: 15px; }
}
@media (hover: none) { .kbd-hint { display: none; } .search-help { justify-content: center; } }

/* ---------- Dialogs ---------- */
.dlg {
    padding: 0; border: 0; color: var(--text); background: var(--surface);
    max-width: none; max-height: none;
    box-shadow: var(--shadow-3);
    overscroll-behavior: contain;
}
.dlg::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .2s ease both; }
.dlg[open] { display: flex; flex-direction: column; }
.dlg-bar { display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 8px 10px; flex: 0 0 auto; border-bottom: 1px solid var(--line); }
.dlg-bar-title { font-weight: 600; font-size: 15.5px; padding-inline: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-bar-spacer { flex: 1; }
.dlg-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.dlg-foot { flex: 0 0 auto; padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--surface); }
.dlg-foot-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dlg-foot-actions .btn { padding: 0 10px; }
.dlg-handle { display: none; }

/* Side panel (fact sheet) */
.dlg-side { position: fixed; inset: 0; inset-inline-start: auto; width: min(600px, 100vw); height: 100dvh; margin: 0; border-radius: 0; }
.dlg-side[open] { animation: slideIn .34s var(--ease-out) both; }
[dir="rtl"] .dlg-side[open] { animation-name: slideInRtl; }
.dlg-side.is-closing { animation: slideOut .22s var(--ease) both; }
[dir="rtl"] .dlg-side.is-closing { animation-name: slideOutRtl; }
@media (min-width: 640px) { .dlg-side { border-start-start-radius: var(--r-xl); border-end-start-radius: var(--r-xl); } }

/* Sheet: centered card on desktop, bottom sheet on phones */
.dlg-sheet { margin: auto; width: min(560px, calc(100vw - 32px)); max-height: min(760px, calc(100dvh - 48px)); border-radius: var(--r-xl); }
.dlg-sheet[open] { animation: popIn .26s var(--ease-out) both; }
.dlg-sheet.is-closing { animation: popOut .16s var(--ease) both; }
.dlg-narrow { width: min(440px, calc(100vw - 32px)); }
@media (max-width: 640px) {
    .dlg-sheet, .dlg-narrow { position: fixed; inset: auto 0 0; width: 100%; max-height: 92dvh; margin: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; }
    .dlg-sheet[open] { animation: sheetUp .34s var(--ease-out) both; }
    .dlg-sheet.is-closing { animation: sheetDown .22s var(--ease) both; }
    .dlg-handle { display: block; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 4px; background: var(--line-strong); flex: 0 0 auto; }
    .dlg-sheet .dlg-bar { min-height: 52px; }
}

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes popOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes slideIn { from { transform: translateX(100%); } }
@keyframes slideInRtl { from { transform: translateX(-100%); } }
@keyframes slideOut { to { transform: translateX(100%); } }
@keyframes slideOutRtl { to { transform: translateX(-100%); } }
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes sheetDown { to { transform: translateY(100%); } }

/* ---------- Fact sheet ---------- */
.fs { padding: 0 0 24px; }
.fs-gallery { position: relative; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.fs-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.fs-track::-webkit-scrollbar { display: none; }
.fs-slide { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 4 / 3; max-height: 46dvh; display: grid; place-items: center; padding: 18px; border: 0; background: transparent; cursor: zoom-in; }
.fs-slide img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--r-sm); }
.fs-count, .lb-counter { direction: ltr; unicode-bidi: isolate; }
.fs-count { position: absolute; bottom: 12px; inset-inline-end: 12px; padding: 3px 10px; border-radius: var(--r-pill); background: rgba(6, 12, 23, .62); color: #fff; font-size: 12px; font-family: var(--mono); }
.fs-thumbs { display: flex; gap: 8px; padding: 10px 16px 12px; overflow-x: auto; scrollbar-width: thin; }
.fs-thumb { flex: 0 0 auto; width: 56px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 11px; background: var(--surface); overflow: hidden; opacity: .65; transition: opacity .15s, border-color .15s; }
.fs-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fs-thumb.is-current { border-color: var(--accent); opacity: 1; }
.fs-noimg { display: flex; align-items: center; justify-content: center; gap: 10px; height: 120px; color: var(--faint); font-size: 13.5px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
img.is-broken { opacity: 0; }

.fs-head { padding: 22px 20px 6px; }
.fs-name { font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -.015em; overflow-wrap: anywhere; }
[dir="rtl"] .fs-name { letter-spacing: 0; }
.fs-ename { margin-top: 4px; color: var(--muted); font-size: 14.5px; overflow-wrap: anywhere; }

.fs-ids { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; padding: 14px 20px 4px; }
.id-tile { position: relative; display: grid; gap: 2px; padding: 10px 44px 10px 12px; padding-inline: 12px 44px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.id-label { font-size: 11.5px; color: var(--muted); }
.id-value { font-family: var(--mono); font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; unicode-bidi: plaintext; }
.id-copy { position: absolute; top: 50%; inset-inline-end: 6px; transform: translateY(-50%); width: 32px; height: 32px; }
.id-copy.is-done { color: var(--ok); }

.fs-section { padding: 22px 20px 0; }
.fs-section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
[dir="rtl"] .fs-section-title { letter-spacing: 0; font-size: 13px; }
.fs-section-title .i { width: 16px; height: 16px; }

.price-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.price-tile { padding: 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.price-tile:first-child { background: linear-gradient(160deg, var(--brand-soft) 0%, var(--surface-2) 100%); border-color: var(--brand-soft-2); }
.price-label { font-size: 12.5px; color: var(--muted); }
.price-value { margin-top: 2px; font-family: var(--mono); font-size: 21px; font-weight: 500; letter-spacing: -.01em; direction: ltr; text-align: start; }
[dir="rtl"] .price-value { text-align: end; }

.kv { display: grid; border-radius: var(--r); border: 1px solid var(--line); overflow: hidden; }
.kv-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 14px; font-size: 14px; }
.kv-row + .kv-row { border-top: 1px solid var(--line); }
.kv-key { color: var(--muted); }
.kv-val { font-weight: 500; text-align: end; overflow-wrap: anywhere; }

.list-links { display: grid; gap: 8px; }
.link-row {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 60px;
    border: 1px solid var(--line); border-radius: var(--r); color: var(--text); background: var(--surface);
    transition: border-color .15s, background .15s;
}
.link-row:hover { border-color: var(--line-strong); background: var(--surface-2); }
.link-badge { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-family: var(--mono); font-size: 10.5px; font-weight: 600; text-transform: uppercase; }
.link-text { display: grid; min-width: 0; flex: 1; }
.link-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row > .i:last-child { color: var(--faint); }

.fs-skel { padding: 0 0 20px; }
.fs-skel .skel-media { height: 260px; border-radius: 0; }

/* ---------- Balances ---------- */
.bal-item { padding: 16px 20px 0; }
.bal-item-name { font-weight: 600; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.bal-item-ids { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bal-item-ids .chip { font-family: var(--mono); font-weight: 400; font-size: 12px; }
.bal-summary {
    position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin: 16px 20px 6px; padding: 18px; border-radius: var(--r-lg);
    background: linear-gradient(150deg, #1A2540 0%, #0A0F1A 100%); color: #F1ECE2; overflow: hidden;
}
.bal-summary::before { content: ""; position: absolute; inset-inline: 18px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--edge), transparent); }
.bal-total-label { font-size: 12.5px; color: #C2B49A; }
.bal-total { font-family: var(--mono); font-size: 32px; font-weight: 500; line-height: 1.15; letter-spacing: -.02em; direction: ltr; }
.bal-total small { font-family: var(--font); font-size: 14px; color: #C2B49A; margin-inline-start: 6px; letter-spacing: 0; }
.bal-meta { display: grid; justify-items: end; gap: 2px; font-size: 12.5px; color: #C2B49A; text-align: end; }
.bal-list { padding: 8px 12px 16px; }
.bal-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 8px; }
.bal-row + .bal-row { border-top: 1px solid var(--line); }
.bal-store { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 500; }
.bal-store span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bal-store .i { color: var(--muted); }
.bal-qty { font-family: var(--mono); font-size: 16px; font-weight: 500; direction: ltr; text-align: end; }
.bal-bar { grid-column: 1 / -1; height: 5px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.bal-bar i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: linear-gradient(90deg, #B9772A, var(--edge)); transform-origin: left; animation: grow .6s var(--ease-out) both; }
[dir="rtl"] .bal-bar i { transform-origin: right; }
@keyframes grow { from { transform: scaleX(0); } }
.bal-row.is-zero .bal-qty, .bal-row.is-zero .bal-store { color: var(--faint); }
.bal-row.is-negative .bal-qty { color: var(--bad); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 500; flex: 0 0 auto; }
.tag-muted { background: var(--surface-3); color: var(--muted); }
.tag-bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- Scanner ---------- */
.dlg-scanner { margin: auto; width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); border-radius: var(--r-xl); background: #050A13; color: #E7EDF6; overflow: hidden; }
.dlg-scanner[open] { animation: popIn .26s var(--ease-out) both; }
.dlg-scanner .dlg-bar { border-color: rgba(255, 255, 255, .08); }
.dlg-scanner .btn-icon { color: #DCE6F2; }
.dlg-scanner .btn-icon:hover { background: rgba(255, 255, 255, .08); }
.dlg-scanner .btn-icon[aria-pressed="true"] { color: #FFD45C; }
.scanner-stage { position: relative; aspect-ratio: 4 / 3; background: radial-gradient(circle at 50% 40%, #182238, #04070D); overflow: hidden; }
.scan-region { position: absolute; inset: 0; }
.scan-region video { width: 100% !important; height: 100% !important; object-fit: cover; }
.scan-region img, .scan-region #qr-shaded-region { display: none !important; }
.scan-frame { position: absolute; inset: 22% 12%; pointer-events: none; }
.scan-frame i { position: absolute; width: 28px; height: 28px; border: 3px solid var(--edge); filter: drop-shadow(0 0 6px rgba(245, 179, 66, .6)); }
.scan-frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.scan-frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 10px; }
.scan-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 10px; }
.scan-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }
.scan-line { position: absolute; inset-inline: 8px; top: 50%; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--edge), transparent); box-shadow: 0 0 12px rgba(245, 179, 66, .8); animation: scanline 2.2s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { transform: translateY(-46px); opacity: .6; } 50% { transform: translateY(46px); opacity: 1; } }
.dlg-scanner:not(.is-live) .scan-frame { opacity: .35; }
.dlg-scanner:not(.is-live) .scan-line { animation: none; opacity: 0; }
.scan-status { position: absolute; inset-inline: 16px; bottom: 14px; padding: 9px 14px; border-radius: var(--r); background: rgba(5, 10, 19, .72); color: #DCE6F2; font-size: 13.5px; text-align: center; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.scan-status:empty { display: none; }
.scan-manual { padding: 16px 16px calc(16px + var(--safe-b)); }
.scan-manual .label { color: #9FB1C8; }
.scan-manual-row { display: flex; gap: 8px; }
.scan-manual .input { height: 48px; padding-inline: 14px; background: #0E1A2C; border-color: rgba(255, 255, 255, .12); color: #fff; font-family: var(--mono); }
.scan-manual .btn { --h: 48px; }
@media (max-width: 640px) {
    .dlg-scanner { position: fixed; inset: 0; width: 100%; max-height: none; height: 100dvh; margin: 0; border-radius: 0; }
    .dlg-scanner .dlg-bar { padding-top: calc(8px + var(--safe-t)); }
    .scanner-stage { flex: 1; aspect-ratio: auto; }
}

/* ---------- Lightbox ---------- */
.dlg-lightbox { position: fixed; inset: 0; width: 100vw; height: 100dvh; margin: 0; background: rgba(3, 7, 14, .96); box-shadow: none; }
.dlg-lightbox[open] { animation: fade .2s ease both; }
.dlg-lightbox::backdrop { background: transparent; }
.lb-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; scroll-snap-align: center; display: grid; place-items: center; padding: 64px 16px; }
.lb-slide img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-close { position: absolute; top: calc(10px + var(--safe-t)); inset-inline-end: 10px; z-index: 2; color: #fff; background: rgba(255, 255, 255, .08); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 48px; border-radius: 50%; color: #fff; background: rgba(255, 255, 255, .1); }
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.lb-prev { inset-inline-start: 14px; }
.lb-next { inset-inline-end: 14px; }
.lb-prev .i { transform: scaleX(-1); }
[dir="rtl"] .lb-prev .i { transform: none; }
[dir="rtl"] .lb-next .i { transform: scaleX(-1); }
.lb-counter { position: absolute; bottom: calc(18px + var(--safe-b)); inset-inline: 0; text-align: center; color: #B8C6D8; font-family: var(--mono); font-size: 13px; }
@media (hover: none) { .lb-nav { display: none; } }

/* ---------- Install ---------- */
.install-body { padding: 20px 22px 26px; text-align: center; }
.install-icon { margin: 4px auto 14px; border-radius: 18px; box-shadow: var(--shadow-2); }
.install-body > p { color: var(--text-2); }
.install-steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; text-align: start; }
.install-steps li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r); background: var(--surface-2); font-size: 14.5px; }
.step-ico { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; inset-inline: 0; bottom: calc(18px + var(--safe-b)); z-index: 2147483000; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
    display: flex; align-items: center; gap: 10px; max-width: 460px; padding: 12px 16px;
    border-radius: var(--r); background: #0E1A2C; color: #EAF1F8; font-size: 14px;
    box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
    animation: toastIn .3s var(--ease-out) both;
}
.toast .i { color: var(--edge); }
.toast.is-bad .i { color: #FF8A9C; }
.toast.is-out { animation: toastOut .2s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Plain pages ---------- */
.plain { display: grid; justify-items: center; align-content: center; gap: 12px; min-height: 100dvh; padding: 24px; text-align: center; }
.plain-mark { width: 96px; height: auto; margin-bottom: 8px; }
.plain h1 { font-size: 24px; font-weight: 600; }
.plain p { color: var(--muted); margin-bottom: 8px; }

/* ---------- Print (balances sheet) ---------- */
.print-area { display: none; }
@media print {
    body.is-printing > *:not(.print-area) { display: none !important; }
    body.is-printing .print-area { display: block; color: #000; font-family: var(--font); }
    .print-area h1 { font-size: 18px; margin-bottom: 4px; }
    .print-area p { font-size: 12px; color: #444; margin-bottom: 14px; }
    .print-area table { width: 100%; border-collapse: collapse; font-size: 13px; }
    .print-area th, .print-area td { padding: 7px 8px; border-bottom: 1px solid #ccc; text-align: start; }
    .print-area .n { text-align: end; font-family: var(--mono); }
    .print-area tfoot th { border-top: 2px solid #000; border-bottom: 0; }
}

/* ---------- Motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
