/* Evolve Edge — a brief's company data on the detail page (pitchiq#828): the shared pieces (Record avatar, section
   empty state, card subtabs, View all, side sheet), the Overview's Company insights card and the Company tab's Company
   insights card. Components: brief-company-shared.jsx, brief-company.jsx. Values are Figma's (`T51wh9ODKWVeqS1lLXRmkb`:
   633:2360, 633:2361, 422:47311, 609:1813, 603:1737, 515:7694; Evolve Components 539:26). */

/* ---- Shared pieces ---- */

/* Record avatar, Initial variant (895:31928): 32px, radius 8, neutral-blue-4, hairline inner shadow. */
.ebci-avatar { position: relative; display: flex; flex: none; align-items: center; justify-content: center; width: 32px; height: 32px; overflow: hidden; border-radius: 8px; background: var(--evsh-neutral-blue-4); box-shadow: inset 0 0 1px 0 rgba(0, 0, 0, 0.25); font-size: 12px; line-height: 18px; font-weight: 500; color: var(--evsh-neutral-blue-1); text-align: center; white-space: nowrap; }

/* Section empty state (609:1797): 24px above and below, 16px at the sides; the illustration area is 146 x 100. */
.ebci-empty { display: flex; flex-direction: column; align-items: center; width: 100%; padding: 24px 16px; }
.ebci-empty-state { width: 100%; max-width: 240px; }
.ebci-empty-state .ebd-empty-art { height: 100px; }
.ebci-empty-state .ebd-empty-disc--1 { top: calc(50% - 24.76px); }
.ebci-empty-state .ebd-empty-disc--2 { top: calc(50% + 16.87px); }
.ebci-empty-state .ebd-empty-disc--3 { top: calc(50% - 24.96px); }

/* View all (pitchiq#914 items 4 and 5): the library Ghost button on a neutral blue 4 bar as wide as its list (608 in
   the 640 card), radius 32, 7px above and under the label; blue 15/20 semibold, then Chevron Right 20 in a 16px slot. */
.ebci-view-all { display: flex; flex: none; align-items: center; justify-content: center; gap: 4px; box-sizing: border-box; width: 100%; padding: 7px 14px; border: none; border-radius: 32px; background: var(--evsh-neutral-blue-4); font: inherit; font-size: 15px; line-height: 20px; font-weight: 600; color: var(--evsh-blue-1); white-space: nowrap; cursor: pointer; }
.ebci-view-all:hover { background: var(--evsh-bg-light-blue); }
.ebci-view-all-icon { position: relative; flex: none; width: 16px; height: 20px; }
.ebci-view-all-icon > img { position: absolute; left: 0; top: 0; display: block; width: 20px; height: 20px; max-width: none; }
/* The competitors row's "View all" (pitchiq#914 item 1): the library Ghost button as it is (`.evsh-btn--ghost`: no
   fill, no hover change; the 4px radius only rounds its keyboard focus ring, like the page's other rings), neutral 1 at 15/20 semibold, 2px above and under and 4px at the sides. */
.ebci-view-all--chip { display: inline-flex; width: auto; padding: 2px 4px; border-radius: 4px; background: none; color: var(--evsh-neutral-1); }
.ebci-view-all--chip:hover { background: none; }
.ebci-view-all--chip > .ebci-view-all-icon { width: 20px; }   /* the Ghost button's icon keeps its whole 20px box */
.ebci-view-all:focus-visible { outline: 2px solid var(--evsh-blue-1); outline-offset: 2px; }

/* Card subtabs (prototype `.subtabs`, pitchiq#908): 16px at the sides, a light-blue rule under the 46px row, 32px
   between tabs; 14/18 semibold, muted until selected. */
.ebci-subtabs { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 0 16px; border-bottom: 1px solid var(--evsh-bg-light-blue); }
.ebci-subtabs-row { display: flex; align-items: center; gap: 32px; margin-bottom: -1px; }
.ebci-subtab { display: flex; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box; padding: 13px 0; border: none; border-bottom: 2px solid transparent; background: none; font: inherit; font-size: 14px; line-height: 18px; font-weight: 600; color: var(--evsh-neutral-blue-1); text-align: center; white-space: nowrap; cursor: pointer; }
.ebci-subtab--selected { border-bottom-color: var(--evsh-neutral-1); color: var(--evsh-neutral-1); }
/* A record count beside a label (prototype `.count`): the shared Badge, filled and without its stroke. */
.evsh-badge.ebci-count { justify-content: center; min-width: 18px; border-radius: 4px; background: var(--evsh-neutral-blue-4); box-shadow: none; font-weight: 500; color: var(--evsh-neutral-blue-1); }
.ebci-subtab:focus-visible { outline: 2px solid var(--evsh-blue-1); outline-offset: 2px; border-radius: 4px; }

/* Side sheet (Evolve Components 539:26): 16px from the viewport's edges, radius 24, a 64px header over scrolling content. */
.ebci-sheet-layer { position: fixed; inset: 0; z-index: 1000; display: flex; justify-content: flex-end; padding: 16px; }
.ebci-sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 32, 47, 0.22); backdrop-filter: blur(2px); }
.ebci-sheet { position: relative; display: flex; flex-direction: column; max-width: 100%; height: 100%; overflow: hidden; border-radius: 24px; background: #fff; box-shadow: -12px 0 50px 0 rgba(0, 32, 47, 0.12); animation: ebci-sheet-in 200ms ease-out; }
@keyframes ebci-sheet-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ebci-sheet { animation: none; } }
.ebci-sheet-header { display: flex; flex: none; align-items: center; gap: 16px; box-sizing: border-box; height: 65px; padding: 12px 24px; border-bottom: 1px solid var(--evsh-bg-light-blue); background: #fff; }
.ebci-sheet-title { flex: 1; min-width: 0; margin: 0; font-size: 21px; line-height: 28px; font-weight: 700; color: var(--evsh-neutral-1); }
.ebci-sheet-close { display: flex; flex: none; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 6px; border: none; border-radius: 8px; background: none; cursor: pointer; }
.ebci-sheet-close:hover { background: var(--evsh-neutral-blue-4); }
.ebci-sheet-close:focus-visible { outline: 2px solid var(--evsh-blue-1); outline-offset: 2px; }
.ebci-sheet-close-icon { transform: rotate(45deg); }
.ebci-sheet-content { display: flex; flex: 1; flex-direction: column; align-items: stretch; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 28px 40px; }

/* ---- Metrics, as both cards write them ---- */
.ebci-metric { display: flex; flex: 1; flex-direction: column; align-items: flex-start; min-width: 0; border: none; background: none; font: inherit; text-align: left; }
.ebci-metric-label { display: flex; align-items: center; gap: 4px; font-weight: 500; color: var(--evsh-neutral-2); white-space: nowrap; }
.ebci-metric-value { max-width: 100%; font-size: 18px; line-height: 24px; font-weight: 900; color: var(--evsh-neutral-1); overflow-wrap: anywhere; }
.ebci-metric--action { cursor: pointer; }
.ebci-metric--action:hover .ebci-metric-label { color: var(--evsh-neutral-1); }
.ebci-metric--action:focus-visible { outline: 2px solid var(--evsh-blue-1); outline-offset: -2px; border-radius: 8px; }

/* ---- Overview: Company insights card (pitchiq#908: the prototype's `.overview-insights`) ---- */
/* 312 wide (292 from 1024 to 1279px, 406 from 1442px), radius 20, a 1px outline drawn inside; no padding under the
   last link. */
.ebci-ov-card { display: flex; flex: none; flex-direction: column; align-items: stretch; width: 312px; min-width: 0; border-radius: 20px; background: #fff; box-shadow: inset 0 0 0 1px var(--evsh-neutral-blue-3); }
@media (min-width: 1442px) { .ebci-ov-card { width: 406px; } }
@media (min-width: 1024px) and (max-width: 1279px) { .ebci-ov-card { width: 292px; } }
.ebci-ov-heading { align-items: center; gap: 8px; padding: 20px 16px; }
.ebci-ov-heading::before { inset: 14px 8px; }
.ebci-ov-content { display: flex; flex-direction: column; gap: 24px; padding: 0 16px; }
.ebci-ov-content > .ebci-terms { margin-bottom: 16px; }   /* the terms notice is not a link row: 16 under it */
/* The four metrics: two columns, each cell 72.4 tall (taller only when a value wraps), label 8 over the value, a rule
   under the first row and between the columns. */
.ebci-ov-metrics { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 12px; border-radius: 16px; background: var(--evsh-neutral-blue-4); }
.ebci-ov-metrics .ebci-metric { box-sizing: border-box; gap: 8px; min-height: 72.4px; padding: 0 12px 12px 0; border-bottom: 1px solid var(--evsh-neutral-blue-3); }
.ebci-ov-metrics .ebci-metric:nth-child(2n) { padding-right: 0; padding-left: 12px; border-left: 1px solid var(--evsh-neutral-blue-3); }
.ebci-ov-metrics .ebci-metric:nth-child(n+3) { padding-top: 12px; padding-bottom: 0; border-bottom: none; }
.ebci-ov-metrics .ebci-metric-label { font-size: 12px; line-height: 18px; }
/* A value may run over the 12px beside it (to the rule, or to the surface's edge) before it wraps… */
.ebci-ov-metrics .ebci-metric-value { max-width: calc(100% + 12px); margin-right: -12px; }
/* …except a left-column value in the narrowest card (292px, at 1024–1279): there it would touch the rule. */
@media (min-width: 1024px) and (max-width: 1279px) {
  .ebci-ov-metrics .ebci-metric:nth-child(2n+1) .ebci-metric-value { max-width: 100%; margin-right: 0; }
}

/* Headcount trend: 202 tall. The label, 8, the count, the period, then the 100px chart 95 from the top; the change
   sits in the top right corner. */
.ebci-ov-headcount { position: relative; display: flex; flex-direction: column; box-sizing: border-box; min-height: 202px; padding: 12px 12px 7px; border-radius: 16px; background: var(--evsh-neutral-blue-4); }
.ebci-ov-headcount-top { display: flex; align-items: flex-start; box-sizing: border-box; min-height: 83px; }
.ebci-ov-headcount-observation { display: flex; flex: 1; flex-direction: column; align-items: flex-start; min-width: 0; }
.ebci-ov-headcount .ebci-metric-label { font-size: 12px; line-height: 18px; }
.ebci-ov-headcount .ebci-metric-value { margin-top: 8px; white-space: nowrap; }
.ebci-ov-headcount-period { padding-top: 3.5px; font-size: 12px; line-height: 18px; font-weight: 400; color: var(--evsh-neutral-blue-2); white-space: nowrap; }
.ebci-ov-headcount .ebce-change { position: absolute; top: 14px; right: 12px; font-size: 11px; line-height: 16px; }

/* The two links: a rule above each, 64 tall at least, the icon and the chevron centred; the surface 4px inside. */
.ebci-ov-links { display: flex; flex-direction: column; border-top: 1px solid var(--evsh-neutral-blue-4); }
.ebci-ov-link { align-items: center; gap: 16px; min-height: 64px; padding: 12px 0; }
.ebci-ov-link + .ebci-ov-link { border-top: 1px solid var(--evsh-neutral-blue-4); }
.ebci-ov-link::before { inset: 4px -8px; }
.ebci-ov-link-text { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.ebci-ov-link-label { font-size: 14px; line-height: 18px; font-weight: 600; color: var(--evsh-neutral-1); overflow-wrap: anywhere; }
.ebci-ov-link-label:not(:only-child) { padding-top: 1px; }   /* over a detail line the label sits 1px lower: the row is 65 */
.ebci-ov-link-detail { font-size: 12px; line-height: 18px; font-weight: 400; color: var(--evsh-neutral-2); white-space: nowrap; }

/* ---- Company tab: Company insights card (422:47311) ---- */
.ebci-card { display: flex; flex-direction: column; align-items: stretch; width: 100%; border-radius: 20px; background: #fff; box-shadow: 0 4px 8px 0 rgba(0, 32, 47, 0.1); }
/* The four metrics (prototype `.insights-card > .metrics`): a 96px row, the first column 140px (wider for a value
   that needs it, so a long range does not wrap beside three half-empty columns) and the others equal. */
.ebci-card-metrics { display: grid; grid-template-columns: minmax(140px, max-content) repeat(3, minmax(0, 1fr)); align-items: start; box-sizing: border-box; min-height: 96px; padding: 28px 16px 20px; }
.ebci-card-metrics .ebci-metric { gap: 6px; padding: 0 0 0 16px; }
.ebci-card-metrics .ebci-metric:first-child { padding-left: 0; }
.ebci-card-metrics .ebci-metric-label { font-size: 14px; line-height: 18px; }
.ebci-card-panel { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }

.ebci-description { margin: 0; padding: 24px 16px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--evsh-neutral-1); overflow-wrap: anywhere; }
/* The prototype keeps three lines for the description on desktop (60px between its 24px paddings) and centres a
   shorter one in them, so the facts start at the same place. */
@media (min-width: 701px) { .ebci-description { display: flex; align-items: center; box-sizing: border-box; min-height: 108px; } }
.ebci-facts-wrap { padding: 0 16px 24px; }
.ebci-facts-wrap--first { padding-top: 24px; }
.ebci-facts-wrap--divided { border-bottom: 1px solid var(--evsh-neutral-blue-3); }
.ebci-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; padding: 12px; border-radius: 16px; background: var(--evsh-neutral-blue-4); }
.ebci-fact { display: grid; grid-template-columns: 95px minmax(0, 1fr); column-gap: 8px; min-width: 0; }
.ebci-fact:nth-child(odd) { grid-template-columns: 110px minmax(0, 1fr); }
.ebci-fact--lastFinancing { grid-column: 1 / -1; }
.ebci-fact-label, .ebci-fact-value { margin: 0; font-size: 14px; line-height: 18px; font-weight: 500; }
.ebci-fact-label { color: var(--evsh-neutral-2); white-space: nowrap; }
.ebci-fact-value { min-width: 0; color: var(--evsh-neutral-1); overflow-wrap: anywhere; }

/* Company competitors (prototype `.company-competitors`): a 62px row, the label 18px before the names, 10px between
   them; the names wrap under the label when they do not fit. */
.ebci-competitors { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; box-sizing: border-box; min-height: 62px; padding: 18px 16px; }
.ebci-competitors-label { flex: none; margin-right: 8px; font-size: 14px; line-height: 18px; font-weight: 400; color: var(--evsh-neutral-2); white-space: nowrap; }
.ebci-competitors-list { display: contents; }
.ebci-competitor-chip { box-sizing: border-box; min-width: 24px; max-width: 100%; padding: 2px 6px; border: 1px solid var(--evsh-neutral-blue-3); border-radius: 7px; font-size: 14px; line-height: 18px; font-weight: 600; color: var(--evsh-neutral-2); text-align: center; overflow-wrap: anywhere; }

/* ---- Funding history sheet content (603:1737) ---- */
.ebci-funding { display: flex; flex-direction: column; gap: 24px; }
.ebci-funding-summary { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 16px; background: var(--evsh-neutral-blue-5, #f6f9fa); }
.ebci-funding-summary-label { flex: 1; min-width: 0; font-size: 14px; line-height: 18px; font-weight: 500; color: var(--evsh-neutral-2); }
.ebci-funding-summary-value { flex: none; font-size: 18px; line-height: 24px; font-weight: 900; color: var(--evsh-neutral-1); text-align: right; }
.ebci-funding-events { display: flex; flex-direction: column; padding: 0 16px; }
.ebci-funding-heading { display: flex; align-items: flex-start; gap: 16px; padding-bottom: 8px; font-size: 14px; line-height: 18px; }
.ebci-funding-count { flex: 1; min-width: 0; font-weight: 600; color: var(--evsh-neutral-1); }
.ebci-funding-order { flex: none; font-weight: 500; color: var(--evsh-neutral-2); text-align: right; }
.ebci-funding-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.ebci-funding-event { display: flex; flex-direction: column; gap: 4px; padding: 12px 0 16px; border-bottom: 1px solid var(--evsh-bg-light-blue); }
.ebci-funding-event-top { display: flex; align-items: center; gap: 16px; color: var(--evsh-neutral-1); }
.ebci-funding-event-name { flex: 1; min-width: 0; font-size: 16px; line-height: 24px; font-weight: 600; overflow-wrap: anywhere; }
.ebci-funding-event-amount { flex: none; font-size: 18px; line-height: 24px; font-weight: 900; text-align: right; }
.ebci-funding-event-date { display: flex; align-items: center; gap: 6px; font-size: 14px; line-height: 18px; font-weight: 500; color: var(--evsh-neutral-2); }

/* ---- Company competitors sheet content (515:7694): two fluid columns ---- */
.ebci-competitor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin: 0; padding: 0; list-style: none; }
.ebci-competitor { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ebci-competitor-name { flex: 1; min-width: 0; font-size: 14px; line-height: 18px; font-weight: 500; color: var(--evsh-neutral-1); overflow-wrap: anywhere; }

/* ---- When the answer is about the terms (docs/COMPANY_DATA.md status table): the notice, in the section or in the Overview card ---- */
.ebci-terms { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 24px 16px; border-radius: 20px; background: #fff; box-shadow: 0 4px 12px 0 rgba(0, 32, 47, 0.13); }
.ebci-terms--compact { padding: 12px; border-radius: 16px; background: var(--evsh-neutral-blue-4); box-shadow: none; }
.ebci-terms-title { margin: 0; font-size: 15px; line-height: 20px; font-weight: 700; color: var(--evsh-neutral-1); }
.ebci-terms-text { margin: 0; font-size: 14px; line-height: 18px; font-weight: 500; color: var(--evsh-neutral-2); }

/* ---- Narrower columns (prototype's rules at 1279px and below, and at 700px and below; pitchiq#908) ---- */
@media (max-width: 1279px) {
  .ebci-card-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ebci-card-metrics .ebci-metric { padding-left: 8px; }
  .ebci-card-metrics .ebci-metric-label { font-size: 11px; }
  .ebci-card-metrics .ebci-metric-value { font-size: 15px; }
  .ebci-subtabs-row { gap: 16px; }
  .ebci-subtab { font-size: 12px; }
  .ebci-facts { grid-template-columns: minmax(0, 1fr); }
  .ebci-fact, .ebci-fact:nth-child(odd) { grid-template-columns: 110px minmax(0, 1fr); }
}
@media (min-width: 1280px) {
  /* The second column's facts sit 11px further in, as the prototype draws them. */
  .ebci-fact:nth-child(even) { transform: translateX(11px); }
}
@media (max-width: 1023px) {
  .ebci-ov-card { width: 300px; }
}
@media (max-width: 700px) {
  /* Overview: the Company insights card under the plan, at the page's width, 20 inside at each side. */
  .ebci-ov-card { width: auto; }
  .ebci-ov-heading { padding: 18px 16px; }                 /* 60 tall */
  .ebci-ov-heading::before { inset: 12px 8px; }
  .ebci-ov-content { padding: 0 20px; }
  .ebci-card-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; padding: 20px 16px; }
  .ebci-card-metrics .ebci-metric { padding-left: 0; }
  .ebci-card-metrics .ebci-metric-label { font-size: 12px; }
  .ebci-card-metrics .ebci-metric-value { font-size: 18px; }
  /* The subtab row scrolls sideways when it does not fit, as the prototype's does. */
  .ebci-subtabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .ebci-subtabs-row { margin-bottom: 0; }
  /* Company details: smaller type, an 85 label column, the competitors under their label. */
  .ebci-description { font-size: 13px; }
  .ebci-fact, .ebci-fact:nth-child(odd) { grid-template-columns: 85px minmax(0, 1fr); }
  .ebci-fact-label, .ebci-fact-value { font-size: 12px; }
  .ebci-competitors-label { width: 100%; margin-right: 0; font-size: 12px; }
  .ebci-competitor-chip { font-size: 12px; }
  /* Side sheets take the width there is, 16 inside at each side. */
  .ebci-sheet { width: 100% !important; }                  /* over the sheet's own design width */
  .ebci-sheet-header { padding: 12px 16px; }
  .ebci-sheet-content { padding: 20px 16px 40px; }
}
