/* Hire & Scale Planner: what the shared tl- classes in portfolio.css don't cover. Tokens from /styles.css only, so
   dark mode and print follow the rest of the site. */

/* Fields: label, input and hint share rows (subgrid), so inputs stay in line when a label wraps or a hint sits below. */
.hs .tl-row > .tl-field { display: grid; grid-template-rows: subgrid; grid-row: span 3; row-gap: 0; align-content: start; }
.hs .tl-row > .tl-field > label { align-self: end; }
.hs .tl-row > .tl-field > .tl-hint { margin-top: 6px; }
.tl-row.hs-gap { margin-top: 1.4rem; }
.tl-row.hs-four { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 940px; }
.tl-in.has-suffix.hs-s2 input { padding-right: 7rem; }
.tl-in.has-suffix.hs-s3 input { padding-right: 8.8rem; }
.hs .tl-field label .muted { color: var(--muted); font-size: 0.85rem; }

.hs-warn { margin-top: 0.8rem; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--accent-tint); font-size: 0.9rem; max-width: 78ch; }
.hs-warn strong { font-weight: 600; }

/* Dotted glossary terms and their popover */
.hs-t { border-bottom: 1px dotted var(--accent); cursor: help; }
.hs-t:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hs-pop {
  position: absolute;
  z-index: 30;
  width: max-content;
  max-width: min(340px, calc(100vw - 16px));
  padding: 12px 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.86rem;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.22);
}
.hs-pop strong { display: block; margin-bottom: 3px; font-weight: 600; }
.hs-pop em { display: block; margin-top: 6px; font-style: normal; opacity: 0.82; }

/* Scenarios */
.hs-scen { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-bottom: 20px; padding: 16px 20px; border: 1px solid var(--line); background: var(--surface); }
.hs-scen .tl-field { flex: 1 1 200px; max-width: 300px; }
.hs-scen-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.hs-scen-btns .btn { padding-inline: 1rem; }
.hs-scen-note { flex-basis: 100%; margin-top: 0; }
.hs-scen-note span:not(:empty) { color: var(--ink); font-weight: 600; }

/* Revenue model blocks */
.hs-model { margin-top: 1rem; padding: 16px 18px 18px; border: 1px dashed var(--line-strong); max-width: 980px; }
.hs-mb-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-weight: 600; }
.hs-chip { font-family: var(--mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.hs-model .tl-row:first-of-type { margin-top: 0.7rem; }
.hs-live strong { color: var(--accent); }

/* Team rows */
.hs-person { margin-top: 14px; padding: 16px 18px 18px; border: 1px solid var(--line); background: var(--paper); max-width: 980px; }
.hs-person-top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.hs-person-top .hs-role { flex: 1 1 220px; max-width: 360px; }
.hs-person-top .tl-seg { max-width: none; }
.hs-rm { margin-left: auto; min-height: 44px; }
.hs-cost { margin-top: 0.9rem; font-size: 0.95rem; }
.hs-cost strong { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.hs-bd { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 0.8rem; font-size: 0.86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hs-bd em { font-style: normal; }
.hs-add { margin-top: 16px; }
.hs .tl-aside { margin-top: 16px; }

/* Results: tiles, badges and the four signals */
.hs-tiles dt.hs-neg { color: var(--ink); }
.hs-neg { font-weight: 600; }
.hs-badge { flex: none; padding: 3px 8px; border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.hs-badge.g { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.hs-badge.a { background: var(--accent-tint); border-color: var(--accent); }
.hs-badge.r { border: 1.5px solid var(--ink); }
.hs-badge.n { color: var(--muted); border-style: dashed; }
.hs-sigs { list-style: none; margin-top: 0.3rem; }
.hs-sigs li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.hs-sigs strong { display: block; font-weight: 600; }
.hs-sigs p { color: var(--muted); font-size: 0.9rem; line-height: 1.5; margin-top: 2px; }
.hs-ic { width: 22px; height: 22px; display: grid; place-items: center; margin-top: 1px; font-size: 0.78rem; font-weight: 700; line-height: 1; border: 1.5px solid var(--line-strong); }
.hs-ic.g { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.hs-ic.a { background: var(--accent-tint); border-color: var(--accent); color: var(--ink); }
.hs-ic.r { border-color: var(--ink); color: var(--ink); }
.hs-ic.n { border-style: dashed; color: var(--muted); }
.hs-kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; margin: 0.6rem 0 0; padding-top: 0.8rem; border-top: 1px solid var(--line); font-size: 0.9rem; }
.hs-kv dt { color: var(--muted); }
.hs-kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.hs-hire .hs-kv { margin-top: auto; }

/* Tables */
.hs-tablewrap { overflow-x: auto; }
.hs-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.hs-table th, .hs-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.hs-table th:first-child { text-align: left; white-space: normal; font-weight: 400; }
.hs-table thead th { font-family: var(--mono); font-weight: 500; font-size: 0.74rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.hs-table tr.total th, .hs-table tr.total td { font-weight: 600; background: var(--accent-tint); }
.hs-table tr.sub th, .hs-table tr.sub td { color: var(--muted); }
.hs-pl { padding: clamp(10px, 2vw, 20px); max-width: 760px; }

/* The next twelve months */
.hs-proj { padding: clamp(14px, 2.4vw, 24px); }
.hs-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 0.9rem; color: var(--muted); }
.hs-legend li { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.hs-legend b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.hs-sw { flex: none; width: 24px; height: 0; border-top: 3px solid var(--accent); }
.hs-sw.cost { border-top: 2px dashed var(--muted); }
.hs-sw.cash { border-top: 2px solid var(--ink); }
.hs-chart { position: relative; margin-top: 14px; touch-action: pan-y; }
.hs-chart svg { width: 100%; height: auto; overflow: visible; }
.hs-chart text { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.hs-chart .grid { stroke: var(--line); stroke-width: 1; }
.hs-chart .zero { stroke: var(--line-strong); stroke-width: 1.2; }
.hs-chart .start { stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 2 4; }
.hs-chart .guide { stroke: var(--line-strong); stroke-width: 1; }
.hs-chart path { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.hs-chart .l-rev { stroke: var(--accent); stroke-width: 3; }
.hs-chart .l-cost { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 6 5; }
.hs-chart .l-cash { stroke: var(--ink); stroke-width: 2; }
.hs-tip { position: absolute; z-index: 2; pointer-events: none; padding: 7px 10px; background: var(--ink); color: var(--paper); font-size: 0.8rem; line-height: 1.45; white-space: nowrap; transform: translate(-50%, -100%); font-variant-numeric: tabular-nums; }
.hs-hires { margin-top: 8px; font-size: 0.88rem; color: var(--muted); }
.hs-projwrap { margin-top: 18px; }
.hs-projtable { font-size: 0.85rem; }
.hs-projtable th, .hs-projtable td { padding: 7px 9px; }
.hs-projtable th:first-child { position: sticky; left: 0; z-index: 1; min-width: 8.5rem; background: var(--surface); }
.hs-projtable tr.total th:first-child { background: var(--accent-tint); }

/* Compliance checklist */
.hs-checks { padding: clamp(14px, 2.4vw, 24px); }
.hs-chk-group + .hs-chk-group { margin-top: 18px; }
.hs-chk-group h3 { margin-bottom: 4px; font-family: var(--mono); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.hs-chk-group ul { list-style: none; }
.hs-chk { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.hs-chk input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); }
.hs-chk b { display: block; font-weight: 600; }
.hs-chk small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.hs-chk.done b { color: var(--muted); text-decoration: line-through; }
.hs-checks .tl-hint { margin-top: 12px; }

/* Glossary */
.hs-gloss { margin-top: 28px; border: 1px solid var(--line); background: var(--surface); padding: 0 20px; }
.hs-gloss summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
.hs-gloss dl { display: grid; grid-template-columns: minmax(9rem, 15rem) minmax(0, 1fr); gap: 10px 20px; padding: 4px 0 18px; font-size: 0.9rem; }
.hs-gloss dt { font-weight: 600; }
.hs-gloss dd { margin: 0; color: var(--muted); }
.hs-gloss dd em { display: block; margin-top: 2px; font-style: normal; font-size: 0.85rem; }

@media (max-width: 900px) {
  .tl-row.hs-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hs-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
}
@media (max-width: 600px) {
  .tl-row.hs-four { grid-template-columns: minmax(0, 1fr); }
  .hs-scen { padding: 14px 16px; }
  .hs-scen .tl-field { max-width: none; }
  .hs-person { padding: 14px; }
  .hs-person-top .hs-role { max-width: none; flex-basis: 100%; }
  .hs .hs-person .tl-seg { flex-direction: row; flex: 1 1 auto; }
  .hs .hs-person .tl-seg button { width: auto; flex: 1 1 0; }
  .hs-badge { white-space: normal; }
  .hs-gloss { padding: 0 14px; }
  .hs-gloss dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .hs-gloss dt { margin-top: 10px; }
}

/* Save as PDF: the results and glossary only (the shared rules hide the form) */
@media print {
  .hs-scen, .hs-pop, .hs-tip, #chkCount { display: none !important; }
  .hs-tablewrap { overflow: visible !important; }
  .hs-table { font-size: 8.5pt; }
  .hs-table th, .hs-table td { padding: 3px 6px; }
  .hs-pl { max-width: none; padding: 6px 10px; border: 1px solid var(--line); }
  .hs-proj { padding: 8px 10px; border: 1px solid var(--line); break-inside: avoid; }
  .hs-projtable { font-size: 7pt; }
  .hs-projtable th, .hs-projtable td { padding: 2px 3px; }
  .hs-projtable th:first-child { min-width: 0; position: static; }
  .hs-legend { font-size: 8pt; }
  .hs-hires { font-size: 8pt; }
  .hs-sigs li { padding: 4px 0; }
  .hs-sigs p, .hs-kv, .hs-chk small { font-size: 8pt; }
  .hs-checks { padding: 6px 10px; border: 1px solid var(--line); }
  .hs-chk { padding: 4px 0; break-inside: avoid; }
  .hs-chk-group h3 { break-after: avoid; }
  .tl-h2 { break-after: avoid; }
  .hs-gloss { border: 0; padding: 0; margin-top: 12px; break-before: page; }
  .hs-gloss summary { list-style: none; padding: 0 0 6px; font-size: 11pt; }
  .hs-gloss summary::-webkit-details-marker { display: none; }
  .hs-gloss dl { grid-template-columns: 38mm minmax(0, 1fr); gap: 3px 10px; font-size: 7.5pt; }
  .hs-gloss dd em { font-size: 7pt; }
}
