/* ============================================================
   Lime Ledger — design tokens
   A modern fintech/analytics-dashboard aesthetic: near-black surfaces
   with a lime-green accent, rounded cards, a pill-shaped active sidebar
   item, and a neon-lime hero gradient reserved for one dashboard card.
   Dark mode is the DEFAULT for this theme (:root) - light mode
   (`[data-theme="light"]`) darkens the lime for contrast on white.
   ============================================================ */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibmplexsans-var.woff2") format("woff2");
  /* Widened from "400 600" to test whether the underlying variable-font file actually carries
     heavier masters (the login redesign wants an 800-weight headline) - verified visually before
     committing to this; see the reskin report for the outcome. If the file's true axis tops out
     below 800, the browser clamps to whatever it has - this range is only ever a ceiling. */
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibmplexmono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibmplexmono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {   /* dark is default for Lime Ledger */
  /* Without this, a browser whose OS is set to dark mode can silently apply its OWN native dark-mode
     text color inside inputs/textareas (ignoring the `color: var(--text)` on .form-control), since
     the page never otherwise declares which color scheme(s) it actually supports - the browser has to
     guess, and its guess can conflict with this theme's own colors. This tells it explicitly: dark
     here, light in the [data-theme="light"] block below - stop guessing. Root cause of a typed
     license key being nearly invisible (very dark text on the dark input background) despite
     `--text: #FFFFFF` being set correctly. */
  color-scheme: dark;
  --bg:        #0C0C0C;
  --surface:   #1B1B1B;
  --surface-2: #141414;
  --text:      #FFFFFF;
  --text-soft: #9C9C9C;
  --rule:      #2A2A2A;
  --input-bg:  #1E1E1E;
  --accent:        #BBE663;
  --accent-strong: #00FF26;
  /* Hover/active darkening of the lime accent - not part of the brief's raw token list, but the
     existing .btn-primary:hover/:active rules key off it, same as the old theme. */
  --accent-hover:  #A6DB4C;
  --on-accent:     #0C0C0C;
  --gold:      var(--accent); /* legacy alias (sidebar-brand/rule/row-focused edge) - now just lime */
  --credit: #3FBF60;
  --debit:  #E0576B;
  --error:  #E0576B;
  --highlight: #23271A;
  --sidebar:             var(--surface-2);
  --sidebar-text:        var(--text-soft);
  --sidebar-active-bg:   var(--accent);
  --sidebar-active-text: var(--on-accent);
  --sidebar-hover-bg:  rgba(255, 255, 255, .06);
  --sidebar-hover-text: var(--text);
  --sidebar-rule:      rgba(255, 255, 255, .06);

  --shadow:       0 1px 2px rgba(0, 0, 0, .35);
  --shadow-hover: 0 2px 8px rgba(0, 0, 0, .5);
  --shadow-modal: 0 12px 32px rgba(0, 0, 0, .6);
  --backdrop:     rgba(0, 0, 0, .55);

  --radius-card:  16px;
  --radius-input: 10px;
  --radius-pill:  8px;

  --pill-good-bg: #16321F;
  --pill-warn-bg: #332A12;
  --pill-bad-bg:  #331716;

  /* Sales vs Purchases dashboard chart - primary series lime, secondary muted (per brief: "save
     lime for accents/actions", so the second series stays --text-soft rather than a second hue). */
  --chart-1: var(--accent);
  --chart-2: var(--text-soft);

  /* Raw components, so rgba()/box-shadow can tint by token without a duplicate literal per mode. */
  --text-rgb:      255, 255, 255;
  --text-soft-rgb: 156, 156, 156;
  --accent-rgb:    187, 230, 99;
  --credit-rgb:    63, 191, 96;
  --debit-rgb:     224, 87, 107;
  --error-rgb:     224, 87, 107;

  --focus-ring: rgba(var(--accent-rgb), .18);

  --font-display: var(--font-body);
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Cascadia Code", Consolas, "Roboto Mono", monospace;

  /* Retarget Bootstrap's own tokens so its utility classes (text-primary, text-dark, text-muted,
     border-danger, etc.) pick up this palette instead of Bootstrap's default blue/grey. */
  --bs-primary: var(--accent);       --bs-primary-rgb: var(--accent-rgb);
  --bs-danger:  var(--error);        --bs-danger-rgb: var(--error-rgb);
  --bs-success: var(--credit);       --bs-success-rgb: var(--credit-rgb);
  --bs-secondary: var(--text-soft);  --bs-secondary-rgb: var(--text-soft-rgb);
  --bs-dark: var(--text);            --bs-dark-rgb: var(--text-rgb);
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-body-font-family: var(--font-body);
  --bs-font-sans-serif: var(--font-body);
  --bs-font-monospace: var(--font-mono);
}

[data-theme="light"] {
  color-scheme: light;
  --bg:        #F4F4F2;
  --surface:   #FFFFFF;
  --surface-2: #FFFFFF;
  --text:      #141414;
  /* Brief specified #7A7A7A; measured contrast against --bg (#F4F4F2) is 3.90:1 (fails WCAG AA's
     4.5:1 for normal text - this label/secondary-text color is used well below the "large text"
     size threshold). Darkened to #6B6B6B, which clears 4.5:1 (4.84:1) against --bg and --surface -
     see the accessibility note in the reskin report for the full contrast audit. */
  --text-soft: #6B6B6B;
  --rule:      #E7E7E4;
  --input-bg:  #F1F1EE;
  /* Raw lime (#BBE663) fails contrast on white, per the brief's own note - darkened for light mode. */
  --accent:        #4B7F1E;
  /* Brief specified #2E9E3B for accent-strong; at the far end of the hero-card gradient, white
     on-accent text against it measures 3.47:1 (fails 4.5:1 for the card's small uppercase label,
     though it clears 3:1 for the large stat number). Darkened to #227A2E (5.40:1) so BOTH ends of
     the lime -> accent-strong gradient stay AA-safe for on-accent text at any size. */
  --accent-strong: #227A2E;
  --accent-hover:  #3D6A18;
  --on-accent:     #FFFFFF;
  --gold:      var(--accent);
  --credit: #1E7A45;
  --debit:  #C0392B;
  --error:  #C0392B;
  --highlight: #EEF4E2;
  --sidebar:             var(--surface-2);
  --sidebar-text:        var(--text-soft);
  --sidebar-active-bg:   var(--accent);
  --sidebar-active-text: var(--on-accent);
  --sidebar-hover-bg:  rgba(0, 0, 0, .04);
  --sidebar-hover-text: var(--text);
  --sidebar-rule:      rgba(0, 0, 0, .06);

  --shadow:       0 1px 2px rgba(0, 0, 0, .05);
  --shadow-hover: 0 2px 8px rgba(20, 20, 20, .08);
  --shadow-modal: 0 12px 32px rgba(20, 20, 20, .18);
  --backdrop:     rgba(20, 20, 20, .35);

  --pill-good-bg: #E3F0D2;
  --pill-warn-bg: #F6EFDD;
  --pill-bad-bg:  #FBEAE7;

  --chart-1: var(--accent);
  --chart-2: var(--text-soft);

  --text-rgb:      20, 20, 20;
  --text-soft-rgb: 107, 107, 107;
  --accent-rgb:    75, 127, 30;
  --credit-rgb:    30, 122, 69;
  --debit-rgb:     192, 57, 43;
  --error-rgb:     192, 57, 43;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
}

h1, h2, h3, .page-title { font-family: var(--font-display); font-weight: 600; text-wrap: balance; color: var(--text); }

/* .card-title only ever set margin-bottom, relying on whatever heading LEVEL each card happened to
   use (h5 by convention) for its size. Fixing the Company/Select outline (h1 page title -> h2 card
   titles, no skipped level) would otherwise pick up Bootstrap's own h2 default (2rem) plus the bold
   display-font rule above - pin the size explicitly so retagging a heading is a pure semantic/a11y
   fix, never a visual one. */
.card-title { font-size: 1.25rem; font-weight: 600; }

code, .mono, .amount, .qty, table td.num, table th.num, .file-tree, .term {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

::selection { background: var(--highlight); }

:focus-visible {
  outline: none;
}

.btn:focus-visible, a:focus-visible, .form-control:focus-visible, .form-select:focus-visible, [tabindex]:focus-visible {
  box-shadow: 0 0 0 3px var(--focus-ring);
  border-radius: var(--radius-input);
}

.text-muted { color: var(--text-soft) !important; }

/* ---------- Field label convention ---------- */

.field-label, label.form-label {
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  font-weight: 600;
  margin-bottom: 0.3rem;
  display: inline-block;
}

/* ---------- Buttons ---------- */

.btn { border-radius: var(--radius-input); font-family: var(--font-body); font-weight: 600; font-size: 0.86rem; transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover, .btn-primary:active { background: var(--accent-hover) !important; border-color: var(--accent-hover) !important; color: var(--on-accent) !important; }
.btn-primary:disabled { background: var(--rule); border-color: var(--rule); color: var(--text-soft); opacity: 1; }

.btn-outline-secondary, .btn-secondary {
  background: var(--surface);
  border: 1px solid var(--rule);
  color: var(--text);
}
.btn-outline-secondary:hover { background: var(--highlight); border-color: var(--rule); color: var(--text); }

.btn-outline-danger, .btn-danger {
  background: var(--surface);
  border: 1px solid var(--error);
  color: var(--error);
}
.btn-outline-danger:hover { background: var(--error); color: var(--on-accent); }

.btn-success { background: var(--credit); border-color: var(--credit); color: var(--on-accent); }
.btn-success:hover { background: color-mix(in srgb, var(--credit) 82%, black); border-color: color-mix(in srgb, var(--credit) 82%, black); }

/* ---------- Inputs ---------- */

.form-control, .form-select {
  background: var(--input-bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-input);
  /* !important confirmed necessary, not just defensive: Bootstrap's own .form-control rule
     (bootstrap.min.css) hardcodes color:#212529 at the exact same selector/specificity as this rule,
     and despite site.css loading after bootstrap.css in _Layout.cshtml, the browser was still
     resolving to Bootstrap's color (confirmed by inspecting document.styleSheets directly - both
     rules present, neither !important, site.css's `background` DID win at the same specificity, but
     `color` didn't) - typed text in any textarea/input was rendering in Bootstrap's dark gray
     (#212529) instead of this theme's --text, nearly invisible against the dark input background. */
  color: var(--text) !important;
  font-family: var(--font-body);
  font-size: 0.9rem;
}

/* Bootstrap bakes its own dropdown-arrow SVG into .form-select with a hardcoded dark-gray stroke
   (#343a40) - invisible against this theme's dark --input-bg, which is exactly why a select looked
   indistinguishable from a plain text input. Redrawn here in --text-soft's actual color per theme
   (can't reference a CSS variable inside a data-URI SVG) so the arrow is always visible, and made
   large/high-contrast enough that "this field has a dropdown" reads at a glance without focusing it. */
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%239C9C9C' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5L6 6.5L11 1.5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 12px 8px;
  padding-right: 2.25rem;
}
[data-theme="light"] .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236B6B6B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5L6 6.5L11 1.5'/%3E%3C/svg%3E") !important;
}

.form-control:focus, .form-select:focus {
  /* Bootstrap's own .form-control:focus hardcodes background-color:#fff at the same specificity
     as this rule (one class + :focus) - harmless in the old theme, whose light input background
     was already white, but it silently punches a bright-white hole in a focused dark-mode input
     unless repeated here. */
  background-color: var(--input-bg);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.is-invalid, .form-control.is-invalid { border-color: var(--error); }
.invalid-feedback, .text-danger { color: var(--error) !important; font-size: 0.78rem; }

/* Chromium/WebKit paint autofilled fields with their own yellow/blue background, ignoring
   `background`, so a saved username/password otherwise shows a jarring off-theme tint (visible on
   the login form). The inset box-shadow trick repaints that layer with the theme's input surface;
   the absurd transition delay stops the browser's own color from flashing in first. */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset;
  box-shadow: 0 0 0 1000px var(--input-bg) inset;
  transition: background-color 9999s ease-in-out 0s;
}

/* ---------- App shell ---------- */

.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 216px;
  flex-shrink: 0;
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

/* Scoped to NOT overlap the <992px mobile off-canvas sidebar below - that range needs its full,
   uncollapsed width when slid open, not this auto-narrow treatment. */
@media (min-width: 992px) and (max-width: 1100px) {
  .app-sidebar { width: 64px; }
  .app-sidebar .nav-label, .app-sidebar .sidebar-brand .brand-name, .app-sidebar .sidebar-brand .rule, .app-sidebar .sidebar-company { display: none; }
  .app-sidebar summary::after { display: none; }
}

/* ---------- Sidebar collapse/expand toggle ---------- */

.sidebar-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text);
  cursor: pointer;
}
.sidebar-toggle-btn svg { width: 18px; height: 18px; }
.sidebar-toggle-btn:hover { background: #e2e8f0; }
[data-theme="dark"] .sidebar-toggle-btn { background: #1e2b23; border-color: #2a3830; }
[data-theme="dark"] .sidebar-toggle-btn:hover { background: #263a2e; }

/* Desktop (>=992px): body.sb-collapsed narrows the sidebar to icons-only. Scoped inside the
   min-width media query so a stale class from a previous wide-window session never fights the
   mobile off-canvas rules below if the window is later resized narrow. */
@media (min-width: 992px) {
  body.sb-collapsed .app-sidebar { width: 70px; }
  body.sb-collapsed .app-sidebar .nav-label,
  body.sb-collapsed .app-sidebar .sidebar-brand .brand-name,
  body.sb-collapsed .app-sidebar .sidebar-brand .rule,
  body.sb-collapsed .app-sidebar .sidebar-company { display: none; }
  body.sb-collapsed .app-sidebar summary::after { display: none; }
  body.sb-collapsed .app-sidebar .sidebar-nav .sub-nav { display: none; }
  body.sb-collapsed .app-sidebar .sidebar-nav a,
  body.sb-collapsed .app-sidebar .sidebar-nav summary { justify-content: center; padding-left: 0; padding-right: 0; }
}

/* Mobile (<992px): sidebar becomes a fixed off-canvas panel sliding in from the left, full width,
   with a dark backdrop behind it. app-shell is a flexbox layout (not a fixed-sidebar+margin one),
   so no separate "main content margin" adjustment is needed on desktop - flex reflows automatically
   when the sidebar's width itself changes. */
.sidebar-overlay { display: none; }
@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1050;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.25);
  }
  .app-sidebar.mobile-open { transform: translateX(0); }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .sidebar-overlay.active { display: block; opacity: 1; pointer-events: auto; }
}

.app-sidebar .sidebar-brand {
  padding: 1.1rem 1.1rem 0.9rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--sidebar-rule);
}

.app-sidebar .sidebar-brand .brand-row { display: flex; align-items: center; gap: 0.6rem; }

/* Brand mark: small rounded square, lime -> neon gradient, dark initials - kept subtle (the
   full company name stays plain --text; only this compact mark carries the accent color). */
.app-sidebar .sidebar-brand .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--on-accent);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* A real uploaded logo, wherever it stands in for the "AK" mark - same box, no gradient behind it
   (would show through a transparent PNG/SVG), image scaled to fit without distortion. */
.brand-logo-img {
  background: none !important;
  object-fit: contain;
  padding: 2px;
}

.app-sidebar .sidebar-brand .rule {
  width: 32px;
  height: 3px;
  background: var(--gold);
  margin-top: 0.5rem;
}

.app-sidebar .sidebar-nav { flex: 1; padding: 0.6rem; font-size: 0.82rem; }

.app-sidebar .sidebar-nav a, .app-sidebar .sidebar-nav summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-pill);
  color: var(--sidebar-text);
  text-decoration: none;
  cursor: pointer;
  list-style: none;
}
.app-sidebar .sidebar-nav summary::-webkit-details-marker { display: none; }
.app-sidebar .sidebar-nav a:hover, .app-sidebar .sidebar-nav summary:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-hover-text); }
.app-sidebar .sidebar-nav a.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600; }
.app-sidebar .sidebar-nav details[open] > summary { color: var(--sidebar-hover-text); }
.app-sidebar .sidebar-nav details .sub-nav { padding-left: 1.6rem; }
.app-sidebar .sidebar-nav details .sub-nav a { font-size: 0.8rem; padding: 0.4rem 0.7rem; }
.app-sidebar .sidebar-nav svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.9; }

.app-sidebar .sidebar-footer {
  padding: 0.8rem 1.1rem;
  font-size: 0.72rem;
  color: var(--sidebar-text);
  border-top: 1px solid var(--sidebar-rule);
}

.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.app-topbar {
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}

.topbar-left { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.topbar-company { font-weight: 600; font-size: 0.9rem; color: var(--text); background: none; border: none; padding: 0.3rem 0.5rem; border-radius: var(--radius-input); }
.topbar-company:hover { background: var(--highlight); }
.fy-badge { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-soft); background: var(--bg); border: 1px solid var(--rule); border-radius: 99px; padding: 0.15rem 0.55rem; }

.search-trigger {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-input);
  padding: 0.32rem 0.6rem;
  color: var(--text-soft);
  font-size: 0.8rem;
  cursor: pointer;
}
.search-trigger kbd { font-family: var(--font-mono); font-size: 0.68rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: 0.05rem 0.3rem; }

.topbar-user { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; color: var(--text-soft); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-input);
  color: var(--text-soft);
  cursor: pointer;
}
.theme-toggle:hover { background: var(--highlight); color: var(--text); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: inline-block; }

.app-content { flex: 1; padding: 1.5rem; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ---------- Page header ---------- */

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-header h1, .page-header h2, .page-header h3 { font-size: 22px; margin: 0; }
.page-header .subtitle { color: var(--text-soft); font-size: 0.85rem; margin-top: 0.2rem; }

/* ---------- Cards ---------- */

.card { border: 1px solid var(--rule); border-radius: var(--radius-card); box-shadow: var(--shadow); background: var(--surface); }
/* min-height is deliberate, not cosmetic: Bootstrap's row/col grid only equalises card height
   among items SHARING a row (align-items: stretch). Whenever the company count is an exact
   multiple of 4, the "+ New Company" tile is the sole item on a new row with nothing left to
   stretch against, and collapses to its own (much shorter) content height - this recurs for any
   install with 4, 8, 12... companies, so a per-row CSS trick can't prevent it; only an explicit
   floor height can. ~150px matches a real company card's own stack (name + GSTIN + state + button
   + card-body padding), so cards look identical whether or not they share a row. */
.card-link-hover { transition: box-shadow 120ms ease, border-color 120ms ease; width: 100%; min-height: 9.5rem; box-sizing: border-box; }
.card-link-hover:hover { border-color: var(--accent); box-shadow: var(--shadow-hover); }

/* A long uppercase identifier (GSTIN, PAN) is correct to KEEP uppercase - it's a real legal
   registration number, not a stylistic choice, and lower-casing it would misrepresent the value.
   Monospace + a touch of tracking is what actually helps an all-caps alphanumeric string scan
   faster, without changing the text itself. */
.id-code { font-family: var(--font-mono); letter-spacing: 0.02em; }

/* Bootstrap's default switch (~28x14px) is well under any reasonable click/tap-target size.
   #backupOnlineToggle is the only role="switch" in the app, so this is scoped to it rather than
   changing every .form-switch checkbox site-wide. */
#backupOnlineToggle.form-check-input {
  width: 2.75rem;   /* 44px */
  height: 1.5rem;   /* 24px */
}

/* Keyboard position marker (page-keynav.js sets .kb-active as the arrows move). A ring rather than
   a background, because a stop can be a whole card, a button or a switch, and "where am I" has to
   read the same on all three - and has to survive against the card's own border. */
[data-ams-card] { outline: none; }
[data-ams-card].kb-active,
[data-ams-card]:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.card[data-ams-card].kb-active,
.card[data-ams-card]:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover), 0 0 0 2px var(--accent);
}

/* The key that presses each page-header action, printed ON the button by page-keynav.js. Muted so
   it reads as a hint rather than part of the label, and lit up while Alt is held. Deliberately
   always visible: a shortcut the user cannot see is a shortcut that does not exist. */
.kb-altnum {
  display: inline-block; margin-left: 0.4rem; padding: 0 0.28rem; border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.66rem;
  line-height: 1.6; vertical-align: middle; font-weight: 500; opacity: 0.72;
  background: rgba(127, 127, 127, 0.22); color: inherit;
}
html.kb-alt .kb-altnum { opacity: 1; background: var(--accent); color: var(--surface); }
@media (max-width: 640px) { .kb-altnum { display: none; } }   /* no keyboard to shortcut with */

/* ---------- Stat cards (dashboard) ---------- */

.stat-card { border: 1px solid var(--rule); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow); padding: 1rem 1.2rem; }
.stat-card .stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-soft); font-weight: 600; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 32px; font-weight: 600; margin-top: 0.15rem; color: var(--text); }
.stat-card .stat-value.debit { color: var(--debit); }
.stat-card .stat-value.credit { color: var(--credit); }

/* Single "hero" treatment - apply to exactly ONE dashboard stat card (the headline metric), never
   to every card: a lime -> neon gradient background with dark/on-accent text. */
.stat-card.hero { background: linear-gradient(135deg, var(--accent), var(--accent-strong)); border-color: transparent; }
.stat-card.hero .stat-label, .stat-card.hero .stat-value { color: var(--on-accent); }

/* ---------- Tables ---------- */

.table-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow); }
.table-card .table { margin-bottom: 0; }

table.table { font-size: 0.86rem; color: var(--text); }
table.table thead th {
  background: var(--bg);
  color: var(--text-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  border-bottom: 1px solid var(--rule);
  border-radius: 0 !important;
}
table.table td, table.table th { border-color: var(--rule); border-radius: 0 !important; vertical-align: middle; height: 38px; padding-top: 0.4rem; padding-bottom: 0.4rem; }
/* Bootstrap's own .table-hover paints BOTH the background and the text on hover, through
   --bs-table-bg-state / --bs-table-color-state, and its hover colour resolves to a near-black
   emphasis colour. Setting only `background` here left that text colour untouched, so on the dark
   theme (:root, where --highlight is #23271A) every hovered row turned dark text on a dark fill and
   the row appeared to go blank - on every list screen in the app. Drive Bootstrap's own two
   variables instead of fighting them, and set colour alongside the fill so the row stays readable
   in both themes. The `> *` is required: Bootstrap applies the state variables to the CELLS, not
   the row, so a rule on <tr> alone is simply overridden. */
table.table tbody tr:hover > *,
table.table tbody tr.row-focused > * {
    --bs-table-bg-state: var(--highlight);
    --bs-table-color-state: var(--text);
    background-color: var(--highlight);
    color: var(--text);
}

/* Tally's signature selection bar: the focused/keyboard-navigated row gets a lime-tinted highlight
   fill plus a solid lime left edge - keep this readable at a glance from across the room. */
table.table tbody tr.row-focused { box-shadow: inset 3px 0 0 var(--gold); }

.col-dr, .col-cr { border-left: 1px solid var(--rule); }
td.amount, th.amount, .text-end.mono { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.amount.debit, .dr-value { color: var(--debit); }
.amount.credit, .cr-value { color: var(--credit); }

/* ---------- Ledger Bar (signature component) ---------- */

.ledger-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  height: 44px;
  background: var(--surface);
  border-top: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  box-shadow: var(--shadow-modal);
  transition: background-color 200ms ease;
}

.ledger-bar .lb-left { display: flex; align-items: center; gap: 1.25rem; color: var(--text-soft); }
.ledger-bar .lb-voucher-no { color: var(--text); font-weight: 500; }
.ledger-bar .lb-totals { display: flex; align-items: center; gap: 1.25rem; }
.ledger-bar .lb-diff.ok { color: var(--credit); font-weight: 600; }
.ledger-bar .lb-diff.bad { color: var(--error); font-weight: 600; }
.ledger-bar .lb-status { color: var(--text-soft); font-family: var(--font-body); font-size: 0.78rem; }
.ledger-bar.flash-save { background: var(--highlight); }
.ledger-bar .lb-save-btn { padding: 0.3rem 1rem; }

@media (prefers-reduced-motion: reduce) {
  .ledger-bar, .btn, .card-link-hover, table.table tbody tr { transition: none !important; }
}

/* ---------- Auth (split-screen login) ---------- */

.login-split { min-height: 100vh; display: flex; }

/* Left panel: brand/value story. Hidden below 900px - see the media query at the end of this
   section - the sign-in card then becomes the entire experience. */
.login-brand-panel {
  flex: 0 0 55%;
  position: relative;
  overflow: hidden;
  padding: 3rem 3.5rem;
  display: flex;
  background: linear-gradient(160deg, var(--surface-2) 0%, var(--bg) 60%);
}
.login-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(var(--accent-rgb), 0.16), transparent 55%),
    radial-gradient(circle at 85% 85%, rgba(var(--accent-rgb), 0.10), transparent 50%);
  pointer-events: none;
}

.brand-panel-inner {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.5rem;
}

.brand-panel-top .brand-row { display: flex; align-items: center; gap: 0.7rem; }
.brand-mark-lg {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
}
.brand-wordmark { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--text); }
.brand-tagline { margin-top: 0.6rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-soft); font-weight: 600; }

.brand-panel-mid h1 { font-size: clamp(1.7rem, 2.6vw, 2.15rem); font-weight: 800; line-height: 1.18; margin: 0 0 0.9rem; letter-spacing: -0.01em; text-wrap: balance; }
.brand-panel-mid > p { color: var(--text-soft); font-size: 0.96rem; line-height: 1.6; max-width: 42ch; margin: 0 0 2rem; }

.feature-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.75rem; }
.feature-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  padding: 0.75rem 1rem;
}
.feature-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
}
.feature-icon svg { width: 17px; height: 17px; }
.feature-text { display: flex; flex-direction: column; font-size: 0.84rem; line-height: 1.35; }
.feature-text strong { color: var(--text); font-weight: 600; }
.feature-text span { color: var(--text-soft); font-size: 0.78rem; }

/* Illustrative widgets only - static mock numbers, not live data (see the view's own comment). */
.widget-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.widget-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  padding: 0.65rem 1rem;
}
.widget-stat-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-soft); font-weight: 600; }
.widget-stat-value { font-family: var(--font-mono); font-size: 1.05rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.widget-stat-up { color: var(--credit); font-size: 0.8rem; }

.brand-panel-footer { position: relative; color: var(--text-soft); font-size: 0.74rem; }

/* Right panel: the sign-in card itself. */
.login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal);
  padding: 2.5rem 2.25rem;
}

.auth-card .auth-brand { text-align: center; margin-bottom: 1.75rem; }

.auth-card .auth-brand .brand-mark {
  width: 44px;
  height: 44px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--on-accent);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.auth-card .auth-brand h1 { font-size: 24px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.auth-card .auth-brand .tagline { color: var(--text-soft); font-size: 0.84rem; margin-top: 0.5rem; }

.auth-card .alert-danger {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: var(--pill-bad-bg);
  border: none;
  border-left: 3px solid var(--error);
  border-radius: 10px;
  color: var(--error);
  font-size: 0.84rem;
  padding: 0.8rem 1rem;
  margin-bottom: 1.25rem;
}
.auth-card .alert-danger svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 0.1rem; }
.auth-card .alert-danger ul { list-style: none; margin: 0; padding: 0; }
.auth-card .alert-danger li + li { margin-top: 0.25rem; }

/* Icon-adorned inputs (username/password on the sign-in card). */
.field-icon-group { position: relative; }
.field-icon-group svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-soft);
  pointer-events: none;
}
.field-icon-group .form-control { padding-left: 2.5rem; }
.field-icon-group:focus-within svg { color: var(--accent); }

/* Password show/hide toggle. */
.field-icon-group.has-toggle .form-control { padding-right: 2.5rem; }
.pw-toggle {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  border-radius: 6px;
}
.pw-toggle:hover { color: var(--text); background: var(--highlight); }
.pw-toggle:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--focus-ring); }
.field-icon-group .pw-toggle svg { position: static; width: 16px; height: 16px; color: inherit; }
.pw-toggle .icon-eye-off { display: none; }
.pw-toggle.showing .icon-eye { display: none; }
.pw-toggle.showing .icon-eye-off { display: block; }

.trust-line { display: flex; align-items: center; justify-content: center; gap: 0.4rem; margin-top: 1.1rem; color: var(--text-soft); font-size: 0.76rem; }
.trust-line svg { width: 14px; height: 14px; color: var(--credit); flex-shrink: 0; }

@media (max-width: 900px) {
  .login-brand-panel { display: none; }
  .login-form-panel { flex: 1 1 100%; }
}

/* ---------- Empty states ---------- */

.empty-state { padding: 2.5rem 1rem; text-align: center; color: var(--text-soft); font-size: 14px; }
.empty-state .btn { margin-top: 0.9rem; }

/* ---------- Pills / badges ---------- */

.pill { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.7rem; font-weight: 600; padding: 0.18rem 0.55rem; border-radius: 99px; }
.pill.good { background: var(--pill-good-bg); color: var(--credit); }
.pill.warn { background: var(--pill-warn-bg); color: var(--debit); }
.pill.bad { background: var(--pill-bad-bg); color: var(--error); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- First-run setup wizard ---------- */

.setup-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2.5rem 1rem;
}
.setup-card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal);
  padding: 2.25rem 2.25rem 2.5rem;
}
.setup-header h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.4rem; }

.setup-steps { display: flex; align-items: center; margin: 1.5rem 0 0.5rem; }
.setup-step { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.setup-step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--rule);
}
.setup-step.current .setup-step-dot { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.setup-step.done .setup-step-dot { background: var(--pill-good-bg); color: var(--credit); border-color: var(--credit); }
.setup-step-label { font-size: 0.72rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.setup-step.current .setup-step-label { color: var(--text); font-weight: 600; }
.setup-step-line { flex: 1; height: 1px; background: var(--rule); margin: 0 0.5rem 1.3rem; }
.setup-step-line.done { background: var(--credit); }

/* ---------- License renewal banner ---------- */

.license-banner {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 1.25rem;
  background: var(--pill-warn-bg);
  color: var(--text);
  font-size: 0.82rem;
  border-bottom: 1px solid var(--rule);
}
.license-banner a { color: var(--accent); font-weight: 600; margin-left: auto; }

/* ---------- Command palette (Ctrl+K) ---------- */

.cmdk-backdrop {
  position: fixed; inset: 0; background: var(--backdrop); z-index: 90;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh;
}
.cmdk-panel {
  width: 100%; max-width: 560px; background: var(--surface); border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal); border: 1px solid var(--rule); overflow: hidden;
}
.cmdk-input { width: 100%; border: none; border-bottom: 1px solid var(--rule); padding: 0.9rem 1.1rem; font-size: 0.95rem; font-family: var(--font-body); outline: none; background: var(--surface); color: var(--text); }
.cmdk-results { max-height: 320px; overflow-y: auto; padding: 0.4rem; }
.cmdk-item { display: flex; justify-content: space-between; padding: 0.55rem 0.8rem; border-radius: var(--radius-input); cursor: pointer; font-size: 0.86rem; color: var(--text); text-decoration: none; }
.cmdk-item:hover, .cmdk-item.active { background: var(--highlight); }
.cmdk-item .cmdk-hint { color: var(--text-soft); font-family: var(--font-mono); font-size: 0.72rem; }

/* ---------- AI chat widget ---------- */

.ai-chat-widget { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 95; }

.ai-chat-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); border: none;
  box-shadow: var(--shadow-hover); cursor: pointer;
}
.ai-chat-toggle:hover { background: var(--accent-hover); }
.ai-chat-toggle svg { width: 24px; height: 24px; }

.ai-chat-panel {
  position: fixed; right: 1.5rem; bottom: 1.5rem;
  width: 360px; max-width: calc(100vw - 2rem); height: 480px; max-height: calc(100vh - 3rem);
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal); flex-direction: column; overflow: hidden;
}

.ai-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--rule);
  font-weight: 600; font-size: 0.9rem; color: var(--text);
}
.ai-chat-header span { display: flex; align-items: center; gap: 0.5rem; }
.ai-chat-header svg { width: 18px; height: 18px; color: var(--accent); }
.ai-chat-close { background: none; border: none; font-size: 1.3rem; line-height: 1; color: var(--text-soft); cursor: pointer; }
.ai-chat-close:hover { color: var(--text); }

.ai-chat-messages { flex: 1; overflow-y: auto; padding: 0.9rem; display: flex; flex-direction: column; gap: 0.6rem; }
.ai-chat-empty-hint { color: var(--text-soft); font-size: 0.82rem; text-align: center; padding: 1.5rem 0.5rem; }

.ai-chat-msg { max-width: 85%; padding: 0.5rem 0.75rem; border-radius: var(--radius-input); font-size: 0.85rem; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.ai-chat-msg-user { align-self: flex-end; background: var(--accent); color: var(--on-accent); }
.ai-chat-msg-ai { align-self: flex-start; background: var(--highlight); color: var(--text); }
.ai-chat-msg-thinking { align-self: flex-start; background: var(--highlight); color: var(--text-soft); font-style: italic; }

.ai-chat-input-row { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--rule); }
.ai-chat-input-row input {
  flex: 1; border: 1px solid var(--rule); border-radius: var(--radius-input); background: var(--input-bg);
  color: var(--text); padding: 0.45rem 0.7rem; font-size: 0.85rem; font-family: var(--font-body); outline: none;
}
.ai-chat-input-row input:focus { border-color: var(--accent); }
.ai-chat-input-row button {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-input);
  background: var(--accent); color: var(--on-accent); border: none; cursor: pointer; flex-shrink: 0;
}
.ai-chat-input-row button:hover { background: var(--accent-hover); }
.ai-chat-input-row button:disabled { opacity: 0.6; cursor: default; }
.ai-chat-input-row button svg { width: 16px; height: 16px; }

/* ---------- AI Business Insights ("Analyze Now") ---------- */

.ai-insights-card { border-color: color-mix(in srgb, var(--accent) 35%, var(--rule)); }

.ai-insights-loader { display: flex; align-items: center; gap: 0.6rem; padding: 1rem 0.2rem; color: var(--text-soft); font-size: 0.85rem; }
.ai-insights-spinner {
  width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%;
  border: 3px solid var(--rule); border-top-color: var(--accent);
  animation: page-loader-spin 0.7s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .ai-insights-spinner { animation-duration: 1.6s; } }

.ai-insights-list { margin: 0.2rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.45rem; }
.ai-insights-list li { font-size: 0.88rem; line-height: 1.45; color: var(--text); }
.ai-insights-list li::marker { color: var(--accent-strong); }

.ai-insights-error { font-size: 0.8rem; padding: 0.4rem 0.8rem; margin-top: 0.6rem; }

/* ---------- Chart ---------- */

.chart-legend { display: flex; gap: 1.25rem; font-size: 0.78rem; color: var(--text-soft); margin-bottom: 0.5rem; }
.chart-legend .dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 0.35rem; }

footer.app-footer { color: var(--text-soft); font-size: 0.75rem; padding: 1rem 1.5rem; }

/* ---------- Page loader (shown while navigating or while a form submission is in flight) ---------- */

.page-loader-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--backdrop);
  display: none; align-items: center; justify-content: center;
}
.page-loader-overlay.active { display: flex; }
.page-loader-spinner {
  width: 44px; height: 44px;
  border: 4px solid var(--rule);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: page-loader-spin 0.7s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .page-loader-spinner { animation-duration: 1.6s; }
}
@keyframes page-loader-spin {
  to { transform: rotate(360deg); }
}

/* ---------- SweetAlert2 theme override (Lime Ledger tokens, both themes) ---------- */

.ams-swal-popup {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow-modal) !important;
  font-family: var(--font-body) !important;
}
.ams-swal-title { color: var(--text) !important; font-family: var(--font-display) !important; }
.ams-swal-text { color: var(--text-soft) !important; }
.ams-swal-confirm {
  background: var(--accent) !important; color: var(--on-accent) !important;
  border-radius: var(--radius-input) !important; box-shadow: none !important;
}
.ams-swal-confirm-danger {
  background: var(--error) !important; color: #fff !important;
  border-radius: var(--radius-input) !important; box-shadow: none !important;
}
.ams-swal-cancel {
  background: var(--input-bg) !important; color: var(--text) !important;
  border: 1px solid var(--rule) !important; border-radius: var(--radius-input) !important; box-shadow: none !important;
}

/* Which button the keyboard is on. Cancel had no :focus rule at all and box-shadow:none, so moving
   onto it showed nothing whatsoever - the keys worked, the user just could not see it and read that
   as "the dialog ignores the keyboard". The old confirm ring was var(--focus-ring) at .18 alpha,
   far too faint to answer "am I about to press Cancel or Yes?" on a destructive action. Two rings:
   a surface-coloured gap so the accent reads against the filled button as well as the pale one. */
.ams-swal-confirm:focus,
.ams-swal-confirm-danger:focus,
.ams-swal-cancel:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent) !important;
}

/* Spelled out inside every dialog in the app, from one place. A confirm box is exactly where a
   keyboard user is most stuck, and there is no other affordance telling them the keys exist. */
.ams-swal-popup .swal2-actions { flex-wrap: wrap !important; }
.ams-swal-popup .swal2-actions::after {
  content: "Tab or ← → move  ·  Enter press  ·  Esc cancel";
  flex-basis: 100%; order: 99; text-align: center;
  margin-top: 0.85rem; font-size: 0.72rem; color: var(--text-soft);
}

/* ---------- Role Permissions Manager (Role/Edit) + grouped Permission Modules admin ---------- */

.perm-stats { display: flex; gap: 1rem; flex-wrap: wrap; }
.perm-stats .stat-card { flex: 1; min-width: 110px; }

.perm-group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.1rem; }

.perm-group-card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-card);
  box-shadow: var(--shadow); overflow: hidden;
}
.perm-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem 1.1rem; background: var(--surface-2); border-bottom: 1px solid var(--rule);
  cursor: pointer; user-select: none;
}
.perm-group-header:hover { background: rgba(var(--accent-rgb), 0.08); }
.perm-group-name { font-weight: 700; font-size: 0.92rem; color: var(--text); }
.perm-group-count { font-size: 0.72rem; color: var(--text-soft); }
.perm-group-arrow { display: inline-block; color: var(--accent); transition: transform 0.2s; }
.perm-group-arrow.collapsed { transform: rotate(-90deg); }

.perm-col-header-row { display: flex; align-items: center; justify-content: flex-end; padding: 0.45rem 1.1rem 0.15rem; }
.perm-col-hdr { font-size: 0.65rem; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.06em; width: 46px; text-align: center; display: inline-block; }

.perm-toggles-row { display: flex; gap: 0.6rem; }

.perm-select-all-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 1.1rem; background: rgba(var(--accent-rgb), 0.06); border-bottom: 1px solid var(--rule);
}
.perm-select-all-lbl { font-size: 0.72rem; font-weight: 800; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.06em; }
.perm-select-all-row .perm-toggles-row > label { width: 46px; display: flex; justify-content: center; }

.perm-page-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.55rem 1.1rem; border-bottom: 1px solid var(--rule);
}
.perm-page-row:last-child { border-bottom: none; }
.perm-page-row:hover { background: rgba(var(--accent-rgb), 0.05); }
.perm-page-info { flex: 1; min-width: 0; padding-right: 0.6rem; }
.perm-page-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.perm-page-url { font-size: 0.7rem; color: var(--text-soft); font-family: var(--font-mono); margin-top: 0.1rem; }
.perm-page-row .perm-toggles-row > label { width: 46px; display: flex; justify-content: center; }

.perm-switch { position: relative; display: inline-block; width: 32px; height: 18px; flex-shrink: 0; }
.perm-switch input { opacity: 0; width: 0; height: 0; }
.perm-slider {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0; cursor: pointer;
  background: var(--rule); border-radius: 18px; transition: 0.2s;
}
.perm-slider::before {
  content: ""; position: absolute; width: 12px; height: 12px; left: 3px; bottom: 3px;
  background: var(--surface); border-radius: 50%; transition: 0.2s;
}
.perm-switch input:checked + .perm-slider { background: var(--accent); }
.perm-switch input:checked + .perm-slider::before { transform: translateX(14px); background: var(--on-accent); }
.perm-switch input:focus-visible + .perm-slider { box-shadow: 0 0 0 3px var(--focus-ring); }

.table-group-header th { background: var(--surface-2); border-bottom: 1px solid var(--rule); padding-top: 0.7rem; padding-bottom: 0.7rem; }

/* ---------- Permission Modules ("Add Page") admin screen ---------- */

.pm-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--rule); }
.pm-toolbar-title { font-weight: 700; font-size: 1rem; color: var(--text); }
.pm-record-badge { font-size: 0.72rem; font-weight: 700; background: rgba(var(--accent-rgb), 0.14); color: var(--accent); border-radius: 20px; padding: 2px 10px; }

.pm-module-cell { white-space: nowrap; }
.pm-module-icon { margin-right: 0.4rem; }

.pm-badge-page {
  display: inline-block; background: rgba(var(--accent-rgb), 0.12); color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.3); border-radius: 20px; padding: 2px 10px;
  font-size: 0.78rem; font-weight: 600;
}
.pm-badge-url {
  display: inline-block; background: var(--surface-2); color: var(--text-soft);
  border: 1px solid var(--rule); border-radius: 20px; padding: 2px 10px;
  font-size: 0.74rem; font-family: var(--font-mono);
}

/* Bootstrap's modal defaults to a light popup regardless of theme - re-skin it with the app's own
   tokens so it matches Lime Ledger's dark-by-default look instead of flashing white. */
.modal-content { background: var(--surface); color: var(--text); border: 1px solid var(--rule); border-radius: var(--radius-card); }
.modal-header, .modal-footer { border-color: var(--rule); }
.modal-title { color: var(--text); }
:root:not([data-theme="light"]) .btn-close { filter: invert(1) grayscale(1) brightness(1.8); }
/* ── Atomquark wordmark ──────────────────────────────────────────────────────
   Brand Guidelines v1.0 (2026) §02 "The wordmark" and §03 "Don't do this".
   Rendered by Views/Shared/_AtomquarkMark.cshtml - never hand-write the spans.

   Fixed letter colours (never reflowed, never a single flat colour, and never
   recoloured to white on dark backgrounds - guidelines are explicit on this).
   Deliberately NO outline, shadow, glow, gradient, 3-D, skew or rotation: those
   are the six documented misuses. Scale only via the size modifiers below, which
   change font-size only, so the wordmark can never be stretched non-uniformly. */
.aq-mark {
    display: inline-block;
    font-family: "Segoe UI", Calibri, Arial, Helvetica, sans-serif;
    font-weight: 800;
    letter-spacing: .045em;
    line-height: 1;
    white-space: nowrap;
    /* Guidelines: clear space of at least 1x cap-height on all sides. Cap-height is
       ~0.7em for this stack, so 0.7em of padding reserves it without needing every
       caller to remember a margin. */
    padding: .7em;
    /* Guidelines: 80px minimum digital width, below which the four-colour pattern
       stops being legible. aq-mark-sm is already ~95px wide; this is the backstop. */
    min-width: 80px;
    text-align: center;
    text-decoration: none;
    text-transform: none;
}
.aq-mark-sm { font-size: .78rem; }
.aq-mark-md { font-size: 1.05rem; }
.aq-mark-lg { font-size: 1.45rem; }

/* A-T-O blue - M yellow - Q-U green - A yellow - R-K red */
.aq-b { color: #4285F4; }
.aq-y { color: #FBBC04; }
.aq-g { color: #34A853; }
.aq-r { color: #EA4335; }

/* ============================================================
   Tally Shell — dark-navy / matching-light theme
   Any page whose Layout is _TallyLayout.cshtml (see Views/Shared/_TallyLayout.cshtml)
   renders <body class="tally-shell"> - _Layout.cshtml pages (still most of the
   app at this stage) never get this class, so they are completely unaffected.
   Reads the SAME [data-theme] attribute the existing toggle already sets on
   <html> - dark gets the navy palette below, light gets a matching palette.
   The two blocks below redeclare the SAME token names every existing component
   already consumes (--bg, --surface, --text, --accent, --rule, etc.), directly
   on <body> - a same-element rule always beats an inherited one, so this wins
   over :root/[data-theme] without needing !important or higher specificity
   tricks. That's what lets tables/cards/buttons/forms on a Tally-shell page
   re-theme automatically with zero changes to their own CSS.
   Remove this whole block (and switch each view's Layout back to "_Layout")
   to fully revert.
   ============================================================ */

body.tally-shell {
  /* Tally-only tokens (Gateway box + shell top/bottom bars) - light palette. */
  --tg-bg:            #F3F5F8;
  --tg-panel:         #FFFFFF;
  --tg-border:        #D7DEE8;
  --tg-header:        #E4ECF9;
  --tg-row-selected:  #D8E4F7;
  --tg-accent:        #2E6BC6;
  --tg-accent-bright: #2E6BC6;
  --tg-text:          #16202E;
  --tg-text-soft:     #47566B;
  --tg-muted:         #8496AD;
  --tg-bottom-bg:     #1D2938;
  --tg-bottom-text:   #E7ECF3;

  /* Re-theme every existing token-driven component to the same light palette. */
  --bg:            #F3F5F8;
  --surface:       #FFFFFF;
  --surface-2:     #FFFFFF;
  --text:          #16202E;
  --text-soft:     #47566B;
  --rule:          #D7DEE8;
  --input-bg:      #EDF1F6;
  --accent:        #2E6BC6;
  --accent-strong: #2E6BC6;
  --accent-hover:  #244F94;
  --on-accent:     #FFFFFF;
  --gold:          var(--accent);
  --credit: #1E7A45;
  --debit:  #C0392B;
  --error:  #C0392B;
  --highlight: #E4ECF9;
  --shadow:       0 1px 2px rgba(20, 20, 20, .05);
  --shadow-hover: 0 2px 8px rgba(20, 20, 20, .08);
  --shadow-modal: 0 12px 32px rgba(20, 20, 20, .18);
  --backdrop:     rgba(20, 20, 20, .35);
  --pill-good-bg: #E3F0D2;
  --pill-warn-bg: #F6EFDD;
  --pill-bad-bg:  #FBEAE7;
  --chart-1: var(--accent);
  --chart-2: var(--text-soft);
  --text-rgb:      22, 32, 46;
  --text-soft-rgb: 71, 86, 107;
  --accent-rgb:    46, 107, 198;
  --credit-rgb:    30, 122, 69;
  --debit-rgb:     192, 57, 43;
  --error-rgb:     192, 57, 43;
  --focus-ring: rgba(46, 107, 198, .18);
  --bs-primary: var(--accent);       --bs-primary-rgb: var(--accent-rgb);
  --bs-danger:  var(--error);        --bs-danger-rgb: var(--error-rgb);
  --bs-success: var(--credit);       --bs-success-rgb: var(--credit-rgb);
  --bs-secondary: var(--text-soft);  --bs-secondary-rgb: var(--text-soft-rgb);
  --bs-dark: var(--text);            --bs-dark-rgb: var(--text-rgb);
}

/* Dark navy Tally palette - exact hexes from the brief. Higher specificity than
   plain "body.tally-shell" above (html[data-theme] + body.class vs body.class
   alone), and both rules target the SAME element (body), so ordinary
   specificity decides between them - this one wins whenever data-theme="dark". */
html[data-theme="dark"] body.tally-shell {
  --tg-bg:            #0C1015;
  --tg-panel:         #13171F;
  --tg-border:        #2A3340;
  --tg-header:        #3C475A;
  --tg-row-selected:  #1D2938;
  --tg-accent:        #6BA3E8;
  --tg-accent-bright: #2E6BC6;
  --tg-text:          #FFFFFF;
  --tg-text-soft:     #D6DEE8;
  --tg-muted:         #8A97A8;
  --tg-bottom-bg:     #050304;
  --tg-bottom-text:   #D6DEE8;

  --bg:            #0C1015;
  --surface:       #13171F;
  --surface-2:     #13171F;
  --text:          #FFFFFF;
  --text-soft:     #D6DEE8;
  --rule:          #2A3340;
  --input-bg:      #0C1015;
  --accent:        #6BA3E8;
  --accent-strong: #2E6BC6;
  --accent-hover:  #5690D6;
  --on-accent:     #FFFFFF;
  --gold:          var(--accent);
  --credit: #3FBF60;
  --debit:  #E0576B;
  --error:  #E0576B;
  --highlight: #1D2938;
  --shadow:       0 1px 2px rgba(0, 0, 0, .35);
  --shadow-hover: 0 2px 8px rgba(0, 0, 0, .5);
  --shadow-modal: 0 12px 32px rgba(0, 0, 0, .6);
  --backdrop:     rgba(0, 0, 0, .55);
  --pill-good-bg: #16321F;
  --pill-warn-bg: #332A12;
  --pill-bad-bg:  #331716;
  --chart-1: var(--accent);
  --chart-2: var(--text-soft);
  --text-rgb:      255, 255, 255;
  --text-soft-rgb: 214, 222, 232;
  --accent-rgb:    107, 163, 232;
  --credit-rgb:    63, 191, 96;
  --debit-rgb:     224, 87, 107;
  --error-rgb:     224, 87, 107;
  --focus-ring: rgba(107, 163, 232, .25);
  --bs-primary: var(--accent);       --bs-primary-rgb: var(--accent-rgb);
  --bs-danger:  var(--error);        --bs-danger-rgb: var(--error-rgb);
  --bs-success: var(--credit);       --bs-success-rgb: var(--credit-rgb);
  --bs-secondary: var(--text-soft);  --bs-secondary-rgb: var(--text-soft-rgb);
  --bs-dark: var(--text);            --bs-dark-rgb: var(--text-rgb);
}

.tg-gateway {
  background: var(--tg-bg);
  border: 1px solid var(--tg-border);
  border-radius: var(--radius-card);
  color: var(--tg-text);
  font-family: var(--font-body);
  overflow: hidden;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow);
}

.tg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--tg-header);
  color: var(--tg-text);
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--tg-border);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.tg-header .tg-title { font-family: var(--font-display); font-size: 0.95rem; }
.tg-header .tg-period { font-size: 0.78rem; font-weight: 500; color: var(--tg-text-soft); font-family: var(--font-mono); }

.tg-body {
  display: grid;
  grid-template-columns: 240px 1fr 190px;
  gap: 0;
  min-height: 420px;
}
@media (max-width: 991.98px) {
  .tg-body { grid-template-columns: 1fr; }
  .tg-fkey-bar { flex-direction: row !important; flex-wrap: wrap; border-left: none !important; border-top: 1px solid var(--tg-border); }
  .tg-info-panel { border-right: none !important; border-bottom: 1px solid var(--tg-border); }
}

/* ---------- Left: company / period info panel ---------- */
.tg-info-panel {
  background: var(--tg-panel);
  border-right: 1px solid var(--tg-border);
  padding: 1rem;
  font-size: 0.8rem;
}
.tg-info-panel h6 {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--tg-muted); font-weight: 700; margin: 0 0 0.7rem;
}
.tg-info-row { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.35rem 0; border-bottom: 1px dashed var(--tg-border); }
.tg-info-row:last-child { border-bottom: none; }
.tg-info-row .tg-info-label { color: var(--tg-text-soft); }
.tg-info-row .tg-info-value { font-family: var(--font-mono); font-weight: 600; color: var(--tg-text); text-align: right; }
.tg-info-row .tg-info-value.debit { color: var(--debit); }
.tg-info-row .tg-info-value.credit { color: var(--credit); }

/* ---------- Center: the actual Gateway menu box ---------- */
.tg-menu-panel {
  background: var(--tg-panel);
  border-right: 1px solid var(--tg-border);
  display: flex;
  flex-direction: column;
}
.tg-menu-crumb {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;
  color: var(--tg-muted);
  border-bottom: 1px solid var(--tg-border);
}
.tg-menu-crumb .tg-back {
  background: none; border: none; color: var(--tg-accent); font-weight: 700; cursor: pointer;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 0;
  display: none;
}
.tg-menu-crumb.has-back .tg-back { display: inline; }

.tg-menu-level { padding: 0.5rem; flex: 1; overflow-y: auto; }
.tg-menu-level[hidden] { display: none; }

.tg-menu-row {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  color: var(--tg-text);
  text-decoration: none;
  font-size: 0.88rem;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.tg-menu-row:hover { background: var(--tg-row-selected); }
.tg-menu-row:focus-visible {
  outline: none;
  background: var(--tg-row-selected);
  box-shadow: inset 3px 0 0 var(--tg-accent-bright);
}
.tg-menu-row .tg-hint { margin-left: auto; color: var(--tg-muted); font-family: var(--font-mono); font-size: 0.7rem; }
.tg-menu-row .tg-key {
  color: var(--tg-accent);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Right: vertical F-key bar ---------- */
.tg-fkey-bar {
  background: var(--tg-panel);
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  gap: 0.25rem;
}
.tg-fkey {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-family: inherit;
  color: var(--tg-text);
  text-decoration: none;
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.tg-fkey:hover { background: var(--tg-row-selected); border-color: var(--tg-border); color: var(--tg-text); }
.tg-fkey:focus-visible { outline: none; border-color: var(--tg-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tg-accent) 35%, transparent); }
.tg-fkey .tg-fkey-code {
  font-family: var(--font-mono); font-weight: 700; font-size: 0.72rem;
  color: var(--tg-accent-bright);
  min-width: 26px;
}
.tg-fkey.tg-fkey-primary { background: var(--tg-accent-bright); border-color: var(--tg-accent-bright); }
.tg-fkey.tg-fkey-primary, .tg-fkey.tg-fkey-primary .tg-fkey-code { color: #FFFFFF; }
.tg-fkey.tg-fkey-primary:hover { background: color-mix(in srgb, var(--tg-accent-bright) 85%, black); }

/* ---------- Bottom hint bar ---------- */
.tg-bottombar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem;
  background: var(--tg-bottom-bg);
  color: var(--tg-bottom-text);
  padding: 0.45rem 1.1rem;
  font-size: 0.74rem;
  font-family: var(--font-mono);
}
.tg-bottombar .tg-hints { display: flex; gap: 1.1rem; }
.tg-bottombar .tg-hints kbd {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  margin-right: 0.3rem;
  font-family: var(--font-mono);
}
.tg-bottombar button.tg-quit {
  background: none; border: none; color: inherit; font: inherit; cursor: pointer; padding: 0;
}
.tg-bottombar button.tg-quit:hover { text-decoration: underline; }

/* ---------- Shell-wide top bar brand link (Views/Shared/_TallyLayout.cshtml) ---------- */
/* Reuses .app-topbar / .topbar-left / .topbar-user / .btn-outline-secondary as-is (already
   token-driven) - this is the one genuinely new bit, the clickable brand mark that doubles as
   the "back to Gateway" link on every Tally-shell page. */
.tg-shell-brand { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--text); flex-shrink: 0; }
.tg-shell-brand:hover { color: var(--accent); }
.tg-shell-brand .brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
  background: var(--accent-strong); color: var(--on-accent);
  font-family: var(--font-display); font-size: 0.68rem; font-weight: 700;
}
.tg-shell-brand .brand-name { font-family: var(--font-display); font-weight: 600; font-size: 0.92rem; }
@media (max-width: 700px) { .tg-shell-brand .brand-name { display: none; } }

/* ---------- AI Analysis, relocated into a Gateway menu level (Views/Home/Index.cshtml) ---------- */
.tg-ai-panel { padding: 0.4rem 0.9rem 0.9rem; display: flex; flex-direction: column; gap: 0.8rem; }
.tg-ai-loader { display: flex; align-items: center; gap: 0.6rem; color: var(--tg-muted); font-size: 0.85rem; }
.tg-ai-loader .ai-insights-spinner { border-color: var(--tg-border); border-top-color: var(--tg-accent); }
.tg-ai-result .ai-insights-list { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.tg-ai-result .ai-insights-list li { font-size: 0.86rem; line-height: 1.45; color: var(--tg-text); }
.tg-ai-result .ai-insights-list li::marker { color: var(--tg-accent); }
.tg-ai-result .tg-ai-empty { color: var(--tg-muted); font-size: 0.85rem; padding: 0.3rem 0; }
.tg-ai-error { font-size: 0.8rem; color: var(--debit); }

/* ---------- Voucher entry, Tally-style right-side button bar ---------- */
/* Wraps the EXISTING page-header + form (Views/Voucher/Create.cshtml, CreateEntries.cshtml) -
   nothing about the form itself changes, this only adds a second column reusing the same
   .tg-fkey-bar/.tg-fkey classes the Gateway already defines (they just read var(--tg-*), which
   is now available anywhere under body.tally-shell, not only inside .tg-gateway). */
.tg-voucher-layout { display: grid; grid-template-columns: 1fr 190px; gap: 1rem; align-items: start; }
.tg-voucher-fkeys { padding: 0; overflow: hidden; }
.tg-voucher-fkeys .tg-fkey-bar { padding: 0.5rem; }
.tg-voucher-hints { padding: 0.7rem 0.9rem; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.74rem; color: var(--text-soft); }
.tg-voucher-hints kbd { font-family: var(--font-mono); background: var(--highlight); border-radius: 4px; padding: 0.05rem 0.35rem; margin-right: 0.3rem; }

/* Keyboard hint line on a chooser screen (Company/Select) - unlike every other <kbd> in the app,
   this one sits directly on the plain page background rather than a dark bar/panel, so it needs its
   own explicit colours instead of Bootstrap's hardcoded dark-box-white-text default, and a border
   since --highlight alone is barely distinct from --bg in light mode. */
.kb-page-hint { color: var(--text-soft); }
.kb-page-hint kbd {
  font-family: var(--font-mono);
  background: var(--highlight);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.05rem 0.4rem;
}

/* Each shortcut as its own inline-flex group (kbd(s) + label) rather than one dense run of text -
   a group can't be split across a line-wrap (its kbd would get orphaned from its own label), and
   the middot lives in CSS, not the string, so removing/reordering a hint never leaves a stray
   separator behind. */
.kb-page-hint { display: flex; flex-wrap: wrap; row-gap: 0.35rem; }
.kb-hint-item { display: inline-flex; align-items: center; gap: 0.3rem; }
.kb-hint-item:not(:last-child)::after {
  content: "\00B7";
  margin-left: 0.7rem;
  color: var(--rule);
}
@media (max-width: 900px) {
  .tg-voucher-layout { grid-template-columns: 1fr; }
  .tg-voucher-fkeys .tg-fkey-bar { flex-direction: row; flex-wrap: wrap; }
}

/* "by ATOMQUARK" credit line - the wordmark sits beside a product name. The
   guidelines forbid putting taglines INSIDE the lockup, so "by" is a separate
   element outside .aq-mark, in neutral grey, never inside the wordmark itself. */
.aq-by {
    display: inline-flex;
    align-items: center;
    gap: .1rem;
    font-size: .8rem;
    font-weight: 600;
    color: #6B7280;
    white-space: nowrap;
}
