/* Share thesis dialog (design 1B) — the sheet deliberately breaks two
   compact-sheet conventions (in-body title, filled Create button); that is
   the approved design, not a mistake to "fix" back. Colors are tokens only —
   see the design reference's header comment for the hex→token mapping. */

/* Strip MudDialog's own padding/paper defaults so .ij-share-sheet owns the
   exact 22/24/18 padding from the design. */
.ij-share-dialog.mud-dialog {
    width: min(496px, calc(100vw - 32px));
    max-width: 496px;
    border-radius: 16px;
}

.ij-share-dialog .mud-dialog-content {
    padding: 0;
}

.ij-share-sheet {
    display: flex;
    flex-direction: column;
    padding: 22px 24px 18px;
}

/* --- Header: title + "{Company} · {TICKER}" + close --- */

.ij-share-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ij-share-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.ij-share-sub {
    margin-top: 3px;
    font-size: 12.5px;
    color: var(--ij-text-secondary);
}

.ij-share-close {
    flex: none;
    display: inline-flex;
    border: none;
    background: transparent;
    padding: 2px;
    color: var(--ij-text-secondary);
    cursor: pointer;
}

.ij-share-intro {
    margin: 12px 0 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--ij-text-secondary);
}

/* --- Show my name --- */

.ij-share-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    cursor: pointer;
}

.ij-share-name-label {
    font-size: 13.5px;
    color: var(--mud-palette-text-primary);
}

.ij-share-switch .mud-switch-track {
    opacity: 1;
    background-color: var(--ij-divider);
}

.ij-share-switch .mud-switch-base.mud-checked + .mud-switch-track {
    background-color: var(--ij-primary);
    opacity: 1;
}

/* --- Create link --- */

.ij-share-create-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.ij-share-create-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: none;
    border-radius: 980px;
    padding: 8px 16px;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background: var(--ij-primary);
    cursor: pointer;
    transition: opacity 0.15s;
}

.ij-share-create-btn:hover {
    opacity: 0.88;
}

.ij-share-create-caption {
    font-size: 12px;
    color: var(--ij-text-tertiary);
}

/* --- Fresh-link callout --- */

.ij-share-fresh {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 11px 12px 11px 14px;
    border-radius: 12px;
    background: var(--ij-primary-tint);
}

.ij-share-fresh-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ij-share-url {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
    color: var(--mud-palette-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ij-share-fresh-sub {
    font-size: 11.5px;
    color: var(--ij-text-secondary);
}

.ij-share-copy-pill {
    flex: none;
    border: none;
    border-radius: 980px;
    padding: 7px 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--ij-primary);
    background: color-mix(in srgb, var(--ij-primary) 14%, transparent);
    cursor: pointer;
    transition:
        color 0.15s,
        background-color 0.15s;
}

.ij-share-copy-pill.ij-copy-ok {
    color: var(--ij-gain);
    background: color-mix(in srgb, var(--ij-gain) 16%, transparent);
}

.ij-share-copy-pill.ij-copy-fail {
    color: var(--ij-loss);
    background: transparent;
}

/* --- Active links --- */

.ij-share-links-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 22px 0 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ij-text-tertiary);
}

.ij-share-links-count {
    font-size: 11px;
    text-transform: none;
    color: var(--ij-text-tertiary);
}

.ij-share-link-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 0;
    border-top: 1px solid var(--ij-divider);
}

.ij-share-link-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ij-share-link-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    cursor: text;
}

.ij-share-link-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ij-share-link-name svg {
    flex: none;
    color: var(--ij-text-tertiary);
}

.ij-share-rename-input {
    width: 100%;
    margin: -4px 0 -4px -8px;
    border: none;
    border-radius: 7px;
    padding: 4px 8px;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    background: color-mix(in srgb, var(--mud-palette-text-primary) 7%, transparent);
    outline: none;
}

.ij-share-link-sub {
    margin-top: 2px;
    font-size: 12px;
    color: var(--ij-text-secondary);
}

.ij-share-copy-text {
    flex: none;
}

.ij-share-revoke-btn {
    flex: none;
    color: var(--ij-loss);
}

/* Applied by the JS delegated copy handler in app-utils.js — same success/fail
   language everywhere a data-ij-copy button lives in this dialog. */
.ij-copy-ok {
    color: var(--ij-gain);
}

.ij-copy-fail {
    color: var(--ij-loss);
}

/* --- Empty state --- */

.ij-share-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding: 26px 0 18px;
    border-top: 1px solid var(--ij-divider);
    text-align: center;
}

.ij-share-empty-text {
    margin: 0;
    font-size: 12.5px;
    color: var(--ij-text-tertiary);
}

/* --- Footer --- */

.ij-share-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--ij-divider);
}

.ij-share-done-btn {
    font-size: 15px;
    font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════
   Public page (design 1A) — /t/{token}, standalone publication page.
   Renders inside the bare PublicShareLayout: no app chrome, so this
   page draws its own top bar. Colors are tokens only, per the design
   reference's header comment. Class prefix ij-st-.
   ════════════════════════════════════════════════════════════════ */

/* Root wrapper. PublicShareLayout renders @Body only — no app-shell markup —
   so this is the one place the page's font stack, base text color, and page
   background get set; everything below inherits them. Without this the page
   fell back to the browser's serif default (MainLayout normally carries the
   app's typography baseline, which this bare layout never applies). */
.ij-st-page {
    font-family: var(--ij-font-family);
    -webkit-font-smoothing: antialiased;
    background: var(--ij-bg);
    color: var(--ij-text-primary);
    min-height: 100vh;

    /* Component-scoped indigo for the "key assumptions" label — distinct from
       --ij-primary (blue), which the catalysts label uses. No shared indigo
       token exists yet (checked tokens.css), so it's defined here with both
       theme values, mirroring tokens.css's own light/dark block pattern —
       declaring it light-only would freeze the light value into dark (see
       the CSS-var-alias-theme-scope lesson). */
    --ij-st-indigo: #594ae2;
}

.ij-theme-dark .ij-st-page {
    --ij-st-indigo: #7e6fff;
}

/* Page-scoped verdict-chip color overrides: the bare PublicShareLayout never
   mounts MudThemeProvider, so --mud-palette-success/error/text-secondary
   (which thesis.css's base .ij-thesis-verdict-chip--* rely on) are undefined
   here and the chip renders as plain text on a transparent background.
   Override only color/background — padding/radius/font stay in thesis.css's
   base .ij-thesis-verdict-chip class, which this page still uses. */
.ij-st-page .ij-thesis-verdict-chip--green {
    color: var(--ij-gain);
    background: color-mix(in srgb, var(--ij-gain) 14%, transparent);
}

.ij-st-page .ij-thesis-verdict-chip--red {
    color: var(--ij-loss);
    background: color-mix(in srgb, var(--ij-loss) 14%, transparent);
}

.ij-st-page .ij-thesis-verdict-chip--neutral {
    color: var(--ij-text-secondary);
    background: color-mix(in srgb, var(--ij-text-secondary) 14%, transparent);
}

/* --- Top bar: mark + wordmark left, "Keep your own journal" pill right --- */

.ij-st-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 24px;
    border-bottom: 1px solid var(--ij-divider);
    background: color-mix(in srgb, var(--ij-bg) 82%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.ij-st-topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ij-text-primary);
    text-decoration: none;
}

.ij-st-topbar-mark {
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    object-fit: cover;
}

.ij-st-topbar-name {
    font-size: 15px;
    font-weight: 600;
}

.ij-st-topbar-pill {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border-radius: 980px;
    padding: 7px 15px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ij-primary);
    background: color-mix(in srgb, var(--ij-primary) 12%, transparent);
    text-decoration: none;
}

/* --- Reading column --- */

.ij-st-column {
    max-width: 728px;
    margin: 0 auto;
    padding: 52px 24px 44px;
}

.ij-st-not-found {
    margin: 40px 0;
    text-align: center;
    font-size: 15px;
    color: var(--ij-text-secondary);
}

.ij-st-kicker {
    margin-bottom: 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ij-text-tertiary);
}

.ij-st-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
}

.ij-st-title {
    margin: 0;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--ij-text-primary);
}

.ij-st-ticker {
    font-size: 20px;
    font-weight: 600;
    /* #1251 — 20px/600 is NOT WCAG large text (that needs >=18.66px BOLD, i.e. 700,
       or >=24px regular), so the 4.5:1 threshold applies. Tertiary measures 2.57:1
       in light: it fails even the 3:1 large-text threshold. */
    color: var(--ij-text-secondary);
}

.ij-st-sector {
    margin-top: 7px;
    font-size: 13.5px;
    color: var(--ij-text-secondary);
}

/* --- Byline: avatar + name + snapshot date --- */

.ij-st-byline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.ij-st-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    color: var(--ij-primary);
    background: color-mix(in srgb, var(--ij-primary) 16%, transparent);
}

.ij-st-byline-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ij-text-primary);
}

.ij-st-byline-dot {
    color: var(--ij-text-tertiary);
}

.ij-st-byline-date {
    font-size: 13.5px;
    color: var(--ij-text-secondary);
}

/* --- Verdict row: chip + target + "at X when written · +y% to target" --- */

.ij-st-verdict-row {
    margin-top: 18px;
}

.ij-st-verdict-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.ij-st-target {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
}

.ij-st-target-value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ij-text-primary);
}

.ij-st-target-word {
    font-size: 12.5px;
    color: var(--ij-text-secondary);
}

.ij-st-verdict-sub {
    margin-top: 6px;
    font-size: 13px;
    color: var(--ij-text-secondary);
}

.ij-st-verdict-sub-dot {
    margin: 0 2px;
    color: var(--ij-text-tertiary);
}

.ij-st-gain {
    font-weight: 700;
    color: var(--ij-gain);
}

.ij-st-loss {
    font-weight: 700;
    color: var(--ij-loss);
}

/* --- Sections: bull / bear / key assumptions / catalysts --- */

.ij-st-sections {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-top: 32px;
}

.ij-st-section {
    padding-top: 14px;
}

.ij-st-section--bull {
    border-top: 2px solid var(--ij-gain);
}

.ij-st-section--bear {
    border-top: 2px solid var(--ij-loss);
}

.ij-st-section--assumptions,
.ij-st-section--catalysts {
    border-top: 1px solid var(--ij-divider);
}

.ij-st-section-label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 9px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ij-st-section--bull .ij-st-section-label {
    color: var(--ij-gain);
}

.ij-st-section--bear .ij-st-section-label {
    color: var(--ij-loss);
}

.ij-st-section--assumptions .ij-st-section-label {
    color: var(--ij-st-indigo);
}

.ij-st-section--catalysts .ij-st-section-label {
    color: var(--ij-primary);
}

.ij-st-section-dot {
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

/* Reuses .ij-thesis-prose (thesis.css) for rich-markdown element styling —
   this class only overrides the type scale for the publication page. */
.ij-st-prose {
    font-size: 15.5px;
    line-height: 1.7;
}

/* --- Disclaimer --- */

.ij-st-disclaimer {
    margin: 34px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--ij-divider);
    font-size: 12.5px;
    line-height: 1.55;
    /* #1251 — the financial disclaimer, on the page users share PUBLICLY. Legally
       meaningful text was rendering at 2.57:1 light / 3.07:1 dark. If a disclaimer
       is worth showing, it is worth being readable. */
    color: var(--ij-text-secondary);
}

/* --- CTA card --- */

.ij-st-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
    padding: 22px 24px;
    border-radius: 18px;
    background: var(--ij-bg-gray);
}

.ij-st-cta-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.ij-st-cta-mark {
    display: block;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    object-fit: cover;
}

.ij-st-cta-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ij-st-cta-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ij-text-primary);
}

.ij-st-cta-body {
    max-width: 420px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ij-text-secondary);
}

.ij-st-cta-btn {
    flex: none;
    border-radius: 980px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background: var(--ij-primary);
    text-decoration: none;
    white-space: nowrap;
}

/* --- Footer --- */

.ij-st-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 26px;
    font-size: 11.5px;
    /* #1251 — carries the Disclaimer and Privacy Policy links. Interactive, and the
       entire point is that a reader can FIND them. Same defect #1243 fixed on the
       landing / /pro footer. */
    color: var(--ij-text-secondary);
}

.ij-st-footer-spacer {
    flex: 1;
}

.ij-st-footer a {
    color: inherit;
    text-decoration: none;
}

.ij-st-footer a:hover {
    text-decoration: underline;
}

/* --- Phone (≤640px) --- */

@media (max-width: 640px) {
    .ij-st-topbar {
        height: 52px;
        padding: 0 18px;
    }

    .ij-st-column {
        padding: 30px 22px;
    }

    .ij-st-title {
        font-size: 26px;
    }

    .ij-st-ticker {
        font-size: 16px;
    }

    .ij-st-kicker {
        font-size: 10.5px;
    }

    .ij-st-avatar {
        width: 26px;
        height: 26px;
    }

    .ij-st-prose {
        font-size: 15px;
        line-height: 1.65;
    }

    .ij-st-cta {
        flex-direction: column;
        align-items: flex-start;
    }

    .ij-st-cta-btn {
        align-self: stretch;
        text-align: center;
    }
}
