/* Good company component layer: comparison, evidence profiles and compare dialog. */
.directory-section,
.profile,
.related-products,
#compare-dialog {
  --component-lime: #d9ed58;
  --component-coral: #ec6955;
  --component-white: #fffef8;
}

/* Comparison controls */
.directory-section {
  min-width: 0;
  margin-block: 32px 56px;
  scroll-margin-top: 24px;
}

.directory-section .section-title {
  align-items: end;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink);
}

.directory-section .section-title h2 {
  margin: 0;
  font-size: clamp(30px, 3.5vw, 44px);
}

.directory-section .table-options {
  margin: 0 0 16px;
}

.directory-section .table-options > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1.5px solid var(--ink);
  background: var(--paper-2);
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  list-style: none;
}

.directory-section .table-options > summary::-webkit-details-marker { display: none; }
.directory-section .table-options > summary::after { content: "+"; color: var(--accent); font-size: 24px; line-height: 1; }
.directory-section .table-options[open] > summary { margin-bottom: 14px; }
.directory-section .table-options[open] > summary::after { content: "−"; }
.directory-section [data-role="filter-count"] { color: var(--muted); font-size: 14px; font-weight: 600; }

.directory-section .table-toolbar {
  gap: 16px;
  padding: clamp(16px, 2.5vw, 24px);
  border: 1.5px solid var(--line-strong);
  background: var(--component-white);
  box-shadow: 4px 4px 0 var(--paper-2);
}

.directory-section .table-toolbar label,
.directory-section .requirements legend { color: var(--ink); font-size: 16px; }

.directory-section input[type="search"],
.directory-section select {
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}

.directory-section input[type="search"]:focus-visible,
.directory-section select:focus-visible,
.directory-section button:focus-visible,
.profile a:focus-visible,
.profile summary:focus-visible,
.related-products a:focus-visible,
#compare-dialog a:focus-visible,
#compare-dialog button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.directory-section .requirements {
  padding: 0 0 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.directory-section .requirements legend { padding: 0 0 8px; font-weight: 800; }
.directory-section .requirements p { max-width: 70ch; margin-bottom: 16px; color: var(--muted); font-size: 16px; }
.directory-section .requirement-grid { gap: 14px 28px; }
.directory-section .requirement-option { gap: 10px; }
.directory-section .requirement-option label { align-items: flex-start; min-height: 48px; }
.directory-section .requirement-option label > span > span { font-size: 14px; line-height: 1.5; }
.directory-section .requirement-option input { accent-color: var(--accent); }
.directory-section .requirement-option > a { min-height: 44px; color: var(--accent); font-weight: 700; }
.directory-section .table-toolbar [data-action="reset"] { min-height: 48px; }

.directory-section .active-requirements { gap: 8px; margin-block: 16px; }
.directory-section .active-requirements > * {
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 14px;
}

.directory-section .results-bar { margin: 16px 0; }
.directory-section .compare-actions { gap: 10px; }
.directory-section .compare-actions .button { min-height: 48px; border-radius: 3px; }
.directory-section .compare-actions .button:not(:disabled):hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.directory-section .compare-actions [data-role="selection"] { font-size: 16px; }

/* Dense but readable comparison table; scrolling stays native inside .table-scroll. */
.directory-section .table-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: var(--component-white);
  box-shadow: 5px 5px 0 var(--paper-2);
  scrollbar-color: var(--accent) var(--paper-2);
}

.directory-section .compare-table { border-collapse: separate; border-spacing: 0; color: var(--ink); }
.directory-section .compare-table th,
.directory-section .compare-table td {
  position: static;
  padding: 15px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--component-white);
  vertical-align: middle;
}

.directory-section .compare-table th:last-child,
.directory-section .compare-table td:last-child { border-right: 0; }
.directory-section .compare-table thead th { background: var(--ink); color: var(--paper); font-weight: 700; }
.directory-section .compare-table thead .is-focus { background: var(--accent); color: #fff; }
.directory-section .compare-table thead .column-sort { min-height: 48px; color: inherit; font-size: 15px; }
.directory-section .compare-table tbody tr:nth-child(even) > * { background: var(--paper-2); }
.directory-section .compare-table tbody tr:hover > * { background: #f3f2e6; }
.directory-section .compare-table tbody tr:last-child > * { border-bottom: 0; }
.directory-section .compare-table tbody td[data-col] { vertical-align: top; }
.directory-section .compare-table .is-focus { background: #e9edff; }
.directory-section .compare-table .logo-cell { padding-inline: 10px; }
.directory-section .compare-table .product-logo { width: 34px; height: 34px; }
.directory-section .compare-table .item-cell { min-width: 0; }
.directory-section .item-name { align-items: center; gap: 8px; }
.directory-section .rank-number { color: var(--muted); font-size: 14px; }
.directory-section .row-selector { min-width: 44px; min-height: 44px; }
.directory-section .row-select { accent-color: var(--accent); }
.directory-section .name-link { padding-block: 6px; color: var(--ink); font-size: 16px; font-weight: 750; line-height: 1.35; overflow-wrap: anywhere; }
.directory-section .name-link:hover { color: var(--accent); text-decoration-thickness: 2px; }
.directory-section .model-access { color: var(--muted); font-size: 14px; line-height: 1.4; }
.directory-section .compare-table caption:not(.sr-only) { padding: 16px; border-top: 1px solid var(--line); background: var(--paper-2); color: var(--muted); font-size: 16px; }

/* Keep every score badge at its shared 100 x 56 size; notes stay underneath. */
.directory-section .score-link { display: block; min-height: 44px; color: inherit; text-decoration: none; }
.directory-section .score-link:hover .rating,
.directory-section .score-link:hover .bds-badge { outline: 2px solid var(--ink); outline-offset: 2px; }
.directory-section .score-stack { align-items: flex-start; gap: 6px; max-width: 132px; }
.directory-section .score-note { max-width: 132px; color: var(--muted); font-size: 16px; line-height: 1.35; }
.directory-section .empty { margin-top: 16px; border: 1.5px solid var(--line-strong); background: var(--paper-2); }

/* Product profiles: four equal columns, then two on compact screens. */
.profile { min-width: 0; }
.profile .profile-intro { margin-bottom: 28px; }
.profile .profile-title { align-items: center; gap: 16px; margin-bottom: 16px; }
.profile .profile-title .product-logo { width: 48px; height: 48px; }
.profile .profile-title h1 { margin: 0; color: var(--ink); }
.profile .profile-summary { max-width: 72ch; margin-bottom: 18px; color: var(--muted); font-size: 18px; line-height: 1.6; }
.profile .profile-actions,
.profile .profile-uses { gap: 6px 18px; }
.profile .profile-actions a,
.profile .profile-uses a { min-height: 44px; color: var(--accent); font-size: 16px; font-weight: 700; }

.profile .profile-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 24px;
}

.profile .profile-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  min-height: 204px;
  gap: 10px;
  padding: 16px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: var(--component-white);
  box-shadow: 3px 3px 0 var(--paper-2);
  color: var(--ink);
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.profile .profile-metric:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.profile .profile-metric > .score-stack { gap: 6px; }
.profile .profile-metric > .score-stack > .score-note { display: none; }
.profile .profile-metric .metric-label { min-height: 44px; color: var(--ink); font-size: 16px; font-weight: 800; line-height: 1.35; }
.profile .profile-metric .metric-notes { display: grid; gap: 5px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.profile .profile-metric .score-note { max-width: 100%; font-size: 14px; }

.profile .profile-extras { gap: 14px; margin-block: 24px; }
.profile .profile-extra,
.profile .capability-profile {
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--paper-2);
}

.profile .profile-extra summary { width: 100%; min-height: 52px; padding: 12px 16px; color: var(--ink); font-size: 16px; font-weight: 800; }
.profile .profile-extra > div { padding: 4px 16px 16px; color: var(--ink); font-size: 16px; line-height: 1.6; }
.profile .profile-extra a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 700; }

/* Findings pair the claim and score; practical evidence opens only when requested. */
.profile .profile-finding {
  padding: 26px 0 30px;
  border-top: 1.5px solid var(--line-strong);
  scroll-margin-top: 24px;
}

.profile .finding-heading { grid-template-columns: minmax(0, 1fr) auto 44px; align-items: center; gap: 16px; margin-bottom: 14px; }
.profile .finding-heading h2 { margin: 0; color: var(--ink); font-size: clamp(26px, 3vw, 36px); }
.profile .finding-score { display: block; min-width: 100px; }
.profile .finding-score .score-stack { gap: 6px; }
.profile .back-to-scores { width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--accent); font-size: 20px; }
.profile .profile-finding > p { max-width: 76ch; margin: 0 0 12px; color: var(--ink); font-size: 16px; line-height: 1.7; }
.profile .finding-details,
.profile .profile-sources { max-width: 76ch; }
.profile .finding-details summary,
.profile .profile-sources > summary,
.profile .practical-evidence > summary {
  display: flex;
  align-items: center;
  width: fit-content;
  min-height: 44px;
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
}

.profile .finding-details[open] summary,
.profile .profile-sources[open] > summary { margin-bottom: 8px; }
.profile .assessment-note { padding: 16px 20px; border-left: 4px solid var(--accent); background: var(--paper-2); color: var(--ink); font-size: 16px; line-height: 1.7; }
.profile .assessment-note > p { margin-bottom: 14px; }
.profile .assessment-note a,
.profile .finding-sources a,
.profile .sources a { color: var(--accent); font-weight: 650; }
.profile .finding-sources,
.profile .sources { font-size: 16px; line-height: 1.55; }
.profile .finding-sources li,
.profile .sources li { margin-block: 10px; }

.profile .practical-profile {
  margin: 28px 0 40px;
  padding: 0 18px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: var(--component-white);
  box-shadow: 5px 5px 0 var(--paper-2);
}

.profile .practical-section { border-bottom: 1px solid var(--line-strong); }
.profile .practical-section:last-child { border-bottom: 0; }
.profile .practical-section > summary {
  position: relative;
  min-height: 58px;
  padding: 14px 42px 14px 4px;
  color: var(--ink);
  font: 700 21px/1.35 var(--serif);
  list-style: none;
}

.profile .practical-section > summary::-webkit-details-marker { display: none; }
.profile .practical-section > summary::after { content: "+"; position: absolute; top: 12px; right: 6px; color: var(--accent); font: 26px/1 var(--sans); }
.profile .practical-section[open] > summary::after { content: "−"; }
.profile .practical-section > p,
.profile .practical-section section { max-width: 76ch; color: var(--ink); font-size: 16px; line-height: 1.7; }
.profile .practical-section section { padding: 12px 0 18px; }
.profile .practical-section h3 { margin: 10px 0 8px; color: var(--ink); font: 700 20px/1.35 var(--serif); }
.profile .practical-section p { margin-bottom: 10px; }
.profile .practical-evidence { margin-top: 8px; }
.profile .practical-evidence > summary { text-decoration: underline; text-underline-offset: 4px; }
.profile .practical-evidence .finding-sources { margin-top: 0; }
.profile .energy-breakdown { margin-block: 18px; }
.profile .energy-breakdown > div { padding: 14px 0; border-top: 1px solid var(--line); }
.profile .energy-breakdown dt { display: flex; justify-content: space-between; gap: 16px; color: var(--ink); font-size: 16px; }
.profile .energy-breakdown dd { margin-top: 8px; color: var(--muted); font-size: 16px; line-height: 1.6; }

.profile .capability-profile { margin-block: 28px; padding: 0 18px 16px; }
.profile .capability-profile > summary { min-height: 56px; color: var(--ink); font: 700 22px/1.4 var(--serif); }

/* Related tools and side-by-side comparison */
.related-products {
  margin-top: 36px;
  padding: 26px 0 0;
  border-top: 2px solid var(--ink);
}

.related-products h2 { margin-bottom: 18px; color: var(--ink); font-size: clamp(26px, 3vw, 34px); }
.related-products ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.related-products li { min-width: 0; padding: 14px 16px; border: 1px solid var(--line-strong); background: var(--paper-2); }
.related-products li > a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.related-products li > a:hover { color: var(--accent); }
.related-products li > span { color: var(--muted); font-size: 14px; }

#compare-dialog {
  width: min(1120px, calc(100% - 32px));
  max-height: min(90dvh, 900px);
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 7px 7px 0 var(--ink);
}

#compare-dialog::backdrop { background: rgb(32 52 121 / 62%); }
#compare-dialog .dialog-head { position: sticky; top: 0; z-index: 1; padding: 18px 22px; border-bottom: 1.5px solid var(--ink); background: var(--paper-2); }
#compare-dialog .dialog-head h2 { margin: 0; color: var(--ink); font-size: 30px; }
#compare-dialog .dialog-head .button { min-height: 44px; border-radius: 3px; }
#compare-dialog .dialog-grid { max-height: calc(min(90dvh, 900px) - 78px); overflow: auto; overscroll-behavior: contain; }
#compare-dialog .dialog-col { min-width: 0; padding: clamp(16px, 2.4vw, 26px); border-right: 1px solid var(--line-strong); }
#compare-dialog .dialog-col h3 { margin: 0 0 12px; font: 700 22px/1.35 var(--serif); }
#compare-dialog .dialog-col h3 a { color: var(--ink); text-decoration-thickness: 1px; }
#compare-dialog .dialog-col > p { color: var(--muted); font-size: 16px; line-height: 1.55; }
#compare-dialog .dialog-dims { margin: 20px 0 0; }
#compare-dialog .dialog-dims li { grid-template-columns: minmax(100px, 1fr) 132px; gap: 10px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
#compare-dialog .dialog-dims li > a { display: flex; align-items: center; min-height: 44px; color: var(--ink); font-size: 16px; font-weight: 700; }
#compare-dialog .dialog-dims .score-stack { max-width: 132px; gap: 6px; }
#compare-dialog .dialog-dims .score-note { max-width: 132px; color: var(--muted); font-size: 14px; line-height: 1.4; }

@media (max-width: 900px) {
  .profile .profile-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #compare-dialog { width: min(760px, calc(100% - 28px)); }
  #compare-dialog .dialog-grid { grid-template-columns: 1fr; }
  #compare-dialog .dialog-col { border-right: 0; border-bottom: 1px solid var(--line-strong); }
  #compare-dialog .dialog-col:last-child { border-bottom: 0; }
}

@media (max-width: 600px) {
  .directory-section { margin-block: 24px 40px; }
  .directory-section .table-options > summary { min-height: 48px; padding-inline: 12px; }
  .directory-section .table-toolbar { padding: 14px; }
  .directory-section .requirement-grid { grid-template-columns: 1fr; }
  .directory-section .compare-actions { width: 100%; }
  .directory-section .compare-actions .button { flex: 1 1 auto; }
  .profile .profile-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .profile .profile-metric { min-height: 190px; padding: 12px; }
  .profile .finding-heading { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .profile .finding-score { grid-column: 2; grid-row: 1; }
  .profile .finding-heading h2 { grid-column: 1; grid-row: 1; font-size: 25px; }
  .profile .back-to-scores { display: none; }
  .profile .assessment-note { padding: 14px; }
  .profile .practical-profile { padding-inline: 12px; }
  .related-products ul { grid-template-columns: 1fr; }
  #compare-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); }
  #compare-dialog .dialog-head { padding: 14px; }
  #compare-dialog .dialog-head h2 { font-size: 26px; }
  #compare-dialog .dialog-grid { max-height: calc(100dvh - 84px); }
  #compare-dialog .dialog-col { padding: 16px; }
  #compare-dialog .dialog-dims li { grid-template-columns: minmax(0, 1fr) 132px; }
}

@media (prefers-reduced-motion: reduce) {
  .profile .profile-metric { transition: none; }
}

/* One score sheet keeps the profile compact and the eight headline values aligned. */
.profile .profile-metrics{gap:0;border:1.5px solid var(--ink);border-radius:3px;background:var(--component-white);box-shadow:4px 4px 0 var(--paper-2);overflow:hidden}
.profile .profile-metric{min-height:0;border:0;border-right:1px solid var(--line);border-bottom:1px solid var(--line);border-radius:0;box-shadow:none;padding:18px 16px;gap:8px;transition:none}
.profile .profile-metric:nth-child(4n){border-right:0}.profile .profile-metric:nth-last-child(-n+4){border-bottom:0}
.profile .profile-metric:hover{transform:none;box-shadow:none;background:#f4f1dc}
.profile .profile-metric .metric-label{min-height:22px}.profile .profile-metric .metric-notes{gap:3px}
@media(max-width:900px){.profile .profile-metric:nth-child(4n){border-right:1px solid var(--line)}.profile .profile-metric:nth-child(2n){border-right:0}.profile .profile-metric:nth-last-child(-n+4){border-bottom:1px solid var(--line)}.profile .profile-metric:nth-last-child(-n+2){border-bottom:0}.profile .profile-metric{padding:16px 12px;min-height:0}.profile .profile-metric .metric-label{min-height:44px}}
