/*
 * Coding Ireland proprietary interactive activity
 * Copyright (c) 2017-2026 Coding Ireland. All rights reserved.
 *
 * Part of the Coding Ireland online learning platform. Licensed for use only
 * as delivered on the platform. Copying, redistributing, or adapting this
 * file, in whole or in part, for use in any other product or service is not
 * permitted. Ref: CI-maths-bill-receipt-breakdown
 */
/*
 * bill-receipt-breakdown — an itemised bill where every charge shows its own
 * arithmetic, with a standing charge and VAT visible as their own lines.
 */

.maths-activity .br-layout {
    display: grid;
    grid-template-columns: 1fr minmax(230px, 300px);
    gap: 1.5rem;
    align-items: start;
}

/* ---- The document ---- */

.maths-activity .br-doc {
    background: #fff;
    border: 1px solid #e2e8f2;
    border-radius: 14px;
    padding: 1rem 1.15rem 0.5rem;
    box-shadow: 0 2px 10px rgba(35, 41, 58, 0.05);
}

.maths-activity .br-doc-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    border-bottom: 2px solid #eef2f8;
    padding-bottom: 0.6rem;
    margin-bottom: 0.4rem;
}

.maths-activity .br-supplier {
    font-weight: 800;
    font-size: 1.1rem;
    color: #23293a;
}

.maths-activity .br-doc-meta {
    font-size: 0.85rem;
    color: #8b94ad;
    font-weight: 600;
    text-align: right;
}

.maths-activity .br-table {
    width: 100%;
    border-collapse: collapse;
}

.maths-activity .br-table thead th {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #8b94ad;
    text-align: left;
    padding: 0.4rem 0.35rem;
    border-bottom: 1px solid #eef2f8;
}

.maths-activity .br-table .br-num {
    text-align: right;
}

.maths-activity .br-line th,
.maths-activity .br-line td {
    padding: 0.55rem 0.35rem;
    border-bottom: 1px solid #f2f5fa;
    vertical-align: top;
}

.maths-activity .br-line-name {
    text-align: left;
    font-weight: 700;
    color: #23293a;
    display: block;
}

.maths-activity .br-line-note {
    display: block;
    font-weight: 600;
    font-size: 0.78rem;
    color: #8b94ad;
    margin-top: 0.1rem;
}

.maths-activity .br-working {
    color: #47506b;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.maths-activity .br-amount {
    font-weight: 800;
    color: #23293a;
    white-space: nowrap;
}

.maths-activity .br-line-percent {
    background: #fdf8ec;
}

.maths-activity .br-subtotal th,
.maths-activity .br-subtotal td {
    padding: 0.35rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #6b7590;
    border-bottom: 1px dashed #e2e8f2;
    text-align: left;
}

.maths-activity .br-subtotal .br-num {
    text-align: right;
}

.maths-activity .br-total th,
.maths-activity .br-total td {
    padding: 0.7rem 0.35rem;
    border-top: 2px solid #23293a;
    font-weight: 800;
    font-size: 1.05rem;
    color: #23293a;
    text-align: left;
}

.maths-activity .br-total .br-num {
    text-align: right;
}

.maths-activity .br-edit-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.maths-activity .br-edit {
    width: 5rem;
    border: 2px solid #d7deeb;
    border-radius: 8px;
    padding: 0.2rem 0.4rem;
    font: inherit;
    font-weight: 700;
    text-align: right;
    color: #23293a;
    background: #fff;
}

.maths-activity .br-edit:focus {
    outline: none;
    border-color: #2f7d6d;
}

/* ---- Side panel ---- */

.maths-activity .br-side {
    background: #f7f9fc;
    border: 1px solid #e2e8f2;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.maths-activity .br-side-head {
    font-weight: 800;
    color: #47506b;
}

.maths-activity .br-split {
    display: flex;
    height: 26px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #d7deeb;
    background: #eef2f8;
}

.maths-activity .br-split-seg {
    transition: width 0.18s ease;
}

.maths-activity .br-split-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #47506b;
}

.maths-activity .br-split-legend li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.maths-activity .br-swatch {
    width: 13px;
    height: 13px;
    border-radius: 4px;
    flex: none;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.maths-activity .br-vat-tools {
    border-top: 1px solid #e2e8f2;
    padding-top: 0.7rem;
}

.maths-activity .br-vat-head {
    font-weight: 800;
    color: #47506b;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.maths-activity .br-vat-note {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #47506b;
}

/* ---- Target + your turn ---- */

.maths-activity .br-target-panel {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.maths-activity .br-target-label {
    font-weight: 800;
    color: #2f7d6d;
}

.maths-activity .br-target-prompt {
    font-weight: 600;
    color: #23293a;
}

.maths-activity .br-callout.is-correct {
    color: #1d6b4f;
    font-weight: 700;
}

.maths-activity .br-callout.is-wrong {
    color: #a33a2a;
    font-weight: 700;
}

.maths-activity .br-mode-chip {
    display: inline-block;
    margin-top: 0.4rem;
    background: #eef2f8;
    color: #47506b;
    border-radius: 999px;
    padding: 0.15rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.maths-activity .br-your-turn {
    margin-top: 1.1rem;
    border: 1px dashed #c9d3e4;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    background: #fbfcfe;
}

.maths-activity .br-your-turn-label {
    font-weight: 800;
    color: #47506b;
    margin-bottom: 0.35rem;
}

.maths-activity .br-your-turn-list {
    margin: 0;
    padding-left: 1.15rem;
}

/* ---- Display mode ---- */

body.display-mode .br-target-panel,
body.display-mode .br-callout,
body.display-mode .br-your-turn,
body.display-mode #challengeRunner {
    display: none !important;
}

body.display-mode .br-layout {
    grid-template-columns: 1fr minmax(200px, 250px);
    gap: 1rem;
}

body.display-mode .br-doc {
    padding: 0.75rem 0.85rem 0.35rem;
}

body.display-mode .br-line th,
body.display-mode .br-line td {
    padding: 0.4rem 0.3rem;
}

body.display-mode .br-total th,
body.display-mode .br-total td {
    padding: 0.55rem 0.3rem;
    font-size: 0.98rem;
}

body.display-mode .br-side {
    padding: 0.75rem 0.85rem;
}

@media (max-width: 880px) {
    .maths-activity .br-layout {
        grid-template-columns: 1fr;
    }
    .maths-activity .br-working {
        white-space: normal;
    }
}
