/* ============================================================
   QBClone — Ledgerline theme
   Colours, radii and shadows come from theme.css (load it first).
   ============================================================ */

/* -- Reset & Base -- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-variant-numeric: tabular-nums;
}

input, select, textarea, button { font-family: inherit; font-variant-numeric: tabular-nums; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; }

::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }

/* Lucide icon from the sprite: <svg class="ll-icon"><use href="…#i-name"/></svg> */
.ll-icon {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================================
   App shell — sidebar + top bar
   ============================================================ */

.ll-app {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

html.ll-collapsed .ll-app { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }

.ll-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--nav-bg);
    border-right: 1px solid var(--nav-border);
    color: var(--nav-ink);
    overflow: hidden;
    z-index: 60;
}

/* Company block */
.ll-company {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 16px 10px;
}

.ll-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; background: #fff; }
.ll-company-logo { display: block; max-height: 60px; max-width: 200px; margin-bottom: 6px; }
.ll-logo {
    width: 32px;
    height: 32px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 15px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}

.ll-company-text { min-width: 0; }

.ll-company-name {
    color: var(--nav-strong);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ll-company-sub {
    color: var(--nav-dim);
    font-size: 11.5px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ll-store-switch { padding: 0 14px 10px; }

.ll-store-switch select {
    width: 100%;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--nav-field-line);
    border-radius: var(--radius-sm);
    background: var(--nav-field);
    color: var(--nav-ink);
    font-size: 12px;
    cursor: pointer;
}

.ll-store-switch select:focus { outline: none; border-color: var(--nav-dot); }
.ll-store-switch option { background: var(--paper); color: var(--ink); }

/* Navigation */
.ll-nav {
    flex: 1;
    overflow-y: auto;
    padding: 6px 10px 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--nav-field-line) transparent;
}

.ll-nav-group { margin-bottom: 2px; }

.ll-nav-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--nav-ink);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    list-style: none;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.ll-nav-row::-webkit-details-marker { display: none; }
.ll-nav-row .ll-icon { color: var(--nav-dim); }
.ll-nav-row:hover { background: var(--nav-hover); color: var(--nav-strong); text-decoration: none; }
.ll-nav-row.is-active { background: var(--nav-active); color: var(--nav-strong); }
.ll-nav-row.is-active .ll-icon { color: var(--nav-strong); }

.ll-label { overflow: hidden; text-overflow: ellipsis; }

.ll-chev {
    width: 14px;
    height: 14px;
    margin-left: auto;
    color: var(--nav-dim);
    transition: transform .15s;
}

.ll-nav-group[open] > .ll-nav-row .ll-chev { transform: rotate(180deg); }

.ll-subnav { padding: 2px 0 6px; }

.ll-sublink {
    position: relative;
    display: flex;
    align-items: center;
    height: 30px;
    padding: 0 10px 0 38px;
    border-radius: var(--radius-sm);
    color: var(--nav-dim);
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ll-sublink:hover { background: var(--nav-hover); color: var(--nav-ink); text-decoration: none; }

.ll-sublink.is-active { background: var(--nav-active); color: var(--nav-strong); font-weight: 500; }

.ll-sublink.is-active::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--nav-dot);
    transform: translateY(-50%);
}

.ll-subnav-divider { height: 1px; margin: 4px 10px 4px 38px; background: var(--nav-line); }

.ll-sidebar-foot { padding: 8px 10px 12px; border-top: 1px solid var(--nav-line); }

/* Collapsed sidebar: icons only */
html.ll-collapsed .ll-company { justify-content: center; padding: 16px 0 10px; }
html.ll-collapsed .ll-company-text,
html.ll-collapsed .ll-store-switch,
html.ll-collapsed .ll-label,
html.ll-collapsed .ll-chev,
html.ll-collapsed .ll-subnav { display: none; }
html.ll-collapsed .ll-nav-row { justify-content: center; padding: 0; }
html.ll-collapsed .ll-collapse-btn .i-collapse,
html:not(.ll-collapsed) .ll-collapse-btn .i-expand { display: none; }

/* Main column + top bar */
.ll-main-col { min-width: 0; display: flex; flex-direction: column; }

.ll-head {
    position: sticky;
    top: 0;
    z-index: 50;
}

.ll-topbar {
    height: var(--topbar-h);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 440px) minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    background: var(--topbar-bg);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--rule);
}

.ll-crumbs {
    font-size: 13px;
    color: var(--ink-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ll-crumbs b { color: var(--ink); font-weight: 600; }
.ll-crumb-sep { margin: 0 6px; color: var(--ink-3); }

.ll-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: var(--paper-2);
    color: var(--ink-3);
    transition: border-color .15s, box-shadow .15s;
}

.ll-search .ll-icon { width: 16px; height: 16px; }

.ll-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
}

.ll-search input::placeholder { color: var(--ink-3); }
.ll-search:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }

.ll-search kbd {
    font: inherit;
    font-size: 11px;
    line-height: 18px;
    padding: 0 5px;
    border: 1px solid var(--rule);
    border-radius: 5px;
    background: var(--paper);
    color: var(--ink-3);
}

.ll-top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }

.ll-icon-btn {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: var(--radius-ctl);
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
    text-decoration: none;
}

.ll-icon-btn:hover { background: var(--paper-3); color: var(--ink); text-decoration: none; }
.ll-icon-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.ll-icon-btn:active { transform: translateY(1px); }

/* Theme toggle shows the icon of the theme it switches to */
:root[data-theme="dark"] .ll-theme-toggle .i-moon,
:root:not([data-theme="dark"]) .ll-theme-toggle .i-sun { display: none; }

.ll-avatar {
    width: 30px;
    height: 30px;
    margin-left: 6px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--nav);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

/* ============================================================
   Page area
   ============================================================ */

.qb-main {
    flex: 1;
    padding: 26px 24px 40px;
    min-height: calc(100vh - var(--head-h));
}

/* ============================================================
   Home Page — workflow launcher
   ============================================================ */

.qb-home {
    max-width: 960px;
    margin: 0 auto;
}

.qb-home-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.qb-home-section {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}

/* Section heading style: 12px uppercase, ink-3 */
.qb-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--rule);
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.qb-section-header i { font-size: 14px; }
.qb-header-vendors i   { color: var(--amber); }
.qb-header-customers i { color: var(--ok); }
.qb-header-company i   { color: var(--blue); }
.qb-header-banking i   { color: var(--accent); }

.qb-section-body { padding: 20px 16px; }

.qb-workflow-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.qb-workflow-arrow { color: var(--ink-3); font-size: 15px; }

.qb-icon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 80px;
    padding: 10px 12px;
    border-radius: var(--radius-ctl);
    color: var(--ink-2);
    text-align: center;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.qb-icon-btn:hover { background: var(--paper-3); color: var(--ink); text-decoration: none; }
.qb-icon-btn:active { transform: translateY(1px); }

.qb-icon-btn span { font-size: 12px; font-weight: 500; line-height: 1.3; }

.qb-icon-circle {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 20px;
}

.qb-icon-circle.vendors   { background: var(--amber-soft); color: var(--amber); }
.qb-icon-circle.customers { background: var(--ok-soft); color: var(--ok); }
.qb-icon-circle.company   { background: var(--blue-soft); color: var(--blue); }
.qb-icon-circle.banking   { background: var(--accent-soft); color: var(--accent); }

/* ============================================================
   Empty states
   ============================================================ */

.ll-empty,
.qb-no-store {
    text-align: center;
    padding: 56px 20px;
    color: var(--ink-3);
}

.ll-empty-title,
.qb-no-store h2 {
    color: var(--ink);
    font-size: 15px;
    font-weight: 650;
    margin-bottom: 4px;
}

.ll-empty p,
.qb-no-store p { color: var(--ink-3); margin-bottom: 16px; }

.qb-no-store i { display: block; margin-bottom: 14px; font-size: 40px; color: var(--ink-3); }

/* ============================================================
   Placeholder Pages
   ============================================================ */

.qb-placeholder { max-width: 800px; margin: 0 auto; }

.qb-placeholder-body {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-1);
    padding: 56px 20px;
    text-align: center;
    color: var(--ink-3);
}

.qb-placeholder-body i { display: block; margin-bottom: 12px; font-size: 40px; color: var(--amber); }

/* ============================================================
   Admin Pages
   ============================================================ */

.qb-admin-page { max-width: 960px; margin: 0 auto; }

/* ============================================================
   Cards
   ============================================================ */

.qb-card {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-1);
    margin-bottom: 16px;
}

.qb-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--rule);
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
}

.qb-card-header > i { color: var(--ink-3); }

.qb-card-header a:not(.qb-btn) {
    margin-left: auto;
    color: var(--accent);
    font-size: 13px;
    font-weight: 550;
}

/* Kept at 16px: several tables sit directly in a card body */
.qb-card-body { padding: 16px; }

/* ============================================================
   Tables
   ============================================================ */

.qb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.qb-table th {
    text-align: left;
    padding: 8px 12px;
    background: var(--qb-gray-100);
    border-bottom: 2px solid var(--qb-border);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--qb-text-light);
}

.qb-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--qb-gray-200);
}

.qb-table tbody tr:hover { background: var(--qb-gray-100); }

/* ============================================================
   Forms — labels above fields
   ============================================================ */

.qb-form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

.qb-form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--ink-2);
    font-size: 12.5px;
    font-weight: 550;
    letter-spacing: 0;
    text-transform: none;
}

/* Fields: 38px, full width of their column */
.qb-form-group input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="file"]),
.qb-form-group select,
.qb-form-group textarea,
.qb-filter-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.qb-filter-form select,
.qb-modal-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.qb-modal-body select,
.qb-modal-body textarea {
    width: 100%;
    height: 38px;
    padding: 0 11px;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-ctl);
    background: var(--paper);
    color: var(--ink);
    font-size: 13.5px;
    transition: border-color .15s, box-shadow .15s;
}

.qb-form-group textarea,
.qb-modal-body textarea {
    height: auto;
    min-height: 84px;
    padding: 9px 11px;
    line-height: 1.5;
    resize: vertical;
}

.qb-form-group input:focus,
.qb-form-group select:focus,
.qb-form-group textarea:focus,
.qb-filter-form input:focus,
.qb-filter-form select:focus,
.qb-modal-body input:focus,
.qb-modal-body select:focus,
.qb-modal-body textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

.qb-form-group :is(input, select, textarea):user-invalid,
.qb-form-group .is-invalid {
    border-color: var(--red);
    box-shadow: var(--invalid-ring);
}

.qb-form-group :is(input, textarea)[readonly],
.qb-form-group :is(input, select, textarea):disabled {
    background: var(--paper-2);
    color: var(--ink-2);
}

.qb-form-group ::placeholder { color: var(--ink-3); }

.ll-hint,
.qb-form-group small {
    display: block;
    margin-top: 5px;
    color: var(--ink-3);
    font-size: 11.5px;
}

/* Form section heading */
.ll-section-title {
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--rule);
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.qb-form-inline {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.qb-form-inline .qb-form-group { margin-bottom: 0; }

.qb-form-row {
    display: flex;
    gap: 22px 28px;
    flex-wrap: wrap;
}

.qb-form-row .qb-form-group { flex: 1; min-width: 180px; }

/* Checkboxes sit left of their label */
.qb-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    color: var(--ink);
    font-size: 13.5px;
    cursor: pointer;
}

.qb-checkbox input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; }

.qb-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Segmented choice: <div class="ll-segmented"><button class="is-active">…</button>…</div> */
.ll-segmented {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border-radius: 10px;
    background: var(--paper-3);
}

.ll-segmented > * {
    height: 28px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 550;
    cursor: pointer;
}

.ll-segmented > .is-active,
.ll-segmented > input:checked + label {
    background: var(--paper);
    color: var(--ink);
    box-shadow: var(--shadow-1);
}

/* ============================================================
   Buttons
   ============================================================ */

.qb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-ctl);
    background: var(--paper);
    color: var(--ink);
    font-size: 13px;
    font-weight: 550;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}

.qb-btn:hover { background: var(--paper-2); color: var(--ink); text-decoration: none; }
.qb-btn:active { transform: translateY(1px); }
.qb-btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.qb-btn:disabled, .qb-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }

.qb-btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), var(--shadow-1);
}

.qb-btn-primary:hover {
    background: var(--accent-2);
    border-color: var(--accent-2);
    color: var(--on-accent);
}

.qb-btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--rule-strong); }
.qb-btn-secondary:hover { background: var(--paper-2); color: var(--ink); }

.qb-btn-quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.qb-btn-quiet:hover { background: var(--paper-3); color: var(--ink); }

.qb-btn-danger {
    background: var(--paper);
    border-color: color-mix(in srgb, var(--red) 35%, var(--rule-strong));
    color: var(--red);
}

.qb-btn-danger:hover { background: var(--red-soft); color: var(--red); }
.qb-btn-success {
    background: var(--paper);
    border-color: color-mix(in srgb, var(--ok) 40%, var(--rule-strong));
    color: var(--ok);
}
.qb-btn-success:hover { background: var(--ok-soft); color: var(--ok); }

.qb-btn-ai {
    background: var(--ai-soft);
    border-color: var(--ai-ring);
    color: var(--ai-ink);
}

.qb-btn-ai i, .qb-btn-ai .ll-icon { color: var(--ai); }
.qb-btn-ai:hover { background: var(--ai-ring); color: var(--ai-ink); }

.qb-btn-ai-strong {
    background: linear-gradient(135deg, var(--ai) 0%, #8a5cf6 100%);
    border-color: transparent;
    color: #fff;
}

.qb-btn-ai-strong:hover { filter: brightness(1.06); color: #fff; }

.qb-btn-small { height: 28px; padding: 0 10px; border-radius: var(--radius-sm); font-size: 12px; }
.qb-btn-full { width: 100%; }

/* ============================================================
   Status pills
   ============================================================ */

.qb-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 23px;
    padding: 0 9px;
    margin-right: 4px;
    border-radius: 999px;
    background: var(--paper-3);
    color: var(--ink-2);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
}

.qb-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    flex: none;
    border-radius: 50%;
    background: currentColor;
}

.qb-badge-success { background: var(--ok-soft); color: var(--ok); }
.qb-badge-info    { background: var(--blue-soft); color: var(--blue); }
.qb-badge-warning { background: var(--amber-soft); color: var(--amber); }
.qb-badge-danger  { background: var(--red-soft); color: var(--red); }
.qb-badge-ai      { background: var(--ai-soft); color: var(--ai-ink); }
.qb-badge-muted   { background: var(--paper-3); color: var(--ink-2); }

/* Tags */
.ll-tag {
    display: inline-flex;
    align-items: center;
    height: 21px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--paper-3);
    color: var(--ink-2);
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
}

.ll-tag-red    { background: var(--red-soft); color: var(--red); }
.ll-tag-green  { background: var(--ok-soft); color: var(--ok); }
.ll-tag-blue   { background: var(--blue-soft); color: var(--blue); }
.ll-tag-violet { background: var(--ai-soft); color: var(--ai-ink); }

.qb-store-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 23px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--paper-3);
    color: var(--ink-2);
    font-size: 11.5px;
    font-weight: 600;
}

.qb-muted { color: var(--ink-3); font-style: italic; }

/* Notes / insight boxes */
.ll-note {
    padding: 10px 14px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-ctl);
    background: var(--paper-2);
    color: var(--ink-2);
    font-size: 13px;
}

.ll-note-ai   { background: var(--ai-soft); border-color: var(--ai-ring); color: var(--ai-ink); }
.ll-note-warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 30%, transparent); color: var(--amber); }
.ll-note-risk { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 30%, transparent); color: var(--red); }

/* Tabs inside records */
.ll-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--rule);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.ll-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 12px;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--ink-3);
    font-weight: 500;
    text-decoration: none;
}

.ll-tab:hover { color: var(--ink); text-decoration: none; }
.ll-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.ll-tab-count {
    padding: 0 6px;
    border-radius: 999px;
    background: var(--paper-3);
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
}

/* ============================================================
   Toasts (flash messages)
   ============================================================ */

.qb-flash-container {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transform: translateX(-50%);
    pointer-events: none;
}

.qb-flash {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: min(560px, 92vw);
    padding: 9px 10px 9px 16px;
    border-radius: 999px;
    background: var(--toast-bg);
    color: var(--toast-ink);
    box-shadow: var(--shadow-pop);
    font-size: 13px;
    font-weight: 500;
    pointer-events: auto;
    animation: ll-toast-in .18s ease-out;
    transition: opacity .25s, transform .25s;
}

.qb-flash::before {
    content: '';
    width: 7px;
    height: 7px;
    flex: none;
    border-radius: 50%;
    background: var(--nav-dot);
}

.qb-flash-info::before    { background: #8db8ec; }
.qb-flash-warning::before { background: #f0b45a; }

.qb-flash-error {
    background: var(--red);
    color: var(--paper);
}

.qb-flash-error::before { background: currentColor; }

.qb-flash.is-leaving { opacity: 0; transform: translateY(8px); }

.qb-flash-close {
    width: 22px;
    height: 22px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 16px;
    line-height: 1;
    opacity: .6;
    cursor: pointer;
}

.qb-flash-close:hover { opacity: 1; background: rgba(127, 127, 127, .2); }

@keyframes ll-toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

/* ============================================================
   Login Page
   ============================================================ */

.qb-login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--canvas);
}

.qb-login-card {
    width: 380px;
    max-width: 100%;
    padding: 36px 32px 32px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-card);
    background: var(--paper);
    box-shadow: var(--shadow-2);
}

.qb-login-header { margin-bottom: 26px; text-align: center; }

.qb-login-header i {
    width: 44px;
    height: 44px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 22px;
}

.qb-login-header h1 {
    margin-bottom: 4px;
    color: var(--ink);
    font-size: 22px;
    font-weight: 650;
    letter-spacing: -.02em;
}

.qb-login-header p { color: var(--ink-3); font-size: 13px; }

.qb-login-card .qb-form-group { margin-bottom: 16px; }

.qb-login-card .qb-btn { height: 38px; margin-top: 8px; font-size: 14px; }

/* ============================================================
   Responsive
   ============================================================ */

/* ============================================================
   Chart of Accounts
   ============================================================ */

.qb-coa-page { max-width: 1060px; margin: 0 auto; }

.qb-coa-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.qb-coa-header h2 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qb-coa-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.qb-coa-table td:first-child { padding-left: 8px; }

.qb-coa-indent {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.qb-coa-type-icon { font-size: 13px; color: var(--qb-blue); opacity: 0.7; }

.qb-coa-name { font-weight: 500; }

.qb-row-inactive { opacity: 0.5; }

.qb-coa-row-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.qb-coa-table tbody tr:hover .qb-coa-row-actions { opacity: 1; }

.text-right { text-align: right; }

.qb-negative { color: var(--qb-red); }

.qb-coa-summary {
    text-align: right;
    font-size: 11px;
    color: var(--qb-text-light);
    margin-top: 8px;
}

/* ============================================================
   Entity Centers (Vendor, Customer)
   ============================================================ */

.qb-center-page { max-width: 1100px; margin: 0 auto; }

.qb-center-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.qb-center-header h2 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qb-center-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.qb-search-form {
    display: flex;
    gap: 4px;
}

.qb-search-input {
    padding: 5px 10px;
    border: 1px solid var(--qb-border);
    border-radius: 3px;
    font-size: 12px;
    width: 200px;
    font-family: inherit;
}

.qb-search-input:focus {
    outline: none;
    border-color: var(--qb-blue);
    box-shadow: 0 0 0 2px rgba(51, 102, 153, 0.15);
}

.qb-center-table td:first-child { font-weight: 500; }

.qb-entity-name { font-weight: 600; }

.qb-clickable-row { cursor: pointer; }
.qb-clickable-row:hover { background: var(--row-hover) !important; }

.qb-center-summary {
    text-align: right;
    font-size: 11px;
    color: var(--qb-text-light);
    margin-top: 8px;
}

.qb-truncate {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   Detail Pages (Vendor/Customer Detail)
   ============================================================ */

.qb-detail-page { max-width: 1100px; margin: 0 auto; }

.qb-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.qb-detail-header h2 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.qb-back-link {
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.qb-detail-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
}

.qb-info-grid { display: flex; flex-direction: column; gap: 10px; }

.qb-info-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.qb-info-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--qb-text-light);
}

@media (max-width: 768px) {
    .qb-detail-grid { grid-template-columns: 1fr; }
    .qb-center-header { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Modal
   ============================================================ */

.qb-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--overlay);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.qb-modal {
    width: 480px;
    max-width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--rule);
    border-radius: var(--radius-card);
    background: var(--paper);
    box-shadow: var(--shadow-pop);
}

.qb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--rule);
}

.qb-modal-header h3 { color: var(--ink); font-size: 15px; font-weight: 600; }

.qb-modal-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: var(--radius-ctl);
    background: none;
    color: var(--ink-3);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.qb-modal-close:hover { background: var(--paper-3); color: var(--ink); }

.qb-modal-body { padding: 18px; }

.qb-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--rule);
    border-radius: 0 0 var(--radius-card) var(--radius-card);
    background: var(--paper-2);
}

/* ============================================================
   Transaction List & Detail
   ============================================================ */

.qb-txn-page {
    max-width: 1200px;
}

.qb-txn-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.qb-txn-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--qb-navy);
}

.qb-txn-count {
    font-size: 13px;
    color: var(--qb-text-light);
    margin-left: 12px;
}

.qb-txn-filters {
    margin-bottom: 16px;
}

.qb-filter-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.qb-filter-form .qb-form-group {
    margin-bottom: 0;
}

.qb-filter-form .qb-form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--qb-text-light);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.qb-filter-form input,
.qb-filter-form select {
    padding: 6px 10px;
    border: 1px solid var(--qb-border);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}

.qb-filter-form input[type="text"] {
    width: 200px;
}

.qb-filter-form input[type="date"] {
    width: 150px;
}

.qb-txn-table {
    font-size: 13px;
}

.qb-nowrap {
    white-space: nowrap;
}

.qb-truncate-col {
    width: 30%;
}

.qb-truncate {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qb-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.qb-page-info {
    font-size: 13px;
    color: var(--qb-text-light);
}

.qb-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.qb-detail-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--qb-text-light);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.qb-detail-field span {
    font-size: 14px;
    color: var(--qb-text);
}

.qb-detail-amount {
    font-weight: 600;
    font-size: 16px !important;
    color: var(--qb-navy) !important;
}

.qb-detail-full {
    grid-column: 1 / -1;
}


/* ============================================================
   Reports
   ============================================================ */

.qb-report-page {
    max-width: 1000px;
}

.qb-report-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.qb-report-header {
    text-align: center;
    margin-bottom: 20px;
}

.qb-report-company {
    font-size: 16px;
    font-weight: 700;
    color: var(--qb-navy);
    text-transform: uppercase;
}

.qb-report-header h2 {
    margin: 4px 0;
    font-size: 20px;
    color: var(--qb-navy);
}

.qb-report-subtitle {
    font-size: 13px;
    color: var(--qb-text-light);
}

.qb-report-body {
    background: #fff;
    border: 1px solid var(--qb-border);
    border-radius: 6px;
    overflow: hidden;
}

.qb-report-table {
    font-size: 13px;
    margin: 0;
}

.qb-report-table th,
.qb-report-table td {
    padding: 6px 12px;
}

.qb-report-section-header th {
    background: var(--qb-navy);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 10px 12px;
}

.qb-report-group-header th {
    background: var(--qb-gray-200);
    font-weight: 600;
    font-size: 13px;
    color: var(--qb-text);
    padding: 8px 12px;
}

.qb-report-indent {
    padding-left: 28px !important;
}

.qb-report-subtotal td {
    font-weight: 600;
    border-top: 1px solid var(--qb-border);
    padding-top: 6px;
}

.qb-report-total td {
    font-weight: 700;
    border-top: 2px solid var(--qb-gray-300);
    background: var(--qb-gray-100);
    padding: 8px 12px;
}

.qb-report-grand-total td {
    font-weight: 700;
    font-size: 14px;
    border-top: 3px double var(--qb-navy);
    background: var(--qb-gray-200);
    padding: 10px 12px;
    color: var(--qb-navy);
}

.qb-report-group-row td {
    font-weight: 600;
    background: var(--qb-gray-100);
}

.qb-report-detail-row td {
    color: var(--qb-text-light);
    font-size: 12px;
}

/* ============================================================
   Account Register
   ============================================================ */

.qb-register-page {
    max-width: 1200px;
}

.qb-register-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.qb-register-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--qb-navy);
}

.qb-register-balance {
    font-size: 14px;
    color: var(--qb-text-light);
    margin-top: 4px;
}

.qb-register-balance strong {
    color: var(--qb-navy);
    font-size: 18px;
}

.qb-register-count {
    padding: 8px 16px;
    font-size: 12px;
    color: var(--qb-text-light);
    border-bottom: 1px solid var(--qb-border);
    background: var(--qb-gray-100);
}

.qb-register-table {
    font-size: 13px;
}

.qb-register-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.qb-reg-date { width: 90px; }
.qb-reg-type { width: 50px; }
.qb-reg-ref { width: 80px; }
.qb-reg-amt { width: 100px; }
.qb-reg-bal { width: 110px; }

.qb-reg-type-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 3px;
    background: var(--qb-gray-200);
    color: var(--qb-text-light);
    text-transform: uppercase;
}

.qb-reg-payee-name {
    font-weight: 500;
}

.qb-reg-memo {
    font-size: 11px;
    color: var(--qb-text-light);
    margin-top: 1px;
}

.qb-reg-balance {
    font-weight: 600;
    color: var(--qb-navy);
}

/* ============================================================
   Company Snapshot
   ============================================================ */

.qb-snapshot {
    max-width: 1200px;
}

.qb-snap-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.qb-snap-card {
    min-height: 0;
}

.qb-snap-wide {
    grid-column: span 3;
}

.qb-snap-table {
    font-size: 13px;
}

.qb-snap-table th,
.qb-snap-table td {
    padding: 8px 16px;
}

.qb-snap-ap {
    text-align: center;
    padding: 24px 16px;
}

.qb-snap-big-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--qb-navy);
    line-height: 1.1;
}

.qb-snap-subtitle {
    font-size: 13px;
    color: var(--qb-text-light);
    margin-top: 4px;
}

/* Bar chart */
.qb-chart-container {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 180px;
    padding: 10px 0;
}

.qb-chart-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.qb-chart-bars {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 150px;
}

.qb-chart-bar {
    width: 28px;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    cursor: default;
    transition: opacity 0.2s;
}

.qb-chart-bar:hover {
    opacity: 0.8;
}

.qb-bar-income {
    background: var(--qb-green);
}

.qb-bar-expense {
    background: var(--qb-red);
}

.qb-chart-label {
    font-size: 11px;
    color: var(--qb-text-light);
    margin-top: 6px;
    text-align: center;
}

.qb-chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--qb-text-light);
}

.qb-legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 4px;
}


/* ============================================================
   Ledgerline page layer
   Kept last so it settles the older per-page header/detail rules above.
   ============================================================ */

/* -- Page headers: title + muted subtitle left, actions right -- */
.qb-admin-header,
.qb-coa-header,
.qb-center-header,
.qb-txn-header,
.qb-register-header,
.qb-placeholder-header,
.qb-detail-header,
.qb-page-header,
.ll-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-bottom: 20px;
}

.qb-admin-header h2,
.qb-coa-header h2,
.qb-center-header h2,
.qb-txn-header h2,
.qb-register-header h2,
.qb-placeholder-header h2,
.qb-detail-header h2,
.qb-page-header h2,
.ll-page-header h2,
.ll-page-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0;
    color: var(--ink);
    font-size: 26px;
    font-weight: 650;
    letter-spacing: -.02em;
    line-height: 1.2;
}

/* Ledgerline titles carry no icon */
.qb-admin-header h2 > .bi,
.qb-coa-header h2 > .bi,
.qb-center-header h2 > .bi,
.qb-txn-header h2 > .bi,
.qb-register-header h2 > .bi,
.qb-placeholder-header h2 > .bi,
.qb-detail-header h2 > .bi,
.qb-page-header h2 > .bi { display: none; }

.ll-page-sub,
.qb-txn-count,
.qb-register-balance {
    margin: 4px 0 0;
    color: var(--ink-3);
    font-size: 13.5px;
    font-weight: 400;
    letter-spacing: 0;
}

.qb-txn-count { margin: 0; }
.qb-register-balance strong { color: var(--ink); font-size: 15px; font-weight: 650; }

.ll-section-heading { color: var(--ink); font-size: 22px; font-weight: 650; letter-spacing: -.02em; }

.qb-center-actions,
.qb-coa-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.qb-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--ink-3);
    font-size: 13px;
}

.qb-back-link:hover { color: var(--ink); text-decoration: none; }

/* Center-page search box */
.qb-search-form { display: flex; gap: 6px; }

.qb-search-input {
    width: 220px;
    height: 34px;
    padding: 0 11px;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-ctl);
    background: var(--paper);
    color: var(--ink);
    font-size: 13px;
}

.qb-search-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }

.qb-center-summary,
.qb-coa-summary { color: var(--ink-3); font-size: 11.5px; }

/* Filter bars above lists */
.qb-filter-form { gap: 12px 16px; }
.qb-filter-form .qb-form-group label { color: var(--ink-2); font-size: 12.5px; font-weight: 550; text-transform: none; }
.qb-filter-form .qb-btn { height: 38px; }
.qb-filter-form input[type="text"] { width: 200px; }
.qb-filter-form input[type="date"] { width: 160px; }
.qb-filter-form select { width: auto; min-width: 160px; }

.qb-page-info { color: var(--ink-3); font-size: 13px; }

/* -- Field grid on entry forms and record views --
   Two columns, 22px rows / 28px columns, one column under 1180px. */
.qb-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 28px;
}

.qb-detail-grid > .qb-form-group { margin-bottom: 0; }

@media (max-width: 1180px) {
    .qb-detail-grid { grid-template-columns: minmax(0, 1fr); }
}

.qb-detail-field label {
    display: block;
    margin-bottom: 4px;
    color: var(--ink-2);
    font-size: 12.5px;
    font-weight: 550;
    text-transform: none;
}

.qb-detail-field span { color: var(--ink); font-size: 13.5px; }

.qb-detail-amount {
    color: var(--ink) !important;
    font-size: 21px !important;
    font-weight: 650;
    letter-spacing: -.01em;
}

/* Label/value pairs in info cards */
.qb-info-grid { display: flex; flex-direction: column; gap: 12px; }
.qb-info-row { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }

.qb-info-label {
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

/* ============================================================
   Stat tiles (KPI row)
   ============================================================ */

.qb-stats-grid,
.ll-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.ll-stats { margin-bottom: 16px; }

/* .qb-stat-card markup is value-then-label; column-reverse puts the label on top */
.qb-stat-card,
.ll-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-card);
    background: var(--paper);
    box-shadow: var(--shadow-1);
    color: var(--ink);
    text-align: left;
    text-decoration: none;
    transition: box-shadow .15s, transform .15s;
}

.qb-stat-card { flex-direction: column-reverse; justify-content: flex-end; }

a.qb-stat-card:hover,
a.ll-stat:hover { box-shadow: var(--shadow-2); color: var(--ink); text-decoration: none; }

.qb-stat-label,
.ll-stat-label {
    margin: 0;
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 400;
    text-transform: none;
}

.qb-stat-value,
.ll-stat-value {
    color: var(--ink);
    font-size: 21px;
    font-weight: 650;
    letter-spacing: -.01em;
    line-height: 1.25;
}

.ll-stat-sub { color: var(--ink-3); font-size: 11.5px; }

.ll-money-neg { color: var(--red); }

/* ============================================================
   Record / detail pages
   ============================================================ */

/* Sticky bar flush under the top bar */
.ll-recordbar {
    position: sticky;
    top: var(--head-h);
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    margin: -26px -24px 0;
    padding: 7px 24px;
    background: var(--topbar-bg);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--rule);
}

.ll-recordbar-crumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--ink-3);
    font-size: 13px;
    white-space: nowrap;
}

.ll-recordbar-crumbs a { display: inline-flex; align-items: center; gap: 2px; color: var(--ink-2); }
.ll-recordbar-crumbs a:hover { color: var(--ink); text-decoration: none; }
.ll-recordbar-crumbs .ll-icon { width: 16px; height: 16px; }
.ll-recordbar-crumbs b { overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-weight: 600; }

.ll-recordbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.ll-record-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 0 18px;
}

.ll-record-avatar {
    width: 56px;
    height: 56px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--accent);
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: .02em;
}

.ll-record-name {
    color: var(--ink);
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.ll-record-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    margin-top: 7px;
    color: var(--ink-2);
    font-size: 13px;
}

.ll-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.ll-meta-item .ll-icon { width: 15px; height: 15px; color: var(--ink-3); }
.ll-record-meta .qb-badge { margin-right: 0; }

.ll-record-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
    align-items: start;
}

.ll-record-main { min-width: 0; }
.ll-record-rail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ll-record-rail .qb-card { margin-bottom: 0; }

@media (max-width: 1100px) {
    .ll-record-body { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================
   Reports
   ============================================================ */

.qb-report-toolbar { flex-wrap: wrap; align-items: center; }

.qb-report-company {
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.qb-report-header h2 {
    color: var(--ink);
    font-size: 22px;
    font-weight: 650;
    letter-spacing: -.02em;
}

.qb-report-subtitle { color: var(--ink-3); font-size: 13px; }

.qb-report-body {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-1);
}

/* ============================================================
   Company Snapshot (dashboard)
   ============================================================ */

.qb-snap-big-number {
    color: var(--ink);
    font-size: 28px;
    font-weight: 650;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.qb-snap-subtitle { margin-top: 4px; color: var(--ink-3); font-size: 12px; }

.qb-chart-bar { border-radius: 4px 4px 0 0; }
.qb-legend-dot { border-radius: 50%; width: 8px; height: 8px; }

/* Stand-alone inputs (toolbars, pay-bills, reconcile). Inputs in table
   cells are left as they were. */
.qb-input:not(td .qb-input) {
    height: 38px;
    padding: 0 11px;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-ctl);
    background: var(--paper);
    color: var(--ink);
    font-size: 13.5px;
}

.qb-input:not(td .qb-input):focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.qb-memorize-form .qb-input { height: 28px; border-radius: var(--radius-sm); }

/* ============================================================
   Print
   ============================================================ */

@media print {
    .ll-sidebar, .ll-head, .ll-launcher, .ll-appear, .ll-recordbar, .qb-report-toolbar, .qb-txn-filters,
    .qb-flash-container { display: none !important; }
    .ll-app { display: block; }
    body, .qb-main { background: #fff; }
    .qb-main { padding: 0 !important; }
    .qb-report-page { max-width: 100%; }
    .qb-report-body { border: none; box-shadow: none; }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 900px) {
    .ll-topbar { grid-template-columns: minmax(0, 1fr) auto; padding: 0 16px; }
    .ll-crumbs { display: none; }
    .qb-main { padding-left: 16px; padding-right: 16px; }
    .ll-recordbar { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 768px) {
    .qb-home-row { grid-template-columns: 1fr; }
    .qb-form-inline { flex-direction: column; align-items: stretch; }
    .qb-form-row { flex-direction: column; }
    .qb-center-header { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Navigation layouts  (<html data-layout="sidebar|topbar|launcher">)
   One header serves all three; CSS shows the parts each layout uses.
   ============================================================ */

[hidden] { display: none !important; }

body {
    background:
        radial-gradient(1100px 360px at 62% -140px, color-mix(in srgb, var(--accent) 9%, transparent), transparent 72%) no-repeat,
        var(--canvas);
}

.ll-top-left { display: flex; align-items: center; gap: 10px; min-width: 0; }

.ll-menu-btn, .ll-brand, .ll-brand-store { display: none; }
.ll-menu-btn i { font-size: 17px; }

.ll-brand {
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--ink);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}
.ll-brand:hover { color: var(--ink); text-decoration: none; }
.ll-brand .ll-logo { width: 30px; height: 30px; font-size: 14px; }
.ll-brand-name { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ll-brand-store {
    height: 28px;
    padding: 0 6px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    background: var(--paper-2);
    color: var(--ink-2);
    font-size: 12px;
    cursor: pointer;
}

:root[data-layout="topbar"] .ll-app,
:root[data-layout="launcher"] .ll-app,
:root[data-layout="apps"] .ll-app { grid-template-columns: minmax(0, 1fr); }
:root[data-layout="topbar"] .ll-sidebar,
:root[data-layout="launcher"] .ll-sidebar,
:root[data-layout="apps"] .ll-sidebar { display: none; }
:root[data-layout="topbar"] .ll-brand,
:root[data-layout="launcher"] .ll-brand,
:root[data-layout="apps"] .ll-brand { display: flex; }
:root[data-layout="topbar"] .ll-brand-store,
:root[data-layout="launcher"] .ll-brand-store,
:root[data-layout="apps"] .ll-brand-store { display: block; }
:root[data-layout="launcher"] .ll-menu-btn { display: inline-grid; }
:root[data-layout="topbar"] .ll-crumbs { display: none; }
:root[data-layout="launcher"] .ll-crumbs { padding-left: 12px; border-left: 1px solid var(--rule); }

/* -- Top-bar layout: menu band under the header -- */
.ll-topnav { display: none; }

:root[data-layout="topbar"] .ll-topnav {
    display: flex;
    align-items: stretch;
    gap: 2px;
    height: var(--topnav-h);
    padding: 0 14px;
    background: var(--nav-bg);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .12);
}

.ll-tn-item { position: relative; display: flex; }

.ll-tn-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 13px;
    border: 0;
    background: none;
    color: var(--nav-dim);
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}

.ll-tn-btn .ll-icon { width: 16px; height: 16px; }
.ll-tn-btn .ll-chev { width: 13px; height: 13px; margin-left: -3px; opacity: .7; transition: transform .15s; }
.ll-tn-btn:hover,
.ll-tn-item.is-open .ll-tn-btn { background: var(--nav-hover); color: var(--nav-strong); text-decoration: none; }
.ll-tn-btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--nav-dot); }
.ll-tn-item.is-open .ll-chev { transform: rotate(180deg); }
.ll-tn-item.is-active .ll-tn-btn { color: var(--nav-strong); }

.ll-tn-item.is-active .ll-tn-btn::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--nav-dot);
}

.ll-tn-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 70;
    grid-template-columns: minmax(230px, 1fr);
    gap: 2px;
    margin-top: 6px;
    padding: 8px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 14px;
    box-shadow: var(--shadow-pop);
}

.ll-tn-panel.is-wide { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
.ll-tn-panel::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.ll-tn-item.is-open .ll-tn-panel { display: grid; animation: ll-pop .14s ease-out; }

.ll-tn-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border-radius: 9px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
}

.ll-tn-link:hover { background: var(--paper-3); color: var(--ink); text-decoration: none; }
.ll-tn-link.is-active { background: var(--accent-soft); color: var(--ink); font-weight: 600; }

.ll-tn-ico {
    width: 30px;
    height: 30px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--tone-soft);
    color: var(--tone);
    font-size: 15px;
}

@keyframes ll-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes ll-rise { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }

/* -- Launcher: every screen as icon tiles, centred over the page -- */
.ll-launcher {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    justify-items: center;
    align-items: start;
    padding: 4vh 20px 24px;
    overflow-y: auto;
}

.ll-launcher-backdrop {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.ll-launcher-panel {
    position: relative;
    width: min(1180px, 100%);
    padding: 16px 20px 18px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 20px;
    box-shadow: var(--shadow-pop);
    animation: ll-rise .18s ease-out;
}

body.ll-launcher-open { overflow: hidden; }

.ll-launcher-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.ll-launcher-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 12px 0 14px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: var(--paper-2);
    color: var(--ink-3);
    font-size: 17px;
    cursor: text;
}

.ll-launcher-search:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }

.ll-launcher-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--ink);
    font-size: 15px;
}

.ll-launch-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--rule);
}

.ll-quick {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    padding: 0 12px 0 9px;
    border-radius: 8px;
    background: var(--tone-soft);
    color: var(--tone);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: box-shadow .12s, transform .12s;
}

.ll-quick i { font-size: 15px; }
.ll-quick:hover { color: var(--tone); text-decoration: none; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tone) 45%, transparent); }
.ll-quick:active { transform: translateY(1px); }

/* Packed columns of dense rows: the whole menu fits one screen (a long section leaves no gaps beside it) */
.ll-launch-grid { columns: 5 204px; column-gap: 18px; }
.ll-launch-sec { break-inside: avoid; padding-bottom: 14px; }

.ll-launch-sec-title {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    margin: 0 0 4px;
    padding: 0 8px 5px;
    border: 0;
    border-bottom: 2px solid color-mix(in srgb, var(--tone) 55%, transparent);
    background: none;
    color: var(--ink);
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-align: left;
    cursor: default;
}
.ll-launch-sec-title i { color: var(--tone); font-size: 14px; line-height: 1; }
.ll-launch-caret { display: none; margin-left: auto; color: var(--ink-3) !important; font-size: 12px !important; transition: transform .15s; }

.ll-launch-rows { list-style: none; margin: 0; padding: 0; }
.ll-mrow { position: relative; display: flex; align-items: center; border-radius: 7px; }
.ll-mlink {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    height: 30px;
    padding: 0 8px;
    border-radius: 7px;
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}
.ll-mlink span { overflow: hidden; text-overflow: ellipsis; }
.ll-mlink i { width: 16px; flex: none; color: var(--tone); font-size: 16px; line-height: 1; text-align: center; }
.ll-mnew {
    flex: none;
    display: grid;
    place-items: center;
    position: absolute;          /* over the end of the name, so a long name keeps its width */
    top: 2px;
    right: 2px;
    width: 26px;
    height: 26px;
    background: var(--paper-3);
    border-radius: 6px;
    color: var(--ink-3);
    font-size: 14px;
    text-decoration: none;
    opacity: 0;
}
.ll-mrow:hover { background: var(--paper-3); }
.ll-mrow:hover .ll-mlink { color: var(--ink); text-decoration: none; }
.ll-mrow:hover .ll-mnew, .ll-mnew:focus-visible, .ll-mrow.is-first .ll-mnew { opacity: 1; }
.ll-mnew:hover { background: var(--tone); color: #fff; text-decoration: none; }
.ll-mlink:focus-visible, .ll-mnew:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ll-mrow.is-current { background: color-mix(in srgb, var(--tone) 12%, transparent); }
.ll-mrow.is-current .ll-mlink { color: var(--ink); font-weight: 650; }
.ll-mrow.is-first { box-shadow: inset 0 0 0 2px var(--accent); background: var(--paper-3); }
.ll-mrow.is-first.is-new-first .ll-mnew { background: var(--tone); color: #fff; }

/* Recent screens (app.js, this browser) */
.ll-launch-recent { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: -6px 0 14px; }
.ll-launch-recent-label { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; color: var(--ink-3); font-size: 11px;
    font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ll-launch-recent-list { display: contents; }
.ll-recent-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px 0 9px; border: 1px solid var(--rule);
    border-radius: 7px; color: var(--ink-2); font-size: 12.5px; font-weight: 500; text-decoration: none; }
.ll-recent-chip i { color: var(--tone); font-size: 14px; }
.ll-recent-chip:hover { border-color: var(--tone); color: var(--ink); text-decoration: none; }

.ll-launch-kbd { padding: 2px 6px; border: 1px solid var(--rule); border-radius: 5px; color: var(--ink-3); font: 11px var(--font-mono, monospace); white-space: nowrap; }
/* The box around it shows focus (:focus-within), so the input itself draws no second ring */
.ll-launcher-search input:focus, .ll-launcher-search input:focus-visible { outline: none !important; box-shadow: none; border: 0; }

/* The header's menu button names itself where there is room */
.ll-menu-btn-label { display: none; margin-left: 6px; font-size: 13px; font-weight: 600; }
@media (min-width: 1100px) {
    :root[data-layout="launcher"] .ll-menu-btn { display: inline-flex; flex-direction: row; align-items: center; width: auto; padding: 0 12px 0 10px; }
    :root[data-layout="launcher"] .ll-menu-btn-label { display: inline; }
}

/* Home page steps still use the icon bubble */
.ll-tile-ico {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--tone-soft);
    color: var(--tone);
    font-size: 21px;
    transition: transform .14s, box-shadow .14s;
}
.ll-launch-empty { padding: 28px; color: var(--ink-3); text-align: center; }

/* -- Appearance panel -- */
.ll-appear {
    position: fixed;
    top: calc(var(--topbar-h) - 2px);
    right: 16px;
    z-index: 210;
    width: 330px;
    padding: 16px 16px 18px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 16px;
    box-shadow: var(--shadow-pop);
    animation: ll-pop .14s ease-out;
}

.ll-appear-head { color: var(--ink); font-size: 14.5px; font-weight: 650; }

.ll-appear-label {
    margin: 14px 0 8px;
    color: var(--ink-3);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.ll-layout-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }

.ll-layout-opt {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 6px 7px;
    border: 1px solid var(--rule);
    border-radius: 11px;
    background: var(--paper);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 550;
    cursor: pointer;
}

.ll-layout-opt:hover { border-color: var(--rule-strong); }
.ll-layout-opt.is-on { border-color: var(--accent); box-shadow: var(--focus-ring); color: var(--ink); }

.ll-thumb {
    display: grid;
    width: 100%;
    height: 56px;
    overflow: hidden;
    border: 1px solid var(--rule);
    border-radius: 7px;
    background: var(--canvas);
}

.thumb-sidebar { grid-template-columns: 26% 1fr; }
.thumb-topbar { grid-template-rows: 13px 1fr; }
.thumb-launcher { grid-template-rows: 9px 1fr; }
.t-nav { background: var(--nav-bg); }
.thumb-launcher .t-nav { background: var(--paper-3); }

.t-body { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; padding: 7px 6px; }
.t-body i { flex: 1 1 100%; height: 5px; border-radius: 2px; background: var(--rule-strong); }
.t-body i:first-child { flex: 0 0 55%; background: var(--accent); }

.thumb-launcher .t-body { display: grid; grid-template-columns: repeat(3, 11px); place-content: center; gap: 5px; padding: 4px; }
.thumb-launcher .t-body i { width: 11px; height: 11px; border-radius: 3.5px; background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }

.ll-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; border-radius: 11px; background: var(--paper-3); }

.ll-seg button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-2);
    font-size: 12.5px;
    font-weight: 550;
    cursor: pointer;
}

.ll-seg button.is-on { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1); }

.ll-themes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: min(330px, 46vh); overflow-y: auto; margin: 0 -4px; padding: 2px 4px 4px; }

.ll-theme-opt {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 8px 5px 5px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink-2);
    font: inherit;
    font-size: 12.5px;
    font-weight: 550;
    text-align: left;
    cursor: pointer;
    transition: border-color .12s;
}

.ll-theme-opt:hover { border-color: var(--rule-strong); color: var(--ink); }
.ll-theme-opt.is-on { border-color: var(--accent); box-shadow: var(--focus-ring); color: var(--ink); }

/* Miniature of the palette: menu strip, page, a card with an accent bar. */
.ll-theme-prev {
    display: grid;
    grid-template-columns: 11px 1fr;
    flex: none;
    width: 46px;
    height: 34px;
    overflow: hidden;
    border: 1px solid var(--p-rule);
    border-radius: 6px;
    background: var(--p-canvas);
}

.p-nav { background: var(--p-nav); border-right: 1px solid var(--p-rule); }
.p-body { padding: 5px 4px; }

.p-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    height: 100%;
    padding: 4px;
    border: 1px solid var(--p-rule);
    border-radius: 3px;
    background: var(--p-paper);
}

.p-card i { height: 3px; border-radius: 2px; background: var(--p-rule); }
.p-card i:first-child { width: 70%; background: var(--sw); }

.ll-theme-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ll-theme-name, .ll-theme-tag { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ll-theme-tag { color: var(--ink-3); font-size: 11px; font-weight: 400; }

/* ============================================================
   Home
   ============================================================ */

.ll-home { max-width: 1200px; margin: 0 auto; }

.ll-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 20px;
}

.ll-hero-eyebrow { color: var(--accent); font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.ll-hero h1 { margin: 4px 0 2px; color: var(--ink); font-size: 26px; font-weight: 650; letter-spacing: -.01em; }
.ll-hero p { color: var(--ink-3); }
.ll-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.ll-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.ll-kpi {
    position: relative;
    display: block;
    padding: 16px 18px 15px;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-1);
    color: var(--ink);
    text-decoration: none;
    transition: box-shadow .15s, transform .15s, border-color .15s;
}

.ll-kpi::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--tone);
}

.ll-kpi:hover { color: var(--ink); text-decoration: none; border-color: var(--rule-strong); box-shadow: var(--shadow-2); transform: translateY(-1px); }

.ll-kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-3); font-size: 12.5px; font-weight: 550; }

.ll-kpi-ico {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--tone-soft);
    color: var(--tone);
    font-size: 15px;
}

.ll-kpi-value { margin-top: 8px; font-size: 23px; font-weight: 650; letter-spacing: -.01em; }
.ll-kpi-sub { margin-top: 2px; color: var(--ink-3); font-size: 12px; }

.ll-flows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.ll-flow {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-1);
}

.ll-flow-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--rule);
}

.ll-flow-head .ll-tn-ico { width: 28px; height: 28px; font-size: 14px; }
.ll-flow-title { color: var(--ink); font-size: 14px; font-weight: 600; }
.ll-flow-head a { margin-left: auto; font-size: 12.5px; font-weight: 550; }

.ll-steps {
    display: flex;
    align-items: flex-start;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 6px 0;
    padding: 20px 10px 16px;
}

.ll-step {
    position: relative;
    flex: 1 1 0;
    min-width: 84px;
    max-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 6px 2px;
    border-radius: 12px;
    color: var(--ink-2);
    text-align: center;
    text-decoration: none;
}

/* Connector line between the steps of a workflow */
.ll-steps.is-flow .ll-step + .ll-step::before {
    content: '';
    position: absolute;
    top: 30px;
    right: calc(50% + 30px);
    width: calc(100% - 60px);
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--tone) 45%, transparent));
}

.ll-step:hover { color: var(--ink); text-decoration: none; }
.ll-step:hover .ll-tile-ico { transform: translateY(-2px); box-shadow: 0 8px 18px -10px var(--tone); }
.ll-step span:last-child { font-size: 12px; font-weight: 500; line-height: 1.25; }

/* Launcher layout: Home shows the full icon launcher in place of the workflows */
.ll-home-launch { display: none; }
:root[data-layout="launcher"] .ll-home-launch {
    display: block;
    padding: 22px 24px 26px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 18px;
    box-shadow: var(--shadow-1);
}
:root[data-layout="launcher"] .ll-flows { display: none; }

/* ============================================================
   Inputs inside line-item tables match the rest of the form
   ============================================================ */

.qb-table td input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.qb-table td select,
.qb-table td textarea {
    height: 32px;
    padding: 0 9px;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-sm);
    background: var(--paper);
    color: var(--ink);
    font-size: 12.5px;
    transition: border-color .15s, box-shadow .15s;
}

.qb-table td textarea { height: auto; padding: 6px 9px; }

.qb-table td input:not([type="checkbox"]):not([type="radio"]):focus,
.qb-table td select:focus,
.qb-table td textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }

/* ============================================================
   Layouts on small screens: every layout opens the launcher
   from the menu button instead of showing a sidebar or menu band.
   ============================================================ */

@media (max-width: 1100px) {
    .ll-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ll-flows { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    :root[data-layout="topbar"] { --topnav-h: 0px; }
    :root[data-layout="topbar"] .ll-topnav { display: none; }
    :root[data-layout="topbar"] .ll-menu-btn { display: inline-grid; }
    .ll-topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
}

@media (max-width: 700px) {
    :root[data-layout] .ll-app { grid-template-columns: minmax(0, 1fr); }  /* beats html.ll-collapsed */
    .ll-sidebar { display: none; }
    .ll-brand { display: flex; }
    .ll-menu-btn { display: inline-grid; }
    .ll-brand-name, .ll-brand-store, .ll-crumbs, .ll-search kbd,
    .ll-theme-toggle, .ll-avatar { display: none !important; }
    .ll-topbar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 0 10px; }
    .ll-launcher { padding: 10px; }
    .ll-launcher-panel { padding: 14px 14px 20px; border-radius: 16px; }
    .ll-launch-grid { columns: 1; }
    .ll-launch-kbd { display: none; }
    /* Phones: sections fold; the one you are in opens; a search opens them all */
    .ll-launch-sec { padding-bottom: 2px; }
    .ll-launch-sec-title { min-height: 40px; margin: 0; padding: 0 8px; border-bottom: 1px solid var(--rule); font-size: 12px; cursor: pointer; }
    .ll-launch-caret { display: inline-block; }
    .ll-launch-sec-title[aria-expanded="true"] .ll-launch-caret { transform: rotate(180deg); }
    .ll-launch-sec-title[aria-expanded="false"] + .ll-launch-rows { display: none; }
    .ll-launcher.is-searching .ll-launch-sec-title + .ll-launch-rows { display: block; }
    .ll-mlink { height: 40px; font-size: 14.5px; }
    .ll-mnew { position: static; width: 36px; height: 36px; opacity: 1; background: none; }
    .ll-appear { left: 10px; right: 10px; width: auto; }
    .ll-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
    .ll-kpi-value { font-size: 19px; }
    .ll-hero h1 { font-size: 22px; }
}

.ll-quick.is-first { box-shadow: inset 0 0 0 2px var(--accent); }

/* Page columns sit centred, so the full-width layouts don't leave a gap at the right */
.qb-txn-page, .qb-register-page, .qb-snapshot, .qb-report-page { margin-left: auto; margin-right: auto; }

/* -- Name list forms (New / Edit Customer, Vendor, Employee) -- */
.names-page { max-width: 980px; }
.names-page .qb-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.names-wide { grid-column: 1 / -1; }
.names-wide textarea { width: 100%; resize: vertical; }
.names-req { color: var(--red); }
.names-check { align-self: end; padding-bottom: 8px; }
.names-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 4px 0 24px; }
.names-inline { display: inline; }
@media (max-width: 700px) { .names-page .qb-detail-grid { grid-template-columns: 1fr; } }

/* Balance Sheet: shown only when the ledger does not tie */
.ll-bs-unbalanced td { color: var(--red); font-weight: 600; background: var(--red-soft); }

/* -- Admin → Data Health -- */
.dh-page { max-width: 1000px; }
.dh-intro { margin: -4px 0 18px; color: var(--ink-3); }
.dh-summary { margin-left: auto; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.dh-summary.is-good { background: var(--ok-soft); color: var(--ok); }
.dh-summary.is-bad { background: var(--red-soft); color: var(--red); }
.dh-list { list-style: none; }
.dh-check { display: flex; align-items: flex-start; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--rule); }
.dh-check:first-child { border-top: 0; }
.dh-dot { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: 13px; }
.dh-check.is-pass .dh-dot { background: var(--ok-soft); color: var(--ok); }
.dh-check.is-fail .dh-dot { background: var(--red-soft); color: var(--red); }
.dh-check.is-na .dh-dot { background: var(--paper-3); color: var(--ink-3); }
.dh-num { width: 20px; flex: none; padding-top: 3px; color: var(--ink-3); font-size: 12px; text-align: right; }
.dh-body { flex: 1; min-width: 0; }
.dh-title { display: flex; gap: 10px; align-items: baseline; color: var(--ink); font-weight: 550; }
.dh-status { margin-left: auto; color: var(--ink-3); font-size: 12px; font-weight: 500; }
.dh-check.is-fail .dh-status { color: var(--red); font-weight: 600; }
.dh-detail { margin-top: 2px; color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dh-rows { margin-top: 6px; font-size: 12.5px; }
.dh-rows summary { color: var(--ink-2); cursor: pointer; }
.dh-rows ul { margin: 6px 0 0 18px; color: var(--ink-2); }

/* ============================================================
   Header "+ New" menu (items come from app/nav.py)
   ============================================================ */
.ll-new-menu { position: relative; margin-right: 6px; }
.ll-new-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ll-new-menu > summary::-webkit-details-marker { display: none; }
.ll-new-menu > summary .ll-icon { width: 15px; height: 15px; }
.ll-new-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    gap: 4px 12px;
    padding: 12px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-pop);
    animation: ll-pop .14s ease-out;
}
.ll-new-title {
    padding: 4px 8px;
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.ll-new-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}
.ll-new-link i { color: var(--accent); }
.ll-new-link:hover, .ll-new-link:focus-visible { background: var(--paper-3); }
.ll-new-link kbd {
    margin-left: auto;
    padding: 0 5px;
    border: 1px solid var(--rule-strong);
    border-radius: 4px;
    color: var(--ink-3);
    font: inherit;
    font-size: 11px;
}
@media (max-width: 900px) {
    .ll-new-menu > summary span { display: none; }
    .ll-new-panel { grid-template-columns: 1fr; max-height: 70vh; overflow: auto; }
}

/* Small utilities used instead of inline styles */
.qb-card-body-flush { padding: 0; }
.ll-header-actions { display: flex; gap: 8px; align-items: center; }
.ll-strong { font-weight: 600; }
.ll-muted { color: var(--ink-3); }
.ll-mt-3 { margin-top: 12px; }
.ll-ico-accent { color: var(--accent); margin-right: 6px; }
.ll-rank { width: 30px; text-align: center; color: var(--ink-3); }
.ll-empty-cell { padding: 20px; text-align: center; color: var(--ink-3); }

/* Report Center: saved reports */
.ll-saved-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ll-saved-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: var(--paper-2);
    color: var(--ink);
    font-size: 13px;
    text-decoration: none;
}
.ll-saved-chip:hover { border-color: var(--accent); color: var(--accent); }
.ll-mb-4 { margin-bottom: 16px; }

/* Audit log (admin/_audit_rows.html) */
.al-table td { vertical-align: top; }
.al-changes summary, .al-json summary { cursor: pointer; color: var(--ink-2); font-size: 12px; }
.al-diff { margin-top: 4px; font-size: 12px; }
.al-diff .al-old { color: var(--red); text-decoration: line-through; }
.al-diff .al-new { color: var(--green, inherit); }
.al-json pre { max-height: 320px; overflow: auto; font-size: 11px; white-space: pre-wrap; }

/* Error pages (templates/error.html) */
.qb-error { width: 440px; }
.qb-error-title { margin-bottom: 8px; color: var(--ink); font-size: 17px; font-weight: 600; text-align: center; }
.qb-error-message { margin-bottom: 20px; color: var(--ink-2); font-size: 14px; line-height: 1.5; text-align: center; }
.qb-error-actions { display: flex; gap: 10px; justify-content: center; }
.qb-error-actions .qb-btn { margin-top: 0; }
.ll-inline-form { display: contents; }
.qb-period-reason { width: 220px; height: 28px; margin-right: 6px; padding: 0 8px; font-size: 13px; }
.al-reason { margin-bottom: 4px; }
.ll-link-btn { border: 0; background: none; padding: 2px 0; color: var(--accent); font-size: 12px; cursor: pointer; text-decoration: underline; }
.qb-item-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.qb-item-type { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--rule); border-radius: var(--radius-card); color: var(--ink); text-decoration: none; }
.qb-item-type:hover { border-color: var(--accent); }
.qb-item-type i { font-size: 20px; color: var(--accent); }
.qb-item-type span { color: var(--ink-3); font-size: 13px; }
.qb-kv th { width: 200px; font-weight: 500; color: var(--ink-3); }

/* Line grids: money and quantity stay readable however the columns share out */
input[name^="line_amount_"], input[name^="line_rate_"], input[name^="itemline_amount_"], input[name^="itemline_cost_"] { min-width: 92px; }
input[name^="line_qty_"], input[name^="itemline_qty_"] { min-width: 64px; }

/* ============================================================
   Layout and density round. Colours are theme tokens only.
   ============================================================ */

/* -- Header fits at every width: the search gives way first -- */
.ll-topbar { grid-template-columns: minmax(0, 1fr) minmax(120px, 440px) auto; }
.ll-top-actions { flex-shrink: 0; flex-wrap: nowrap; }
.ll-top-actions .ll-avatar { flex-shrink: 0; }
.ll-search { min-width: 0; }
.ll-brand-name { max-width: 200px; }
@media (max-width: 1280px) {
    .ll-search kbd { display: none; }
    .ll-top-actions { gap: 0; }
    .ll-topbar { gap: 10px; padding: 0 14px; }
}
@media (max-width: 1180px) {
    :root[data-layout] .ll-crumbs { display: none; }
    .ll-theme-toggle { display: none; }
    .ll-topbar { grid-template-columns: auto minmax(100px, 1fr) auto; }
    .ll-top-left:empty { display: none; }
}
@media (max-width: 1024px) {
    :root[data-layout] .ll-brand-name { max-width: 130px; }
    .ll-avatar { display: none; }
}
@media (max-width: 480px) {
    .ll-top-actions .ll-icon-btn[data-shortcuts-open], .ll-top-actions #ll-appear-btn { display: none; }
    .ll-new-menu > summary { padding: 0 8px; }
}
.ll-skip { position: absolute; left: 8px; top: -60px; z-index: 4000; padding: 8px 14px; border-radius: var(--radius-ctl); background: var(--paper); color: var(--ink); box-shadow: var(--shadow-pop); }
.ll-skip:focus { top: 8px; }
.ll-sr-only, .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* -- Page headers wrap instead of pushing the page wide -- */
.qb-txn-header, .qb-center-header, .qb-coa-header, .qb-admin-header { flex-wrap: wrap; gap: 10px; }
.ll-header-actions { flex-wrap: wrap; }
.qb-filter-form { flex-wrap: wrap; }
.qb-filter-form .qb-form-group { min-width: 0; flex: 1 1 150px; }
.qb-center-actions { flex-wrap: wrap; }
.ll-recordbar { flex-wrap: wrap; gap: 8px; }
.ll-recordbar-actions { flex: 0 1 auto; flex-wrap: wrap; max-width: 100%; }
.qb-main { min-width: 0; }

/* -- A wide table scrolls in its own box; its first column stays put -- */
.ll-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.ll-table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ll-sticky-first th:first-child, .ll-sticky-first td:first-child { position: sticky; left: 0; z-index: 1; background: var(--paper); }
.ll-sticky-first th:first-child { background: var(--paper-2); z-index: 2; }
.ll-sticky-first tbody tr:hover td:first-child { background: var(--row-hover); }
.ll-sticky-first tfoot td:first-child { background: var(--paper-2); }
.ll-table-scroll.is-scrolled .ll-sticky-first th:first-child,
.ll-table-scroll.is-scrolled .ll-sticky-first td:first-child { box-shadow: 1px 0 0 var(--rule-strong); }
:root[data-accent="green"] .ll-sticky-first th:first-child { background: var(--accent); }
:root[data-accent="orange"] .ll-sticky-first th:first-child { background: var(--accent-soft); }
:root[data-accent="rose"] .ll-sticky-first th:first-child { background: var(--paper); }
.qb-table td.text-right, .qb-table th.text-right, .qb-nowrap { white-space: nowrap; }
.ll-first-with-check { white-space: nowrap; }
.ll-first-with-check input[type="checkbox"] { margin-right: 6px; vertical-align: middle; }
.ll-row-link { color: inherit; text-decoration: none; }
.ll-row-link:hover { color: var(--accent); text-decoration: underline; }
.ll-row-void td { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.ll-row-void td .qb-badge { text-decoration: none; }
.ll-total-row td { background: var(--paper-2); font-weight: 650; color: var(--ink); border-top: 1px solid var(--rule-strong); }
.qb-badge-danger { background: var(--red-soft); color: var(--red); }
.ll-text-danger { color: var(--red); }
.ll-empty-state { padding: 60px 20px; text-align: center; color: var(--ink-2); }
.ll-empty-state i { display: block; margin-bottom: 12px; font-size: 40px; color: var(--ink-3); }

/* -- List tools -- */
.ll-sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; }
.ll-sort:hover { color: inherit; text-decoration: underline; }
.ll-sort.is-sorted { color: inherit; }
.ll-sort i { font-size: 9px; }
:root[data-accent="green"] .qb-table th .ll-sort, :root[data-accent="green"] .qb-table th .ll-sort.is-sorted { color: var(--on-accent); }
.ll-views { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.ll-view-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 2px 10px; border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--paper); color: var(--ink-2); font-size: 12.5px; text-decoration: none; cursor: pointer; }
.ll-view-chip a { color: inherit; text-decoration: none; }
.ll-view-chip:hover { border-color: var(--accent); color: var(--ink); }
.ll-view-chip.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.ll-view-add { list-style: none; }
.ll-view-add::-webkit-details-marker { display: none; }
.ll-view-x { padding: 0 2px; border: 0; background: none; color: var(--ink-2); font-size: 15px; line-height: 1; cursor: pointer; }
.ll-view-x:hover { color: var(--red); }
.ll-pop { position: relative; display: inline-block; }
.ll-pop > summary { list-style: none; cursor: pointer; }
.ll-pop > summary::-webkit-details-marker { display: none; }
.ll-pop-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; display: flex; flex-direction: column; gap: 10px; min-width: 220px; padding: 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius-card); background: var(--paper); box-shadow: var(--shadow-pop); }
.ll-pop-end .ll-pop-panel { left: auto; right: 0; }
.ll-col-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; }
.ll-col-list legend { margin-bottom: 6px; font-weight: 600; color: var(--ink); }
.ll-col-list label { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 400; }
.ll-bulk { position: sticky; top: calc(var(--head-h) + 6px); z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 12px; border: 1px solid var(--accent); border-radius: var(--radius-card); background: var(--accent-soft); color: var(--ink); }
.ll-bulk-count { margin-right: auto; }
.ll-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--ink-2); font-size: 13px; }
.ll-pager-size { display: inline-flex; align-items: center; gap: 2px; }
.ll-pager-label { margin-right: 6px; }
.ll-pager-opt { min-width: 34px; padding: 3px 8px; border-radius: var(--radius-sm); color: var(--ink-2); text-align: center; text-decoration: none; }
.ll-pager-opt:hover { background: var(--paper-3); color: var(--ink); }
.ll-pager-opt.is-active { background: var(--accent-soft); color: var(--ink); font-weight: 650; }
.ll-pager-nav { display: inline-flex; align-items: center; gap: 8px; }

/* -- Breadcrumbs: one look on every page -- */
.ll-breadcrumb { margin-bottom: 8px; font-size: 12.5px; color: var(--ink-2); }
.ll-breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.ll-breadcrumb li + li::before { content: "/"; margin-right: 4px; color: var(--ink-3); }
.ll-breadcrumb a { color: var(--ink-2); }
.ll-breadcrumb a:hover { color: var(--accent); }
.ll-breadcrumb [aria-current] { color: var(--ink); font-weight: 600; }

/* -- Document view -- */
.ll-doc .qb-card { margin-bottom: 12px; }
.ll-doc-actions .qb-btn { white-space: nowrap; }
.ll-void-box { border-left: 4px solid var(--red); }
.ll-doc-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 22px; margin: 0; padding: 16px 18px; }
.ll-doc-meta dt { margin-bottom: 2px; color: var(--ink-2); font-size: 11.5px; font-weight: 550; }
.ll-doc-meta dd { margin: 0; color: var(--ink); font-size: 13.5px; overflow-wrap: anywhere; }
.ll-doc-party dd { font-size: 15px; font-weight: 650; }
.ll-doc-due dd { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ll-doc-wide { grid-column: 1 / -1; }
.ll-doc-totals { display: flex; justify-content: flex-end; margin: -2px 0 14px; }
.ll-doc-totals table { min-width: min(320px, 100%); border-collapse: collapse; }
.ll-doc-totals th { padding: 4px 18px 4px 0; color: var(--ink-2); font-weight: 450; text-align: left; }
.ll-doc-totals td { padding: 4px 0; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.ll-doc-totals .is-total th, .ll-doc-totals .is-total td { border-top: 1px solid var(--rule-strong); color: var(--ink); font-size: 14.5px; font-weight: 700; }
.ll-dt-list { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--rule-strong); margin-bottom: 10px; }
.ll-dt-tab { padding: 8px 14px; border-bottom: 2px solid transparent; color: var(--ink-2); font-weight: 550; text-decoration: none; }
.ll-dt-tab:hover { color: var(--ink); }
.ll-dt-tab[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); }
.ll-dt-tab .ll-muted { color: var(--ink-2); font-weight: 400; }
.ll-attach-list { margin: 0 0 14px; padding: 0; list-style: none; }
.ll-attach-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.ll-attach-list form { margin-left: auto; }
.ll-attach-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ll-attach-form label { font-weight: 550; color: var(--ink-2); }
.ll-attach-form .ll-hint { flex-basis: 100%; }

/* -- Entry forms: compact header above a dense grid, totals pinned to the window -- */
form .qb-detail-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 14px; }
form .qb-detail-grid > .qb-form-group { min-width: 0; }
form .qb-detail-grid label { margin-bottom: 2px; font-size: 12px; }
:root form .qb-detail-grid select, :root form .qb-detail-grid input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { width: 100%; height: 34px !important; min-height: 34px; padding-top: 4px !important; padding-bottom: 4px !important; }
@media (max-width: 480px) { form .qb-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } form .qb-detail-grid > .qb-form-group:first-child { grid-column: 1 / -1; } }
.ll-line-grid td { padding: 2px 4px; }
.ll-line-grid th { padding-top: 6px; padding-bottom: 6px; }
:root .ll-line-grid input:not([type="checkbox"]):not([type="radio"]), :root .ll-line-grid select { height: 30px; padding-top: 2px; padding-bottom: 2px; border-color: transparent; background: transparent; }
:root .ll-line-grid input:not([type="checkbox"]):not([type="radio"]):hover, :root .ll-line-grid select:hover { border-color: var(--rule-strong); }
:root .ll-line-grid input:not([type="checkbox"]):not([type="radio"]):focus, :root .ll-line-grid select:focus { border-color: var(--accent); background: var(--paper); }
.ll-table-scroll > .ll-line-grid { min-width: 720px; }
.ll-form-foot { position: sticky; bottom: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin: 12px 0 0; padding: 10px 14px; border: 1px solid var(--rule-strong); border-radius: var(--radius-card); background: var(--paper); box-shadow: var(--shadow-2); }
.ll-form-totals { display: flex; flex-wrap: wrap; gap: 4px 22px; order: 2; margin: 0 0 0 auto; }
.ll-form-totals div { display: flex; align-items: baseline; gap: 8px; }
.ll-form-totals dt { color: var(--ink-2); font-size: 12.5px; }
.ll-form-totals dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.ll-form-totals .is-total dd { font-size: 16px; font-weight: 700; }
.ll-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; order: 1; }
.ll-field-error { display: block; margin-top: 3px; color: var(--red); font-size: 12px; font-weight: 550; }
[aria-invalid="true"] { border-color: var(--red) !important; box-shadow: var(--invalid-ring); }

/* -- Chart of Accounts -- */
.qb-coa-page { max-width: none; }
.qb-coa-indent { display: inline-flex; align-items: center; gap: 6px; }
.ll-depth-1 { padding-left: 22px; } .ll-depth-2 { padding-left: 44px; } .ll-depth-3 { padding-left: 66px; } .ll-depth-4 { padding-left: 88px; } .ll-depth-5 { padding-left: 110px; }
.qb-coa-indent[class*="ll-depth-"]:not(.ll-depth-0) .qb-coa-name { font-weight: 450; }
@media (hover: none), (max-width: 1024px) { .qb-coa-row-actions { opacity: 1 !important; } }
.qb-coa-row-actions { white-space: nowrap; }
.qb-coa-table tbody tr:focus-within .qb-coa-row-actions { opacity: 1; }

/* -- Report Center: every row a real link -- */
.ll-report-list { margin: 0; padding: 0; list-style: none; }
.ll-report-list li + li { border-top: 1px solid var(--rule); }
.ll-report-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: var(--ink); text-decoration: none; }
.ll-report-row:hover { background: var(--row-hover); color: var(--ink); text-decoration: none; }
.ll-report-ico { width: 22px; color: var(--accent); font-size: 17px; text-align: center; }
.ll-report-text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.ll-report-text span { color: var(--ink-2); font-size: 12px; }
.ll-report-go { color: var(--ink-3); }

/* -- Dashboard -- */
.ll-card-head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ll-card-link { color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.ll-attn { margin: 0; padding: 0; list-style: none; }
.ll-attn li + li { border-top: 1px solid var(--rule); }
.ll-attn-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: var(--ink-2); text-decoration: none; }
.ll-attn-row:hover { background: var(--row-hover); color: var(--ink); text-decoration: none; }
.ll-attn-row i { color: var(--ink-3); }
.ll-attn-row.has-count i { color: var(--amber); }
.ll-attn-label { display: flex; flex: 1; flex-direction: column; color: var(--ink); }
.ll-attn-label small { color: var(--ink-2); font-size: 11.5px; }
.ll-attn-row b { color: var(--ink-2); font-size: 16px; font-variant-numeric: tabular-nums; }
.ll-attn-row.has-count b { color: var(--ink); }
.ll-aging-bar { display: flex; gap: 2px; height: 10px; margin: 10px 0 12px; overflow: hidden; border-radius: 5px; background: var(--paper-3); }
.ll-aging-bar span { min-width: 2px; }
.ll-aging-legend { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 0; font-size: 12.5px; }
.ll-aging-legend div { display: flex; justify-content: space-between; gap: 8px; }
.ll-aging-legend dt { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 400; }
.ll-aging-legend dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.ll-aging-dot { width: 9px; height: 9px; border-radius: 3px; }
.ll-aging-current { background: var(--ok); } .ll-aging-d1_30 { background: var(--blue); } .ll-aging-d31_60 { background: var(--amber); } .ll-aging-d61_90 { background: var(--rose); } .ll-aging-over90 { background: var(--red); }
.ll-forecast { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.ll-forecast div { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); }
.ll-forecast b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ll-forecast .is-total { padding-top: 7px; border-top: 1px solid var(--rule-strong); color: var(--ink); font-weight: 600; }
.ll-forecast .is-total b { font-size: 15px; font-weight: 700; }
.ll-group-row th { color: var(--ink); font-weight: 650; text-align: left; text-transform: none; letter-spacing: 0; font-size: 12.5px; background: var(--paper-2); }
.ll-group-row td { color: var(--ink); font-weight: 650; background: var(--paper-2); }
.ll-group-item { padding-left: 24px !important; }
.ll-snap-foot { margin: 0; padding: 8px 16px; font-size: 12px; color: var(--ink-2); border-top: 1px solid var(--rule); }
.ll-seg-links { display: inline-flex; flex-wrap: wrap; gap: 2px; font-size: 12px; font-weight: 500; }
.ll-seg-links a { padding: 3px 9px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; }
.ll-seg-links a:hover { background: var(--paper-3); color: var(--ink); }
.ll-seg-links a.is-active { background: var(--accent-soft); color: var(--ink); font-weight: 650; }
.ll-chart-legend { display: flex; gap: 16px; margin-bottom: 10px; color: var(--ink-2); font-size: 12.5px; }
.ll-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ll-chart-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.ll-bar-in { background: var(--accent); }
.ll-bar-out { background: var(--amber); }
.ll-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 200px auto; column-gap: 8px; }
.ll-chart-yaxis { display: flex; flex-direction: column; justify-content: space-between; color: var(--ink-2); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; transform: translateY(-1px); }
.ll-chart-yaxis span { line-height: 1; }
.ll-chart-plot { position: relative; }
.ll-chart-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; }
.ll-chart-grid i { display: block; height: 1px; background: var(--rule); }
.ll-chart-cols { position: absolute; inset: 0; display: flex; gap: 4px; }
.ll-chart-col { position: relative; display: flex; flex: 1; align-items: flex-end; justify-content: center; gap: 2px; min-width: 0; padding: 0 2px; text-decoration: none; border-radius: 4px 4px 0 0; }
.ll-chart-col:hover, .ll-chart-col:focus-visible { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.ll-bar { display: block; width: min(38%, 22px); min-height: 1px; border-radius: 4px 4px 0 0; }
.ll-chart-col.is-empty { align-items: center; background-image: repeating-linear-gradient(135deg, transparent 0 5px, color-mix(in srgb, var(--ink-3) 14%, transparent) 5px 6px); }
.ll-chart-none { color: var(--ink-2); font-size: 11px; text-align: center; }
.ll-chart-tip { position: absolute; bottom: calc(100% - 26px); left: 50%; z-index: 30; display: none; flex-direction: column; gap: 3px; width: max-content; min-width: 150px; max-width: 220px; padding: 8px 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); box-shadow: var(--shadow-pop); font-size: 12px; transform: translateX(-50%); pointer-events: none; }
.ll-chart-col:first-child .ll-chart-tip { left: 0; transform: none; }
.ll-chart-col:last-child .ll-chart-tip { left: auto; right: 0; transform: none; }
.ll-chart-col:hover .ll-chart-tip, .ll-chart-col:focus-visible .ll-chart-tip { display: flex; }
.ll-chart-tip span { display: flex; align-items: center; gap: 6px; }
.ll-chart-tip em { margin-left: auto; font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }
.ll-chart-xaxis { grid-column: 2; display: flex; gap: 4px; margin-top: 6px; color: var(--ink-2); font-size: 11px; }
.ll-chart-xaxis span { flex: 1; min-width: 0; text-align: center; }
.ll-chart-nodata { padding: 40px 20px; color: var(--ink-2); text-align: center; }
.ll-chart-nodata i { display: block; margin-bottom: 8px; font-size: 32px; color: var(--ink-3); }
.ll-kpi:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.qb-snap-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.qb-snap-wide { grid-column: 1 / -1; }
.ll-snap-span2 { grid-column: span 2; }
@media (max-width: 1240px) { .qb-snap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .qb-snap-grid { grid-template-columns: minmax(0, 1fr); } .ll-snap-span2 { grid-column: auto; } }
.qb-snapshot, .ll-home { min-width: 0; }

/* -- Appearance -- */
.ll-narrow { max-width: 860px; }
.ll-stack { display: flex; flex-direction: column; gap: 16px; }
.ll-choice { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; border: 0; }
.ll-choice legend { margin-bottom: 8px; font-weight: 600; color: var(--ink); }
.ll-choice label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 400; }
.ll-choice-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.ll-theme-choice { padding: 8px 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius-ctl); }
.ll-theme-choice:has(input:checked) { border-color: var(--accent); box-shadow: var(--focus-ring); }

/* -- Keyboard shortcuts -- */
.ll-shortcuts .ll-launcher-panel { max-width: 780px; }
.ll-shortcuts h2 { margin: 0; font-size: 17px; color: var(--ink); }
.ll-sc-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 26px; margin-top: 14px; }
.ll-sc-cols h3 { margin: 0 0 8px; font-size: 13px; color: var(--ink); }
.ll-sc-list { display: flex; flex-direction: column; gap: 7px; margin: 0; font-size: 13px; }
.ll-sc-list div { display: flex; align-items: baseline; gap: 10px; }
.ll-sc-list dt { flex-shrink: 0; min-width: 84px; color: var(--ink-2); font-weight: 400; }
.ll-sc-list dd { margin: 0; color: var(--ink); }
.ll-sc-list kbd { padding: 1px 6px; border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--paper-2); color: var(--ink); font: inherit; font-size: 11.5px; }

/* -- A focus ring that always shows, on every theme -- */
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--accent) !important; outline-offset: 2px; }
.ll-sidebar :where(a, button, summary, select):focus-visible, .ll-topnav :where(a, button):focus-visible { outline-color: var(--nav-dot) !important; outline-offset: 1px; }
.ll-subhead { margin: 18px 0 10px; font-size: 14px; color: var(--ink); }

.qb-table th.text-right { text-align: right; }
.qb-table th.text-right .ll-sort { justify-content: flex-end; }
.ll-group-row th, .ll-group-row td { border-bottom: 1px solid var(--rule); }
:where(input, select, textarea):focus-visible { outline-offset: 0; }
.qb-coa-row-actions { opacity: 1 !important; text-align: right; }
@media (max-width: 1100px) {
    :root[data-layout="topbar"] .ll-topnav { padding: 0 6px; gap: 0; }
    :root[data-layout="topbar"] .ll-tn-btn { padding: 0 8px; font-size: 13px; gap: 5px; }
}
@media (max-width: 600px) {
    .ll-form-foot { gap: 6px 10px; padding: 8px 10px; }
    .ll-form-totals { order: 1; width: 100%; margin: 0; justify-content: flex-end; }
    .ll-form-totals div:not(.is-total) { display: none; }
    .ll-form-actions { order: 2; width: 100%; flex-wrap: nowrap; overflow-x: auto; }
    .ll-form-actions .qb-btn { flex: none; }
}

/* Report kit */
.ll-kit-compare { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.ll-kit-compare legend { float: left; padding: 0; margin-right: 12px; font-size: 12px; color: var(--ink-3); }
.ll-kit-table .ll-kit-section th { background: var(--paper-2); text-align: left; font-weight: 600; text-transform: none; letter-spacing: 0; position: static; }
.ll-kit-table .ll-kit-section th span { position: sticky; left: 12px; }
.ll-kit-table .ll-kit-sub td { font-weight: 600; border-top: 1px solid var(--rule); }
.ll-kit-table .ll-kit-total td { font-weight: 700; border-top: 2px solid var(--ink-3); background: var(--paper-2); }
.ll-kit-note { margin: 10px 12px; }
.ll-kit-table td a.ll-row-link { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 2px; }
.ll-kit-table td a.ll-row-link:hover, .ll-kit-table td a.ll-row-link:focus { color: var(--accent); text-decoration-color: currentColor; }
.ll-kit-paper { display: none; }
.ll-kit-table thead th { white-space: normal; min-width: 72px; vertical-align: bottom; }
.ll-kit-table thead th:first-child { min-width: 0; }
@media print {
    .ll-kit-paper { display: block; }
    .ll-kit-screen { display: none !important; }
    .ll-kit-paper-page { page-break-after: always; }
    .ll-kit-paper-page:last-child { page-break-after: auto; }
}
@media print { .ll-no-print { display: none !important; } .ll-table-scroll { overflow: visible !important; } .ll-kit-table td a.ll-row-link { text-decoration: none; } }
.qb-report-basis { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.ll-kit-why { font-style: italic; }
.ll-basis-toggle { display: inline-flex; gap: 2px; align-items: center; margin-left: 4px; }
.ll-backup-status { margin: 0; display: grid; gap: 8px; }
.ll-backup-status > div { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 12px; }
.ll-backup-status dt { color: var(--ink-3); }
.ll-backup-status dd { margin: 0; overflow-wrap: anywhere; }
.ll-danger-card { border-color: var(--red); }

/* Company setup */
.ll-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.ll-steps a { display: block; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-2); font-size: 13px; text-decoration: none; background: var(--paper); }
.ll-steps a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.ll-steps .is-current a { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.ll-steps .is-done a::before { content: "\2713\00a0"; }
.ll-setup-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ll-setup-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ll-setup-grid input { width: 100%; min-width: 90px; text-align: right; }
.ll-setup-diff { font-weight: 600; }
.ll-setup-diff.is-off { color: var(--red); }

/* Line account override (app/lineaccounts.py) and date notes (app/dateparams.py) */
.ll-line-override { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px 6px; }
.ll-line-override-toggle { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.ll-line-override input[type="text"] { flex: 1 1 260px; max-width: 480px; }
.ll-date-problems { margin-bottom: 12px; }
.ll-date-problems > div + div { margin-top: 4px; }

/* A refused save, summarised above the form (app/feedback.py) */
.ll-error-summary { margin: 0 0 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--red) 35%, transparent);
    border-radius: 8px; background: var(--red-soft); color: var(--red); }
.ll-error-summary:focus { outline: 2px solid var(--red); outline-offset: 2px; }
.ll-error-summary ul { margin: 6px 0 0; padding-left: 20px; }
.ll-error-summary a { color: inherit; text-decoration: underline; }

/* Filters, chips and groups on every list (app/filters.py) */
.ll-filterbar { margin: 0 0 12px; }
.ll-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ll-search { display: flex; gap: 6px; flex: 1 1 280px; max-width: 460px; }
.ll-search input[type="search"] { flex: 1; min-width: 0; }
.ll-filter-panel { min-width: min(560px, 92vw); }
.ll-filter-form, .ll-group-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.ll-filter-form label, .ll-group-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85em; }
.ll-filter-values { display: contents; }
.ll-group-level { display: flex; gap: 8px; flex-basis: 100%; }
.ll-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ll-quick-chip, .ll-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
    border: 1px solid var(--border, #d0d5dd); background: var(--surface, #fff); font-size: 0.85em; text-decoration: none; color: inherit; }
.ll-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.ll-chip { background: var(--accent-soft, #eef4ff); }
.ll-chip-x { text-decoration: none; font-weight: 600; color: inherit; padding: 0 2px; }
.ll-chip-summary { margin-left: auto; font-size: 0.85em; opacity: 0.85; font-variant-numeric: tabular-nums; }
.ll-chip-clear { font-size: 0.85em; }
.ll-view-default { font-size: 0.75em; opacity: 0.7; }
.ll-group-row td { background: var(--surface-2, rgba(0,0,0,0.03)); font-weight: 600; }
.ll-group-head { padding-left: calc(8px + var(--depth, 0) * 18px) !important; white-space: nowrap; }
.ll-group-leaf > td:first-child { padding-left: calc(8px + var(--depth, 0) * 18px) !important; }
.ll-group-toggle { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.ll-group-toggle[aria-expanded="true"] .bi-chevron-right { transform: rotate(90deg); }
.ll-group-toggle .bi { transition: transform 0.12s; }
.ll-group-count { margin-left: 8px; font-weight: 400; opacity: 0.7; font-size: 0.85em; }
.ll-group-more td { padding-left: calc(8px + var(--depth, 0) * 18px) !important; }

/* Reports on the filter engine (app/reportfilters.py): the bar is for the screen, the conditions print */
.ll-print-only { display: none; }
@media print { .ll-print-only { display: block; } }
.ll-report-filtered { font-size: .85em; margin: 0 0 .5rem; }
.ll-report-filterbar { margin: .5rem 0; }
.ll-group-drill { margin-left: .4rem; font-size: .8em; opacity: .7; }
.ll-group-drill:hover, .ll-group-drill:focus { opacity: 1; }

/* Line Items explorer (app/lineitems.py): mode switch, pivot, charts.
   Chart colours: the categorical slots in fixed order, stepped separately for dark (validated set). */
.ll-explorer-bar { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin: .5rem 0; }
.ll-mode { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.ll-refreshed { font-size: .85em; color: var(--qb-text-light); align-self: center; }
.ll-hint { font-size: .85em; color: var(--qb-text-light); }
.ll-pc-form label, .ll-measure-form label { display: inline-flex; gap: .35rem; align-items: center; }
.ll-measure-form { display: flex; flex-direction: column; gap: .5rem; }
.ll-pivot th[scope="row"] { font-weight: 500; white-space: nowrap; }
.ll-pivot-link { display: inline-flex; flex-direction: column; align-items: flex-end; text-decoration: none; color: inherit; }
.ll-pivot-link:hover .ll-pivot-fig, .ll-pivot-link:focus .ll-pivot-fig { text-decoration: underline; }
.ll-pivot-fig { display: block; }
.ll-pivot-total, .ll-pivot tfoot td { font-weight: 600; }
.ll-chart {
    --ll-series-1: #2a78d6; --ll-series-2: #eb6834; --ll-series-3: #1baf7a; --ll-series-4: #eda100;
    --ll-series-5: #e87ba4; --ll-series-6: #008300; --ll-series-7: #6250d6; --ll-series-8: #e34948;
    padding: .75rem; margin: 0 0 .75rem;
}
:root[data-theme="dark"] .ll-chart {
    --ll-series-1: #3987e5; --ll-series-2: #d95926; --ll-series-3: #199e70; --ll-series-4: #c98500;
    --ll-series-5: #d55181; --ll-series-6: #008300; --ll-series-7: #9085e9; --ll-series-8: #e66767;
}
.ll-chart-title { font-weight: 600; margin-bottom: .25rem; }
.ll-chart-svg { width: 100%; height: auto; max-height: 420px; display: block; }
.ll-chart-text { font-size: 11px; fill: var(--qb-text); }
.ll-axis { fill: var(--qb-text-light); }
.ll-grid { stroke: var(--qb-text-light); stroke-opacity: .18; stroke-width: 1; }
.ll-baseline { stroke: var(--qb-text-light); stroke-opacity: .6; stroke-width: 1; }
.ll-line { fill: none; stroke-width: 2; }
.ll-mark { stroke: var(--paper, #fff); stroke-width: 2; cursor: pointer; }
.ll-mark:hover, a:focus .ll-mark { opacity: .8; }
.ll-legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; list-style: none; padding: 0; margin: 0 0 .25rem; font-size: .85em; }
.ll-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }
.ll-rf-downloads { display: flex; gap: .4rem; justify-content: flex-end; margin-bottom: .4rem; }

/* Activity timeline on customer and vendor pages (app/parties.py) */
.ll-timeline { list-style: none; margin: 0; padding: 0; }
.ll-timeline li { display: flex; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line, #e5e7eb); flex-wrap: wrap; }
.ll-timeline-when { flex: 0 0 6.5em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ll-timeline-what { flex: 1 1 14em; min-width: 0; overflow-wrap: anywhere; }
.ll-timeline-amount { font-variant-numeric: tabular-nums; }
.ll-timeline-note .ll-timeline-what { font-style: italic; }
.ll-section > summary { cursor: pointer; list-style: none; }
.ll-section > summary::-webkit-details-marker { display: none; }
.ll-section > summary::before { content: '\25B8'; display: inline-block; margin-right: 6px; transition: transform .15s; }
.ll-section[open] > summary::before { transform: rotate(90deg); }
.ll-repeat input { width: 100%; min-width: 6em; }

/* ── Help: the User Guide pages and the help panel (app/helpcenter.py) ─────────────────── */
.ll-guide-search { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 8px 12px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-card, 12px); }
.ll-guide-search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 15px; outline: none; color: var(--ink); }
.ll-guide-search > .bi { color: var(--ink-3); }
.ll-guide-search-small { margin-top: 12px; padding: 4px 6px 4px 10px; }
.ll-guide-ai-off { display: flex; gap: 6px; align-items: center; margin: -4px 0 16px; font-size: 13px; }
.ll-guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.ll-guide-group ul { list-style: none; margin: 0; padding: 4px 0 8px; }
.ll-guide-group li { padding: 7px 16px; border-top: 1px solid var(--rule); }
.ll-guide-group li:first-child { border-top: 0; }
.ll-guide-group li a { font-weight: 600; text-decoration: none; color: var(--accent); }
.ll-guide-group li a:hover { text-decoration: underline; }
.ll-guide-sum { display: block; color: var(--ink-3); font-size: 12.5px; line-height: 1.4; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ll-guide-results { margin-bottom: 16px; }
.ll-guide-hit { display: block; padding: 10px 16px; border-top: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.ll-guide-hit:hover { background: var(--paper-2); }
.ll-guide-hit-title { display: block; font-weight: 600; color: var(--accent); }
.ll-guide-hit-snip { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.ll-guide-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; margin-top: 8px; }
.ll-guide-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 12px; }
.ll-guide-toc { list-style: none; margin: 0; padding: 6px 0; font-size: 13px; }
.ll-guide-toc li a { display: block; padding: 4px 14px; color: var(--ink-2); text-decoration: none; border-left: 2px solid transparent; }
.ll-guide-toc li a:hover { color: var(--accent); }
.ll-guide-toc li.is-current a { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.ll-guide-article { padding: 24px 32px 32px; }
.ll-guide-article-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ll-guide-article-head h1 { font-size: 26px; margin: 0; }
.ll-guide-actions { display: flex; gap: 8px; }
.ll-guide-body { font-size: 14.5px; line-height: 1.65; color: var(--ink); max-width: 820px; }
.ll-guide-body h2 { font-size: 19px; margin: 28px 0 8px; padding-top: 8px; border-top: 1px solid var(--rule); scroll-margin-top: 80px; }
.ll-guide-body h3 { font-size: 15.5px; margin: 20px 0 6px; scroll-margin-top: 80px; }
.ll-guide-body p { margin: 0 0 10px; }
.ll-guide-body ul, .ll-guide-body ol { margin: 0 0 12px; padding-left: 22px; }
.ll-guide-body li { margin: 3px 0; }
.ll-guide-body code { font-size: 12.5px; padding: 1px 5px; border-radius: 4px; background: var(--paper-3); }
.ll-guide-body a { color: var(--accent); }
.ll-guide-table { overflow-x: auto; margin: 4px 0 14px; }
.ll-guide-table table { font-size: 13.5px; }
.ll-guide-note { display: flex; gap: 10px; margin: 8px 0 14px; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft, var(--paper-2)); border-left: 3px solid var(--accent); }
.ll-guide-note > .bi { color: var(--accent); margin-top: 2px; }
.ll-guide-answer { font-size: 13.5px; max-width: none; }
.ll-guide-answer p:last-child { margin-bottom: 0; }

.ll-help { position: fixed; top: 0; right: 0; bottom: 0; z-index: 1200; width: min(440px, 100vw); display: flex; flex-direction: column;
    background: var(--paper); border-left: 1px solid var(--rule); box-shadow: var(--shadow-pop); animation: ll-help-in .16s ease-out; }
.ll-help[hidden] { display: none; }
@keyframes ll-help-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.ll-help-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--rule); }
.ll-help-head h2 { flex: 1; margin: 0; font-size: 17px; display: flex; gap: 8px; align-items: center; }
.ll-help-here { display: flex; align-items: center; gap: 8px; margin: 10px 14px 0; padding: 9px 12px; border-radius: 10px; background: var(--paper-2);
    border: 1px solid var(--rule); color: var(--ink); text-decoration: none; font-size: 13.5px; }
.ll-help-here span { flex: 1; }
.ll-help-here:hover { border-color: var(--accent); }
.ll-help-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ll-help-intro { color: var(--ink-2); font-size: 14px; }
.ll-help-chips { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ll-help-chips button { text-align: left; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; font-size: 13px; }
.ll-help-chips button:hover { border-color: var(--accent); color: var(--accent); }
.ll-help-msg { padding: 10px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; max-width: 100%; overflow-wrap: anywhere; }
.ll-help-me { align-self: flex-end; background: var(--accent); color: var(--on-accent, #fff); max-width: 85%; white-space: pre-wrap; }
.ll-help-bot { align-self: stretch; background: var(--paper-2); border: 1px solid var(--rule); }
.ll-help-bot.is-loading .ll-help-dots { color: var(--ink-3); animation: ll-help-pulse 1.2s infinite; }
@keyframes ll-help-pulse { 50% { opacity: .4; } }
.ll-help-results { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ll-help-results a { display: block; padding: 8px 10px; border-radius: 8px; background: var(--paper); border: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.ll-help-results a:hover { border-color: var(--accent); }
.ll-help-results strong { display: block; color: var(--accent); font-size: 13px; }
.ll-help-results span { display: block; color: var(--ink-2); font-size: 12.5px; }
.ll-help-notice { margin: 0 0 8px; padding: 6px 10px; border-radius: 8px; background: var(--amber-soft, var(--paper-3)); font-size: 12.5px; }
.ll-help-err { margin: 0; color: var(--red); }
.ll-help-fb { display: flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.ll-help-fb .ll-icon-btn { width: 28px; height: 28px; }
.ll-help-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px; border-top: 1px solid var(--rule); }
.ll-help-form textarea { flex: 1; resize: none; min-height: 42px; max-height: 140px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--rule-strong, var(--rule));
    background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; }
.ll-help-form textarea:focus { outline: none; box-shadow: var(--focus-ring); }
.ll-help-foot { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 0 14px 12px; font-size: 11.5px; color: var(--ink-3); }
.ll-help-new { border: 0; background: none; color: var(--accent); cursor: pointer; font-size: 12px; white-space: nowrap; }
@media (max-width: 900px) {
    .ll-guide-layout { grid-template-columns: 1fr; }
    .ll-guide-side { position: static; }
    .ll-guide-article { padding: 18px 16px 24px; }
}
@media print {
    .ll-help, .ll-guide-side, .ll-guide-actions, .ll-breadcrumb { display: none !important; }
    .ll-guide-layout { display: block; }
    .ll-guide-article { border: 0; box-shadow: none; padding: 0; }
}


/* ============================================================
   Apps layout: a Modules page of tiles, and inside a module one bar of its screens.
   Built on the same tokens as every theme, so each colour theme and dark mode apply.
   ============================================================ */
.ll-apps-btn, .ll-appbar { display: none; }
:root[data-layout="apps"] .ll-apps-btn { display: inline-grid; font-size: 17px; color: var(--ink); }
:root[data-layout="apps"] .ll-apps-btn.is-active { background: var(--accent-soft); color: var(--accent); }
:root[data-layout="apps"] .ll-crumbs { display: none; }

:root[data-layout="apps"] .ll-appbar {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    height: var(--topnav-h);
    padding: 0 16px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
}
.ll-ab-mod {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 9px;
    padding-right: 14px;
    margin-right: 4px;
    border-right: 1px solid var(--rule);
    color: var(--ink);
    font-size: 14.5px;
    font-weight: 650;
    letter-spacing: -.01em;
    text-decoration: none;
}
.ll-ab-mod:hover { text-decoration: none; color: var(--ink); }
.ll-ab-ico {
    display: inline-grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 7px;
    background: var(--tone, var(--accent));
    color: #fff;
    font-size: 13.5px;
}
.ll-ab-links { display: flex; flex: 1 1 auto; align-items: center; gap: 2px; min-width: 0; overflow: hidden; }
.ll-ab-link {
    position: relative;
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 10px;
    border-radius: var(--radius-ctl);
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    list-style: none;
}
.ll-ab-link::-webkit-details-marker { display: none; }
.ll-ab-link:hover { background: var(--paper-3); color: var(--ink); text-decoration: none; }
.ll-ab-link.is-active { color: var(--ink); font-weight: 600; }
.ll-ab-link.is-active::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -6px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}
.ll-ab-link i { font-size: 11px; }
.ll-ab-more { position: static; flex: none; }
.ll-ab-panel {
    position: absolute;
    z-index: 60;
    top: calc(100% - 2px);
    right: 16px;
    min-width: 220px;
    max-height: 60vh;
    overflow: auto;
    padding: 6px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-2, 0 12px 32px -12px rgba(15, 23, 42, .28));
}
.ll-ab-panel .ll-ab-link { display: flex; height: 34px; }
.ll-ab-panel .ll-ab-link.is-active::after { display: none; }
/* One grid button in this layout: it opens the Modules page; Ctrl+K still opens the screen search. */
:root[data-layout="apps"] .ll-menu-btn { display: none !important; }

/* -- Modules page -- */
.ll-apps { max-width: 1180px; margin: 6px auto 0; }
.ll-apps-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.ll-apps-head h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.02em; color: var(--ink); }
.ll-apps-head p { margin: 4px 0 0; color: var(--ink-3); font-size: 13px; }
.ll-apps-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(340px, 100%);
    height: 38px;
    padding: 0 12px;
    background: var(--paper);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-ctl);
    color: var(--ink-3);
}
.ll-apps-filter:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.ll-apps-filter input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; }

.ll-apps-quick { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.ll-app-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 16px 0 9px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-1);
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.ll-app-chip:hover { border-color: color-mix(in srgb, var(--tone) 40%, var(--rule)); color: var(--ink); text-decoration: none; }
.ll-app-chip[hidden] { display: none; }
.ll-apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.ll-app-tile {
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-1);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.ll-app-tile[hidden] { display: none; }
.ll-app-tile:hover { border-color: color-mix(in srgb, var(--tone) 40%, var(--rule)); box-shadow: 0 10px 28px -16px color-mix(in srgb, var(--tone) 70%, transparent); transform: translateY(-1px); }
.ll-app-main {
    display: grid;
    grid-template-columns: 46px 1fr;
    grid-template-rows: auto auto;
    column-gap: 13px;
    align-items: center;
    padding: 16px 16px 12px;
    color: var(--ink);
    text-decoration: none;
}
.ll-app-main:hover { text-decoration: none; color: var(--ink); }
.ll-app-ico {
    grid-row: span 2;
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(140deg, color-mix(in srgb, var(--tone) 82%, #fff) 0%, var(--tone) 55%, color-mix(in srgb, var(--tone) 78%, #000) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 14px -8px var(--tone);
    color: #fff;
    font-size: 21px;
}
.ll-app-name { align-self: end; font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; }
.ll-app-count { align-self: start; color: var(--ink-3); font-size: 12px; }
.ll-app-links { margin: 0; padding: 4px 8px 10px; list-style: none; border-top: 1px solid var(--rule); }
.ll-app-links li { display: flex; align-items: center; }
.ll-app-links a, .ll-app-more button {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 9px;
    min-width: 0;
    height: 31px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    color: var(--ink-2);
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}
.ll-app-links a:hover, .ll-app-more button:hover { background: var(--paper-2); color: var(--ink); text-decoration: none; }
.ll-app-links a i { width: 16px; color: var(--tone); font-size: 14px; text-align: center; }
.ll-app-links a.ll-app-new { flex: none; width: 28px; justify-content: center; padding: 0; color: var(--ink-3); }
.ll-app-links a.ll-app-new i { color: inherit; }
.ll-app-links a.ll-app-new:hover { color: var(--tone); background: var(--tone-soft); }
.ll-app-more button { justify-content: space-between; border: 0; background: transparent; color: var(--tone); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ll-apps-empty { margin-top: 18px; color: var(--ink-3); text-align: center; }

/* Layout picker thumbnail */
.thumb-apps { grid-template-rows: 8px 6px 1fr; }
.thumb-apps .t-nav { background: var(--paper-3); }
.thumb-apps .t-sub { background: var(--paper); border-bottom: 1px solid var(--rule); }
.thumb-apps .t-body { display: grid; grid-template-columns: repeat(2, 16px); place-content: center; gap: 4px; padding: 3px; }
.thumb-apps .t-body i { width: 16px; height: 11px; border-radius: 3px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.thumb-apps .t-body i:first-child { background: var(--accent); box-shadow: none; }

@media (max-width: 720px) {
    :root[data-layout="apps"] .ll-appbar { padding: 0 10px; }
    .ll-ab-mod { padding-right: 8px; font-size: 13.5px; }
    .ll-apps-grid { grid-template-columns: 1fr; }
}
@media print { .ll-appbar { display: none !important; } }

/* ============================================================
   Email: Inbox, a received message, compose, and the Email panel on records (app/mailbox.py)
   ============================================================ */
.ll-tag-amber { background: var(--amber-soft); color: var(--amber); }
.ll-hint-error { color: var(--red); }
.ll-small { font-size: 12px; }
.ll-linkbtn { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 12.5px; cursor: pointer; }
.ll-linkbtn:hover { text-decoration: underline; }
.ll-mail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ll-mail-actions form { margin: 0; }
.ll-mail-checked { margin: -4px 0 10px; font-size: 12.5px; }
.ll-mail-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ll-mail-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.ll-mail-tabs a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); color: var(--ink-2); font-size: 13px; font-weight: 550; text-decoration: none; }
.ll-mail-tabs a span { color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.ll-mail-tabs a.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.ll-mail-search { display: flex; align-items: center; gap: 8px; width: min(320px, 100%); height: 34px; padding: 0 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius-ctl); background: var(--paper); color: var(--ink-3); }
.ll-mail-search:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.ll-mail-search input[type="search"] { flex: 1; min-width: 0; height: auto; padding: 0; border: 0; outline: 0; background: transparent; box-shadow: none; color: var(--ink); font: inherit; font-size: 13px; }
.ll-mail-list { overflow: hidden; }
.ll-mail-row { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr) auto 92px; align-items: center; gap: 14px; padding: 10px 16px; border-bottom: 1px solid var(--rule); color: var(--ink-2); font-size: 13px; text-decoration: none; }
.ll-mail-row:last-child { border-bottom: 0; }
.ll-mail-row:hover { background: var(--paper-2); color: var(--ink-2); text-decoration: none; }
.ll-mail-row.is-new { box-shadow: inset 3px 0 0 var(--accent); }
.ll-mail-row.is-new .ll-mail-from, .ll-mail-row.is-new b { color: var(--ink); font-weight: 700; }
.ll-mail-from { overflow: hidden; color: var(--ink); font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.ll-mail-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ll-mail-main b { color: var(--ink); font-weight: 550; }
.ll-mail-where { display: flex; align-items: center; gap: 6px; }
.ll-mail-date { color: var(--ink-3); font-size: 12.5px; text-align: right; }
.ll-mail-empty { margin: 0; padding: 18px 16px; }
.ll-mail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: 16px; }
.ll-mail-msg { padding: 0; }
.ll-mail-head { display: grid; gap: 3px; padding: 14px 18px; border-bottom: 1px solid var(--rule); font-size: 13px; }
.ll-mail-files { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 10px 18px; border-bottom: 1px solid var(--rule); list-style: none; font-size: 13px; }
.ll-mail-files i { margin-right: 4px; }
.ll-mail-body { padding: 16px 18px 20px; color: var(--ink); font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ll-mail-side { display: grid; gap: 14px; }
.ll-mail-side p { margin: 0 0 8px; }
.ll-mail-file { display: grid; gap: 6px; margin: 10px 0 8px; }
.ll-mail-file label { color: var(--ink-2); font-size: 12.5px; font-weight: 550; }
.ll-mail-file .qb-btn { justify-self: start; }
.ll-compose textarea { width: 100%; min-height: 260px; font: inherit; line-height: 1.5; }
.ll-incoming-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ll-mail-panel { margin-top: 16px; }
.ll-mail-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ll-convo { margin: 0; padding: 0; list-style: none; }
.ll-convo li { border-top: 1px solid var(--rule); }
.ll-convo li:first-child { border-top: 0; }
.ll-convo a { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; padding: 10px 16px; color: var(--ink-2); font-size: 13px; text-decoration: none; }
.ll-convo a:hover { background: var(--paper-2); text-decoration: none; }
.ll-convo li.is-current a { background: var(--accent-soft); }
.ll-convo i.bi-arrow-down-left { color: var(--blue); }
.ll-convo i.bi-arrow-up-right { color: var(--ok); }
.ll-convo-text { display: grid; gap: 2px; min-width: 0; }
.ll-convo-text b { overflow: hidden; color: var(--ink); font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.ll-convo-snip { overflow: hidden; color: var(--ink-3); text-overflow: ellipsis; white-space: nowrap; }
.ll-convo-meta { display: grid; justify-items: end; gap: 4px; color: var(--ink-3); font-size: 12px; }
@media (max-width: 900px) {
    .ll-mail-grid { grid-template-columns: 1fr; }
    .ll-mail-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "from date" "main main" "where where"; gap: 4px 10px; }
    .ll-mail-from { grid-area: from; } .ll-mail-date { grid-area: date; } .ll-mail-main { grid-area: main; } .ll-mail-where { grid-area: where; }
}

/* Bank connections (app/banksync.py) */
.ll-bankconn-intro { margin: -4px 0 12px; }
.ll-conn { margin-bottom: 14px; }
.ll-conn-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ll-conn-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }
.ll-conn-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 400; }
.ll-conn-actions form { margin: 0; }
.ll-conn-error { margin: 10px 16px 0; }
.ll-conn-table select { min-width: 240px; max-width: 100%; }
.ll-conn-save { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ll-conn-empty { display: flex; align-items: center; gap: 14px; }
.ll-conn-empty i { color: var(--accent); font-size: 28px; }
.ll-conn-empty p { margin: 0; }
@media (max-width: 720px) { .ll-conn-table select { min-width: 0; width: 100%; } }

/* Dashboard tile trends (home.html): six-month bank balance line and net income bars */
.ll-kpi-trend { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 12px; }
.ll-spark, .ll-bars { display: block; flex: 1 1 auto; width: 100%; max-width: 150px; height: 36px; overflow: visible; }
.ll-spark-line { stroke: var(--tone, var(--accent)); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ll-spark-stop-a { stop-color: var(--tone, var(--accent)); stop-opacity: .28; }
.ll-spark-stop-b { stop-color: var(--tone, var(--accent)); stop-opacity: 0; }
.ll-bar { fill: color-mix(in srgb, var(--tone, var(--accent)) 38%, transparent); }
.ll-bar.is-now { fill: var(--tone, var(--accent)); }
.ll-bar.is-neg { fill: color-mix(in srgb, var(--red) 55%, transparent); }
.ll-bars-labels { display: none; }
.ll-delta { flex: none; padding: 3px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 11.5px; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ll-delta.is-down { background: var(--red-soft); color: var(--red); }
.ll-delta .ll-money-neg { color: inherit; }
.ll-delta small { font-weight: 500; }
.ll-kpi-meter { flex-direction: column; align-items: stretch; gap: 8px; }
.ll-aging-mini { height: 8px; margin: 0; }
.ll-meter-note { color: var(--ink-3); font-size: 12px; }
.ll-meter-note b { color: var(--ink); font-weight: 650; }
.ll-kpi-facts { justify-content: flex-start; gap: 24px; }
.ll-kpi-facts span { display: flex; flex-direction: column; gap: 2px; }
.ll-kpi-facts small { color: var(--ink-3); font-size: 11.5px; }
.ll-kpi-facts b { color: var(--ink); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ll-spark { min-width: 0; flex: 1 1 0; }
.ll-kpi-spark { flex-direction: column; align-items: stretch; gap: 8px; }
.ll-kpi-spark .ll-delta { align-self: flex-start; }
.ll-bars-zero { stroke: var(--rule-strong); stroke-width: 1; }

/* Bank Feeds review (templates/bankfeed/account.html, line.html) */
.ll-bank-balances { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 8px; }
.ll-bank-balances span { display: flex; flex-direction: column; gap: 1px; }
.ll-bank-balances small { color: var(--ink-3); font-size: 12px; }
.ll-bank-balances b { color: var(--ink); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ll-bank-balances em { color: var(--ink-3); font-size: 12px; font-style: normal; }
.ll-col-check { width: 36px; }
.ll-bank-desc { display: flex; flex-direction: column; gap: 1px; color: var(--ink); text-decoration: none; }
.ll-bank-desc b { font-weight: 550; }
.ll-bank-desc small { color: var(--ink-3); font-size: 12px; }
a.ll-bank-desc:hover b { color: var(--accent); text-decoration: underline; }
.ll-bank-sugg { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 12.5px; font-weight: 500; }
.ll-bank-sugg.is-match { background: var(--ok-soft); color: var(--ok); }
.ll-bank-sugg.is-rule { background: var(--accent-soft); color: var(--accent); }
.ll-bank-batchbar { position: sticky; top: calc(var(--head-h) + 6px); z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; padding: 8px 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius-card); background: var(--paper); box-shadow: var(--shadow-2); }
.ll-bank-batchbar[hidden] { display: none; }
.ll-bank-reconcile { margin-top: 20px; }
.ll-bank-reconcile-body { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.ll-bank-reconcile-body .qb-form-group { margin: 0; }
.ll-bank-back { margin-bottom: 12px; font-size: 13px; }
.ll-bank-back a { color: var(--ink-2); text-decoration: none; }
.ll-bank-back a:hover { color: var(--accent); }
.ll-bank-summary { margin-bottom: 16px; }
.ll-bank-summary-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; }
.ll-bank-summary-what h2 { margin: 6px 0 2px; font-size: 20px; font-weight: 600; letter-spacing: -.016em; }
.ll-bank-summary-what p { margin: 0; color: var(--ink-3); }
.ll-bank-summary-amount { display: flex; flex-direction: column; align-items: flex-end; }
.ll-bank-summary-amount small { color: var(--ink-3); font-size: 12px; }
.ll-bank-summary-amount b { font-size: 26px; font-weight: 600; letter-spacing: -.024em; font-variant-numeric: tabular-nums; }
.ll-bank-search { margin-bottom: 12px; }
.ll-bank-search input { width: min(420px, 100%); }
.ll-bank-group { margin-bottom: 14px; }
.ll-bank-group tr.is-likely td:nth-child(3) { font-weight: 550; }
.ll-bank-group tr.is-picked { background: var(--accent-soft); }
.ll-col-pay { width: 140px; }
.ll-col-pay input { width: 120px; text-align: right; }
.ll-bank-foot { flex-wrap: wrap; }
.ll-bank-tally { display: flex; gap: 24px; order: 2; margin-left: auto; }
.ll-bank-tally span { display: flex; flex-direction: column; align-items: flex-end; }
.ll-bank-tally small { color: var(--ink-3); font-size: 12px; }
.ll-bank-tally b { font-variant-numeric: tabular-nums; font-weight: 600; }
.ll-bank-diff.is-off b, .ll-bank-tally-inline .is-off { color: var(--red); }
.ll-bank-diffpick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; order: 3; flex-basis: 100%; }
.ll-bank-diffpick[hidden] { display: none; }
.ll-bank-add-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.ll-bank-splits input, .ll-bank-splits select { width: 100%; }
.ll-bank-splits td:nth-last-child(2) input { text-align: right; }
.ll-bank-split-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 14px; }
.ll-bank-tally-inline { color: var(--ink-3); }
.ll-bank-tally-inline b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ll-bank-rule-opt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--ink-2); }
.ll-bank-rule-opt input[name="rule_text"] { width: 200px; }
.qb-card-footer { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--rule); }
.ll-bank-exclude { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.ll-bank-pad { padding: 0 20px; }
.ll-bank-books > summary { cursor: pointer; list-style: none; }
.ll-bank-books > summary::-webkit-details-marker { display: none; }
.ll-bank-books > summary .bi { color: var(--ink-3); transition: transform .15s; }
.ll-bank-books[open] > summary .bi { transform: rotate(180deg); }
.ll-bank-books:not([open]) > summary { border-bottom: 0; }
.ll-bank-badge { margin-right: 6px; height: 18px; padding: 0 6px; font-size: 10.5px; }
.qb-reg-cleared { width: 48px; }
.ll-cr { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; font-size: 11px; font-weight: 650; }
.ll-cr-c { background: var(--blue-soft); color: var(--blue); }
.ll-cr-r { background: var(--ok-soft); color: var(--ok); }
.ll-reconciled-box .qb-card-body { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .ll-reconciled-box .ll-hint { flex-basis: 100%; }
