.feed-tabs {
  grid-template-columns: repeat(4, minmax(104px, 1fr));
}

.stock-analysis-panel {
  min-width: 0;
}

.stock-analysis-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
  gap: 28px;
  align-items: end;
  padding: 2px 4px 22px;
  border-bottom: 1px solid var(--line);
}

.stock-analysis-intro h2 {
  margin: 0;
  font-size: 26px;
}

.stock-analysis-intro p:not(.eyebrow) {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.stock-tool-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  align-self: center;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #f5f7f6;
}

.stock-tool-switch button {
  min-height: 38px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.stock-tool-switch button.is-active {
  background: #fff;
  color: var(--green-dark);
  box-shadow: 0 1px 4px rgb(18 50 39 / 12%);
}

.stock-ranking-workspace,
.stock-single-workspace {
  min-width: 0;
}

.stock-ranking-filters {
  display: grid;
  grid-template-columns: 1fr 1.15fr 0.8fr 1fr auto auto;
  gap: 10px;
  align-items: end;
  padding: 18px 4px;
  border-bottom: 1px solid var(--line);
}

.stock-ranking-filters > label:not(.stock-ranking-checkbox) {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.stock-ranking-filters label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stock-ranking-filters select,
.stock-ranking-filters input[type="number"] {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
}

.stock-ranking-checkbox {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.stock-ranking-checkbox input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--green);
}

.stock-ranking-filters > button {
  min-width: 104px;
  height: 40px;
}

.stock-ranking-loading,
.stock-ranking-empty {
  min-height: 180px;
  display: grid;
  align-content: center;
  justify-content: center;
  justify-items: center;
  gap: 8px;
  padding: 34px 20px;
  color: var(--muted);
  text-align: center;
}

.stock-ranking-loading {
  grid-template-columns: auto minmax(0, auto) auto;
  align-items: center;
  justify-items: start;
  text-align: left;
}

.stock-ranking-loading strong,
.stock-ranking-empty strong {
  color: var(--text);
  font-size: 17px;
}

.stock-ranking-loading p,
.stock-ranking-empty p {
  max-width: 720px;
  margin: 2px 0 0;
  line-height: 1.6;
}

#stockRankingProgress {
  min-width: 46px;
  color: var(--green-dark);
  font-size: 18px;
  font-weight: 800;
  text-align: right;
}

.stock-ranking-result {
  min-width: 0;
}

.stock-ranking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 4px 14px;
}

.stock-ranking-head h3,
.stock-watchlist-section h3 {
  margin: 1px 0 0;
  font-size: 20px;
}

.stock-ranking-head p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.stock-ranking-actions {
  display: flex;
  gap: 8px;
}

.stock-ranking-actions button {
  min-width: 88px;
  white-space: nowrap;
}

.stock-ranking-shortfall {
  margin: 0 4px 12px;
  border-left: 3px solid #d69b2d;
  background: #fff8e8;
  color: #6c4d0d;
  padding: 9px 11px;
  font-size: 13px;
}

.stock-ranking-table-wrap {
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.stock-ranking-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.stock-ranking-table th {
  height: 42px;
  background: #f5f7f6;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
}

.stock-ranking-table th,
.stock-ranking-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  vertical-align: middle;
}

.stock-ranking-table tbody tr:last-child td {
  border-bottom: 0;
}

.stock-ranking-table tbody tr:hover {
  background: #fbfcfc;
}

.stock-ranking-table th:nth-child(1),
.stock-ranking-table td:nth-child(1) {
  width: 52px;
  text-align: center;
}

.stock-ranking-table th:nth-child(2),
.stock-ranking-table td:nth-child(2) { width: 125px; }
.stock-ranking-table th:nth-child(3),
.stock-ranking-table td:nth-child(3) { width: 100px; }
.stock-ranking-table th:nth-child(4),
.stock-ranking-table td:nth-child(4) { width: 180px; }
.stock-ranking-table th:nth-child(5),
.stock-ranking-table td:nth-child(5) { width: 100px; }
.stock-ranking-table th:nth-child(7),
.stock-ranking-table td:nth-child(7) { width: 122px; }

.ranking-rank {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.ranking-rank strong {
  font-size: 19px;
}

.ranking-rank span {
  color: var(--muted);
  font-size: 10px;
}

.ranking-stock {
  display: grid;
  gap: 3px;
}

.ranking-stock strong {
  color: var(--text);
  font-size: 14px;
}

.ranking-stock span,
.ranking-stock small {
  color: var(--muted);
}

.ranking-score {
  display: grid;
  gap: 2px;
}

.ranking-score strong {
  color: var(--green-dark);
  font-size: 22px;
}

.ranking-score span,
.ranking-score small {
  color: var(--muted);
  font-size: 11px;
}

.ranking-dimensions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.ranking-dimensions span {
  display: grid;
  justify-items: center;
  gap: 2px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.ranking-dimensions span:last-child {
  border-right: 0;
}

.ranking-dimensions strong {
  color: var(--text);
  font-size: 13px;
}

.ranking-quote,
.ranking-judgement {
  display: grid;
  gap: 4px;
}

.ranking-quote small,
.ranking-judgement small {
  color: var(--muted);
}

.ranking-judgement strong,
.ranking-judgement span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-actions {
  display: flex;
  gap: 6px;
}

.ranking-actions button {
  min-width: 58px;
  min-height: 34px;
  padding: 0 9px;
  font-size: 12px;
}

.ranking-actions button.is-tracked {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
}

.stock-ranking-method {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 4px 20px;
  color: var(--muted);
  font-size: 12px;
}

.stock-ranking-method summary {
  cursor: pointer;
  color: var(--green-dark);
  font-weight: 700;
}

.stock-ranking-method details {
  max-width: 720px;
}

.stock-ranking-method details p {
  margin: 6px 0 0;
  line-height: 1.55;
}

.stock-watchlist-section {
  border-top: 1px solid var(--line-strong);
  padding: 20px 4px 4px;
}

.stock-watchlist-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
}

.stock-watchlist-section > header > span {
  color: var(--muted);
  font-size: 13px;
}

.stock-watchlist-rows {
  display: grid;
  border-top: 1px solid var(--line);
}

.stock-watchlist-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) 90px 90px minmax(130px, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.stock-watchlist-row > div {
  display: grid;
  gap: 2px;
}

.stock-watchlist-row span,
.stock-watchlist-row small {
  color: var(--muted);
  font-size: 11px;
}

.stock-watchlist-row button {
  min-width: 62px;
}

.stock-single-search {
  max-width: 620px;
  margin: 18px 4px 0 auto;
}

.stock-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.stock-search-form.is-disabled {
  opacity: 0.65;
}

.stock-search-field {
  position: relative;
  display: grid;
  gap: 6px;
}

.stock-search-field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stock-search-field input {
  height: 42px;
  border-color: var(--line-strong);
  background: #fff;
  font-size: 15px;
}

.stock-search-form > button {
  min-width: 108px;
  height: 42px;
}

.stock-search-suggestions {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  z-index: 22;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}

.stock-search-suggestions .suggestion-caption {
  padding: 8px 12px 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.stock-search-suggestions button {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  padding: 8px 12px;
  text-align: left;
}

.stock-search-suggestions button:hover {
  background: var(--green-soft);
}

.stock-search-suggestions button span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.stock-analysis-gate,
.stock-analysis-empty,
.stock-analysis-loading {
  min-height: 220px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  padding: 36px 24px;
  text-align: center;
}

.stock-analysis-gate strong,
.stock-analysis-empty strong,
.stock-analysis-loading strong {
  color: var(--text);
  font-size: 18px;
}

.stock-analysis-gate p,
.stock-analysis-empty p,
.stock-analysis-loading p {
  max-width: 620px;
  margin: 0;
  line-height: 1.6;
}

.stock-analysis-loading {
  min-height: 148px;
  grid-template-columns: auto minmax(0, auto);
  align-items: center;
  align-content: center;
  justify-content: center;
  justify-items: start;
  text-align: left;
}

.analysis-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--green-soft);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: analysis-spin 700ms linear infinite;
}

@keyframes analysis-spin {
  to { transform: rotate(360deg); }
}

.stock-analysis-result {
  display: grid;
}

.stock-result-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px auto;
  gap: 22px;
  align-items: center;
  padding: 22px 4px 18px;
  border-bottom: 1px solid var(--line);
}

.stock-identity,
.stock-quote-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

.stock-identity h2 {
  margin: 0;
  font-size: 26px;
}

.stock-identity .mono-text {
  color: var(--muted);
  font-size: 13px;
}

.stock-industry {
  border-left: 1px solid var(--line-strong);
  color: var(--blue);
  padding-left: 12px;
  font-size: 12px;
  font-weight: 700;
}

.stock-quote-line {
  margin-top: 8px;
}

.stock-quote-line > strong {
  font-size: 25px;
}

.stock-quote-line > span {
  font-size: 15px;
  font-weight: 750;
}

.stock-quote-line > small {
  color: var(--muted);
  font-size: 11px;
}

.stock-score-block {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1px 8px;
  padding-left: 18px;
  border-left: 3px solid var(--green);
}

.stock-score-block span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

.stock-score-block strong {
  font-size: 28px;
}

.stock-score-block small {
  align-self: end;
  padding-bottom: 4px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
}

.analysis-view-tabs {
  display: flex;
  overflow-x: auto;
  gap: 24px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
}

button.analysis-view-tab {
  min-width: max-content;
  min-height: 46px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 1px;
  font-size: 13px;
  font-weight: 750;
}

button.analysis-view-tab:hover,
button.analysis-view-tab.is-active {
  border-bottom-color: var(--green);
  background: transparent;
  color: var(--green-dark);
  box-shadow: none;
}

.analysis-view {
  display: grid;
}

.analysis-summary-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 0.48fr);
  gap: 34px;
  padding: 26px 4px;
  border-bottom: 1px solid var(--line);
}

.analysis-summary-band h3,
.analysis-section h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

.analysis-lead {
  max-width: 820px;
  margin: 12px 0 0;
  color: #283330;
  font-size: 16px;
  line-height: 1.8;
}

.dimension-score-list {
  display: grid;
  gap: 9px;
  align-content: center;
}

.dimension-score-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 28px;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.dimension-score-row > div {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #e8eeec;
}

.dimension-score-row i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--green);
}

.dimension-score-row strong {
  color: var(--text);
  font-size: 12px;
  text-align: right;
}

.analysis-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.analysis-two-column .analysis-section {
  border-bottom: 0;
  padding-right: 24px;
  padding-left: 4px;
}

.analysis-two-column .analysis-section + .analysis-section {
  border-left: 1px solid var(--line);
  padding-right: 4px;
  padding-left: 24px;
}

.analysis-section {
  min-width: 0;
  padding: 24px 4px 26px;
  border-bottom: 1px solid var(--line);
}

.analysis-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.analysis-section-head > span {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.analysis-section-head .eyebrow {
  margin-bottom: 2px;
}

.analysis-bullet-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding-left: 19px;
  line-height: 1.65;
}

.analysis-bullet-list li::marker {
  color: var(--green);
}

.analysis-bullet-list.risk-list li::marker {
  color: var(--red);
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
}

.scenario-item {
  min-width: 0;
  padding: 16px;
}

.scenario-item + .scenario-item {
  border-left: 1px solid var(--line);
}

.scenario-item > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.scenario-item > div span {
  color: var(--muted);
  font-size: 10px;
}

.scenario-item ul {
  min-height: 96px;
  display: grid;
  align-content: start;
  gap: 6px;
  margin: 13px 0;
  padding-left: 17px;
  color: #3f4947;
  font-size: 12px;
  line-height: 1.55;
}

.scenario-item p {
  margin: 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.scenario-item p span {
  display: block;
  color: var(--red);
  font-weight: 700;
}

.scenario-1 { border-top: 3px solid var(--red); }
.scenario-2 { border-top: 3px solid var(--blue); }
.scenario-3 { border-top: 3px solid var(--amber); }

.attribution-list,
.stock-news-list,
.report-sample-list {
  display: grid;
}

.attribution-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.attribution-item:first-child,
.stock-news-list article:first-child {
  border-top: 0;
}

.attribution-date {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.attribution-item h4,
.stock-news-list h4 {
  margin: 0;
  font-size: 14px;
}

.attribution-item p,
.stock-news-list p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.attribution-item > a,
.stock-news-list a,
.report-sample-list a,
.stock-data-sources a {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.attribution-returns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.stock-analysis-panel .is-positive { color: var(--red) !important; }
.stock-analysis-panel .is-negative { color: var(--green) !important; }
.stock-analysis-panel .is-neutral { color: var(--muted) !important; }

.stock-news-list article {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.stock-news-list time {
  color: var(--muted);
  font-size: 11px;
}

.analysis-empty-row {
  padding: 24px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.stock-price-chart {
  width: 100%;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
}

.stock-price-chart svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2.7 / 1;
}

.chart-grid-line { stroke: #e5e9e8; stroke-width: 1; }
.chart-axis-text { fill: #79837f; font-size: 10px; }
.chart-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-close-line { stroke: #17201f; }
.chart-ma20-line { stroke: #2456d8; }
.chart-ma60-line { stroke: #b17600; }
.chart-volume-up { fill: rgba(187, 45, 59, 0.45); }
.chart-volume-down { fill: rgba(8, 119, 93, 0.45); }
.legend-close { fill: #17201f; font-size: 10px; }
.legend-ma20 { fill: #2456d8; font-size: 10px; }
.legend-ma60 { fill: #9a6500; font-size: 10px; }

.stock-analysis-panel .metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.stock-analysis-panel .metric-cell {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stock-analysis-panel .metric-cell:nth-child(5n) {
  border-right: 0;
}

.stock-analysis-panel .metric-cell span,
.stock-analysis-panel .metric-cell small {
  color: var(--muted);
  font-size: 10px;
}

.stock-analysis-panel .metric-cell strong {
  overflow-wrap: anywhere;
  font-size: 16px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.analysis-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 12px;
}

.analysis-table th,
.analysis-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

.analysis-table th {
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.analysis-table th:first-child,
.analysis-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  text-align: left;
}

.analysis-table th:first-child {
  background: var(--panel-soft);
}

.analysis-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.analysis-table tr.is-target td {
  background: #edf8f4;
  font-weight: 700;
}

.valuation-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.valuation-metric-grid article {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
}

.valuation-metric-grid article.is-unavailable {
  opacity: 0.58;
}

.valuation-metric-grid article > div:first-child,
.valuation-metric-grid article p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.valuation-metric-grid article > div:first-child span {
  font-size: 19px;
  font-weight: 750;
}

.percentile-track {
  height: 8px;
  overflow: hidden;
  margin-top: 13px;
  border-radius: 4px;
  background: linear-gradient(90deg, #dcefe7 0 33%, #fff0cc 33% 66%, #f7d9dd 66% 100%);
}

.percentile-track i {
  display: block;
  height: 100%;
  border-right: 3px solid #17201f;
}

.valuation-metric-grid article p,
.valuation-metric-grid article small,
.method-note {
  color: var(--muted);
  font-size: 10px;
}

.method-note {
  margin: 13px 0 0;
  line-height: 1.65;
}

.report-sample-list {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.report-sample-list article {
  display: grid;
  grid-template-columns: minmax(170px, 0.35fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.report-sample-list article:first-child {
  border-top: 0;
}

.report-sample-list article > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
}

.report-sample-list article span,
.report-sample-list article time {
  color: var(--muted);
  font-size: 10px;
}

.report-sample-list article p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.backtest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.backtest-grid > article {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
}

.backtest-grid article > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.backtest-grid article > header span {
  color: var(--muted);
  font-size: 10px;
}

.backtest-grid article > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.backtest-grid .metric-cell {
  border-bottom: 0;
  padding: 10px 8px;
}

.backtest-grid article > p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.muted-list {
  color: var(--muted);
  font-size: 11px;
}

.stock-analysis-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px 18px;
  padding: 18px 4px 4px;
  color: var(--muted);
  font-size: 10px;
}

.stock-analysis-footer details {
  flex-basis: 100%;
}

.stock-analysis-footer summary {
  width: max-content;
  cursor: pointer;
  color: var(--green-dark);
  font-weight: 700;
}

.stock-data-sources {
  display: grid;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.stock-data-sources > div {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) minmax(0, 1fr) auto;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 980px) {
  .stock-analysis-intro,
  .analysis-summary-band {
    grid-template-columns: 1fr;
  }

  .stock-tool-switch {
    width: min(100%, 360px);
  }

  .stock-ranking-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stock-ranking-checkbox,
  .stock-ranking-filters > button {
    width: 100%;
  }

  .stock-watchlist-row {
    grid-template-columns: minmax(150px, 1.2fr) 80px 80px minmax(120px, 1fr) auto;
  }

  .stock-result-header {
    grid-template-columns: minmax(0, 1fr) 126px;
  }

  .stock-result-header > button {
    grid-column: 1 / -1;
    width: max-content;
  }

  .stock-analysis-panel .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stock-analysis-panel .metric-cell:nth-child(5n) {
    border-right: 1px solid var(--line);
  }

  .stock-analysis-panel .metric-cell:nth-child(3n) {
    border-right: 0;
  }

  .scenario-grid,
  .backtest-grid {
    grid-template-columns: 1fr;
  }

  .scenario-item + .scenario-item {
    border-left: 0;
  }

  .scenario-item ul {
    min-height: 0;
  }
}

@media (max-width: 680px) {
  .feed-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  button.feed-tab {
    min-width: 0;
    padding: 0 8px;
  }

  .stock-analysis-intro {
    gap: 18px;
    padding-right: 0;
    padding-left: 0;
  }

  .stock-tool-switch {
    width: 100%;
  }

  .stock-ranking-filters {
    grid-template-columns: 1fr 1fr;
    padding-right: 0;
    padding-left: 0;
  }

  .stock-ranking-checkbox,
  .stock-ranking-filters > button {
    min-height: 40px;
  }

  .stock-ranking-loading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  #stockRankingProgress {
    grid-column: 2;
    text-align: left;
  }

  .stock-ranking-head {
    align-items: flex-start;
    padding-right: 0;
    padding-left: 0;
  }

  .stock-ranking-actions {
    flex-direction: column;
  }

  .stock-ranking-method {
    flex-direction: column;
    padding-right: 0;
    padding-left: 0;
  }

  .stock-watchlist-section {
    padding-right: 0;
    padding-left: 0;
  }

  .stock-watchlist-row {
    grid-template-columns: minmax(0, 1fr) 80px auto;
  }

  .stock-watchlist-row > :nth-child(4) {
    grid-column: 1 / 3;
  }

  .stock-watchlist-row > :last-child {
    grid-column: 3;
    grid-row: 1 / 3;
  }

  .stock-single-search {
    max-width: none;
    margin-right: 0;
    margin-left: 0;
  }

  .stock-search-form,
  .stock-result-header,
  .analysis-two-column,
  .valuation-metric-grid {
    grid-template-columns: 1fr;
  }

  .stock-search-form > button,
  .stock-result-header > button {
    width: 100%;
  }

  .stock-search-suggestions {
    position: static;
    margin-top: 2px;
    box-shadow: none;
  }

  .stock-score-block {
    width: max-content;
    padding-left: 12px;
  }

  .analysis-view-tabs {
    gap: 18px;
  }

  .analysis-summary-band,
  .analysis-section,
  .analysis-two-column .analysis-section,
  .analysis-two-column .analysis-section + .analysis-section {
    padding-right: 0;
    padding-left: 0;
  }

  .analysis-two-column .analysis-section + .analysis-section {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .attribution-item,
  .stock-news-list article,
  .report-sample-list article {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .stock-price-chart {
    min-height: 210px;
    overflow-x: auto;
  }

  .stock-price-chart svg {
    min-width: 620px;
  }

  .stock-analysis-panel .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stock-analysis-panel .metric-cell:nth-child(3n),
  .stock-analysis-panel .metric-cell:nth-child(5n) {
    border-right: 1px solid var(--line);
  }

  .stock-analysis-panel .metric-cell:nth-child(2n) {
    border-right: 0;
  }

  .stock-data-sources > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
