/* Pizza Pilgrims Impact Hub: maturity wheel component (assets/maturity.js). Light theme only.
   Band colours agreed 29 Oct 2026 (Maturity Framework Notes, display rules). Load after assets/pp.css. */
:root {
  --mat-emb: #026340;                       /* Embedded: brand green */
  --mat-inplace: #6DB38A;                   /* In place: light brand green */
  --mat-progress: rgba(232, 166, 46, .55);  /* In progress: amber */
  --mat-gap: rgba(190, 45, 32, .88);        /* Major gap */
  --mat-gap-minor: rgba(190, 45, 32, .3);   /* Minor gap */
  --mat-na: #FBF7EA;                        /* Not yet assessed: blank cream */
  --mat-na-edge: #E3D7B0;
  --mat-hatch: rgba(255, 255, 255, .7);     /* limitation hatching */
  --mat-sep: #FFFFFF;
}

.mat { display: grid; gap: 18px; }
.mat-controls { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.mat-controls .grp { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.mat-controls .lab { font-size: .8rem; font-weight: 600; color: var(--pp-muted); text-transform: uppercase; letter-spacing: .08em; }
.mat-seg { display: inline-flex; border-radius: 999px; background: var(--pp-card); box-shadow: var(--shadow); padding: 4px; }
.mat-seg button { font: inherit; font-weight: 600; font-size: .92rem; border: 0; background: transparent; color: var(--pp-muted); padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.mat-seg button[aria-pressed="true"] { background: var(--pp-green); color: #fff; }

.mat-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; list-style: none; margin: 0; padding: 0; }
.mat-legend li { display: flex; align-items: center; gap: 7px; }
.mat-sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; flex: none; }
.mat-sw.na { box-shadow: inset 0 0 0 1px var(--mat-na-edge); }

.mat-stage { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .mat-stage { grid-template-columns: minmax(0, 1fr); } }
.mat .card { min-width: 0; }
.mat .card h2 { font-size: 1.35rem; margin: 0; }
.mat .card .sub { font-size: .88rem; color: var(--pp-muted); margin: 4px 0; }

svg.mat-wheel { width: 100%; height: auto; display: block; max-width: 520px; margin: 0 auto; overflow: visible; }
.mat-wheel .sector { cursor: pointer; }
.mat-wheel .sector:focus { outline: none; }
.mat-wheel .sector:focus-visible path:first-child { stroke: var(--pp-accent); stroke-width: 3; }
.mat-wheel .hit { fill: transparent; }
.mat-wheel .lbl { font-family: var(--font-body); font-size: 14px; fill: var(--pp-muted); font-weight: 600; }
.mat-wheel .lbl.pct { font-family: var(--font-head); font-size: 20px; font-weight: 400; fill: var(--pp-green); font-variant-numeric: tabular-nums; }
.mat-wheel .sector.sel .lbl { fill: var(--pp-text); }
.mat-wheel .sector.sel .lbl.pct { fill: var(--pp-green); }
.mat-wheel .ctr { font-family: var(--font-head); font-size: 28px; fill: var(--pp-green); font-variant-numeric: tabular-nums; }
.mat-wheel .ctr-s { font-family: var(--font-body); font-size: 10.5px; fill: var(--pp-muted); letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }

.mat-tip { position: fixed; pointer-events: none; background: var(--pp-card); color: var(--pp-text); border-radius: 10px; padding: 10px 12px; font-size: .84rem; box-shadow: 0 8px 24px rgba(2, 99, 64, .18); max-width: 270px; z-index: 20; }
.mat-tip b { font-family: var(--font-head); font-weight: 400; color: var(--pp-green); font-size: 1.05rem; display: block; margin-bottom: 4px; }
.mat-tip .row { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.mat-tip .row span:first-child { display: flex; align-items: center; gap: 6px; }
.mat-tip .mat-sw { width: 10px; height: 10px; }
.mat-tip .note { margin-top: 6px; color: var(--pp-muted); }

.mat-detail .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--pp-muted); font-size: .92rem; margin: 6px 0 14px; }
.mat-detail .reqs { display: grid; max-height: 560px; overflow-y: auto; }
.mat-detail .req { display: grid; grid-template-columns: minmax(58px, 70px) minmax(0, 1fr) minmax(70px, 110px); gap: 6px 14px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--pp-line); }
.mat-detail .code { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--pp-green); }
.mat-detail .name { min-width: 0; }
.mat-detail .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.mat .chip { font-size: .74rem; font-weight: 600; border-radius: 999px; padding: 2px 9px; background: var(--pp-green-tint); color: var(--pp-green); white-space: nowrap; text-decoration: none; }
.mat a.chip:hover { text-decoration: underline; }
.mat .chip.warn { background: #C0261C; color: #FFFFFF; }
.mat .chip.minor { background: #F9DEDA; color: #8A1F14; }
.mat-bar { display: flex; height: 12px; border-radius: 4px; overflow: hidden; background: var(--mat-na); box-shadow: inset 0 0 0 1px var(--mat-na-edge); gap: 2px; }
.mat-bar i { display: block; height: 100%; }
.mat-detail .req .bar, .mat-detail .req .mat-bar { grid-column: 3; grid-row: 1; }
.mat-detail .req .n { font-size: .8rem; color: var(--pp-muted); font-variant-numeric: tabular-nums; white-space: nowrap; grid-column: 3; margin-top: -4px; }
@media (max-width: 640px) {
  .mat-detail .req { grid-template-columns: 62px minmax(0, 1fr); }
  .mat-detail .req .mat-bar { grid-column: 2; grid-row: auto; }
  .mat-detail .req .n { grid-column: 2; margin-top: 0; }
}

.mat-table details summary { cursor: pointer; font-weight: 600; color: var(--pp-green); }
.mat-scroll { overflow-x: auto; }
.mat-table table { border-collapse: collapse; width: 100%; font-size: .88rem; font-variant-numeric: tabular-nums; margin-top: 10px; }
.mat-table th, .mat-table td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--pp-line); white-space: nowrap; }
.mat-table th:first-child, .mat-table td:first-child { text-align: left; }
.mat-table th { color: var(--pp-muted); font-weight: 600; }
.mat-table tr.total td { font-weight: 700; border-top: 2px solid var(--pp-line); }
.mat-foot { font-size: .84rem; color: var(--pp-muted); max-width: 90ch; margin: 0; }
.mat-detail a.code { text-decoration: none; }
.mat-detail a.code:hover { text-decoration: underline; }
.mat a.chip.warn, .mat a.chip.minor { text-decoration: none; }
.mat a.chip.warn:hover, .mat a.chip.minor:hover { text-decoration: underline; }
