/* Portfolio reads across measures: progress with health, then money with risk. */
main:has(.hub-head) { --hub-budget:#87785f; }
.hub-head { margin: 2px 0 0; }
.hub-heading, .hub-chart-title { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.hub-heading h1 { font:600 var(--type-page)/1.2 var(--display); }
.hub-heading p { margin:6px 0 0; font-size:14px; color:var(--chart-label); }
.hub-heading p span { padding:0 4px; color:var(--muted); }
.hub-principles { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border-block:1px solid var(--border); margin:20px 0 10px; background:color-mix(in srgb,var(--card) 81%,transparent); }
.hub-principles a { min-width:0; display:flex; align-items:center; gap:14px; padding:12px 18px; }
.hub-principles a+a { border-left:1px solid var(--border); }
.hub-principles a:hover { background:var(--surface); }
.hub-principles b { font:600 var(--type-card) var(--display); color:var(--primary); white-space:nowrap; }
.hub-principles strong,.hub-principles small { display:block; }
.hub-principles strong { font-size:14px; font-weight:550; }.hub-principles small { color:var(--chart-label); margin-top:1px; }
.hub-principles svg { flex:none; margin-left:auto; color:var(--muted); }
.hub-head .tabs { margin-block:14px; }.hub-head .tabs a { padding:8px 14px; }
.hub-metrics { display:grid;grid-template-columns:repeat(4,1fr);margin:0 0 16px;padding:15px 0;border:1px solid var(--border);border-radius:var(--radius);background:var(--card); }
.hub-metrics>div { padding:0 clamp(14px,2vw,32px); }.hub-metrics>div+div {border-left:1px solid var(--border);}
.hub-metrics dt { color:var(--chart-label);font-size:14px; }.hub-metrics dd {margin:2px 0 0;font:550 var(--type-metric)/1.18 var(--chart-numerals);letter-spacing:-.025em;}
.hub-metrics em {font:500 13px var(--font-sans);margin-left:6px;}.hub-metrics small {font-size:12px;color:var(--chart-label);}
.hub-metrics>div:last-child dd {color:var(--chart-5);}
.hub-plots { display:grid;grid-template-columns:minmax(0,1.65fr) minmax(0,1fr);gap:16px;align-items:start; }
.hub-card {position:relative;min-width:0;padding:18px clamp(14px,1.55vw,25px) 13px;border:1px solid var(--border);border-radius:var(--radius);background:var(--card);font-variant-numeric:tabular-nums;}
.hub-chart-title {align-items:baseline;margin-bottom:9px;}.hub-chart-title h2 {font:600 var(--type-section)/1.25 var(--display);}
.hub-chart-title p {margin:5px 0 0;color:var(--chart-label);font-size:13px;line-height:1.55;}.hub-chart-title>strong {font-size:13px;color:var(--primary);white-space:nowrap;}
.hub-legend {display:flex;gap:16px;align-items:center;flex-wrap:wrap;min-height:23px;}
.hub-key {display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--chart-label);}
.hub-key i,.hub-projects i {width:9px;height:9px;border-radius:2px;background:var(--ink);}
.hub-key.is-line i {width:16px;height:3px;}.hub-cartesian {height:166px;}
.hub-xlabels {margin:0 14px 0 36px;display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;}
.hub-xlabels a {text-align:center;line-height:28px;font-size:13px;color:var(--chart-label);white-space:nowrap;}
.hub-xlabels a:hover,.hub-projects a:hover {color:var(--primary);background:var(--surface);}
.hub-tooltip {padding:7px;}.hub-tooltip b,.hub-tooltip span {display:block;}.hub-tooltip span {color:var(--chart-label);font-size:12px;}
.hub-ring,.hub-radar-plot {display:flex;justify-content:center;margin:auto;}.hub-ring {margin-block:4px;cursor:pointer;}
.hub-ring-center {text-align:center;}.hub-ring-center b {display:block;font:550 var(--type-metric)/1.1 var(--chart-numerals);}.hub-ring-center small {color:var(--chart-label);}
.hub-health-keys {display:flex;justify-content:center;gap:12px;border-top:1px solid var(--border);padding-top:3px;}
.hub-health-key {min-height:44px;display:inline-flex;align-items:center;gap:6px;font-size:14px;}.hub-health-key::before {content:"";width:8px;height:8px;border-radius:50%;background:var(--chart-positive);}.hub-health-key:nth-child(2)::before {background:var(--chart-2);}.hub-health-key:nth-child(3)::before {background:var(--chart-5);}
.hub-health-key:hover {color:var(--primary);}
.hub-data {margin-top:3px;border-top:1px solid var(--border);}.hub-data summary {cursor:pointer;width:fit-content;color:var(--chart-label);font-size:13px;padding:8px 2px 0;}.hub-data>div {overflow-x:auto;}.hub-data table {width:100%;font-size:13px;}.hub-data td {text-align:right;}.hub-data th {text-align:left;font-weight:500;}.hub-data th:not(:first-child){text-align:right;}
.hub-scatter {height:226px;}.hub-matrix-labels a rect {fill:transparent;}.hub-matrix-labels a:hover rect,.hub-matrix-labels a:focus-visible rect {fill:#ffffff0c;stroke:var(--primary);}.hub-matrix-labels a text {fill:var(--foreground);font-size:12px;}.hub-quadrant,.hub-tick {fill:var(--chart-label);font-size:11px;}
.hub-projects {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 18px;margin-top:8px;}
.hub-projects a {display:flex;align-items:center;gap:7px;border-top:1px solid var(--border);min-height:40px;font-size:13px;}.hub-projects i {flex:none;border-radius:50%;}.hub-projects b {margin-left:auto;font-weight:500;}
@media(min-width:1050px) {.hub-card.hub-health {align-self:stretch;display:flex;flex-direction:column;}.hub-health platform-chart {margin:auto;}}
@media(max-width:1100px) {.hub-principles a {gap:8px;padding:10px;}.hub-principles small {display:none;}.hub-principles strong {font-size:13px;}.hub-projects {grid-template-columns:1fr;}.hub-plots {grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);}}
@media(max-width:767px) {
 main:has(.hub-head) {padding-bottom:95px;}.hub-heading {align-items:flex-start;flex-direction:column;gap:10px;}.hub-heading p {font-size:13px;}
 .hub-principles {margin:12px 0 6px;}.hub-principles a {justify-content:space-between;padding:8px 10px;min-height:44px;}.hub-principles a span {display:none;}
 .hub-head .tabs {flex-wrap:nowrap;overflow:auto;scrollbar-width:thin;padding-bottom:3px;}.hub-head .tabs a {white-space:nowrap;min-height:44px;}
 .hub-metrics {grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 0;padding:14px 0;}.hub-metrics>div:nth-child(3){border-left:0;}
 .hub-plots {grid-template-columns:minmax(0,1fr);gap:12px;}.hub-card {padding:16px 12px 10px;}.hub-cartesian {height:162px;}
 .hub-xlabels a {font-size:11px;min-height:44px;line-height:40px;}.hub-legend {gap:12px;}.hub-data summary {min-height:44px;line-height:28px;}
 .hub-projects a {min-height:44px;}.hub-matrix-labels a text {font-size:10px;}
}
.hub-xlabels a {display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:39px;line-height:1.35;min-width:0;overflow:hidden;}
.hub-xlabels a span {display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;font-size:12px;}
.hub-xlabels small {font-size:11px;color:var(--muted-foreground);}
.hub-data {padding:0;}
.hub-radar-plot {max-width:100%;}
@media(max-width:767px) {.hub-xlabels a {min-height:44px;}.hub-xlabels a span{display:none;}.hub-xlabels small{color:var(--chart-label);}}
main:has(.hub-head) .segments a {padding:7px 12px;display:inline-flex;align-items:center;border-radius:4px;font-size:14px;}
@media(max-width:767px) {main:has(.hub-head) .segments a{min-height:44px;}}

/* The open reminder has room for a decision; the rest scan as a quiet list. */
.hub-alerts { padding: 0; }
.hub-alert-head, .hub-alert-head h2, .hub-alert-actions, .hub-alert-actions > *,
.hub-alert-footer > button, .hub-rest > summary { display: flex; align-items: center; }
.hub-alert-head {
  justify-content: space-between; gap: 12px; margin: 0 18px; padding: 18px 0 15px;
}
.hub-alert-head h2 { gap: 10px; margin: 0; font: 600 var(--type-section)/1.3 var(--display); }
.hub-alert-head h2 .icon { color: var(--primary); flex: none; }
.hub-alert-count { color: var(--chart-label); font-size: 13px; white-space: nowrap; }
.hub-alert-count b { color: var(--primary); font: 550 var(--type-stat) var(--chart-numerals); }
.hub-alert { padding: 0; margin: 0 12px; border: 1px solid transparent; border-top-color: var(--border); }
.hub-alert > summary {
  display: grid; grid-template-columns: 7px minmax(0,1fr) auto; gap: 10px;
  align-items: start; list-style: none; padding: 13px 10px; border-radius: 5px;
}
.hub-alert:has(.hub-read) > summary { grid-template-columns: 7px minmax(0,1fr) auto auto; }
.hub-alert > summary::-webkit-details-marker, .hub-rest > summary::-webkit-details-marker { display: none; }
.hub-alert > summary > .icon { align-self: center; color: var(--muted-foreground); }
.hub-alert[open] > summary > .icon, .hub-rest[open] > summary .icon { transform: rotate(180deg); }
.hub-alert[open] {
  background: color-mix(in srgb,var(--primary) 6%,var(--card));
  border-color: color-mix(in srgb,var(--primary) 30%,var(--border)); border-radius: 6px;
}
.hub-alert[open] + .hub-alert { border-top-color: transparent; }
.hub-alert:not([open]) > summary:hover { background: var(--surface); }
.hub-alert-dot { width: 6px; height: 6px; margin-top: 9px; border-radius: 50%; background: var(--primary); }
.hub-alert-dot.is-read { background: transparent; border: 1px solid var(--muted-foreground); }
.hub-alert-copy strong { display: block; font-size: 16px; font-weight: 550; line-height: 1.5; color: var(--foreground); }
.hub-alert-copy small { display: block; margin-top: 3px; color: var(--chart-label); font-size: 12px; line-height: 1.5; }
.hub-owner { display: inline-block; margin-left: 7px; padding-left: 7px; border-left: 1px solid var(--border); line-height: 1; }
.hub-read { align-self: center; color: var(--chart-label); font-size: 12px; }
.hub-alert-body { padding: 0 13px 10px 27px; }
.hub-next-node { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 0 0 10px; font-size: 13px; line-height: 1.6; }
.hub-next-node span, .hub-next-node time { color: var(--chart-label); }
.hub-next-node strong { font-weight: 500; color: var(--foreground); }
.hub-alert-actions { gap: 6px 12px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--border); }
.hub-alert-actions > *, .hub-inspect { min-height: 34px; background: transparent; border: 0; gap: 5px; font-size: 13px; }
.hub-project-link { color: var(--primary); }
.hub-dispatch { color: var(--foreground); padding-inline: 4px; }
.hub-ack { margin-left: auto; padding-inline: 4px; color: var(--chart-label); }
.hub-alert-actions > :hover, .hub-inspect:hover, .hub-rest > summary:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.hub-alert-footer { margin: 0 18px; border-top: 1px solid var(--border); display: grid; align-items: start; }
.hub-rest { min-width: 0; grid-area: 1/1; padding: 0; border: 0; }
.hub-rest > summary { gap: 7px; min-height: 44px; width: fit-content; max-width: calc(100% - 88px); font-size: 13px; list-style: none; color: var(--chart-label); }
.hub-rest .hub-alert { margin-inline: -6px; }
.hub-inspect { grid-area: 1/1; justify-self: end; align-self: start; min-height: 44px; padding: 0; color: var(--primary); }
@media (max-width: 767px) {
  .hub-alert-head { margin-inline: 13px; }
  .hub-alert { margin-inline: 8px; }.hub-alert > summary { gap: 8px; }
  .hub-alert-body { padding: 0 9px 6px 25px; }.hub-alert-actions { gap: 3px 10px; padding-top: 4px; }
  .hub-alert-actions > * { min-height: 44px; }.hub-alert-footer { margin-inline: 13px; }
}

/* The owner catalogue uses the same four fields and project action as the methods view. */
.hub-head + .panel .skill-catalog {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, max(15rem, 30%)), 1fr));
  gap: clamp(12px, 1.25vw, 20px);

  > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 20px clamp(16px, 1.7vw, 28px) 9px;
    overflow-wrap: anywhere;
    border: 1px solid #46494b;
    border-top-color: #737065;
    border-radius: var(--radius);
    background: #101317;
  }
  small, h3, p, .textlink { font-family: var(--display); }
  small {
    color: #bfd1c8;
    font-size: var(--type-control);
    font-weight: 500;
    line-height: 1.45;
  }
  h3 {
    margin: 9px 0 0;
    color: var(--foreground);
    font-family: Georgia, var(--display);
    font-size: var(--type-section);
    font-weight: 650;
    line-height: 1.2;
  }
  p {
    flex: 1;
    margin: 10px 0 21px;
    color: #d0d1d1;
    font-size: var(--type-body);
    line-height: 1.55;
  }
  .textlink {
    flex-direction: row-reverse;
    justify-content: space-between;
    min-height: 48px;
    border-top: 1px solid #454748;
    border-radius: 0;
    color: var(--primary);
    font-size: var(--type-control);
  }
  .textlink .icon { width: 19px; height: 19px; }
  > div:focus-within { border-color: var(--primary); }
  @media (hover: hover) {
    > div:has(.textlink:hover) { border-color: var(--primary); }
  }
}

/* The charter tree is typeset from the editable company record. */
.charter {
  container-type: inline-size;
  padding: 18px clamp(12px, 1.15vw, 20px) 26px;
  overflow-wrap: anywhere;
}
.charter-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 7px 17px; }
.charter-head h2 { font-size: var(--type-section); line-height: 1.35; }
.charter-head .btn { min-height: 42px; padding-inline: 17px; }
.charter-map {
  --branch-arm: clamp(22px, 2.7cqi, 44px);
  --wire: #c7a575;
  display: grid;
  grid-template-columns: minmax(0, 29%) minmax(0, 1fr);
  column-gap: calc(2 * var(--branch-arm));
  align-items: center;
  min-height: 390px;
  padding: 30px 14px 30px 24px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #10151b url("../assets/charter-grid.webp") repeat;
}
.charter-company {
  position: relative;
  padding: 20px clamp(16px, 2cqi, 30px);
  border: 1.5px solid var(--primary);
  border-radius: 17px;
  background: var(--card);
}
.charter-company h3 { font: 650 var(--type-feature)/1.25 var(--display); }
.charter-industry { margin-top: 5px; color: var(--primary); font: 600 var(--type-lead)/1.4 var(--display); }
.charter-org { margin-top: 12px; padding-top: 12px; border-top: 1px solid #796749; color: var(--foreground); font-size: 17px; }
.charter-company::after, .charter-branch::before {
  content: ""; position: absolute; top: 50%; width: var(--branch-arm); border-top: 2px solid var(--wire);
}
.charter-company::after { left: 100%; }
.charter-branches { --row-gap: 26px; display: grid; grid-template-rows: repeat(3, 1fr); gap: var(--row-gap); min-width: 0; }
.charter-branch {
  position: relative; display: grid; grid-template-columns: clamp(120px, 14cqi, 166px) minmax(0,1fr);
  align-items: center; gap: clamp(12px, 1.5cqi, 24px); min-height: 90px; padding: 8px 8px 8px 4px;
}
.charter-branch::before { right: 100%; }
.charter-branch::after {
  content: ""; position: absolute; left: calc(-1 * var(--branch-arm)); top: calc(-.5 * var(--row-gap));
  bottom: calc(-.5 * var(--row-gap)); border-left: 2px solid var(--wire);
}
.charter-branch:first-child::after { top: 50%; }
.charter-branch:last-child::after { bottom: 50%; }
.charter-branch h3 {
  padding: 12px 6px; border: 1px solid #a78d6d; border-radius: 9px; color: var(--foreground);
  background: #232425; text-align: center; font: 600 var(--type-card)/1.45 var(--display);
}
.charter-branch dl { margin: 0; padding-left: clamp(12px, 1.45cqi, 22px); border-left: 1px solid #706b61; font-size: var(--type-body); line-height: 1.55; }
.charter-branch dl > div + div { margin-top: 5px; }
.charter-branch dt, .charter-branch dd { display: inline; margin: 0; }
.charter-branch dt::after { content: "："; }
.charter-floor { border-radius: 10px; background: #272218; box-shadow: inset 0 0 0 1px #493a23; }
.charter-floor h3 { background: #40321f; border-color: var(--primary); }
.charter-floor dl { color: var(--primary); font-weight: 600; border-color: #927752; }
.charter-uses { margin: 28px 7px 0; padding-top: 16px; border-top: 1px solid var(--border); }
.charter-uses h3 { margin: 0 0 12px; font: 600 var(--type-section)/1.4 var(--display); }
.charter-uses dl { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); margin: 0; padding: 18px 0; border: 1px solid var(--border); border-radius: var(--radius); }
.charter-uses dl > div { padding: 0 clamp(15px, 2.2cqi, 30px); }
.charter-uses dl > div + div { border-left: 1px solid var(--border); }
.charter-uses dt { color: var(--primary); font: 600 var(--type-card)/1.4 var(--display); }
.charter-uses dd { margin: 6px 0 0; color: #c8ced0; font-size: 16px; line-height: 1.65; }

@container (max-width: 800px) {
  .charter-map { --branch-arm: 18px; display: block; min-height: 0; padding: 16px; }
  .charter-company { padding: 13px 17px; border-radius: 11px; }
  .charter-org { margin-top: 8px; padding-top: 8px; font-size: 15px; }
  .charter-company::after { display: none; }
  .charter-branches { --row-gap: 14px; grid-template-rows: none; padding: 16px 0 0 calc(2 * var(--branch-arm)); }
  .charter-branch { min-height: 0; grid-template-columns: minmax(0,1fr); gap: 4px; padding: 8px 12px; }
  .charter-branch h3 { border: 0; padding: 0; background: none; text-align: left;  }
  .charter-branch dl { padding: 0; border: 0; font-size: 15px; }
  .charter-branch dl > div + div { margin-top: 2px; }
  .charter-branch:first-child::after { top: -16px; }
  .charter-head { padding-inline: 0; }
  .charter-uses { margin: 20px 0 0; }
}
@container (max-width: 520px) {
  .charter-map { --branch-arm: 12px; padding: 12px; }
  .charter-uses dl { grid-template-columns: minmax(0,1fr); padding: 0 14px; }
  .charter-uses dl > div { padding: 13px 0; }
  .charter-uses dl > div + div { border-left: 0; border-top: 1px solid var(--border); }
  .charter-uses dd { font-size: 15px; }
}
