:root {
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    --desk: #e7e5dd;
    --paper: #fff;
    --ink: #1c2b2a;
    --ink-2: #5c6665;
    --ink-3: #8a9291;
    --rule: #e8e6de;
    --rule-2: #f0efe9;
    --brand: #0e6e5c;
    --pos: #2f8f6f;
    --warn: #c0871f;
    --alert: #b85440;
    --pos-bg: #e7f2ec;
    --warn-bg: #f7efdd;
    --alert-bg: #f6e6e1;
    /* Noto JP when the web app provides it (self-hosted); otherwise the system's
       Japanese fonts — a downloaded report makes no external requests. */
    --sans: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
    --serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", Georgia, serif;
}

* {
    box-sizing: inherit
}

html {
    -webkit-text-size-adjust: 100%
}

body {
    margin: 0;
    background: var(--desk);
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.7;
    font-feature-settings: "palt" 1;
    padding: 32px 16px 72px
}

.num {
    font-feature-settings: "tnum" 1;
    font-variant-numeric: tabular-nums
}

.sheet {
    max-width: 860px;
    margin: 0 auto;
    background: var(--paper);
    border: 1px solid var(--rule);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .02), 0 18px 48px -24px rgba(28, 43, 42, .28);
    padding: clamp(22px, 4.5vw, 52px)
}

.mark {
    font-size: 12px;
    letter-spacing: .14em;
    color: var(--brand);
    font-weight: 700;
    margin: 0 0 20px
}

.mark span {
    color: var(--ink-3);
    font-weight: 400;
    letter-spacing: .02em;
    margin-left: 8px
}

.biz {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(26px, 5.2vw, 38px);
    line-height: 1.2;
    margin: 0;
    letter-spacing: .01em
}

.biz small {
    display: block;
    font-family: var(--sans);
    font-weight: 500;
    font-size: 14px;
    color: var(--ink-2);
    margin-top: 8px
}

.period .nw {
    white-space: nowrap
}

.period {
    margin: 14px 0 0;
    font-size: 14px;
    color: var(--ink-2);
    font-weight: 500
}

/* "Data not used in this report" (A65): quiet, below the coverage panel */
.not-used {
    margin: 14px 0 0
}

.not-used h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-2);
    margin: 0 0 6px
}

.not-used ul {
    margin: 0;
    padding-left: 1.2em;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--ink-2)
}

/* "Report settings" (A63): a small, quiet section at the very end of the report */
.locale {
    margin: 36px 0 0;
    padding: 14px 0 0;
    border-top: 1px solid var(--rule);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 24px;
    align-items: baseline
}

.locale .lt {
    display: block;
    width: 100%;
    margin: 0 0 2px;
    padding: 0;
    border: 0;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--ink-3)
}

.locale dl {
    margin: 0;
    display: flex;
    gap: 6px;
    align-items: baseline
}

.locale dt {
    font-size: 11.5px;
    color: var(--ink-3)
}

.locale dd {
    margin: 0;
    font-size: 12px;
    color: var(--ink-2)
}

.verdict {
    margin: 30px 0 0;
    padding: 20px 22px;
    border-radius: 12px;
    border: 1px solid;
    display: flex;
    gap: 18px;
    align-items: flex-start
}

.verdict.warn {
    background: var(--warn-bg);
    border-color: #ecd9ab
}

.verdict .badge {
    flex: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--warn);
    color: #fff;
    white-space: nowrap;
    margin-top: 4px
}

.verdict p {
    margin: 0;
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(18px, 3.4vw, 23px);
    line-height: 1.5;
    color: #5a4410
}

section {
    margin: 42px 0 0
}

h2 {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: .02em;
    margin: 0 0 16px;
    padding-bottom: 9px;
    border-bottom: 2px solid var(--ink);
    display: inline-block
}

h2 .q {
    color: var(--ink-3);
    font-weight: 500;
    margin-left: 10px;
    /* a subtitle moves to the next line as a whole and wraps in balanced lines, never
       leaving one character on its own line (A89); Japanese breaks between phrases */
    display: inline-block;
    text-wrap: balance;
    word-break: auto-phrase
}

/* glossary */
.glossary {
    margin: 30px 0 0;
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: #faf9f5;
    padding: 20px 22px
}

.glossary .g-head {
    font-size: 13px;
    font-weight: 700;
    color: var(--brand);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px
}

.glossary summary.g-head {
    cursor: pointer;
    list-style: none
}

.glossary summary.g-head::-webkit-details-marker {
    display: none
}

.glossary summary.g-head::after {
    content: "▸";
    margin-left: 2px;
    color: var(--ink-2);
    transition: transform .15s
}

.glossary[open] summary.g-head::after {
    transform: rotate(90deg)
}

.glossary:not([open]) .g-head {
    margin: 0
}

.glossary:not([open]) {
    padding-top: 12px;
    padding-bottom: 12px
}

.glossary .g-head::before {
    content: "?";
    flex: none;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700
}

.glossary dl {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 28px
}

.glossary div {
    display: flex;
    flex-direction: column
}

.glossary dt {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink)
}

.glossary dt .f {
    color: var(--brand)
}

.glossary dd {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--ink-2)
}

.glossary dd .mini {
    color: var(--ink-3)
}

.lead {
    font-size: 15.5px;
    line-height: 1.85;
    margin: 0;
    color: #263635;
    max-width: 68ch
}

.lead b {
    font-weight: 700;
    color: var(--ink)
}

.mark-up {
    color: var(--pos);
    font-weight: 700
}

.mark-dn {
    color: var(--alert);
    font-weight: 700
}

/* Wrapping flex instead of a fixed grid: cards in a short last row stretch to fill
   it, so 4/5-card layouts never leave empty cells. 4 cards → 2×2. */
.kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    background: var(--rule);
    border: 1px solid var(--rule);
    border-radius: 12px;
    overflow: hidden
}

.kpi {
    flex: 1 1 calc((100% - 2px) / 3);
    min-width: 0;
    background: var(--paper);
    padding: 18px
}

.kpis.n4 .kpi {
    flex-basis: calc((100% - 1px) / 2)
}

.kpi .k-label {
    font-size: 12px;
    color: var(--ink-2);
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 9px
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none
}

.dot.pos {
    background: var(--pos)
}

.dot.warn {
    background: var(--warn)
}

.dot.alert {
    background: var(--alert)
}

.kpi .k-val {
    font-size: 27px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.01em
}

/* long values (large-unit currencies, e.g. 1,234,567,890 ₫): smaller type, never cut */
.kpi .k-val.long {
    font-size: 22px
}

.kpi .k-val.xlong {
    font-size: 18px
}

.kpi .k-val .u {
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-2)
}

.kpi .k-sub {
    font-size: 12px;
    color: var(--ink-3);
    margin-top: 7px
}

.kpi .k-sub .up {
    color: var(--pos);
    font-weight: 700
}

.kpi .k-sub .dn {
    color: var(--alert);
    font-weight: 700
}

/* decomposition: customers x spend */
.decomp {
    display: grid;
    grid-template-columns: 1fr 1fr auto 1fr;
    gap: 16px;
    align-items: center;
    border: 1px solid var(--rule);
    border-radius: 12px;
    padding: 22px
}

.decomp .cell {
    text-align: center
}

.decomp .cell .lab {
    font-size: 12px;
    color: var(--ink-2);
    margin-bottom: 6px
}

.decomp .cell .big {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1
}

.decomp .cell .chg {
    font-size: 12.5px;
    margin-top: 5px;
    font-weight: 700
}

.decomp .op {
    font-size: 22px;
    color: var(--ink-3);
    text-align: center;
    font-weight: 700
}

.decomp .eq .big {
    color: var(--brand)
}

.split {
    margin: 16px 0 0;
    display: flex;
    gap: 12px;
    flex-wrap: wrap
}

.split .s {
    flex: 1 1 220px;
    border-left: 3px solid;
    padding: 10px 14px;
    background: #faf9f5;
    border-radius: 0 8px 8px 0;
    font-size: 13.5px;
    line-height: 1.7
}

.split .s.pos {
    border-color: var(--pos)
}

.split .s.neg {
    border-color: var(--alert)
}

.split .s b {
    font-weight: 700
}

svg {
    overflow: visible
}

.chart-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px
}

.chart h3 {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
    margin: 0 0 4px
}

.chart svg,
.full svg {
    width: 100%;
    height: auto;
    display: block
}

.cap {
    font-size: 12.5px;
    color: var(--ink-3);
    margin: 14px 0 0;
    line-height: 1.7
}

.cap b {
    color: var(--ink)
}

.cap .note {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--ink-3);
    line-height: 1.7
}

.cap .note b {
    color: var(--ink-2)
}

.costbar svg {
    width: 100%;
    height: auto;
    display: block
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 16px 0 0;
    font-size: 12px;
    color: var(--ink-2)
}

.legend span {
    display: flex;
    align-items: center;
    gap: 7px
}

.legend i {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex: none
}

.flr {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin: 18px 0 0
}

.flr .chip {
    flex: 1 1 150px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    padding: 13px 15px
}

/* Stacked: label (one line) → value → note (full width) → provisional tag. Label and
   value never wrap; a chip too narrow for them moves to its own row instead. */
.flr .chip .t {
    font-size: 12px;
    color: var(--ink-2);
    margin-bottom: 5px;
    white-space: nowrap
}

.flr .chip .v {
    font-size: 22px;
    font-weight: 700;
    white-space: nowrap
}

.flr .chip .prov {
    display: table;
    margin: 6px 0 0
}

.flr .chip .n {
    font-size: 11.5px;
    color: var(--ink-3);
    margin-top: 3px
}

.flr .chip.warn {
    background: var(--warn-bg);
    border-color: #ecd9ab
}

.insight {
    margin: 18px 0 0;
    padding: 16px 18px;
    border-left: 3px solid var(--alert);
    background: #fbf1ee;
    border-radius: 0 8px 8px 0
}

.insight p {
    margin: 0;
    font-size: 14.5px;
    line-height: 1.8;
    color: #50342e
}

.insight b {
    color: var(--alert)
}

/* profit bridge (ledger / receipt style) */
.pos {
    color: var(--pos)
}

.neg {
    color: var(--alert)
}

.bridge {
    border: 1px solid var(--rule);
    border-radius: 12px;
    overflow: hidden
}

.bridge-head {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: #faf9f5;
    border-bottom: 1px solid var(--rule)
}

.bh-side {
    text-align: center
}

.bh-lab {
    font-size: 12.5px;
    color: var(--ink-2);
    margin-bottom: 5px
}

.bh-val {
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 700;
    line-height: 1
}

.bh-arrow {
    text-align: center
}

.bh-arrow>span {
    font-size: 22px;
    color: var(--ink-3)
}

.bh-delta {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--alert);
    margin-top: 4px;
    white-space: nowrap
}

.bridge-body {
    padding: 6px 20px
}

.bb-group {
    padding: 14px 0
}

.bb-group+.bb-group {
    border-top: 1px solid var(--rule-2)
}

.bb-gh {
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 12px
}

.bb-gh.pos {
    color: var(--pos)
}

.bb-gh.neg {
    color: var(--alert)
}

.bb-row {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) 1.6fr minmax(74px, max-content);
    align-items: center;
    gap: 14px;
    padding: 7px 0
}

.bb-name {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35
}

.bb-name small {
    display: block;
    font-size: 11px;
    color: var(--ink-3);
    font-weight: 400;
    margin-top: 1px
}

.bb-bar {
    display: block;
    height: 16px;
    background: var(--rule-2);
    border-radius: 4px;
    overflow: hidden
}

.bb-bar i {
    display: block;
    height: 100%;
    border-radius: 4px
}

.bb-bar i.pos {
    background: var(--pos)
}

.bb-bar i.neg {
    background: var(--alert)
}

.bb-amt {
    font-size: 15px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap
}

.bb-amt.pos {
    color: var(--pos)
}

.bb-amt.neg {
    color: var(--alert)
}

.bridge-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
    justify-content: flex-end;
    padding: 14px 20px;
    background: #faf9f5;
    border-top: 1px solid var(--rule);
    font-size: 13px;
    color: var(--ink-2)
}

.bridge-foot b {
    font-size: 15px
}

/* gauges → horizontal signal bars */
.gauges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px
}

.gauge {
    border: 1px solid var(--rule);
    border-radius: 12px;
    padding: 18px 20px 16px
}

.sg-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px
}

.sg-head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700
}

.sg-val {
    font-size: 26px;
    font-weight: 700;
    line-height: 1
}

.sg-val.alert {
    color: var(--alert)
}

.sg-val.warn {
    color: var(--warn)
}

.sg-val.pos {
    color: var(--pos)
}

.sg-track {
    position: relative;
    display: flex;
    height: 14px;
    border-radius: 7px;
    margin-bottom: 2px
}

.sg-zone {
    height: 100%
}

.sg-zone:first-child {
    border-radius: 7px 0 0 7px
}

.sg-zone:last-child {
    border-radius: 0 7px 7px 0
}

.sg-ptr {
    position: absolute;
    top: -7px;
    width: 0;
    height: 0;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--ink)
}

.sg-ptr::after {
    content: "";
    position: absolute;
    left: -1px;
    top: 7px;
    width: 2px;
    height: 16px;
    background: var(--ink)
}

.sg-scale {
    position: relative;
    height: 16px;
    margin-top: 9px;
    font-size: 11px;
    color: var(--ink-3)
}

.sg-scale>span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    white-space: nowrap
}

.sg-scale>span:first-child {
    left: 0;
    transform: none
}

.sg-scale>span.r {
    left: auto;
    right: 0;
    transform: none
}

.gauge .money {
    font-size: 13px;
    color: #50342e;
    margin: 16px 0 0;
    line-height: 1.65
}

.gauge .money b {
    font-weight: 700
}

.gauge .extra {
    font-size: 12px;
    color: var(--alert);
    margin: 8px 0 0;
    font-weight: 500;
    line-height: 1.6
}

/* links inside the report (the web view's settings link) use the design's link colour */
a.settings-link {
    color: var(--brand)
}

/* CVP */
.cvp {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 22px;
    align-items: center
}

.cvp .be-fig {
    border: 1px solid var(--rule);
    border-radius: 12px;
    padding: 18px
}

.cvp .be-fig .row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 7px 0;
    font-size: 14px
}

.cvp .be-fig .row+.row {
    border-top: 1px solid var(--rule-2)
}

.cvp .be-fig .row .v {
    font-weight: 700;
    font-size: 16px
}

/* the margin's colour follows its zone (A70) */
.cvp .be-fig .row.margin.pos .v {
    color: var(--pos)
}

.cvp .be-fig .row.margin.warn .v {
    color: var(--warn)
}

.cvp .be-fig .row.margin.alert .v {
    color: var(--alert)
}

.cvp .be-zone {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0 0;
    font-size: 12.5px;
    color: var(--ink-2)
}

.cvp .be-cust {
    border: 1px solid var(--rule);
    border-radius: 12px;
    padding: 14px 18px;
    margin: 12px 0 0;
    background: var(--rule-2)
}

.cvp .be-cust p {
    margin: 0
}

.cvp .be-cust .bc-h {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-2);
    margin-bottom: 6px
}

.cvp .be-cust .bc-main {
    font-size: 14.5px;
    line-height: 1.75
}

.cvp .be-cust .bc-main b {
    white-space: nowrap
}

.cvp .be-cust .bc-ref {
    font-size: 13px;
    color: var(--ink-2);
    margin-top: 6px
}

.cvp .be-cust .bc-note {
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--ink-3);
    margin-top: 8px
}

.cvp .be-note {
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--ink-2);
    margin: 12px 0 0
}

/* month-end cash (A87): the figure box, the chart, the cash-vs-profit table */
.cash {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    align-items: center
}

.cash.with-chart {
    grid-template-columns: 1fr 1.15fr
}

.cash .cash-fig {
    border: 1px solid var(--rule);
    border-radius: 12px;
    padding: 16px 18px
}

.cash .row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 12px;
    padding: 7px 0;
    font-size: 13.5px
}

.cash .row+.row {
    border-top: 1px solid var(--rule-2)
}

.cash .row .v {
    font-weight: 700;
    font-size: 15px;
    margin-left: auto;
    text-align: right
}

.cash .row.hl .v {
    font-size: 17px
}

.cash .row.hl.pos .v {
    color: var(--pos)
}

.cash .row.hl.warn .v {
    color: var(--warn)
}

.cash .row.hl.alert .v {
    color: var(--alert)
}

.cash .cash-zone {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 0;
    font-size: 12.5px;
    color: var(--ink-2)
}

.cash .cash-guide,
.cash .cash-basis {
    margin: 6px 0 0;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--ink-2)
}

.cash .cash-basis {
    color: var(--ink-3)
}

.cash-table-wrap {
    margin: 16px 0 0
}

.cash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px
}

.cash-table caption {
    text-align: left;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-2);
    margin-bottom: 6px
}

.cash-table th,
.cash-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--rule-2);
    text-align: right;
    white-space: nowrap
}

.cash-table th:first-child {
    text-align: left
}

.cash-table thead th {
    font-weight: 600;
    color: var(--ink-2);
    white-space: normal;
    vertical-align: bottom
}

.cash-table td.up {
    color: var(--pos)
}

.cash-table td.dn {
    color: var(--alert)
}

.conf.extended {
    margin-top: 12px
}

.conf.extended .ext-h {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-2)
}

.conf.extended .ext-h .note {
    font-weight: 400
}

/* sales by time of day (A88): per-slot table with share-of-sales vs share-of-hours bars,
   and a month × slot view; shading follows the activity index, the share is always written */
.tod-since {
    margin: 0 0 10px
}

.tod-table,
.tod-heat {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px
}

.tod-table th,
.tod-table td,
.tod-heat th,
.tod-heat td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--rule-2);
    text-align: right;
    vertical-align: middle
}

.tod-table th:first-child,
.tod-heat th:first-child {
    text-align: left
}

.tod-table thead th,
.tod-heat thead th {
    font-weight: 600;
    color: var(--ink-2);
    vertical-align: bottom
}

.tod-table td .v {
    white-space: nowrap
}

.tod-table tr.quiet th {
    color: var(--warn)
}

.tod-bars {
    display: grid;
    gap: 2px;
    margin: 4px 0 0 auto;
    width: 7.5em
}

.tod-bars i {
    display: block;
    height: 5px;
    border-radius: 3px
}

.tod-bars i.s {
    background: var(--brand)
}

.tod-bars i.h {
    background: var(--ink-3);
    opacity: .45
}

.tod-table td.lv-lo,
.tod-heat td.lv-lo {
    background: #f4f2ea
}

.tod-table td.lv-hi,
.tod-heat td.lv-hi {
    background: #b9d9cb
}

.tod-heat-wrap {
    margin: 16px 0 0;
    overflow-x: auto
}

.tod-heat caption {
    text-align: left;
    text-wrap: balance;
    word-break: auto-phrase;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-2);
    margin-bottom: 6px
}

.tod-heat td {
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums
}

.tod-heat td small.act {
    display: block;
    font-size: 10.5px;
    color: var(--ink-2)
}

.tod-legend {
    margin: 6px 0 0
}

/* sales by item (A89): ranked table; the class is a letter, never colour alone */
.items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px
}

.items-table th,
.items-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--rule-2);
    text-align: right;
    vertical-align: middle
}

.items-table th:first-child {
    text-align: left
}

.items-table thead th {
    font-weight: 600;
    color: var(--ink-2);
    vertical-align: bottom
}

.items-table td .v {
    white-space: nowrap
}

.items-table td.abc {
    text-align: center;
    font-weight: 700
}

.items-table td.abc-a {
    color: var(--brand)
}

.items-table tr.other th,
.items-table tr.other td {
    color: var(--ink-2)
}

.items-bar {
    display: block;
    margin: 4px 0 0 auto;
    width: 7.5em;
    height: 5px;
    border-radius: 3px;
    background: var(--rule-2)
}

.items-bar i {
    display: block;
    height: 5px;
    border-radius: 3px;
    background: var(--brand)
}

/* annual outlook (A53) */
.outlook {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 22px;
    align-items: center
}

.outlook .ol-fig {
    border: 1px solid var(--rule);
    border-radius: 12px;
    padding: 16px 18px
}

.outlook .ol-period {
    margin: 0 0 6px;
    font-size: 12.5px;
    color: var(--ink-2)
}

.outlook .row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 12px;
    padding: 7px 0;
    font-size: 13.5px
}

.outlook .row+.row {
    border-top: 1px solid var(--rule-2)
}

.outlook .row .v {
    font-weight: 700;
    font-size: 15px;
    margin-left: auto;
    text-align: right
}

.outlook .row.hl .v {
    color: var(--brand);
    font-size: 17px
}

/* A56: a very uncertain outlook — the headline range is shown, but not as a headline */
.outlook .row.hl.weak .v {
    color: var(--ink-2);
    font-size: 15px;
    font-weight: 500
}

.outlook .ol-caveat {
    margin: 2px 0 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--warn-bg);
    font-size: 13px;
    line-height: 1.6
}

.outlook .ol-vs {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--ink-2)
}

.outlook .ol-chart svg {
    width: 100%;
    height: auto;
    display: block
}

/* simulation */
.sim {
    border: 1px solid var(--brand);
    border-radius: 14px;
    overflow: hidden
}

.sim .sim-head {
    background: #eef5f2;
    padding: 16px 20px;
    border-bottom: 1px solid #d3e4de
}

.sim .sim-head p {
    margin: 0;
    font-size: 14px;
    color: #1d3b36
}

.sim .sim-head b {
    font-weight: 700
}

.sim-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px dashed var(--rule);
    background: #fff
}

.sp-lab {
    width: 100%;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-2)
}

.sp-chip {
    flex: 1 1 180px;
    text-align: left;
    border: 1px solid var(--rule);
    background: #faf9f5;
    border-radius: 10px;
    padding: 10px 13px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    line-height: 1.3;
    transition: border-color .12s, background .12s
}

.sp-chip small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--ink-3);
    margin-top: 3px
}

.sp-chip:hover {
    border-color: var(--brand)
}

.sp-chip.active {
    border-color: var(--brand);
    background: var(--pos-bg)
}

.sp-chip.active small {
    color: #2c6a56
}

.sim .sim-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    padding: 22px 20px
}

.lever label {
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 10px
}

.lever label .lv {
    color: var(--brand);
    font-variant-numeric: tabular-nums
}

.lever input[type=range] {
    width: 100%;
    margin: 0;
    accent-color: var(--brand);
    height: 4px
}

.lever .hint {
    font-size: 11.5px;
    color: var(--ink-3);
    margin-top: 8px;
    min-height: 2.4em
}

.sim-out {
    grid-column: 1/-1;
    border-top: 1px dashed var(--rule);
    padding-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    align-items: end
}

.sim-out .o {
    text-align: center
}

.sim-out .o .lab {
    font-size: 12px;
    color: var(--ink-2);
    margin-bottom: 6px
}

.sim-out .o .big {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: var(--brand)
}

.sim-out .o .big .u {
    font-size: 15px;
    color: var(--ink-2)
}

.sim-out .o .sm {
    font-size: 12.5px;
    margin-top: 6px;
    font-weight: 700
}

.sim-goal {
    grid-column: 1/-1;
    margin-top: 4px;
    font-size: 13.5px;
    text-align: center;
    padding: 12px;
    border-radius: 10px;
    background: #faf9f5;
    line-height: 1.6
}

.sim-goal.hit {
    background: var(--pos-bg);
    color: #1c5c45;
    font-weight: 700
}

.acts {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: a
}

.acts li {
    counter-increment: a;
    position: relative;
    padding: 16px 0 16px 46px;
    border-top: 1px solid var(--rule)
}

.acts li:first-child {
    border-top: none
}

.acts li::before {
    content: counter(a);
    position: absolute;
    left: 0;
    top: 16px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center
}

.acts h4 {
    margin: 0;
    font-size: 15.5px;
    font-weight: 700
}

.acts p {
    margin: 0;
    font-size: 14px;
    line-height: 1.75;
    color: var(--ink-2)
}

.acts p b {
    color: var(--brand);
    font-weight: 700
}

.act-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px
}

.acts-legend {
    font-size: 12.5px;
    color: var(--ink-2);
    margin: 0 0 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    line-height: 1.7
}

.tag {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap
}

.tag.now {
    background: var(--pos-bg);
    color: #1c5c45
}

.tag.need {
    background: var(--warn-bg);
    color: #8a6414
}

.acts li.gated::before {
    background: var(--warn)
}

.substeps {
    counter-reset: ss;
    list-style: none;
    margin: 10px 0 0;
    padding: 0
}

.substeps li {
    counter-increment: ss;
    position: relative;
    padding: 5px 0 5px 28px;
    font-size: 13.5px;
    color: var(--ink-2);
    border: none;
    line-height: 1.6
}

.substeps li::before {
    content: counter(ss);
    position: absolute;
    left: 0;
    top: 5px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: var(--warn-bg);
    color: #8a6414;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center
}

.warnline {
    margin: 10px 0 0 !important;
    padding: 10px 13px;
    background: #fbf1ee;
    border-left: 3px solid var(--alert);
    border-radius: 0 8px 8px 0;
    font-size: 13px !important;
    color: #50342e !important;
    line-height: 1.7 !important
}

.warnline b {
    color: var(--alert) !important
}

/* data confidence */
.conf {
    border: 1px solid var(--rule);
    border-radius: 12px;
    padding: 18px 20px
}

.conf-top {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px
}

.conf-bar {
    flex: 1 1 160px;
    height: 9px;
    border-radius: 999px;
    background: var(--rule);
    overflow: hidden;
    min-width: 140px
}

.conf-bar i {
    display: block;
    height: 100%;
    background: var(--warn);
    border-radius: 999px
}

.conf-score {
    font-size: 14px;
    font-weight: 700;
    color: var(--warn)
}

.conf ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px
}

.conf li {
    font-size: 13px;
    display: flex;
    gap: 9px;
    align-items: flex-start;
    line-height: 1.5
}

.conf li .ic {
    flex: none;
    font-weight: 700;
    width: 16px
}

.conf li.ok .ic {
    color: var(--pos)
}

.conf li.est .ic {
    color: var(--warn)
}

.conf li.no .ic {
    color: var(--ink-3)
}

.conf li.no {
    color: var(--ink-3)
}

.foot {
    margin: 44px 0 0;
    padding: 20px 0 0;
    border-top: 1px solid var(--rule);
    font-size: 12px;
    color: var(--ink-3);
    line-height: 1.8
}

.foot .gen {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--brand);
    font-weight: 500
}

.foot .gen::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand)
}

@media(max-width:640px) {
    .glossary dl {
        grid-template-columns: 1fr
    }

    .kpis .kpi,
    .kpis.n4 .kpi {
        flex-basis: calc((100% - 1px) / 2)
    }

    .chart-wrap,
    .gauges,
    .cvp,
    .outlook,
    .cash.with-chart,
    .sim .sim-body {
        grid-template-columns: 1fr
    }

    /* the cash table becomes one card per month on phones */
    .cash-table thead {
        display: none
    }

    .cash-table caption {
        display: block;
        width: 100%
    }

    .cash-table,
    .cash-table tbody,
    .cash-table tr,
    .cash-table th,
    .cash-table td {
        display: block;
        width: 100%
    }

    .cash-table tr {
        border: 1px solid var(--rule);
        border-radius: 10px;
        padding: 6px 10px;
        margin: 0 0 8px
    }

    .cash-table th,
    .cash-table td {
        border: 0;
        padding: 3px 0;
        text-align: left;
        white-space: normal
    }

    .cash-table td {
        display: flex;
        justify-content: space-between;
        gap: 12px
    }

    .cash-table td::before {
        content: attr(data-label);
        color: var(--ink-2);
        font-weight: 400
    }

    /* the time-of-day table becomes one card per time slot on phones */
    .tod-table thead {
        display: none
    }

    .tod-table,
    .tod-table tbody,
    .tod-table tr,
    .tod-table th,
    .tod-table td {
        display: block;
        width: 100%
    }

    .tod-table tr {
        border: 1px solid var(--rule);
        border-radius: 10px;
        padding: 6px 10px;
        margin: 0 0 8px
    }

    .tod-table th,
    .tod-table td {
        border: 0;
        padding: 3px 0;
        text-align: left
    }

    .tod-table td {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 4px 12px
    }

    .tod-table td::before {
        content: attr(data-label);
        color: var(--ink-2);
        font-weight: 400
    }

    .tod-table td .tod-bars {
        width: 100%
    }

    .tod-heat {
        font-size: 11.5px
    }

    .tod-heat th,
    .tod-heat td {
        padding: 5px 3px
    }

    /* the item table becomes one card per item on phones */
    .items-table thead {
        display: none
    }

    .items-table,
    .items-table tbody,
    .items-table tr,
    .items-table th,
    .items-table td {
        display: block;
        width: 100%
    }

    .items-table tr {
        border: 1px solid var(--rule);
        border-radius: 10px;
        padding: 6px 10px;
        margin: 0 0 8px
    }

    .items-table th,
    .items-table td {
        border: 0;
        padding: 3px 0;
        text-align: left
    }

    .items-table td {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 4px 12px
    }

    .items-table td::before {
        content: attr(data-label);
        color: var(--ink-2);
        font-weight: 400
    }

    .items-table td .items-bar {
        width: 100%
    }

    /* an amount never wraps (the minus sign stays with its number) */
    .cash-table td .v {
        white-space: nowrap;
        text-align: right;
        align-self: flex-end
    }

    .decomp {
        grid-template-columns: 1fr;
        gap: 10px
    }

    .decomp .op {
        display: none
    }

    .sim-out {
        grid-template-columns: 1fr
    }

    .conf ul {
        grid-template-columns: 1fr
    }

    .verdict {
        flex-direction: column;
        gap: 12px
    }

    .bb-row {
        grid-template-columns: 1fr auto;
        gap: 4px 12px
    }

    .bb-bar {
        grid-column: 1/-1;
        order: 3
    }

    .bridge-head {
        grid-template-columns: 1fr;
        gap: 3px
    }

    .bh-arrow>span {
        display: inline-block;
        transform: rotate(90deg)
    }

    .bh-val {
        font-size: 27px
    }

    .bridge-foot {
        justify-content: space-between
    }
}

@media(max-width:380px) {
    .kpis .kpi,
    .kpis.n4 .kpi {
        flex-basis: 100%
    }
}

@media(prefers-reduced-motion:reduce) {
    * {
        transition: none !important
    }
}

/* ---- Shopwise additions (states the sample did not need) ---- */
.verdict.pos {
    background: var(--pos-bg);
    border-color: #bfe0d2
}

.verdict.pos .badge {
    background: var(--pos)
}

.verdict.pos p {
    color: #1c5c45
}

.verdict.alert {
    background: var(--alert-bg);
    border-color: #e3b1a6
}

.verdict.alert .badge {
    background: var(--alert)
}

.verdict.alert p {
    color: #50342e
}

.conf-bar i.pos {
    background: var(--pos)
}

.conf-bar i.alert {
    background: var(--alert)
}

.conf-score.pos {
    color: var(--pos)
}

.conf-score.alert {
    color: var(--alert)
}

.narr-missing {
    font-size: 12.5px;
    color: var(--ink-3);
    margin: 0;
    padding: 10px 13px;
    border: 1px dashed var(--rule);
    border-radius: 8px
}

.bh-delta.pos {
    color: var(--pos)
}

.verdict .narr-missing {
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--ink-3);
    align-self: center
}

.flr .chip.alert {
    background: var(--alert-bg);
    border-color: #e3b1a6
}

/* provisional benchmark tag (SPEC Amendment A18) */
.prov {
    display: inline-block;
    margin-left: 2px;
    padding: 0 6px;
    border: 1px dashed var(--ink-3);
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--ink-2);
    white-space: nowrap;
    vertical-align: 1px
}
