/* The stack lane (spec docs/specs/2026-11-24-stack.md): the tech stack page, its matches and the
   onboarding guide's modal. Values from tokens.css only. No coloured border, edge or stripe: rows are
   separated by a grey hairline, colour sits on the data (the CVSS badge, the exploited dot). */

.stack-page { max-width: 1080px; margin: 40px auto 0; }
.stack-lead { margin: 16px 0 0; max-width: 720px; font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-2); }
.stack-section { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--rule); }
.stack-section:first-of-type { border-top: 0; padding-top: 0; }
.stack-head { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: var(--fs-head); line-height: 1.3; letter-spacing: -.01em; font-weight: 700; }
.stack-count { font-size: var(--fs-meta); font-weight: 400; color: var(--ink-3); letter-spacing: 0; }
.stack-subhead { margin: 40px 0 0; font-size: var(--fs-list-head); font-weight: 700; }
.stack-empty { margin: 16px 0 0; max-width: 720px; font-size: var(--fs-body); line-height: 1.6; color: var(--ink-2); }
.stack-hint { margin: 8px 0 0; font-size: var(--fs-label); line-height: 1.5; color: var(--ink-3); }
.stack-quiet { font-size: var(--fs-label); color: var(--ink-3); }
.stack-error { margin: 20px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--quiet); color: var(--brick); font-size: var(--fs-meta); line-height: 1.5; }

/* Add a product */
.stack-add { margin-top: 20px; max-width: 720px; }
.stack-label { display: block; font-size: var(--fs-label); color: var(--ink-2); }
.stack-add-row { display: flex; gap: 8px; margin-top: 6px; }
.stack-input { flex: 1 1 auto; min-width: 0; min-height: var(--touch); padding: 0 12px; border: 1px solid var(--sand-rule); border-radius: 10px; background: var(--page); color: var(--ink); font: inherit; font-size: var(--fs-body); }
.stack-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.stack-add-btn { flex: 0 0 auto; }
.stack-suggest { max-width: 720px; }
.stack-suggestions { list-style: none; margin: 8px 0 0; padding: 6px; border-radius: 12px; background: var(--quiet); display: flex; flex-direction: column; gap: 2px; }
.stack-suggestions form { margin: 0; }
.stack-suggestion { display: flex; align-items: center; width: 100%; min-height: var(--touch); padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-table); text-align: left; cursor: pointer; }
.stack-suggestion:hover, .stack-suggestion:focus-visible { background: var(--page); }
.stack-suggestion.is-typed { color: var(--accent); }

/* The stack and the domains */
.stack-items { list-style: none; margin: 16px 0 0; padding: 0; }
.stack-item { display: flex; align-items: center; gap: 16px; padding: 10px 0; border-top: 1px solid var(--rule); }
.stack-item:first-child { border-top: 0; }
.stack-item-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stack-item-name { font-size: var(--fs-table); font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.stack-item-meta { font-size: var(--fs-label); color: var(--ink-3); overflow-wrap: anywhere; }
.stack-item-hits { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.stack-chip-hit { color: var(--chip-theme-fg); }
.stack-remove { margin: 0; flex: 0 0 auto; }
.stack-record { display: block; margin-top: 4px; padding: 8px 10px; border-radius: 8px; background: var(--quiet); font-family: var(--mono); font-size: var(--fs-label); color: var(--ink-2); overflow-wrap: anywhere; }
.stack-status { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-size: var(--fs-label); font-weight: 400; color: var(--ink-3); }
.stack-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: 0 0 auto; }
.stack-status.is-pending .stack-dot { background: var(--amber); }
.stack-status.is-verified .stack-dot { background: var(--moss); }
.stack-dot.is-brick { background: var(--brick); }

/* Matches */
.stack-table-box { margin-top: 20px; overflow-x: auto; }
.stack-table { width: 100%; border-collapse: collapse; font-size: var(--fs-table); line-height: 1.55; }
.stack-table th { padding: 8px 12px 8px 0; font-size: var(--fs-label); font-weight: 400; color: var(--ink-3); text-align: left; white-space: nowrap; }
.stack-table td { padding: 14px 12px 14px 0; border-top: 1px solid var(--rule); vertical-align: top; }
.stack-td-cve { min-width: 220px; }
.stack-td-cve .chip { text-decoration: none; }
.stack-summary { display: block; margin-top: 6px; font-size: var(--fs-meta); color: var(--ink-2); }
.stack-td-name { display: block; min-width: 160px; font-weight: 700; }
.stack-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stack-table th.stack-num { text-align: right; }
.stack-cvss { display: inline-block; min-width: 36px; padding: 0 6px; border-radius: 6px; text-align: center; }
.stack-cvss.is-critical { background: var(--brick); color: var(--page); font-weight: 700; }
.stack-cvss.is-high { color: var(--amber); font-weight: 700; }
.stack-td-status { white-space: nowrap; }
.stack-exploited { display: flex; align-items: center; gap: 6px; font-size: var(--fs-meta); }
.stack-td-date { white-space: nowrap; color: var(--ink-3); font-size: var(--fs-meta); }
.stack-broad-head { padding-top: 24px !important; }
.stack-match.is-broad td { color: var(--ink-2); }
.stack-articles { list-style: none; margin: 12px 0 0; padding: 0; }
.stack-article { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-top: 1px solid var(--rule); }
.stack-article:first-child { border-top: 0; }
.stack-article-title { font-size: var(--fs-table); font-weight: 700; line-height: 1.45; }

/* The guide's bar and its modal (B20) */
.stack-guide-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 32px; padding: 12px 12px 12px 20px; border-radius: 12px; background: var(--accent-fill); font-size: var(--fs-meta); }
.stack-guide-backdrop { position: fixed; inset: 0; z-index: 30; background: color-mix(in srgb, var(--ink) 32%, transparent); }
.stack-guide { position: fixed; z-index: 31; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; padding: 16px 32px 24px; border: 0; border-radius: 16px; background: var(--page); color: var(--ink); box-shadow: 0 24px 64px color-mix(in srgb, var(--ink) 24%, transparent); }
.stack-guide-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-right: -16px; }
.stack-guide-top form { margin: 0; }
.stack-guide-steps { display: flex; gap: 6px; list-style: none; margin: 4px 0 0; padding: 0; }
.stack-guide-steps li { flex: 1 1 0; height: 4px; border-radius: 2px; background: var(--rule); }
.stack-guide-steps li.is-past, .stack-guide-steps li.is-now { background: var(--accent); }
.stack-guide-q { margin: 20px 0 0; font-size: var(--fs-head); line-height: 1.3; letter-spacing: -.01em; font-weight: 700; }
.stack-guide-facts { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 10px 0 0; font-size: var(--fs-label); color: var(--ink-3); }
.stack-guide-facts div { display: flex; gap: 6px; }
.stack-guide-facts dt { margin: 0; }
.stack-guide-facts dd { margin: 0; color: var(--ink); }
.stack-guide-text { margin: 16px 0 0; font-size: var(--fs-body); line-height: 1.6; color: var(--ink-2); }
.stack-guide .stack-add { margin-top: 16px; }
.stack-guide .stack-items { margin-top: 12px; }
.stack-lenses fieldset { margin: 16px 0 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 4px; }
.stack-lens { display: flex; align-items: center; gap: 12px; min-height: var(--touch); padding: 8px 12px; border-radius: 10px; background: var(--quiet); cursor: pointer; }
.stack-lens input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: 0 0 auto; }
.stack-lens.is-coming { cursor: default; color: var(--ink-3); }
.stack-lens-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.stack-lens-name { font-size: var(--fs-table); font-weight: 700; }
.stack-lens.is-coming .stack-lens-name { font-weight: 400; }
.stack-guide-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 28px; }
.stack-guide-foot form { margin: 0; }
.stack-guide-spacer { flex: 1 1 auto; }

@media (max-width: 760px) {
  .stack-page { margin-top: 24px; }
  .stack-lead { font-size: var(--fs-body); }
  .stack-section { margin-top: 36px; padding-top: 28px; }
  .stack-item { flex-wrap: wrap; gap: 8px 12px; }
  .stack-item-body { flex: 1 1 0; } /* beside the grade circle (B612) and the remove button */
  .stack-item-hits { order: 3; justify-content: flex-start; flex-basis: 100%; }
  .stack-guide { padding: 12px 20px 20px; max-height: calc(100vh - 32px); }
  .stack-guide-top { margin-right: -8px; }
  .stack-add-row { flex-wrap: wrap; }
  .stack-add-btn { flex: 1 1 100%; justify-content: center; }
}
