/* ============================================================
   GSTR-9 / GSTR-9C module design system — scoped under .gstr9-shell
   Ports the prototype's visual language (GSTR9-Web-UI styles.css /
   GSTR9C GSTR9_UI style.css): GST-portal navy bands, light blue
   chrome, compact statutory tables.
   ============================================================ */

.gstr9-shell {
    /* ---- brand palette: navy/blue for statutory table headers, accents,
       borders, landing cards, and part-description strips now all derive from
       the app's --theme-default so the entire module recolours with the
       Appearance theme picker (2026-09-16). ---- */
    --g9-navy: color-mix(in srgb, var(--theme-default, #274c6b) 90%, #000 10%);
    --g9-navy-dark: color-mix(in srgb, var(--theme-default, #1d3a53) 78%, #000 22%);
    --g9-blue: var(--theme-default, #2c5f8a);
    --g9-blue-light: color-mix(in srgb, var(--theme-default, #2c5f8a) 10%, var(--bs-body-bg, #fff));
    --g9-border: var(--bs-border-color, #c9d8e6);
    --g9-amber: #b45309;
    --g9-amber-bg: #fff7e6;

    /* ---- prototype tokens — surfaces/borders/ink tied to Bootstrap theme vars ---- */
    --bg:       var(--bs-body-bg, #eef1f6);
    --surface:  var(--bs-body-bg, #ffffff);
    --surface-2: color-mix(in srgb, var(--bs-body-color, #17202e) 4%,  var(--bs-body-bg, #f7f9fc));
    --surface-3: color-mix(in srgb, var(--bs-body-color, #17202e) 7%,  var(--bs-body-bg, #eaeff7));
    --line:     var(--bs-border-color, #d3dbe7);
    --line-soft: color-mix(in srgb, var(--bs-border-color, #d3dbe7) 60%, transparent);
    --ink:      var(--tc-strong, var(--bs-body-color, #17202e));
    --ink-2:    var(--tc-text, color-mix(in srgb, var(--bs-body-color, #17202e) 75%, var(--bs-secondary-color, #78849a)));
    --ink-3:    var(--tc-muted, var(--bs-secondary-color, #78849a));
    --brand:    var(--theme-default, #1f4b8f);
    --brand-dk: var(--theme-default, #163a72);
    --brand-lt: color-mix(in srgb, var(--theme-default, #1f4b8f) 10%, var(--bs-body-bg, #fff));
    --accent: #0f766e; --accent-lt: #e2f4f1;
    --ok: #16794c; --ok-lt: #e3f6ec;
    --warn: #a4600b; --warn-lt: #fdf1dc;
    --err: #b3261e; --err-lt: #fdecea;
    --info: #1f4b8f; --info-lt: color-mix(in srgb, var(--theme-default, #1f4b8f) 10%, var(--bs-body-bg, #fff));
    --radius: 10px; --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 20px rgba(0,0,0,.07);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.08);
    /* Himanshu (21-Oct-2026): was a monospace stack — figures now use the theme font with
       tabular digits (set on .gstr9-shell), so the module reads like the rest of the app. */
    --mono: var(--spq-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
    /* Sans stack falls through to the app-wide body font so GSTR-9 typography
       matches whatever theme font is in effect elsewhere. */
    --sans: var(--spq-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
    --navy: var(--theme-default, #1c3a5e); --navy-dk: color-mix(in srgb, var(--theme-default, #1c3a5e) 80%, #000); --navy-lt: color-mix(in srgb, var(--theme-default, #1c3a5e) 70%, #fff);
    /* Himanshu (21-Oct-2026): theme colour used as TEXT reads --theme-text (the AAA shade of the
       picked theme in the current mode); --brand / --navy stay for fills and borders only. */
    --brand-tx: var(--theme-text, var(--brand));
    --navy-tx: var(--theme-text, var(--navy));
    font-family: var(--sans);
    font-variant-numeric: tabular-nums;
}

/* Himanshu (21-Oct-2026): the old @media (prefers-color-scheme: dark) block is gone — it turned the
   module dark whenever the OS was dark, even with the app in light mode. Dark comes only from the app
   (body.dark-only, below) or an explicit data-g9-theme. */
.gstr9-shell[data-g9-theme="dark"] {
    --bg: var(--app-paper, #0d1420); --surface: var(--sf-card, #141d2b); --surface-2: var(--sf-card, #182333); --surface-3: var(--sf-raised, #1e2a3c);
    --line: var(--bd, #2b3a51); --line-soft: var(--bd, #222f42);
    --ink: #e6ecf5; --ink-2: #a9b6c9; --ink-3: #7d8ba1;
    --brand: var(--theme-default, #6f9dea); --brand-dk: #4a7fd4; --brand-lt: #1b2b45;
    --accent: #3fb3a3; --accent-lt: #14312e;
    --ok: #52c08a; --ok-lt: #12301f;
    --warn: #e0a34a; --warn-lt: #33260f;
    --err: #f0837a; --err-lt: #3a1614;
    --info: #6f9dea; --info-lt: #1b2b45;
}

/* ---- app dark mode (body.dark-only) integration — mirrors prefers-color-scheme dark ---- */
body.dark-only .gstr9-shell {
    --bg: var(--app-paper, #0d1420); --surface: var(--sf-card, #141d2b); --surface-2: var(--sf-card, #182333); --surface-3: var(--sf-raised, #1e2a3c);
    --line: var(--bd, #2b3a51); --line-soft: var(--bd, #222f42);
    --ink: var(--tcd-strong, #e6ecf5); --ink-2: var(--tcd-text, #a9b6c9); --ink-3: var(--tcd-muted, #7d8ba1);
    --brand: var(--theme-default, #6f9dea); --brand-dk: #4a7fd4; --brand-lt: #1b2b45;
    --accent: #3fb3a3; --accent-lt: #14312e;
    --ok: #52c08a; --ok-lt: #12301f;
    --warn: #e0a34a; --warn-lt: #33260f;
    --err: #f0837a; --err-lt: #3a1614;
    --info: #6f9dea; --info-lt: #1b2b45;
    --navy: var(--theme-default, #6f9dea); --navy-dk: color-mix(in srgb, var(--theme-default, #4a7fd4) 90%, #000); --navy-lt: color-mix(in srgb, var(--theme-default, #6f9dea) 60%, #fff);
    /* Dark-mode statutory table band: keep the theme colour but push it toward
       navy so white text keeps enough contrast on any picked hue. */
    --g9-navy: color-mix(in srgb, var(--theme-default, #6f9dea) 55%, #05101d 45%);
    --g9-navy-dark: color-mix(in srgb, var(--theme-default, #6f9dea) 40%, #05101d 60%);
    --g9-blue: color-mix(in srgb, var(--theme-default, #6f9dea) 85%, #fff);
    --g9-border: var(--bd, #2b3a51); --g9-blue-light: #1b2b45; --g9-amber-bg: #33260f;
}
body.dark-only .gstr9-shell .gstr9-table-card > .card-body.small { background: var(--sf-card, #182333); color: var(--tcd-text, #a9b6c9); }
body.dark-only .gstr9-shell .gstr9-table-card > .card-footer { background: var(--sf-card, #141d2b); color: var(--tcd-muted, #7d8ba1); }
body.dark-only .gstr9-shell .menu-list button { color: var(--ink); }
body.dark-only .gstr9-shell .card:not(.gstr9-table-card) > .card-header { color: var(--tcd-text, #a9b6c9); }
body.dark-only .gstr9-shell .alert-info { background: var(--sf-raised, #1b2b45); border-color: var(--bd, #2b3a51); color: var(--tcd-text, #a9b6c9); }

/* ---- appbar-row: module filing-status band (row 1) — themed, no hardcoded navy ---- */
.gstr9-shell .appbar-row {
    display: flex; align-items: center; gap: 12px;
    padding: 5px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    border-radius: 8px 8px 0 0;
}
.gstr9-shell .appbar-row .filing { display: flex; gap: 10px; align-items: center; flex: 0 0 auto; }
.gstr9-shell .appbar-row .fl { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.gstr9-shell .appbar-row .fl > span {
    font-size: 9px; text-transform: uppercase; letter-spacing: .5px;
    color: var(--ink-3); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); white-space: nowrap;
}
.gstr9-shell .appbar-row .fl select, .gstr9-shell .appbar-row .fl input {
    font: 11.5px var(--sans); color: var(--ink);
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 5px; padding: 2px 5px; height: 22px;
}
.gstr9-shell .appbar-row .fl select { width: 110px; }
.gstr9-shell .filing[data-status="filed"] .fl select { background: var(--ok-lt); border-color: var(--ok); color: var(--ok); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell .filing[data-status="uploaded"] .fl select { background: var(--info-lt); border-color: var(--info); color: var(--info); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell .filing[data-status="prepared"] .fl select { background: var(--warn-lt); border-color: var(--warn); color: var(--warn); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell .filing[data-status="notfiled"] .fl select { background: var(--err-lt); border-color: var(--err); color: var(--err); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell .appbar-row .fl input[type="date"] { width: 122px; font-family: var(--mono); font-size: 11px; }
.gstr9-shell .appbar-row .fl-arn input { width: 118px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .3px; }
.gstr9-shell .appbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gstr9-shell .appbar-row .btn {
    font-size: 12.5px; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); font-family: var(--sans);
    border: 1px solid var(--line);
    background: var(--surface); color: var(--ink);
    padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
}
.gstr9-shell .appbar-row .btn:hover { border-color: var(--brand); color: var(--brand-tx); background: var(--brand-lt); }
/* accent button — follows theme colour, matches hd-export contrast */
.gstr9-shell .appbar-row .hd-btn {
    background: var(--surface-2); border-color: var(--brand); color: var(--brand-tx);
    font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000);
}
.gstr9-shell .appbar-row .hd-btn:hover { background: var(--brand-lt); border-color: var(--brand); color: var(--brand-tx); }
.gstr9-shell .appbar-row .hd-export { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell .appbar-row .hd-export:hover { background: var(--brand-dk); border-color: var(--brand-dk); color: #fff; }
.gstr9-shell .appbar-row .save-chip {
    font-size: 11px; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); padding: 3px 9px; border-radius: 999px;
    background: var(--ok-lt); color: var(--ok); border: 1px solid transparent;
}
.gstr9-shell .appbar-row .save-chip.dirty { background: var(--warn-lt); color: var(--warn); }

/* ---- stepstrip: dataset radio + preparation steps (row 2) ---- */
.gstr9-shell .stepstrip {
    display: flex; align-items: stretch; gap: 8px;
    padding: 8px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    overflow: visible !important;
    border-radius: 0 0 8px 8px;
}
.gstr9-shell .dsbar { display: flex; align-items: stretch; gap: 6px; flex: 0 0 auto; padding: 0; border: 0; background: transparent; }
.gstr9-shell .ds-opt {
    display: flex; align-items: center; gap: 7px;
    padding: 3px 11px 3px 8px; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--surface);
    cursor: pointer; line-height: 1.15;
}
.gstr9-shell .ds-opt:hover { border-color: var(--brand); }
.gstr9-shell .ds-opt.active {
    border-color: var(--brand); background: var(--brand-lt);
    box-shadow: inset 0 0 0 1px var(--brand);
}
.gstr9-shell .dsbar[data-active="pc"] .ds-opt.active,
.gstr9-shell .dsbar[data-active="ps"] .ds-opt.active {
    border-color: var(--warn); background: var(--warn-lt);
    box-shadow: inset 0 0 0 1px var(--warn);
}
.gstr9-shell .ds-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.gstr9-shell .ds-dot { flex: 0 0 auto; width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--ink-3); background: var(--surface); position: relative; }
.gstr9-shell .ds-opt input:checked + .ds-dot { border-color: var(--brand); }
.gstr9-shell .ds-opt input:checked + .ds-dot::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: var(--brand); }
.gstr9-shell .dsbar[data-active="pc"] .ds-opt input:checked + .ds-dot,
.gstr9-shell .dsbar[data-active="ps"] .ds-opt input:checked + .ds-dot { border-color: var(--warn); }
.gstr9-shell .dsbar[data-active="pc"] .ds-opt input:checked + .ds-dot::after,
.gstr9-shell .dsbar[data-active="ps"] .ds-opt input:checked + .ds-dot::after { background: var(--warn); }
.gstr9-shell .ds-txt { display: flex; flex-direction: column; font-size: 12.5px; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell .ds-txt em { font-style: normal; font-weight: clamp(1, calc(400 + var(--spq-fw-delta, 0)), 1000); font-size: 11px; color: var(--ink-3); }
.gstr9-shell .ds-opt input:checked ~ .ds-txt { color: var(--brand-tx); }
.gstr9-shell .dsbar[data-active="pc"] .ds-opt input:checked ~ .ds-txt,
.gstr9-shell .dsbar[data-active="ps"] .ds-opt input:checked ~ .ds-txt { color: var(--warn); }

.gstr9-shell .steps { display: flex; align-items: stretch; gap: 8px; flex: 1 1 auto; min-width: 0; overflow: visible !important; }
.gstr9-shell .step {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
    text-align: center; cursor: pointer; white-space: nowrap;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink);
    padding: 3px 12px; font: inherit; flex: 0 0 auto; min-width: 118px;
}
.gstr9-shell .step:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.gstr9-shell .step em { font-style: normal; font-size: 9.5px; font-weight: clamp(1, calc(800 + var(--spq-fw-delta, 0)), 1000); color: var(--err); letter-spacing: .2px; }
.gstr9-shell .step b { font-size: 11.5px; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); line-height: 1.25; color: var(--navy-tx); display: block; }
.gstr9-shell .step i { font-style: normal; font-size: 9.5px; line-height: 1.2; color: var(--warn); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell .step.done em, .gstr9-shell .step.done i { color: var(--ok); }
.gstr9-shell .step-help { background: var(--warn-lt); border-color: var(--warn); margin-left: auto; }
.gstr9-shell .step-help em { color: var(--warn); }
.gstr9-shell .step-menu { position: relative; display: flex; overflow: visible !important; }
.gstr9-shell .step-menu .menu-list { top: calc(100% + 4px); left: 0; right: auto; min-width: 250px; z-index: 9999 !important; }

.gstr9-shell .menu { position: relative; overflow: visible !important; }
.gstr9-shell .menu-list {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 9999 !important;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    min-width: 230px; padding: 6px;
}
.gstr9-shell .menu-list button {
    display: block; width: 100%; text-align: left;
    border: 0; background: transparent; color: var(--ink);
    font: 13px var(--sans); padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer;
}
.gstr9-shell .menu-list button:hover { background: var(--surface-3); }
.gstr9-shell .menu-list hr { border: 0; border-top: 1px solid var(--line-soft); margin: 5px 2px; }
.gstr9-shell .gstr9-topbar-card,
.gstr9-shell .gstr9-topbar-card > .card-body,
.gstr9-shell .gstr9-topbar,
.gstr9-shell .appbar-row { overflow: visible !important; }

/* ---- Part I: registration strip + summary/position cards (verbatim) ---- */
.gstr9-shell .reg-strip {
    display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
    padding: 10px 14px; margin-bottom: 14px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.gstr9-shell .reg-f { display: flex; flex-direction: column; gap: 2px; flex: 0 1 auto; }
.gstr9-shell .reg-f > span { font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); white-space: nowrap; }
.gstr9-shell .reg-f em { color: var(--err); font-style: normal; }
.gstr9-shell .reg-f input, .gstr9-shell .reg-f select {
    font: 12.5px var(--sans); color: var(--ink);
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: 5px; padding: 4px 8px; height: 28px;
}
.gstr9-shell .reg-f input { width: 150px; }
.gstr9-shell .reg-f select { width: 150px; }
.gstr9-shell .reg-meta { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 12px; color: var(--ink-3); padding-bottom: 4px; white-space: nowrap; }
.gstr9-shell .reg-meta b { color: var(--ink); font-family: var(--mono); }

.gstr9-shell .card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); margin-bottom: 22px; overflow: hidden;
}
.gstr9-shell .card > header {
    display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
    border-bottom: 1px solid var(--line-soft); background: var(--surface-2);
}
.gstr9-shell .card-no { flex: 0 0 auto; font-size: 13px; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); font-family: var(--mono); color: #fff; background: var(--brand); border-radius: var(--radius-sm); padding: 5px 9px; min-width: 34px; text-align: center; }
.gstr9-shell .card-ttl { flex: 1 1 auto; min-width: 0; }
.gstr9-shell .card-ttl h3 { font-size: 14.5px; font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000); line-height: 1.35; margin: 0; }
.gstr9-shell .card-ttl .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.gstr9-shell .card-tools { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; }
.gstr9-shell .tag { font-size: 10.5px; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); font-family: var(--sans); text-transform: uppercase; letter-spacing: .5px; padding: 3px 7px; border-radius: 999px; background: var(--surface-3); color: var(--ink-3); }

.gstr9-shell .tbl-wrap { overflow-x: auto; }
.gstr9-shell table.calc { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; margin: 0; }
.gstr9-shell table.calc th { background: var(--surface-3); font-size: 11.5px; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); font-family: var(--sans); color: var(--ink-2); text-align: right; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.gstr9-shell table.calc th:first-child { text-align: left; }
.gstr9-shell table.calc td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); text-align: right; font: 13px var(--mono); white-space: nowrap; }
.gstr9-shell table.calc td:first-child { text-align: left; font-family: var(--sans); }
.gstr9-shell .pos { color: var(--err); }
.gstr9-shell .neg { color: var(--ok); }

.gstr9-shell table.sum th.c-tno, .gstr9-shell table.sum td.c-tno { width: 58px; text-align: center; font-family: var(--mono); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell table.sum th.c-dsc, .gstr9-shell table.sum td.c-dsc { text-align: left; min-width: 280px; font-family: var(--sans); }
.gstr9-shell table.sum th.c-val0, .gstr9-shell table.sum td.c-val0 { width: 104px; text-align: center; }
.gstr9-shell table.sum tbody tr { cursor: pointer; }
.gstr9-shell table.sum tbody tr:hover td { background: var(--surface-2); }
.gstr9-shell table.sum td.na-cell { background: repeating-linear-gradient(135deg,transparent,transparent 5px,var(--line-soft) 5px,var(--line-soft) 6px); }
.gstr9-shell .vchip { display: inline-block; font-size: 10px; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); font-family: var(--sans); letter-spacing: .4px; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; }
.gstr9-shell .vchip.ok { background: var(--ok-lt); color: var(--ok); }
.gstr9-shell .vchip.warn { background: var(--warn-lt); color: var(--warn); }
.gstr9-shell .vchip.err { background: var(--err-lt); color: var(--err); }

.gstr9-shell .help-panel { padding: 12px 16px; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); background: var(--accent-lt); border-bottom: 1px solid var(--line-soft); white-space: pre-line; }
.gstr9-shell .card-help {
    width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
    border: 1.5px solid var(--brand); background: var(--surface);
    color: var(--brand-tx); font-size: 14px; font-weight: clamp(1, calc(800 + var(--spq-fw-delta, 0)), 1000); font-family: var(--sans); cursor: pointer;
}
.gstr9-shell .card-help:hover { background: var(--brand); color: #fff; }
.gstr9-shell .tbl-notes {
    margin: -18px 0 22px; padding: 12px 16px;
    background: var(--surface-2); border: 1px solid var(--line); border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: 12.5px; line-height: 1.65; color: var(--ink-2); white-space: pre-line;
}
.gstr9-shell .tbl-notes b { display: block; color: var(--ink); margin-bottom: 4px; }
.gstr9-shell .gstr9-table-card { margin-bottom: 0; }

/* ---- Review screens: validation / compare / computation (verbatim) ---- */
.gstr9-shell .part-head { margin: 6px 0 16px; font-size: 12px; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); letter-spacing: .7px; text-transform: uppercase; color: var(--accent); }
.gstr9-shell .v-summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.gstr9-shell .v-pill { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 11px 16px; box-shadow: var(--shadow-sm); }
.gstr9-shell .v-pill b { font-size: 20px; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); font-family: var(--mono); }
.gstr9-shell .v-pill span { font-size: 12px; color: var(--ink-3); }
.gstr9-shell .v-pill.err b { color: var(--err); }
.gstr9-shell .v-pill.warn b { color: var(--warn); }
.gstr9-shell .v-pill.info b { color: var(--info); }
.gstr9-shell .v-pill.ok b { color: var(--ok); }

.gstr9-shell .issue { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.gstr9-shell .issue:hover { background: var(--surface-2); }
.gstr9-shell .issue:last-child { border-bottom: 0; }
.gstr9-shell .issue .sev { flex: 0 0 auto; font-size: 9.5px; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); font-family: var(--sans); text-transform: uppercase; letter-spacing: .6px; padding: 3px 7px; border-radius: 4px; margin-top: 1px; min-width: 52px; text-align: center; }
.gstr9-shell .sev.error { background: var(--err-lt); color: var(--err); }
.gstr9-shell .sev.warn { background: var(--warn-lt); color: var(--warn); }
.gstr9-shell .sev.info { background: var(--info-lt); color: var(--info); }
.gstr9-shell .issue .where { font-size: 12px; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); font-family: var(--mono); color: var(--ink-2); flex: 0 0 96px; margin-top: 2px; }
.gstr9-shell .issue .what { flex: 1 1 auto; font-size: 13px; line-height: 1.5; }
.gstr9-shell .clean-state { padding: 40px 20px; text-align: center; }
.gstr9-shell .clean-state .big { font-size: 34px; }
.gstr9-shell .clean-state h3 { margin-top: 8px; font-size: 16px; }
.gstr9-shell .clean-state p { margin-top: 6px; color: var(--ink-3); font-size: 13px; }

.gstr9-shell table.calc tr.sep td { background: var(--sub-bg); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell table.calc tr.grand td { background: var(--total-bg); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell table.calc tr.grand td:first-child { font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell table.calc td.na-cell, .gstr9-shell table.calc td.cmp-diff { text-align: right; }
.gstr9-shell table.calc td.cmp-diff { background: var(--warn-lt); color: var(--warn); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell table.calc td.na-cell { background: repeating-linear-gradient(135deg,transparent,transparent 5px,var(--line-soft) 5px,var(--line-soft) 6px); }

/* ---- cards ---------------------------------------------------- */
.gstr9-shell .card {
    border: 1px solid var(--g9-border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* the module toolbar card gets a soft blue wash */
.gstr9-shell > .card:first-child > .card-body {
    background: var(--g9-blue-light);
    border-radius: 8px;
}

/* ---- statutory table cards (Gstr9TableSheet / Gstr9cTableSheet) */
.gstr9-shell .gstr9-table-card {
    border-color: var(--g9-blue);
    overflow: hidden;
}

.gstr9-shell .gstr9-table-card > .card-header {
    background: linear-gradient(180deg, var(--g9-navy), var(--g9-navy-dark));
    color: #fff;
    border-bottom: 0;
    letter-spacing: .01em;
}

.gstr9-shell .gstr9-table-card > .card-header .btn-outline-secondary {
    color: #fff;
    border-color: rgba(255, 255, 255, .55);
}

.gstr9-shell .gstr9-table-card > .card-header .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

.gstr9-shell .gstr9-table-card > .card-header .btn-outline-primary {
    color: #fff;
    border-color: rgba(255, 255, 255, .55);
    background: rgba(255, 255, 255, .08);
}

.gstr9-shell .gstr9-table-card > .card-header .badge.text-bg-light {
    background: var(--g9-amber-bg) !important;
    color: var(--g9-amber);
    border-color: #f0d9a8 !important;
}

/* help / notes strips under the navy band */
.gstr9-shell .gstr9-table-card > .card-body.small {
    background: var(--g9-blue-light);
    border-bottom: 1px solid var(--g9-border);
    color: var(--ink-2);
}

.gstr9-shell .gstr9-table-card > .card-footer {
    background: var(--surface-2);
    color: var(--ink-3);
    font-style: italic;
}

/* ---- part description band ----------------------------------- */
.gstr9-shell .g9-part-desc {
    background: var(--g9-blue-light);
    border-left: 4px solid var(--g9-blue);
    border-radius: 4px;
    padding: .35rem .6rem;
    color: var(--navy-tx);
    font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000);
}

/* ---- dataset switch: prototype colouring ---------------------- */
.gstr9-shell .btn-group .btn-primary {
    background: var(--g9-navy);
    border-color: var(--g9-navy);
}

.gstr9-shell .btn-group .btn-outline-primary {
    color: var(--navy-tx);
    border-color: var(--g9-navy);
}

.gstr9-shell .btn-group .btn-outline-primary:hover {
    background: var(--g9-blue-light);
    color: var(--navy-tx);
}

/* ---- landing cards (summary jump tiles) ----------------------- */
.gstr9-shell .card[role="button"] {
    transition: box-shadow .12s ease, transform .12s ease;
    border-left: 4px solid var(--g9-blue);
}

.gstr9-shell .card[role="button"]:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .16);
    transform: translateY(-1px);
}

/* ---- headers inside plain info cards -------------------------- */
.gstr9-shell .card:not(.gstr9-table-card) > .card-header {
    background: var(--g9-blue-light);
    border-bottom: 1px solid var(--g9-border);
    color: var(--navy-tx);
}

/* statutory table band text stays white (beats any theme colour) */
.gstr9-shell .gstr9-table-card > .card-header,
.gstr9-shell .gstr9-table-card > .card-header .fw-semibold,
.gstr9-shell .gstr9-table-card > .card-header span {
    color: #fff !important;
}

/* ---- FY notes / alerts ---------------------------------------- */
.gstr9-shell .alert-info {
    background: var(--g9-blue-light);
    border-color: var(--g9-border);
    color: var(--ink);
}

/* ---- datasheet polish inside the module ----------------------- */
.gstr9-shell .data-grid {
    border-top: 1px solid var(--g9-border);
}

.gstr9-shell .gstr9-table-card .card-body.p-0 {
    background: var(--surface);
    /* horizontal scroll wraps wide statutory tables inside the card on narrow
       viewports instead of pushing the page wider than the phone screen */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================================
   Mobile responsive layer — "native app feel"
   Applies below 768px. Scoped under .gstr9-shell so it never
   leaks into other modules.
   ============================================================ */
@media (max-width: 768px) {
    .gstr9-shell {
        padding: 0 !important;
    }

    /* trim outer card chrome so the phone gets edge-to-edge content */
    .gstr9-shell > .card {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }

    .gstr9-shell > .card > .card-body {
        padding: 0.5rem !important;
    }

    /* sticky module toolbar so save/validate stay reachable while scrolling
       tall statutory tables — mimics a mobile app's top action bar */
    .gstr9-shell > .card:first-child {
        position: sticky;
        top: 0;
        z-index: 20;
        margin-bottom: 0.5rem !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    }

    /* toolbar packs tighter and wraps cleanly */
    .gstr9-shell .spq-toolbar {
        gap: 0.35rem !important;
        padding: 0 !important;
    }

    /* dataset switch: shrink text and give thumb-sized tap targets */
    .gstr9-shell .spq-toolbar .btn-group .btn {
        font-size: 0.72rem;
        padding: 0.35rem 0.5rem;
        min-height: 40px;
    }

    /* status chip strip drops onto its own line so it never crowds buttons */
    .gstr9-shell .spq-toolbar > .d-inline-flex.small {
        flex-basis: 100%;
        order: 10;
        margin: 0 !important;
        font-size: 0.72rem;
    }

    /* every action button in the toolbar gets a comfortable tap target */
    .gstr9-shell .spq-toolbar .btn {
        min-height: 40px;
    }

    /* delete moves inline with the scroller instead of hugging the far right,
       which on phones ended up under the go-back arrow */
    .gstr9-shell .spq-toolbar > .ms-auto {
        margin-left: 0 !important;
    }

    /* statutory table card: less inner chrome, header stacks */
    .gstr9-shell .gstr9-table-card {
        border-radius: 6px;
        margin-bottom: 0.75rem !important;
    }

    .gstr9-shell .gstr9-table-card > .card-header {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
        gap: 0.35rem !important;
    }

    .gstr9-shell .gstr9-table-card > .card-header .fw-semibold {
        font-size: 0.85rem;
        line-height: 1.25;
    }

    .gstr9-shell .gstr9-table-card > .card-header .btn {
        min-height: 36px;
        padding: 0.3rem 0.55rem;
    }

    /* the SmartGrid host: keep sheet at natural width, scroll the card body */
    .gstr9-shell .gstr9-table-card .card-body.p-0 > .d-flex {
        min-width: 640px;
    }

    /* summary landing cards: mobile-app-style stacked list with press feedback */
    .gstr9-shell .card[role="button"] {
        border-left-width: 6px;
        border-radius: 8px;
    }

    .gstr9-shell .card[role="button"]:active {
        transform: scale(0.98);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18) inset;
    }

    /* landing header/summary grid — bigger, one-per-line fields for touch */
    .gstr9-shell .card-body .row.g-2.small > [class*="col-"] {
        flex-basis: 100%;
        max-width: 100%;
    }

    .gstr9-shell .form-select-sm,
    .gstr9-shell .form-control-sm {
        min-height: 40px;
        font-size: 0.9rem;
    }

    /* preparation-step rows: bigger tappable link + generous row height */
    .gstr9-shell .card-body .btn-link.p-0 {
        padding: 0.5rem 0 !important;
        font-size: 0.9rem;
    }

    /* validation results table shrinks to a phone-friendly font */
    .gstr9-shell .table.table-sm {
        font-size: 0.78rem;
    }

    .gstr9-shell .table.table-sm td,
    .gstr9-shell .table.table-sm th {
        padding: 0.4rem 0.35rem;
    }

    /* FY-notes alert becomes edge-to-edge like a mobile notification */
    .gstr9-shell .alert {
        border-radius: 6px;
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
    }

    /* ---- Summary page: appbar-row wraps on mobile ---- */
    .gstr9-shell .appbar-row {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 10px;
    }
    .gstr9-shell .appbar-row .filing {
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }
    .gstr9-shell .appbar-row .fl {
        flex: 1 1 auto;
    }
    .gstr9-shell .appbar-row .appbar-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }
    .gstr9-shell .appbar-row .btn,
    .gstr9-shell .appbar-row .save-chip {
        min-height: 44px;
        font-size: 11.5px;
    }

    /* stepstrip scrolls horizontally rather than overflowing the viewport */
    .gstr9-shell .stepstrip {
        overflow-x: auto !important;
        flex-wrap: nowrap;
        padding: 6px 10px;
    }
    .gstr9-shell .steps {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    .gstr9-shell .step {
        min-width: 90px;
        min-height: 44px;
        padding: 3px 8px;
    }

    /* registration strip: stack fields full-width on mobile */
    .gstr9-shell .reg-strip {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 10px;
    }
    .gstr9-shell .reg-f {
        width: 100%;
    }
    .gstr9-shell .reg-f input,
    .gstr9-shell .reg-f select {
        width: 100%;
        min-height: 40px;
        font-size: 14px;
    }
    .gstr9-shell .reg-meta {
        margin-left: 0;
        padding-bottom: 0;
        white-space: normal;
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }

    /* summary tables: horizontal scroll + comfortable row height */
    .gstr9-shell .tbl-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .gstr9-shell table.calc.sum {
        min-width: 700px;
    }
    .gstr9-shell table.calc td,
    .gstr9-shell table.calc th {
        padding: 6px 8px;
        font-size: 12px;
    }

    /* part jump cards: full-width on mobile, left border accent, touch feedback */
    .gstr9-shell .row.g-2 > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .gstr9-shell .card[role="button"] .card-body {
        padding: 0.65rem 0.75rem !important;
    }
    .gstr9-shell .card[role="button"] .fw-semibold {
        font-size: 0.88rem;
    }

    /* card <header> element compression on mobile */
    .gstr9-shell .card > header {
        padding: 10px 12px;
        gap: 8px;
        flex-wrap: wrap;
    }
    .gstr9-shell .card-no {
        font-size: 11px;
        padding: 4px 6px;
        min-width: 28px;
    }
    .gstr9-shell .card-ttl h3 {
        font-size: 13px;
    }
    .gstr9-shell .card-ttl .sub {
        font-size: 11px;
    }

    /* dataset radio options: ≥44px touch target */
    .gstr9-shell .ds-opt {
        min-height: 44px;
        padding: 4px 11px 4px 8px;
    }

    /* bottombar sticky footer: 44px touch targets */
    .gstr9-shell .gstr9-bottombar .btn {
        min-height: 44px;
        padding: 0.4rem 0.65rem;
    }
    .gstr9-shell .gstr9-bottombar .btn-group {
        margin-left: 0 !important;
    }

    /* position-of-return table (2-col): allow horizontal scroll on narrow viewports */
    .gstr9-shell table.calc:not(.sum) {
        min-width: 300px;
    }

    /* FY-notes help strip: compact on mobile */
    .gstr9-shell .help-panel.fy-note {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* very narrow phones — tighten one more notch */
@media (max-width: 380px) {
    .gstr9-shell .spq-toolbar .btn-group .btn {
        font-size: 0.68rem;
        padding: 0.3rem 0.4rem;
    }

    .gstr9-shell .gstr9-table-card > .card-header {
        font-size: 0.8rem;
    }
}

/* ============================================================
   Inline prototype host pages (body.g9proto-active) — the
   prototype carries its own rail/header, so the app sidebar
   collapses and the content area goes full width.
   ============================================================ */
body.g9proto-active .appnav { display: none !important; }
body.g9proto-active .page-wrapper .page-body-wrapper,
body.g9proto-active .page-body {
    margin-left: 0 !important;
    padding-left: 0 !important;
}
/* the prototype manages its own scrolling chrome */
.g9proto { min-height: 60vh; }

/* The prototype's own <header class="appbar"> must not compete with the app
   header: no viewport-sticky, and a z-index well below the app chrome. Its
   sidebar then sticks to the viewport top on scroll instead of the appbar. */
body.g9proto-active .g9proto .appbar {
    position: static !important;
    z-index: 10 !important;
}

body.g9proto-active .g9proto .sidebar {
    top: 0 !important;
    height: calc(100vh - 64px) !important;
}

/* bottom action bar stays under the app's floating widgets and dialogs */
body.g9proto-active .g9proto .actionbar {
    z-index: 30 !important;
}

/* app layout offset variable: collapse the reserved sidebar width entirely
   while the prototype page owns the viewport */
body.g9proto-active {
    --appnav-w: -12px !important;
}

/* ---- Table-6 auto-fill buttons: semantic colouring that still tracks light/dark
   theme (no hardcoded !important). Purple = "View", Red = "Last-Year import",
   Blue = "Import from 3B". Card background follows the amber-note colour so
   they read as annotation buttons over any theme. ---- */
.gstr9-shell .g9-autofill-btn {
    font-size: 11px;
    line-height: 1.2;
    background: var(--g9-amber-bg);
    border: 1px solid var(--line);
}
.gstr9-shell .g9-autofill-btn:hover {
    filter: brightness(0.97);
}
.gstr9-shell .g9-autofill-purple .fw-bold { color: color-mix(in srgb, #7a1ea1 var(--ink-keep, 100%), var(--ink-flip, #7a1ea1)); }
.gstr9-shell .g9-autofill-red    .fw-bold { color: var(--err); }
.gstr9-shell .g9-autofill-red    { border-color: var(--err); }
.gstr9-shell .g9-autofill-blue   .fw-bold { color: var(--brand-tx); }
.gstr9-shell .g9-autofill-blue   { border: 2px solid var(--brand); }
body.dark-only .gstr9-shell .g9-autofill-purple .fw-bold { color: #c789e6; }

/* ---- native GSTR-9 module header/footer (Gstr9TopBar / Gstr9BottomBar) --- */
/* Pin the Gstr9TopBar across every GSTR-9 sub-section (Summary / Parts /
   Validation / Computation / Compare) so filing status, dataset toggle and the
   five prep steps stay reachable while scrolling long statutory tables. Sits
   just below the app's fixed .page-header (~56px tall). z-index below the
   app header (z:8) but above table content and SmartGrid chrome. Mobile has
   its own rule earlier (top:0, z-index:20) — this scope keeps it desktop-only. */
/* #region Himanshu (17-Sep-2026) — the page scrolls INSIDE .root-container, which already
   sits below the fixed app header. The old `top: 56px` offset therefore left a 56px empty band
   above the Status row once stuck, and applied on desktop only. Stick flush at the scroller's
   top on every breakpoint, and drop the card's outer chrome so no band shows above the row. */
.gstr9-shell > .gstr9-topbar-card {
    position: sticky;
    top: 0;
    z-index: 20;
    margin-top: 0 !important;
    margin-bottom: 6px !important;
    border: 0;
    border-radius: 0 0 8px 8px;
    background: var(--surface, #fff);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}
.gstr9-shell > .gstr9-topbar-card > .card-body {
    padding: 0 !important;
}
/* The portal host's ProviderLoginGate renders ahead of the shell and always emits an empty
   SingleLineButtonScroller (arrow buttons + track); on GSTR-9 screens it had no buttons, so it
   only added a blank band above the Status row. Hidden while empty, GSTR-9 pages only. */
.root-container:has(.gstr9-shell) .spq-provider-login-gate-container .slbs:not(:has(.slbs__track > *)) {
    display: none !important;
}
.gstr9-shell > .gstr9-topbar-card .appbar-row {
    border-radius: 0;
}

@media (max-width: 768px) {
    /* phones: one horizontally scrolling line each for the status/actions row and the step
       strip, so the pinned bar stays two rows tall instead of wrapping over half the screen */
    .gstr9-shell > .gstr9-topbar-card .appbar-row {
        flex-wrap: nowrap;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 6px 10px;
    }
    .gstr9-shell > .gstr9-topbar-card .appbar-row::-webkit-scrollbar { display: none; }
    .gstr9-shell > .gstr9-topbar-card .appbar-row .filing,
    .gstr9-shell > .gstr9-topbar-card .appbar-row .appbar-actions {
        flex-wrap: nowrap;
        width: auto;
        flex: 0 0 auto;
    }
    .gstr9-shell > .gstr9-topbar-card .appbar-row .fl { flex: 0 0 auto; }
    .gstr9-shell > .gstr9-topbar-card .stepstrip { scrollbar-width: none; }
    .gstr9-shell > .gstr9-topbar-card .stepstrip::-webkit-scrollbar { display: none; }

    /* top bar dropdowns open as a bottom sheet — they would be clipped by the scrolling row,
       and a thumb-reachable sheet is the native pattern anyway */
    .gstr9-shell > .gstr9-topbar-card .menu-list,
    .gstr9-shell > .gstr9-topbar-card .step-menu .menu-list {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        bottom: 0 !important;
        min-width: 0 !important;
        max-height: 70vh;
        overflow-y: auto;
        border-radius: 16px 16px 0 0;
        padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
        z-index: 1060 !important;
        animation: g9-sheet-up .2s cubic-bezier(.22, .61, .36, 1);
    }
    .gstr9-shell > .gstr9-topbar-card .menu-list button { min-height: 48px; font-size: 15px; }
    .gstr9-shell > .gstr9-topbar-card .menu-backdrop {
        background: rgba(0, 0, 0, .35) !important;
        z-index: 1055 !important;
    }
}
@keyframes g9-sheet-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
/* #endregion */

.gstr9-topbar .gstr9-step {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    padding: 4px 10px;
    min-width: 108px;
}

.gstr9-topbar .gstr9-step-em {
    font-size: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--g9-amber, #b45309);
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
}

.gstr9-bottombar {
    position: sticky;
    bottom: 0;
    z-index: 20;
}

/* the app header already names the screen — drop the prototype's own brand */
body.g9proto-active .g9proto .appbar .brand {
    display: none !important;
}

/* ============================================================
   #region Himanshu (17-Sep-2026) — GSTR-9 desktop-parity UI pieces
   Theme tokens only (no hard-coded palette), mobile rules behind
   media queries, desktop layout unchanged.
   ============================================================ */

/* AATO slab on the filing strip */
.gstr9-shell .appbar-row .fl-aato select { width: 118px; }
.gstr9-shell .appbar-row .fl-aato .fl-value { font: 11.5px var(--sans); color: var(--ink); }
.gstr9-shell .appbar-row .fl-aato.unconfirmed select {
    background: var(--warn-lt); border-color: var(--warn); color: var(--warn); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
}
.gstr9-shell .appbar-row .g9-aato-check { align-self: flex-end; }

/* bottom sheet: proceed-to-file differences (dialog on desktop, sheet on phones) */
.g9-sheet-backdrop {
    position: fixed; inset: 0; z-index: 1055;
    background: rgba(0, 0, 0, .35);
}
.g9-sheet {
    position: fixed; z-index: 1060;
    left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: min(880px, calc(100vw - 32px)); max-height: 80vh;
    display: flex; flex-direction: column;
    background: var(--bs-body-bg, #fff); color: var(--bs-body-color, #17202e);
    border: 1px solid var(--bs-border-color, #d3dbe7);
    border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}
.g9-sheet-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 12px 16px; border-bottom: 1px solid var(--bs-border-color, #d3dbe7);
}
.g9-sheet-title { font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); font-size: 15px; }
.g9-sheet-sub { font-size: 12px; color: var(--bs-secondary-color, #6c757d); margin-top: 2px; }
.g9-sheet-body { overflow: auto; padding: 8px 16px 16px; -webkit-overflow-scrolling: touch; }
.g9-diff-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.g9-diff-table th, .g9-diff-table td { padding: 6px 8px; border-bottom: 1px solid var(--bs-border-color, #e3e9f3); }
.g9-diff-table th { position: sticky; top: 0; background: var(--bs-tertiary-bg, #f4f6fa); text-align: left; }
.g9-diff-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.g9-diff-table .diff { color: var(--bs-danger, #b3261e); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }

/* HSN tools under Tables 17 / 18 */
.gstr9-shell .g9-hsn-tools {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin: 6px 0 12px; padding: 8px 10px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
}
.gstr9-shell .g9-hsn-tools .g9-file-btn { cursor: pointer; }
.gstr9-shell .g9-hsn-adjust { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.gstr9-shell .g9-hsn-adjust input { width: 72px; }

/* Quick Review gate + dialog width */
.gstr9-quickreview-backdrop .g9-review-dialog { max-width: 95vw; }
.gstr9-quickreview-backdrop .g9-review-gate ul { font-size: 12.5px; }

/* observation report */
.gstr9-shell .g9-obs-note { padding: 10px 14px; font-size: 12.5px; color: var(--ink-2); }
.gstr9-shell .g9-obs-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gstr9-shell .g9-obs-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.gstr9-shell .g9-obs-table th, .gstr9-shell .g9-obs-table td { padding: 5px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.gstr9-shell .g9-obs-table th { background: var(--surface-3); color: var(--ink); text-align: left; white-space: nowrap; }
.gstr9-shell .g9-obs-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gstr9-shell .g9-obs-section td { background: var(--brand-lt); color: var(--brand-tx); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell .g9-obs-diff td { font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell .g9-obs-diff.has-diff td.num { color: var(--err); }
.gstr9-shell .g9-obs-main.has-diff td:first-child { box-shadow: inset 3px 0 0 var(--err); }
.gstr9-shell .g9-obs-foot { padding: 8px 14px 12px; font-size: 11.5px; color: var(--ink-3); }

@media (max-width: 767.98px) {
    /* differences: a real bottom sheet */
    .g9-sheet {
        left: 0; right: 0; top: auto; bottom: 0; transform: none;
        width: 100%; max-height: 85vh;
        border-radius: 16px 16px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
        animation: g9-sheet-up .2s cubic-bezier(.22, .61, .36, 1);
    }
    .g9-sheet-head .btn-close { min-width: 44px; min-height: 44px; }
    /* table rows become stacked cards */
    .g9-diff-table thead { display: none; }
    .g9-diff-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--bs-border-color, #e3e9f3); }
    .g9-diff-table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 0; }
    .g9-diff-table td::before { content: attr(data-label); color: var(--bs-secondary-color, #6c757d); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }

    .gstr9-shell .g9-hsn-tools { flex-direction: column; align-items: stretch; }
    .gstr9-shell .g9-hsn-tools .btn { min-height: 44px; }
    .gstr9-shell .g9-hsn-adjust input { flex: 1 1 auto; min-height: 44px; font-size: 16px; }
    .gstr9-shell .g9-hsn-tools .ms-auto { margin-left: 0 !important; }

    .gstr9-shell .g9-obs-fetch { min-height: 44px; }
    .gstr9-shell .g9-obs-table thead { display: none; }
    .gstr9-shell .g9-obs-table tr { display: block; }
    .gstr9-shell .g9-obs-table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 2px 12px; }
    .gstr9-shell .g9-obs-table td[rowspan] { display: flex; }
    .gstr9-shell .g9-obs-table td::before { content: attr(data-label); color: var(--ink-3); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
    .gstr9-shell .g9-obs-section td { display: block; padding: 8px 12px; }
    .gstr9-shell .g9-obs-section td::before { content: none; }
    .gstr9-shell .g9-obs-main { padding-top: 8px; }
    .gstr9-shell .g9-obs-diff { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
    .gstr9-shell .g9-obs-main.has-diff td:first-child { box-shadow: none; }
}
/* #endregion */

/* ---- #region Himanshu (21-Oct-2026): themed GSTR-9 modals (GSTR-3B ITC view, Quick Review) and notes.
   Header/thead are theme fills with white ink; group rows a light theme tint; amounts use status
   colours. Replaces fixed #000 / #17C4BB / #139a93 / bg-primary / bg-light that ignored Appearance. ---- */
/* These modals can render outside .gstr9-shell (the Quick Review lives in the portal host), so
   they read the app-wide tokens directly rather than the shell-only --line / --ink set. */
.g9-modal { border: 1px solid var(--bd, var(--bs-border-color, #d3dbe7)); background: var(--sf-card, var(--bs-body-bg, #fff)); color: var(--tc-strong, var(--bs-body-color, #17202e)); }
.g9-modal-head { background: var(--theme-default, #1f4b8f); color: #fff; border-bottom: 0; }
.g9-modal-head .modal-title { color: #fff; font-family: var(--spq-font-family, inherit); font-size: 15px; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.g9-modal .modal-footer { background: var(--sf-subtle, #f7f9fc); border-top: 1px solid var(--bd, var(--bs-border-color, #d3dbe7)); }
.g9-modal-thead, .g9-modal-thead th { background: color-mix(in srgb, var(--theme-default, #1f4b8f) 85%, #000); color: #fff; }
.g9-modal-group, .g9-modal-group td { background: color-mix(in srgb, var(--theme-default, #1f4b8f) 12%, var(--sf-card, #fff)); color: var(--theme-text, #1f4b8f); }
.g9-row-total, .g9-row-total td { background: var(--sf-raised, #eef1f6); }
.g9-amt-neg, .g9-amt-neg td { color: var(--bs-danger-text-emphasis, #b3261e); }
.g9-amt-pos, .g9-amt-pos td { color: var(--bs-success-text-emphasis, #16794c); }
body.dark-only .g9-modal { border-color: var(--bd, #2b3a51); background: var(--sf-card, #141d2b); color: var(--tcd-strong, #e6ecf5); }
body.dark-only .g9-modal .modal-footer { background: var(--sf-raised, #1e2a3c); border-top-color: var(--bd, #2b3a51); }
body.dark-only .g9-modal-group, body.dark-only .g9-modal-group td { background: color-mix(in srgb, var(--theme-default, #6f9dea) 22%, var(--sf-card, #141d2b)); }
body.dark-only .g9-row-total, body.dark-only .g9-row-total td { background: var(--sf-raised, #1e2a3c); }
body.dark-only .g9-amt-neg, body.dark-only .g9-amt-neg td { color: #f0837a; }
body.dark-only .g9-amt-pos, body.dark-only .g9-amt-pos td { color: #52c08a; }
.gstr9-shell .g9-note { background: var(--info-lt); border: 1px solid var(--line); color: var(--ink-2); }
.gstr9-shell .g9-note-title { color: var(--brand-tx); }

/* the old header row is gone: give the step strip the card's top corners */
.gstr9-shell .gstr9-topbar > .stepstrip:first-child { border-top-left-radius: 8px; border-top-right-radius: 8px; }

/* ---- footer bar on phones: Save stays pinned (MobilePinned), the rest live in the bar's own sheet;
   keep the bar above the home indicator and every tap target at least 44px tall ---- */
@media (max-width: 767.98px) {
    .gstr9-shell .gstr9-bottombar {
        position: sticky; bottom: 0; z-index: 5;
        padding-bottom: calc(.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }
    .gstr9-shell .gstr9-bottombar .spq-ab { min-height: 44px; }
    .gstr9-shell .g9-modal-head .modal-title { font-size: 14px; }
}
/* #endregion */

/* ---- #region Himanshu (21-Oct-2026): GSTR-9 UX round 2 ---- */

/* part tabs — scroll sideways inside themselves, never widen the page */
.gstr9-shell .g9-tabs {
    display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
    padding: 6px 8px; border-top: 1px solid var(--line-soft); background: var(--surface);
}
.gstr9-shell .g9-tab {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
    min-height: 34px; padding: 4px 12px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
    font-family: var(--sans); font-size: 12.5px; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000);
    white-space: nowrap; cursor: pointer; transition: background .12s, border-color .12s;
}
.gstr9-shell .g9-tab:hover { border-color: var(--brand); color: var(--brand-tx); }
.gstr9-shell .g9-tab:active { transform: translateY(1px); }
.gstr9-shell .g9-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.gstr9-shell .g9-tab.is-active { background: var(--brand-lt); border-color: var(--brand); color: var(--brand-tx); }
.gstr9-shell .g9-tab__badge {
    display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; font-size: 10.5px; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); line-height: 1;
}
.gstr9-shell .g9-tab__badge.is-err  { background: var(--err-lt);  color: var(--err); }
.gstr9-shell .g9-tab__badge.is-warn { background: var(--warn-lt); color: var(--warn); }
.gstr9-shell .g9-tab__badge.is-ok   { background: var(--ok-lt);   color: var(--ok); }

/* a portal dataset on screen: say so, and edge every table in amber */
.gstr9-shell .g9-ro-banner {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    padding: 8px 12px; border-top: 1px solid var(--line-soft);
    background: var(--warn-lt); color: var(--ink); font-size: 12.5px;
}
.gstr9-shell .g9-ro-banner > i { color: var(--warn); }
.gstr9-shell .g9-ro-banner__btn {
    margin-left: auto; min-height: 32px; padding: 4px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--warn); background: var(--surface); color: var(--warn);
    font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); cursor: pointer;
}
.gstr9-shell:has(.g9-ro-banner) .gstr9-table-card { border-left: 4px solid var(--warn); }

/* cell-colour legend under each statutory table */
.gstr9-shell .g9-legend {
    display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center;
    margin: -14px 0 18px; padding: 0 4px; font-size: 11.5px; color: var(--ink-3);
}
.gstr9-shell .g9-legend__item { display: inline-flex; align-items: center; gap: 5px; }
.gstr9-shell .g9-legend__item.is-hot { color: var(--warn); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell .g9-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); }
.gstr9-shell .g9-sw--auto   { background: var(--sf-subtle, #f2f6fd); }
.gstr9-shell .g9-sw--portal { background: var(--sf-subtle, #f1f3f6); }
.gstr9-shell .g9-sw--diff   { background: color-mix(in srgb, #ffe8b3 var(--pastel-keep, 100%), var(--sf-card, #ffe8b3)); }
body.dark-only .gstr9-shell .g9-sw--auto   { background: var(--sf-raised, #1e2838); }
body.dark-only .gstr9-shell .g9-sw--portal { background: #262a31; }
body.dark-only .gstr9-shell .g9-sw--diff   { background: #5a4620; }

/* table heading stays in view while scrolling a long table (overflow: clip keeps the rounded
   corners without making the card its own scroll box, which would stop sticky working) */
.gstr9-shell .gstr9-table-card { overflow: clip; }
.gstr9-shell .gstr9-table-card > header { position: sticky; top: 0; z-index: 3; }

/* footer: unsaved changes read amber on the Save tile */
.gstr9-bottombar .g9-save-dirty .spq-ab__cap { color: var(--warn, #a4600b); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }

/* moved out of inline styles */
.gstr9-shell .g9-ov-visible { overflow: visible; }
.gstr9-shell .g9-cmp-toggle { display: flex; gap: 9px; align-items: center; cursor: pointer; font-size: 13px; }
.gstr9-shell .g9-cmp-cell { text-align: left; font-family: var(--mono); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell .g9-cmp-col { text-align: left; color: var(--ink-3); }

/* phones: summary tables become a tappable list — table no., description, validation and the
   headline figure (last column); the full breakdown is one tap away on the part screen */
@media (max-width: 767.98px) {
    .gstr9-shell table.sum th:not(.c-tno):not(.c-dsc):not(.c-val0):not(:last-child),
    .gstr9-shell table.sum td:not(.c-tno):not(.c-dsc):not(.c-val0):not(:last-child) { display: none; }
    .gstr9-shell table.sum th.c-dsc, .gstr9-shell table.sum td.c-dsc { min-width: 0; white-space: normal; }
    .gstr9-shell table.sum tbody tr { cursor: pointer; }
    .gstr9-shell table.sum tbody td { padding-top: 12px; padding-bottom: 12px; }
    .gstr9-shell .g9-tab { min-height: 44px; }
    .gstr9-shell .g9-ro-banner__btn { min-height: 44px; margin-left: 0; width: 100%; }
    .gstr9-shell .gstr9-table-card > header { position: static; }
}
/* #endregion */

/* ---- #region Himanshu (21-Oct-2026): dataset selector — the chosen dataset is a FILLED tile so it
   reads at a glance on any theme (a tinted border was too faint on grey themes). Software data =
   theme fill; the read-only portal datasets = amber fill, matching the read-only banner. Keyed on
   .active (set by Blazor), not :checked, so it can never drift from what is really on screen. ---- */
.gstr9-shell .ds-opt { transition: background .15s, border-color .15s, box-shadow .15s, color .15s; }
.gstr9-shell .ds-opt.active {
    background: var(--theme-default, #1f4b8f); border-color: var(--theme-default, #1f4b8f);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--theme-default, #1f4b8f) 35%, transparent);
}
.gstr9-shell .ds-opt.active .ds-txt,
.gstr9-shell .ds-opt.active .ds-txt em { color: #fff; }
.gstr9-shell .ds-opt.active .ds-dot { border-color: rgb(255 255 255); background: transparent; }
.gstr9-shell .ds-opt.active .ds-dot::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: rgb(255 255 255); }
.gstr9-shell .dsbar[data-active="pc"] .ds-opt.active,
.gstr9-shell .dsbar[data-active="ps"] .ds-opt.active {
    background: #b45309; border-color: #b45309;
    box-shadow: 0 2px 8px rgba(180, 83, 9, .35);
}
body.dark-only .gstr9-shell .dsbar[data-active="pc"] .ds-opt.active,
body.dark-only .gstr9-shell .dsbar[data-active="ps"] .ds-opt.active { background: #9a4a0c; border-color: #c2661a; }
.gstr9-shell .dsbar[data-active="pc"] .ds-opt.active input:checked + .ds-dot,
.gstr9-shell .dsbar[data-active="ps"] .ds-opt.active input:checked + .ds-dot { border-color: rgb(255 255 255); }
.gstr9-shell .dsbar[data-active="pc"] .ds-opt.active input:checked + .ds-dot::after,
.gstr9-shell .dsbar[data-active="ps"] .ds-opt.active input:checked + .ds-dot::after { background: rgb(255 255 255); }
.gstr9-shell .dsbar[data-active="pc"] .ds-opt.active input:checked ~ .ds-txt,
.gstr9-shell .dsbar[data-active="ps"] .ds-opt.active input:checked ~ .ds-txt,
.gstr9-shell .ds-opt.active input:checked ~ .ds-txt { color: #fff; }
.gstr9-shell .ds-opt:not(.active):hover { background: var(--brand-lt); }
.gstr9-shell .ds-opt:focus-within { outline: 2px solid var(--theme-default, #1f4b8f); outline-offset: 2px; }
/* #endregion */

/* ---- #region Himanshu (21-Oct-2026): Prepare confirmation ("how the data will be used") ---- */
.g9-confirm-backdrop { z-index: 10440; }
.g9-confirm-layer { z-index: 10450; }
.g9-confirm-dialog { max-width: 620px; }
.g9-confirm-body { padding: 14px 18px; font-size: 13.5px; line-height: 1.5; }
.g9-confirm-sec + .g9-confirm-sec { margin-top: 12px; }
.g9-confirm-h {
    font-size: 11px; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px;
    color: var(--theme-text, #1f4b8f); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
}
.g9-confirm-body p { margin: 0; }
.g9-confirm-body ul { margin: 0; padding-left: 18px; }
.g9-confirm-body li + li { margin-top: 3px; }
.g9-confirm-warn {
    display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 9px 11px; border-radius: 8px;
    background: color-mix(in srgb, #b45309 12%, var(--sf-card, #fff)); border: 1px solid color-mix(in srgb, #b45309 40%, transparent);
}
.g9-confirm-warn > i { color: color-mix(in srgb, #b45309 var(--ink-keep, 100%), var(--ink-flip, #b45309)); margin-top: 3px; }
.g9-confirm-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.g9-confirm-agree { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.g9-confirm-agree .form-check-input { margin: 0; width: 18px; height: 18px; flex: 0 0 auto; }
.g9-confirm-btns { display: flex; gap: 8px; margin-left: auto; }
body.dark-only .g9-confirm-warn { background: color-mix(in srgb, #b45309 22%, #141d2b); }

/* phones: a bottom sheet, full width, thumb-reachable buttons */
@media (max-width: 767.98px) {
    .g9-confirm-dialog { max-width: none; margin: 0; position: fixed; left: 0; right: 0; bottom: 0; align-items: flex-end; min-height: 0; }
    .g9-confirm-dialog .modal-content { border-radius: 16px 16px 0 0; max-height: 88vh; overflow: auto;
        padding-bottom: env(safe-area-inset-bottom, 0px); animation: g9SheetUp .22s ease-out; }
    .g9-confirm-agree { width: 100%; min-height: 44px; }
    .g9-confirm-btns { width: 100%; }
    .g9-confirm-btns > * { flex: 1 1 0; }
}
@keyframes g9SheetUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .g9-confirm-dialog .modal-content { animation: none; } }
/* #endregion */

/* ---- #region Himanshu (21-Oct-2026): Quick Review table (was an inline <style> with light-only colours) ---- */
.gstr9-review-tbl th, .gstr9-review-tbl td {
    vertical-align: middle !important; padding: 4px 8px !important;
    border: 1px solid var(--bd, #b0c4de) !important;
}
.gstr9-review-tbl td.text-end { font-variant-numeric: tabular-nums; }
.gstr9-review-tbl .disabled-cell { background-color: var(--sf-raised, #d0d5dd) !important; text-align: right; color: var(--tc-muted, #6b7280); }
body.dark-only .gstr9-review-tbl .disabled-cell { background-color: var(--sf-raised, #262a33) !important; color: var(--tcd-muted, #7d8ba1); }
.g9-qr-foot { background: var(--sf-subtle, #eef2f5); border-top: 1px solid var(--bd, #ccc); }
body.dark-only .g9-qr-foot { background: var(--sf-raised, #1e2a3c); }
.g9-qr-note { color: var(--tc-muted, #6b7280); }
@media (max-width: 767.98px) {
    .g9-qr-foot { padding-bottom: calc(.5rem + env(safe-area-inset-bottom, 0px)) !important; }
    .g9-qr-note { width: 100%; }
}
/* #endregion */

/* ---- #region Himanshu (22-Oct-2026): GSTR-9 HSN — Table 17 / 18 summary card + records dialog ---- */
.gstr9-shell .g9-hsn-stats {
    display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0; width: 100%;
    border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; color: inherit;
}
.gstr9-shell .g9-hsn-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-right: 1px solid var(--line-soft); }
.gstr9-shell .g9-hsn-stat:last-child { border-right: 0; }
.gstr9-shell .g9-hsn-stat em { font-style: normal; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); }
.gstr9-shell .g9-hsn-stat b { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell .g9-hsn-stat.is-total { background: var(--brand-lt); }
.gstr9-shell .g9-hsn-stat.is-total b { color: var(--brand-tx); }
.gstr9-shell .g9-hsn-stats:hover .g9-hsn-stat { background: var(--surface-2); }
.gstr9-shell .g9-hsn-stats:hover .g9-hsn-stat.is-total { background: var(--brand-lt); }
.gstr9-shell .g9-hsn-stats:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.gstr9-shell .g9-hsn-empty { padding: 10px 16px 14px; font-size: 12.5px; color: var(--ink-3); border-top: 1px solid var(--line-soft); }

.g9-hsn-backdrop { z-index: 1047; }   /* above the app nav rail (1046), below Bootstrap modals (1050+) */
.g9-hsn-layer { z-index: 1048; }
.g9-hsn-dialog { max-width: min(1500px, 96vw); margin: 2vh auto; }
.g9-hsn-dialog .modal-content { height: 96vh; display: flex; flex-direction: column; }
.g9-hsn-sub { margin-left: 10px; font-size: 12px; opacity: .85; font-weight: clamp(1, calc(500 + var(--spq-fw-delta, 0)), 1000); }
.g9-hsn-toolbar { padding: 8px 12px; border-bottom: 1px solid var(--bd, #d3dbe7); background: var(--sf-card, #fff); }
.g9-hsn-totals {
    display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 14px; font-size: 12.5px;
    background: var(--sf-subtle, #f7f9fc); border-bottom: 1px solid var(--bd, #d3dbe7);
}
.g9-hsn-totals span { display: inline-flex; gap: 6px; align-items: baseline; }
.g9-hsn-totals em { font-style: normal; color: var(--tc-muted, #6b7280); }
.g9-hsn-totals b { font-variant-numeric: tabular-nums; }
.g9-hsn-totals .is-total b { color: var(--theme-text, #1f4b8f); }
.g9-hsn-val { margin: 8px 12px 0; border: 1px solid color-mix(in srgb, #b45309 40%, transparent); border-radius: 8px; overflow: hidden; }
.g9-hsn-val.is-clear { border-color: color-mix(in srgb, #16794c 40%, transparent); }
.g9-hsn-val-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; font-size: 12.5px;
    background: color-mix(in srgb, #b45309 10%, var(--sf-card, #fff));
    font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000);
}
.g9-hsn-val.is-clear .g9-hsn-val-head { background: color-mix(in srgb, #16794c 10%, var(--sf-card, #fff)); }
.g9-hsn-val-list { max-height: 34vh; overflow: auto; overscroll-behavior: contain; }
.g9-hsn-val-list table { width: 100%; border-collapse: collapse; font-size: 12px; }
.g9-hsn-val-list th { position: sticky; top: 0; background: var(--sf-raised, #eef1f6); text-align: left; padding: 5px 8px; }
.g9-hsn-val-list td { padding: 5px 8px; border-top: 1px solid var(--bd, #e5e7eb); vertical-align: top; }
.g9-hsn-val-list tr.sev-error td:nth-child(3) { color: var(--bs-danger-text-emphasis, #b3261e); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.g9-hsn-val-list tr.sev-warn td:nth-child(3) { color: color-mix(in srgb, #a4600b var(--ink-keep, 100%), var(--ink-flip, #a4600b)); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.g9-hsn-body { flex: 1 1 auto; overflow: auto; padding: 10px 12px; }
.g9-hsn-body .gstr9-table-card { margin-bottom: 8px; }
.g9-hsn-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.g9-hsn-hint { font-size: 12px; color: var(--tc-muted, #6b7280); }
.g9-hsn-foot-btns { display: flex; gap: 8px; margin-left: auto; }
body.dark-only .g9-hsn-toolbar { background: var(--sf-card, #141d2b); border-color: var(--bd, #2b3a51); }
body.dark-only .g9-hsn-totals { background: var(--sf-raised, #1e2a3c); border-color: var(--bd, #2b3a51); }
body.dark-only .g9-hsn-val-head { background: color-mix(in srgb, #b45309 20%, #141d2b); }
body.dark-only .g9-hsn-val.is-clear .g9-hsn-val-head { background: color-mix(in srgb, #16794c 20%, #141d2b); }
body.dark-only .g9-hsn-val-list tr.sev-warn td:nth-child(3) { color: #e0a34a; }

@media (max-width: 991.98px) {
    .gstr9-shell .g9-hsn-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .gstr9-shell .g9-hsn-stat:nth-child(4n) { border-right: 0; }
    .g9-hsn-dialog { max-width: none; margin: 0; }
    .g9-hsn-dialog .modal-content { height: 100dvh; border-radius: 0; }
}
@media (max-width: 575.98px) {
    .gstr9-shell .g9-hsn-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gstr9-shell .g9-hsn-stat { border-bottom: 1px solid var(--line-soft); }
    .gstr9-shell .g9-hsn-stat:nth-child(2n) { border-right: 0; }
    .g9-hsn-foot { padding-bottom: calc(.5rem + env(safe-area-inset-bottom, 0px)); }
    .g9-hsn-foot-btns { width: 100%; }
    .g9-hsn-foot-btns > * { flex: 1 1 0; }
}
/* #endregion */

/* Himanshu (22-Oct-2026): the dialog is a flex column — fixed bands must not shrink, or the
   findings panel collapsed to one line under the grid's height. Only the grid area scrolls. */
.g9-hsn-dialog .modal-header,
.g9-hsn-toolbar, .g9-hsn-totals, .g9-hsn-val, .g9-hsn-foot { flex: 0 0 auto; }
.g9-hsn-body { min-height: 180px; }
.g9-hsn-val-list tbody tr { cursor: default; }
.g9-hsn-val-list tbody tr:hover td { background: var(--sf-subtle, #f7f9fc); }
.g9-hsn-val-list td:first-child, .g9-hsn-val-list th:first-child { width: 56px; text-align: center; }
.g9-hsn-val-list td:nth-child(2), .g9-hsn-val-list th:nth-child(2) { width: 110px; }
.g9-hsn-val-list td:nth-child(3), .g9-hsn-val-list th:nth-child(3) { width: 90px; }
body.dark-only .g9-hsn-val-list th { background: var(--sf-raised, #1e2a3c); }
body.dark-only .g9-hsn-val-list tbody tr:hover td { background: var(--sf-raised, #1e2a3c); }

/* #region Himanshu (22-Oct-2026) - Computation KPI strip + SmartGrid sections, ITC-vs-3B compare
   dialog, Table 7H other-reversal dialog. Desktop rules first; phone rules in the media query. */
.gstr9-shell .g9-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 12px; }
.gstr9-shell .g9-kpi { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px;
    background: var(--sf-card, #ffffff); border: 1px solid var(--bd, #e3e8ef); border-left: 4px solid var(--theme-default); }
.gstr9-shell .g9-kpi__lbl { font-size: 11.5px; color: var(--tc-muted, #5b6474); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell .g9-kpi__lbl i { margin-right: 6px; color: var(--theme-text); }
.gstr9-shell .g9-kpi__val { font: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000) 17px var(--mono, monospace); color: var(--tc-strong, #17202e); }
.gstr9-shell .g9-kpi__hint { font-size: 11px; color: color-mix(in srgb, #b42318 var(--ink-keep, 100%), var(--ink-flip, #b42318)); }
.gstr9-shell .g9-kpi.is-ok { border-left-color: #12805c; }
.gstr9-shell .g9-kpi.is-warn { border-left-color: #c77c02; }
.gstr9-shell .g9-kpi.is-bad { border-left-color: #b42318; }
.gstr9-shell .g9-kpi.is-bad .g9-kpi__val { color: color-mix(in srgb, #b42318 var(--ink-keep, 100%), var(--ink-flip, #b42318)); }
body.dark-only .gstr9-shell .g9-kpi.is-bad .g9-kpi__val, body.dark-only .gstr9-shell .g9-kpi__hint { color: #ff8a80; }
.gstr9-shell .g9-cmp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.gstr9-shell .g9-cmp-grid > .card { margin: 0; }
.gstr9-shell .g9-cmp-card { margin-bottom: 12px; }
.gstr9-shell .g9-cmp-body { padding: 6px 8px 8px; }

.g9-itc-layer, .g9-orv-layer { z-index: 1055; }
.g9-itc-backdrop, .g9-orv-backdrop { z-index: 1050; }
.g9-itc-hdr-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.18); }
.g9-itc-hdr-sub { font-size: 12px; opacity: .85; }
.g9-itc-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.g9-itc-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.g9-itc-wrap .spq-cmp-tbl tr.g9-itc-group td { font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); color: var(--theme-text);
    padding: 10px 8px 4px; border: 0; text-transform: uppercase; font-size: 11.5px; letter-spacing: .03em; }
.g9-itc-wrap .spq-cmp-tbl tr.g9-itc-total .sec-name { font-weight: clamp(1, calc(800 + var(--spq-fw-delta, 0)), 1000); }
.g9-itc-copy { font-size: 12px; }
/* Himanshu (31-Oct-2026): one horizontal scroller per GSTR-9 dialog. The scrollable modal body no longer
   scrolls sideways (only the table frame may), and long Particulars wrap instead of widening the table. */
.g9-modal > .modal-body { overflow-x: hidden; }
.g9-itc-only, .g9-as-tbl { width: 100%; }
.g9-itc-only th.col-particulars, .g9-itc-only td.col-particulars { white-space: normal; min-width: 180px; width: 38%; overflow-wrap: anywhere; }
.g9-as-tbl td:nth-child(2) { white-space: normal; overflow-wrap: anywhere; min-width: 160px; }
.g9-itc-only td.num, .g9-itc-only th.num { white-space: nowrap; }
.g9-fetched { white-space: nowrap; }
/* Validate popup (Gstr9ValidationDialog): one table, a band per GSTR-9 table, text columns wrap */
.g9-val-body { background: var(--sf-card, #ffffff); }
.g9-val-sum { margin-bottom: 10px; }
.g9-val-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.g9-val-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.g9-val-tbl { table-layout: auto; }
.g9-val-tbl td.g9-val-part, .g9-val-tbl td.g9-val-msg, .g9-val-tbl td.g9-val-col { white-space: normal; overflow-wrap: anywhere; }
.g9-val-tbl .g9-val-sev { width: 86px; }
.g9-val-tbl .g9-val-ref { width: 72px; font-variant-numeric: tabular-nums; }
.g9-val-tbl .g9-val-part { min-width: 160px; width: 26%; }
.g9-val-tbl .g9-val-col { min-width: 90px; width: 12%; }
.g9-val-tbl .g9-val-amt { width: 120px; }
.g9-val-tbl .g9-val-msg { min-width: 220px; }
.g9-val-tbl .sev { display: inline-block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px; padding: 2px 6px; border-radius: 4px;
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.g9-val-tbl tr.sec-row .g9-val-go { float: right; padding: 0 4px; }
@media (max-width: 767.98px) {
    .g9-val-tbl thead { display: none; }
    .g9-val-tbl, .g9-val-tbl tbody, .g9-val-tbl tr, .g9-val-tbl td { display: block; width: auto !important; min-width: 0 !important; }
    .g9-val-tbl tr.g9-val-line { padding: 6px 4px; border-bottom: 1px solid var(--bd, #e3e8ef); }
    .g9-val-tbl tr.g9-val-line td { border: 0; padding: 2px 6px; text-align: left; white-space: normal; }
    .g9-val-tbl tr.g9-val-line td::before { content: attr(data-label) ": "; color: var(--tc-muted, #5b6474); font-size: 11px; }
    .g9-val-tbl tr.sec-row .g9-val-go { float: none; display: block; min-height: 44px; }
}
.g9-fetched-note { font-size: 12px; color: var(--tc-muted, #5b6474); }

.g9-orv-line { border: 1px solid var(--bd, #e3e8ef); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: var(--sf-subtle, #f8fafc); }
.g9-orv-line-head { display: flex; justify-content: space-between; align-items: center; }
.g9-orv-amts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.g9-orv-total { background: var(--sf-raised, #eef2f8); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }

@media (max-width: 991.98px) {
    .gstr9-shell .g9-cmp-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
    .gstr9-shell .g9-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .gstr9-shell .g9-kpi__val { font-size: 15px; }
    .g9-orv-amts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .g9-orv-amts input, .g9-orv-line input { min-height: 44px; font-size: 16px; }
    .g9-itc-layer .modal-footer, .g9-orv-layer .modal-footer { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
}
/* #endregion */

/* #region Himanshu (22-Oct-2026) - GSTR-9 Tables 4-16 and the Computation grids: no per-table
   Excel / PDF strip above the sheet (HSN Tables 17 / 18 keep theirs). */
.g9-nostrip .sheet-header, .g9-nostrip .smartgrid-toolbar:empty { display: none !important; }
/* #endregion */

/* #region Himanshu (22-Oct-2026) - "GSTR-9 Computation New" sheet: professional computation layout.
   Fixed column widths (Description / Data source no longer stretch), wrapped text, row types told
   apart by tint, sticky header, and the table scrolls inside its own frame on small screens. */
.gstr9-shell .g9-cmpn-wrap { overflow: auto; max-height: 72vh; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--bd, #e3e8ef); }
.gstr9-shell table.g9-cmpn-tbl { table-layout: fixed; width: 100%; min-width: 1080px; font-size: 12.5px; }
.gstr9-shell table.g9-cmpn-tbl col.w-sno { width: 46px; }
.gstr9-shell table.g9-cmpn-tbl col.w-desc { width: 30%; }
.gstr9-shell table.g9-cmpn-tbl col.w-src { width: 132px; }
.gstr9-shell table.g9-cmpn-tbl col.w-amt { width: auto; }
.gstr9-shell table.g9-cmpn-tbl col.w-act { width: 84px; }
.gstr9-shell table.g9-cmpn-tbl thead th { position: sticky; top: 0; z-index: 2; padding: 8px 8px; white-space: normal; line-height: 1.25; vertical-align: bottom; }
.gstr9-shell table.g9-cmpn-tbl thead th.c-sno, .gstr9-shell table.g9-cmpn-tbl td.c-sno { text-align: center; }
.gstr9-shell table.g9-cmpn-tbl thead th.c-desc, .gstr9-shell table.g9-cmpn-tbl thead th.c-src { text-align: left; }
.gstr9-shell table.g9-cmpn-tbl td { padding: 6px 8px; vertical-align: top; font-size: 12.5px; }
.gstr9-shell table.g9-cmpn-tbl td.c-sno { font-family: var(--sans); color: var(--tc-muted, #5b6474); }
.gstr9-shell table.g9-cmpn-tbl td.c-desc, .gstr9-shell table.g9-cmpn-tbl td.c-src {
    white-space: normal; overflow-wrap: anywhere; text-align: left; font-family: var(--spq-font-family, var(--sans)); line-height: 1.35; }
.gstr9-shell .g9-cmpn-d { display: block; color: var(--tc-text, #2b3442); }
.gstr9-shell .g9-cmpn-f { display: block; margin-top: 2px; font: 11px var(--mono, monospace); color: var(--tc-muted, #5b6474); }
.gstr9-shell .g9-cmpn-src { display: inline-flex; align-items: flex-start; gap: 5px; max-width: 100%; padding: 2px 7px; border-radius: 6px;
    font-size: 11px; line-height: 1.3; white-space: normal; background: var(--sf-subtle, #f3f5f9); color: var(--tc-muted, #5b6474); border: 1px solid var(--bd, #e3e8ef); }
.gstr9-shell .g9-cmpn-src i { margin-top: 2px; font-size: 10px; opacity: .8; }
.gstr9-shell .g9-cmpn-src.is-manual { border-color: #9ec5fe; color: var(--theme-text); }
.gstr9-shell .g9-cmpn-src.is-gstn { border-color: #a3cfbb; }
.gstr9-shell .g9-cmpn-src.is-calc { border-style: dashed; }

.gstr9-shell table.g9-cmpn-tbl tr.g9-cmpn-sec td { position: static; padding: 9px 10px; text-align: left; font-family: var(--sans);
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); font-size: 12px; letter-spacing: .03em; text-transform: uppercase;
    color: var(--theme-text); background: var(--sf-raised, #eef2f8); border-top: 2px solid var(--theme-default); }
.gstr9-shell table.g9-cmpn-tbl tr.is-manual td, .gstr9-shell table.g9-cmpn-tbl tr.is-import td { background: var(--sf-card, #f7faff); }
.gstr9-shell table.g9-cmpn-tbl tr.is-total td { font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); background: var(--sf-subtle, #f3f6fb); }
.gstr9-shell table.g9-cmpn-tbl tr.is-band td { font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); background: var(--sf-raised, #e8eef8); border-top: 1px solid var(--bd, #d6deea); }
.gstr9-shell table.g9-cmpn-tbl tr.is-diff td { font-style: normal; border-bottom: 1px solid var(--bd, #e3e8ef); }
.gstr9-shell table.g9-cmpn-tbl tr.is-diff:not(.is-nil) td.num { font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); color: color-mix(in srgb, #b42318 var(--ink-keep, 100%), var(--ink-flip, #b42318)); }
.gstr9-shell table.g9-cmpn-tbl tr.is-diff.is-nil td.num { color: var(--tc-faint, #8a93a3); }
.gstr9-shell table.g9-cmpn-tbl tr.is-pay td { background: rgba(180, 35, 24, .07); }
.gstr9-shell table.g9-cmpn-tbl tr.is-excess td { background: rgba(18, 128, 92, .08); }
.gstr9-shell table.g9-cmpn-tbl tr.is-excess td.num { color: color-mix(in srgb, #12805c var(--ink-keep, 100%), var(--ink-flip, #12805c)); }
.gstr9-shell table.g9-cmpn-tbl td.c-tot { font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell table.g9-cmpn-tbl td.c-na { color: var(--tc-faint, #8a93a3); text-align: center; }
.gstr9-shell table.g9-cmpn-tbl td.c-in { padding: 3px 4px; }
.gstr9-shell .g9-cmpn-in { width: 100%; min-width: 0; padding: 4px 6px; border: 1px solid var(--bd, #c9d4e5); border-radius: 6px; text-align: right;
    font: 12.5px var(--mono, monospace); background: var(--sf-card, #ffffff); color: var(--tc-strong, #17202e); }
.gstr9-shell .g9-cmpn-in:focus { outline: 2px solid var(--theme-default); outline-offset: -1px; border-color: transparent; }
.gstr9-shell table.g9-cmpn-tbl td.c-act { text-align: center; }
.gstr9-shell .g9-cmpn-link { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; font-size: 11.5px;
    border: 1px solid var(--theme-default); background: transparent; color: var(--theme-text); white-space: nowrap; }
.gstr9-shell .g9-cmpn-link:hover:not(:disabled) { background: var(--theme-default); color: #fff; }
.gstr9-shell .g9-cmpn-notes { padding: 10px 14px; font-size: 12px; line-height: 1.45; color: var(--tc-text, #2b3442); border-top: 1px solid var(--bd, #e3e8ef); }
.gstr9-shell .g9-cmpn-notes p { margin: 0 0 6px; }
.gstr9-shell .g9-cmpn-warn { color: color-mix(in srgb, #9a5b00 var(--ink-keep, 100%), var(--ink-flip, #9a5b00)); }
@media (max-width: 767.98px) {
    .gstr9-shell .g9-cmpn-wrap { max-height: none; }
    .gstr9-shell table.g9-cmpn-tbl { min-width: 900px; }
    .gstr9-shell table.g9-cmpn-tbl col.w-desc { width: 220px; }
    .gstr9-shell .g9-cmpn-in { min-height: 40px; font-size: 16px; }
    .gstr9-shell .g9-cmpn-link { min-height: 40px; }
}
/* #endregion */

/* #region Himanshu (23-Oct-2026) - Computation New as one SmartGrid: frame + colour legend */
.gstr9-shell .g9-cmpn-grid { display: flex; flex-direction: column; padding: 6px 8px 0; }
.gstr9-shell .g9-cmpn-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 14px; font-size: 11.5px; color: var(--tc-muted, #5b6474); }
.gstr9-shell .g9-cmpn-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gstr9-shell .g9-cmpn-legend .g9-sw { width: 14px; height: 12px; border-radius: 3px; border: 1px solid var(--bd, #c9d4e5); display: inline-block; }
.gstr9-shell .g9-cmpn-legend .g9-sw--manual { background: var(--sf-subtle, #eef5ff); border-color: #0b5cad; }
.gstr9-shell .g9-cmpn-legend .g9-sw--import { background: var(--sf-subtle, #ecf8f3); border-color: #0f6b5c; }
.gstr9-shell .g9-cmpn-legend .g9-sw--calc { background: var(--sf-card, #ffffff); }
.gstr9-shell .g9-cmpn-legend .g9-sw--total { background: var(--sf-raised, #e6edf8); }
body.dark-only .gstr9-shell .g9-cmpn-legend .g9-sw--manual { background: var(--sf-raised, #1c2a40); border-color: #8ab4ff; }
body.dark-only .gstr9-shell .g9-cmpn-legend .g9-sw--import { background: #173129; border-color: #6fd6bf; }
body.dark-only .gstr9-shell .g9-cmpn-legend .g9-sw--total { background: var(--sf-raised, #25314a); }
.gstr9-shell .g9-cmpn-legend .is-bad { color: color-mix(in srgb, #b42318 var(--ink-keep, 100%), var(--ink-flip, #b42318)); }
.gstr9-shell .g9-cmpn-legend .is-good { color: color-mix(in srgb, #12805c var(--ink-keep, 100%), var(--ink-flip, #12805c)); }
/* #endregion */

/* #region Himanshu (23-Oct-2026) - "Help" pill on each GSTR-9 table (SPEQTA Knowledge link) */
.g9-help-link { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px 0 4px; border-radius: 999px;
    font-size: 12px; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); text-decoration: none; white-space: nowrap;
    color: var(--theme-text); background: var(--sf-card, #ffffff); border: 1px solid var(--theme-default);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08); transition: background .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease; }
.g9-help-link i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 13px;
    background: var(--theme-default); color: #fff; }
.g9-help-link:hover, .g9-help-link:focus-visible { background: var(--theme-default); color: #fff; transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 24, 40, .15); text-decoration: none; }
.g9-help-link:hover i, .g9-help-link:focus-visible i { background: var(--sf-card, #fff); color: var(--theme-text, var(--theme-default)); }
.g9-modal-head .g9-help-link { margin-left: auto; border-color: rgba(255, 255, 255, .7); background: transparent; color: #fff; box-shadow: none; }
.g9-modal-head .g9-help-link i { background: var(--sf-card, #fff); color: var(--theme-text, var(--theme-default)); }
@media (prefers-reduced-motion: reduce) { .g9-help-link { transition: none; } .g9-help-link:hover { transform: none; } }
@media (max-width: 767.98px) {
    .g9-help-link { height: 44px; padding: 0 14px 0 6px; }
    .g9-help-link i { width: 30px; height: 30px; }
}
/* #endregion */

/* #region Himanshu (23-Oct-2026) - Computation sheet rev 2: one page scroll, fixed title bar and
   column headings, minimal colour. The grid is sized to all its rows (no inner scroll), so its
   overflow is opened up to the page and the headings stick under the card's title bar. */
.gstr9-shell .card.g9-cmpn { overflow: visible; --g9-cmpn-head-h: 64px; }
.gstr9-shell .card.g9-cmpn > header.g9-cmpn-head {
    position: sticky; top: 0; z-index: 30; min-height: var(--g9-cmpn-head-h); box-sizing: border-box;
    background: var(--surface, var(--sf-card, #ffffff)); border-bottom: 1px solid var(--line, #e3e8ef);
    border-top-left-radius: var(--radius, 10px); border-top-right-radius: var(--radius, 10px); }
.gstr9-shell .g9-cmpn-grid { overflow: visible; padding: 0 8px; }
.gstr9-shell .g9-cmpn-grid .smartgrid-main-container,
.gstr9-shell .g9-cmpn-grid .smartgrid-root,
.gstr9-shell .g9-cmpn-grid .data-grid,
.gstr9-shell .g9-cmpn-grid .data-grid > .vars,
.gstr9-shell .g9-cmpn-grid .sheet-menu-target { overflow: visible !important; }
.gstr9-shell .g9-cmpn-grid .sheet-col-head-container { position: sticky !important; top: var(--g9-cmpn-head-h) !important; z-index: 25 !important; }
.gstr9-shell .g9-cmpn-legend .is-manual { color: color-mix(in srgb, #0b5cad var(--ink-keep, 100%), var(--ink-flip, #0b5cad)); }
.gstr9-shell .g9-cmpn-legend .is-import { color: color-mix(in srgb, #0f6b5c var(--ink-keep, 100%), var(--ink-flip, #0f6b5c)); }
@media (max-width: 991.98px) {
    /* the title bar wraps on narrow screens: keep it in flow, let the wide sheet scroll sideways in its own frame */
    .gstr9-shell .card.g9-cmpn > header.g9-cmpn-head { position: static; }
    .gstr9-shell .g9-cmpn-grid { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .gstr9-shell .g9-cmpn-grid .sheet-col-head-container { position: static !important; }
}
/* #endregion */

/* #region Himanshu (23-Oct-2026) - ITC (GSTR-3B annual summary) dialog and Table 7H reversals dialog */
.g9-itc-only .g9-itc-tbl { color: var(--tc-muted, #5b6474); font-size: 11.5px; white-space: nowrap; }
.g9-itc-only .g9-itc-sum { font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.g9-itc-only tr.g9-itc-total td { font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); background: var(--sf-subtle, #f3f6fb); }
.g9-itc-only .g9-itc-act { width: 40px; text-align: center; }
.g9-orv-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.g9-orv-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.g9-orv-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.g9-orv-tbl th { padding: 7px 6px; font-size: 11.5px; color: var(--tc-muted, #5b6474); border-bottom: 2px solid var(--bd, #dfe5ee); text-align: left; white-space: nowrap; }
.g9-orv-tbl td { padding: 5px 6px; border-bottom: 1px solid var(--bd, #edf1f6); vertical-align: middle; }
.g9-orv-tbl .num { text-align: right; min-width: 110px; }
.g9-orv-tbl .c-no { width: 34px; text-align: center; color: var(--tc-muted, #5b6474); }
.g9-orv-tbl .c-desc { min-width: 240px; }
.g9-orv-tbl .c-del { width: 44px; text-align: center; }
.g9-orv-tbl tfoot td { border-top: 2px solid var(--bd, #dfe5ee); border-bottom: 0; background: var(--sf-subtle, #f3f6fb); }
.g9-orv-del { color: color-mix(in srgb, #b42318 var(--ink-keep, 100%), var(--ink-flip, #b42318)); border: 1px solid transparent; }
.g9-orv-del:hover { border-color: currentColor; }
@media (max-width: 767.98px) {
    /* phones: each reversal becomes a stacked card */
    .g9-orv-tbl thead { display: none; }
    .g9-orv-tbl, .g9-orv-tbl tbody, .g9-orv-tbl tfoot, .g9-orv-tbl tr, .g9-orv-tbl td { display: block; width: 100%; }
    .g9-orv-tbl tr { border: 1px solid var(--bd, #dfe5ee); border-radius: 10px; padding: 8px; margin-bottom: 10px; }
    .g9-orv-tbl td { border: 0; padding: 4px 0; }
    .g9-orv-tbl td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--tc-muted, #5b6474); }
    .g9-orv-tbl .num { text-align: left; }
    .g9-orv-tbl input { min-height: 44px; font-size: 16px; }
    .g9-orv-del { min-width: 44px; min-height: 44px; }
}
/* #endregion */

/* #region Himanshu (23-Oct-2026) - Computation sheet rev 3: one fixed band, prominent centred headings.
   The module top bar is sticky at the same spot, so on this page it scrolls away and the computation
   title bar + column headings are the only fixed band (its step pills no longer peek through). */
.gstr9-shell:has(.g9-cmpn) > .gstr9-topbar-card { position: static; }
.gstr9-shell .card.g9-cmpn > header.g9-cmpn-head { z-index: 45; box-shadow: 0 1px 0 var(--line, #e3e8ef); }
.gstr9-shell .g9-cmpn-grid .sheet-col-head-container {
    z-index: 44 !important; background: var(--surface, var(--sf-card, #ffffff));
    box-shadow: 0 3px 6px rgba(16, 24, 40, .10); }
.gstr9-shell .g9-cmpn-grid .sheet-col-head-container .col-head,
.gstr9-shell .g9-cmpn-grid .sheet-col-head-container .sheet-cell {
    justify-content: center !important; text-align: center !important;
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell .g9-cmpn-grid .sheet-col-head-container .sheet-cell > div,
.gstr9-shell .g9-cmpn-grid .sheet-col-head-container .sheet-cell > span { justify-content: center !important; text-align: center !important; margin-inline: auto; }
/* #endregion */

/* #region Himanshu (23-Oct-2026) - rev 4: flat light-blue column headings on the computation sheet
   (no inset / pressed look), ITC dialog colours, and the HSN dialog grid filling its window. */
.gstr9-shell .g9-cmpn-grid .sheet-col-head-container { box-shadow: 0 1px 0 var(--bd, #c9d6ea) !important; }
.gstr9-shell .g9-cmpn-grid .sheet-col-head-container .col-head,
.gstr9-shell .g9-cmpn-grid .sheet-col-head-container .sheet-cell {
    background: var(--g9-blue-light, #e8f0fb) !important; background-image: none !important; box-shadow: none !important;
    color: var(--theme-text) !important; border-color: var(--bd, #c9d6ea) !important; }
.g9-itc-only tr.is-rev td { color: color-mix(in srgb, #b42318 var(--ink-keep, 100%), var(--ink-flip, #b42318)); }
.g9-itc-only tr.is-net td { color: color-mix(in srgb, #0b6b3a var(--ink-keep, 100%), var(--ink-flip, #0b6b3a)); }
.g9-hsn-body { display: flex; flex-direction: column; overflow: hidden; }
.g9-hsn-body .gstr9-table-card.g9-in-dialog { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin: 0; border: 0; box-shadow: none; overflow: hidden; }
.g9-hsn-body .g9-in-dialog > .tbl-wrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.g9-hsn-body .g9-in-dialog .g9-fill { flex: 1 1 auto; min-height: 0; }
.g9-hsn-body .g9-in-dialog .g9-fill .data-grid > .vars { overflow: auto !important; }
/* #endregion */

/* #region Himanshu (23-Oct-2026) - GSTR-9 Compare in the GSTR-1 / GSTR-3B compare style */
.gstr9-shell .g9-cx { overflow: visible; }
.gstr9-shell .g9-cx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 14px; border-bottom: 1px solid var(--bd, #e3e8ef); }
.gstr9-shell .g9-cx-seg { display: inline-flex; border: 1px solid var(--theme-default); border-radius: 8px; overflow: hidden; }
.gstr9-shell .g9-cx-segbtn { border: 0; background: transparent; color: var(--theme-text); padding: 6px 12px; font-size: 12.5px;
    font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); border-right: 1px solid var(--theme-default); }
.gstr9-shell .g9-cx-segbtn:last-child { border-right: 0; }
.gstr9-shell .g9-cx-segbtn.is-on { background: var(--theme-default); color: #fff; }
.gstr9-shell .g9-cx-segbtn:disabled { opacity: .45; cursor: not-allowed; }
.gstr9-shell .g9-cx-exp { margin-left: auto; display: flex; gap: 4px; }
.gstr9-shell .g9-cx-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 8px 14px; font-size: 12px; color: var(--tc-muted, #5b6474); }
.gstr9-shell .g9-cx-legend i { margin-right: 6px; color: var(--theme-text); }
.gstr9-shell .g9-cx-tbl { border-top: 1px solid var(--bd, #e3e8ef); }
.gstr9-shell .g9-cx-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 0; text-align: left;
    background: var(--sf-subtle, #f3f6fb); color: var(--tc-strong, #17202e); font-size: 13px; }
.gstr9-shell .g9-cx-head:hover { background: var(--sf-raised, #e8eef8); }
.gstr9-shell .g9-cx-head.is-bad { box-shadow: inset 4px 0 0 #b42318; }
.gstr9-shell .g9-cx-head.is-ok { box-shadow: inset 4px 0 0 #12805c; }
.gstr9-shell .g9-cx-chev { width: 14px; color: var(--tc-muted, #5b6474); }
.gstr9-shell .g9-cx-no { min-width: 40px; padding: 2px 8px; border-radius: 6px; text-align: center; background: var(--theme-default); color: #fff;
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); font-size: 12px; }
.gstr9-shell .g9-cx-title { flex: 1 1 auto; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell .g9-cx-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0 8px 8px; }
.gstr9-shell .g9-cx-empty { padding: 10px 14px; font-size: 12.5px; color: var(--tc-muted, #5b6474); }
.gstr9-shell .g9-cx-foot { padding: 10px 14px; border-top: 1px solid var(--bd, #e3e8ef); }
@media (max-width: 767.98px) {
    .gstr9-shell .g9-cx-segbtn { min-height: 44px; }
    .gstr9-shell .g9-cx-exp { margin-left: 0; }
    .gstr9-shell .g9-cx-head { min-height: 48px; }
}
/* #endregion */

/* #region Himanshu (23-Oct-2026) - dialogs must sit above the GSTR-9 footer bar.
   Step dialogs render inside the sticky top bar (z-index 20) and table dialogs inside a table card;
   that ancestor's stacking context trapped the dialog at level 20, and the sticky footer bar (also 20,
   later in the page) painted over it. While a dialog is open its host is lifted above everything and
   the footer drops its own layer. The footer also keeps clear of the floating help / report buttons. */
.gstr9-shell > .gstr9-topbar-card:has(.modal.d-block, .modal.show),
.gstr9-shell .card:has(> * .modal.d-block, > * .modal.show),
.gstr9-shell .card:has(.modal.d-block, .modal.show) { z-index: 1060 !important; position: relative; }
body:has(.modal.d-block, .modal.show) .gstr9-bottombar { z-index: auto; }
@media (min-width: 992px) {
    .gstr9-bottombar { padding-right: 160px !important; }
}
/* #endregion */

/* #region Himanshu (23-Oct-2026) - GSTR-9 Quick Review in the compare style */
.g9-qr-layer { z-index: 1065; }
.g9-qr-backdrop { z-index: 1060; }
.g9-qr-body { background: var(--sf-subtle, #f7f9fc); }
.g9-qr-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--sf-card, #ffffff); border-radius: 8px; }
.g9-qr-tbl .g9-qr-tno { width: 90px; text-align: center; color: var(--tc-muted, #5b6474); font-size: 11.5px; white-space: nowrap; }
.g9-qr-tbl .g9-qr-sum { font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.g9-qr-tbl tr.g9-qr-strong td { font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.g9-qr-tbl tr.g9-qr-note-row td { padding: 8px 12px; font-size: 12px; line-height: 1.45; color: var(--tc-muted, #5b6474);
    background: var(--sf-subtle, #f3f6fb); border-bottom: 1px solid var(--bd, #e3e8ef); }
.g9-qr-tbl td.cell-bad { color: color-mix(in srgb, #b42318 var(--ink-keep, 100%), var(--ink-flip, #b42318)) !important;
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.g9-qr-foot .g9-qr-confirm { flex: 1 1 420px; }
@media (max-width: 767.98px) {
    .g9-qr-foot .g9-qr-confirm { flex-basis: 100%; }
}
/* #endregion */

/* Himanshu (23-Oct-2026) - compare: what the computed summary covers */
.gstr9-shell .g9-cx-scope { margin: 0 14px 10px; padding: 8px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.45;
    background: var(--sf-subtle, #f3f6fb); color: var(--tc-text, #2b3442); border: 1px solid var(--bd, #e3e8ef); }
.gstr9-shell .g9-cx-scope i { color: var(--theme-text); }

/* #region Himanshu (23-Oct-2026) - GSTR-9 "View Turnover" dialog */
.g9-to-layer { z-index: 1065; }
.g9-to-backdrop { z-index: 1060; }
.g9-to-dialog { max-width: 720px; }
.g9-to-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.g9-to-kpi { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px;
    border: 1px solid var(--bd, #e3e8ef); border-left: 4px solid var(--theme-default); background: var(--sf-card, #ffffff); }
.g9-to-kpi span { font-size: 11.5px; color: var(--tc-muted, #5b6474); }
.g9-to-kpi b { font: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000) 16px var(--mono, monospace); color: var(--tc-strong, #17202e); }
.g9-to-kpi em { font-style: normal; font-size: 11px; color: var(--tc-muted, #5b6474); }
.g9-to-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.g9-to-tbl th, .g9-to-tbl td { padding: 9px 8px; border-bottom: 1px solid var(--bd, #e3e8ef); text-align: left; vertical-align: middle; }
.g9-to-tbl th { font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); color: var(--tc-strong, #17202e); }
.g9-to-tbl .g9-to-rule { font-size: 12px; color: var(--tc-muted, #5b6474); }
.g9-to-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); white-space: nowrap; }
.g9-to-badge.is-man { color: color-mix(in srgb, #b42318 var(--ink-keep, 100%), var(--ink-flip, #b42318)); background: rgba(180, 35, 24, .1); }
.g9-to-badge.is-opt { color: color-mix(in srgb, #12805c var(--ink-keep, 100%), var(--ink-flip, #12805c)); background: rgba(18, 128, 92, .1); }
.g9-to-badge.is-na { color: var(--tc-muted, #5b6474); background: var(--sf-subtle, #f3f6fb); }
.g9-to-fybar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 12px; font-size: 12.5px; color: var(--tc-muted, #5b6474); }
.g9-to-fybar select { width: auto; min-width: 160px; }
.g9-to-asof { margin-top: 12px; font-size: 12.5px; color: var(--tc-muted, #5b6474); }
@media (max-width: 575.98px) {
    .g9-to-grid { grid-template-columns: minmax(0, 1fr); }
    .g9-to-tbl .g9-to-rule { display: none; }
    .g9-to-fybar { justify-content: space-between; }
    .g9-to-fybar select { min-height: 44px; flex: 1; }
}
/* #endregion */

/* #region Himanshu (24-Oct-2026) - GSTR-9 fixed tables: column headings wrap onto two lines (heading
   height 44px is set in Gstr9TableSheet) so "Paid through ITC - CGST" is read in full. */
.gstr9-table-card:not(.g9-in-dialog) .sheet-col-head-container .sheet-cell,
.gstr9-table-card:not(.g9-in-dialog) .sheet-col-head-container .sheet-cell > div,
.gstr9-table-card:not(.g9-in-dialog) .sheet-col-head-container .sheet-cell > span {
    white-space: normal !important; overflow-wrap: anywhere; line-height: 1.15; text-overflow: clip !important; }
/* #endregion */

/* #region Himanshu (24-Oct-2026) - Step-4 Compare dialog: the compare view inside a modal body (the
   body carries .gstr9-shell so the compare styles apply; it scrolls, the header and footer stay put). */
.g9-cmpd-body.gstr9-shell { display: block; height: auto; min-height: 240px; }
.g9-cmpd-body .card.g9-cx { margin: 0; border: 0; box-shadow: none; }
@media (max-width: 991.98px) {
    .g9-cmpd-dialog .modal-footer { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
}
/* #endregion */

/* #region Himanshu (24-Oct-2026) - Validation page: Validations / Observation tabs, findings per table row */
.gstr9-shell .g9-vt-tabs { display: flex; gap: 6px; margin: 4px 0 10px; border-bottom: 1px solid var(--bd, #e3e8ef); }
.gstr9-shell .g9-vt-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 0; border-bottom: 3px solid transparent;
    background: transparent; color: var(--tc-muted, #5b6472); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); min-height: 44px; }
.gstr9-shell .g9-vt-tab.is-on { color: var(--theme-text); border-bottom-color: var(--theme-default); }
.gstr9-shell .g9-vt-count { min-width: 22px; padding: 1px 7px; border-radius: 11px; font-size: 12px; text-align: center; color: #fff; background: #2e7d32; }
.gstr9-shell .g9-vt-count.is-bad { background: #b42318; }
.gstr9-shell .g9-vt-count.is-warn { background: #b26a00; }
.gstr9-shell .g9-vt-body { padding: 6px 10px 10px; }
.gstr9-shell .g9-vt-list { list-style: none; margin: 6px 0 0; padding: 0; }
.gstr9-shell .g9-vt-item { display: flex; gap: 10px; align-items: baseline; padding: 5px 0; border-top: 1px dashed var(--bd, #e3e8ef); }
.gstr9-shell .g9-vt-item:first-child { border-top: 0; }
.gstr9-shell .g9-vt-item .sev { flex: 0 0 auto; }
.gstr9-shell .g9-vt-go { padding-left: 0; }
.gstr9-shell .g9-obs-ttl { display: flex; flex-direction: column; line-height: 1.25; }
.gstr9-shell .g9-obs-ttl span { font-size: 12px; color: var(--tc-muted, #5b6472); }
@media (max-width: 767.98px) {
    .gstr9-shell .g9-vt-tabs { overflow-x: auto; }
    .gstr9-shell .g9-vt-tab { flex: 1 1 0; justify-content: center; }
}
/* #endregion */

/* #region Himanshu (24-Oct-2026) - headings centred (GST amount columns), pinned compare / observation heading */
.gstr9-table-card .sheet-col-head-container .sheet-cell,
.gstr9-table-card .sheet-col-head-container .sheet-cell > div,
.gstr9-table-card .sheet-col-head-container .sheet-cell > span { justify-content: center !important; text-align: center !important; }
.gstr9-table-card .sheet-col-head-container .sheet-cell:first-child,
.gstr9-table-card .sheet-col-head-container .sheet-cell:first-child > div { justify-content: flex-start !important; text-align: start !important; }
.gstr9-shell .spq-cmp-tbl thead th.num { text-align: center; }
.gstr9-shell .g9-cx-sticky { position: sticky; top: var(--g9-cx-sticky-top, 0px); z-index: 6; background: var(--sf-card, #ffffff); box-shadow: 0 2px 4px rgba(16, 24, 40, .08); }
.gstr9-shell .g9-cx-sticky .spq-cmp-tbl { margin: 0; }
.gstr9-shell .spq-cmp-tbl.g9-cx-std { table-layout: fixed; width: 100%; }
.gstr9-shell .spq-cmp-tbl.g9-cx-std col.g9-cx-c0 { width: 31%; }
.gstr9-shell .spq-cmp-tbl.g9-cx-std .g9-cx-tot { font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.gstr9-shell .g9-cx-tbl .g9-cx-wrap { overflow-x: visible; }
@media (max-width: 767.98px) {
    .gstr9-shell .g9-cx-sticky { display: none; }   /* phone rows are cards with their own labels */
    .gstr9-shell .spq-cmp-tbl.g9-cx-std { table-layout: auto; }
}
/* #endregion */

/* #region Himanshu (24-Oct-2026) - part tabs: full part name with the table numbers in small text under it */
.gstr9-shell .g9-tab__text { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.gstr9-shell .g9-tab__sub { font-size: 10.5px; color: var(--tc-muted, #5b6472); font-weight: clamp(1, calc(500 + var(--spq-fw-delta, 0)), 1000); letter-spacing: .01em; }
.gstr9-shell .g9-tab.is-active .g9-tab__sub { color: var(--theme-text); }
/* #endregion */

/* #region Himanshu (26-Oct-2026) - GSTR-1 / GSTR-3B annual summary viewer (footer -> Export PDF) */
.g9-as-dialog { max-width: 1140px; }
.g9-as-body { background: var(--sf-card, #ffffff); }
.g9-as-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.g9-as-tbl { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--tc-text, #1f2937); }
.g9-as-tbl th, .g9-as-tbl td { padding: 6px 10px; border: 1px solid var(--bd, #d3dbe7); vertical-align: middle; }
.g9-as-tbl thead th { background: var(--theme-default, #1f4b8f); color: #fff; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); text-align: center; position: sticky; top: 0; z-index: 1; }
.g9-as-tbl td.num, .g9-as-tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.g9-as-tbl thead th.num { text-align: center; }
.g9-as-tbl tr.g9-as-heading td { background: color-mix(in srgb, var(--theme-default, #1f4b8f) 14%, var(--sf-card, #ffffff)); color: var(--theme-text, #1f4b8f); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); letter-spacing: .02em; }
.g9-as-tbl tr.g9-as-subheading td { background: var(--sf-subtle, #f4f7fb); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.g9-as-tbl tr.g9-as-total td { background: color-mix(in srgb, var(--theme-default, #1f4b8f) 8%, var(--sf-card, #ffffff)); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
body.dark-only .g9-as-tbl { color: var(--tcd-text, #dbe3ef); }
@media (max-width: 767.98px) {
    .g9-as-tbl { min-width: 640px; font-size: 12.5px; }
    .g9-as-tbl th, .g9-as-tbl td { padding: 8px 8px; }
}
/* #endregion */

/* Himanshu (28-Oct-2026): desktop step strip stays ONE row - a wrapped tile (View Turnover) doubled the
   strip and stretched the dataset tiles; the row now scrolls sideways instead of growing taller. */
@media (min-width: 992px) {
    .gstr9-shell .steps .spq-abar__row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
    .gstr9-shell .steps .spq-abar__row > * { flex: 0 0 auto; }
    .gstr9-shell .stepstrip { align-items: center; }
}

/* #region Himanshu (28-Oct-2026) - GSTR-9 table headings (Tables 4-18, HSN, Computation): amount
   headings (Taxable Value, CGST, SGST, IGST, Cess, Total GST) sit middle-centre of the heading cell,
   not top-left. The heading's inner wrapper fills the cell so both axes can centre. */
.gstr9-table-card .sheet-col-head-container .sheet-cell,
.gstr9-shell .g9-cmpn-grid .sheet-col-head-container .sheet-cell {
    display: flex !important; align-items: center !important; justify-content: center !important; text-align: center !important; }
.gstr9-table-card .sheet-col-head-container .sheet-cell > div,
.gstr9-shell .g9-cmpn-grid .sheet-col-head-container .sheet-cell > div {
    display: flex !important; flex-wrap: wrap; align-items: center !important; justify-content: center !important;
    text-align: center !important; width: 100%; height: 100%; margin: 0 !important; }
/* the description heading stays left-aligned, only vertically centred */
.gstr9-table-card .sheet-col-head-container .sheet-cell:first-child,
.gstr9-table-card .sheet-col-head-container .sheet-cell:first-child > div { justify-content: flex-start !important; text-align: start !important; }
/* #endregion */

/* #region Himanshu (28-Oct-2026) - Quick Review: nil-difference toggle, column headings pinned to the
   top of the scrolling body on an opaque background (the wrapper must not clip, or sticky stops working). */
.g9-qr-filter { display: flex; justify-content: flex-end; padding: 2px 6px 8px; }
.g9-qr-filter .form-check-label { font-size: 13px; color: var(--tc-text, #33415c); cursor: pointer; }
@media (min-width: 768px) {
    .g9-qr-wrap { overflow: visible; }
    .g9-qr-tbl thead th {
        position: sticky; top: -8px; z-index: 5;
        background: var(--sf-card, #ffffff) !important; background-clip: padding-box;
        box-shadow: inset 0 -1px 0 var(--bd, #dbe3ee), 0 2px 4px rgba(16, 24, 40, .08); }
}
@media (max-width: 767.98px) {
    .g9-qr-filter { justify-content: flex-start; }
    .g9-qr-filter .form-check { min-height: 44px; display: flex; align-items: center; gap: 8px; }
}
/* #endregion */

/* #region Arun (28-Oct-2026) - Step-5 File GSTR-9 dialog: step indicator, live loader, portal-data review */
.g9-file-body { background: var(--sf-subtle, #f7f9fc); }
.g9-file-steps { display: flex; gap: 6px; margin: 0 0 12px; padding: 0; overflow-x: auto; }
.g9-file-steps__item { display: flex; align-items: center; gap: 6px; flex: 1 1 0; min-width: max-content; padding: 6px 10px; border-radius: 8px;
    background: var(--sf-card, #ffffff); border: 1px solid var(--bd, #dbe3ee); color: var(--tc-muted, #5b6474); font-size: 13px; }
.g9-file-steps__dot { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
    background: var(--sf-subtle, #eef2f7); font-size: 12px; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.g9-file-steps__item.is-active { border-color: var(--theme-default); color: var(--theme-text); }
.g9-file-steps__item.is-active .g9-file-steps__dot { background: var(--theme-default); color: #fff; }
.g9-file-steps__item.is-done .g9-file-steps__dot { background: #2e7d32; color: #fff; }
.g9-file-progress { background: var(--sf-card, #ffffff); border: 1px solid var(--bd, #dbe3ee); border-radius: 8px; padding: 12px 14px; }
.g9-file-progress__row { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 13.5px; }
.g9-file-progress__row.is-done { color: var(--tc-muted, #5b6474); }
.g9-file-progress__row.is-done .fa-check { color: color-mix(in srgb, #2e7d32 var(--ink-keep, 100%), var(--ink-flip, #2e7d32)); }
.g9-file-progress__row.is-running { color: var(--tc-strong, #17202e); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.g9-file-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.g9-file-card { background: var(--sf-card, #ffffff); border: 1px solid var(--bd, #dbe3ee); border-radius: 8px; padding: 10px 12px; }
.g9-file-card h6 { margin: 0 0 6px; font-size: 13px; color: var(--theme-text); }
.g9-file-kv { width: 100%; font-size: 12.5px; }
.g9-file-kv td { padding: 2px 0; }
.g9-file-kv td.num, .g9-file-tbl td.num, .g9-file-tbl th.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Arun (30-Oct-2026): filing step 2 — compact late-fee strip + cash / ITC balance by tax head */
.g9-fb { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-start; background: var(--sf-card, #ffffff);
    border: 1px solid var(--bd, #dbe3ee); border-radius: 8px; padding: 8px 10px; }
.g9-fb__fee { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 0 1 auto; }
.g9-fb__bal { display: flex; flex-direction: column; gap: 4px; flex: 1 1 380px; min-width: 0; }
.g9-fb__lbl { font-size: 12px; color: var(--theme-text); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); white-space: nowrap; }
.g9-fb__chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px;
    border: 1px solid var(--bd, #dbe3ee); background: var(--sf-subtle, #f4f7fb); color: var(--tc-text, #334155); white-space: nowrap; }
.g9-fb__chip b { font-variant-numeric: tabular-nums; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.g9-fb__chip.is-ok { color: color-mix(in srgb, #2e7d32 var(--ink-keep, 100%), var(--ink-flip, #2e7d32)); border-color: color-mix(in srgb, #2e7d32 35%, transparent); }
.g9-fb__chip.is-due { color: color-mix(in srgb, #b45309 var(--ink-keep, 100%), var(--ink-flip, #b45309)); border-color: color-mix(in srgb, #b45309 35%, transparent); }
.g9-fb__chip.is-total { color: color-mix(in srgb, #b91c1c var(--ink-keep, 100%), var(--ink-flip, #b91c1c)); border-color: color-mix(in srgb, #b91c1c 40%, transparent); }
.g9-fb__chip.is-nil { color: var(--tc-muted, #64748b); }
.g9-fb__wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.g9-fb__tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.g9-fb__tbl th, .g9-fb__tbl td { padding: 2px 8px; border-bottom: 1px solid var(--bd, #eef2f7); }
.g9-fb__tbl thead th { color: var(--tc-muted, #64748b); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.g9-fb__tbl tbody th { text-align: start; color: var(--tc-text, #334155); font-weight: clamp(1, calc(400 + var(--spq-fw-delta, 0)), 1000); white-space: nowrap; }
.g9-fb__tbl .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.g9-fb__tbl tr.is-total th, .g9-fb__tbl tr.is-total td { color: var(--tc-strong, #17202e); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.g9-fb__other { display: flex; flex-wrap: wrap; gap: 4px; }
@media (max-width: 767.98px) {
    .g9-fb { flex-direction: column; }
    .g9-fb__bal { flex: 1 1 auto; width: 100%; }
    .g9-fb__tbl { min-width: 420px; }
}
.g9-file-tbl-wrap { max-height: 46vh; overflow: auto; background: var(--sf-card, #ffffff); border: 1px solid var(--bd, #dbe3ee); border-radius: 8px; }
.g9-file-tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.g9-file-tbl th { position: sticky; top: 0; z-index: 2; background: var(--sf-card, #ffffff); color: var(--theme-text); padding: 6px 8px;
    box-shadow: inset 0 -1px 0 var(--bd, #dbe3ee); text-align: center; }
.g9-file-tbl td { padding: 4px 8px; border-bottom: 1px solid var(--bd, #eef2f7); }
.g9-file-tbl tr.is-heading td { background: color-mix(in srgb, var(--theme-default, #1f4b8f) 14%, var(--sf-card, #ffffff)); color: var(--theme-text);
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.g9-file-tbl tr.is-subheading td { background: var(--sf-subtle, #f4f7fb); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.g9-file-tbl tr.is-total td { font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.g9-file-ok { color: color-mix(in srgb, #2e7d32 var(--ink-keep, 100%), var(--ink-flip, #2e7d32)); }
.g9-file-done__icon { font-size: 48px; color: color-mix(in srgb, #2e7d32 var(--ink-keep, 100%), var(--ink-flip, #2e7d32)); }
@media (max-width: 767.98px) {
    .g9-file-steps__label { display: none; }
    .g9-file-steps__item { flex: 0 0 auto; min-height: 44px; }
    .g9-file-steps__item.is-active .g9-file-steps__label { display: inline; }
    .g9-file-cards { grid-template-columns: 1fr; }
    .g9-file-tbl-wrap { max-height: none; }
    .g9-file-sig .form-select { min-height: 44px; font-size: 16px; }
    .g9-file-dialog .modal-footer { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
}
/* #endregion */

/* #region Arun (28-Oct-2026) — filing dialog: "Next: GSTR-9C" card after filing */
.g9-file-next {
    border: 1px solid var(--bd, #dee2e6);
    border-left: 3px solid var(--theme-default);
    border-radius: 6px;
    padding: 10px 12px;
    background: var(--sf-subtle, #f8f9fa);
}
/* #endregion */

/* #region Arun (28-Oct-2026) — filing dialog: GSTR-1 / 3B readiness grid */
.g9-file-prior summary { cursor: pointer; min-height: 32px; }
.g9-prior-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 4px; }
.g9-prior-cell { border: 1px solid var(--bd, #dee2e6); border-radius: 4px; padding: 3px 6px; font-size: .78rem; text-align: center; }
.g9-prior-period { font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.g9-prior-ok { color: color-mix(in srgb, #198754 var(--ink-keep, 100%), var(--ink-flip, #198754)); }
.g9-prior-bad { color: color-mix(in srgb, #dc3545 var(--ink-keep, 100%), var(--ink-flip, #dc3545)); }
.g9-prior-na { color: var(--tc-faint, #9aa0a6); }
body.dark-only .g9-prior-ok { color: #4ade80; }
body.dark-only .g9-prior-bad { color: #f87171; }
/* #endregion */

/* #region Arun (28-Oct-2026) — Computation: row 14 source switch */
.g9-cmpn-opt { padding: 6px 12px; border-bottom: 1px solid var(--bd, #dee2e6); font-size: .85rem; }
.g9-cmpn-opt .form-check-input { cursor: pointer; }
@media (max-width: 767.98px) {
    .g9-cmpn-opt { padding: 10px 16px; }
    .g9-cmpn-opt .form-check-input { width: 2.6em; height: 1.4em; }
}
/* #endregion */

/* #region Himanshu (28-Oct-2026) - GSTR-9 table frame never grows past its card: the Description
   column is fitted to the frame's width, so the frame must take the card's width, not the sheet's. */
.gstr9-table-card .g9-nostrip { min-width: 0; max-width: 100%; }
/* #endregion */

/* #region Himanshu (28-Oct-2026) - Step-4 Compare dialog: no sideways scroll of the whole body (the
   tables fit the dialog; only a table too wide for a phone scrolls inside itself), compact toolbar. */
@media (min-width: 992px) {
    .g9-cmpd-body.gstr9-shell { overflow-x: hidden; }
    .g9-cmpd-body .spq-cmp-tbl { min-width: 0 !important; width: 100%; }
    .g9-cmpd-body .g9-cx-bar { gap: 8px 14px; padding: 10px 12px; }
    .g9-cmpd-body .g9-cx-segbtn { padding: 6px 12px; }
}
@media (max-width: 991.98px) {
    .g9-cmpd-body.gstr9-shell { overflow-x: hidden; }
    .g9-cmpd-body .g9-cx-tbl .g9-cx-wrap, .g9-cmpd-body .g9-cx-sticky { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
/* #endregion */

/* #region Himanshu (28-Oct-2026) - File GSTR-9 dialog: "GSTR-9 saved on the portal" table — fixed columns,
   one "Figures (₹)" heading, column titles over their numbers, Part headings across the row. */
.g9-file-tbl { table-layout: fixed; min-width: 760px; }
.g9-file-tbl col.g9-ft-code { width: 72px; }
.g9-file-tbl col.g9-ft-desc { width: 34%; }
.g9-file-tbl th { text-align: start; vertical-align: middle; }
.g9-file-tbl th.g9-ft-figs { text-align: center; }
.g9-file-tbl td { vertical-align: middle; overflow-wrap: anywhere; line-height: 1.3; }
.g9-file-tbl td.g9-ft-title { text-align: end; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); white-space: normal; }
.g9-file-tbl tr.is-heading td { padding-top: 8px; padding-bottom: 8px; letter-spacing: .01em; }
.g9-file-tbl tr.is-subheading td { padding-top: 6px; padding-bottom: 6px; }
.g9-file-tbl tr.is-row:hover td { background: var(--sf-subtle, #f7f9fc); }
@media (max-width: 767.98px) {
    .g9-file-tbl col.g9-ft-desc { width: 220px; }
}
/* #endregion */

/* #region Himanshu (28-Oct-2026) - GSTR-9 mobile pass. Phones and tablets only; desktop rules untouched.
   SmartGrid internals (sheet / data-grid) are deliberately left alone: the grid gets its own central mobile pass. */
@media (max-width: 991.98px) {
    .gstr9-shell { max-width: 100%; overflow-x: clip; }
    /* Part tabs, dataset switch and legend: one swipeable chip row */
    .gstr9-shell .g9-tabs,
    .gstr9-shell .dsbar,
    .gstr9-shell .g9-legend,
    .g9-file-steps,
    .g9-vt-tabs {
        display: flex; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; scrollbar-width: none;
    }
    .gstr9-shell .g9-tabs::-webkit-scrollbar,
    .gstr9-shell .dsbar::-webkit-scrollbar,
    .gstr9-shell .g9-legend::-webkit-scrollbar,
    .g9-file-steps::-webkit-scrollbar,
    .g9-vt-tabs::-webkit-scrollbar { display: none; }
    .gstr9-shell .g9-tab,
    .gstr9-shell .ds-opt,
    .gstr9-shell .g9-legend__item,
    .g9-vt-tabs > * { flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap; }
    /* Non-grid HTML tables scroll inside their own frame, never the page */
    .g9-file-tbl-wrap, .g9-qr-wrap, .g9-as-wrap, .g9-itc-wrap, .g9-orv-wrap, .g9-cx-wrap,
    .g9-cmp-body, .g9-to-grid, .g9-cmpn-grid {
        max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    }
    .g9-diff-table, .g9-to-tbl { display: block; max-width: 100%; overflow-x: auto; }
}
@media (max-width: 767.98px) {
    /* Table card header: title first, tools below on their own row */
    .gstr9-shell .gstr9-table-card .card-header,
    .gstr9-shell .g9-cmp-card .card-header { flex-wrap: wrap; row-gap: 6px; }
    .gstr9-shell .gstr9-table-card .card-ttl { flex: 1 1 100%; min-width: 0; }
    .gstr9-shell .gstr9-table-card .card-tools,
    .gstr9-shell .g9-hsn-tools {
        flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start;
    }
    /* Touch targets */
    .gstr9-shell .g9-tab,
    .gstr9-shell .ds-opt,
    .gstr9-shell .card-tools .btn,
    .gstr9-shell .g9-hsn-tools .btn,
    .gstr9-shell .g9-ro-banner__btn,
    .gstr9-bottombar .btn,
    .g9-modal .modal-footer .btn,
    .g9-qr-filter .btn,
    .g9-orv-del { min-height: 44px; }
    .g9-modal .btn-close { min-width: 44px; min-height: 44px; background-size: 14px; }
    .gstr9-shell .form-control, .gstr9-shell .form-select,
    .g9-modal .form-control, .g9-modal .form-select { min-height: 44px; font-size: 16px; }
    /* Bottom action bar: full width, pinned above the home indicator */
    .gstr9-bottombar {
        position: sticky; bottom: 0; z-index: 5;
        padding-bottom: calc(.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }
    .gstr9-bottombar > .btn, .gstr9-bottombar .spq-ab { flex: 1 1 calc(50% - 8px); justify-content: center; }
    /* Dialog footers: sticky, full-width buttons, safe area */
    .g9-modal .modal-footer {
        position: sticky; bottom: 0; z-index: 2; background: var(--sf-card, #fff);
        flex-wrap: wrap; gap: 8px;
        padding-bottom: calc(.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }
    .g9-modal .modal-footer > .btn { flex: 1 1 0; margin: 0; }
    .g9-modal .modal-header { position: sticky; top: 0; z-index: 2; }
    /* Single-column forms and summaries */
    .g9-file-cards, .g9-file-kv, .g9-cmpn-opt, .g9-qr-sum, .g9-itc-sum, .g9-orv-sum, .g9-hsn-adjust {
        grid-template-columns: 1fr !important;
    }
    .g9-qr-filter, .g9-orv-bar, .g9-cx-bar, .g9-hsn-toolbar { flex-wrap: wrap; gap: 6px; }
    .g9-cx-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
    /* Hover-only affordances: show the pressed state on tap */
    .gstr9-shell .g9-tab:active, .gstr9-shell .ds-opt:active, .g9-vt-item:active { opacity: .75; }
    .g9-vt-item { min-height: 48px; }
}
/* #endregion */

/* #region Himanshu (29-Oct-2026) - Compare dialog: review tick beside the action bar */
.g9-cmpd-dialog .modal-footer { flex-wrap: wrap; gap: .5rem; }
.g9-cmpd-ack { flex: 1 1 22rem; min-width: 0; font-size: .85rem; }
@media (max-width: 767.98px) {
    .g9-cmpd-ack { flex-basis: 100%; }
}
/* #endregion */

/* #region Himanshu (29-Oct-2026) - File GSTR-9 review table: figures never overlap.
   Auto layout so a column grows to its widest figure; Particulars keeps a readable width;
   words wrap only at spaces ("Taxable Value", never "Taxabl e"). The wrapper scrolls sideways. */
.g9-file-tbl { table-layout: auto; min-width: 100%; }
.g9-file-tbl td, .g9-file-tbl th { overflow-wrap: normal; word-break: normal; }
.g9-file-tbl td.num { min-width: 112px; padding-left: 14px; }
.g9-file-tbl td.g9-ft-title { min-width: 96px; padding-left: 14px; }
.g9-file-tbl tr:not(.is-heading) td:nth-child(2) { min-width: 260px; }
.g9-file-tbl tr:not(.is-heading) td:first-child { white-space: nowrap; }
/* Compare: an acknowledged mismatch */
.spq-cmp-tbl .sec-flag--warn { color: color-mix(in srgb, #b45309 var(--ink-keep, 100%), var(--ink-flip, #b45309)); background: color-mix(in srgb, #f59e0b 16%, transparent); }
/* #endregion */

/* #region Himanshu (29-Oct-2026) - Quick Review: the confirm tick on its own row below Difference */
.g9-qr-ack-row td { padding: 4px 8px 10px; border-bottom: 1px solid var(--bd, #eef2f7); }
.g9-qr-ack-row td > * { max-width: 100%; }
/* #endregion */

/* #region Himanshu (29-Oct-2026) - GSTR-9 table headings: middle-centre, wrap only between words.
   The heading text sits directly in .col-head (SmartGrid's ColumnHeaderTemplate); the earlier rules
   aimed at .sheet-cell and used overflow-wrap:anywhere, which split "Differen|ce" and "Taxabl|e". */
.gstr9-table-card .sheet-col-head-container .col-head {
    display: flex !important; align-items: center !important; justify-content: center !important;
    text-align: center !important; white-space: normal !important;
    overflow-wrap: normal !important; word-break: normal !important; hyphens: none;
    line-height: 1.2 !important; padding: 4px 8px !important; text-overflow: clip !important;
}
.gstr9-table-card .sheet-col-head-container .col-head .icofont-pencil-alt-5 { align-self: flex-start; margin-right: 2px; }
/* the description column (index 0) stays left-aligned */
.gstr9-table-card .sheet-col-head-container .col-head:has([data-sg-col="0"]) {
    justify-content: flex-start !important; text-align: start !important;
}
/* #endregion */

/* #region Arun (30-Oct-2026): GSTR-9 footer pinned and opaque, as the GSTR-9C footer — help text and grid
   rows no longer show through it. Sticky inside the shell (same as .gstr9c-bottombar), full width. */
.gstr9-shell .gstr9-bottombar,
.gstr9-bottombar {
    position: sticky;
    bottom: 0;
    z-index: 25;
    width: 100%;
    background: var(--sf-card, #fff) !important;
    border-top: 1px solid var(--bd, #dee2e6) !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .08);
    padding-bottom: calc(.5rem + env(safe-area-inset-bottom, 0px)) !important;
}
body.dark-only .gstr9-bottombar { background: var(--sf-card, #1f2937) !important; }
body:has(.modal.d-block, .modal.show) .gstr9-bottombar { z-index: auto; }
@media (max-width: 767.98px) {
    .gstr9-shell .gstr9-bottombar, .gstr9-bottombar { z-index: 25; }
}
/* #endregion */

/* #region Arun (30-Oct-2026) — GSTR-9 footer pinned to the window bottom (spqPinFooter, as GSTR-9C).
   Sticky stopped short of the window edge (the scroll container's padding), so table rows showed below
   the bar. On desktop the bar is position:fixed and lined up with .gstr9-shell by spqPinFooter, which also
   pads the shell by the bar's height so no row hides behind it. Phones keep the sticky bar above. */
@media (min-width: 768px) {
    .gstr9-shell .gstr9-bottombar.c9-pinned {
        position: fixed; bottom: 0; z-index: 30; margin: 0;
        background: linear-gradient(var(--sf-card, #ffffff), var(--sf-card, #ffffff)), var(--sf-card, #ffffff) !important;
        padding-right: .5rem !important;
        padding-bottom: calc(.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }
    body.dark-only .gstr9-shell .gstr9-bottombar.c9-pinned { background: linear-gradient(var(--sf-card, #1f2937), var(--sf-card, #1f2937)), var(--sf-card, #111827) !important; }
}
/* the help / bug buttons now sit mid-right, so the footer no longer keeps room for them */
@media (min-width: 992px) {
    .gstr9-shell .gstr9-bottombar { padding-right: .5rem !important; }
}
/* phones: the bar scrolls sideways inside itself, never widens the page */
@media (max-width: 767.98px) {
    .gstr9-shell .gstr9-bottombar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .gstr9-shell .gstr9-bottombar .spq-ab { min-height: 44px; }
}
/* #endregion */

/* #region Arun (30-Oct-2026) — compact Software / Computed / Portal data radio */
.gstr9-shell .dsbar { gap: 4px; }
.gstr9-shell .ds-opt { gap: 5px; padding: 2px 8px 2px 6px; line-height: 1.1; }
.gstr9-shell .ds-dot { width: 12px; height: 12px; border-width: 2px; }
.gstr9-shell .ds-txt { font-size: 11.5px; }
.gstr9-shell .ds-txt em { font-size: 9.5px; }
@media (max-width: 767.98px) {
    .gstr9-shell .ds-opt { min-height: 44px; padding: 2px 10px 2px 8px; }
    .gstr9-shell .ds-txt { font-size: 12.5px; }
    .gstr9-shell .ds-txt em { font-size: 10.5px; }
}
/* #endregion */

/* #region Arun (30-Oct-2026) — on GSTR-9 pages the floating help (?) and bug buttons move to the middle of
   the right edge so they never sit on the footer. Scoped by :has(.gstr9-shell); the widgets are untouched. */
body:has(.gstr9-shell) .spq-help-fab,
body:has(.gstr9-shell) .spq-bugwidget-fab {
    top: 50% !important; bottom: auto !important;
    right: max(8px, env(safe-area-inset-right, 0px)) !important;
}
body:has(.gstr9-shell) .spq-help-fab { transform: translateY(calc(-100% - 6px)); }
body:has(.gstr9-shell) .spq-bugwidget-fab { transform: translateY(6px); }
/* #endregion */

/* #region Himanshu (21-Nov-2026) — compact dataset radios + no grey band above the strip (desktop).
   The three dataset options were taller than the step tiles and wrapped the stamp under the title,
   so the strip looked uneven; the portal host's empty inline pieces (gate container, helper status
   slot) left a grey band between the company bar and the GSTR-9 card. Phones keep the
   segmented layout in topbars.app.css (≤ 991.98px). */
@media (min-width: 992px) {
    .gstr9-shell .gstr9-topbar > .stepstrip { padding: 6px 10px; gap: 6px; align-items: center; }
    .gstr9-shell .dsbar { gap: 4px; align-items: stretch; }
    .gstr9-shell .ds-opt { padding: 2px 8px 2px 6px; gap: 5px; border-radius: 6px; white-space: nowrap; }
    .gstr9-shell .ds-dot { width: 12px; height: 12px; }
    .gstr9-shell .ds-txt { font-size: 11.5px; line-height: 1.15; }
    .gstr9-shell .ds-txt em { font-size: 10px; line-height: 1.1; }
}
.root-container:has(.gstr9-shell) .spq-provider-login-gate-container:not(:has(.slbs__track > *, .plg-helper-status, .modal.show, .overlay-wait)) {
    margin: 0 !important; padding: 0 !important; min-height: 0 !important;
}
.root-container:has(.gstr9-shell) .gstr9-shell.fill { margin-top: 0 !important; padding-top: 0 !important; }
/* #endregion */
