﻿/* Shared navigation and reading surfaces */
.mobile-actions, .bottom-navigation { display: none; }
.navigation a { min-height: 44px; }
.brand { min-height: 44px; }
.topbar-inner > *, .workspace, .star-stage, .star-content { min-width: 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--blue); }
.governance-tabs { margin-bottom: 18px; }
.governance-tabs a { text-decoration: none; }
.governance-tabs a[aria-current="page"] {
  border-color: #BFDBFE; color: #1D4ED8; background: var(--white);
}
.drawer-body { min-width: 0; overflow-wrap: anywhere; }
img { max-width: 100%; }
.tone-C { color: #9A3412; background: #FFF2E8; }
.priority-B { --accent: #D97706; }
.priority-C { --accent: #EA580C; }
.ai-badge { font-size: 12px; border-radius: 99px; padding: 4px 10px; border: 1px solid transparent; }
.ai-tailwind { color: #065F46; background: #CCFBE4; border-color: #A7F3D0; }
.ai-risk { color: #9A3412; background: #FFEDD5; border-color: #FED7AA; }
.ai-steady { color: #365375; background: #EFF6FF; border-color: #DBEAFE; }
.chain-filters select { min-width: 0; }
.chain-section { margin-bottom: 24px; }
.overview-grid { scroll-margin-top: 84px; }
.tailwind-panel { border-left: 4px solid #10B981; }
.critique-panel { border-left: 4px solid #F97316; }
.assessment-verdict { font-weight: 750; margin: 9px 0 5px; }

/* Discovery */
.feed-layout { width: min(700px, 100%); margin-inline: auto; }
.feed-heading { padding: 7px 2px 22px; }
.feed-heading p { font-size: 15px; margin-top: 5px; }
.feed-controls { padding: 14px 15px 5px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
.feed-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.feed-tab { min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--white); color: var(--muted); font-size: 13px; font-weight: 700; }
.feed-tab:hover, .feed-tab[aria-pressed="true"] { color: #1D4ED8; border-color: #BFDBFE; background: #EFF6FF; }
.feed-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 8px; margin-top: 4px; }
.feed-tools .inline { gap: 3px; }
.feed-status { padding-inline: 5px; }
.feed-stream { display: grid; gap: 15px; margin: 15px 0; }
.feed-card { min-width: 0; padding: 20px 23px 7px; overflow-wrap: anywhere; }
.feed-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; color: var(--muted); font-size: 12px; }
.feed-sub { font-weight: 600; }
.feed-meta time { margin-left: auto; color: #52637A; font-variant-numeric: tabular-nums; }
.feed-kind { padding: 4px 8px; border-radius: 99px; font-size: 12px; }
.kind-chain { color: #1D4ED8; background: #DBEAFE; }
.kind-document { color: #6B21A8; background: #F3E8FF; }
.kind-lighthouse { color: #92400E; background: #FEF3C7; }
.kind-macro { color: #115E59; background: #CCFBF1; }
.feed-card h2 { font-size: clamp(20px, 2vw, 25px); margin: 11px 0 7px; letter-spacing: -.022em; }
.feed-summary { font-size: 16px; line-height: 1.7; margin: 8px 0 12px; }
.feed-points { list-style: none; padding: 10px 13px; border-radius: 12px; background: var(--page); display: grid; gap: 6px; }
.feed-points li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 8px; line-height: 1.7; }
.feed-points strong { color: #1D4ED8; font-weight: 750; white-space: nowrap; }
.feed-points li:nth-child(2) strong { color: #047857; }
.feed-points li:nth-child(3) strong { color: #9A3412; }
.feed-image { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin: 14px 0 0; border-radius: 12px; }
.feed-image.legacy-cover { filter: invert(1) hue-rotate(180deg) saturate(.75) brightness(1.05); }
.feed-more { display: flex; margin-inline: auto; }

.item-interactions { margin-top: 12px; border-top: 1px solid var(--line); }
.interaction-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 9px; }
.reaction {
  min-height: 44px; min-width: 44px; max-width: 100%; border: 0; border-radius: 9px;
  padding: 6px 8px; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  color: var(--muted); background: transparent; font-weight: 700; line-height: 1.35;
}
.reaction:hover, .reaction[aria-expanded="true"], .toggle-latest[aria-pressed="true"] { background: #EFF6FF; color: #1D4ED8; }
.reaction-glyph { font-size: 17px; line-height: 1; }
.reaction-count { font-variant-numeric: tabular-nums; }
.reaction-like[aria-pressed="true"] { color: #BE123C; }
.reaction-bookmark[aria-pressed="true"] { color: #9A5400; }
.reaction-bookmark[aria-pressed="true"] .reaction-glyph { color: #AD6800; }
.count-pop { animation: count-pop 260ms ease-out; }
@keyframes count-pop { 45% { transform: translateY(-3px) scale(1.22); } }
.detail-link { color: #1D4ED8; }
.interaction-bar .detail-link { margin-left: auto; }
.interaction-status { font-size: 13px; color: #BE123C; }
.interaction-status:not(:empty) { padding-block: 4px; }
.comments-region { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 200ms ease, visibility 0s 200ms; }
.comments-region.is-open { grid-template-rows: 1fr; visibility: visible; transition-delay: 0s; }
.comments-inner { min-height: 0; overflow: hidden; }
.comment-list { list-style: none; padding: 0; }
.comment-entry { padding: 2px 8px 8px; border-bottom: 1px solid var(--line); }
.comment-entry p { white-space: pre-wrap; overflow-wrap: anywhere; padding-bottom: 5px; }
.comment-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 9px; }
.comment-meta .remove-comment { margin-left: auto; color: #9F1239; font-size: 12px; }
.comment-form { display: flex; align-items: end; gap: 8px; padding: 8px 5px 10px; }
.comment-form .button { min-height: 44px; flex: none; }
.comment-input { width: 100%; min-width: 0; resize: vertical; font: inherit; font-size: 16px; }
.comment-input:focus-visible { outline-offset: 0; }

/* One-hop knowledge map */
.star-layout { display: grid; grid-template-columns: minmax(215px, 267px) minmax(0, 1fr); align-items: start; gap: 23px; }
.star-sidebar { padding: 11px; position: sticky; top: 84px; max-height: calc(100dvh - 97px); overflow: auto; }
.star-sidebar > input { display: block; width: 100%; }
.star-outline { margin-top: 8px; }
.star-outline summary { min-height: 44px; padding: 10px 5px; cursor: pointer; font-weight: 750; }
.outline-group { margin: 3px 0 6px; border-top: 1px solid var(--line); }
.outline-group summary { padding-left: 6px; color: #29415F; }
.outline-row {
  display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 7px;
  width: 100%; min-height: 44px; padding: 4px 7px; text-align: left; line-height: 1.35;
  border: 0; border-radius: 7px; background: var(--white); font-weight: 650;
}
.outline-all { display: block; color: #1D4ED8; }
.outline-row:hover, .outline-row[aria-pressed="true"] { background: #EFF6FF; color: #1D4ED8; }
.outline-count { font-size: 12px; font-variant-numeric: tabular-nums; padding: 2px 6px; border-radius: 50px; color: var(--muted); background: #F1F5F9; }
.star-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; margin-bottom: 15px; }
.star-heading h2, .star-content, .macro-detail { scroll-margin-top: 84px; }
.star-matrix-section + .star-matrix-section { margin-top: 25px; }
.star-matrix-section h3 { margin-bottom: 9px; font-size: 17px; }
.matrix-count { margin-left: 8px; color: var(--muted); font-size: 12px; }
.map-matrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr)); gap: 10px; }
.map-card { padding: 13px; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.map-card h4 { font-size: 16px; }
.map-card p { overflow-wrap: anywhere; }
.map-card-actions { margin-top: auto; gap: 4px; }
.star-drawer .dossier-header .inline { margin: 12px 0; }
.star-detail-relations { margin-top: 16px; }
.focus-links { display: grid; gap: 7px; margin-top: 8px; }
.focus-link { padding: 11px; }
.focus-link p { margin: 4px 0 7px; }
.focus-count { margin-bottom: 9px; }
.focus-canvas {
  position: relative; display: grid; grid-template-areas: "tech tech tech" "business center support" "related related related";
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.22fr) minmax(0, 1fr);
  align-items: center; gap: 29px; padding: 14px; background: var(--white); border: 1px solid var(--line); border-radius: 16px;
}
.focus-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.focus-central { position: relative; grid-area: center; border: 2px solid #93C5FD; padding: 12px; min-width: 0; }
.focus-central h3 { font-size: 19px; margin: 6px 0; }
.focus-central .inline { margin-top: 9px; gap: 3px; }
.focus-marker { color: #1D4ED8; font-size: 12px; font-weight: 800; margin-bottom: 5px; }
.focus-cluster { --relation: #2563EB; position: relative; min-width: 0; padding: 9px; background: var(--page); border: 1px solid var(--line); border-radius: 10px; }
.relation-label { display: table; border-radius: 60px; padding: 3px 7px; margin: 0 auto 7px; color: var(--relation); background: var(--white); font-size: 13px; }
.cluster-tech { grid-area: tech; --relation: #0E7490; }
.cluster-business { grid-area: business; --relation: #9A5400; }
.cluster-support { grid-area: support; --relation: #047857; }
.cluster-related { grid-area: related; --relation: #6D28D9; }
.cluster-tech, .cluster-related { justify-self: center; width: min(94%, 700px); }
.cluster-tech .focus-neighbors, .cluster-related .focus-neighbors { grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr)); }
.focus-neighbors { display: grid; gap: 6px; }
.focus-peer { min-width: 0; padding: 3px; border: 1px solid var(--line); background: var(--white); border-radius: 8px; }
.focus-node { display: grid; width: 100%; min-height: 44px; padding: 5px; border: 0; border-radius: 5px; text-align: left; background: var(--white); gap: 3px; overflow-wrap: anywhere; }
.focus-node strong { color: var(--ink); font-size: 15px; }
.focus-node:hover { background: #EFF6FF; }
.focus-node span { font-size: 13px; }
.relation-note { font-size: 12px; }
.focus-none { text-align: center; }

/* Market metrics and decision links */
.macro-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.macro-figure { min-width: 0; padding: 16px 16px 8px; }
.macro-figure h2 { font-size: 18px; }
.macro-chart { height: clamp(235px, 29vh, 315px); }
.macro-sources { margin-top: 8px; color: var(--muted); font-size: 13px; }
.macro-sources summary { min-height: 44px; padding: 10px 0; cursor: pointer; }
.macro-sources .inline { gap: 8px 15px; margin-top: 4px; }
.macro-sources a { display: inline-flex; align-items: center; min-height: 44px; }
.macro-opportunities, .macro-regions { margin-top: 25px; }
.market-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.market-opportunity, .market-category { padding: 15px; min-width: 0; overflow-wrap: anywhere; }
.market-opportunity { display: flex; flex-direction: column; }
.market-opportunity p { margin-top: 6px; }
.market-opportunity.featured { border-color: #BBF7D0; border-top: 3px solid #10B981; }
.macro-chain-links { display: flex; flex-wrap: wrap; align-items: start; gap: 2px; padding-top: 5px; }
.market-opportunity .macro-chain-links { margin-top: auto; }
.macro-chain-links button { text-align: left; font-size: 13px; justify-content: start; }
.macro-tabs { margin: 10px 0 13px; }
.macro-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 9px 0; }
.macro-kpis dt { font-size: 13px; }
.macro-kpis dd { font-size: 21px; font-variant-numeric: tabular-nums; }
.region-note { font-size: 13px; }
.market-callout { padding: 9px 10px; border-radius: 8px; margin-top: 8px; background: var(--page); }
.market-callout h4 { margin-bottom: 3px; }
.market-gap { background: #ECFDF5; color: #065F46; }
.market-pain { background: #FFF7ED; color: #9A3412; }
.market-scale { color: #29415F; font-size: 13px; margin-top: 5px; }
.market-source { display: inline-flex; min-height: 44px; align-items: center; align-self: start; font-size: 13px; }
.market-entry { padding: 14px; margin-top: 12px; }
.market-entry p, .region-summary { margin-top: 5px; }

@media (width < 900px) {
  .topbar-inner { min-height: 60px; flex-wrap: nowrap; padding: 3px max(14px, env(safe-area-inset-right)) 3px max(14px, env(safe-area-inset-left)); }
  .navigation, .search-shell:not(.search-open) { display: none; }
  .mobile-actions { display: flex; gap: 4px; margin-left: auto; }
  .header-action {
    display: grid; place-items: center; width: 44px; height: 44px; font-size: 23px;
    background: var(--white); color: #29415F; border: 1px solid var(--line); border-radius: 12px; text-decoration: none;
  }
  .header-action .icon { width: 20px; height: 20px; }
  body:has(.feed-layout[data-channel="saved"]) #saved-shortcut { color: #9A5400; background: #FFFBEB; border-color: #FDE68A; }
  #global-search { width: 100%; }
  #global-search input { flex: 1; width: auto; height: 44px; font-size: 16px; }
  #global-search kbd { display: none; }
  .search-shell { position: absolute; top: 100%; inset-inline: 0; padding: 9px max(14px, env(safe-area-inset-right)) 9px max(14px, env(safe-area-inset-left)); background: var(--white); box-shadow: var(--shadow); }
  .search-results { width: auto; right: 12px; left: 12px; top: calc(100% + 1px); }
  .search-entry { min-height: 44px; }
  .bottom-navigation {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px;
    position: fixed; z-index: 9; inset: auto 0 0; padding: 4px max(8px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -6px 22px #0F172A0A;
  }
  .bottom-navigation a { display: grid; place-content: center; justify-items: center; gap: 3px; min-height: 51px; text-decoration: none; font-size: 11px; font-weight: 750; color: var(--muted); border-radius: 10px; }
  .bottom-navigation a .icon { width: 19px; height: 19px; }
  .bottom-navigation a[aria-current="page"] { color: #1D4ED8; background: #EFF6FF; }
  .workspace { padding: 0 max(14px, env(safe-area-inset-right)) calc(58px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  main { padding: 20px 0 28px; }
  .site-footer a { display: inline-flex; align-items: center; min-height: 44px; }
  .site-footer { padding: 1px 0; }
  button, button[class], .segment-button, .select, .field { min-height: 44px; min-width: 44px; }
  .icon-button { min-width: 44px; }
  .select, .field { font-size: 16px; }
  .drawer { inset: auto 0 0; width: 100%; border: 0; }
  .drawer[open] { animation: slide-up 210ms ease-out; }
  .drawer-bar { padding-top: max(7px, env(safe-area-inset-top)); padding-inline: max(13px, env(safe-area-inset-left)) max(13px, env(safe-area-inset-right)); }
  .drawer-body { padding-bottom: calc(17px + env(safe-area-inset-bottom)); }
  @keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .star-layout, .macro-compare { grid-template-columns: minmax(0, 1fr); }
  .star-sidebar { position: static; max-height: none; }
  .star-outline[open] { max-height: min(62dvh, 580px); overflow: auto; }
  .star-heading h2, .star-content, .macro-detail, .overview-grid { scroll-margin-top: 72px; }
  .focus-canvas { display: flex; flex-direction: column; align-items: stretch; padding: 10px; gap: 9px; }
  .focus-cluster { width: 100%; padding-left: 10px; border-left: 3px solid var(--relation); }
  .focus-lines { display: none; }
  .relation-label { margin-left: 0; }
}
@media (width <= 600px) {
  .page-heading, .section-heading { flex-wrap: wrap; }
  .page-heading { margin-bottom: 15px; }
  .segments { max-width: 100%; }
  .workspace:has(.feed-layout) { padding-inline: 0; }
  .workspace:has(.feed-layout) .site-footer { margin-inline: 14px; }
  .feed-layout { width: 100%; }
  .feed-heading { padding: 0 15px 15px; }
  .feed-controls { padding: 11px 13px 3px; border-left: 0; border-right: 0; border-radius: 0; }
  .feed-tab { padding-inline: 9px; font-size: 13px; }
  .feed-card { padding: 15px 14px 4px; border-radius: 0; border-left: 0; border-right: 0; }
  .feed-stream { gap: 9px; margin-top: 9px; }
  .feed-meta { gap: 4px 6px; }
  .feed-summary { font-size: 16px; }
  .feed-points { padding-inline: 9px; }
  .feed-points li { gap: 6px; }
  .interaction-bar { gap: 0 2px; }
  .interaction-bar .reaction { padding-inline: 5px; font-size: 13px; }
  .interaction-bar .detail-link { font-size: 12px; }
  .map-matrix, .market-grid, .macro-kpis, .hard-metrics, .kpi-strip, .dossier-meta, .summary-grid,
  .watch-panel .ranked-list, .gate-grid, .coverage-grid, .method-library, .scenario-grid, .md-card-grid,
  .cluster-tech .focus-neighbors, .cluster-related .focus-neighbors { grid-template-columns: minmax(0, 1fr); }
  .macro-kpis .metric { display: flex; align-items: center; justify-content: space-between; gap: 5px 9px; flex-wrap: wrap; }
  .macro-kpis dd { margin: 0; font-size: 19px; }
  .macro-figure { padding-inline: 10px; }
  .macro-chart { height: clamp(205px, 28vh, 260px); }
  .opportunity-chart { height: clamp(250px, 38vh, 315px); }
  .value-chart, .radar-chart { height: clamp(225px, 33vh, 265px); }
  .chain-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chain-filters .field, .chain-filters .toolbar-count { grid-column: 1 / -1; }
  .chain-filters .select { width: 100%; font-size: 14px; padding-inline: 7px; }
  .story-details summary, .audit-case summary { min-height: 44px; padding-block: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .comments-region { transition: none; }
  .count-pop, .drawer[open] { animation: none; }
}
