/* Tally Connector module (Himanshu, 18-Oct-2026).
   Theme tokens only: --theme-default for fills / borders, --theme-text for theme-coloured text,
   --sf-* surfaces and --bd borders (dark-mode tokens; light mode keeps the fallback), --tc-*
   text greys, and clamp(…--spq-fw-delta…) weights. Status colours stay literal.
   Desktop rules first; every phone rule lives inside the media queries at the end. */

.tly-page {
    --tly-accent: var(--theme-default, #0f766e);
    --tly-accent-soft: color-mix(in srgb, var(--tly-accent) 11%, transparent);
    --tly-surface: var(--sf-card, #ffffff);
    --tly-surface-2: var(--sf-subtle, #f8fafc);
    --tly-line: var(--bd, #e5e7eb);
    --tly-text: var(--tc-strong, #0f172a);
    --tly-text-2: var(--tc-text, #334155);
    --tly-muted: var(--tc-muted, #64748b);
    --tly-faint: var(--tc-faint, #94a3b8);
    --tly-ok: #15803d;
    --tly-ok-bg: color-mix(in srgb, #16a34a 12%, transparent);
    --tly-warn: #b45309;
    --tly-warn-bg: color-mix(in srgb, #f59e0b 15%, transparent);
    --tly-err: #b91c1c;
    --tly-err-bg: color-mix(in srgb, #ef4444 12%, transparent);
    --tly-info: #1d4ed8;
    --tly-info-bg: color-mix(in srgb, #3b82f6 12%, transparent);
    --tly-radius: 14px;
    --tly-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 1px rgba(15, 23, 42, .03);
    --tly-shadow-lg: 0 14px 34px -14px rgba(15, 23, 42, .28);
    padding: 1rem 1.5rem 2.5rem;
    max-width: 1320px;
    margin: 0 auto;
    color: var(--tly-text-2);
}
body.dark-only .tly-page {
    --tly-text: var(--tcd-strong, #f8fafc);
    --tly-text-2: var(--tcd-text, #e5e7eb);
    --tly-muted: var(--tcd-muted, #c3cad5);
    --tly-faint: var(--tcd-faint, #9aa4b2);
    --tly-surface: var(--sf-card, #1f2430);
    --tly-surface-2: var(--sf-subtle, #1a1e28);
    --tly-ok: #4ade80;
    --tly-warn: #fbbf24;
    --tly-err: #f87171;
    --tly-info: #93c5fd;
    --tly-shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --tly-shadow-lg: 0 14px 34px -14px rgba(0, 0, 0, .6);
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.tly-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem;
    margin-bottom: 1.1rem;
}
.tly-head-main { display: flex; align-items: center; gap: .85rem; min-width: 0; flex: 1 1 320px; }
.tly-head-icon {
    width: 46px; height: 46px; flex: 0 0 46px; border-radius: 13px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem;
    color: #fff;
    background: linear-gradient(135deg, var(--tly-accent), color-mix(in srgb, var(--tly-accent) 62%, #0f172a));
    box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--tly-accent) 70%, transparent);
}
.tly-head-text { min-width: 0; }
.tly-head-text h1 {
    margin: 0; font-size: 1.32rem; line-height: 1.25; color: var(--tly-text);
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tly-head-text p { margin: .1rem 0 0; font-size: .86rem; color: var(--tly-muted); }
.tly-back {
    width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--tly-line);
    background: var(--tly-surface); color: var(--tly-text); display: inline-flex; align-items: center; justify-content: center;
}
.tly-head-side { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.tly-head-actions { flex: 1 1 100%; }

.tly-company {
    display: inline-flex; align-items: center; gap: .45rem; max-width: 340px;
    padding: .3rem .4rem .3rem .75rem; border-radius: 999px; border: 1px solid var(--tly-line);
    background: var(--tly-surface); color: var(--tly-text); font-size: .85rem; margin: 0;
}
.tly-company i { color: var(--tly-muted); }
.tly-company select {
    border: 0; background: transparent; color: inherit; font: inherit; max-width: 280px;
    padding: .15rem 1.4rem .15rem 0; outline: none; text-overflow: ellipsis;
}
.tly-company--single { padding-right: .85rem; }

.tly-conn {
    display: inline-flex; align-items: center; gap: .45rem; max-width: 320px;
    padding: .38rem .8rem; border-radius: 999px; font-size: .82rem; border: 1px solid transparent;
    font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000);
}
.tly-conn-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tly-conn-at { font-size: .72rem; opacity: .75; font-variant-numeric: tabular-nums; font-weight: clamp(1, calc(500 + var(--spq-fw-delta, 0)), 1000); }
/* Himanshu (08-Nov-2026): two-line status, "Helper · Tally HH:mm" over the Tally company in small text. */
.tly-conn-stack { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; min-width: 0; }
.tly-conn-line { display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; }
.tly-conn-seg { display: inline-flex; align-items: center; gap: .25rem; font-size: .8rem; }
.tly-conn-seg.is-ok { color: var(--tly-ok); }
.tly-conn-seg.is-warn { color: var(--tly-warn); }
.tly-conn-co { font-size: .68rem; opacity: .8; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tc-muted, #6b7280); font-weight: clamp(1, calc(500 + var(--spq-fw-delta, 0)), 1000); }
.tly-conn-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 8px; }
.tly-conn.is-ok { color: var(--tly-ok); background: var(--tly-ok-bg); }
.tly-conn.is-warn { color: var(--tly-warn); background: var(--tly-warn-bg); }
.tly-conn.is-ok .tly-conn-dot { box-shadow: 0 0 0 4px color-mix(in srgb, #16a34a 22%, transparent); }

/* ── Building blocks ───────────────────────────────────────────────────── */
.tly-card {
    background: var(--tly-surface); border: 1px solid var(--tly-line); border-radius: var(--tly-radius);
    box-shadow: var(--tly-shadow); padding: 1.1rem 1.2rem;
}
.tly-card + .tly-card { margin-top: .9rem; }
.tly-card--flat { box-shadow: none; background: var(--tly-surface-2); }
.tly-recurring { margin-top: 0 !important; display: flex; flex-direction: column; }
.tly-recurring.is-off { opacity: .7; }
.tly-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: .85rem; }
.tly-card-title {
    margin: 0; font-size: 1rem; color: var(--tly-text);
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
}
.tly-card-sub { margin: .15rem 0 0; font-size: .82rem; color: var(--tly-muted); }
.tly-section-title {
    margin: 1.4rem 0 .6rem; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase;
    color: var(--tly-muted); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
}
.tly-muted { color: var(--tly-muted); }
.tly-small { font-size: .8rem; }
.tly-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }
.tly-alert { border-radius: 12px; }
.tly-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tly-two { display: grid; gap: .9rem; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
.tly-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.tly-spacer { flex: 1 1 auto; }

/* Status badges */
.tly-badge {
    display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px;
    font-size: .72rem; line-height: 1.5; white-space: nowrap;
    font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000);
}
.tly-badge--ok { color: var(--tly-ok); background: var(--tly-ok-bg); }
.tly-badge--warn { color: var(--tly-warn); background: var(--tly-warn-bg); }
.tly-badge--err { color: var(--tly-err); background: var(--tly-err-bg); }
.tly-badge--info { color: var(--tly-info); background: var(--tly-info-bg); }
.tly-badge--muted { color: var(--tly-muted); background: color-mix(in srgb, var(--tly-muted) 12%, transparent); }

/* KPI tiles */
.tly-stats { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.tly-stat {
    padding: .8rem .95rem; border-radius: 12px; border: 1px solid var(--tly-line); background: var(--tly-surface-2);
    text-align: left; min-width: 0;
}
button.tly-stat { cursor: pointer; transition: border-color .15s ease, transform .15s ease; }
button.tly-stat.is-active { border-color: var(--tly-accent); box-shadow: 0 0 0 3px var(--tly-accent-soft); }
.tly-stat-label { display: block; font-size: .74rem; color: var(--tly-muted); }
.tly-stat-value {
    display: block; margin-top: .15rem; font-size: 1.35rem; color: var(--tly-text); line-height: 1.2;
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
    font-variant-numeric: tabular-nums;
}
.tly-stat--ok .tly-stat-value { color: var(--tly-ok); }
.tly-stat--err .tly-stat-value { color: var(--tly-err); }
.tly-stat--warn .tly-stat-value { color: var(--tly-warn); }
.tly-stat--info .tly-stat-value { color: var(--tly-info); }

/* Feature tiles (hub) */
.tly-tile {
    position: relative; display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; text-align: left;
    padding: 1.1rem 1.2rem 1.15rem; border-radius: var(--tly-radius); border: 1px solid var(--tly-line);
    background: var(--tly-surface); box-shadow: var(--tly-shadow); color: inherit;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
    animation: tly-in .28s ease both;
}
.tly-tile-icon {
    width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--tly-accent-soft); color: var(--theme-text, var(--tly-accent)); font-size: 1.05rem;
}
.tly-tile-title { font-size: 1rem; color: var(--tly-text); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.tly-tile-desc { font-size: .82rem; color: var(--tly-muted); line-height: 1.45; }
.tly-tile-foot { margin-top: auto; padding-top: .35rem; display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--theme-text, var(--tly-accent)); }
.tly-tile.is-locked { opacity: .82; }
.tly-tile.is-locked .tly-tile-icon { filter: grayscale(1); }
.tly-tile-lock { position: absolute; top: .9rem; right: .9rem; }
@media (hover: hover) {
    .tly-tile:hover { transform: translateY(-2px); box-shadow: var(--tly-shadow-lg); border-color: color-mix(in srgb, var(--tly-accent) 40%, var(--tly-line)); }
}

/* Connection hero (hub) */
.tly-hero {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center;
    padding: 1.2rem 1.35rem; border-radius: 18px; border: 1px solid var(--tly-line);
    background:
        radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--tly-accent) 16%, transparent), transparent 60%),
        var(--tly-surface);
    box-shadow: var(--tly-shadow);
}
.tly-hero h2 { margin: 0 0 .25rem; font-size: 1.1rem; color: var(--tly-text); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.tly-hero p { margin: 0; font-size: .86rem; color: var(--tly-muted); }
.tly-hero-steps { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .75rem; }

/* Steps (connection checklist, wizard) */
.tly-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.tly-step {
    display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: .8rem; align-items: center;
    padding: .85rem 1rem; border: 1px solid var(--tly-line); border-radius: 12px; background: var(--tly-surface);
}
.tly-step-dot {
    width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--tly-muted) 14%, transparent); color: var(--tly-muted);
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
}
.tly-step.is-done .tly-step-dot { background: var(--tly-ok-bg); color: var(--tly-ok); }
.tly-step.is-warn .tly-step-dot { background: var(--tly-warn-bg); color: var(--tly-warn); }
.tly-step.is-err .tly-step-dot { background: var(--tly-err-bg); color: var(--tly-err); }
.tly-step.is-current { border-color: color-mix(in srgb, var(--tly-accent) 55%, var(--tly-line)); box-shadow: 0 0 0 3px var(--tly-accent-soft); }
.tly-step-title { display: block; color: var(--tly-text); font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000); }
.tly-step-sub { display: block; font-size: .8rem; color: var(--tly-muted); margin-top: .1rem; }

.tly-wizard { display: flex; gap: .4rem; list-style: none; margin: 0 0 1rem; padding: 0; overflow-x: auto; scrollbar-width: none; }
.tly-wizard::-webkit-scrollbar { display: none; }
.tly-wizard li {
    display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .8rem; border-radius: 999px; white-space: nowrap;
    font-size: .8rem; color: var(--tly-muted); background: var(--tly-surface-2); border: 1px solid var(--tly-line);
}
.tly-wizard li.is-active { color: var(--theme-text, var(--tly-accent)); background: var(--tly-accent-soft); border-color: transparent; font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000); }
.tly-wizard li.is-done { color: var(--tly-ok); }
.tly-wizard-num { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; background: currentColor; }
.tly-wizard-num > span { color: var(--tly-surface); }

/* Choice cards (voucher kind, source) */
.tly-choices { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tly-choice {
    display: flex; gap: .75rem; align-items: flex-start; text-align: left; padding: .9rem 1rem; border-radius: 12px;
    border: 1px solid var(--tly-line); background: var(--tly-surface); color: inherit; transition: border-color .15s ease, box-shadow .15s ease;
}
.tly-choice.is-active { border-color: var(--tly-accent); box-shadow: 0 0 0 3px var(--tly-accent-soft); }
.tly-choice-icon { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--tly-accent-soft); color: var(--theme-text, var(--tly-accent)); }
.tly-choice-title { display: block; color: var(--tly-text); font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000); }
.tly-choice-desc { display: block; font-size: .78rem; color: var(--tly-muted); margin-top: .1rem; }

/* File drop zone */
.tly-drop {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
    min-height: 150px; padding: 1.2rem; border-radius: 14px; text-align: center; cursor: pointer;
    border: 1.5px dashed color-mix(in srgb, var(--tly-accent) 55%, var(--tly-line));
    background: color-mix(in srgb, var(--tly-accent) 4%, var(--tly-surface-2));
    transition: background .15s ease, border-color .15s ease;
}
.tly-drop:hover, .tly-drop:focus-within { background: var(--tly-accent-soft); border-color: var(--tly-accent); }
.tly-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.tly-drop-icon { font-size: 1.8rem; }
.tly-drop-title { color: var(--tly-text); font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000); }
.tly-drop-sub { font-size: .8rem; color: var(--tly-muted); }
.tly-drop.is-busy { pointer-events: none; opacity: .7; }

/* Forms */
.tly-form { display: grid; gap: .75rem 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tly-form .full { grid-column: 1 / -1; }
.tly-field label { display: block; font-size: .78rem; color: var(--tly-muted); margin-bottom: .25rem; }
.tly-field .form-control, .tly-field .form-select { border-radius: 10px; }
.tly-check { display: flex; gap: .55rem; align-items: flex-start; font-size: .86rem; color: var(--tly-text-2); }
.tly-check--center { align-items: center; }
.tly-check input { margin-top: .2rem; width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--tly-accent); }
.tly-hint { font-size: .76rem; color: var(--tly-muted); margin-top: .25rem; }
.tly-btn-lg { min-height: 44px; border-radius: 10px; padding-left: 1.1rem; padding-right: 1.1rem; }

/* Lists: a table on desktop, stacked cards on phones */
.tly-list { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .86rem; }
.tly-list th {
    position: sticky; top: 0; z-index: 1; text-align: left; font-size: .74rem; color: var(--tly-muted);
    padding: .55rem .7rem; background: var(--tly-surface-2); border-bottom: 1px solid var(--tly-line);
    font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000); white-space: nowrap;
}
.tly-list td { padding: .6rem .7rem; border-bottom: 1px solid var(--tly-line); vertical-align: top; color: var(--tly-text-2); }
.tly-list tr:last-child td { border-bottom: 0; }
.tly-list tr.is-clickable { cursor: pointer; }
.tly-list tr.is-clickable:hover td { background: color-mix(in srgb, var(--tly-accent) 4%, transparent); }
.tly-list .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tly-list-wrap { overflow-x: auto; border: 1px solid var(--tly-line); border-radius: 12px; background: var(--tly-surface); max-height: 70vh; overflow-y: auto; }
.tly-cell-title { color: var(--tly-text); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-cell-sub { display: block; font-size: .76rem; color: var(--tly-muted); }
.tly-issue { display: block; font-size: .78rem; margin-top: .15rem; }
.tly-issue.is-err { color: var(--tly-err); }
.tly-issue.is-warn { color: var(--tly-warn); }

.tly-row-btn {
    width: 100%; display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; text-align: left;
    border: 0; border-radius: 10px; background: transparent; color: inherit; min-height: 52px;
}
.tly-row-btn:hover { background: color-mix(in srgb, var(--tly-accent) 6%, transparent); }
.tly-row-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.tly-row-title { color: var(--tly-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-row-sub { font-size: .78rem; color: var(--tly-muted); }
.tly-chevron { color: var(--tly-faint); }
.tly-avatar {
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--tly-accent-soft); color: var(--theme-text, var(--tly-accent)); font-size: .82rem;
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
}

/* Picker, empty states, lock card */
.tly-picker { max-width: 720px; }
.tly-picker-head { display: flex; gap: .85rem; align-items: flex-start; margin-bottom: .8rem; }
.tly-picker-head h2 { margin: 0; font-size: 1.05rem; color: var(--tly-text); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.tly-picker-head p { margin: .2rem 0 0; font-size: .85rem; color: var(--tly-muted); }
.tly-picker-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; max-height: 60vh; overflow-y: auto; }
.tly-empty { text-align: center; padding: 2.4rem 1rem; color: var(--tly-muted); }
.tly-empty-icon {
    width: 52px; height: 52px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 52px;
    background: var(--tly-accent-soft); color: var(--theme-text, var(--tly-accent)); font-size: 1.3rem;
}
.tly-empty h3 { margin: .7rem 0 .25rem; font-size: 1rem; color: var(--tly-text); }
.tly-lock { max-width: 560px; margin: 1rem auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .65rem; padding: 2rem 1.5rem; }
.tly-lock-icon { width: 60px; height: 60px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; background: var(--tly-warn-bg); color: var(--tly-warn); }
.tly-lock h2 { margin: .2rem 0 0; font-size: 1.15rem; color: var(--tly-text); }
.tly-lock p { margin: 0; color: var(--tly-muted); font-size: .9rem; }

.tly-search {
    display: flex; align-items: center; gap: .5rem; padding: 0 .85rem; border-radius: 999px; min-height: 40px;
    border: 1px solid var(--tly-line); background: var(--tly-surface-2); margin-bottom: .7rem;
}
.tly-search i { color: var(--tly-faint); }
.tly-search input { flex: 1 1 auto; border: 0; outline: 0; background: transparent; color: var(--tly-text); font-size: .9rem; min-width: 0; }

/* Progress */
.tly-progress { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--tly-muted) 16%, transparent); overflow: hidden; }
.tly-progress > span {
    display: block; height: 100%; border-radius: inherit; transition: width .45s ease;
    background: linear-gradient(90deg, var(--tly-accent), color-mix(in srgb, var(--tly-accent) 60%, #22c55e));
}
.tly-progress.is-running > span { background-size: 200% 100%; animation: tly-shimmer 1.4s linear infinite; }
.tly-progress > span.tly-progress-full { width: 100%; }
.tly-live { display: grid; gap: .7rem; }

/* Voucher detail (Dr / Cr lines) */
.tly-lines { width: 100%; font-size: .84rem; border-collapse: collapse; }
.tly-lines td { padding: .35rem .4rem; border-bottom: 1px dashed var(--tly-line); }
.tly-lines .dr, .tly-lines .cr { text-align: right; font-variant-numeric: tabular-nums; width: 120px; }
.tly-lines tfoot td { border-bottom: 0; color: var(--tly-text); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }

/* Unresolved names (mapping) */
.tly-map { display: grid; gap: .6rem; }
.tly-map-row {
    display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1.1fr) auto; gap: .6rem; align-items: center;
    padding: .65rem .75rem; border: 1px solid var(--tly-line); border-radius: 12px; background: var(--tly-surface);
}
.tly-map-arrow { color: var(--tly-faint); text-align: center; }
.tly-map-from { min-width: 0; }
.tly-map-from .tly-cell-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tly-sticky-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* Skeleton */
.tly-skel { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tly-skel-card { padding: 1.1rem; border-radius: var(--tly-radius); border: 1px solid var(--tly-line); background: var(--tly-surface); display: grid; gap: .6rem; }
.tly-skel-card span { display: block; height: 11px; border-radius: 6px; background: color-mix(in srgb, var(--tly-text) 8%, transparent); animation: tly-pulse 1.3s ease-in-out infinite; }
.tly-skel-card .w40 { width: 40%; } .tly-skel-card .w60 { width: 60%; } .tly-skel-card .w80 { width: 80%; }

.tly-pager { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .7rem; font-size: .82rem; color: var(--tly-muted); }

@keyframes tly-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes tly-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes tly-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
    .tly-tile, .tly-skel-card span, .tly-progress.is-running > span { animation: none; }
    .tly-tile { transition: none; }
}

/* ── Tablet ─────────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .tly-two { grid-template-columns: 1fr; }
}

/* ── Phone: native-app presentation ───────────────────────────────────── */
@media (max-width: 767.98px) {
    .tly-page { padding: 0 .75rem calc(5.5rem + env(safe-area-inset-bottom, 0px)); }

    /* Sticky app bar under the app's own header */
    .tly-head {
        position: sticky; top: 0; z-index: 20; margin: 0 -.75rem .8rem; padding: .65rem .75rem .6rem;
        background: color-mix(in srgb, var(--tly-surface) 92%, transparent);
        -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
        border-bottom: 1px solid var(--tly-line);
        gap: .5rem;
    }
    .tly-head-main { flex: 1 1 100%; gap: .6rem; }
    .tly-head-icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 11px; font-size: 1rem; }
    .tly-head-text h1 { font-size: 1.08rem; }
    .tly-head-text p { display: none; }
    .tly-head-side { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .tly-head-side::-webkit-scrollbar { display: none; }
    .tly-company { flex: 1 1 auto; min-height: 40px; max-width: none; min-width: 0; }
    .tly-company select { max-width: none; width: 100%; font-size: 16px; min-height: 36px; }
    .tly-conn { min-height: 40px; flex: 0 0 auto; max-width: 52vw; }

    .tly-card { padding: .95rem; border-radius: 16px; }
    .tly-grid, .tly-skel { grid-template-columns: 1fr; gap: .65rem; }
    .tly-tile { flex-direction: row; align-items: center; min-height: 72px; padding: .85rem .95rem; gap: .8rem; }
    .tly-tile-desc, .tly-tile-foot { display: none; }
    .tly-tile:active, .tly-choice:active, .tly-row-btn:active, button.tly-stat:active { transform: scale(.98); }
    .tly-tile-lock { position: static; margin-left: auto; }
    .tly-hero { grid-template-columns: 1fr; padding: 1rem; border-radius: 16px; }
    .tly-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
    .tly-stat { padding: .65rem .75rem; }
    .tly-stat-value { font-size: 1.15rem; }
    .tly-form { grid-template-columns: 1fr; }
    .tly-field .form-control, .tly-field .form-select { min-height: 46px; font-size: 16px; }
    .tly-choices { grid-template-columns: 1fr; }
    .tly-choice { min-height: 64px; }
    .tly-step { grid-template-columns: 32px minmax(0, 1fr); }
    .tly-step > :last-child:not(:nth-child(2)) { grid-column: 1 / -1; }
    .tly-map-row { grid-template-columns: 1fr; }
    .tly-map-arrow { display: none; }

    /* Table → stacked cards */
    .tly-list-wrap { border: 0; background: transparent; max-height: none; overflow: visible; }
    .tly-list, .tly-list tbody, .tly-list tr, .tly-list td { display: block; width: 100%; }
    .tly-list thead { display: none; }
    .tly-list tr {
        margin-bottom: .55rem; padding: .7rem .8rem; border: 1px solid var(--tly-line); border-radius: 14px;
        background: var(--tly-surface); box-shadow: var(--tly-shadow);
    }
    .tly-list td { border: 0; padding: .18rem 0; }
    .tly-list td[data-label]::before { content: attr(data-label); display: block; font-size: .7rem; color: var(--tly-muted); }
    .tly-list td.num { text-align: left; }
    .tly-list td.tly-hide-phone { display: none; }

    /* Primary actions pinned above the app's bottom bar */
    .tly-sticky-actions {
        position: fixed; left: 0; right: 0; z-index: 1030;
        bottom: calc(var(--spq-bottomnav-h, 64px) + env(safe-area-inset-bottom, 0px));
        padding: .6rem .75rem; gap: .5rem; flex-wrap: nowrap;
        background: color-mix(in srgb, var(--tly-surface) 96%, transparent);
        -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
        border-top: 1px solid var(--tly-line);
        box-shadow: 0 -8px 20px -14px rgba(15, 23, 42, .35);
    }
    .tly-sticky-actions > .btn, .tly-sticky-actions > button { flex: 1 1 0; min-height: 48px; }
    .tly-btn-lg { width: 100%; }
    .tly-pager { flex-wrap: wrap; }
}

/* ── Books Warehouse · Audit Workbench · Business Dashboard (Himanshu, 27-Oct-2026) ── */
.tly-audit-areas { display: flex; flex-wrap: wrap; gap: .45rem; }
.tly-chip {
    display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; min-height: 40px; border-radius: 999px;
    border: 1px solid var(--tly-line); background: var(--tly-surface); color: var(--tly-text); font-size: .84rem;
    transition: border-color .15s ease, background-color .15s ease;
}
.tly-chip.is-active { border-color: var(--tly-accent); background: var(--tly-accent-soft); color: var(--theme-text, var(--tly-accent)); }
.tly-chip-count { padding: 0 .45rem; border-radius: 999px; font-size: .74rem; background: color-mix(in srgb, var(--tly-muted) 16%, transparent); color: var(--tly-text); font-variant-numeric: tabular-nums; }
.tly-select-sm { width: auto; max-width: 16rem; }
.tly-rule-card { padding: .7rem .9rem; border-radius: 12px; border: 1px solid var(--tly-line); background: var(--tly-surface-2); }
.tly-rule-link { padding: 0; border: 0; background: transparent; cursor: pointer; }
.tly-review-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .55rem .7rem; margin-bottom: .6rem; border-radius: 12px; border: 1px solid var(--tly-line); background: var(--tly-accent-soft); }
.tly-review-note { flex: 1 1 14rem; min-width: 10rem; }
.tly-findings .tly-col-check { width: 2.2rem; text-align: center; }
.tly-findings .tly-col-check input { width: 1.1rem; height: 1.1rem; }
.tly-findings tr.is-selected td { background: color-mix(in srgb, var(--tly-accent) 10%, transparent); }
.tly-neg { color: var(--tly-err); }

/* Monthly columns (pure CSS, no chart library) */
.tly-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(28px, 1fr); gap: .5rem; align-items: end; height: 180px; padding: .4rem .2rem 0; overflow-x: auto; }
.tly-bar-col { display: flex; flex-direction: column; align-items: center; gap: .3rem; height: 100%; min-width: 0; }
.tly-bar-stack { display: flex; align-items: flex-end; gap: 3px; flex: 1 1 auto; width: 100%; justify-content: center; }
.tly-bar { display: block; width: 40%; max-width: 18px; min-height: 2px; border-radius: 4px 4px 0 0; }
.tly-bar--sales { background: var(--theme-default, var(--tly-accent)); }
.tly-bar--purch { background: color-mix(in srgb, var(--tly-warn) 75%, var(--tly-surface)); }
.tly-bar-label { font-size: .68rem; color: var(--tly-muted); white-space: nowrap; }
.tly-legend { display: flex; gap: 1rem; margin-top: .4rem; font-size: .78rem; color: var(--tly-muted); }
.tly-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }

/* Horizontal bars (expense mix) */
.tly-hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.tly-hbars li { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr auto; align-items: center; gap: .6rem; font-size: .84rem; }
.tly-hbar-label { color: var(--tly-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tly-hbar-track { display: block; height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--tly-muted) 16%, transparent); overflow: hidden; }
.tly-hbar { display: block; height: 100%; border-radius: 999px; background: var(--theme-default, var(--tly-accent)); }
.tly-hbar-value { color: var(--tly-muted); font-variant-numeric: tabular-nums; }

@media (max-width: 767.98px) {
    .tly-select-sm { width: 100%; max-width: none; }
    .tly-review-bar { position: sticky; top: 0; z-index: 2; }
    .tly-findings .tly-col-check { width: auto; text-align: left; }
    .tly-hbars li { grid-template-columns: 1fr; gap: .2rem; }
    .tly-bars { height: 150px; }
}

/* ── Match your columns (Himanshu, 30-Oct-2026) ─────────────────────────────────── */
.tly-colmap-rows { display: grid; gap: .45rem; }
.tly-colmap-head, .tly-colmap-row {
    display: grid; grid-template-columns: minmax(150px, 1.1fr) 28px minmax(190px, 1.4fr) minmax(120px, 1fr);
    gap: .6rem; align-items: center;
}
.tly-colmap-head { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--tly-faint); padding: 0 .35rem; }
.tly-colmap-row { padding: .45rem .35rem; border-radius: 10px; border: 1px solid transparent; }
.tly-colmap-row:nth-child(even) { background: var(--sf-subtle, color-mix(in srgb, var(--tly-line) 35%, transparent)); }
.tly-colmap-row.is-missing { border-color: var(--tly-err); background: var(--tly-err-bg); }
.tly-colmap-field { min-width: 0; }
.tly-colmap-field .tly-cell-title { display: block; }
.tly-colmap-req { color: var(--tly-err); margin-left: .15rem; }
.tly-colmap-pick { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; min-width: 0; }
.tly-colmap-pick .form-select { flex: 1 1 160px; min-width: 0; }
.tly-colmap-sample { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tly-colmap-name { max-width: 260px; }
.tly-colmap-foot { flex-wrap: wrap; }

/* ── Simplified hub: three things you can do (Himanshu, 30-Oct-2026) ─────────────── */
.tly-do { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.tly-do-card {
    background: var(--tly-surface); border: 1px solid var(--tly-line); border-radius: 16px; padding: 1.1rem;
    display: flex; flex-direction: column; gap: .7rem; box-shadow: var(--tly-shadow);
}
.tly-do-head { display: flex; align-items: center; gap: .75rem; }
.tly-do-icon {
    width: 46px; height: 46px; flex: 0 0 46px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.25rem; background: var(--tly-accent-soft); color: var(--theme-text, var(--tly-accent));
}
.tly-do-title { font-size: 1.05rem; color: var(--tly-text); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); display: block; }
.tly-do-sub { font-size: .82rem; color: var(--tly-muted); display: block; }
.tly-do-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.tly-do-link {
    width: 100%; text-align: left; display: flex; align-items: center; gap: .65rem; min-height: 48px; padding: .45rem .6rem;
    border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--tly-text); cursor: pointer;
}
.tly-do-link:hover, .tly-do-link:focus-visible { background: var(--tly-accent-soft); border-color: color-mix(in srgb, var(--tly-accent) 35%, transparent); outline: none; }
.tly-do-link i.fa-solid:first-child { width: 20px; text-align: center; color: var(--theme-text, var(--tly-accent)); }
.tly-do-link-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.tly-do-link-title { font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-do-link-sub { font-size: .76rem; color: var(--tly-muted); }
.tly-do-link.is-locked { opacity: .75; }
.tly-do-primary { margin-top: auto; }

@media (max-width: 767.98px) {
    .tly-colmap-head { display: none; }
    .tly-colmap-row { grid-template-columns: 1fr; gap: .3rem; padding: .6rem .5rem; border-color: var(--tly-line); }
    .tly-colmap-row .tly-map-arrow { display: none; }
    .tly-colmap-sample { white-space: normal; }
    .tly-colmap-sample:not(:empty)::before { content: "Example: "; color: var(--tly-faint); }
    .tly-colmap-foot .btn { flex: 1 1 45%; min-height: 48px; }
    .tly-colmap-name { max-width: none; width: 100%; }
    .tly-do { grid-template-columns: 1fr; }
}

/* ── Change Period — Tally's box (Himanshu, 30-Oct-2026) ───────────────────────── */
.tly-period { display: grid; grid-template-columns: minmax(300px, 1.2fr) minmax(220px, 1fr); gap: 1.25rem; align-items: start; }
.tly-period-title {
    margin: 0 0 .8rem; font-size: 1.05rem; color: var(--tly-text); display: inline-block;
    border-bottom: 2px solid var(--tly-text); padding-bottom: .1rem;
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
}
.tly-period-rows { display: grid; gap: .55rem; }
.tly-period-row { display: grid; grid-template-columns: 52px 12px 190px minmax(0, 1fr); align-items: center; gap: .5rem; }
.tly-period-row label { margin: 0; color: var(--tly-text); font-size: 1rem; }
.tly-period-colon { color: var(--tly-muted); text-align: center; }
.tly-period-input {
    width: 100%; min-height: 44px; padding: .3rem .65rem; border-radius: 8px; border: 1px solid var(--tly-line);
    background: color-mix(in srgb, #fde68a 42%, var(--tly-surface)); color: var(--tly-text);
    font-size: 1.05rem; font-variant-numeric: tabular-nums; letter-spacing: .02em;
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
}
.tly-period-input:focus { outline: none; border-color: var(--tly-accent); box-shadow: 0 0 0 3px var(--tly-accent-soft); }
.tly-period-input.is-err { border-color: var(--tly-err); background: var(--tly-err-bg); }
body.dark-only .tly-period-input { background: color-mix(in srgb, #fde68a 18%, var(--tly-surface)); }
.tly-period-preview { font-size: .82rem; color: var(--tly-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tly-period-preview.is-err { color: var(--tly-err); white-space: normal; }
.tly-period-actions { display: flex; align-items: center; gap: .75rem; margin-top: .9rem; flex-wrap: wrap; }
.tly-period-dirty { font-size: .8rem; color: var(--tly-warn); }
.tly-period-help { margin: .75rem 0 0; font-size: .78rem; color: var(--tly-faint); line-height: 1.6; }
.tly-period-help code { font-size: .78rem; padding: .05rem .3rem; border-radius: 5px; background: var(--tly-surface-2); color: var(--tly-text-2); border: 1px solid var(--tly-line); }
.tly-period-side { border-left: 1px solid var(--tly-line); padding-left: 1.25rem; }
.tly-period-side-title { display: block; font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--tly-muted); margin-bottom: .5rem; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }

/* ── Drill-down rows, stat buttons, voucher dialog ───────────────────────────────── */
.tly-list--drill tr.is-clickable:hover .tly-cell-title { color: var(--theme-text, var(--tly-accent)); }
.tly-list--drill tr.is-empty { opacity: .62; }
.tly-list--drill .tly-drill-cell { width: 32px; text-align: center; }
.tly-list--drill tr.is-active td { background: var(--tly-accent-soft); }
.tly-stat-btn { cursor: pointer; text-align: left; font: inherit; border: 1px solid var(--tly-line); }
.tly-stat-btn:hover, .tly-stat-btn:focus-visible { border-color: color-mix(in srgb, var(--tly-accent) 45%, var(--tly-line)); box-shadow: var(--tly-shadow-lg); outline: none; }
.tly-stat-foot { display: block; margin-top: .25rem; font-size: .74rem; color: var(--theme-text, var(--tly-accent)); }
.tly-drill-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; }
.tly-drill-period { color: var(--tly-text); font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000); }
.tly-vch-head { display: grid; gap: .6rem .9rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: .75rem; }
.tly-vch-head > div { display: flex; flex-direction: column; min-width: 0; }
.tly-vch-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--tly-faint); }
.tly-vch-value { color: var(--tly-text); overflow: hidden; text-overflow: ellipsis; }
.tly-vch-section { font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; color: var(--tly-muted); margin: .6rem 0 .4rem; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.tly-list tfoot th { padding: .55rem .7rem; color: var(--tly-text); border-top: 2px solid var(--tly-line); text-align: left; }

/* ── Visual pass (30-Oct-2026): calmer surfaces, sticky table heads, clearer sections ── */
.tly-page { --tly-radius: 16px; }
.tly-list th { position: sticky; top: 0; z-index: 1; background: var(--tly-surface-2); }
.tly-list tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--tly-surface-2) 55%, transparent); }
.tly-list tr.is-clickable:hover td { background: color-mix(in srgb, var(--tly-accent) 7%, transparent); }
.tly-card-head { padding-bottom: .65rem; border-bottom: 1px dashed var(--tly-line); }
.tly-section-title { display: flex; align-items: center; gap: .6rem; }
.tly-section-title::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--tly-line); }
.tly-hero { background: linear-gradient(135deg, var(--tly-surface), color-mix(in srgb, var(--tly-accent) 8%, var(--tly-surface))); }

@media (max-width: 767.98px) {
    .tly-period { grid-template-columns: 1fr; }
    .tly-period-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--tly-line); padding-top: .9rem; }
    .tly-period-row { grid-template-columns: 48px 10px 1fr; }
    .tly-period-preview { grid-column: 3; }
    .tly-period-actions .btn { flex: 1 1 auto; min-height: 48px; }
    .tly-list--drill .tly-drill-cell { display: none; }
    .tly-list th { position: static; }
}

/* ── Audit review programmes, rule builder, dashboard insights (Himanshu, 30-Oct-2026) ── */
.tly-review-grid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.tly-review {
    display: flex; align-items: center; gap: .7rem; text-align: left; font: inherit; min-height: 64px;
    padding: .7rem .8rem; border-radius: 14px; border: 1px solid var(--tly-line); background: var(--tly-surface); color: var(--tly-text); cursor: pointer;
}
.tly-review:hover, .tly-review:focus-visible { border-color: color-mix(in srgb, var(--tly-accent) 45%, var(--tly-line)); box-shadow: var(--tly-shadow-lg); outline: none; }
.tly-review.is-active { border-color: var(--tly-accent); box-shadow: 0 0 0 3px var(--tly-accent-soft); }
.tly-review-icon { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--tly-accent-soft); color: var(--theme-text, var(--tly-accent)); font-size: 1.05rem; }
.tly-review-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.tly-review-title { font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.tly-review-sub { font-size: .74rem; color: var(--tly-muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tly-review-count { display: flex; flex-direction: column; align-items: flex-end; font-size: 1.15rem; font-variant-numeric: tabular-nums; color: var(--tly-muted); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.tly-review-count small { font-size: .68rem; font-weight: clamp(1, calc(500 + var(--spq-fw-delta, 0)), 1000); color: var(--tly-faint); white-space: nowrap; }
.tly-review-count.has-open { color: var(--tly-warn); }
.tly-cu-conds { display: grid; gap: .45rem; }
.tly-cu-cond { display: grid; grid-template-columns: minmax(170px, 1.3fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(0, .8fr) 36px; gap: .45rem; align-items: center; }
.tly-alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.tly-alert-item { display: flex; align-items: center; gap: .65rem; padding: .55rem .75rem; border-radius: 10px; border: 1px solid var(--tly-line); background: var(--tly-surface-2); }
.tly-alert-item i { font-size: 1.05rem; }
.tly-alert-item.is-ok { color: var(--tly-ok); background: var(--tly-ok-bg); border-color: transparent; }
.tly-alert-item.is-warn { color: var(--tly-warn); background: var(--tly-warn-bg); border-color: transparent; }
.tly-alert-item.is-err { color: var(--tly-err); background: var(--tly-err-bg); border-color: transparent; }
.tly-alert-item.is-info { color: var(--tly-info); background: var(--tly-info-bg); border-color: transparent; }
.tly-alert-item span { color: var(--tly-text); }
.tly-stat-foot.is-up { color: var(--tly-ok); }
.tly-stat-foot.is-down { color: var(--tly-err); }
.tly-hbar.is-old { background: var(--tly-err); }

@media (max-width: 767.98px) {
    .tly-review-grid { grid-template-columns: 1fr; }
    .tly-cu-cond { grid-template-columns: 1fr 1fr; }
    .tly-cu-cond > :first-child { grid-column: 1 / -1; }
}

/* ── Period bar + Alt+F2 dialog, F12 configuration, statement tree (Himanshu, 31-Oct-2026) ── */
.tly-period-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .8rem 1.1rem; }
.tly-period-bar-main { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.tly-period-bar-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--tly-muted); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.tly-period-bar-value { font-size: 1.05rem; color: var(--tly-text); font-variant-numeric: tabular-nums; white-space: pre; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.tly-period-bar-sub { font-size: .8rem; color: var(--tly-faint); }
.tly-period-bar kbd, .tly-st-bar kbd { font-size: .7rem; padding: .05rem .35rem; border-radius: 5px; border: 1px solid var(--tly-line); background: var(--tly-surface-2); color: var(--tly-muted); margin-left: .35rem; }
.cmn-modal-body .tly-period { gap: 1rem; }
.tly-f12 .tly-period-title { margin-bottom: .6rem; }
.tly-f12-rows { display: grid; gap: .3rem; max-width: 760px; }
.tly-f12-row { display: grid; grid-template-columns: minmax(220px, 1.6fr) 12px minmax(120px, 1fr) minmax(0, 1.4fr); align-items: center; gap: .5rem; min-height: 36px; }
.tly-f12-row.is-off { opacity: .5; }
.tly-f12-label { color: var(--tly-text); font-size: 1rem; }
.tly-f12-label.is-sub { padding-left: 1.1rem; color: var(--tly-muted); }
.tly-f12-colon { color: var(--tly-muted); text-align: center; }
.tly-f12-value {
    text-align: left; font: inherit; min-height: 36px; padding: .2rem .7rem; border-radius: 8px; border: 1px solid transparent; cursor: pointer;
    background: color-mix(in srgb, #fde68a 42%, var(--tly-surface)); color: var(--tly-text); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
}
.tly-f12-value:hover, .tly-f12-value:focus-visible { border-color: var(--tly-accent); outline: none; }
.tly-f12-value:disabled { cursor: default; }
body.dark-only .tly-f12-value { background: color-mix(in srgb, #fde68a 18%, var(--tly-surface)); }
.tly-f12-select { font: inherit; min-height: 36px; padding: .2rem .5rem; border-radius: 8px; border: 1px solid var(--tly-line); background: var(--tly-surface); color: var(--tly-text); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.tly-f12-note { font-size: .76rem; color: var(--tly-warn); }
.tly-st-wrap { max-height: none; }
.tly-st tr.is-group td { font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000); color: var(--tly-text); }
.tly-st .tly-st-name { padding-left: calc(.7rem + var(--tly-depth, 0) * 1.25rem); display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.tly-st .tly-st-name .tly-cell-sub { width: 100%; padding-left: 1.25rem; }
.tly-st-caret { display: inline-block; width: .9rem; color: var(--theme-text, var(--tly-accent)); }
.tly-st tfoot th { position: sticky; bottom: 0; background: var(--tly-surface-2); }

@media (max-width: 767.98px) {
    .tly-period-bar { flex-direction: column; align-items: stretch; }
    .tly-period-bar .btn { width: 100%; min-height: 48px; }
    .tly-f12-row { grid-template-columns: 1fr auto; }
    .tly-f12-colon { display: none; }
    .tly-f12-note { grid-column: 1 / -1; }
    .tly-st .tly-st-name { padding-left: calc(.7rem + var(--tly-depth, 0) * .6rem); }
}

/* ── Audit Workbench wizard, rule groups, depreciation (Himanshu, 31-Oct-2026) ── */
.tly-wizard { list-style: none; margin: 0 0 .9rem; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
.tly-wizard-step {
    display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: .6rem; align-items: center; text-align: left;
    padding: .6rem .75rem; border: 1px solid var(--tly-line); border-radius: 12px; background: var(--tly-card); cursor: pointer; min-height: 48px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.tly-wizard-step:focus-visible { outline: 2px solid var(--tly-accent); outline-offset: 2px; }
.tly-wizard-step.is-current { border-color: var(--tly-accent); box-shadow: 0 0 0 3px var(--tly-accent-soft); }
.tly-wizard-num {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: .9rem;
    background: var(--tly-accent-soft); color: var(--tly-accent); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
}
.tly-wizard-step.is-done .tly-wizard-num { background: var(--tly-ok-bg); color: var(--tly-ok); }
.tly-wizard-step.is-warn .tly-wizard-num { background: var(--tly-warn-bg); color: var(--tly-warn); }
.tly-wizard-title { display: block; font-size: .9rem; color: var(--tly-text); font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000); line-height: 1.2; }
.tly-wizard-sub { display: block; font-size: .76rem; color: var(--tly-muted); margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tly-wizard-next { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-top: .9rem; flex-wrap: wrap; }

.tly-rulegroup { border: 1px solid var(--tly-line); border-radius: 12px; overflow: hidden; }
.tly-rulegroup + .tly-rulegroup { margin-top: .6rem; }
.tly-rulegroup-head {
    display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: .7rem; align-items: center; width: 100%; text-align: left;
    padding: .65rem .85rem; background: var(--sf-subtle, #f8f9fb); border: 0; cursor: pointer; min-height: 48px;
}
.tly-rulegroup-head:hover { background: var(--tly-accent-soft); }
.tly-rulegroup-count { font-size: .8rem; color: var(--tly-muted); white-space: nowrap; }
.tly-rulegroup-count b { color: var(--tly-text); font-size: 1rem; }
.tly-rulerow {
    display: grid; grid-template-columns: 84px minmax(0, 1fr) 110px 120px 90px; gap: .6rem; align-items: center; width: 100%; text-align: left;
    padding: .5rem .85rem; border: 0; border-top: 1px solid var(--tly-line); background: transparent; cursor: pointer; min-height: 44px; font-size: .86rem;
}
.tly-rulerow:hover, .tly-rulerow.is-active { background: var(--tly-accent-soft); }
.tly-rulerow .num { text-align: right; font-variant-numeric: tabular-nums; }
.tly-rulerow-title { color: var(--tly-text); }
.tly-rulerow-sub { display: block; font-size: .76rem; color: var(--tly-muted); }
.tly-meter { height: 6px; border-radius: 3px; background: var(--tly-line); overflow: hidden; }
.tly-meter > span { display: block; height: 100%; background: var(--tly-warn); }
.tly-finding-detail td { background: var(--sf-subtle, #f8f9fb); }
.tly-ratio-group td { background: var(--sf-subtle, #f8f9fb); }
.tly-ratio-sharp td:first-child { box-shadow: inset 3px 0 0 var(--tly-warn); }
.tly-dep-diff.is-pos { color: var(--tly-err); } .tly-dep-diff.is-neg { color: var(--tly-ok); }

@media (max-width: 991.98px) {
    .tly-wizard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tly-rulerow { grid-template-columns: 72px minmax(0, 1fr) 90px; }
    .tly-rulerow > :nth-child(4), .tly-rulerow > :nth-child(5) { display: none; }
}
@media (max-width: 767.98px) {
    .tly-wizard { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .25rem; -webkit-overflow-scrolling: touch; }
    .tly-wizard-step { flex: 0 0 72%; scroll-snap-align: start; }
    .tly-rulegroup-head { grid-template-columns: 30px minmax(0, 1fr); }
    .tly-rulegroup-count { grid-column: 2; }
}

/* Himanshu (31-Oct-2026) — live pull panel: what Tally is sending right now, chunk by chunk */
.tly-pull { display: grid; gap: .6rem; }
.tly-pull-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.tly-pull-head .tly-pull-now { font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-pull-head .tly-pull-pct { font-variant-numeric: tabular-nums; color: var(--tly-muted); }
.tly-pull-phase { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--tly-muted); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-pull-stats { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .84rem; color: var(--tly-muted); }
.tly-pull-stats b { color: var(--tly-text); font-variant-numeric: tabular-nums; }
.tly-pull-log { list-style: none; margin: 0; padding: 0; max-height: 15rem; overflow: auto; border: 1px solid var(--tly-line); border-radius: .6rem; background: var(--tly-surface-2); }
.tly-pull-log li { display: grid; grid-template-columns: 1.4rem 1fr; gap: .5rem; align-items: start; padding: .4rem .7rem; border-bottom: 1px dashed var(--tly-line); font-size: .84rem; }
.tly-pull-log li:last-child { border-bottom: 0; }
.tly-pull-log li i { margin-top: .15rem; }
.tly-pull-log li.is-ok i { color: color-mix(in srgb, #15803d var(--ink-keep, 100%), var(--ink-flip, #15803d)); }
.tly-pull-log li.is-split i { color: color-mix(in srgb, #b45309 var(--ink-keep, 100%), var(--ink-flip, #b45309)); }
.tly-pull-log li.is-err i { color: color-mix(in srgb, #b91c1c var(--ink-keep, 100%), var(--ink-flip, #b91c1c)); }
.tly-pull-log li.is-run i { color: var(--tly-accent); }
.tly-pull-log .tly-pull-range { font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); margin-right: .35rem; }
.tly-pull-log .tly-pull-meta { color: var(--tly-muted); }
@media (max-width: 767.98px) {
    .tly-pull-log { max-height: 11rem; }
    .tly-pull-stats { gap: .6rem .9rem; }
}

/* Himanshu (1-Nov-2026) — statement heading, T format, drill-down popup. */
.tly-st-heading { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; padding: .25rem 0 .9rem; border-bottom: 1px solid var(--bd, #e5e7eb); margin-bottom: .9rem; }
.tly-st-heading > div:first-child { flex: 1 1 auto; text-align: center; }
.tly-st-heading-co { font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); font-size: 1.05rem; }
.tly-st-heading-title { font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-st-heading-period { color: var(--tc-muted, #6b7280); font-size: .85rem; }
.tly-st-caret-btn { border: 0; background: transparent; padding: 0; line-height: 1; cursor: pointer; }
.tly-t { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--bd, #e5e7eb); border-radius: .5rem; overflow: hidden; }
.tly-t .tly-t-side { margin: 0; border-radius: 0; }
.tly-t .tly-t-side + .tly-t-side { border-left: 1px solid var(--bd, #e5e7eb); }
.tly-t tfoot th { border-top: 2px solid var(--bd, #d1d5db); }
.tly-t-balancing td { font-style: italic; color: var(--theme-text, var(--tly-accent)); }
.tly-list-dialog-body:focus { outline: none; }
.tly-close-confirm { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; position: sticky; top: 0; z-index: 2; }
.tly-crumbs { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .25rem; }
.tly-crumb.is-current { font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-crumb-sep { font-size: .7rem; color: var(--tc-faint, #9ca3af); }
.tly-drill-tbl tbody tr.is-clickable:focus { outline: 2px solid var(--theme-default, #2563eb); outline-offset: -2px; }
@media (max-width: 991.98px) {
    .tly-t { grid-template-columns: 1fr; }
    .tly-t .tly-t-side + .tly-t-side { border-left: 0; border-top: 1px solid var(--bd, #e5e7eb); }
}
@media (max-width: 767.98px) {
    .tly-st-heading > div:first-child { text-align: left; }
    .tly-st-format .btn, .tly-crumb { min-height: 44px; }
}

/* Himanshu (1-Nov-2026) — TallyConfirm: the Esc confirmation, built like the top bar's Exit dialog. */
.tly-confirm-overlay { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(16, 28, 61, .45); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.tly-confirm { display: flex; flex-direction: column; width: min(440px, 100%); background: var(--sf-card, #fff); border: 1px solid var(--bd, #e7ecf3); border-radius: 16px; box-shadow: 0 24px 60px rgba(16, 28, 61, .28); outline: none; }
.tly-confirm-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .9rem .6rem; border-bottom: 1px solid var(--bd, #e7ecf3); }
.tly-confirm-title { display: inline-flex; align-items: center; gap: .5rem; margin: 0; font-size: 1rem; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); color: var(--theme-text, var(--theme-default, #5647d8)); }
.tly-confirm-x { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--tc-muted, #7e8ba4); cursor: pointer; }
.tly-confirm-body { padding: .8rem .9rem .4rem; }
.tly-confirm-lead { margin: 0 0 .5rem; color: var(--tc-text, #374151); }
.tly-confirm-hint { margin: 0; font-size: .82rem; color: var(--tc-muted, #6b7280); }
.tly-confirm-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .6rem .9rem .8rem; }
.tly-t-calc td { font-style: italic; color: var(--theme-text, var(--tly-accent)); }
.tly-t-total th { border-top: 1px solid var(--bd, #d1d5db); border-bottom: 2px solid var(--bd, #d1d5db); }
.tly-t-pad td { border-bottom-color: transparent; }
.tly-t-sub { color: var(--tc-muted, #6b7280); }
@media (max-width: 767.98px) {
    .tly-confirm-overlay { align-items: flex-end; padding: 0; }
    .tly-confirm { width: 100%; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); }
    .tly-confirm-foot .btn { flex: 1 1 0; min-height: 44px; }
    .tly-t-pad { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════
   SPEQTA Tally Connect — workspace redesign (Himanshu, 01-Nov-2026).
   App bar · module menu (click-open dropdowns, search, help) · page heading with trail ·
   connection strip · figures · module cards · activity lists · numbered step cards.
   Module tones: blue (push), green (pull), amber (audit) are status-style literals; analytics
   uses the user's theme colour. Desktop first; phone rules in the media query at the end.
   ═══════════════════════════════════════════════════════════════════════════════════════════ */
.tly-page { --tly-radius: 16px; }
.tone-blue  { --tone: #2563eb; }
.tone-green { --tone: #16a34a; }
.tone-amber { --tone: #d97706; }
.tone-theme { --tone: var(--theme-default, #0f766e); }
body.dark-only .tone-blue  { --tone: #60a5fa; }
body.dark-only .tone-green { --tone: #4ade80; }
body.dark-only .tone-amber { --tone: #fbbf24; }

/* App bar */
.tly-app {
    display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem;
    padding: .25rem 0 1rem;
}
.tly-brand {
    display: flex; align-items: center; gap: .8rem; min-width: 0; flex: 1 1 320px;
    border: 0; background: none; padding: 0; text-align: left; color: inherit; cursor: pointer;
}
.tly-brand-mark {
    width: 52px; height: 52px; flex: 0 0 52px; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; color: #fff;
    background: linear-gradient(135deg, var(--tly-accent), color-mix(in srgb, var(--tly-accent) 60%, #0f172a));
    box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--tly-accent) 75%, transparent);
}
.tly-brand-text { display: flex; flex-direction: column; min-width: 0; }
.tly-brand-name { font-size: 1.35rem; line-height: 1.2; color: var(--tly-text); font-weight: clamp(1, calc(750 + var(--spq-fw-delta, 0)), 1000); }
.tly-brand-tag { font-size: .86rem; color: var(--tly-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tly-app-side { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.tly-select {
    display: inline-flex; align-items: center; gap: .45rem; height: 42px; padding: 0 .75rem;
    border: 1px solid var(--tly-line); border-radius: 12px; background: var(--tly-surface);
    color: var(--tly-text); box-shadow: var(--tly-shadow); max-width: 22rem;
}
.tly-select i { color: var(--tly-muted); font-size: .85rem; }
.tly-select select {
    border: 0; background: transparent; color: inherit; font: inherit; font-size: .88rem; outline: none;
    min-width: 0; max-width: 18rem; text-overflow: ellipsis; cursor: pointer;
}
.tly-select--static { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tly-iconbtn {
    width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--tly-line);
    background: var(--tly-surface); color: var(--tly-text-2); box-shadow: var(--tly-shadow); cursor: pointer;
}
.tly-iconbtn:hover, .tly-iconbtn:focus-visible { border-color: var(--tly-accent); color: var(--theme-text, var(--tly-accent)); outline: none; }
.tly-page .tly-conn { height: 42px; border-radius: 12px; }

/* Module menu */
.tly-nav {
    position: relative; z-index: 30;
    display: flex; align-items: center; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap;
    padding: .45rem .6rem; margin-bottom: 1.25rem;
    background: var(--tly-surface); border: 1px solid var(--tly-line); border-radius: var(--tly-radius); box-shadow: var(--tly-shadow);
}
.tly-nav-items, .tly-nav-tools { display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; }
.tly-nav-menu { position: relative; }
.tly-nav-btn {
    display: inline-flex; align-items: center; gap: .45rem; height: 44px; padding: 0 .85rem;
    border: 0; border-radius: 10px; background: transparent; cursor: pointer; white-space: nowrap;
    color: var(--tly-text-2); font-size: .9rem; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000);
    position: relative;
}
.tly-nav-btn i:first-child { color: var(--tly-muted); font-size: .85rem; }
.tly-nav-caret { font-size: .62rem; opacity: .6; transition: transform .15s; }
.tly-nav-btn:hover, .tly-nav-btn:focus-visible { background: var(--tly-surface-2); color: var(--tly-text); outline: none; }
.tly-nav-btn.is-open { background: var(--tly-accent-soft); color: var(--theme-text, var(--tly-accent)); }
.tly-nav-btn.is-open .tly-nav-caret { transform: rotate(180deg); }
.tly-nav-btn.is-active { color: var(--theme-text, var(--tly-accent)); }
.tly-nav-btn.is-active i:first-child { color: var(--theme-text, var(--tly-accent)); }
.tly-nav-btn.is-active::after {
    content: ""; position: absolute; left: .85rem; right: .85rem; bottom: -.45rem; height: 3px;
    border-radius: 3px 3px 0 0; background: var(--tly-accent);
}
.tly-nav-search { position: relative; display: flex; align-items: center; }
.tly-nav-search i { position: absolute; left: .75rem; font-size: .8rem; color: var(--tly-faint); pointer-events: none; }
.tly-nav-search input {
    width: 15rem; height: 40px; padding: 0 .8rem 0 2.1rem; border-radius: 10px;
    border: 1px solid var(--tly-line); background: var(--tly-surface-2); color: var(--tly-text); font-size: .86rem; outline: none;
}
.tly-nav-search input:focus { border-color: var(--tly-accent); box-shadow: 0 0 0 3px var(--tly-accent-soft); background: var(--tly-surface); }
.tly-menu-backdrop { position: fixed; inset: 0; z-index: 25; }
.tly-menu {
    position: absolute; top: calc(100% + .5rem); left: 0; z-index: 40; width: 25rem; max-width: calc(100vw - 2rem);
    max-height: min(70vh, 34rem); overflow: auto; padding: .45rem;
    background: var(--tly-surface); border: 1px solid var(--tly-line); border-radius: 14px; box-shadow: var(--tly-shadow-lg);
    animation: tlyMenuIn .14s ease-out;
}
.tly-menu--end, .tly-menu--search { left: auto; right: 0; }
.tly-menu--search { width: 22rem; }
@keyframes tlyMenuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.tly-menu-head { padding: .55rem .7rem .6rem; border-bottom: 1px solid var(--tly-line); margin-bottom: .35rem; }
.tly-menu-title { display: block; color: var(--tly-text); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.tly-menu-sub { display: block; font-size: .78rem; color: var(--tly-muted); }
.tly-menu-empty { padding: .9rem; font-size: .85rem; color: var(--tly-muted); }
.tly-menu-item {
    display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 52px; padding: .5rem .6rem;
    border: 0; border-radius: 10px; background: transparent; text-align: left; color: var(--tly-text-2); cursor: pointer;
}
.tly-menu-item:hover, .tly-menu-item:focus-visible { background: var(--tly-surface-2); outline: none; }
.tly-menu-item.is-current { background: var(--tly-accent-soft); }
.tly-menu-item.is-locked { opacity: .72; }
.tly-menu-ic, .tly-activity-ic {
    width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center; font-size: .9rem;
    color: var(--tone, var(--tly-accent)); background: color-mix(in srgb, var(--tone, var(--tly-accent)) 13%, transparent);
}
.tly-menu-text, .tly-activity-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.tly-menu-item-title, .tly-activity-title { color: var(--tly-text); font-size: .9rem; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-menu-item-sub, .tly-activity-sub { font-size: .77rem; color: var(--tly-muted); }

/* Page heading */
.tly-pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.15rem; }
.tly-pagehead-main { display: flex; align-items: flex-start; gap: .75rem; min-width: 0; flex: 1 1 420px; }
.tly-trail { display: flex; align-items: center; gap: .4rem; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--theme-text, var(--tly-accent)); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.tly-trail-link { border: 0; background: none; padding: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.tly-trail-link:hover { text-decoration: underline; }
.tly-pagehead-title { margin: .2rem 0 0; font-size: 1.65rem; line-height: 1.25; color: var(--tly-text); font-weight: clamp(1, calc(750 + var(--spq-fw-delta, 0)), 1000); }
.tly-pagehead-sub { margin: .3rem 0 0; font-size: .92rem; color: var(--tly-muted); max-width: 62rem; }
/* 07-Nov-2026: data-source line under the page subtitle, and the "what to do" line inside every error box. */
.tly-pagehead-src { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin: .3rem 0 0; font-size: .8rem; color: var(--tly-muted); }
.tly-pagehead-src > i { color: var(--theme-text, var(--theme-default, #0d6efd)); }
.tly-error-fix { display: block; margin-top: .2rem; font-size: .85rem; }
.tly-error-fix:empty { display: none; }
.tly-pagehead .tly-head-actions { flex: 0 1 auto; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.tly-btn-md { height: 42px; border-radius: 12px; display: inline-flex; align-items: center; }

/* Connection strip */
.tly-connstrip {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.15rem; margin-bottom: 1.1rem;
    border: 1px solid var(--tly-line); border-radius: var(--tly-radius); box-shadow: var(--tly-shadow);
    background: linear-gradient(120deg, var(--tly-surface), color-mix(in srgb, var(--tly-accent) 6%, var(--tly-surface)));
}
.tly-connstrip-ic {
    width: 48px; height: 48px; flex: 0 0 48px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.tly-connstrip.is-ok .tly-connstrip-ic { color: var(--tly-ok); background: var(--tly-ok-bg); }
.tly-connstrip.is-warn .tly-connstrip-ic { color: var(--tly-warn); background: var(--tly-warn-bg); }
.tly-connstrip-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 320px; }
.tly-connstrip-text strong { color: var(--tly-text); font-size: 1rem; }
.tly-connstrip-text span { font-size: .84rem; color: var(--tly-muted); }
.tly-connstrip-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.tly-pill { display: inline-flex; align-items: center; gap: .4rem; height: 32px; padding: 0 .75rem; border-radius: 999px; font-size: .8rem; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-pill.is-ok { color: var(--tly-ok); background: var(--tly-ok-bg); }
.tly-pill.is-warn { color: var(--tly-warn); background: var(--tly-warn-bg); }

/* Figures */
.tly-kpis { display: grid; gap: 1rem; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1.4rem; }
.tly-kpi {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; min-height: 132px;
    padding: 1.1rem 1.2rem; text-align: left; cursor: pointer; color: inherit;
    background: var(--tly-surface); border: 1px solid var(--tly-line); border-radius: var(--tly-radius); box-shadow: var(--tly-shadow);
    transition: border-color .15s, box-shadow .15s;
}
.tly-kpi:hover, .tly-kpi:focus-visible { border-color: color-mix(in srgb, var(--tone) 45%, var(--tly-line)); box-shadow: var(--tly-shadow-lg); outline: none; }
.tly-kpi-label { font-size: .84rem; color: var(--tly-muted); padding-right: 3rem; }
.tly-kpi-ic {
    position: absolute; top: 1rem; right: 1rem; width: 44px; height: 44px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center; color: var(--tone); background: color-mix(in srgb, var(--tone) 13%, transparent);
}
.tly-kpi-value { margin-top: .35rem; font-size: 1.85rem; line-height: 1.15; color: var(--tly-text); font-variant-numeric: tabular-nums; font-weight: clamp(1, calc(750 + var(--spq-fw-delta, 0)), 1000); }
.tly-kpi-sub { font-size: .8rem; color: var(--tly-muted); }
.tly-kpi-sub.is-warn { color: var(--tly-warn); }

/* Module cards */
.tly-section-row { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin: .2rem 0 .7rem; }
.tly-section-row .tly-section-title { margin: 0; }
.tly-modules { display: grid; gap: 1rem; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1.4rem; }
.tly-module {
    display: flex; flex-direction: column; background: var(--tly-surface); border: 1px solid var(--tly-line);
    border-radius: var(--tly-radius); box-shadow: var(--tly-shadow); transition: border-color .15s, box-shadow .15s;
}
.tly-module:hover { border-color: color-mix(in srgb, var(--tone) 40%, var(--tly-line)); box-shadow: var(--tly-shadow-lg); }
.tly-module-main {
    display: flex; align-items: flex-start; gap: .9rem; flex: 1 1 auto; padding: 1.15rem 1.2rem 1rem;
    border: 0; background: none; text-align: left; color: inherit; cursor: pointer; border-radius: var(--tly-radius) var(--tly-radius) 0 0;
}
.tly-module-main:focus-visible { outline: 2px solid var(--tone); outline-offset: -2px; }
.tly-module-ic {
    width: 46px; height: 46px; flex: 0 0 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.05rem; color: var(--tone); background: color-mix(in srgb, var(--tone) 13%, transparent);
}
.tly-module-title { display: block; font-size: 1.05rem; color: var(--tly-text); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.tly-module-sub { display: block; margin-top: .2rem; font-size: .82rem; color: var(--tly-muted); }
.tly-module-foot {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem 1.2rem;
    border-top: 1px solid var(--tly-line); font-size: .8rem; color: var(--tly-muted);
}
.tly-linkbtn {
    border: 0; background: none; padding: .25rem 0; color: var(--theme-text, var(--tly-accent)); cursor: pointer;
    font-size: .84rem; font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000);
}
.tly-linkbtn i { font-size: .72rem; margin-left: .2rem; transition: transform .15s; }
.tly-linkbtn:hover i { transform: translateX(2px); }

/* Tools of one module */
.tly-tools { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tly-tool {
    display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; min-height: 168px; padding: 1.1rem 1.15rem;
    text-align: left; color: inherit; cursor: pointer;
    background: var(--tly-surface); border: 1px solid var(--tly-line); border-radius: var(--tly-radius); box-shadow: var(--tly-shadow);
    transition: border-color .15s, box-shadow .15s;
}
.tly-tool:hover, .tly-tool:focus-visible { border-color: color-mix(in srgb, var(--tone) 45%, var(--tly-line)); box-shadow: var(--tly-shadow-lg); outline: none; }
.tly-tool.is-locked { opacity: .78; }
.tly-tool-ic {
    width: 42px; height: 42px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
    color: var(--tone); background: color-mix(in srgb, var(--tone) 13%, transparent); margin-bottom: .25rem;
}
.tly-tool-title { color: var(--tly-text); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.tly-tool-sub { font-size: .82rem; color: var(--tly-muted); flex: 1 1 auto; }
.tly-tool-go { font-size: .82rem; color: var(--theme-text, var(--tly-accent)); font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000); }

/* Activity / help lists */
.tly-activity { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.tly-activity-row {
    display: flex; align-items: center; gap: .8rem; width: 100%; min-height: 60px; padding: .6rem .75rem;
    border: 1px solid var(--tly-line); border-radius: 12px; background: var(--tly-surface); text-align: left; color: inherit; cursor: pointer;
}
.tly-activity-row:hover, .tly-activity-row:focus-visible { border-color: color-mix(in srgb, var(--tly-accent) 40%, var(--tly-line)); background: var(--tly-surface-2); outline: none; }
.tly-two { align-items: stretch; }

/* Numbered step cards (Connection, Getting started) */
.tly-step { border-radius: 14px; padding: .95rem 1rem; background: var(--tly-surface); align-items: flex-start; }
.tly-step-dot {
    width: 36px; height: 36px; flex: 0 0 36px; font-size: .95rem;
    color: var(--theme-text, var(--tly-accent)); background: var(--tly-accent-soft);
}
.tly-step-title { font-size: .98rem; }

@media (max-width: 1199.98px) {
    .tly-kpis, .tly-modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .tly-app { padding-bottom: .6rem; }
    .tly-brand-mark { width: 44px; height: 44px; flex-basis: 44px; }
    .tly-brand-name { font-size: 1.1rem; }
    .tly-brand-tag { display: none; }
    .tly-app-side { width: 100%; }
    .tly-app-side .tly-select { flex: 1 1 auto; min-width: 0; height: 44px; }
    .tly-iconbtn, .tly-page .tly-conn { height: 44px; min-width: 44px; }
    .tly-page .tly-conn-text { display: none; }
    /* Menu: one swipeable row; menus open as bottom sheets. */
    .tly-nav { padding: .35rem; margin-bottom: 1rem; }
    .tly-nav-items { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; -webkit-overflow-scrolling: touch; }
    .tly-nav-items::-webkit-scrollbar { display: none; }
    .tly-nav-tools { width: 100%; flex-wrap: nowrap; }
    .tly-nav-search { flex: 1 1 auto; }
    .tly-nav-search input { width: 100%; height: 44px; }
    .tly-nav-btn.is-active::after { bottom: 0; }
    .tly-menu, .tly-menu--end, .tly-menu--search {
        position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-width: none; max-height: 78vh;
        border-radius: 18px 18px 0 0; padding: .6rem .6rem calc(.6rem + env(safe-area-inset-bottom));
        animation: tlySheetIn .2s ease-out;
    }
    .tly-menu-backdrop { background: rgba(15, 23, 42, .4); }
    .tly-menu-item { min-height: 56px; }
    .tly-pagehead-title { font-size: 1.3rem; }
    .tly-pagehead .tly-head-actions { width: 100%; }
    .tly-kpis, .tly-modules { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
    .tly-kpi { min-height: 0; }
    .tly-connstrip-actions { width: 100%; }
    .tly-connstrip-actions .btn { flex: 1 1 auto; min-height: 44px; }
    .tly-two { grid-template-columns: minmax(0, 1fr); }
}
@keyframes tlySheetIn { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .tly-menu, .tly-kpi, .tly-module, .tly-tool { animation: none; transition: none; }
}

/* Plain list tables (cards, dialogs, breakdowns) — same presentation as the light grid (01-Nov-2026). */
.tly-list-wrap { border-radius: 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.tly-list { font-size: 13px; }
.tly-list th {
    height: 40px; padding: 6px 12px; vertical-align: middle;
    font-size: 11.5px; letter-spacing: .01em; color: var(--tly-muted); background: var(--tly-surface-2);
}
.tly-list th.num { text-align: right; }
.tly-list td { padding: 8px 12px; vertical-align: middle; border-bottom-color: color-mix(in srgb, var(--tly-line) 70%, transparent); }
.tly-list tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--tly-surface-2) 60%, var(--tly-surface)); }
.tly-list tbody tr:hover td { background: color-mix(in srgb, var(--tly-accent) 5%, var(--tly-surface)); }
.tly-list tfoot th, .tly-list tfoot td {
    position: sticky; bottom: 0; background: var(--tly-surface-2); color: var(--tly-text);
    border-top: 2px solid var(--tly-line); font-variant-numeric: tabular-nums;
}
.tly-list .tly-cell-title { color: var(--tly-text); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
@media (max-width: 767.98px) {
    .tly-list tbody tr:nth-child(even) td, .tly-list tbody tr:hover td { background: transparent; }
}

/* ═══ Tally light grid (TallyLiteGrid) — moved here from the component's scoped CSS (01-Nov-2026) so its styles
   ship with tally.css and its cache-bust stamp; the scoped bundle is not always rebuilt with the markup. ═══ */
/* Himanshu — Tally light grid (01-Nov-2026; presentation pass the same day).
   One line per row (full value on hover), long text clamped to two lines, spare width taken by a filler column,
   zeros shown as a faint dash, negatives in red, state words as badges, first column pinned, rows kept (dimmed)
   while reloading. Theme tokens only, so dark mode and the user's theme follow. Phone rules are in the media query. */
.tlg {
    border: 1px solid var(--bd, #e2e8f0);
    border-radius: 14px;
    background: var(--sf-card, #fff);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    overflow: hidden;
}

/* ── Toolbar ── */
.tlg-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--bd, #e2e8f0);
}
.tlg-title { font-size: 14px; color: var(--tc-strong, #0f172a); font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000); }
.tlg-count {
    display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px;
    font-size: 11.5px; color: var(--tc-muted, #64748b); background: var(--sf-subtle, #f1f5f9); white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.tlg-spacer { flex: 1 1 auto; }
.tlg-search { position: relative; display: flex; align-items: center; flex: 0 1 280px; min-width: 170px; }
.tlg-search i { position: absolute; left: 10px; font-size: 11px; color: var(--tc-faint, #94a3b8); pointer-events: none; }
.tlg-search input {
    width: 100%; height: 34px; padding: 0 10px 0 30px;
    border: 1px solid var(--bd, #e2e8f0); border-radius: 9px;
    background: var(--sf-subtle, #f8fafc); color: var(--tc-text, #334155); font-size: 13px; outline: none;
    transition: border-color .12s, box-shadow .12s, background .12s;
}
.tlg-search input:focus { border-color: var(--theme-default); background: var(--sf-card, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-default) 15%, transparent); }
.tlg-chip, .tlg-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px;
    border-radius: 9px; font-size: 12.5px; cursor: pointer; white-space: nowrap;
    font-weight: clamp(1, calc(550 + var(--spq-fw-delta, 0)), 1000);
}
.tlg-chip {
    border: 1px solid color-mix(in srgb, var(--theme-default) 35%, transparent);
    background: color-mix(in srgb, var(--theme-default) 9%, transparent);
    color: var(--theme-text, var(--theme-default));
}
.tlg-btn { border: 1px solid var(--bd, #e2e8f0); background: var(--sf-card, #fff); color: var(--tc-text, #334155); }
.tlg-btn:hover:not(:disabled), .tlg-btn:focus-visible { border-color: var(--theme-default); color: var(--theme-text, var(--theme-default)); outline: none; }
.tlg-btn:disabled { opacity: .45; cursor: default; }
.tlg-btn--icon { width: 34px; padding: 0; }

/* ── Scroll area ── */
.tlg-wrap {
    position: relative;
    overflow: auto;
    max-height: calc(100vh - 250px);
    min-height: 220px;
    overscroll-behavior: contain;
    outline: none;
}
.tlg-wrap:focus-visible { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--theme-default) 40%, transparent); }
.tlg-loadbar {
    position: sticky; top: 0; left: 0; z-index: 6; height: 2px; width: 100%; margin-bottom: -2px;
    background: linear-gradient(90deg, transparent, var(--theme-default), transparent);
    background-size: 40% 100%; background-repeat: no-repeat;
    animation: tlgLoad 1s linear infinite;
}
@keyframes tlgLoad { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.tlg-wrap.is-loading tbody { opacity: .55; transition: opacity .15s; }

/* ── Table ── */
.tlg-table {
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: max-content;
    font-size: 13px;
    color: var(--tc-text, #334155);
}
.tlg-table th, .tlg-table td { background: var(--sf-card, #fff); }

.tlg-table thead th {
    position: sticky; top: 0; z-index: 3;
    height: 40px; padding: 6px 10px;
    background: var(--sf-subtle, #f8fafc);
    color: var(--tc-muted, #64748b);
    font-size: 11.5px; line-height: 1.25; letter-spacing: .01em; text-align: left; vertical-align: middle;
    font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000);
    border-bottom: 1px solid var(--bd, #e2e8f0);
    user-select: none;
}
.tlg-table thead tr.tlg-filter-row th { top: 40px; height: 38px; padding: 4px 6px; border-bottom: 1px solid var(--bd, #e2e8f0); }
.tlg-table thead th.num { text-align: right; }
.tlg-table thead th.is-sorted { color: var(--theme-text, var(--theme-default)); }
.tlg-th-sort {
    display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
    padding: 0; border: none; background: transparent; color: inherit; font: inherit; text-align: inherit; cursor: pointer;
}
.tlg-table thead th.num .tlg-th-sort { flex-direction: row-reverse; }
.tlg-th-sort span, .tlg-th-text {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal;
}
.tlg-th-sort:hover { color: var(--tc-strong, #0f172a); }
.tlg-sort-ic { font-size: 9px; flex: 0 0 auto; }
.tlg-sort-ic.is-dim { opacity: .3; }

.tlg-filter {
    width: 100%; height: 28px; padding: 0 8px;
    border: 1px solid var(--bd, #e2e8f0); border-radius: 7px;
    background: var(--sf-card, #fff); color: var(--tc-text, #334155); font-size: 12px; outline: none;
}
.tlg-filter::placeholder { color: var(--tc-faint, #94a3b8); }
.tlg-filter.num { text-align: right; }
.tlg-filter:focus { border-color: var(--theme-default); box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-default) 14%, transparent); }
.tlg-filter.is-on { border-color: var(--theme-default); background: color-mix(in srgb, var(--theme-default) 7%, var(--sf-card, #fff)); }

.tlg-table tbody td, .tlg-table tfoot td {
    height: 38px; padding: 7px 10px;
    vertical-align: middle;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    border-bottom: 1px solid color-mix(in srgb, var(--bd, #e2e8f0) 70%, transparent);
}
.tlg-table tbody td.num, .tlg-table tfoot td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tlg-table tbody td.is-neg { color: color-mix(in srgb, #b91c1c var(--ink-keep, 100%), var(--ink-flip, #b91c1c)); }
.tlg-table tbody td.tlg-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; letter-spacing: .02em; }
.tlg-table tbody td.tlg-long { white-space: normal; }
.tlg-table tbody td.tlg-long .tlg-cell { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.tlg-zero { color: var(--tc-faint, #94a3b8); }

.tlg-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--sf-subtle, #f8fafc) 60%, var(--sf-card, #fff)); }
.tlg-table tbody tr:hover td { background: color-mix(in srgb, var(--theme-default) 5%, var(--sf-card, #fff)); }
.tlg-table tbody tr.is-active td { background: color-mix(in srgb, var(--theme-default) 11%, var(--sf-card, #fff)); }
.tlg-table tbody tr.is-active td.tlg-sno { box-shadow: inset 3px 0 0 var(--theme-default); }

/* Row tones a screen may set through RowClass: needs attention (amber) / set aside (faded). */
.tlg-table tbody tr.tlg-row-warn td { background: color-mix(in srgb, #f59e0b 8%, var(--sf-card, #fff)); }
.tlg-table tbody tr.tlg-row-warn td.tlg-sno { box-shadow: inset 3px 0 0 #f59e0b; }
.tlg-table tbody tr.tlg-row-muted td { color: var(--tc-faint, #94a3b8); }

.tlg-table tfoot td {
    position: sticky; bottom: 0; z-index: 2;
    background: var(--sf-subtle, #f8fafc);
    color: var(--tc-strong, #0f172a);
    font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000);
    border-top: 2px solid var(--bd, #e2e8f0); border-bottom: 0;
}

/* Row number column + pinned first column */
.tlg-sno {
    position: sticky; left: 0; z-index: 2;
    text-align: right !important; padding-right: 10px !important;
    color: var(--tc-faint, #94a3b8); font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.tlg-table thead th.tlg-sno { z-index: 5; }
.tlg-table tfoot td.tlg-sno { z-index: 4; }
.tlg-wrap.is-frozen .tlg-first { position: sticky; left: 52px; z-index: 2; box-shadow: 1px 0 0 var(--bd, #e2e8f0); }
.tlg-wrap.is-frozen.no-sno .tlg-first { left: 0; }
.tlg-wrap.is-frozen thead .tlg-first { z-index: 5; }
.tlg-wrap.is-frozen tfoot .tlg-first { z-index: 4; }
.tlg-fill { padding: 0 !important; }

/* State words */
.tlg-badge {
    display: inline-flex; align-items: center; max-width: 100%; height: 22px; padding: 0 8px; border-radius: 999px;
    font-size: 11.5px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000);
}
.tlg-badge--ok    { color: color-mix(in srgb, #15803d var(--ink-keep, 100%), var(--ink-flip, #15803d)); background: color-mix(in srgb, #16a34a 13%, transparent); }
.tlg-badge--warn  { color: color-mix(in srgb, #b45309 var(--ink-keep, 100%), var(--ink-flip, #b45309)); background: color-mix(in srgb, #f59e0b 16%, transparent); }
.tlg-badge--err   { color: color-mix(in srgb, #b91c1c var(--ink-keep, 100%), var(--ink-flip, #b91c1c)); background: color-mix(in srgb, #ef4444 13%, transparent); }
.tlg-badge--info  { color: color-mix(in srgb, #1d4ed8 var(--ink-keep, 100%), var(--ink-flip, #1d4ed8)); background: color-mix(in srgb, #3b82f6 13%, transparent); }
.tlg-badge--muted { color: var(--tc-muted, #64748b); background: color-mix(in srgb, #64748b 12%, transparent); }

/* Empty / loading */
.tlg-table tbody td.tlg-msg {
    height: auto; padding: 44px 16px !important; white-space: normal; text-align: center !important;
    color: var(--tc-muted, #64748b); background: var(--sf-card, #fff) !important;
}
.tlg-msg { display: table-cell; }
.tlg-empty-ic {
    display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%;
    margin-bottom: 8px; font-size: 18px; color: var(--tc-faint, #94a3b8); background: var(--sf-subtle, #f1f5f9);
}
.tlg-empty-title { display: block; font-size: 13.5px; color: var(--tc-text, #334155); }

.tlg-link {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis;
    padding: 0; border: none; background: none;
    color: var(--theme-text, var(--theme-default)); font: inherit; text-align: left; cursor: pointer;
    font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000);
}
.tlg-link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ── Pager ── */
.tlg-pager {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px;
    padding: 8px 12px;
    border-top: 1px solid var(--bd, #e2e8f0);
    font-size: 12.5px; color: var(--tc-muted, #64748b);
}
.tlg-range { font-variant-numeric: tabular-nums; color: var(--tc-text, #334155); }
.tlg-size { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.tlg-size select {
    height: 30px; padding: 0 6px; border: 1px solid var(--bd, #e2e8f0); border-radius: 7px;
    background: var(--sf-card, #fff); color: var(--tc-text, #334155); font-size: 12.5px;
}
.tlg-pageno { padding: 0 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
    .tlg-loadbar { animation: none; }
}

/* Phones: rows become stacked cards (label from data-label), the filter row is hidden, taps stay ≥ 44px. */
@media (max-width: 767.98px) {
    .tlg-bar { padding: 10px; }
    .tlg-search { flex: 1 1 100%; }
    .tlg-search input, .tlg-chip, .tlg-btn { height: 44px; }
    .tlg-btn--icon { width: 44px; }
    .tlg-size select { height: 44px; }
    .tlg-wrap { max-height: none; }
    .tlg-table { min-width: 0; }
    .tlg-table, .tlg-table tbody, .tlg-table tr, .tlg-table td { display: block; width: 100%; }
    .tlg-table colgroup, .tlg-table thead, .tlg-table tfoot { display: none; }
    .tlg-table tbody tr { padding: 10px 14px; border-bottom: 1px solid var(--bd, #e2e8f0); }
    .tlg-table tbody tr:nth-child(even) td, .tlg-table tbody td { background: transparent !important; }
    .tlg-table tbody td {
        display: flex; justify-content: space-between; gap: 12px; height: auto; padding: 3px 0;
        border: none; text-align: right; white-space: normal; position: static !important; box-shadow: none !important;
    }
    .tlg-table tbody td::before { content: attr(data-label); flex: 0 0 auto; text-align: left; color: var(--tc-muted, #64748b); font-size: 12px; }
    .tlg-table tbody td.tlg-sno, .tlg-table tbody td.tlg-fill { display: none; }
    .tlg-table tbody td.tlg-msg::before { content: none; }
    .tlg-table tbody td.tlg-msg { display: block; }
    .tlg-table tbody tr.is-active { box-shadow: inset 3px 0 0 var(--theme-default); }
    .tlg-table tbody tr.tlg-row-warn { box-shadow: inset 3px 0 0 #f59e0b; }
}

/* Dark mode: the status reds / greens / ambers in lighter shades so they stay readable. */
body.dark-only .tlg-table tbody td.is-neg { color: #f87171; }
body.dark-only .tlg-badge--ok   { color: #4ade80; }
body.dark-only .tlg-badge--warn { color: #fbbf24; }
body.dark-only .tlg-badge--err  { color: #f87171; }
body.dark-only .tlg-badge--info { color: #93c5fd; }

/* ═══ Full-width workspace and module pages (Himanshu, 01-Nov-2026) ═══
   The page was capped at 1320px, which left wide screens half empty and squeezed the grids. It now uses the
   whole width, with side padding that grows with the screen. Module buttons open pages of tool cards. */
.tly-page {
    max-width: none;
    padding: 1rem clamp(1rem, 2.2vw, 2.5rem) 2.5rem;
}
.tly-nav { flex-wrap: nowrap; }
.tly-nav-items { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tly-nav-items::-webkit-scrollbar { display: none; }
.tly-nav-tools { flex: 0 0 auto; flex-wrap: nowrap; gap: .4rem; }
.tly-nav-search input { width: clamp(11rem, 18vw, 20rem); }
.tly-kpis { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tly-modules { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }

/* Tool cards: even rows, a clear "open" line at the bottom. */
.tly-tools { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; }
.tly-tool { position: relative; min-height: 190px; padding: 1.25rem 1.3rem 1.1rem; border-radius: 16px; }
.tly-tool-ic { width: 48px; height: 48px; border-radius: 13px; font-size: 1.1rem; margin-bottom: .45rem; }
.tly-tool-title { font-size: 1.02rem; }
.tly-tool-sub { line-height: 1.45; }
.tly-tool-go {
    display: flex; align-items: center; gap: .35rem; width: 100%; margin-top: .6rem; padding-top: .75rem;
    border-top: 1px solid var(--tly-line);
}
.tly-tool-go i { font-size: .72rem; transition: transform .15s; }
.tly-tool:hover .tly-tool-go i { transform: translateX(3px); }
.tly-tool-step {
    position: absolute; top: 1.1rem; right: 1.1rem; padding: .15rem .55rem; border-radius: 999px;
    font-size: .72rem; color: var(--tly-muted); background: var(--tly-surface-2); border: 1px solid var(--tly-line);
}
.tly-tool .tly-badge { margin-top: .6rem; }

@media (max-width: 991.98px) {
    .tly-nav { flex-wrap: wrap; }
    .tly-nav-items { width: 100%; }
    .tly-nav-tools { width: 100%; }
    .tly-nav-search { flex: 1 1 auto; }
    .tly-nav-search input { width: 100%; }
}
@media (max-width: 767.98px) {
    .tly-page { padding: .75rem .75rem 2rem; }
    .tly-tools { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
    .tly-tool { min-height: 0; }
}

/* ═══ Period bar (TallyDateRange, Himanshu 01-Nov-2026) — one slim strip: calendar tile, the two dates as
   pills, the day count, then "Books as of" and the Change Period button. The whole left half is a button. ═══ */
.tly-period-bar { padding: .5rem .75rem; gap: .5rem .75rem; align-items: center; }
.tly-period-bar-main {
    display: flex; align-items: center; gap: .65rem; min-width: 0; flex: 1 1 320px;
    border: 0; background: transparent; padding: .25rem .4rem; border-radius: 10px; text-align: left; color: inherit; cursor: pointer;
}
.tly-period-bar-main:hover:not(:disabled), .tly-period-bar-main:focus-visible { background: var(--tly-accent-soft); outline: none; }
.tly-period-bar-main:disabled { cursor: default; opacity: .7; }
.tly-period-bar-ic {
    width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--tly-accent-soft); color: var(--theme-text, var(--tly-accent)); font-size: .95rem;
}
.tly-period-bar-text { display: flex; flex-direction: column; min-width: 0; gap: .1rem; }
.tly-period-bar-label { font-size: .66rem; }
.tly-period-bar-value { font-size: .95rem; white-space: normal; display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.tly-period-date {
    display: inline-block; padding: .05rem .5rem; border-radius: 7px; font-variant-numeric: tabular-nums; letter-spacing: .01em;
    background: var(--tly-surface-2); border: 1px solid var(--tly-line); color: var(--tly-text);
}
.tly-period-to { font-size: .76rem; color: var(--tly-muted); text-transform: lowercase; font-weight: clamp(1, calc(500 + var(--spq-fw-delta, 0)), 1000); }
.tly-period-bar-sub { margin-left: .15rem; }
.tly-period-bar-side { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; margin-left: auto; }
.tly-period-bar-btn { height: 34px; border-radius: 9px; display: inline-flex; align-items: center; white-space: nowrap; }
.tly-period-input::placeholder { color: var(--tly-faint); font-weight: clamp(1, calc(400 + var(--spq-fw-delta, 0)), 1000); letter-spacing: .03em; }
@media (max-width: 767.98px) {
    .tly-period-bar-main { flex: 1 1 100%; min-height: 48px; }
    .tly-period-bar-side { width: 100%; margin-left: 0; }
    .tly-period-bar-btn { width: 100%; min-height: 48px; }
}

/* ═══ Compact pass (Himanshu, 01-Nov-2026) — desktop and tablet only (768px and up), so every phone rule above
   keeps its 44px targets. Smaller tiles, tighter card padding, one size step down on headings: more of the
   work fits on screen without losing the hierarchy. ═══ */
@media (min-width: 768px) {
    .tly-page { padding: .75rem clamp(1rem, 2vw, 2rem) 2rem; --tly-radius: 14px; }

    /* App bar + module menu */
    .tly-app { padding: .1rem 0 .65rem; gap: .5rem .85rem; }
    .tly-brand { gap: .6rem; }
    .tly-brand-mark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 11px; font-size: 1rem; box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--tly-accent) 70%, transparent); }
    .tly-brand-name { font-size: 1.1rem; }
    .tly-brand-tag { font-size: .78rem; }
    .tly-select, .tly-iconbtn, .tly-page .tly-conn, .tly-btn-md { height: 36px; border-radius: 10px; }
    .tly-iconbtn { width: 36px; }
    .tly-select select { font-size: .84rem; }
    .tly-nav { padding: .3rem .45rem; margin-bottom: .9rem; border-radius: 12px; }
    .tly-nav-btn { height: 38px; padding: 0 .7rem; font-size: .86rem; gap: .4rem; }
    .tly-nav-btn.is-active::after { bottom: -.3rem; height: 2px; }
    .tly-nav-search input { height: 34px; font-size: .84rem; }

    /* Page heading */
    .tly-pagehead { margin-bottom: .85rem; gap: .5rem .85rem; }
    .tly-pagehead-title { font-size: 1.3rem; margin-top: .1rem; }
    .tly-pagehead-sub { font-size: .85rem; margin-top: .2rem; }
    .tly-trail { font-size: .7rem; }
    .tly-back { width: 34px; height: 34px; border-radius: 9px; }

    /* Cards and sections */
    .tly-card { padding: .85rem 1rem; }
    .tly-card + .tly-card, .tly-card + .tly-stats, .tly-stats + .tly-card, .tly-two + .tly-card { margin-top: .75rem; }
    .tly-card-head { margin-bottom: .6rem; padding-bottom: .5rem; gap: .6rem; }
    .tly-card-title { font-size: .95rem; }
    .tly-card-sub { font-size: .8rem; margin-top: .1rem; }
    .tly-section-title { margin: .9rem 0 .5rem; font-size: .7rem; }
    .tly-section-row { margin: .1rem 0 .5rem; }
    .tly-two, .tly-grid { gap: .75rem; }
    .tly-empty { padding: 1.6rem 1rem; }
    .tly-empty-icon { width: 44px; height: 44px; flex-basis: 44px; border-radius: 12px; font-size: 1.1rem; }
    .tly-empty h3 { font-size: .95rem; margin-top: .55rem; }
    .tly-btn-lg { min-height: 40px; border-radius: 9px; }
    .tly-hint { font-size: .76rem; }
    .tly-alert { border-radius: 10px; }

    /* Connection strip */
    .tly-connstrip { padding: .65rem .9rem; margin-bottom: .85rem; gap: .75rem; }
    .tly-connstrip-ic { width: 38px; height: 38px; flex-basis: 38px; border-radius: 10px; font-size: .95rem; }
    .tly-connstrip-text strong { font-size: .92rem; }
    .tly-connstrip-text span { font-size: .8rem; }
    .tly-pill { height: 28px; font-size: .76rem; }

    /* Figures (home) and KPI tiles (reports) */
    .tly-kpis { gap: .75rem; margin-bottom: 1rem; }
    .tly-kpi { min-height: 0; padding: .8rem .95rem; gap: .1rem; }
    .tly-kpi-label { font-size: .76rem; padding-right: 2.6rem; }
    .tly-kpi-ic { top: .75rem; right: .75rem; width: 34px; height: 34px; border-radius: 10px; font-size: .9rem; }
    .tly-kpi-value { font-size: 1.45rem; margin-top: .2rem; }
    .tly-kpi-sub { font-size: .76rem; }
    .tly-stats { gap: .55rem; }
    .tly-stat { padding: .6rem .8rem; border-radius: 10px; }
    .tly-stat-label { font-size: .72rem; }
    .tly-stat-value { font-size: 1.15rem; margin-top: .1rem; }
    .tly-stat-foot { font-size: .72rem; margin-top: .15rem; }

    /* Module cards, tool cards, activity rows, steps */
    .tly-modules { gap: .75rem; margin-bottom: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
    .tly-module-main { padding: .85rem .95rem .65rem; gap: .7rem; }
    .tly-module-ic { width: 38px; height: 38px; flex-basis: 38px; border-radius: 10px; font-size: .95rem; }
    .tly-module-title { font-size: .95rem; }
    .tly-module-sub { font-size: .78rem; margin-top: .1rem; }
    .tly-module-foot { padding: .5rem .95rem; font-size: .76rem; }
    .tly-tools { gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
    .tly-tool { min-height: 0; padding: .9rem 1rem .75rem; border-radius: 14px; gap: .25rem; }
    .tly-tool-ic { width: 38px; height: 38px; border-radius: 10px; font-size: .95rem; margin-bottom: .25rem; }
    .tly-tool-title { font-size: .95rem; }
    .tly-tool-sub { font-size: .79rem; line-height: 1.4; }
    .tly-tool-go { margin-top: .45rem; padding-top: .5rem; font-size: .78rem; }
    .tly-tool-step { top: .8rem; right: .8rem; }
    .tly-activity { gap: .4rem; }
    .tly-activity-row { min-height: 50px; padding: .45rem .65rem; gap: .65rem; border-radius: 10px; }
    .tly-menu-ic, .tly-activity-ic { width: 32px; height: 32px; flex-basis: 32px; border-radius: 9px; font-size: .82rem; }
    .tly-activity-title { font-size: .86rem; }
    .tly-activity-sub { font-size: .74rem; }
    .tly-steps { gap: .5rem; }
    .tly-step { padding: .65rem .85rem; border-radius: 12px; grid-template-columns: 32px minmax(0, 1fr) auto; gap: .65rem; }
    .tly-step-dot { width: 32px; height: 32px; flex-basis: 32px; font-size: .88rem; }
    .tly-step-title { font-size: .92rem; }
    .tly-step-sub { font-size: .76rem; }
    .tly-review { min-height: 56px; padding: .6rem .75rem; border-radius: 12px; }
    .tly-review-icon { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; }

    /* Tables */
    .tly-list { font-size: 12.5px; }
    .tly-list th { height: 36px; padding: 5px 10px; font-size: 11px; }
    .tly-list td { padding: 6px 10px; }
    .tly-list-wrap { border-radius: 12px; }
    .tly-cell-sub { font-size: .74rem; }
    .tlg-bar { padding: 8px 10px; }
    .tlg-search input, .tlg-chip, .tlg-btn { height: 32px; }
    .tlg-btn--icon { width: 32px; }
    .tlg-table thead th { height: 36px; }
    .tlg-table thead tr.tlg-filter-row th { top: 36px; height: 34px; }
    .tlg-table tbody td, .tlg-table tfoot td { height: 34px; padding: 5px 10px; }
    .tlg-pager { padding: 6px 10px; }

    /* Chips, forms, Change Period editor */
    .tly-chip { min-height: 34px; padding: .3rem .7rem; font-size: .8rem; }
    .tly-field .form-control, .tly-field .form-select { min-height: 36px; }
    .tly-period-input { min-height: 40px; font-size: 1rem; }
    .tly-period-row { grid-template-columns: 52px 12px 170px minmax(0, 1fr); gap: .45rem; }
    .tly-period-rows { gap: .45rem; }
    .tly-period-help { margin-top: .55rem; font-size: .76rem; line-height: 1.5; }
    .cmn-modal-body .tly-period { gap: .85rem; }
    .tly-period-side { padding-left: 1rem; }
    .tly-wizard-step { padding: .5rem .65rem; min-height: 44px; }
    .tly-wizard-num { width: 30px; height: 30px; font-size: .82rem; }
}

/* Arun (03-Nov-2026) — Tally connection step 2: the helper's "Found on this computer" table
   (PID · Port · User · Company · Action) spans the whole step card, under the buttons. */
.tly-step > .tly-scan { grid-column: 1 / -1; min-width: 0; }
.tly-scan-title {
    display: block; font-size: .8rem; color: var(--tly-muted);
    font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000);
}
.tly-scan .tly-list-wrap { max-height: none; }
.tly-scan .tly-list tr.is-current td { background: var(--tly-accent-soft); }
.tly-scan .tly-list td:empty { color: var(--tly-muted); }
.tly-scan-warn { display: inline-flex; align-items: center; gap: .3rem; color: var(--tly-warn); white-space: nowrap; }
.tly-scan-warn-btn { color: var(--tly-warn); line-height: 1; text-decoration: none; }
.tly-scan-note { display: block; margin-top: .25rem; font-size: .76rem; color: var(--tly-warn); }
@media (max-width: 767.98px) {
    /* The button row is no longer the step's last child here, so it needs its own full-width rule. */
    .tly-step > .tly-row { grid-column: 1 / -1; }
    .tly-scan .btn { min-height: 44px; }
    .tly-scan-warn-btn { min-width: 44px; min-height: 44px; }
    .tly-scan .tly-list td:empty { display: none; }
}

/* Arun (03-Nov-2026): connect anyway / Cancel for another user's Tally row */
.tly-scan-confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
/* ── Audit Workbench v2 (04-Nov-2026): rule library, finding detail drawer, trail, roles, statutory ── */
.tly-chip-count--blocked { background: var(--tly-warn-bg); color: var(--tly-warn); }
.tly-chip--attention { border-color: var(--tly-warn); }
.tly-finding-text { padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.tly-finding-text:hover { text-decoration: underline; }
.tly-link-text { color: var(--theme-text, var(--tly-accent)); text-align: left; font: inherit; }
.tly-findings tr.is-blocked td { color: var(--tly-muted); }
.tly-findings tr.is-expanded td { border-bottom: 0; }
.tly-detail-row td { padding: 0 .75rem .9rem; background: var(--tly-surface-2); }
.tly-detail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: .8rem .9rem; border: 1px solid var(--tly-line); border-radius: 12px; background: var(--tly-surface); }
.tly-detail h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--tly-muted); margin: 0 0 .35rem; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-detail p { margin: 0 0 .4rem; font-size: .88rem; color: var(--tly-text); }
.tly-kv { display: grid; grid-template-columns: auto 1fr; gap: .15rem .8rem; margin: 0; font-size: .84rem; }
.tly-kv dt { color: var(--tly-muted); font-weight: clamp(1, calc(500 + var(--spq-fw-delta, 0)), 1000); }
.tly-kv dd { margin: 0; color: var(--tly-text); font-variant-numeric: tabular-nums; }
.tly-trail { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; font-size: .84rem; }
.tly-trail li { padding-left: .7rem; border-left: 2px solid var(--tly-line); }
.tly-rulelib td, .tly-roles td, .tly-statutory td { vertical-align: top; }
.tly-ok-text { color: var(--tly-ok); }
.tly-actions { white-space: nowrap; }
.tly-actions .btn + .btn { margin-left: .3rem; }

@media (max-width: 991.98px) {
    .tly-detail { grid-template-columns: 1fr; }
}
@media (max-width: 767.98px) {
    .tly-detail-row td { padding: 0 0 .9rem; }
    .tly-detail { padding: .7rem; border-radius: 10px; }
    .tly-kv { grid-template-columns: 1fr; gap: 0 .5rem; }
    .tly-kv dt { margin-top: .3rem; }
    .tly-actions { white-space: normal; display: flex; flex-wrap: wrap; gap: .35rem; }
    .tly-actions .btn { min-height: 44px; }
    .tly-actions .btn + .btn { margin-left: 0; }
    .tly-roles select, .tly-review-bar select { min-height: 44px; }
}

/* ── Audit Workbench v2: drill-down tables, wide detail column, more-filters row ── */
.tly-detail-col--wide { grid-column: span 2; min-width: 0; }
.tly-mini { font-size: .8rem; }
.tly-mini th, .tly-mini td { padding: .25rem .45rem; }
.tly-more-filters { flex-wrap: wrap; gap: .4rem; }
.tly-more-filters .tly-select-sm { max-width: 13rem; }
@media (max-width: 991.98px) {
    .tly-detail-col--wide { grid-column: auto; }
}
@media (max-width: 767.98px) {
    .tly-more-filters .tly-select-sm { max-width: none; width: 100%; }
    .tly-mini { font-size: .84rem; }
}

/* ── v3: drill-down tables and aggregated finding cells on phones ── */
.tly-findings td[data-label="Voucher"], .tly-findings td[data-label="Ledger"] { overflow-wrap: anywhere; }
@media (max-width: 767.98px) {
    .tly-detail .tly-mini { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tly-detail .tly-mini thead { display: table-header-group; }
    .tly-detail .tly-mini tr { display: table-row; }
    .tly-detail .tly-mini td, .tly-detail .tly-mini th { display: table-cell; white-space: nowrap; }
}

/* ── Ledger Suggest Engine (Himanshu, 05-Nov-2026) ─────────────────────────── */
.tly-sug-list .tly-sug-row { align-items: flex-start; }
.tly-sug-pick { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.tly-sug-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .78rem; color: var(--tc-muted, #6c757d); }
.tly-sug-chip { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); background: var(--sf-subtle, #eef1f5); color: var(--tc-text, #343a40); border: 1px solid var(--bd, #dde2e8); }
.tly-sug-band-4 .tly-sug-chip { background: var(--sf-raised, #e6f4ea); color: color-mix(in srgb, #1e7b34 var(--ink-keep, 100%), var(--ink-flip, #1e7b34)); border-color: #bfe3c8; }
.tly-sug-band-3 .tly-sug-chip { background: var(--sf-raised, #e8f1fb); color: color-mix(in srgb, #1d5fa3 var(--ink-keep, 100%), var(--ink-flip, #1d5fa3)); border-color: #c3d9f3; }
.tly-sug-band-2 .tly-sug-chip { background: color-mix(in srgb, #fff4d6 var(--pastel-keep, 100%), var(--sf-card, #fff4d6)); color: color-mix(in srgb, #8a6100 var(--ink-keep, 100%), var(--ink-flip, #8a6100)); border-color: #f2dc9a; }
.tly-sug-band-1 .tly-sug-chip, .tly-sug-band-0 .tly-sug-chip { background: var(--sf-raised, #fde8e8); color: color-mix(in srgb, #a61b1b var(--ink-keep, 100%), var(--ink-flip, #a61b1b)); border-color: #f3c0c0; }
.tly-sug-row.tly-sug-band-1, .tly-sug-row.tly-sug-band-0 { background: color-mix(in srgb, #fde8e8 45%, transparent); }
.tly-sug-reason { white-space: normal; }
.tly-sug-alts .btn-link { font-size: .78rem; margin-left: .25rem; }
/* Himanshu (12-Nov-2026): nature of account, evidence notes and the conflict chip on the create-ledgers rows. */
.tly-sug-nature { display: inline-block; margin-left: .35rem; font-size: .72rem; color: var(--tc-muted, #6c757d); }
.tly-sug-note { display: block; margin-top: .15rem; font-size: .76rem; color: var(--tc-muted, #6c757d); white-space: normal; }
.tly-sug-row .tly-sug-chip.tly-sug-chip--conflict { background: color-mix(in srgb, #fff4d6 var(--pastel-keep, 100%), var(--sf-card, #fff4d6)); color: color-mix(in srgb, #8a6100 var(--ink-keep, 100%), var(--ink-flip, #8a6100)); border-color: #e0a800; }
body.dark-only .tly-sug-row .tly-sug-chip.tly-sug-chip--conflict { background: #4a3a0c; color: #f3d98a; border-color: #b08a1c; }
.tly-sug-result { margin-top: .75rem; padding: .75rem .9rem; border: 1px solid var(--bd, #dde2e8); border-radius: .5rem; background: var(--sf-card, #fff); }
.tly-sug-result-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.tly-sug-add { padding: .75rem .9rem; border: 1px dashed var(--bd, #dde2e8); border-radius: .5rem; background: var(--sf-subtle, #f8f9fb); }
.tly-tag { display: inline-block; padding: .02rem .4rem; margin: 0 .2rem .2rem 0; border-radius: .3rem; font-size: .72rem; background: var(--sf-subtle, #eef1f5); border: 1px solid var(--bd, #dde2e8); color: var(--tc-text, #343a40); }
.tly-grow { flex: 1 1 18rem; }
.tly-field--btn { align-self: flex-end; }
body.dark-only .tly-sug-band-4 .tly-sug-chip { background: #163d22; color: #9fe0b1; border-color: #245c35; }
body.dark-only .tly-sug-band-3 .tly-sug-chip { background: var(--sf-raised, #15304d); color: #9cc7f4; border-color: var(--bd, #23507f); }
body.dark-only .tly-sug-band-2 .tly-sug-chip { background: #4a3a0c; color: #f3d98a; border-color: #7a6118; }
body.dark-only .tly-sug-band-1 .tly-sug-chip, body.dark-only .tly-sug-band-0 .tly-sug-chip { background: #4d1a1a; color: #f3a6a6; border-color: #7a2a2a; }
body.dark-only .tly-sug-row.tly-sug-band-1, body.dark-only .tly-sug-row.tly-sug-band-0 { background: color-mix(in srgb, #4d1a1a 35%, transparent); }
@media (max-width: 767.98px) {
    .tly-sug-list .tly-sug-row { grid-template-columns: 1fr; }
    .tly-sug-pick .form-select { min-height: 44px; }
    .tly-sug-alts .btn-link { min-height: 32px; }
    .tly-field--btn .btn { width: 100%; min-height: 44px; }
}

/* ── Create-ledgers keyboard group picker (Himanshu, 05-Nov-2026) ───────────── */
.tly-gp { position: relative; min-width: 0; }
.tly-gp-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); margin: 0; padding: .2rem 0; list-style: none; background: var(--sf-card, #fff); border: 1px solid var(--bd, #dde2e8); border-radius: .4rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.tly-gp-opt { padding: .3rem .65rem; cursor: pointer; font-size: .85rem; color: var(--tc-text, #343a40); }
.tly-gp-opt:hover { background: var(--sf-subtle, #eef1f5); }
.tly-gp-opt--hi, .tly-gp-opt--hi:hover { background: var(--theme-default, #0d6efd); color: #fff; }
.tly-gp-more { padding: .1rem .65rem; font-size: .72rem; color: var(--tc-muted, #6c757d); }
/* Himanshu (11-Nov-2026): "To be created in Tally" option, Split link and row delete on the bank statement review */
.tly-gp-new { border-top: 1px dashed var(--bd, #dde2e8); font-style: italic; }
.tly-split-link, .tly-split-sum { font-size: .78rem; margin-top: .15rem; }
.tly-row-del { margin-top: .35rem; font-size: .85rem; opacity: .7; }
.tly-row-del:hover, .tly-row-del:focus { opacity: 1; }
@media (max-width: 767.98px) { .tly-split-link, .tly-split-sum, .tly-row-del { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; } }
.tly-gp-none { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); padding: .35rem .65rem; font-size: .8rem; color: var(--tc-muted, #6c757d); background: var(--sf-card, #fff); border: 1px solid var(--bd, #dde2e8); border-radius: .4rem; }
.tly-gp-quick { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.tly-gp-quick .tly-gp { flex: 0 1 18rem; }
.tly-gp-stage { display: flex; align-items: center; padding: 1.5rem .5rem; color: var(--tc-text, #343a40); }
@media (max-width: 767.98px) {
    .tly-gp-input { min-height: 44px; font-size: 1rem; }
    .tly-gp-opt { padding: .7rem .75rem; font-size: 1rem; }
    .tly-gp-quick { flex-wrap: wrap; }
    .tly-gp-quick .tly-gp { flex: 1 1 100%; }
    .tly-gp-quick .btn { min-height: 44px; }
}

/* ── Create-ledgers steps, Tally-down bar, known parties (Himanshu, 05-Nov-2026) ── */
.tly-gp-steps { list-style: none; margin: .25rem 0 1rem; padding: 0; display: grid; gap: .45rem; }
.tly-gp-step { display: flex; align-items: center; gap: .55rem; font-size: .9rem; color: var(--tc-text, #343a40); }
.tly-gp-step--done i { color: color-mix(in srgb, #1e7b34 var(--ink-keep, 100%), var(--ink-flip, #1e7b34)); }
.tly-gp-step--warn i { color: color-mix(in srgb, #8a6100 var(--ink-keep, 100%), var(--ink-flip, #8a6100)); }
.tly-gp-step--failed i, .tly-gp-step--failed { color: color-mix(in srgb, #a61b1b var(--ink-keep, 100%), var(--ink-flip, #a61b1b)); }
.tly-gp-down { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.tly-gp-down-actions { display: flex; gap: .4rem; }
.tly-sug-row--known { background: color-mix(in srgb, #e6f4ea 45%, transparent); }
.tly-sug-known { font-size: .9rem; color: var(--tc-text, #343a40); }
@media (max-width: 767.98px) {
    .tly-gp-down-actions { width: 100%; }
    .tly-gp-down-actions .btn { flex: 1 1 0; min-height: 44px; }
}

/* ── Tally top bar (Himanshu, 05-Nov-2026; redesigned 14-Nov-2026) ─────────────────────────────────
   TallyShell's fragment in the header's title area (PageHeader shows it through TopbarSlotService). Since
   14-Nov-2026 it has the GST company bar's layout: the header carries .spq-topbar--ctb (two lines, page offset;
   app-topbar.css) and .spq-topbar--tally on every Tally page; line 2 never hides.
     Line 1 (28 px): crumbs · page name · connection · Connection · Posting.
     Line 2 (28 px): SPEQTA GST Dashboard, the Tally tabs and Help, feature search on the right.
   The company name, GSTIN, type and dates are not here any more: the company footer carries them.
   Sizes and colours mirror Components/Shared/CompanyTopbar.razor.css (scoped there, so not shareable) —
   keep the two in step. Every rule sits under .spq-topbar--tally, which also matches the scoped
   specificity there. The bar lives outside .tly-page, so it carries its own copy of the tokens it needs. */
.spq-topbar--tally {
    --tly-accent: var(--theme-default, #0f766e);
    --tly-accent-soft: color-mix(in srgb, var(--tly-accent) 11%, transparent);
    --tly-surface: var(--sf-card, #ffffff);
    --tly-surface-2: var(--sf-subtle, #f8fafc);
    --tly-line: var(--bd, #e5e7eb);
    --tly-text: var(--tc-strong, #0f172a);
    --tly-text-2: var(--tc-text, #334155);
    --tly-muted: var(--tc-muted, #64748b);
    --tly-faint: var(--tc-faint, #94a3b8);
    --tly-ok: #15803d;
    --tly-ok-bg: color-mix(in srgb, #16a34a 12%, transparent);
    --tly-warn: #b45309;
    --tly-warn-bg: color-mix(in srgb, #f59e0b 15%, transparent);
    --tly-radius: 14px;
    --tly-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 1px rgba(15, 23, 42, .03);
    --tly-shadow-lg: 0 14px 34px -14px rgba(15, 23, 42, .28);
    --tly-bar-crumb: #1e3a8a;          /* breadcrumbs: dark navy, as in the company bar */
}
body.dark-only .spq-topbar--tally {
    --tly-text: var(--tcd-strong, #f8fafc);
    --tly-text-2: var(--tcd-text, #e5e7eb);
    --tly-muted: var(--tcd-muted, #c3cad5);
    --tly-faint: var(--tcd-faint, #9aa4b2);
    --tly-surface: var(--sf-card, #1f2430);
    --tly-surface-2: var(--sf-subtle, #1a1e28);
    --tly-ok: #4ade80;
    --tly-warn: #fbbf24;
    --tly-shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --tly-shadow-lg: 0 14px 34px -14px rgba(0, 0, 0, .6);
    --tly-bar-crumb: #bfdbfe;
}
.spq-topbar__title--slot { flex: 1 1 auto; min-width: 0; }

.spq-topbar--tally .tly-topbar {
    display: flex; align-items: center; gap: .75rem; min-width: 0; height: 28px; white-space: nowrap;
}

/* Line 1 — breadcrumbs back into the GST app */
/* Clipped, never under the page's name: a long trail (… › Push to Tally) gives way first. */
.spq-topbar--tally .tly-topbar__crumbs { display: flex; align-items: center; gap: .15rem; flex: 0 1 auto; min-width: 0; overflow: hidden; color: var(--tly-bar-crumb); }
.spq-topbar--tally .tly-topbar__crumb {
    display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .4rem; border-radius: 999px;
    color: var(--tly-bar-crumb); font-size: .783rem; letter-spacing: normal; line-height: 1.2; text-decoration: none; cursor: pointer;
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
    transition: background-color .15s ease, color .15s ease;
}
.spq-topbar--tally .tly-topbar__crumb i { font-size: .9em; }
.spq-topbar--tally .tly-topbar__crumb:hover,
.spq-topbar--tally .tly-topbar__crumb:focus-visible {
    background: color-mix(in srgb, var(--tly-bar-crumb) 12%, transparent); color: var(--tly-bar-crumb); text-decoration: none; outline: none;
}
.spq-topbar--tally .tly-topbar__sep { font-size: .48rem; color: var(--tly-bar-crumb); opacity: .5; }

/* Line 1 — the page's name */
.spq-topbar--tally .tly-topbar__label {
    flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
    font-size: .8125rem; color: var(--tc-strong, #0b1220); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000);
}
body.dark-only .spq-topbar--tally .tly-topbar__label { color: var(--tcd-strong, #f8fafc); }

/* Line 1 — connection state, Connection and Posting, next to the tray */
.spq-topbar--tally .tly-topbar__end { flex: none; margin-left: auto; display: flex; align-items: center; gap: .4rem; }
.spq-topbar--tally .tly-topbar__conn {
    position: relative; display: inline-flex; align-items: center; gap: .45rem; max-width: 22rem; height: 22px; padding: 0 .6rem;
    border: 1px solid transparent; border-radius: 999px; cursor: pointer; white-space: nowrap; line-height: 1;
    font-size: .7rem; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000);
}
.spq-topbar--tally .tly-topbar__conn.is-ok { color: var(--tly-ok); background: var(--tly-ok-bg); }
.spq-topbar--tally .tly-topbar__conn.is-warn { color: var(--tly-warn); background: var(--tly-warn-bg); }
.spq-topbar--tally .tly-topbar__conn:hover,
.spq-topbar--tally .tly-topbar__conn:focus-visible { border-color: currentColor; outline: none; }
.spq-topbar--tally .tly-topbar__conn-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: currentColor; }
.spq-topbar--tally .tly-topbar__conn.is-ok .tly-topbar__conn-dot { box-shadow: 0 0 0 3px color-mix(in srgb, #16a34a 22%, transparent); }
.spq-topbar--tally .tly-topbar__conn-text { overflow: hidden; text-overflow: ellipsis; }
.spq-topbar--tally .tly-topbar__conn-seg { display: inline-flex; align-items: center; gap: .22rem; }
.spq-topbar--tally .tly-topbar__conn-seg i { font-size: .64rem; }
.spq-topbar--tally .tly-topbar__conn-seg.is-ok { color: var(--tly-ok); }
.spq-topbar--tally .tly-topbar__conn-seg.is-warn { color: var(--tly-warn); }
.spq-topbar--tally .tly-topbar__conn-at { opacity: .75; font-variant-numeric: tabular-nums; font-weight: clamp(1, calc(500 + var(--spq-fw-delta, 0)), 1000); }
.spq-topbar--tally .tly-topbar__conn-edu {
    padding: .1rem .35rem; border-radius: 999px; border: 1px solid currentColor; font-size: .6rem;
    color: var(--tly-warn); background: var(--tly-warn-bg);
}
/* Connection / Posting: the header's "Go to portal" pill (same height, border and type). */
.spq-topbar--tally .tly-topbar__btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 22px; padding: 0 10px;
    border: 1px solid color-mix(in srgb, var(--theme-default, #2563eb) 30%, transparent); border-radius: 8px; background: transparent;
    color: var(--theme-text, var(--theme-default, #1d4ed8)); cursor: pointer; white-space: nowrap;
    font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000);
}
.spq-topbar--tally .tly-topbar__btn i { font-size: .72rem; }
.spq-topbar--tally .tly-topbar__btn-text { font-size: .74rem; }
.spq-topbar--tally .tly-topbar__btn:hover,
.spq-topbar--tally .tly-topbar__btn:focus-visible { background: color-mix(in srgb, var(--theme-default, #2563eb) 10%, transparent); outline: none; }

/* Line 2 — across the whole bar, as the company bar's tab line */
.spq-topbar--tally .tly-topbar__line2 {
    position: absolute; left: 13px; right: 13px; bottom: 4px; height: 28px; padding: 3px 0;
    display: flex; align-items: center; gap: .75rem; border-top: 1px solid var(--bd, #e7ecf3);
}
.spq-topbar--tally .tly-topbar__tabs {
    flex: 1 1 auto; min-width: 0; height: 100%; display: flex; align-items: center; gap: 4px;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.spq-topbar--tally .tly-topbar__tabs::-webkit-scrollbar { display: none; }
.spq-topbar--tally .tly-topbar__tab {
    position: relative; flex: none; display: inline-flex; align-items: center; gap: .3rem; height: 22px; padding: 0 .6rem;
    border: 0; border-radius: 6px; background: transparent; color: var(--tc-text, #111827); cursor: pointer; white-space: nowrap;
    font-size: .644rem; line-height: 1; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000);
    transition: background-color .15s ease, color .15s ease;
}
.spq-topbar--tally .tly-topbar__tab i { font-size: .62rem; opacity: .85; }
.spq-topbar--tally .tly-topbar__tab:hover { background: color-mix(in srgb, var(--theme-default, #2563eb) 12%, transparent); color: var(--theme-text, #1d4ed8); }
.spq-topbar--tally .tly-topbar__tab:focus-visible { outline: 2px solid var(--theme-default, #2563eb); outline-offset: -2px; }
/* Active: filled with the theme colour, like the company bar's active tab. */
.spq-topbar--tally .tly-topbar__tab.is-active {
    background: var(--theme-default, #2563eb); color: #fff;
    box-shadow: 0 1px 3px color-mix(in srgb, var(--theme-default, #2563eb) 35%, transparent);
}
.spq-topbar--tally .tly-topbar__tab.is-active i { opacity: 1; }
/* "SPEQTA GST Dashboard": the way back to the GST app, so it is outlined and set a little apart. */
.spq-topbar--tally .tly-topbar__tab--app {
    margin-right: .5rem; border: 1px solid color-mix(in srgb, var(--theme-default, #2563eb) 30%, transparent);
    color: var(--theme-text, var(--theme-default, #1d4ed8));
}
.spq-topbar--tally .tly-topbar__tab--app i { opacity: 1; }
/* Dark mode: the light text the header gives "Go to portal" there (app-topbar.css, .spq-topbar__icon-btn). */
body.dark-only .spq-topbar--tally :is(.tly-topbar__btn, .tly-topbar__tab--app) { color: var(--tcd-text, #c2cde3); }
/* A tab none of whose tools is open to this user (14-Nov-2026): quieter text and the common lock mark after the name
   (crown = not in the subscription, user-lock = not allowed for the role). It stays pressable: its page explains each tool.
   The mark is kept where the tab icons hide (laptops, phones), so the state never depends on the width. */
.spq-topbar--tally .tly-topbar__tab.is-locked:not(.is-active) { color: var(--tc-muted, #6b7280); }
.spq-topbar--tally .tly-topbar__tab i.tly-topbar__tab-lock { display: inline-block; font-size: .58rem; opacity: 1; color: color-mix(in srgb, #b45309 var(--ink-keep, 100%), var(--ink-flip, #b45309)); }
.spq-topbar--tally .tly-topbar__tab.is-active i.tly-topbar__tab-lock { color: inherit; }
body.dark-only .spq-topbar--tally .tly-topbar__tab.is-locked:not(.is-active) { color: var(--tcd-muted, #94a3b8); }
body.dark-only .spq-topbar--tally .tly-topbar__tab:not(.is-active) i.tly-topbar__tab-lock { color: #fbbf24; }
/* Tally Home: a module card none of whose tools is open. */
.tly-module.is-locked .tly-module-ic { filter: grayscale(1); opacity: .6; }

/* Line 2 — feature search. Its results show only while the box has focus, so a click anywhere else closes them. */
.spq-topbar--tally .tly-topbar__tools { flex: none; display: flex; align-items: center; height: 100%; }
.spq-topbar--tally .tly-topbar__search { position: relative; display: flex; align-items: center; }
.spq-topbar--tally .tly-topbar__search > i { position: absolute; left: .55rem; font-size: .62rem; color: var(--tly-faint); pointer-events: none; }
.spq-topbar--tally .tly-topbar__search input {
    width: clamp(9rem, 14vw, 15rem); height: 22px; padding: 0 .6rem 0 1.6rem; border-radius: 6px; outline: none;
    border: 1px solid var(--tly-line); background: var(--tly-surface-2); color: var(--tly-text); font-size: .7rem;
}
.spq-topbar--tally .tly-topbar__search input:focus {
    border-color: var(--theme-default, #2563eb); background: var(--tly-surface);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-default, #2563eb) 18%, transparent);
}
.spq-topbar--tally .tly-topbar__results { top: calc(100% + 6px); z-index: 1200; width: 20rem; padding: .3rem; border-radius: 10px; white-space: normal; }
.spq-topbar--tally .tly-topbar__search:not(:focus-within) .tly-topbar__results { display: none; }
/* Results at the bar's scale, not the page's tool cards. */
.spq-topbar--tally .tly-topbar__results .tly-menu-item { min-height: 40px; gap: .55rem; padding: .35rem .45rem; border-radius: 8px; }
.spq-topbar--tally .tly-topbar__results .tly-menu-ic { width: 28px; height: 28px; flex-basis: 28px; border-radius: 8px; font-size: .75rem; }
.spq-topbar--tally .tly-topbar__results .tly-menu-item-title { font-size: .78rem; }
.spq-topbar--tally .tly-topbar__results .tly-menu-item-sub { font-size: .68rem; }
.spq-topbar--tally .tly-topbar__results .tly-menu-empty { padding: .6rem; font-size: .76rem; }

/* The same search on a phone, in the page on Tally Home and its module pages (the bar has no room there). */
.tly-phone-search, .tly-phone-search__backdrop { display: none; }

/* Below 1400 px the "Dashboard" crumb steps aside: line 2's "SPEQTA GST Dashboard" goes to the same place. */
@media (max-width: 1399.98px) {
    .spq-topbar--tally .tly-topbar__dash { display: none; }
}
/* Smaller laptops: the tabs still fit on one line — icons go, padding tightens; Connection / Posting keep their
   icons (the tooltip names them) and "Company List" becomes its house icon, as in the company bar. */
@media (max-width: 1199.98px) {
    .spq-topbar--tally .tly-topbar { gap: .5rem; }
    .spq-topbar--tally .tly-topbar__tab { padding: 0 .45rem; }
    .spq-topbar--tally .tly-topbar__tab i { display: none; }
    .spq-topbar--tally .tly-topbar__btn { width: 26px; padding: 0; }
    .spq-topbar--tally .tly-topbar__btn-text,
    .spq-topbar--tally .tly-topbar__crumb--home span { display: none; }
}
/* Touch screens: a 44 px hit area around the 22 px controls, without making the bar taller. */
@media (pointer: coarse) {
    .spq-topbar--tally :is(.tly-topbar__btn, .tly-topbar__conn)::after { content: ""; position: absolute; inset: -11px -4px; }
}

/* Company picker (F3) */
.tly-cpick-backdrop { position: fixed; inset: 0; z-index: 1300; background: rgba(15, 23, 42, .4); }
.tly-cpick {
    position: fixed; z-index: 1301; top: 10vh; left: 50%; transform: translateX(-50%);
    width: 34rem; max-width: calc(100vw - 2rem); max-height: 75vh; display: flex; flex-direction: column; gap: .6rem;
    padding: 1rem; background: var(--tly-surface); border: 1px solid var(--tly-line); border-radius: 16px; box-shadow: var(--tly-shadow-lg);
    animation: tlyMenuIn .14s ease-out;
}
.tly-cpick-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.tly-cpick-head h2 { margin: 0; font-size: 1.05rem; color: var(--tly-text); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.tly-cpick-list { overflow: auto; margin: 0; }
.tly-cpick-list .tly-row-btn.is-current { background: var(--tly-accent-soft); }
.tly-cpick-empty { padding: .8rem; }

/* Phones: line 1 = the page's name + the connection dot and two icon buttons (crumbs drop); line 2 = swipeable
   tab chips, 28 px tall with a 44 px touch area, snapping as they scroll — the company bar's phone layout. */
@media (max-width: 767.98px) {
    .spq-topbar--tally .tly-topbar { gap: .5rem; height: auto; }
    .spq-topbar--tally .tly-topbar__crumbs { display: none; }
    .spq-topbar--tally .tly-topbar__label { font-size: .78rem; }
    .spq-topbar--tally .tly-topbar__end { gap: 2px; }
    .spq-topbar--tally .tly-topbar__conn { height: 34px; padding: 0 .6rem; }
    .spq-topbar--tally .tly-topbar__conn :is(.tly-topbar__conn-text, .tly-topbar__conn-at, .tly-topbar__conn-edu, .tly-topbar__conn-seg--helper) { display: none; }
    .spq-topbar--tally .tly-topbar__btn { width: 34px; height: 34px; border-color: transparent; }
    .spq-topbar--tally :is(.tly-topbar__btn, .tly-topbar__conn)::after { content: ""; position: absolute; inset: -5px -2px; }
    .spq-topbar--tally .tly-topbar__line2 { left: 0; right: 0; height: 34px; padding: 3px 8px; }
    .spq-topbar--tally .tly-topbar__tabs { gap: 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
    .spq-topbar--tally .tly-topbar__tab {
        height: 28px; padding: 0 .75rem; border-radius: 999px; font-size: .7rem; scroll-snap-align: start;
        background: color-mix(in srgb, var(--theme-default, #2563eb) 8%, transparent);
    }
    .spq-topbar--tally .tly-topbar__tab.is-active { background: var(--theme-default, #2563eb); }
    .spq-topbar--tally .tly-topbar__tab::after { content: ""; position: absolute; inset: -8px 0; }
    .spq-topbar--tally .tly-topbar__tools { display: none; }

    .tly-phone-search { display: block; position: relative; z-index: 30; margin: 0 0 .75rem; }
    .tly-phone-search .tly-nav-search { width: 100%; }
    .tly-phone-search .tly-nav-search input { width: 100%; height: 44px; font-size: 16px; }
    .tly-phone-search__backdrop { display: block; }
}
/* Narrow phones: the connection and buttons need the line; the tab line already says where the user is. */
@media (max-width: 575.98px) {
    .spq-topbar--tally .tly-topbar__label { display: none; }
}
@media (max-width: 767.98px) {
    .tly-cpick {
        top: auto; bottom: 0; left: 0; right: 0; transform: none; width: 100%; max-width: none; max-height: 82vh;
        border-radius: 18px 18px 0 0; padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
        animation: tlySheetIn .2s ease-out;
    }
}

/* Compact page context row (05-Nov-2026): Back · one-line purpose · actions. The title lives in the top bar. */
.tly-pagehead--compact { align-items: center; margin-bottom: .9rem; gap: .5rem 1rem; }
.tly-pagehead--compact .tly-pagehead-main { align-items: center; flex: 1 1 360px; gap: .6rem; flex-wrap: wrap; }
.tly-pagehead--compact .tly-pagehead-sub { margin: 0; font-size: .86rem; line-height: 1.4; }
.tly-backlink {
    display: inline-flex; align-items: center; gap: .4rem; height: 30px; padding: 0 .7rem; flex: 0 0 auto;
    border: 1px solid var(--tly-line); border-radius: 999px; background: var(--tly-surface); cursor: pointer;
    color: var(--tly-text-2); font-size: .82rem; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000);
}
.tly-backlink:hover, .tly-backlink:focus-visible { border-color: var(--tly-accent); color: var(--theme-text, var(--tly-accent)); outline: none; }
.tly-backlink i { font-size: .75rem; }
@media (max-width: 767.98px) {
    .tly-backlink { height: 44px; padding: 0 .9rem; }
    .tly-pagehead--compact .tly-pagehead-sub { flex-basis: 100%; }
    .tly-pagehead--compact .tly-head-actions { width: 100%; }
}

/* ── Batch: names-not-in-Tally banner + dialog, create-ledgers progress (05-Nov-2026) ── */
.tly-miss-banner { display: flex; align-items: center; gap: .75rem; margin: 0 0 .75rem; padding: .6rem .85rem; border: 1px solid #f2dc9a; border-left: 4px solid #e0a800; border-radius: .5rem; background: color-mix(in srgb, #fff8e6 var(--pastel-keep, 100%), var(--sf-card, #fff8e6)); }
.tly-miss-icon { color: #b07d00; font-size: 1.1rem; }
.tly-miss-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.tly-miss-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.tly-nm-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.tly-nm-search { flex: 1 1 16rem; margin: 0; }
.tly-nm-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.tly-nm-chip { border: 1px solid var(--bd, #dde2e8); background: var(--sf-card, #fff); color: var(--tc-text, #343a40); border-radius: 999px; padding: .2rem .7rem; font-size: .8rem; }
.tly-nm-chip span { margin-left: .3rem; color: var(--tc-muted, #6c757d); }
.tly-nm-chip.is-on { background: var(--theme-default, #0d6efd); border-color: var(--theme-default, #0d6efd); color: #fff; }
.tly-nm-chip.is-on span { color: #fff; opacity: .85; }
.tly-nm-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--bd, #dde2e8); border-radius: .5rem; overflow: hidden; }
.tly-nm-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .55rem .8rem; border-top: 1px solid var(--bd, #eef1f5); background: var(--sf-card, #fff); }
.tly-nm-row:first-child { border-top: 0; }
.tly-nm-row:hover { background: var(--sf-subtle, #f8f9fb); }
.tly-nm-name { display: flex; flex-direction: column; min-width: 0; }
.tly-nm-name .tly-cell-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tly-nm-kind { display: inline-block; margin-right: .35rem; padding: 0 .4rem; border-radius: .25rem; font-size: .7rem; background: var(--sf-subtle, #eef1f5); color: var(--tc-text, #343a40); }
.tly-nm-act { display: flex; gap: .35rem; }
.tly-cr { margin-bottom: 1rem; padding: .85rem 1rem; border: 1px solid var(--bd, #dde2e8); border-radius: .6rem; background: var(--sf-subtle, #f8f9fb); }
.tly-cr-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.tly-cr-pct { font-variant-numeric: tabular-nums; color: var(--tc-muted, #6c757d); }
.tly-cr-ok { color: color-mix(in srgb, #1e7b34 var(--ink-keep, 100%), var(--ink-flip, #1e7b34)); }
.tly-cr-warn { color: #b07d00; }
.tly-cr-counts { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin-top: .55rem; font-size: .85rem; color: var(--tc-muted, #6c757d); }
.tly-cr-n b { font-variant-numeric: tabular-nums; color: var(--tc-strong, #212529); margin-right: .15rem; }
.tly-cr-n--ok b { color: color-mix(in srgb, #1e7b34 var(--ink-keep, 100%), var(--ink-flip, #1e7b34)); }
.tly-cr-n--err b { color: color-mix(in srgb, #a61b1b var(--ink-keep, 100%), var(--ink-flip, #a61b1b)); }
.tly-cr-cur { margin-top: .35rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tly-cr-errs { margin-top: .5rem; font-size: .8rem; }
.tly-cr-errs summary { cursor: pointer; color: color-mix(in srgb, #a61b1b var(--ink-keep, 100%), var(--ink-flip, #a61b1b)); }
.tly-cr-errs ul { margin: .35rem 0 0; padding-left: 1.1rem; max-height: 9rem; overflow: auto; }
.tly-cr-bar { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; padding-bottom: .4rem; border-bottom: 1px solid var(--bd, #eef1f5); }
body.dark-only .tly-miss-banner { background: #3a2f0f; border-color: #7a6118; }
body.dark-only .tly-miss-icon, body.dark-only .tly-cr-warn { color: #f3d98a; }
body.dark-only .tly-cr-ok, body.dark-only .tly-cr-n--ok b { color: #9fe0b1; }
body.dark-only .tly-cr-n--err b, body.dark-only .tly-cr-errs summary { color: #f3a6a6; }
@media (max-width: 767.98px) {
    .tly-miss-banner { flex-wrap: wrap; }
    .tly-miss-actions { width: 100%; }
    .tly-miss-actions .btn { flex: 1 1 auto; min-height: 44px; }
    .tly-nm-row { grid-template-columns: 1fr; gap: .4rem; }
    .tly-nm-row .form-control { min-height: 44px; font-size: 1rem; }
    .tly-nm-act .btn, .tly-nm-chip { min-height: 44px; }
    .tly-cr-bar .btn { min-height: 44px; }
}

/* ── Batch: steps live on the toolbar buttons (08-Nov-2026); "Post" pressed while not ready ── */
.tly-postcheck { margin-top: .9rem; }
.tly-postcheck-list { margin: .4rem 0 .5rem; padding-left: 1.1rem; }
.tly-postcheck-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .5rem; }
.tly-postcheck-list .btn-link { padding: 0 .25rem; }
/* Posting settings: existing flow or GST Helper (08-Nov-2026) */
.tly-post-method { display: flex; flex-direction: column; gap: .35rem; margin: 0; padding: 0; border: 0; }
.tly-post-method legend { float: none; width: auto; margin: 0 0 .15rem; font-size: inherit; }
@media (max-width: 767.98px) {
    .tly-post-method .tly-check { min-height: 44px; align-items: center; }
}
/* Posting progress, in the blocking dialog and on the page after (08-Nov-2026).
   The dialog sits outside .tly-page, so this block carries its own copy of the tokens it needs. */
.tly-pp {
    --tly-accent: var(--theme-default, #0f766e);
    --tly-accent-soft: color-mix(in srgb, var(--tly-accent) 11%, transparent);
    --tly-surface: var(--sf-card, #ffffff);
    --tly-line: var(--bd, #e5e7eb);
    --tly-text: var(--tc-strong, #0f172a);
    --tly-muted: var(--tc-muted, #64748b);
    --tly-ok: #15803d;
    --tly-ok-bg: color-mix(in srgb, #16a34a 12%, transparent);
    --tly-warn: #b45309;
    --tly-warn-bg: color-mix(in srgb, #f59e0b 15%, transparent);
    --tly-err: #b91c1c;
    --tly-err-bg: color-mix(in srgb, #ef4444 12%, transparent);
    --tly-info: #1d4ed8;
    --tly-info-bg: color-mix(in srgb, #3b82f6 12%, transparent);
    --tly-pp-tone: var(--theme-text, var(--tly-accent));
    --tly-pp-tone-bg: var(--tly-accent-soft);
    display: grid;
    gap: .7rem;
}
body.dark-only .tly-pp {
    --tly-text: var(--tcd-strong, #f8fafc);
    --tly-muted: var(--tcd-muted, #c3cad5);
    --tly-surface: var(--sf-card, #1f2430);
    --tly-ok: #4ade80;
    --tly-warn: #fbbf24;
    --tly-err: #f87171;
    --tly-info: #93c5fd;
}
.tly-pp.is-done { --tly-pp-tone: var(--tly-ok); --tly-pp-tone-bg: var(--tly-ok-bg); }
.tly-pp.is-failed { --tly-pp-tone: var(--tly-err); --tly-pp-tone-bg: var(--tly-err-bg); }
.tly-pp.is-stopping, .tly-pp.is-stopped, .tly-pp.is-attention { --tly-pp-tone: var(--tly-warn); --tly-pp-tone-bg: var(--tly-warn-bg); }

.tly-pp-hero { padding: 1rem 1.1rem 1.1rem; border: 1px solid var(--tly-line); border-radius: 12px; background: var(--tly-surface); }
.tly-pp-head { display: flex; align-items: center; gap: .85rem; margin-bottom: .85rem; }
.tly-pp-ic {
    position: relative; flex: 0 0 46px; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
    font-size: 1.15rem; color: var(--tly-pp-tone); background: var(--tly-pp-tone-bg);
}
.tly-pp.is-running .tly-pp-ic::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--tly-accent);
    animation: tly-pp-pulse 1.6s ease-out infinite;
}
.tly-pp-what { display: flex; flex-direction: column; min-width: 0; }
.tly-pp-title { font-size: 1.02rem; color: var(--tly-text); font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000); }
.tly-pp-sub { font-size: .84rem; color: var(--tly-muted); font-variant-numeric: tabular-nums; }
.tly-pp-pct {
    margin-left: auto; font-size: 2.2rem; line-height: 1; white-space: nowrap; color: var(--tly-pp-tone);
    font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); font-variant-numeric: tabular-nums;
}
.tly-pp-pct small { font-size: 1.1rem; margin-left: .1rem; }
.tly-pp-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--tly-muted) 18%, transparent); }
.tly-pp-seg { flex: 0 0 auto; min-width: 4px; height: 100%; transition: width .45s ease; }
.tly-pp-seg.is-ok { background-color: #16a34a; }
.tly-pp-seg.is-info { background-color: #3b82f6; }
.tly-pp-seg.is-err { background-color: #ef4444; }
.tly-pp.is-running .tly-pp-seg {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, .22) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .22) 50%, rgba(255, 255, 255, .22) 75%, transparent 75%);
    background-size: 28px 28px;
    animation: tly-pp-stripes 1s linear infinite;
}
@keyframes tly-pp-stripes { from { background-position: 28px 0; } to { background-position: 0 0; } }
@keyframes tly-pp-pulse { from { transform: scale(1); opacity: .55; } to { transform: scale(1.45); opacity: 0; } }

.tly-pp-tiles { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
.tly-pp-tile {
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .3rem .55rem; padding: .65rem .75rem;
    border: 1px solid var(--tly-line); border-radius: 10px; background: var(--tly-surface);
}
.tly-pp-tile.is-ok { --tly-pp-tone: var(--tly-ok); --tly-pp-tone-bg: var(--tly-ok-bg); }
.tly-pp-tile.is-accent { --tly-pp-tone: var(--theme-text, var(--tly-accent)); --tly-pp-tone-bg: var(--tly-accent-soft); }
.tly-pp-tile.is-info { --tly-pp-tone: var(--tly-info); --tly-pp-tone-bg: var(--tly-info-bg); }
.tly-pp-tile.is-err { --tly-pp-tone: var(--tly-err); --tly-pp-tone-bg: var(--tly-err-bg); }
.tly-pp-tile.is-warn { --tly-pp-tone: var(--tly-warn); --tly-pp-tone-bg: var(--tly-warn-bg); }
.tly-pp-tile.is-zero { --tly-pp-tone: var(--tly-muted); --tly-pp-tone-bg: color-mix(in srgb, var(--tly-muted) 12%, transparent); }
.tly-pp-tile-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; font-size: .9rem; color: var(--tly-pp-tone); background: var(--tly-pp-tone-bg); }
.tly-pp-tile-n { font-size: 1.3rem; line-height: 1.1; color: var(--tly-pp-tone); font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); font-variant-numeric: tabular-nums; }
.tly-pp-tile-label { grid-column: 1 / -1; font-size: .76rem; color: var(--tly-muted); }

.tly-pp-metrics {
    display: grid; gap: .5rem 1rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0; padding: .7rem .9rem;
    border: 1px solid var(--tly-line); border-radius: 10px; background: var(--tly-surface);
}
.tly-pp-metric { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; column-gap: .5rem; min-width: 0; }
.tly-pp-metric > i { grid-row: 1 / span 2; font-size: 1rem; text-align: center; color: var(--theme-text, var(--tly-accent)); }
.tly-pp-metric dt { font-size: .72rem; color: var(--tly-muted); font-weight: clamp(1, calc(400 + var(--spq-fw-delta, 0)), 1000); }
.tly-pp-metric dd { margin: 0; font-size: .92rem; color: var(--tly-text); font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000); font-variant-numeric: tabular-nums; }
.tly-pp-foot { display: flex; flex-wrap: wrap; gap: .15rem 1.1rem; margin: 0; padding: 0 .15rem; font-size: .76rem; color: var(--tly-muted); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
    .tly-pp.is-running .tly-pp-seg, .tly-pp.is-running .tly-pp-ic::after { animation: none; }
    .tly-pp-seg { transition: none; }
}
@media (max-width: 767.98px) {
    .tly-pp-hero { padding: .85rem .9rem .95rem; }
    .tly-pp-ic { flex-basis: 40px; width: 40px; height: 40px; font-size: 1rem; }
    .tly-pp-pct { font-size: 1.8rem; }
    .tly-pp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
    .tly-pp-tile:first-child { grid-column: 1 / -1; }
    .tly-pp-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .65rem .75rem; }
}

/* ── Step dialogs: smart name matching (TallyNameMatchDialog) and Create stock items (TallyCreateItemsDialog), 08-Nov-2026 ── */
.tly-nm-read { margin-left: auto; }
.tly-mt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; margin-bottom: .4rem; }
.tly-mt-tick { display: flex; align-items: center; justify-content: center; margin: 0; }
.tly-mt-tick input { width: 1.05rem; height: 1.05rem; }
.tly-nm-cols.tly-mt-cols, .tly-nm-row.tly-mt-row { grid-template-columns: 2rem minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr); }
.tly-mt-why { display: flex; flex-direction: column; gap: .15rem; min-width: 0; font-size: .78rem; }
.tly-mt-chip { align-self: flex-start; padding: 0 .45rem; border-radius: 999px; font-size: .7rem; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); border: 1px solid var(--bd, #dde2e8); background: var(--sf-subtle, #eef1f5); color: var(--tc-text, #343a40); }
.tly-mt-chip--c1, .tly-mt-chip--c2, .tly-mt-chip--c3 { color: color-mix(in srgb, #1e7b34 var(--ink-keep, 100%), var(--ink-flip, #1e7b34)); border-color: #bfe3c8; background: var(--sf-raised, #e6f4ea); }
.tly-mt-chip--c4 { color: color-mix(in srgb, #1d5fa3 var(--ink-keep, 100%), var(--ink-flip, #1d5fa3)); border-color: #c3d9f3; background: var(--sf-raised, #e8f1fb); }
.tly-mt-chip--c5, .tly-mt-chip--c7 { color: color-mix(in srgb, #8a6100 var(--ink-keep, 100%), var(--ink-flip, #8a6100)); border-color: #f2dc9a; background: color-mix(in srgb, #fff4d6 var(--pastel-keep, 100%), var(--sf-card, #fff4d6)); }
.tly-mt-chip--c6 { color: color-mix(in srgb, #a61b1b var(--ink-keep, 100%), var(--ink-flip, #a61b1b)); border-color: #f3c0c0; background: var(--sf-raised, #fde8e8); }
.tly-mt-row--c6 { box-shadow: inset 3px 0 0 #d9534f; }
.tly-mt-sum--c1:not(.is-active), .tly-mt-sum--c2:not(.is-active), .tly-mt-sum--c3:not(.is-active) { color: color-mix(in srgb, #1e7b34 var(--ink-keep, 100%), var(--ink-flip, #1e7b34)); border-color: #bfe3c8; background: var(--sf-raised, #e6f4ea); }
.tly-mt-sum--c4:not(.is-active) { color: color-mix(in srgb, #1d5fa3 var(--ink-keep, 100%), var(--ink-flip, #1d5fa3)); border-color: #c3d9f3; background: var(--sf-raised, #e8f1fb); }
.tly-mt-sum--c5:not(.is-active), .tly-mt-sum--c7:not(.is-active) { color: color-mix(in srgb, #8a6100 var(--ink-keep, 100%), var(--ink-flip, #8a6100)); border-color: #f2dc9a; background: color-mix(in srgb, #fff4d6 var(--pastel-keep, 100%), var(--sf-card, #fff4d6)); }
.tly-mt-sum--c6:not(.is-active) { color: color-mix(in srgb, #a61b1b var(--ink-keep, 100%), var(--ink-flip, #a61b1b)); border-color: #f3c0c0; background: var(--sf-raised, #fde8e8); }
body.dark-only .tly-mt-chip--c1, body.dark-only .tly-mt-chip--c2, body.dark-only .tly-mt-chip--c3,
body.dark-only .tly-mt-sum--c1:not(.is-active), body.dark-only .tly-mt-sum--c2:not(.is-active), body.dark-only .tly-mt-sum--c3:not(.is-active) { background: #163d22; color: #9fe0b1; border-color: #245c35; }
body.dark-only .tly-mt-chip--c4, body.dark-only .tly-mt-sum--c4:not(.is-active) { background: var(--sf-raised, #15304d); color: #9cc7f4; border-color: var(--bd, #23507f); }
body.dark-only .tly-mt-chip--c5, body.dark-only .tly-mt-chip--c7,
body.dark-only .tly-mt-sum--c5:not(.is-active), body.dark-only .tly-mt-sum--c7:not(.is-active) { background: #4a3a0c; color: #f3d98a; border-color: #7a6118; }
body.dark-only .tly-mt-chip--c6, body.dark-only .tly-mt-sum--c6:not(.is-active) { background: #4d1a1a; color: #f3a6a6; border-color: #7a2a2a; }

.tly-ci-cols, .tly-ci-row { display: grid; grid-template-columns: 2rem minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .8fr) 6.5rem 5.5rem; align-items: center; gap: .6rem; }
.tly-ci-cols { padding: 0 .8rem .25rem; font-size: .74rem; color: var(--tc-muted, #6c757d); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-ci-list { border: 1px solid var(--bd, #dde2e8); border-radius: .5rem; }
.tly-ci-row { padding: .35rem .8rem; border-top: 1px solid var(--bd, #eef1f5); background: var(--sf-card, #fff); }
.tly-ci-row:first-child { border-top: 0; border-radius: .5rem .5rem 0 0; }
.tly-ci-row.is-bad { box-shadow: inset 3px 0 0 #d9534f; }
.tly-ci-bad { color: color-mix(in srgb, #a61b1b var(--ink-keep, 100%), var(--ink-flip, #a61b1b)); }
body.dark-only .tly-ci-bad { color: #f3a6a6; }

@media (max-width: 767.98px) {
    .tly-postcheck-list { padding-left: .9rem; }
    .tly-postcheck-list .btn-link, .tly-postcheck .btn { min-height: 44px; }
    .tly-nm-read { margin-left: 0; flex: 1 1 100%; }
    .tly-mt-bar .btn { min-height: 44px; }
    .tly-nm-cols.tly-mt-cols, .tly-ci-cols { display: none; }
    .tly-nm-row.tly-mt-row { grid-template-columns: 2.75rem minmax(0, 1fr); gap: .35rem .5rem; padding: .55rem .6rem; }
    .tly-nm-row.tly-mt-row > .tly-nm-pick, .tly-nm-row.tly-mt-row > .tly-mt-why { grid-column: 2; }
    .tly-mt-tick { min-height: 44px; }
    .tly-mt-tick input { width: 1.35rem; height: 1.35rem; }
    .tly-ci-row { grid-template-columns: 2.75rem minmax(0, 1fr) minmax(0, 1fr); gap: .4rem .5rem; padding: .55rem .6rem; }
    .tly-ci-row > .tly-nm-name { grid-column: 2 / span 2; }
    .tly-ci-row > :nth-child(3), .tly-ci-row > :nth-child(5) { grid-column: 2; }
    .tly-ci-row > :nth-child(4), .tly-ci-row > :nth-child(6) { grid-column: 3; }
    .tly-ci-row .form-control, .tly-ci-row .form-select { min-height: 44px; font-size: 1rem; }
}

/* ── Page head: back link and subtitle on one row on desktop (05-Nov-2026) ── */
@media (min-width: 768px) {
    .tly-pagehead--compact .tly-pagehead-main { flex-wrap: nowrap; }
    .tly-pagehead--compact .tly-backlink { flex: 0 0 auto; }
    .tly-pagehead--compact .tly-pagehead-sub { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ── Voucher pager: range · rows per page · numbered pages (05-Nov-2026) ── */
.tly-pg { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.25rem; margin-top: .85rem; padding-top: .75rem; border-top: 1px solid var(--bd, #eef1f5); font-size: .85rem; color: var(--tc-muted, #6c757d); }
.tly-pg-info b { color: var(--tc-strong, #212529); font-variant-numeric: tabular-nums; }
.tly-pg-size { display: inline-flex; align-items: center; gap: .45rem; margin: 0; }
.tly-pg-size .form-select { width: auto; min-width: 5rem; }
.tly-pg-btns { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-left: auto; }
.tly-pg-btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-width: 2.1rem; height: 2.1rem; padding: 0 .6rem; border: 1px solid var(--bd, #dde2e8); border-radius: .4rem; background: var(--sf-card, #fff); color: var(--tc-text, #343a40); font-variant-numeric: tabular-nums; }
.tly-pg-btn:hover:not(:disabled) { border-color: var(--theme-default, #0d6efd); color: var(--theme-text, #0d6efd); }
.tly-pg-btn:disabled { opacity: .45; cursor: not-allowed; }
.tly-pg-num.is-on, .tly-pg-num.is-on:hover { background: var(--theme-default, #0d6efd); border-color: var(--theme-default, #0d6efd); color: #fff; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-pg-gap { padding: 0 .2rem; }
@media (max-width: 767.98px) {
    .tly-pg { flex-direction: column; align-items: stretch; }
    .tly-pg-btns { margin-left: 0; justify-content: center; }
    .tly-pg-btn { min-width: 44px; height: 44px; }
    .tly-pg-word { display: none; }
    .tly-pg-size .form-select { min-height: 44px; }
}

/* Connection and posting-settings popups (06-Nov-2026). */
.tly-cx-dialog .modal-body { overflow-x: hidden; }
.tly-cx-hero {
    display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem; margin-bottom: .8rem;
    border: 1px solid var(--tly-line); border-radius: 12px; background: var(--tly-surface-2);
}
.tly-cx-hero.is-ok { background: var(--tly-ok-bg); }
.tly-cx-hero.is-warn { background: var(--tly-warn-bg); }
.tly-cx-hero.is-err { background: var(--tly-err-bg); }
.tly-cx-hero.is-err .tly-cx-hero-ic { color: var(--tly-err); }
.tly-cx-checked { font-size: .74rem; color: var(--tly-muted); }
.tly-cx-match {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: .6rem;
    border: 1px solid var(--tly-line); border-radius: 12px; background: var(--tly-surface);
}
.tly-cx-match-cell { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; min-width: 0; padding: .7rem .85rem; }
.tly-cx-match-cell + .tly-cx-match-cell { border-left: 1px solid var(--tly-line); }
.tly-cx-confirm { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; margin-top: .5rem; }
.tly-cx-hero-ic { flex: 0 0 auto; font-size: 1.15rem; color: var(--tly-muted); }
.tly-cx-hero.is-ok .tly-cx-hero-ic { color: var(--tly-ok); }
.tly-cx-hero.is-warn .tly-cx-hero-ic { color: var(--tly-warn); }
.tly-cx-hero-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; color: var(--tly-text-2); font-size: .84rem; }
.tly-cx-hero-text strong { color: var(--tly-text); font-size: .98rem; }
.tly-cx-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-bottom: .9rem; }
.tly-cx-tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; min-width: 0; padding: .65rem .75rem;
    border: 1px solid var(--tly-line); border-radius: 12px; background: var(--tly-surface);
}
.tly-cx-label { display: flex; align-items: center; gap: .4rem; font-size: .75rem; color: var(--tly-muted); }
.tly-cx-value { max-width: 100%; color: var(--tly-text); font-size: .94rem; overflow-wrap: anywhere; font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000); }
.tly-cx-sub { font-size: .78rem; color: var(--tly-muted); overflow-wrap: anywhere; }
.tly-cx-action { margin-top: .2rem; }
.tly-cx-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .05rem .6rem; margin: .15rem 0 0; font-size: .78rem; }
.tly-cx-facts dt { color: var(--tly-muted); font-weight: clamp(1, calc(400 + var(--spq-fw-delta, 0)), 1000); }
.tly-cx-facts dd { margin: 0; color: var(--tly-text); font-variant-numeric: tabular-nums; }
.tly-cx-steps .tly-step { grid-template-columns: 36px minmax(0, 1fr); }
.tly-cx-steps .tly-step .tly-scan { grid-column: 1 / -1; }
.tly-cx-step-head {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%;
    padding: 0; border: 0; background: none; color: var(--tly-muted); text-align: left; cursor: pointer;
}
.tly-cx-address { align-items: end; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
.tly-cx-save { height: 38px; }
.tly-cx-group { margin: 1rem 0 .45rem; color: var(--tly-text); font-size: .9rem; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.tly-cx-foot { margin-right: auto; font-size: .82rem; color: var(--tly-muted); }
/* Connect to Tally, 07-Nov-2026: this firm against the companies open in Tally, one row each, GSTIN in its
   own column so a mismatch reads at a glance. Waiting / greyed states for what depends on step 3. */
.tly-cx-cmp {
    display: grid; grid-template-columns: auto minmax(0, 1.4fr) auto auto; max-width: 100%;
    border: 1px solid var(--tly-line); border-radius: 10px; background: var(--tly-surface); overflow: hidden;
}
.tly-cx-cmp-row { display: contents; }
.tly-cx-cmp-row > span { display: flex; align-items: center; min-width: 0; padding: .5rem .7rem; border-top: 1px solid var(--tly-line); }
.tly-cx-cmp-row:first-child > span { border-top: 0; }
.tly-cx-cmp-row.is-firm > span { background: var(--tly-surface-2); }
.tly-cx-cmp-row.is-ok > span { background: var(--tly-ok-bg); }
.tly-cx-cmp-row.is-err > span { background: var(--tly-err-bg); }
.tly-cx-cmp-who { font-size: .75rem; color: var(--tly-muted); white-space: nowrap; }
.tly-cx-cmp-name { color: var(--tly-text); overflow-wrap: anywhere; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-cx-cmp-name.is-none { color: var(--tly-muted); font-weight: clamp(1, calc(400 + var(--spq-fw-delta, 0)), 1000); }
.tly-cx-cmp-gstin { font-size: .82rem; color: var(--tly-text-2); font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap; }
.tly-cx-cmp-act { justify-content: flex-end; }
.tly-cx-waiting { display: flex; align-items: center; gap: .45rem; font-size: .8rem; color: var(--tly-muted); }
.tly-cx-posting { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin-top: .6rem; font-size: .8rem; color: var(--tly-text-2); }
.tly-cx-posting.is-off { opacity: .55; }

@media (max-width: 991.98px) {
    .tly-cx-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .tly-cx-board { grid-template-columns: minmax(0, 1fr); }
    .tly-cx-match { grid-template-columns: minmax(0, 1fr); }
    .tly-cx-match-cell + .tly-cx-match-cell { border-left: 0; border-top: 1px solid var(--tly-line); }
    .tly-cx-confirm .btn { width: 100%; min-height: 44px; }
    .tly-cx-hero { flex-wrap: wrap; }
    .tly-cx-hero .btn { width: 100%; min-height: 44px; }
    .tly-cx-step-head { min-height: 44px; }
    .tly-cx-address { grid-template-columns: minmax(0, 1fr); }
    .tly-cx-save { height: 44px; }
    .tly-cx-dialog .modal-footer .btn { flex: 1 1 100%; min-height: 44px; }
    .tly-cx-foot { flex: 1 1 100%; }
    .tly-cx-cmp { grid-template-columns: minmax(0, 1fr) auto; }
    .tly-cx-cmp-who { grid-column: 1 / -1; padding-bottom: 0 !important; }
    .tly-cx-cmp-who:empty { display: none !important; }
    .tly-cx-cmp-name, .tly-cx-cmp-gstin, .tly-cx-cmp-act { border-top: 0 !important; }
    .tly-cx-cmp-gstin { grid-column: 1; padding-top: 0 !important; }
    .tly-cx-cmp-act { grid-column: 2; grid-row: span 2; }
    .tly-cx-cmp-act .btn { min-height: 44px; }
    .tly-cx-posting .tly-linkbtn { min-height: 44px; }
}

/* Voucher edit, name matching and ledger creation dialogs (06-Nov-2026) */
.tly-ed-issues { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.tly-ed-head { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .3rem .6rem; margin-top: .35rem; }
.tly-ed-head .tly-field { margin-bottom: 0; }
.tly-ed-head .tly-field label { margin-bottom: .05rem; font-size: .72rem; }
.tly-ed-lines { max-height: max(240px, calc(100vh - 430px)); }
.tly-ed-lines th:nth-child(1) { width: 38%; }
.tly-ed-lines th:nth-child(2) { width: 76px; }
.tly-ed-lines th:nth-child(3) { width: 150px; }
.tly-ed-lines th:nth-child(4) { width: 120px; }
.tly-ed-lines th:last-child { width: 40px; }
.tly-ed-lines tfoot th { position: sticky; bottom: 0; background: var(--tly-surface-2); }
.tly-ed-lines td { padding-top: .15rem; padding-bottom: .15rem; }

.tly-nm-cols, .tly-cr-cols { display: grid; gap: .75rem; padding: 0 .8rem .25rem; font-size: .74rem; color: var(--tc-muted, #6c757d); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-nm-cols { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 9rem; }
.tly-nm-list { overflow: visible; }
.tly-nm-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 9rem; padding: .35rem .8rem; }
.tly-nm-pick { position: relative; display: block; }
.tly-nm-pick > i { position: absolute; z-index: 1; left: .6rem; top: .55rem; font-size: .75rem; color: var(--tc-muted, #6c757d); pointer-events: none; }
.tly-nm-pick .tly-gp-input { padding-left: 1.75rem; }

.tly-cr-tools { flex-wrap: wrap; }
.tly-cr-tools .tly-gp-quick .tly-gp { flex: 0 1 15rem; width: 15rem; }
.tly-cr-cols, .tly-cr-grid .tly-sug-row { grid-template-columns: 2.25rem minmax(0, 1fr) minmax(0, .85fr) minmax(0, 1.5fr); }
.tly-cr-grid { gap: .25rem; }
.tly-cr-grid .tly-sug-row { gap: .75rem; padding: .45rem .8rem; border-radius: 8px; border: 1px solid transparent; transition: background-color .12s ease, border-color .12s ease; }
.tly-cr-grid .tly-sug-row:hover { border-color: var(--bd, #e3e7ee); }
.tly-cr-grid .tly-sug-row + .tly-sug-row { box-shadow: 0 -1px 0 var(--bd, #eef1f5); }
.tly-cr-sn { text-align: right; font-variant-numeric: tabular-nums; font-size: .78rem; color: var(--tc-muted, #6c757d); padding-top: .15rem; }
.tly-cr-cols .tly-cr-sn { padding-top: 0; }
/* Toolbar + column header stay visible while the rows scroll (07-Nov-2026). */
.tly-cr-sticky { position: sticky; top: 0; z-index: 3; background: var(--sf-subtle, #f5f6f8); margin: 0 -.8rem .25rem; padding: .25rem .8rem 0; border-bottom: 1px solid var(--bd, #e3e7ee); }
.tly-cr-sticky .tly-cr-cols { padding-top: .35rem; padding-bottom: .4rem; text-transform: uppercase; letter-spacing: .03em; font-size: .7rem; }
/* Footer summary — one clickable chip per bucket present. */
.tly-cr-summary { display: flex; flex-wrap: wrap; gap: .35rem; margin-right: auto; align-items: center; }
.tly-cr-sumchip { display: inline-flex; align-items: center; gap: .35rem; min-height: 2rem; padding: .2rem .7rem; border-radius: 999px; font-size: .78rem; cursor: pointer;
    background: var(--sf-card, #fff); color: var(--tc-text, #343a40); border: 1px solid var(--bd, #dde2e8); }
.tly-cr-sumchip b { font-variant-numeric: tabular-nums; }
.tly-cr-sumchip:hover { border-color: var(--theme-default, #6c757d); }
.tly-cr-sumchip.is-active { background: var(--theme-default, #3949ab); border-color: var(--theme-default, #3949ab); color: #fff; }
.tly-cr-sumchip--b4:not(.is-active) { color: color-mix(in srgb, #1e7b34 var(--ink-keep, 100%), var(--ink-flip, #1e7b34)); border-color: #bfe3c8; background: var(--sf-raised, #e6f4ea); }
.tly-cr-sumchip--b3:not(.is-active) { color: color-mix(in srgb, #1d5fa3 var(--ink-keep, 100%), var(--ink-flip, #1d5fa3)); border-color: #c3d9f3; background: var(--sf-raised, #e8f1fb); }
.tly-cr-sumchip--b2:not(.is-active) { color: color-mix(in srgb, #8a6100 var(--ink-keep, 100%), var(--ink-flip, #8a6100)); border-color: #f2dc9a; background: color-mix(in srgb, #fff4d6 var(--pastel-keep, 100%), var(--sf-card, #fff4d6)); }
.tly-cr-sumchip--b1:not(.is-active), .tly-cr-sumchip--b0:not(.is-active), .tly-cr-sumchip--none:not(.is-active) { color: color-mix(in srgb, #a61b1b var(--ink-keep, 100%), var(--ink-flip, #a61b1b)); border-color: #f3c0c0; background: var(--sf-raised, #fde8e8); }
body.dark-only .tly-cr-sumchip--b4:not(.is-active) { background: #163d22; color: #9fe0b1; border-color: #245c35; }
body.dark-only .tly-cr-sumchip--b3:not(.is-active) { background: var(--sf-raised, #15304d); color: #9cc7f4; border-color: var(--bd, #23507f); }
body.dark-only .tly-cr-sumchip--b2:not(.is-active) { background: #4a3a0c; color: #f3d98a; border-color: #7a6118; }
body.dark-only .tly-cr-sumchip--b1:not(.is-active), body.dark-only .tly-cr-sumchip--b0:not(.is-active), body.dark-only .tly-cr-sumchip--none:not(.is-active) { background: #4d1a1a; color: #f3a6a6; border-color: #7a2a2a; }
.tly-cr-name { display: flex; align-items: flex-start; gap: .5rem; min-width: 0; margin: 0; }
.tly-cr-name .tly-cell-title { display: block; white-space: normal; overflow-wrap: anywhere; }

@media (max-width: 991.98px) {
    .tly-ed-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .tly-ed-head { grid-template-columns: 1fr; }
    .tly-ed-lines { max-height: none; }
    .tly-ed-lines th:nth-child(n) { width: auto; }
    .tly-nm-cols, .tly-cr-cols { display: none; }
    .tly-nm-row { grid-template-columns: 1fr; }
    .tly-cr-grid .tly-sug-row { grid-template-columns: 1.75rem minmax(0, 1fr); row-gap: .4rem; }
    .tly-cr-grid .tly-sug-row > :not(.tly-cr-sn) { grid-column: 2; }
    .tly-cr-sticky { margin: 0 -.6rem .25rem; padding: .25rem .6rem .35rem; }
    .tly-cr-summary { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .25rem; }
    .tly-cr-sumchip { min-height: 2.75rem; flex: 0 0 auto; }
    .tly-nm-pick > i { top: .85rem; }
    .tly-cr-tools .tly-gp-quick, .tly-cr-tools .tly-gp-quick .tly-gp { width: 100%; }
}

/* Books Sync (06-Nov-2026): status strip, month coverage, action row, result, delete */
.tly-bk-status { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .9rem; }
.tly-bk-fy { display: inline-flex; align-items: center; gap: .45rem; }
.tly-bk-fy label { margin: 0; font-size: .78rem; color: var(--tly-muted); white-space: nowrap; }
.tly-bk-fy .form-select { width: auto; min-width: 7.5rem; }
.tly-bk-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .35rem; margin-top: .75rem; }
.tly-bk-month { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .35rem .15rem; border: 1px solid var(--tly-line); border-radius: 8px; font-size: .72rem; color: var(--tly-muted); min-width: 0; }
.tly-bk-month.has-data { background: var(--tly-ok-bg); border-color: transparent; color: var(--tly-text); }
.tly-bk-month.is-future { opacity: .55; border-style: dashed; }
.tly-bk-month-n { font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000); }
.tly-bk-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 0 .75rem; }
.tly-bk-adv { margin-top: .75rem; }
.tly-bk-adv summary { cursor: pointer; font-size: .82rem; color: var(--tly-muted); padding: .25rem 0; }
.tly-bk-adv .tly-choices { margin-top: .5rem; }
.tly-bk-actions { display: flex; justify-content: flex-end; margin-top: .9rem; }
.tly-bk-result { display: flex; align-items: flex-start; gap: .5rem; margin-top: .75rem; padding: .55rem .75rem; border-radius: 10px; font-size: .86rem; color: var(--tly-text); }
.tly-bk-result.is-ok { background: var(--tly-ok-bg); }
.tly-bk-result.is-ok > i { color: var(--tly-ok); }
.tly-bk-result.is-warn { background: var(--tly-warn-bg); }
.tly-bk-result.is-warn > i { color: var(--tly-warn); }
.tly-bk-next { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: .75rem; }
.tly-bk-danger { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
@media (max-width: 767.98px) {
    .tly-bk-months { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .tly-bk-fy, .tly-bk-fy .form-select { flex: 1 1 auto; min-height: 44px; }
    .tly-bk-next .btn { flex: 1 1 100%; min-height: 44px; }
    .tly-bk-adv summary { min-height: 44px; display: flex; align-items: center; }
    .tly-bk-danger > * { width: 100%; }
}

/* 07-Nov-2026: setup-order strip on the audit setup screens (TallySetupSteps). */
.tly-setup-steps { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: 0 0 .25rem; }
.tly-setup-step { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .65rem; border: 1px solid var(--bd, #dde2e8); border-radius: 999px; background: var(--sf-card, #fff); color: var(--tc-text, #343a40); font-size: .82rem; }
.tly-setup-step:hover { border-color: var(--theme-default, #0d6efd); }
.tly-setup-no { width: 1.35rem; height: 1.35rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--sf-subtle, #eef1f5); font-size: .72rem; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.tly-setup-step.is-current { border-color: var(--theme-default, #0d6efd); background: var(--theme-default, #0d6efd); color: #fff; }
.tly-setup-step.is-current .tly-setup-no { background: rgba(255, 255, 255, .25); color: #fff; }
.tly-setup-sep { font-size: .65rem; color: var(--tc-muted, #6c757d); }
@media (max-width: 767.98px) {
    .tly-setup-steps { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: .25rem; }
    .tly-setup-step { flex: 0 0 auto; min-height: 2.75rem; }
}

/* Bank statement review (07-Nov-2026) */
.tly-row-warn > td { background: var(--tly-warn-bg); }
.tly-row-muted > td { opacity: .55; }   /* bank statement: line left out as already in Tally (08-Nov-2026) */
.tly-bulk-ledger { max-width: 260px; }
@media (max-width: 767.98px) {
    .tly-bulk-ledger { max-width: none; flex: 1 1 100%; min-height: 44px; }
}

/* Name-match dialog: one-line intro, filters in the toolbar, outcome per row; floating picker list (08-Nov-2026) */
.tly-nm-intro { margin: 0 0 .6rem; font-size: .82rem; color: var(--tc-text, #343a40); }
.tly-nm-tools { margin-bottom: .5rem; }
.tly-nm-search { min-height: 34px; border: 1px solid var(--bd, #dde2e8); border-radius: .4rem; background: var(--sf-card, #fff); }
.tly-nm-search i { color: var(--tc-muted, #6c757d); }
.tly-nm-search input { color: var(--tc-text, #343a40); }
.tly-nm-filters { margin-right: 0; }
.tly-nm-cols { position: sticky; top: 0; z-index: 2; padding: .3rem .8rem; background: var(--light-background, var(--sf-card, #fff)); }
.tly-nm-row { padding: .5rem .8rem; }
.tly-nm-row:first-child { border-radius: .5rem .5rem 0 0; }
.tly-nm-row:last-child { border-radius: 0 0 .5rem .5rem; }
.tly-nm-row:only-child { border-radius: .5rem; }
.tly-nm-row.is-map { box-shadow: inset 3px 0 0 #2e9e50; }
.tly-nm-row .tly-nm-name .tly-cell-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.tly-nm-outcome { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .5rem; }
.tly-nm-do { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--tc-muted, #6c757d); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-nm-do i { font-size: .72rem; }
.tly-nm-do--map { color: color-mix(in srgb, #1e7b34 var(--ink-keep, 100%), var(--ink-flip, #1e7b34)); }
.tly-nm-do--new { color: var(--theme-text, #0d6efd); }
body.dark-only .tly-nm-do--map { color: #9fe0b1; }
.tly-nm-row .tly-sug-reason { color: var(--tc-muted, #6c757d); }
.tly-gp--float .tly-gp-list, .tly-gp--float .tly-gp-none { position: fixed; top: 0; left: 0; right: auto; z-index: 40; visibility: hidden; }
.tly-gp--float .tly-gp-list { overflow-y: auto; overscroll-behavior: contain; }
.tly-gp--float .is-placed { visibility: visible; }
@media (max-width: 767.98px) {
    .tly-nm-search { min-height: 44px; flex: 1 1 100%; }
    .tly-nm-search input { font-size: 1rem; }
}

/* ── Business Dashboard role views (Himanshu, 08-Nov-2026) ─────────────────────────────────────
   One large figure, a few more, what to act on, one chart. Every number opens a sheet. */
.tly-dash-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .9rem; margin-bottom: .7rem; }
.tly-dash-roles { display: flex; gap: .3rem; min-width: 0; }
.tly-dash-role {
    display: inline-flex; align-items: center; gap: .4rem; height: 36px; padding: 0 .8rem; border: 1px solid var(--tly-line); border-radius: 999px;
    background: var(--tly-surface); color: var(--tly-text-2); font-size: .84rem; white-space: nowrap; cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
.tly-dash-role.is-active { background: var(--tly-accent); border-color: var(--tly-accent); color: #fff; }
.tly-dash-filters { display: flex; align-items: center; gap: .5rem; }
.tly-dash-seg { display: inline-flex; padding: 2px; border-radius: 10px; background: var(--tly-surface-2); border: 1px solid var(--tly-line); }
.tly-dash-seg button { height: 30px; padding: 0 .75rem; border: 0; border-radius: 8px; background: transparent; color: var(--tly-text-2); font-size: .82rem; cursor: pointer; }
.tly-dash-seg button.is-active { background: var(--tly-surface); color: var(--tly-text); box-shadow: var(--tly-shadow); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-dash-fy { width: auto; height: 36px; font-size: .84rem; padding-top: 0; padding-bottom: 0; }
.tly-dash-fresh { display: flex; align-items: center; gap: .4rem; margin: 0 0 .7rem; font-size: .8rem; color: var(--tly-muted); }
.tly-dash-fresh.is-ok i { color: var(--tly-ok); }
.tly-dash-fresh.is-warn i { color: var(--tly-warn); }

.tly-dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .8rem; align-items: start; }
.tly-dash-col { display: grid; gap: .8rem; min-width: 0; }
.tly-dash-col > .tly-card { margin: 0; }
.tly-dash-hero, .tly-dash-kpi { font: inherit; text-align: left; background: var(--tly-surface); border: 1px solid var(--tly-line); box-shadow: var(--tly-shadow); color: var(--tly-text-2); transition: border-color .15s ease, transform .12s ease; }
button.tly-dash-hero, button.tly-dash-kpi, .tly-dash-row { cursor: pointer; }
.tly-dash-hero { position: relative; display: flex; flex-direction: column; width: 100%; padding: 1rem 2.4rem 1rem 1.1rem; border-radius: var(--tly-radius); }
.tly-dash-hero .tly-dash-chev { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); }
.tly-dash-hero-value { font-size: 2.1rem; line-height: 1.15; margin-top: .15rem; color: var(--tly-text); font-variant-numeric: tabular-nums; font-weight: clamp(1, calc(700 + var(--spq-fw-delta, 0)), 1000); }
.tly-dash-kpis { display: grid; gap: .6rem; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tly-dash-kpi { display: flex; flex-direction: column; padding: .65rem .8rem; border-radius: 12px; min-width: 0; grid-column: span 2; }
.tly-dash-kpi:nth-child(3n+1):nth-last-child(2), .tly-dash-kpi:nth-child(3n+2):nth-last-child(1) { grid-column: span 3; }
.tly-dash-kpi:nth-child(3n+1):nth-last-child(1) { grid-column: span 6; }
.tly-dash-fresh .btn-link, .tly-dch-table { color: var(--theme-text, var(--tly-accent)); }
.tly-dash-value { font-size: 1.2rem; margin-top: .1rem; color: var(--tly-text); font-variant-numeric: tabular-nums; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-dash-label { font-size: .76rem; color: var(--tly-muted); }
.tly-dash-label i { margin-right: .3rem; }
.tly-dash-label i.is-ok { color: var(--tly-ok); }
.tly-dash-label i.is-warn { color: var(--tly-warn); }
.tly-dash-label i.is-err { color: var(--tly-err); }
.tly-dash-foot { margin-top: .15rem; font-size: .74rem; color: var(--tly-muted); }
.tly-dash-foot.is-up { color: var(--tly-ok); }
.tly-dash-foot.is-down { color: var(--tly-err); }
.tly-dash-chev { color: var(--tly-faint); font-size: .75rem; flex: 0 0 auto; }

.tly-dash-actions .tly-card-title, .tly-dash-more .tly-card-title { margin-bottom: .3rem; }
.tly-dash-clear { display: flex; align-items: center; gap: .5rem; margin: .3rem 0; color: var(--tly-text-2); font-size: .88rem; }
.tly-dash-clear i { color: var(--tly-ok); }
.tly-dash-list { list-style: none; margin: 0; padding: 0; }
.tly-dash-list > li + li { border-top: 1px solid var(--tly-line); }
.tly-dash-row { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 52px; padding: .45rem .2rem; border: 0; background: transparent; text-align: left; font: inherit; color: var(--tly-text-2); }
.tly-dash-row-ic { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; font-size: .9rem; background: var(--tly-surface-2); color: var(--tly-muted); }
.tly-dash-row-ic.is-err { background: var(--tly-err-bg); color: var(--tly-err); }
.tly-dash-row-ic.is-warn { background: var(--tly-warn-bg); color: var(--tly-warn); }
.tly-dash-row-ic.is-info { background: var(--tly-info-bg); color: var(--tly-info); }
.tly-dash-row-ic.is-ok { background: var(--tly-ok-bg); color: var(--tly-ok); }
.tly-dash-row-main { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.tly-dash-row-title { color: var(--tly-text); font-size: .9rem; overflow-wrap: anywhere; }
.tly-dash-row-sub { color: var(--tly-muted); font-size: .76rem; }
.tly-dash-row-amt { color: var(--tly-text); font-size: .92rem; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-dash-bill { display: flex; align-items: center; gap: .7rem; padding: .55rem .2rem; }
@media (hover: hover) {
    .tly-dash-role:not(.is-active):hover, button.tly-dash-hero:hover, button.tly-dash-kpi:hover { border-color: color-mix(in srgb, var(--tly-accent) 45%, var(--tly-line)); }
    .tly-dash-row:hover .tly-dash-row-title { color: var(--theme-text, var(--tly-accent)); }
}
.tly-dash-role:focus-visible, .tly-dash-seg button:focus-visible, .tly-dash-hero:focus-visible, .tly-dash-kpi:focus-visible, .tly-dash-row:focus-visible, .tly-dch-hit:focus-visible { outline: 2px solid var(--tly-accent); outline-offset: 1px; }

.tly-dash-sheet .tly-card { margin: 0; padding: 0; border: 0; box-shadow: none; background: transparent; }
.tly-dash-sheet .tly-card-head { border: 0; padding-bottom: 0; }
.tly-dash-sheet .tly-card-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tly-dash-sheet .tly-card-sub { margin-bottom: .5rem; }
.tly-dash-sheet-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.tly-dash-preview { margin: 0; padding: .75rem; border-radius: 10px; background: var(--tly-surface-2); color: var(--tly-text-2); font: inherit; font-size: .86rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.tly-view-admin { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .7rem; padding: .6rem .7rem; border: 1px solid var(--bd, #e5e7eb); border-radius: 10px; cursor: pointer; }
.tly-view-admin span { display: flex; flex-direction: column; }
.tly-view-admin small { color: var(--tc-muted, #64748b); }

.tly-dch { margin: 0; }
.tly-dch-table { white-space: nowrap; }
.tly-dch-read { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; min-height: 2rem; margin-bottom: .4rem; font-size: .78rem; color: var(--tly-muted); font-variant-numeric: tabular-nums; }
.tly-dch-read strong { font-size: 1.15rem; color: var(--tly-text); font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-dch-legend { display: flex; gap: .9rem; margin-bottom: .35rem; font-size: .74rem; color: var(--tly-muted); }
.tly-dch-key { display: inline-block; width: 10px; height: 10px; margin-right: .3rem; border-radius: 3px; background: var(--tly-accent); }
.tly-dch-key.is-compare { background: var(--tly-faint); }
.tly-dch-body { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); }
.tly-dch-y, .tly-dch-plot { position: relative; height: 190px; }
.tly-dch-y span { position: absolute; right: .45rem; transform: translateY(-50%); font-size: .68rem; color: var(--tly-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tly-dch-grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--tly-line); }
.tly-dch-grid.is-zero { background: var(--tly-muted); }
.tly-dch-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tly-dch-line { fill: none; stroke: var(--tly-accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tly-dch-area { fill: var(--tly-accent); opacity: .1; }
.tly-dch-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--tly-accent); box-shadow: 0 0 0 2px var(--tly-surface); pointer-events: none; }
.tly-dch-dot.is-neg { background: var(--tly-err); }
.tly-dch-bands, .tly-dch-hits, .tly-dch-x { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.tly-dch-bands, .tly-dch-hits { position: absolute; inset: 0; }
.tly-dch-band { position: relative; }
.tly-dch-bar { position: absolute; left: 50%; width: min(64%, 24px); transform: translateX(-50%); background: var(--tly-accent); border-radius: 4px 4px 0 0; }
.tly-dch-bar.is-neg { background: var(--tly-err); border-radius: 0 0 4px 4px; }
.is-two .tly-dch-bar { width: min(38%, 14px); transform: translateX(1px); }
.is-two .tly-dch-bar.is-compare { background: var(--tly-faint); transform: translateX(calc(-100% - 1px)); }
.tly-dch-hit { padding: 0; border: 0; border-radius: 4px; background: transparent; cursor: pointer; }
.tly-dch-hit.is-active { background: var(--tly-accent-soft); }
@media (hover: hover) { .tly-dch-hit:hover { background: var(--tly-accent-soft); } }
.tly-dch-x { margin: .3rem 0 0 3.6rem; font-size: .66rem; color: var(--tly-muted); text-align: center; }
.tly-dch-x span { white-space: nowrap; min-width: 0; }

@media (max-width: 991.98px) {
    .tly-dash-grid { grid-template-columns: minmax(0, 1fr); }
    .tly-dash-role { height: 44px; padding: 0 .95rem; }
    .tly-dash-seg button { height: 44px; }
    .tly-dash-fy { font-size: 16px; height: 46px; }
}

@media (max-width: 767.98px) {
    .tly-dash-bar {
        position: sticky; top: 0; z-index: 12; flex-flow: column nowrap; align-items: stretch; gap: .4rem; margin: 0 -.75rem .6rem; padding: .4rem .75rem .5rem;
        background: color-mix(in srgb, var(--tly-surface) 94%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--tly-line);
    }
    .tly-dash-roles { margin: 0 -.75rem; padding: 0 .75rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
    .tly-dash-roles::-webkit-scrollbar { display: none; }
    .tly-dash-role { flex: 0 0 auto; font-size: .88rem; scroll-snap-align: start; }
    .tly-dash-seg { flex: 1 1 auto; min-width: 0; }
    .tly-dash-seg button { flex: 1 1 0; min-width: 0; padding: 0 .35rem; font-size: .88rem; }
    .tly-dash-fy { flex: 0 1 auto; max-width: 42%; }
    .tly-dash-hero { padding: 1.05rem 2.4rem 1.05rem 1.05rem; border-radius: 16px; }
    .tly-dash-hero-value { font-size: 2.2rem; }
    .tly-dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
    .tly-dash-kpis .tly-dash-kpi:nth-child(n) { grid-column: auto; min-height: 84px; padding: .7rem .75rem; border-radius: 14px; }
    .tly-dash-kpis .tly-dash-kpi:nth-child(2n+1):last-child { grid-column: 1 / -1; }
    .tly-dash-row { min-height: 60px; }
    .tly-dash-hero:active, button.tly-dash-kpi:active, .tly-dash-row:active, .tly-dash-role:active { transform: scale(.985); }
    .tly-dash-hero:active .tly-dash-chev { transform: translateY(-50%); }
    .tly-dash-sheet-actions { position: sticky; bottom: 0; flex-direction: column; padding: .6rem 0 calc(.3rem + env(safe-area-inset-bottom, 0px)); background: var(--bs-modal-bg, var(--tly-surface)); }
    .tly-dash-sheet-actions .btn { width: 100%; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }
    .tly-dash-page .tly-dash-sheet .tly-an-settings { grid-template-columns: minmax(0, 1fr); }
    .tly-dash-sheet .tly-an-settings input { min-height: 46px; font-size: 16px; }
    .tly-sheet .modal-content::before { content: ""; display: block; flex: 0 0 auto; width: 40px; height: 4px; margin: .5rem auto -.1rem; border-radius: 2px; background: var(--bd, #cbd5e1); }
    .tly-sheet .modal-header { touch-action: none; }
    .tly-sheet .modal-header .btn-close { padding: .9rem; }
    .tly-view-admin { min-height: 48px; }
    .tly-dch-y, .tly-dch-plot { height: 170px; }
    .tly-dch-x span.is-minor { visibility: hidden; }
}

@media (max-width: 575.98px) {
    .tly-dash-hero-value { font-size: 1.95rem; }
    .tly-dash-value { font-size: 1.1rem; }
    .tly-dch-body { grid-template-columns: 3.1rem minmax(0, 1fr); }
    .tly-dch-x { margin-left: 3.1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .tly-dash-role, .tly-dash-hero, .tly-dash-kpi { transition: none; }
    .tly-dash-hero:active, button.tly-dash-kpi:active, .tly-dash-row:active, .tly-dash-role:active { transform: none; }
}

/* Himanshu (08-Nov-2026): Excel or XML to vouchers popup (TallyVoucherUploadDialog) */
.tly-up-dialog .tly-choices { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .55rem; margin-bottom: 1rem; }
.tly-up-dialog .tly-choice { padding: .6rem .7rem; gap: .55rem; cursor: pointer; }
.tly-up-dialog .tly-choice-icon { width: 32px; height: 32px; flex-basis: 32px; }
.tly-up-radio { flex: 0 0 auto; margin: .55rem 0 0; cursor: pointer; }
.tly-up-filehead { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .5rem .75rem; margin-bottom: .55rem; }
.tly-up-templates { display: flex; flex-wrap: wrap; gap: .4rem; }
.tly-up-dialog .tly-drop { min-height: 120px; }
.tly-up-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
.tly-up-dialog .tly-colmap { border: 0; box-shadow: none; background: transparent; padding: 0; margin: 0; }

@media (max-width: 767.98px) {
    .tly-up-dialog .tly-choices { grid-template-columns: minmax(0, 1fr); }
    .tly-up-dialog .tly-choice { min-height: 64px; }
    .tly-up-radio { width: 1.25rem; height: 1.25rem; }
    .tly-up-templates, .tly-up-templates .btn { width: 100%; }
    .tly-up-templates .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .tly-up-actions { position: sticky; bottom: 0; padding: .6rem 0 calc(.3rem + env(safe-area-inset-bottom, 0px)); background: var(--bs-modal-bg, var(--tly-surface)); }
    .tly-up-actions .btn { flex: 1 1 100%; min-height: 48px; }
    .tly-xi-parts .tly-check { min-height: 44px; align-items: center; }
    .tly-xi-help > summary { min-height: 44px; display: flex; align-items: center; }
}

/* Himanshu (08-Nov-2026): tool tags, statement switcher, shortcuts. The named top-bar buttons and the phone
   menu button went with the 14-Nov-2026 top bar (see "Tally top bar"). */
.tly-tool-tag { display: inline-flex; align-items: center; gap: .3rem; align-self: flex-start; margin-top: .35rem; font-size: .72rem; color: var(--tly-muted); }
.tly-tool-tag.is-live { color: var(--theme-text, var(--tly-accent)); }
.tly-books-health { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.tly-st-switch { display: flex; flex-wrap: wrap; gap: .35rem; margin: .1rem 0 .75rem; }
.tly-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .4rem 1rem; margin: .5rem 0 0; }
.tly-keys > div { display: flex; align-items: center; gap: .6rem; }
.tly-keys dt { flex: 0 0 auto; margin: 0; }
.tly-keys dd { margin: 0; font-size: .85rem; color: var(--tly-text); }
.tly-keys kbd { font-size: .74rem; padding: .08rem .4rem; border-radius: 5px; border: 1px solid var(--tly-line); background: var(--tly-surface-2); color: var(--tly-text); }
.tly-dash-seg-label { font-size: .78rem; color: var(--tly-muted); white-space: nowrap; }
.tly-dash-sheet-hint { margin: 0 0 .6rem; font-size: .85rem; color: var(--tly-muted); }
.tly-dash-bar-read { margin: .4rem 0 0; font-size: .85rem; color: var(--tly-text); }
@media (max-width: 767.98px) {
    /* Keys cannot be pressed on a phone. */
    .tly-keys-hint, .tly-period-bar kbd, .tly-st-bar kbd, .tly-confirm-hint, .tly-shortcuts { display: none; }

    .tly-st-switch { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tly-st-switch .tly-chip { min-height: 44px; flex: 0 0 auto; }
    .tly-st-caret-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .tly-st td.num:empty { display: none; }
    .tly-st tfoot tr { display: block; padding: .5rem .7rem; }
    .tly-st tfoot th { display: block; position: static; padding: .18rem 0; border-top: 0; text-align: left; }
    .tly-st tfoot th:empty { display: none; }
    .tly-st tfoot th[data-label]::before { content: attr(data-label); display: block; font-size: .7rem; color: var(--tly-muted); font-weight: clamp(1, calc(400 + var(--spq-fw-delta, 0)), 1000); }

    .tly-dash-filters { flex-wrap: wrap; }
    .tly-dash-seg-label { flex: 1 1 100%; }
    .tly-bar-col { cursor: pointer; }
}

/* Himanshu (09-Nov-2026): Excel to masters. A centred dialog of 70% of the screen; from the review step on it keeps that height, the grid takes the room and the footer stays put. */
@media (min-width: 768px) {
    .modal .modal-dialog.tly-mu-dialog { display: flex; align-items: center; width: 70vw; min-width: min(900px, calc(100vw - 32px)); max-width: none; min-height: calc(100% - 2rem); margin: 1rem auto; }
    .modal .modal-dialog.tly-mu-dialog:has(.tly-mu-page) .modal-content { height: 70vh; min-height: min(480px, calc(100vh - 32px)); max-height: none; }
}
.modal .modal-dialog.tly-mu-dialog:has(.tly-mu-page) .modal-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; max-height: none; overflow: hidden; padding-bottom: 0; }
/* While the common Tally progress window is up it is the only thing on screen; the empty dialog behind it is hidden and the page dims once. */
.modal .modal-dialog.tly-mu-dialog:has(.tly-pd) .modal-content { visibility: hidden; }
.modal .modal-dialog.tly-mu-dialog .tly-confirm-overlay { visibility: visible; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.tly-mu-page { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.tly-mu-page.is-scroll { display: block; overflow-y: auto; padding-bottom: .75rem; }
.tly-mu-page:not(.is-scroll) .tly-mu-review { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.tly-mu-page:not(.is-scroll) .tlg.tly-mu-grid { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.tly-mu-page:not(.is-scroll) .tlg.tly-mu-grid .tlg-wrap { flex: 1 1 auto; min-height: 0; max-height: none; }
.tly-mu-first { flex: 0 0 auto; max-height: 28vh; overflow-y: auto; }
.tly-mu-status { white-space: normal; line-height: 1.35; }
.tly-up-actions.tly-mu-foot {
    flex: 0 0 auto; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 1rem;
    margin: .6rem -.8rem 0; padding: .6rem .8rem calc(.6rem + env(safe-area-inset-bottom, 0px));
    background: var(--sf-card, #fff); border-top: 1px solid var(--bd, #e2e8f0); box-shadow: 0 -4px 12px rgba(15, 23, 42, .06);
}
.tly-mu-foot-text { flex: 1 1 auto; min-width: 0; }
.tly-mu-foot-btns { display: flex; flex: 0 0 auto; gap: .5rem; }

@media (max-width: 767.98px) {
    .modal .modal-dialog.tly-mu-dialog:has(.tly-mu-page) .modal-content { height: 92dvh; }
    .tly-up-actions.tly-mu-foot { position: static; flex-direction: column; align-items: stretch; gap: .5rem; }
    .tly-mu-foot-btns .btn { flex: 1 1 0; min-height: 48px; }
    .tly-mu-page:not(.is-scroll) .tly-mu-review { overflow-y: auto; }
    .tly-mu-page:not(.is-scroll) .tlg.tly-mu-grid, .tly-mu-page:not(.is-scroll) .tlg.tly-mu-grid .tlg-wrap { flex: 0 0 auto; }
}

/* Himanshu (09-Nov-2026): Delete data imported from Tally popup */
.tly-del-head { margin: 0 0 .4rem; font-size: .86rem; font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000); color: var(--tly-text); }
.tly-del-what { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; border-radius: 10px; }
.tly-del-opt { padding: .55rem .65rem; margin: 0; border: 1px solid var(--tly-line); border-radius: 10px; cursor: pointer; }
.tly-del-opt:has(input:checked) { border-color: var(--theme-default); }
.tly-del-sub { display: block; font-size: .76rem; color: var(--tly-muted); }
.tly-del-period { margin-top: .8rem; }
.tly-del-periodbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.tly-del-periodbar .form-select { width: auto; }
.tly-del-months { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .35rem; border-radius: 10px; }
.tly-del-month { position: relative; display: flex; flex-direction: column; align-items: center; gap: .1rem; margin: 0; padding: .4rem .15rem; border: 1px solid var(--tly-line); border-radius: 8px; font-size: .76rem; color: var(--tly-text); cursor: pointer; }
.tly-del-month input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tly-del-month:focus-within { outline: 2px solid var(--theme-default); outline-offset: 1px; }
.tly-del-month.is-on { border-color: #dc3545; background: rgba(220, 53, 69, .1); }
.tly-del-n { font-size: .72rem; color: var(--tly-muted); }
.tly-del-impact { margin: 0; padding-left: 1.1rem; font-size: .85rem; color: var(--tly-text); }

@media (max-width: 767.98px) {
    .tly-del-what { grid-template-columns: 1fr; }
    .tly-del-opt { min-height: 48px; }
    .tly-del-months { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .tly-del-month { min-height: 48px; justify-content: center; }
    .tly-del-periodbar .form-select { min-height: 44px; }
    .tly-del-dialog .modal-footer .btn { min-height: 48px; }
}

/* Voucher Type step: check Tally's list, Manual or Automatic numbering, stop on typed numbers (Himanshu, 09-Nov-2026).
   The dialog sits outside .tly-page, so these rules use the app tokens directly. */
.tly-vt-intro { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .6rem; }
.tly-vt-intro .btn { flex: 0 0 auto; }
.tly-vt-browse { border: 1px solid var(--bd, #e5e7eb); border-radius: 12px; background: var(--sf-card, #ffffff); padding: .6rem .75rem; margin-bottom: .75rem; }
.tly-vt-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.tly-vt-search { flex: 1 1 180px; width: auto; }
.tly-vt-for { flex: 0 1 200px; width: auto; }
.tly-vt-seg { display: inline-flex; border: 1px solid var(--bd, #e5e7eb); border-radius: 8px; overflow: hidden; }
.tly-vt-seg button { border: 0; background: transparent; color: inherit; font-size: .8rem; padding: .25rem .65rem; }
.tly-vt-seg button.active { background: var(--theme-default, #0f766e); color: #ffffff; }
.tly-vt-list { max-height: 260px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tly-vt-item { display: grid; grid-template-columns: minmax(0, 1fr) auto 56px; gap: .6rem; align-items: center; padding: .35rem 0; border-top: 1px solid var(--bd, #e5e7eb); }
.tly-vt-item:first-child { border-top: 0; }
.tly-vt-name { min-width: 0; overflow-wrap: anywhere; font-size: .86rem; }
.tly-vt-name .tly-cell-sub { display: block; }
.tly-vt-num { font-size: .74rem; padding: .1rem .5rem; border-radius: 999px; white-space: nowrap; }
.tly-vt-num.auto { color: color-mix(in srgb, #b45309 var(--ink-keep, 100%), var(--ink-flip, #b45309)); background: color-mix(in srgb, #f59e0b 15%, transparent); }
.tly-vt-num.manual { color: color-mix(in srgb, #15803d var(--ink-keep, 100%), var(--ink-flip, #15803d)); background: color-mix(in srgb, #16a34a 12%, transparent); }
body.dark-only .tly-vt-num.auto { color: #fbbf24; }
body.dark-only .tly-vt-num.manual { color: #4ade80; }
.tly-vt-note { grid-column: 1 / -1; }
.tly-vt-warn { grid-column: 1 / -1; font-size: .84rem; border: 1px solid color-mix(in srgb, #f59e0b 55%, transparent); border-radius: 10px; padding: .55rem .7rem; background: color-mix(in srgb, #f59e0b 12%, transparent); }

@media (max-width: 767.98px) {
    .tly-vt-intro { flex-direction: column; align-items: stretch; }
    .tly-vt-intro .btn, .tly-vt-item .btn { min-height: 44px; }
    .tly-vt-search, .tly-vt-for { flex: 1 1 100%; min-height: 44px; }
    .tly-vt-seg { flex: 1 1 100%; }
    .tly-vt-seg button { flex: 1 1 0; min-height: 44px; }
    .tly-vt-list { max-height: 45vh; }
    .tly-vt-warn .tly-check { min-height: 44px; align-items: center; }
}

/* Himanshu — upload popup: option required, file must fit it (10-Nov-2026) */
.tly-up-dialog .tly-choices.tly-up-need { border-radius: 12px; padding: .35rem; animation: tly-up-shake .35s ease-in-out 1; }
@keyframes tly-up-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .tly-up-dialog .tly-choices.tly-up-need { animation: none; } }
button.tly-drop.tly-drop--blocked { width: 100%; font: inherit; color: inherit; cursor: pointer; }
.tly-up-mismatch { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.1rem; border: 1px solid #f0b429; border-left-width: 4px; border-radius: 12px; background: var(--sf-subtle, #fffaf0); }
.tly-up-mismatch-icon { flex: 0 0 auto; width: 2.4rem; height: 2.4rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, #f0b429 22%, transparent); color: color-mix(in srgb, #9a6700 var(--ink-keep, 100%), var(--ink-flip, #9a6700)); font-size: 1.1rem; }
.tly-up-mismatch-body { min-width: 0; flex: 1 1 auto; }
.tly-up-mismatch-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.tly-up-pick { position: relative; overflow: hidden; margin: 0; cursor: pointer; }
.tly-up-pick input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
@media (max-width: 767.98px) {
    .tly-up-mismatch { flex-direction: column; }
    .tly-up-mismatch-actions > * { width: 100%; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
}

/* Himanshu (10-Nov-2026) — bank statement review: wrapped narration, wide ledger, Receipt / Payment / Contra colours. */
.tly-bank-review td.tly-bank-narr { max-width: 340px; white-space: normal; overflow-wrap: anywhere; }
.tly-bank-review th.tly-bank-led, .tly-bank-review td.tly-bank-led { min-width: 320px; width: 30%; }
.tly-bank-review td.tly-bank-led .tly-gp { width: 100%; }
.tly-bank-kind { font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); white-space: nowrap; }
.tly-bank-kind--receipt { color: color-mix(in srgb, #146c2e var(--ink-keep, 100%), var(--ink-flip, #146c2e)); }
.tly-bank-kind--payment { color: color-mix(in srgb, #c62828 var(--ink-keep, 100%), var(--ink-flip, #c62828)); }
.tly-bank-kind--contra { color: color-mix(in srgb, #1f5fbf var(--ink-keep, 100%), var(--ink-flip, #1f5fbf)); }
body.dark-only .tly-bank-kind--receipt { color: #5cc97a; }
body.dark-only .tly-bank-kind--payment { color: #ff7b72; }
body.dark-only .tly-bank-kind--contra { color: #79a8ff; }
@media (max-width: 767.98px) {
    .tly-bank-review td.tly-bank-narr, .tly-bank-review td.tly-bank-led { max-width: none; min-width: 0; width: auto; }
    .tly-bank-review td.tly-bank-led .tly-gp-input { min-height: 44px; }
}

/* Himanshu (10-Nov-2026) — bank ledger rules dialog: list + editor side by side, stacked on phones. */
.tly-rules { display: grid; grid-template-columns: minmax(260px, 2fr) 3fr; gap: 16px; align-items: start; }
.tly-rules-scroll { max-height: 56vh; overflow: auto; border: 1px solid var(--bd, #e3e7ee); border-radius: 8px; outline: none; }
.tly-rules-scroll:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-default, #2f5bd3) 30%, transparent); }
.tly-rule-item { display: flex; gap: 8px; justify-content: space-between; align-items: flex-start; padding: 8px 10px; border-bottom: 1px solid var(--bd, #eef1f5); cursor: pointer; }
.tly-rule-item:last-child { border-bottom: 0; }
.tly-rule-item.is-hi { background: color-mix(in srgb, var(--theme-default, #2f5bd3) 10%, transparent); }
.tly-rule-item.is-edit { box-shadow: inset 3px 0 0 var(--theme-default, #2f5bd3); }
.tly-rule-item.is-off .tly-rule-main { opacity: .6; }
.tly-rule-main { display: flex; flex-direction: column; min-width: 0; }
.tly-rule-tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; flex-shrink: 0; }
.tly-rules-edit { border: 1px solid var(--bd, #e3e7ee); border-radius: 8px; padding: 12px; min-height: 200px; }
.tly-rule-desc { flex-wrap: nowrap; }
.tly-rule-desc .form-select { max-width: 170px; flex-shrink: 0; }
.tly-rule-preview { border-left: 3px solid var(--bd, #dfe4ec); padding-left: 8px; max-height: 140px; overflow: auto; }
@media (max-width: 767.98px) {
    .tly-rules { grid-template-columns: 1fr; }
    .tly-rules-scroll { max-height: 40vh; }
    .tly-rule-item { min-height: 48px; }
    .tly-rule-desc { flex-wrap: wrap; }
    .tly-rule-desc .form-select { max-width: none; }
}

/* Himanshu (10-Nov-2026) — bank review: one page scroll, statement bar with the Create button on top. */
.tly-bank-review-wrap { max-height: none; overflow-y: visible; }
.tly-bank-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
    padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--tly-line); border-radius: 12px; background: var(--tly-surface-2);
}
.tly-bank-bar-file { display: flex; gap: 10px; align-items: center; min-width: 0; flex: 1 1 340px; }
.tly-bank-bar-file > i { font-size: 1.3rem; color: var(--theme-text, #2f5bd3); }
.tly-bank-bar-field { flex: 0 1 260px; min-width: 200px; border-radius: 8px; }
.tly-bank-bar-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.tly-bank-topbar { margin-bottom: 10px; }
.tly-bank-topbar:empty { display: none; }
@media (max-width: 767.98px) {
    .tly-bank-bar-field, .tly-bank-bar-file { flex-basis: 100%; }
    .tly-bank-bar-actions { width: 100%; }
    .tly-bank-bar-actions .btn { flex: 1 1 auto; min-height: 44px; }
    .tly-bank-bar-actions .btn-primary { flex-basis: 100%; order: -1; }
}

/* Himanshu (10-Nov-2026) — bank review: sticky toolbar + column headers (both in the thead), Excel-like column filters. */
.tly-list-wrap.tly-bank-review-wrap { overflow: visible; max-height: none; }
.tly-bank-review thead { position: sticky; top: 0; z-index: 6; }
.tly-bank-review thead th { background: var(--tly-surface-2); }
.tly-bank-review tr.tly-bank-toolrow th {
    height: auto; padding: 10px 12px; background: var(--tly-surface); text-transform: none; letter-spacing: 0;
    font-size: 13px; color: var(--tly-text); border-bottom: 1px solid var(--tly-line);
    font-weight: clamp(1, calc(400 + var(--spq-fw-delta, 0)), 1000);
}
.tly-bank-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tly-bank-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1 1 auto; }
.tly-bank-create { margin-left: auto; white-space: nowrap; }
.tly-bank-search { flex: 0 1 380px; min-width: 220px; }
.tly-bank-tools .tly-bulk-ledger { min-width: 240px; }
.tly-bank-review tr.is-cursor td { box-shadow: inset 0 2px 0 var(--theme-default, #2f5bd3), inset 0 -2px 0 var(--theme-default, #2f5bd3); }
.tly-bank-kind-sel { min-width: 150px; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }

.tly-colhead { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.tly-colfilter-btn { border: 0; background: none; padding: 2px 4px; border-radius: 4px; color: var(--tly-muted); line-height: 1; cursor: pointer; font-size: 11px; }
.tly-colfilter-btn:hover, .tly-colfilter-btn:focus-visible { color: var(--theme-text, #2f5bd3); outline: none; background: color-mix(in srgb, var(--theme-default, #2f5bd3) 12%, transparent); }
.tly-colfilter-btn.is-active { color: #fff; background: var(--theme-default, #2f5bd3); }
.tly-colfilter {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 280px; padding: 10px;
    background: var(--tly-surface); border: 1px solid var(--tly-line); border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18); text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--tly-text);
    font-weight: clamp(1, calc(400 + var(--spq-fw-delta, 0)), 1000);
}
th.num .tly-colfilter, th:last-child .tly-colfilter { left: auto; right: 0; }
.tly-colfilter-list { max-height: 240px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.tly-colfilter-list .tly-check, .tly-colfilter-all { display: flex; align-items: center; gap: 6px; margin: 0; }
.tly-colfilter-all { border-bottom: 1px solid var(--tly-line); padding-bottom: 4px; margin-bottom: 4px; }

@media (max-width: 767.98px) {
    .tly-bank-review thead { display: block; top: 0; }
    .tly-bank-review thead tr.tly-bank-colhead { display: none; }
    .tly-bank-review thead tr.tly-bank-toolrow { display: block; margin: 0 0 .55rem; padding: 0; border: 0; }
    .tly-bank-review thead tr.tly-bank-toolrow th { display: block; width: 100%; border-radius: 12px; }
    .tly-bank-create { width: 100%; min-height: 44px; }
    .tly-bank-search { flex-basis: 100%; }
    .tly-bank-kind-sel { min-height: 44px; }
    .tly-colfilter { width: min(92vw, 320px); }
}

/* Himanshu (10-Nov-2026) — a ledger picked but not applied yet. */
.tly-gp-input.tly-pick-pending { border-color: #b25e00; box-shadow: inset 3px 0 0 #b25e00; }
.tly-bank-create + .tly-bank-create { margin-left: 0; }

/* Himanshu (11-Nov-2026) — Type colours win over the table / select defaults: Receipt dark green, Payment red, Contra blue. */
.tly-bank-review td.tly-bank-kind--receipt, .tly-bank-review .form-select.tly-bank-kind--receipt { color: color-mix(in srgb, #146c2e var(--ink-keep, 100%), var(--ink-flip, #146c2e)); }
.tly-bank-review td.tly-bank-kind--payment, .tly-bank-review .form-select.tly-bank-kind--payment { color: color-mix(in srgb, #c62828 var(--ink-keep, 100%), var(--ink-flip, #c62828)); }
.tly-bank-review td.tly-bank-kind--contra, .tly-bank-review .form-select.tly-bank-kind--contra { color: color-mix(in srgb, #1f5fbf var(--ink-keep, 100%), var(--ink-flip, #1f5fbf)); }
.tly-bank-review td[class*="tly-bank-kind--"] { font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-bank-kind-sel option { color: var(--tly-text); }
body.dark-only .tly-bank-review td.tly-bank-kind--receipt, body.dark-only .tly-bank-review .form-select.tly-bank-kind--receipt { color: #5cc97a; }
body.dark-only .tly-bank-review td.tly-bank-kind--payment, body.dark-only .tly-bank-review .form-select.tly-bank-kind--payment { color: #ff7b72; }
body.dark-only .tly-bank-review td.tly-bank-kind--contra, body.dark-only .tly-bank-review .form-select.tly-bank-kind--contra { color: #79a8ff; }

/* Himanshu (11-Nov-2026): Push to Tally fixes — save-failed note, fixed-width inputs (Depreciation) and 44px touch targets. */
.tly-text-warn { color: var(--bs-warning-text-emphasis, #997404); }
body.dark-only .tly-text-warn { color: #ffda6a; }
.tly-wizard.tly-wizard--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tly-in-xs { width: 4.5rem; }
.tly-in-sm { width: 5rem; }
.tly-in-md { width: 8rem; }
.tly-in-date { width: 10rem; }
@media (max-width: 767.98px) {
    .tly-in-xs, .tly-in-sm, .tly-in-md, .tly-in-date { width: 100%; }
}
@media (pointer: coarse) {
    .tly-iconbtn { min-width: 44px; min-height: 44px; }
}

/* Himanshu (11-Nov-2026): Posting History, Import button beside the search */
.tly-hist-tools { flex-wrap: nowrap; align-items: stretch; }
.tly-hist-import { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 767.98px) {
    .tly-hist-tools { flex-wrap: wrap; }
    .tly-hist-import { flex: 1 1 100%; min-height: 44px; }
}

/* Himanshu (11-Nov-2026): Posting History opened from Push to Tally (?from=push) */
.tly-hist-states { display: flex; flex-wrap: wrap; gap: .35rem; }
.tly-hist-kinds { align-items: center; }
.tly-hist-kinds .tly-hist-import { margin-left: auto; }
.tly-hist-steps { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: 0 0 .65rem; padding: 0 0 .6rem; border-bottom: 1px solid var(--bd, #e5e7eb); font-size: .82rem; color: var(--tc-muted, #6b7280); }
.tly-hist-steps li { display: flex; align-items: center; gap: .4rem; }
.tly-hist-steps li span { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; border: 1px solid var(--bd, #d1d5db); font-size: .72rem; font-weight: clamp(1, calc(600 + var(--spq-fw-delta, 0)), 1000); }
.tly-hist-steps li.is-on { color: var(--tc-strong, #111827); }
.tly-hist-steps li.is-on span { background: var(--theme-default); border-color: var(--theme-default); color: #fff; }
@media (max-width: 767.98px) {
    .tly-hist-steps { flex-direction: column; gap: .3rem; }
    .tly-hist-kinds .tly-hist-import { margin-left: 0; }
    .tly-hist-states .tly-chip { min-height: 44px; }
}

/* ── Himanshu (11-Nov-2026): full-width Tally pages, one scrollbar ─────────────────────────────
   Tally screens filled only the middle of the window: the layout's page-body / root-container
   padding plus the page's own clamp() side padding left grey gutters, and a 2.5rem bottom pad left
   a grey band under the pager. Grids also scrolled inside a capped box (.tlg-wrap 100vh-250px,
   .tly-list-wrap 70vh), so the page had two vertical scrollbars. Scoped with :has(.tly-page) so
   no other screen changes. Dialogs keep their own scroll areas. */
#pageWrapper .page-body:has(.tly-page) { padding-left: 0 !important; padding-right: 0 !important; padding-bottom: 0 !important; }
#pageWrapper .root-container:has(.tly-page) { padding-left: 0; padding-right: 0; }
.root-container > .tly-page, .root-container .tly-page:not(.modal .tly-page) {
    padding: .5rem .75rem .75rem;
}
/* Page-level grids grow with their rows; only the page scrolls. Horizontal overflow stays in the grid. */
.tly-page .tlg-wrap:not(.modal .tlg-wrap),
.tly-page .tly-list-wrap:not(.modal .tly-list-wrap) {
    max-height: none; overflow: clip; min-height: 0;
}
.tly-page .tly-pager:not(.modal .tly-pager) { margin-bottom: 0; }
/* Compact status cell: messages run inline, clamped to two lines (full text on hover). */
.tly-issue-clamp {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-top: .2rem; line-height: 1.35; font-size: .78rem;
}
.tly-issue-clamp .tly-issue { display: inline; margin: 0; }
.tly-issue-clamp .tly-issue + .tly-issue::before { content: " · "; color: var(--tly-faint); }
@media (max-width: 767.98px) {
    .root-container .tly-page:not(.modal .tly-page) { padding: .5rem .5rem calc(.75rem + env(safe-area-inset-bottom)); }
    .tly-issue-clamp { -webkit-line-clamp: 3; }
}

/* ── Himanshu (11-Nov-2026): compact chrome on every Tally page, so the grid gets the screen ──
   Tiles, alerts and card heads were sized like a dashboard; on a working page they pushed the table below the fold. */
.tly-stats { gap: .5rem; }
.tly-stat { padding: .45rem .75rem; }
.tly-stat-value { font-size: 1.15rem; line-height: 1.2; }
.tly-alert { padding: .35rem .75rem !important; margin-top: .5rem !important; margin-bottom: 0; font-size: .85rem; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
.tly-alert .btn-link { padding: 0 .25rem; font-size: inherit; }
.tly-card-head { margin-bottom: .5rem; padding-bottom: .4rem; }
.tly-badge { white-space: nowrap; }
.tly-list .tly-col-status { min-width: 150px; }

/* Status strip as one row of chips (label + count side by side) — the batch page. */
.tly-stats--chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.tly-stats--chips .tly-stat { flex: 1 1 auto; display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; padding: .3rem .7rem; min-height: 0; }
.tly-stats--chips .tly-stat-label { font-size: .78rem; white-space: nowrap; }
.tly-stats--chips .tly-stat-value { font-size: 1rem; }
.tly-card-head--inline { align-items: baseline; flex-wrap: wrap; }
.tly-card-head--inline > div { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.tly-card-head--inline .tly-card-sub { margin: 0; }

@media (max-width: 767.98px) {
    .tly-stats--chips .tly-stat { flex: 1 1 calc(50% - .4rem); min-height: 44px; align-items: center; }
    .tly-list .tly-col-status { min-width: 0; }
}
/* Himanshu (11-Nov-2026): Tally Home + Back sit side by side in the context row. */
.tly-backlinks { display: inline-flex; align-items: center; gap: .4rem; flex: 0 0 auto; flex-wrap: wrap; }
/* Himanshu (11-Nov-2026): a search box inside a card's title row — title + info on the left, search
   on the right, one line. Used by Posting History → batch and the GSTR-1 detail grid. */
.tly-card-head--inline { align-items: center; }
.tly-card-head .tly-head-search { margin: 0 0 0 auto; flex: 0 1 26rem; min-width: 14rem; height: 34px; min-height: 34px; padding-top: 0; padding-bottom: 0; }
@media (max-width: 767.98px) {
    .tly-card-head .tly-head-search { flex: 1 1 100%; margin: .35rem 0 0; height: 44px; min-height: 44px; }
    .tly-card-head .tly-head-search input { font-size: 16px; }
}

/* ── Himanshu (11-Nov-2026): Posting History → batch grid widths ── */
.tly-batch-list .tly-col-check { width: 36px; }
.tly-batch-list .tly-col-seq   { width: 52px; }
.tly-batch-list .tly-col-date  { width: 104px; }
.tly-batch-list .tly-col-vtype { width: 150px; }
.tly-batch-list .tly-col-vno   { width: 170px; }
.tly-batch-list .tly-col-party { width: 280px; }   /* was 250px-wide content; +30 */
.tly-batch-list th.num         { width: 130px; }
.tly-batch-list .tly-col-status { width: auto; }   /* takes the rest */
@media (max-width: 767.98px) {
    .tly-batch-list th, .tly-batch-list td { width: auto !important; }
}

/* ── Himanshu (11-Nov-2026): Tally grids keep their toolbar and column header in view ──────────────
   One page scrollbar: the grid's toolbar (TallyLiteGrid bar / the card's title row) sticks to the top
   of the page scroll and the column header sticks just under it (--tlyf-top, measured by
   tally-grid-filter.js). A grid wider than the page (data-tly-wide) scrolls inside itself instead,
   capped to the window, so its header still stays visible. Dialogs are untouched. */
.tly-page .tlg { overflow: clip; }
.tly-page .tlg:not(.modal .tlg) > .tlg-bar { position: sticky; top: var(--tly-ph-h, 0px); z-index: 9; background: var(--sf-card, #fff); }
.tly-page .tly-list-wrap:not(.modal .tly-list-wrap):not([data-tly-wide]) .tly-list thead th { position: sticky; top: var(--tlyf-top, 0px); z-index: 5; }
.tly-page .tlg-wrap:not(.modal .tlg-wrap):not([data-tly-wide]) .tlg-table thead tr:first-child th { top: var(--tlyf-top, 0px); }
.tly-page .tlg-wrap:not(.modal .tlg-wrap):not([data-tly-wide]) .tlg-table thead tr.tlg-filter-row th { top: calc(var(--tlyf-top, 0px) + 40px); }
.tly-page .tly-list-wrap:not(.modal .tly-list-wrap)[data-tly-wide],
.tly-page .tlg-wrap:not(.modal .tlg-wrap)[data-tly-wide] {
    overflow: auto; max-height: calc(100dvh - 65px - var(--tly-bar-extra, 0px) - var(--spq-cfoot-h, 0px) - var(--tlyf-top, 0px) - 1rem);
}
/* Himanshu (14-Nov-2026): the two-line top bar pushes the page down (app-topbar.css, .spq-topbar--ctb) and the
   company footer docks under it (app.css, --spq-cfoot-h); a capped grid leaves room for both. */
@media (min-width: 768px) {
    body:has(.page-header .spq-topbar--tally.spq-topbar--ctb) { --tly-bar-extra: 10px; }
}
@media (max-width: 767.98px) {
    body:has(.page-header .spq-topbar--tally.spq-topbar--ctb) { --tly-bar-extra: 38px; }
}

/* Excel-style column filter (tally-grid-filter.js) */
tr[data-tlyf-hide] { display: none !important; }
th.tlyf-th { white-space: nowrap; }
.tlyf-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-left: .3rem;
    padding: 0; border: 1px solid transparent; border-radius: 4px; background: transparent; cursor: pointer;
    color: var(--tc-faint, #94a3b8); font-size: .62rem; vertical-align: middle; opacity: .7;
}
th:hover > .tlyf-btn, .tlyf-btn:focus-visible { opacity: 1; border-color: var(--bd, #e2e8f0); background: var(--sf-card, #fff); outline: none; }
.tlyf-btn.is-on { opacity: 1; color: #fff; background: var(--theme-default); border-color: var(--theme-default); }
.tlyf-pop {
    position: fixed; z-index: 2100; width: 17rem; max-width: calc(100vw - 16px); display: flex; flex-direction: column; gap: .4rem;
    padding: .6rem; border: 1px solid var(--bd, #e2e8f0); border-radius: 10px; background: var(--sf-card, #fff);
    box-shadow: 0 14px 34px -14px rgba(15, 23, 42, .35); font-size: .82rem; color: var(--tc-text, #334155);
}
.tlyf-head { display: flex; align-items: center; gap: .4rem; color: var(--tc-strong, #0f172a); font-weight: clamp(1, calc(650 + var(--spq-fw-delta, 0)), 1000); }
.tlyf-head i { color: var(--theme-text, var(--theme-default)); font-size: .72rem; }
.tlyf-search { display: flex; align-items: center; gap: .4rem; height: 32px; padding: 0 .6rem; border: 1px solid var(--bd, #e2e8f0); border-radius: 8px; background: var(--sf-subtle, #f8fafc); }
.tlyf-search i { color: var(--tc-faint, #94a3b8); font-size: .72rem; }
.tlyf-search input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; color: inherit; font-size: .82rem; }
.tlyf-all, .tlyf-item { display: flex; align-items: center; gap: .45rem; margin: 0; padding: .2rem .35rem; border-radius: 5px; cursor: pointer; }
.tlyf-all { border-bottom: 1px solid var(--bd, #eef2f7); border-radius: 0; padding-bottom: .35rem; }
.tlyf-item:hover { background: color-mix(in srgb, var(--theme-default) 7%, transparent); }
.tlyf-list { max-height: 15rem; overflow: auto; overscroll-behavior: contain; }
.tlyf-val { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlyf-cnt { flex: 0 0 auto; color: var(--tc-faint, #94a3b8); font-size: .72rem; font-variant-numeric: tabular-nums; }
.tlyf-more, .tlyf-note { margin: .2rem .35rem; color: var(--tc-muted, #64748b); font-size: .72rem; }
.tlyf-actions { display: flex; align-items: center; gap: .35rem; }
.tlyf-actions > span { flex: 1 1 auto; }
.tlyf-actions button { height: 30px; padding: 0 .7rem; border-radius: 7px; border: 1px solid var(--bd, #e2e8f0); background: var(--sf-card, #fff); color: inherit; font-size: .8rem; cursor: pointer; }
.tlyf-actions .tlyf-clear { border-color: transparent; color: var(--theme-text, var(--theme-default)); padding: 0 .3rem; }
.tlyf-actions .tlyf-ok { background: var(--theme-default); border-color: var(--theme-default); color: #fff; }
.tlyf-actions .tlyf-ok:disabled { opacity: .5; cursor: default; }
@media (max-width: 767.98px) {
    .tlyf-pop { left: 8px !important; right: 8px; width: auto; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom)); }
    .tlyf-list { max-height: 45vh; }
    .tlyf-all, .tlyf-item, .tlyf-actions button { min-height: 44px; }
    .tlyf-btn { width: 32px; height: 32px; }
}

/* Himanshu (11-Nov-2026): the page's action row (Back / Tally Home, the step buttons, More …) stays at the
   top while the page scrolls; the grid's header pins just under it (--tly-ph-h, measured by
   tally-grid-filter.js). Its z-index sits above grid headers so the More menu opens over the grid.
   Desktop and tablet only: on a phone the actions already live in the bottom bar. */
@media (min-width: 768px) {
    .tly-page:has(.tly-list-wrap, .tlg-wrap) > .tly-pagehead {
        position: sticky; top: 0; z-index: 30;
        margin: -.5rem -.75rem .75rem; padding: .5rem .75rem;
        background: var(--app-paper-light, #f7f8f9);
        box-shadow: 0 1px 0 var(--bd, #e2e8f0);
    }
    body.dark-only .tly-page:has(.tly-list-wrap, .tlg-wrap) > .tly-pagehead { background: var(--app-paper, #1d1e26); }
}

/* ── Himanshu (11-Nov-2026): ONE scroll per Tally page — the page's. ──
   Wide grids ([data-tly-wide]) had their own box capped at the screen height, so a long, wide register showed a
   second vertical scrollbar. They now grow with their rows like every other grid and scroll only sideways.
   (Their header no longer pins while the page scrolls — a second scrollbar was the price of that.) Dialogs keep
   their own scroll areas. */
.tly-page .tly-list-wrap:not(.modal .tly-list-wrap)[data-tly-wide],
.tly-page .tlg-wrap:not(.modal .tlg-wrap)[data-tly-wide] {
    overflow-x: auto; overflow-y: hidden; max-height: none;
}
