    :root {
        --ink: #1B2A41;
        --paper: #FBF9F6;
        --slate: #3A3F44;
        --slate-60: #7A8087;
        --hairline: #D8D3C8;
        --brass-bg: #F2E9DF;
    }

    * {
        box-sizing: border-box;
    }

    html, body {
        margin: 0;
        background: #E9E6DF;
        color: var(--slate);
        font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    }

    /* ---- page shell: list on the left, invoice on the right ---- */
    .app {
        display: flex;
        max-width: 1100px;
        margin: 24px auto;
        gap: 20px;
        align-items: flex-start;
        padding: 0 20px;
    }

    .list-panel {
        width: 260px;
        background: var(--paper);
        border-radius: 6px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
        overflow: hidden;
        flex-shrink: 0;
    }

    .list-panel h2 {
        margin: 0;
        padding: 16px 18px;
        font-size: 13px;
        letter-spacing: .04em;
        color: var(--slate-60);
        border-bottom: 1px solid var(--hairline);
    }

    .invoice-row {
        padding: 14px 18px;
        border-bottom: 1px solid var(--hairline);
        cursor: pointer;
        font-size: 14px;
    }

    .invoice-row:hover {
        background: var(--brass-bg);
    }

    .invoice-row.active {
        background: var(--brass-bg);
        border-left: 3px solid var(--ink);
        padding-left: 15px;
    }

    .invoice-row .num {
        font-weight: 600;
        color: var(--ink);
    }

    .invoice-row .client {
        color: var(--slate-60);
        font-size: 12.5px;
        margin-top: 2px;
    }

    .invoice-panel {
        flex: 1;
        min-width: 0;
    }

    .toolbar {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        margin-bottom: 12px;
    }

    .toolbar button {
        font-family: inherit;
        font-size: 14px;
        border-radius: 5px;
        padding: 10px 18px;
        cursor: pointer;
        border: 1px solid var(--ink);
        background: var(--ink);
        color: var(--paper);
    }

    .toolbar button.secondary {
        background: transparent;
        color: var(--ink);
    }

    .toolbar button:disabled {
        opacity: .5;
        cursor: wait;
    }

    /* ---- the invoice itself, now inside #invoiceContainer ---- */
    #invoiceContainer {
        background: var(--paper);
        padding: 56px 56px 48px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 10px 30px rgba(0, 0, 0, .06);
    }

    .head {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 24px;
        padding-bottom: 28px;
        border-bottom: 2px solid var(--ink);
    }

    .brand .biz-name {
        font-family: 'Source Serif 4', Georgia, serif;
        font-size: 26px;
        font-weight: 600;
        color: var(--ink);
    }

    .brand .biz-details {
        margin-top: 8px;
        font-size: 13px;
        line-height: 1.6;
        color: var(--slate-60);
        white-space: pre-line;
    }

    .meta {
        text-align: right;
    }

    .meta .label {
        font-family: 'Source Serif 4', Georgia, serif;
        font-size: 22px;
        color: var(--ink);
    }

    .meta-row {
        margin-top: 10px;
        font-size: 13px;
        display: flex;
        justify-content: flex-end;
        gap: 8px;
    }

    .meta-row .k {
        color: var(--slate-60);
    }

    .parties {
        display: flex;
        gap: 40px;
        margin-top: 32px;
    }

    .party {
        flex: 1;
    }

    .party h3 {
        margin: 0 0 8px;
        font-size: 11px;
        letter-spacing: .06em;
        color: var(--slate-60);
        font-weight: 600;
    }

    .party .line {
        font-size: 14px;
        line-height: 1.6;
    }

    table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 36px;
    }

    thead th {
        text-align: left;
        font-size: 11px;
        letter-spacing: .06em;
        color: var(--slate-60);
        font-weight: 600;
        padding: 0 8px 10px;
        border-bottom: 1px solid var(--ink);
    }

    thead th.num {
        text-align: right;
    }

    tbody td {
        padding: 14px 8px;
        border-bottom: 1px solid var(--hairline);
        font-size: 14px;
    }

    td.num {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    .totals {
        margin-top: 8px;
        margin-left: auto;
        width: 260px;
    }

    .totals-row {
        display: flex;
        justify-content: space-between;
        padding: 9px 8px;
        font-size: 14px;
    }

    .totals-row.subtotal {
        color: var(--slate-60);
    }

    .totals-row.grand {
        margin-top: 4px;
        background: var(--brass-bg);
        border-radius: 4px;
        font-family: 'Source Serif 4', Georgia, serif;
        font-size: 18px;
        color: var(--ink);
        font-weight: 600;
    }

    .notes {
        margin-top: 40px;
        padding-top: 20px;
        border-top: 1px solid var(--hairline);
        font-size: 13px;
        color: var(--slate);
        line-height: 1.6;
    }

    .notes h3 {
        margin: 0 0 8px;
        font-size: 11px;
        letter-spacing: .06em;
        color: var(--slate-60);
        font-weight: 600;
    }

    /* ---- THIS is what makes print show only the invoice ----
       Everything is hidden by default when printing; the container
       and its contents are switched back to visible and pulled to
       the top of the page. */
    @media print {
        body * {
            visibility: hidden;
        }

        #invoiceContainer, #invoiceContainer * {
            visibility: visible;
        }

        #invoiceContainer {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            box-shadow: none;
            padding: 24px;
        }

        .list-panel, .toolbar {
            display: none;
        }
    }