/* ── Stock Homepage ───────────────────────────────────
   Layout styles for the homepage only.
   Loads after delvantic-ui.css.
   ────────────────────────────────────────────────── */

/* ── Hero ──────────────────────────────────────────── */
.hp-hero {
    background: #f8f9fa;
    padding: 72px 24px 56px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.hp-hero-inner {
    max-width: 640px;
    margin: 0 auto;
}

.hp-hero-logo {
    margin-bottom: 20px;
}

.hp-hero-logo canvas {
    display: block;
    margin: 0 auto;
    border: none;
    background: transparent;
}

.hp-hero h1 {
    font-size: 34px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.hp-hero-subtitle {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 28px;
}

.hp-hero-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── How It Works Link ─────────────────────────────── */
.hp-how-link {
    display: inline-block;
    margin-top: 16px;
    font-size: 13px;
    color: #6b7280;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s;
}
.hp-how-link:hover {
    color: #198754;
}

/* ── Search Section ────────────────────────────────── */
.hp-search-section {
    padding: 48px 24px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.hp-search-inner {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.hp-search-label {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px;
}

.hp-search-box {
    margin: 0 0 14px;
}

.hp-search-box .sc-ac-wrap {
    width: 100%;
}

.hp-search-box .sc-ac-input-row {
    padding: 4px 14px;
    border-width: 2px;
    border-radius: 10px;
}

.hp-search-box .sc-ac-input {
    font-size: 16px;
    padding: 10px 10px;
}

.hp-search-box .sc-ac-icon {
    font-size: 18px;
}

.hp-search-box .sc-ac-input-row:focus-within {
    border-color: #198754;
    box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.1);
}

.hp-search-hint {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
}

/* ── Sections ──────────────────────────────────────── */
.hp-section {
    padding: 56px 24px;
    background: #fff;
}

.hp-section--alt {
    background: #f8f9fa;
}

.hp-section-inner {
    max-width: 1060px;
    margin: 0 auto;
}

.hp-section-title {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 4px;
}

.hp-section-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* ── Disclaimer ──────────────────────────────────── */
.hp-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    color: #475569;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
}
.hp-disclaimer i {
    color: #d97706;
    font-size: 18px;
    line-height: 1.4;
    flex-shrink: 0;
}

/* ── Level Cards ───────────────────────────────────── */
.hp-level-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 16px;
    overflow: hidden;
}

.hp-level-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
}

.hp-level-badge {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hp-level-label {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
}

.hp-level-count {
    font-size: 12px;
    color: #9ca3af;
}

.hp-level-bar {
    display: flex;
    gap: 3px;
    margin-left: auto;
}

.hp-level-seg {
    width: 18px;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
}

/* ── Company Rows ──────────────────────────────────── */
.hp-company-list {
    display: flex;
    flex-direction: column;
}

/* Row layout: CSS Grid with fixed columns so empty cells don't shift
   neighbors. Each child uses explicit grid-column so missing elements
   leave their cell empty — keeps Market Cap / Country / Rating chip
   aligned vertically across every row in a list. */
.hp-company-row {
    display: grid;
    grid-template-columns:
        [id-col] 140px
        [info-col] minmax(180px, 1fr)
        [ai-col] 100px
        [cap-col] 100px
        [country-col] 90px;
    align-items: center;
    column-gap: 16px;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.1s;
}

/* Reviewed (curated) variant: badges chip + rating chip on the right. Note
 * is inlined into the info column (.hp-company-note-inline) so the row
 * stays compact and consistent in height regardless of whether the note
 * exists. */
.hp-company-row--reviewed {
    grid-template-columns:
        [id-col] 140px
        [info-col] minmax(200px, 1fr)
        [ai-col] auto
        [cap-col] 90px
        [price-then-col] 78px
        [price-now-col] 78px
        [pct-col] 70px
        [rating-col] 58px
        [days-col] 48px;
}

/* Fully-researched variant (Reviewed by Delvantic — pipeline-complete list,
 * no curator note, no rating chip). The AI cell holds an inline verdict
 * preview (2 lines), so we give it a flexible band. */
.hp-company-row--fully-researched {
    grid-template-columns:
        [id-col] 140px
        [info-col] minmax(180px, 1fr)
        [ai-col] minmax(180px, 1.5fr)
        [cap-col] 84px
        [country-col] 60px;
}

/* Top Picks variant: id | info | strategy-chip | price | market-cap */
.hp-company-row--top-pick {
    grid-template-columns:
        [id-col] 140px
        [info-col] minmax(180px, 1fr)
        [strategy-col] auto
        [price-col] 100px
        [cap-col] 100px;
}
.hp-company-row--top-pick .st-chip          { grid-column: strategy-col; }
.hp-company-row--top-pick .hp-company-stat--price { grid-column: price-col; }
.hp-company-row--top-pick .hp-company-stat--cap   { grid-column: cap-col; }

/* Stats wrapper dissolves so its children sit on the parent grid. */
.hp-company-row .hp-company-stats { display: contents; }

/* Explicit column assignment — keeps every element in its dedicated cell. */
.hp-company-row .hp-company-id              { grid-column: id-col; }
.hp-company-row .hp-company-info            { grid-column: info-col; min-width: 0; }
.hp-company-row .hp-ai-review-chip          { grid-column: ai-col; }
.hp-company-row .hp-ai-preview              { grid-column: ai-col; min-width: 0; }
.hp-company-row .hp-company-stat--cap       { grid-column: cap-col; }
.hp-company-row .hp-company-stat--days       { grid-column: days-col; }
.hp-company-row .hp-company-stat--price-then { grid-column: price-then-col; }
.hp-company-row .hp-company-stat--price-now  { grid-column: price-now-col; }
.hp-company-row .hp-company-stat--pct        { grid-column: pct-col; font-weight: 700; }
.hp-company-row .hp-company-stat--pct.hp-pct--up   .hp-company-stat-val { color: #059669; }
.hp-company-row .hp-company-stat--pct.hp-pct--down .hp-company-stat-val { color: #dc2626; }
.hp-company-row .hp-reviewed-chip-wrap      { grid-column: rating-col; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.hp-company-row .hp-reviewed-chip           { /* placement now driven by the wrap */ }

/* mm/dd/yyyy date subline under price values + rating chip in div view. */
.hp-company-stat-date {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 1px;
    font-weight: 400;
}
.hp-reviewed-chip-date {
    font-size: 10px;
    color: #9ca3af;
    font-weight: 400;
}

/* Hide the small "Market Cap" / "Country" captions under stat values — the
 * value alone is readable in row context and saves ~14px of row height.
 * Was making rows feel taller than they needed to be. */
.hp-company-row .hp-company-stat-lbl { display: none; }

/* Inline curator note — sits right after the industry text on the same line.
 * Truncated with ellipsis so it never pushes the row taller; full text
 * available via the title tooltip on hover. */
.hp-company-note-inline {
    color: #6b7280;
    font-style: italic;
    font-size: 12px;
}
.hp-company-row .hp-company-industry {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-company-row:last-child {
    border-bottom: none;
}

.hp-company-row:hover {
    background: #f9fafb;
    color: inherit;
    text-decoration: none;
}

.hp-company-id {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.hp-company-logo {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    object-fit: contain;
    background: #f8f9fa;
}

.hp-company-logo-fb {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    background: #198754;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
}

.hp-company-ticker {
    font-weight: 700;
    font-size: 14px;
    color: #198754;
}

.hp-company-info {
    min-width: 0;
}

.hp-company-note {
    min-width: 0;
    font-size: 12px;
    line-height: 1.4;
    color: #4b5563;
    padding: 0 12px;
    border-left: 2px solid #fde68a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hp-company-name {
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hp-company-industry {
    font-size: 12px;
    color: #9ca3af;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Stats are now individual grid cells rendered as <div class="hp-company-stat">
   directly in the row — keeps Market Cap and Country in fixed columns.
   `.hp-company-stats` wrapper is kept around as a flex fallback for any
   legacy markup but no longer used by row rendering. */
.hp-company-stats {
    display: contents;  /* dissolve so children sit on parent grid */
}

.hp-company-stat {
    text-align: left;
    min-width: 0;
    overflow: hidden;
}

.hp-company-stat-val {
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
}

.hp-company-stat-lbl {
    font-size: 10px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.hp-depth-chip {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border: 1.5px solid;
    border-radius: 8px;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Depth Explainer ───────────────────────────────── */
.hp-depth-explainer {
    margin-bottom: 16px;
}

.hp-depth-explainer-inner {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
}

.hp-depth-groups {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.hp-depth-group-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 13px;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.hp-depth-group-name {
    font-weight: 700;
    color: #1f2937;
    min-width: 120px;
    flex-shrink: 0;
}

.hp-depth-group-count {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.hp-depth-group-items {
    font-size: 12px;
    color: #9ca3af;
    text-transform: capitalize;
}

.hp-depth-scale {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.hp-depth-scale-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

.hp-depth-scale-badge {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
}

.hp-depth-scale-range {
    font-weight: 500;
}

/* ── Filter Input ──────────────────────────────────── */
.hp-company-search:focus {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.15);
}

/* ── CTA ───────────────────────────────────────────── */
.hp-cta {
    padding: 56px 24px;
    background: #f8f9fa;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

.hp-cta-inner {
    max-width: 520px;
    margin: 0 auto;
}

.hp-cta h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px;
}

.hp-cta p {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 24px;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
    .hp-hero {
        padding: 48px 20px 40px;
    }
    .hp-hero h1 {
        font-size: 26px;
    }
    .hp-section {
        padding: 40px 20px;
    }
    .hp-cta {
        padding: 40px 20px;
    }
    /* Mobile: switch from desktop's fixed-column grid to a 2-column grid
       with select children spanning the full width. Same "columns stay
       aligned" guarantee but laid out vertically when there isn't room. */
    .hp-company-row,
    .hp-company-row--reviewed {
        grid-template-columns: 1fr 1fr;
        row-gap: 8px;
        padding: 10px 12px;
    }
    .hp-company-row .hp-company-id            { grid-column: 1 / 3; }
    .hp-company-row .hp-company-info          { grid-column: 1 / 3; }
    .hp-company-row .hp-ai-review-chip        { grid-column: 1 / 3; justify-self: start; }
    /* Mobile pairings (Country dropped, Days moved last):
     *   Row A:  Cap | Then
     *   Row B:  Now | % Change
     *   Row C:  Days (full width)
     * Days as "26d" doesn't need a full row but pairing it with anything
     * else gets awkward. Captions are re-enabled for these cells only so
     * "$180" without "Then" isn't ambiguous on narrow screens. */
    .hp-company-row .hp-company-stat--cap        { grid-column: 1; margin-left: 40px; }
    .hp-company-row .hp-company-stat--price-then { grid-column: 2; }
    .hp-company-row .hp-company-stat--price-now  { grid-column: 1; margin-left: 40px; }
    .hp-company-row .hp-company-stat--pct        { grid-column: 2; text-align: left; }
    .hp-company-row .hp-company-stat--days       { grid-column: 1 / 3; margin-left: 40px; }
    .hp-company-row .hp-company-stat--days .hp-company-stat-lbl,
    .hp-company-row .hp-company-stat--pct .hp-company-stat-lbl,
    .hp-company-row .hp-company-stat--price-then .hp-company-stat-lbl,
    .hp-company-row .hp-company-stat--price-now .hp-company-stat-lbl { display: block; }
    .hp-company-row .hp-reviewed-chip-wrap    { grid-column: 1 / 3; align-items: flex-end; }
    /* Mobile: allow industry+note to wrap to a second line if it's long.
     * The desktop nowrap+ellipsis is too restrictive on narrow screens. */
    .hp-company-row .hp-company-industry {
        white-space: normal;
    }
    .hp-search-section {
        padding: 36px 20px;
    }
    .hp-depth-explainer-inner {
        padding: 16px;
    }
    /* Stack the group row: name + count on top line, items wrapped below. */
    .hp-depth-group-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 12px;
    }
    .hp-depth-group-name {
        min-width: 0;
    }
    .hp-depth-group-items {
        line-height: 1.5;
        word-break: break-word;
    }
    /* Let scale badges wrap into a compact grid instead of one flex row. */
    .hp-depth-scale {
        flex-wrap: wrap;
        gap: 8px 14px;
        justify-content: flex-start;
    }
}

/* ── Reviewed By Delvantic section ─────────────────── */
.hp-reviewed-section {
    margin-bottom: 20px;
}
.hp-reviewed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 10px;
}
.hp-reviewed-header h5 {
    font-weight: 700;
    color: #1f2937;
}
.hp-reviewed-count {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hp-reviewed-chip {
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    margin-left: 10px;
    flex-shrink: 0;
    align-self: center;
}

/* AI review chip — shows on a reviewed row when at least one AI reviewer
 * has completed. Single-line layout with badges side-by-side. The "AI
 * REVIEWS" caption used to sit on top, but that doubled the row height for
 * something the badges already communicate. Tooltip on hover still says
 * "AI reviews — Claude: X, GPT: Y". Clicking opens the company detail
 * page scrolled to the AI Findings card. */
.hp-ai-review-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    flex-shrink: 0;
    white-space: nowrap;
}
.hp-ai-review-chip:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-1px);
}
.hp-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px 2px 2px;
    border-radius: 8px;
    color: #fff;
}
.hp-ai-badge-logo {
    width: 14px;
    height: 14px;
    display: inline-flex;
    flex-shrink: 0;
    color: #fff;
    opacity: 0.9;
}
.hp-ai-badge-count {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    padding-right: 2px;
}
/* Brand-adjacent chip colors: Anthropic rust for Claude, softened charcoal
 * for GPT (pure black read as a punch hole next to the rust chip). SVG
 * inside uses currentColor → inherits white for contrast. */
.hp-ai-badge--claude { background: #D97757; } /* Anthropic brand rust */
.hp-ai-badge--gpt    { background: #4b5563; } /* Slate-600, tonned-down */

/* Inline AI verdict preview — replaces the chip on Reviewed rows. The
 * headline is the verdict line from ai-findings (one-sentence call); the
 * sub is the first sentence of the narrative. Both ellipsis on overflow
 * so the row height stays predictable; full text on hover via title. */
.hp-ai-preview {
    cursor: pointer;
    line-height: 1.3;
    padding: 2px 8px;
    border-left: 2px solid #e5e7eb;
    transition: border-color 0.12s;
}
.hp-ai-preview:hover { border-left-color: #4f46e5; }
.hp-ai-preview-headline {
    font-size: 12px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hp-ai-preview:hover .hp-ai-preview-headline { color: #4f46e5; }
.hp-ai-preview-sub {
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.hp-company-row--reviewed {
    background: linear-gradient(to right, #fffbeb 0%, #fff 30%);
    border-left: 3px solid #f59e0b;
}
.hp-company-row--reviewed:hover {
    background: linear-gradient(to right, #fef3c7 0%, #fff 30%);
}

/* Fully-researched rows pick up the section's purple identity (lightbulb
 * icon in the heading is #7c3aed) — same visual rhythm as the curator
 * list above, distinct color so the two sections don't blur together. */
.hp-company-row--fully-researched {
    background: linear-gradient(to right, #f5f3ff 0%, #fff 30%);
    border-left: 3px solid #7c3aed;
}
.hp-company-row--fully-researched:hover {
    background: linear-gradient(to right, #ede9fe 0%, #fff 30%);
}
.hp-company-row--fully-researched .hp-ai-preview {
    border-left-color: #c4b5fd;
}
.hp-company-row--fully-researched .hp-ai-preview:hover {
    border-left-color: #7c3aed;
}
.hp-company-row--fully-researched .hp-ai-preview:hover .hp-ai-preview-headline {
    color: #7c3aed;
}
.hp-section-divider {
    display: flex;
    align-items: center;
    margin: 24px 0 16px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.hp-section-divider::before,
.hp-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}
.hp-section-divider span {
    padding: 0 14px;
}

/* ── Reviewed by Delvantic & Curator — viewport split ──────
 * Two sibling renderings of the same data in homepage3.php:
 *   .hp-reviewed-variant--divs   — CSS-grid rows, mobile-friendly
 *   .hp-reviewed-variant--table  — real <table>, desktop-friendly
 * Tables don't collapse well on narrow screens, so we show the
 * table on desktop and the div-row version on mobile. Both sections
 * are always present in the DOM; only one is visible at a time. */
.hp-reviewed-variant--table { display: block; }
.hp-reviewed-variant--divs  { display: none; }
@media (max-width: 768px) {
    .hp-reviewed-variant--table { display: none; }
    .hp-reviewed-variant--divs  { display: block; }
}

/* ── Reviewed by Delvantic & Curator — TABLE variant ──────
 * Sibling rendering of the same data using a real <table>.
 * Matches the div version's amber gradient row + hover and
 * the same green/red pct treatment. Drop one when we pick. */

.hp-level-card--table {
    padding: 0;  /* table draws its own internal padding */
    overflow-x: auto;  /* narrow viewports get a horizontal scroll */
}
.hp-reviewed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    /* Fixed layout so column widths come from CSS, not content. Without
     * this, long company names push the row past the container and we
     * get an unwanted horizontal scrollbar. */
    table-layout: fixed;
}
.hp-reviewed-table .hp-rt-th-id,
.hp-reviewed-table .hp-rt-id       { width: 130px; }
.hp-reviewed-table .hp-rt-th-info,
.hp-reviewed-table .hp-rt-info     { width: 300px; }
.hp-reviewed-table .hp-rt-th-ai,
.hp-reviewed-table .hp-rt-ai       { width: 90px; }
.hp-reviewed-table .hp-rt-th-cap,
.hp-reviewed-table .hp-rt-cap      { width: 80px; }
.hp-reviewed-table .hp-rt-th-days,
.hp-reviewed-table .hp-rt-days     { width: 50px; }
.hp-reviewed-table .hp-rt-th-price,
.hp-reviewed-table .hp-rt-price    { width: 78px; }
.hp-reviewed-table .hp-rt-th-pct,
.hp-reviewed-table .hp-rt-pct      { width: 70px; }
.hp-reviewed-table .hp-rt-th-rating,
.hp-reviewed-table .hp-rt-rating   { width: 90px; }
.hp-reviewed-table thead th {
    text-align: left;
    font-size: 10px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
    padding: 10px 12px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
.hp-reviewed-table thead .hp-rt-th-rating { text-align: right; }
.hp-reviewed-table tbody tr {
    cursor: pointer;
    background: linear-gradient(to right, #fffbeb 0%, #fff 30%);
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}
.hp-reviewed-table tbody tr:hover {
    background: linear-gradient(to right, #fef3c7 0%, #fff 30%);
}
.hp-reviewed-table tbody tr:last-child {
    border-bottom: none;
}
.hp-reviewed-table td {
    padding: 12px;
    vertical-align: middle;
    color: #1f2937;
}

/* Left amber accent on the first cell — mimics the div version's
   `border-left: 3px solid #f59e0b` on .hp-company-row--reviewed. */
.hp-reviewed-table tbody td:first-child {
    box-shadow: inset 3px 0 0 #f59e0b;
}

/* Cell-level styling. The first cell holds logo + ticker stacked
   horizontally, so the inner wrapper goes flex. */
.hp-rt-id-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.hp-reviewed-table .hp-rt-info { overflow: hidden; }
.hp-reviewed-table .hp-company-name,
.hp-reviewed-table .hp-company-industry {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hp-reviewed-table .hp-company-name {
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
}
.hp-reviewed-table .hp-company-industry {
    font-size: 12px;
    color: #6b7280;
}
.hp-rt-cap,
.hp-rt-days,
.hp-rt-price {
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
}
.hp-rt-days,
.hp-rt-price,
.hp-rt-pct,
.hp-rt-cap {
    text-align: left;
}
.hp-rt-pct {
    font-weight: 700;
    white-space: nowrap;
}
.hp-rt-pct.hp-pct--up   { color: #059669; }
.hp-rt-pct.hp-pct--down { color: #dc2626; }
.hp-rt-rating {
    text-align: right;
    white-space: nowrap;
}
.hp-reviewed-table .hp-reviewed-chip {
    margin-left: 0;  /* table cell handles spacing; chip is the only thing here */
}

/* Date subline rendered under the Then/Now value cells and the rating
 * chip — surfaces the timestamp each datapoint was captured at so the
 * temporal gap is visible at a glance. */
.hp-rt-val {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}
.hp-rt-subdate {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 2px;
    font-weight: 400;
}
.hp-rt-subdate--rating {
    text-align: right;
    margin-top: 4px;
}

/* Small "admin" pill rendered above each admin-only column header
 * (Then / Now / Change / Days). Surfaces "you're seeing this because
 * you're logged in as a stocks admin" so the visibility-gating is
 * never confusing on the same page rendered for different audiences. */
.hp-admin-chip {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    color: #6366f1;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 1px 6px;
    border-radius: 8px;
    line-height: 1.2;
}

/* Table variant is desktop-only (see viewport split at the top of this
 * block). Mobile users see the div-row version with its own collapse
 * rules in the @media (max-width: 768px) block higher up. */
