/* Heart Risk app. Same SAP Fiori Horizon tokens and layout as the Supplier Spend app (colours and 72 font stack; font files not bundled). */
:root {
  --brand: #0062D6; --brand-dark: #004BB0; --text: #1D2D3E; --muted: #556B82; --line: #D9DEE4;
  --bg: #F5F6F7; --card: #FFFFFF; --pos: #256F3A; --crit: #E76500; --neg: #AA0808; --info: #0062D6;
  --brand-soft: #EBF8FF; --crit-soft: #FFF3E8; --radius: 12px;
  --shadow: 0 0 2px rgba(34, 53, 72, 0.12), 0 2px 8px rgba(34, 53, 72, 0.08);
  --font: "72", "72full", Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
button, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem .8rem; z-index: 50; }
.skip:focus { left: .5rem; top: .5rem; }

.shellbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; padding: .55rem 1rem; background: #fff; box-shadow: 0 1px 0 var(--line), 0 2px 6px rgba(34,53,72,.06); }
.sb-brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--text); }
.sb-logo { width: 28px; height: 28px; flex: none; }
.sb-title { font-weight: 700; font-size: 1rem; }
.sb-sub { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-link { margin-left: auto; font-size: .88rem; font-weight: 700; text-decoration: none; padding: .35rem .7rem; border-radius: 8px; }
.sb-link:hover { background: var(--brand-soft); }

.page { max-width: 1240px; margin: 0 auto; padding: .9rem 1rem 1.5rem; }
.strip { display: flex; gap: .6rem; align-items: flex-start; margin: 0 0 .9rem; padding: .55rem .8rem; background: var(--brand-soft); border: 1px solid #A6CFFF; border-radius: 8px; font-size: .88rem; }
.strip-icon { flex: none; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--info); color: #fff; font-weight: 700; font-size: .75rem; display: grid; place-items: center; margin-top: .1rem; }

.filterbar { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: flex-end; padding: .75rem 1rem; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: .9rem; }
.fb-group { display: flex; flex-direction: column; gap: .3rem; }
.fb-label { font-size: .8rem; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--brand); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; color: var(--brand-dark); padding: .4rem .8rem; cursor: pointer; min-width: 3.4rem; }
.seg button + button { border-left: 1px solid var(--brand); }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }
select { border: 1px solid #89919A; border-radius: 8px; padding: .4rem 2rem .4rem .6rem; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23556B82' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right .6rem center / 12px; appearance: none; min-width: 10rem; }

.tabbar { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0 .5rem; margin-bottom: 1rem; }
.tabbar::-webkit-scrollbar { display: none; }
.tabbar button { flex: none; display: inline-flex; align-items: center; gap: .45rem; border: 0; background: none; padding: .8rem .75rem .7rem; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 700; font-size: .9rem; }
.tabbar svg { width: 18px; height: 18px; fill: currentColor; }
.tabbar button:hover { color: var(--text); }
.tabbar button[aria-selected="true"] { color: var(--brand-dark); border-bottom-color: var(--brand); }

main:focus { outline: none; }
.view-in { animation: fadein .22s ease-out both; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.loading { color: var(--muted); }
h1.v-title { font-size: 1.25rem; margin: 0 0 .2rem; }
.v-sub { color: var(--muted); margin: 0 0 1rem; font-size: .92rem; }
.scope { display: inline-block; font-size: .78rem; color: var(--muted); background: #EFF1F2; border-radius: 6px; padding: .1rem .45rem; margin-left: .35rem; vertical-align: middle; font-weight: 400; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.tile { text-align: left; border: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: .85rem .95rem; display: flex; flex-direction: column; gap: .2rem; min-height: 132px; cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; }
.tile:hover { box-shadow: 0 0 2px rgba(34,53,72,.15), 0 6px 16px rgba(34,53,72,.14); }
div.tile { cursor: default; }
.tile-title { font-weight: 700; font-size: .92rem; }
.tile-sub { color: var(--muted); font-size: .8rem; }
.tile-val { margin-top: auto; font-size: 1.85rem; font-weight: 300; line-height: 1.1; color: var(--text); }
.tile-val.crit { color: #8A5A00; }
.tile-val.neg { color: var(--neg); }
.tile-val.pos { color: var(--pos); }
.tile-val.info { color: var(--brand-dark); }
.tile-foot { color: var(--muted); font-size: .78rem; }

.grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; min-width: 0; }
.card h2 { font-size: 1rem; margin: 0 0 .2rem; }
.card .c-sub { color: var(--muted); font-size: .84rem; margin: 0 0 .8rem; }
.thesis { border-left: 4px solid var(--brand); }
.thesis p { margin: .3rem 0 0; }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .6rem; align-items: baseline; width: 100%; text-align: left; border: 0; background: none; padding: .15rem .2rem; border-radius: 6px; }
button.bar-row { cursor: pointer; }
button.bar-row:hover { background: #F5FAFF; }
.bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.bar-val { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-track { display: block; grid-column: 1 / -1; height: 10px; background: #EFF1F2; border-radius: 5px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--brand); border-radius: 5px; transition: width .35s ease; }
.bar-fill.crit { background: var(--crit); }
.bar-fill.muted { background: #A9B4BE; }

svg.chart { display: block; width: 100%; height: auto; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--muted); }
.chart .axis { stroke: var(--line); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th { text-align: left; color: var(--muted); font-weight: 400; padding: .5rem .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .5rem .5rem; border-bottom: 1px solid #EDEFF0; vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #F5FAFF; }
.link-btn { border: 0; background: none; padding: 0; color: var(--brand); cursor: pointer; text-align: left; font-weight: 700; }
.link-btn:hover { text-decoration: underline; }
.badge { display: inline-block; padding: .05rem .45rem; border-radius: 999px; font-size: .74rem; font-weight: 700; border: 1px solid currentColor; white-space: nowrap; }
.badge.a { color: var(--brand-dark); } .badge.b { color: var(--muted); } .badge.c { color: #556B82; }
.badge.dup { color: #8A5A00; background: var(--crit-soft); }
.badge.ok { color: var(--pos); }
.badge.seg-Strategic { color: var(--brand-dark); } .badge.seg-Leverage { color: #004BB0; } .badge.seg-Bottleneck { color: #8A5A00; } .badge.seg-Routine { color: var(--pos); }

.funnel { display: grid; gap: .55rem; }
.funnel-step { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .6rem; font-size: .86rem; }
.funnel-step .bar-track { height: 18px; border-radius: 6px; }
.funnel-step .bar-fill { border-radius: 6px; }

dialog { border: 0; padding: 0; border-radius: var(--radius); box-shadow: 0 10px 40px rgba(34,53,72,.3); width: min(720px, calc(100vw - 1.5rem)); max-height: calc(100vh - 2rem); color: var(--text); }
dialog::backdrop { background: rgba(29, 45, 62, .45); }
dialog[open] { animation: fadein .2s ease-out both; }
.obj { padding: 1rem 1.1rem 1.2rem; }
.obj-head { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: .7rem; margin-bottom: .9rem; }
.obj-head h2 { margin: 0; font-size: 1.2rem; }
.obj-kicker { margin: 0 0 .15rem; color: var(--muted); font-size: .8rem; }
.icon-btn { border: 0; background: none; font-size: 1.6rem; line-height: 1; width: 2.2rem; height: 2.2rem; border-radius: 8px; cursor: pointer; color: var(--muted); flex: none; }
.icon-btn:hover { background: #EFF1F2; }
.facets { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.facet { background: #F5F6F7; border-radius: 8px; padding: .55rem .7rem; }
.facet span { display: block; color: var(--muted); font-size: .76rem; }
.facet strong { font-size: 1.05rem; font-weight: 700; }
.obj h3 { font-size: .92rem; margin: 1rem 0 .5rem; }
.obj ul.plain { margin: 0; padding-left: 1.1rem; }
.note { color: var(--muted); font-size: .82rem; margin: .7rem 0 0; }
.about p, .about li { max-width: 72ch; }

.foot { max-width: 1240px; margin: 0 auto; padding: 1rem 1rem 2rem; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); }
.foot p { margin: 0 0 .4rem; }

@media (min-width: 700px) {
  .page { padding: 1.1rem 1.5rem 2rem; }
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.wide { grid-template-columns: 1.4fr 1fr; }
}
@media (max-width: 560px) {
  .sb-sub { display: none; }
  .tiles { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .tile { min-height: 116px; padding: .75rem; }
  .tile-val { font-size: 1.45rem; }
  .filterbar { padding: .7rem .8rem; }
  .seg button { min-width: 0; padding: .4rem .6rem; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.comment{margin-top:1rem;border-left:4px solid #0062D6}
.comment p{margin:.3rem 0 0;color:#1D2D3E;line-height:1.5}
/* alignment pass v=20261007c */
:root { --gap: 1rem; --pad: 1rem; }
.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: stretch; margin-bottom: var(--gap); }
@media (min-width: 900px) { .tiles { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); } }
.tile, div.tile { display: flex; flex-direction: column; gap: 0; padding: var(--pad); min-height: 0; box-sizing: border-box; }
.tile-title { font-size: .92rem; line-height: 1.25rem; min-height: 2.5rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-sub { font-size: .8rem; line-height: 1.1rem; min-height: 2.2rem; }
.tile-val { margin-top: auto; padding-top: .5rem; line-height: 2.2rem; font-size: 1.85rem; }
.tile-foot { font-size: .78rem; line-height: 1.1rem; min-height: 2.2rem; margin-top: .25rem; }
.grid { gap: var(--gap); align-items: stretch; }
.grid + .grid, .grid + .card, .card + .card, .tiles + .card { margin-top: var(--gap); }
.card { padding: var(--pad); box-sizing: border-box; }
.card h2 { line-height: 1.4rem; margin: 0 0 .75rem; }
.comment { height: auto; }
@media (min-width: 700px) { .grid.two, .grid.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { :root { --gap: .75rem; --pad: .8rem; } .tile-val { font-size: 1.45rem; line-height: 1.8rem; } }
.grid > .card { margin-top: 0 !important; }
.card.comment, .grid ~ .card { margin-top: var(--gap); }
.about .comment p { max-width: none; }
.keys { margin: 0; padding-left: 1.2rem; display: grid; gap: .7rem; }
.keys li strong { display: block; font-size: .9rem; }
.key-st { display: block; color: var(--muted); font-size: .82rem; }
.key-st.pos { color: var(--pos); font-weight: 700; }
.card + .grid { margin-top: var(--gap); }
/* Heart Risk additions */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1rem; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field label, .field .fb-label { font-size: .8rem; color: var(--muted); }
.field input[type=number] { width: 100%; border: 1px solid #89919A; border-radius: 8px; padding: .4rem .6rem; font: inherit; color: inherit; background: #fff; }
.field input[aria-invalid=true] { border-color: var(--neg); }
.field .seg { align-self: flex-start; }
.field .hint { font-size: .74rem; color: var(--muted); min-height: 1rem; }
.field .hint.warn { color: #8A5A00; }
.form-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: flex-end; border-top: 1px solid var(--line); padding-top: .85rem; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: .9rem; }
.legend { display: flex; gap: 1rem; font-size: .78rem; color: var(--muted); margin-top: .4rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); margin-right: .35rem; vertical-align: -1px; }
.legend i.line { border-radius: 0; height: 2px; width: 14px; background: #A9B4BE; vertical-align: 3px; }
.cs-hero h1 { font-size: 1.5rem; margin: 0 0 .3rem; }
.cs-hero p { margin: 0; color: var(--muted); max-width: 64ch; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.btn { display: inline-flex; align-items: center; padding: .5rem 1rem; border-radius: 8px; font-weight: 700; text-decoration: none; border: 1px solid var(--brand); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { color: var(--brand-dark); background: #fff; }
.card ul.plain, .card ol.plain { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; }
@media (max-width: 560px) { .form { grid-template-columns: 1fr 1fr; gap: .7rem .75rem; } .facts { grid-template-columns: 1fr 1fr; } }

/* KPI tiles, clean card look: short uppercase label, one big number, small change line */
.tile, div.tile { gap: 0; padding: 1rem 1.1rem; box-shadow: none; border: 1px solid #E5E8EB; border-radius: 10px; }
.tile:hover { box-shadow: 0 2px 10px rgba(34,53,72,.10); }
div.tile:hover { box-shadow: none; }
.tile-title { order: 0; text-transform: uppercase; letter-spacing: .05em; font-size: .72rem; font-weight: 700; color: var(--muted); line-height: 1.1rem; min-height: 2.2rem; }
.tile-val { order: 1; margin-top: .35rem; padding-top: 0; font-size: 2rem; line-height: 2.3rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tile-delta { order: 2; display: inline-flex; align-items: baseline; gap: .3rem; margin-top: .3rem; font-size: .8rem; font-weight: 700; line-height: 1.1rem; }
.tile-delta .d-arrow { font-size: .7rem; }
.tile-delta .d-vs { font-weight: 400; color: var(--muted); }
.tile-delta.good { color: var(--pos); }
.tile-delta.bad { color: var(--neg); }
.tile-delta.neutral { color: var(--muted); }
.tile-sub { order: 3; margin-top: .55rem; min-height: 0; color: var(--muted); font-size: .78rem; line-height: 1.1rem; }
.tile-foot { order: 4; margin-top: .15rem; min-height: 0; font-size: .78rem; line-height: 1.1rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 560px) { .tile, div.tile { padding: .8rem; } .tile-val { font-size: 1.5rem; line-height: 1.8rem; } .tile-title { font-size: .68rem; } }
/* Home button in the shell bar */
.sb-home { display: inline-flex; align-items: center; gap: .35rem; margin-left: auto; font-size: .88rem; font-weight: 700; text-decoration: none; padding: .35rem .7rem; border-radius: 8px; border: 1px solid #A6CFFF; color: var(--brand-dark); white-space: nowrap; }
.sb-home svg { width: 16px; height: 16px; fill: currentColor; }
.sb-home:hover { background: var(--brand-soft); }
.sb-home + .sb-link { margin-left: 0; }
@media (max-width: 560px) { .sb-sub { display: none; } }

/* Plain words result */
.result { margin-bottom: var(--gap, .9rem); }
.res-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 1.25rem; align-items: start; }
.plain-lead { font-size: 1.15rem; line-height: 1.5; margin: .2rem 0 .6rem; }
.plain-lead strong { font-size: 1.35rem; color: var(--brand-dark); }
.plain-sub { margin: 0 0 .6rem; }
.lvl-lab { margin: .6rem 0 .4rem; font-weight: 700; }
.lvl { display: inline-block; padding: .05rem .55rem; border-radius: 999px; font-size: .85rem; }
.lvl.low { background: #E3F4E8; color: #1E6B35; } .lvl.mod { background: #FFF3E0; color: #8A4B00; } .lvl.high { background: #FDE4E2; color: #A0130B; }
.lvl-bar { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; height: 30px; border-radius: 8px; overflow: visible; font-size: .75rem; font-weight: 700; }
.lvl-bar .z { display: grid; place-items: center; }
.lvl-bar .low { background: #E3F4E8; color: #1E6B35; border-radius: 8px 0 0 8px; } .lvl-bar .mod { background: #FFF3E0; color: #8A4B00; } .lvl-bar .high { background: #FDE4E2; color: #A0130B; border-radius: 0 8px 8px 0; }
.lvl-bar i { position: absolute; top: -5px; bottom: -5px; width: 4px; margin-left: -2px; background: var(--text); border-radius: 2px; }
.result h3 { font-size: .95rem; margin: 1rem 0 .4rem; }
.why { list-style: none; margin: 0; padding: 0; }
.why li { padding: .3rem 0; border-bottom: 1px solid #EEF0F2; }
.why .arr { display: inline-block; width: 1.1rem; font-size: .7rem; }
.why li.up .arr { color: var(--neg); } .why li.down .arr { color: var(--pos); }
.why .muted { color: var(--muted); font-size: .85rem; }
.res-fig { margin: 0; text-align: center; }
.people { width: 100%; max-width: 220px; }
.people .pp { fill: #D5DADF; } .people .pp.on { fill: #D0450B; }
.res-fig figcaption { font-size: .8rem; color: var(--muted); }
.meaning { margin: .7rem 0 0; font-size: .9rem; }
@media (max-width: 700px) { .res-grid { grid-template-columns: 1fr; } .people { max-width: 180px; } }
.people .pp.avg { fill: #F4B99A; }
.res-fig .key { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .3rem; vertical-align: -1px; background: #D0450B; }
.res-fig .key.avg { background: #F4B99A; }
.sb-link { white-space: nowrap; }
