/* Formal analysis company context, using the workbench's paper and teal palette. */
@media (min-width: 70.01rem) and (max-width: 94rem) {
  .research-topbar { height: auto; grid-template-columns: minmax(12rem, 1fr) auto; }
  .research-topbar .top-context { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; padding-bottom: .4rem; }
  .research-topbar .status-cluster { flex-shrink: 0; white-space: nowrap; }
}
.research-app[data-active-panel="company-overview"] #workflow-message,
.research-app[data-active-panel="company-overview"] .top-context { display: none; }
.research-app[data-active-panel="company-overview"] .research-topbar { grid-template-columns: minmax(12rem, 1fr) auto; }
#tab-company-overview { grid-row: 1 / -1; padding: 0; min-height: 0; }
.company-overview {
  --co-paper: var(--color-surface, #fffefa);
  --co-canvas: var(--color-surface-muted, #f7f5ee);
  --co-ink: var(--color-ink, #17222c);
  --co-muted: #5d6a64;
  --co-line: var(--color-line, #d8d6cd);
  --co-accent: var(--color-accent, #0f766e);
  --co-up: #a83e36;
  --co-down: #237558;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 1.5rem clamp(.75rem, 2vw, 2rem) 3rem;
  color: var(--co-ink);
  background: var(--co-canvas);
  font-size: .85rem;
  line-height: 1.6;
}
.company-overview *, .company-overview *::before, .company-overview *::after { box-sizing: border-box; }
.company-overview[hidden] { display: none; }
.company-overview > * { max-width: 1500px; margin-left: auto; margin-right: auto; }
.company-overview h2 { font-family: "Noto Serif SC", "Songti SC", SimSun, serif; font-size: clamp(1.5rem, 2.5vw, 2rem); margin: 0 0 .5rem; }
.company-overview h3 { margin: 0; font-size: 1.12rem; line-height: 1.4; }
.company-overview h4 { font-size: .85rem; line-height: 1.6; }
.company-overview p { overflow-wrap: anywhere; }
.co-eyebrow { color: var(--co-accent); font-size: .62rem; letter-spacing: .14em; font-weight: 700; margin: 0 0 .35rem; }
.co-page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .3rem; }
.co-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.company-overview button { min-height: 2.25rem; padding: .45rem .75rem; font-size: .76rem; line-height: 1.4; font-weight: 600; border-radius: .3rem; border: 1px solid var(--co-line); background: var(--co-paper); color: var(--co-ink); cursor: pointer; }
.company-overview button:hover { background: #eef3eb; filter: none; }
.company-overview button.co-primary { border-color: var(--co-accent); background: var(--co-accent); color: white; }
.company-overview button.co-primary:hover { background: #0c655e; }
.company-overview button:disabled { cursor: default; opacity: .5; }
.company-overview :focus-visible { outline: 2px solid var(--co-accent); outline-offset: 3px; }
.co-state-line { display: flex; gap: 1rem; justify-content: space-between; align-items: center; padding: .6rem 0 1rem; }
.co-state-line strong { font-size: .96rem; font-weight: 700; overflow-wrap: anywhere; }
.co-status { flex-shrink: 0; font-size: .7rem; color: #396149; background: #edf4ea; padding: .2rem .65rem; border: 1px solid #c8d6c7; border-radius: 1rem; }
.co-status[data-state="partial"], .co-status[data-state="error"], .co-status[data-state="unavailable"], .co-status[data-state="timeout"] { color: #815d24; border-color: #dfd0b0; background: #fbf3e3; }
.co-meta { color: var(--co-muted); font-size: .73rem; line-height: 1.7; margin: .35rem 0; }
.co-warning { color: #79551c; border-left: 3px solid #ba893b; background: #fcf4e3; padding: .55rem .75rem; font-size: .78rem; line-height: 1.7; margin: .75rem 0; }
.co-content { display: grid; gap: 1.25rem; min-width: 0; }
.co-section { min-width: 0; padding: 1.25rem; background: var(--co-paper); border: 1px solid var(--co-line); border-radius: .4rem; }
.co-section-heading { display: flex; gap: 1rem; justify-content: space-between; align-items: start; margin-bottom: .75rem; }
.co-section-heading > div { min-width: 0; }
.co-section-heading .co-meta { max-width: 60rem; }
.co-switch { display: inline-flex; flex-shrink: 0; flex-wrap: wrap; gap: .2rem; padding: .2rem; border: 1px solid var(--co-line); border-radius: .35rem; background: #f5f6ee; }
.co-switch button { min-height: 1.85rem; padding: .3rem .6rem; font-size: .72rem; background: transparent; border-color: transparent; white-space: nowrap; }
.co-switch button[aria-pressed="true"] { border-color: #aabdaf; background: #fffefa; color: #235847; }
.co-company-line { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; margin: .8rem 0; }
.co-company-line strong { font-size: 1.12rem; }
.co-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0; }
.co-stat { min-width: 0; display: flex; flex-direction: column; gap: .4rem; padding: 1rem; border: 1.5px solid #90a99b; border-radius: .35rem; background: #f7faf5; }
.co-stat-label { font-size: .86rem; color: #344a3e; font-weight: 700; }
.co-stat strong { font-size: clamp(1.32rem, 1.9vw, 1.85rem); font-weight: 750; line-height: 1.35; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.co-stat small { font-size: .72rem; color: #4f6458; line-height: 1.6; }
.co-stat small:empty { display: none; }
.co-details { margin: 1rem 0 .25rem; font-size: .78rem; }
.co-details > summary { cursor: pointer; color: #345e4e; font-size: .77rem; width: fit-content; padding: .25rem 0; }
.co-details[open] > summary { margin-bottom: .45rem; }
.co-table-wrap { overflow: auto; width: 100%; max-width: 100%; margin: .85rem 0; border: 1px solid #d8dcd0; border-radius: .25rem; overscroll-behavior-inline: contain; }
.company-overview table { width: 100%; border-collapse: collapse; font-size: .74rem; line-height: 1.55; }
.company-overview th, .company-overview td { padding: .65rem .75rem; border-bottom: 1px solid #e0e3d8; text-align: left; vertical-align: top; white-space: nowrap; }
.company-overview th { color: #3f5147; background: #edf1e8; font-weight: 600; }
.company-overview td { color: var(--co-ink); max-width: 28rem; overflow: hidden; text-overflow: ellipsis; }
.company-overview td:first-child { max-width: 22rem; }
.company-overview tr:last-child td { border-bottom: 0; }
.company-overview tr:nth-child(even) { background: #fafaf5; }
.company-overview tr:hover td { background: #f2f5ed; }
.company-overview .co-numeric { text-align: right; font-variant-numeric: tabular-nums; }
.company-overview .co-positive, .co-price-up { color: var(--co-up); }
.company-overview .co-negative, .co-price-down { color: var(--co-down); }
.co-subheading { font-size: .8rem; margin: 1.25rem 0 .3rem; }
.co-business-description { padding: .75rem 1rem; background: #f6f6ef; border-left: 2px solid #9eb7aa; font-size: .8rem; line-height: 1.85; }
.co-segment-bars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 2rem; margin: 1rem 0; }
.co-segment-row { min-width: 0; }
.co-segment-label { display: flex; justify-content: space-between; align-items: start; gap: .75rem; font-size: .74rem; margin-bottom: .3rem; }
.co-segment-label span { overflow-wrap: anywhere; }
.co-segment-label strong { font-variant-numeric: tabular-nums; flex-shrink: 0; font-weight: 500; }
.co-segment-track { background: #e8ebe0; height: .35rem; border-radius: .15rem; overflow: hidden; }
.co-segment-track > span { display: block; height: 100%; background: #739888; }
.co-observations { padding-left: 1.25rem; color: #3e5147; font-size: .79rem; line-height: 1.85; }
.co-observations li { padding-bottom: .3rem; overflow-wrap: anywhere; }
.co-empty { margin: .75rem 0; padding: 1rem; background: #f6f6ef; color: var(--co-muted); font-size: .83rem; }
.co-empty-start { padding: 3rem 1.5rem; border: 1px dashed #c3ccbf; text-align: center; }
.co-source-record { padding: 1rem 0; border-top: 1px solid var(--co-line); }
.co-source-record h4 { margin: 0; }
.co-source-fields, .co-source-params, .co-source-hash { color: #536357; font-size: .71rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.co-source-params { padding: .5rem .75rem; border: 1px solid #dfe2d5; background: #f6f7f0; max-height: 12rem; overflow: auto; }
.co-source-hash { padding-left: .6rem; border-left: 2px solid #c5d1c2; font-family: ui-monospace, Consolas, monospace; }
.co-source-hash p { margin: .3rem 0; }
.company-overview a { color: #256b78; text-underline-offset: .2em; }
.co-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.co-chart { min-width: 0; margin: 1rem 0 .25rem; }
.co-chart-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; align-items: center; }
.co-chart-legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .7rem; color: var(--co-muted); margin: .7rem 0 .25rem; }
.co-chart-surface { background: #fafbf6; border: 1px solid #e0e4d8; border-radius: .25rem; overflow: hidden; }
.co-chart-surface svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.co-chart-surface svg text { font-size: 10px; fill: #606e65; font-family: system-ui, "Microsoft YaHei", sans-serif; font-variant-numeric: tabular-nums; }
.co-chart-grid { stroke: #e1e5d9; stroke-width: 1; }
.co-chart-cursor { stroke: #819486; stroke-width: 1; stroke-dasharray: 3 4; pointer-events: none; }
.co-candle-up { stroke: var(--co-up); fill: var(--co-up); }
.co-candle-down { stroke: var(--co-down); fill: var(--co-down); }
.co-volume-unknown { stroke: #8c958b; fill: #8c958b; }
.co-line-ma5 { stroke: #ae7a21; }
.co-line-ma10 { stroke: #856292; }
.co-line-ma20 { stroke: #357d99; }
.co-line-stock { stroke: #aa5343; }
.co-line-index { stroke: #407c86; stroke-dasharray: 5 3; }
circle.co-line-ma5 { fill: #ae7a21; }
circle.co-line-ma10 { fill: #856292; }
circle.co-line-ma20 { fill: #357d99; }
circle.co-line-stock { fill: #aa5343; }
circle.co-line-index { fill: #407c86; }
.co-ma5 { color: #986716; }
.co-ma10 { color: #7a548a; }
.co-ma20 { color: #2c6f8b; }
.co-stock-return { color: #aa5343; }
.co-index-return { color: #407c86; }
.co-chart-readout { min-height: 2.4em; padding: .4rem .1rem; margin: .3rem 0 .75rem; font-size: .72rem; line-height: 1.7; color: #3c5748; font-variant-numeric: tabular-nums; }
.co-chart-subtitle { margin: 1rem 0 .25rem; }
.co-chart-slider-label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .8rem; align-items: center; color: var(--co-muted); font-size: .72rem; margin: .8rem 0 .2rem; }
.company-overview .co-chart-slider { width: 100%; margin: 0; padding: 0; min-height: 1.75rem; border: none; background: transparent; accent-color: var(--co-accent); }
@media (max-width: 1100px) {
  .co-section-heading { flex-wrap: wrap; }
}
@media (max-width: 650px) {
  .research-app[data-active-panel="company-overview"] .research-topbar { display: flex; height: auto; padding: .7rem; }
  .research-app[data-active-panel="company-overview"] .top-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; max-width: 100%; overflow: visible; }
  .research-app[data-active-panel="company-overview"] .workbench-tabs { min-width: 0; max-width: 100%; overflow-x: auto; }
  #tab-company-overview { height: auto; overflow: visible; }
  .company-overview { padding: 1rem .65rem 2rem; }
  .co-section { padding: .8rem; }
  .co-page-header { align-items: flex-start; flex-direction: column; gap: .5rem; }
  .co-content { gap: .85rem; }
  .co-state-line { align-items: start; flex-direction: column; gap: .4rem; }
  .co-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .co-stat { padding: .7rem; }
  .co-stat strong { font-size: 1.35rem; }
  .co-segment-bars { grid-template-columns: minmax(0, 1fr); }
  .co-section-heading { flex-direction: column; gap: .5rem; }
  .co-actions { width: 100%; }
  .co-actions button { flex: 1 0 calc(50% - .5rem); }
  .co-chart-slider-label { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
  .co-chart-readout { font-size: .68rem; }
}
