/* "+"-knappen ved papirerne og vinduet med analytikernes vurderinger (analyst.js). Global, fordi vinduet oprettes af scriptet. */
/* Øverst i vinduet: profilen af virksomheden fra Claude, som først hentes, når der trykkes på knappen. Dæmpet blå,
   så den skiller sig ud fra analytikernes data. Profilen afsluttes med en streg mod analytikerdelen nedenunder. */
.info-section {
    margin-bottom: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(233, 238, 244, 0.1);
}

/* Brugerens egen note i "+"-vinduet (notes.js, editor): kun det lille note-ikon (som ved aktierne); et klik folder
   skrivefeltet ud, og først da får afsnittet en streg under sig. */
.note-inline {
    margin-bottom: 0.6rem;
}

    .note-inline.open {
        margin-bottom: 1rem;
        padding-bottom: 0.9rem;
        border-bottom: 1px solid rgba(233, 238, 244, 0.1);
    }

    .note-inline form {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 0.6rem;
    }

    .note-inline form[hidden] {
        display: none;
    }

    .note-inline h3 {
        margin-top: 0 !important;
    }

    .note-inline textarea {
        min-height: 5.5rem;
    }

/* Ikonet med noten ved siden af (når der er en); et klik på teksten folder også skrivefeltet ud. */
.note-inline-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.note-inline-text {
    flex: 1;
    min-width: 0;
    margin: 0 !important;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    cursor: pointer;
}

    .note-inline-text[hidden] {
        display: none;
    }

.note-inline-open {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    padding: 0;
    border: 1px solid rgba(148, 170, 205, 0.25);
    border-radius: 5px;
    background: transparent;
    color: var(--faint);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

    .note-inline-open:hover,
    .note-inline-open:focus-visible,
    .note-inline-open[aria-expanded="true"] {
        border-color: rgba(201, 162, 92, 0.55);
        color: var(--accent);
    }

    .note-inline-open.has-note {
        border-color: rgba(201, 162, 92, 0.55);
        background: rgba(201, 162, 92, 0.14);
        color: var(--accent);
    }

.info-load {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem 0.4rem 0.45rem;
    border-radius: 999px;
    border: 1px solid rgba(111, 168, 220, 0.45);
    background: rgba(111, 168, 220, 0.08);
    color: #a9cbee;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

    .info-load:hover,
    .info-load:focus-visible {
        background: rgba(111, 168, 220, 0.22);
        color: var(--text);
    }

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 999px;
    border: 1px solid rgba(111, 168, 220, 0.6);
    font: italic 600 0.8rem/1 Georgia, serif;
}

.info-about {
    margin: 0.25rem 0 0.9rem;
    line-height: 1.55;
}

.info-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
    gap: 0.6rem 1.25rem;
    margin: 0;
}

    .info-facts dt {
        font-family: var(--font-mono);
        font-size: 0.66rem;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--muted);
    }

    .info-facts dd {
        margin: 0.1rem 0 0;
    }

.info-list {
    margin: 0;
    padding-left: 1.1rem;
    line-height: 1.5;
}

    .info-list li + li {
        margin-top: 0.25rem;
    }

/* AI'ens vurdering til sidst: en kant i vurderingens farve (grøn, grå eller rød) markerer, at det er en mening, ikke fakta. */
.info-assessment {
    margin-top: 1.3rem;
    padding: 0.2rem 0 0.4rem 0.9rem;
    border-left: 3px solid var(--stance, #8a94a6);
}

    .info-assessment h3 {
        margin-top: 0.4rem;
    }

    .info-assessment p {
        margin: 0.3rem 0 0.6rem;
        line-height: 1.55;
    }

    .info-assessment.stance-positive {
        --stance: #5dd88a;
    }

    .info-assessment.stance-negative {
        --stance: #ff6b61;
    }

.info-stance {
    font-weight: 600;
    font-size: 1rem;
    color: var(--stance, #c3cad6);
}

.info-procon {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: 0.5rem 1.5rem;
}

    .info-procon h4 {
        margin: 0.2rem 0 0.35rem;
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--muted);
    }

.analyst-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 1.2rem;
    height: 1.2rem;
    margin-left: 0.35rem;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(201, 162, 92, 0.45);
    background: rgba(201, 162, 92, 0.08);
    color: var(--accent);
    font: 600 0.85rem/1 var(--font-display);
    vertical-align: middle;
    cursor: pointer;
}

    .analyst-btn:hover,
    .analyst-btn:focus-visible {
        background: rgba(201, 162, 92, 0.25);
        color: var(--text);
    }

    /* Konsensus stærkt køb: tykkere, lysegrøn ring. Sælg (Yahoos "Underperform" og "Sell"): tykkere, rød ring. */
    .analyst-btn.strong-buy {
        border: 2px solid #5dff8f;
        color: #5dff8f;
        background: rgba(93, 255, 143, 0.1);
    }

    .analyst-btn.sell {
        border: 2px solid #ff3b30;
        color: #ff5a50;
        background: rgba(255, 59, 48, 0.12);
    }

        .analyst-btn.strong-buy:hover,
        .analyst-btn.strong-buy:focus-visible {
            background: rgba(93, 255, 143, 0.25);
        }

        .analyst-btn.sell:hover,
        .analyst-btn.sell:focus-visible {
            background: rgba(255, 59, 48, 0.28);
        }

/* Lille mærkat efter "+" med AI'ens konklusion fra den gemte profil: grøn køb, grå neutral, rød nej. */
.ai-stance {
    display: inline-flex;
    align-items: center;
    flex: none;
    margin-left: 0.3rem;
    padding: 0.05rem 0.38rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    line-height: 1.35;
    letter-spacing: 0.02em;
    white-space: nowrap;
    vertical-align: middle;
    cursor: help;
}

    .ai-stance.stance-positive {
        color: #7ed38c;
        background: rgba(126, 211, 140, 0.1);
    }

    .ai-stance.stance-neutral {
        color: #a3adbd;
        background: rgba(163, 173, 189, 0.08);
    }

    .ai-stance.stance-negative {
        color: #ff8a7d;
        background: rgba(255, 122, 107, 0.1);
    }

    /* Blåt "+" ved aktier uden analytikere: går direkte til AI-profilen af virksomheden. */
    .analyst-btn.info-only {
        border-color: rgba(111, 168, 220, 0.6);
        background: rgba(111, 168, 220, 0.12);
        color: #8fbbe6;
    }

        .analyst-btn.info-only:hover,
        .analyst-btn.info-only:focus-visible {
            background: rgba(111, 168, 220, 0.28);
            color: var(--text);
        }

dialog.analyst {
    width: min(42rem, calc(100vw - 32px));
    max-height: calc(100dvh - 48px);
    padding: 0;
    border-radius: 14px;
    border: 1px solid rgba(201, 162, 92, 0.25);
    background: #0d1526;
    color: var(--text);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

    dialog.analyst::backdrop {
        background: rgba(3, 6, 14, 0.65);
    }

.analyst-head {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.1rem 0.75rem;
    background: #0d1526;
    border-bottom: 1px solid rgba(201, 162, 92, 0.14);
}

    .analyst-head h2 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
    }

.analyst-symbol {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--faint);
}

.analyst-close {
    padding: 0 0.4rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

    .analyst-close:hover {
        color: var(--text);
        background: rgba(148, 170, 205, 0.1);
    }

.analyst-body {
    padding: 0.9rem 1.1rem 1.1rem;
    font-size: 0.9rem;
}

    .analyst-body h3 {
        margin: 1.2rem 0 0.5rem;
        font-family: var(--font-mono);
        font-size: 0.7rem;
        font-weight: 400;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--muted);
    }

.analyst-muted {
    margin: 0.25rem 0;
    color: var(--muted);
}

.analyst-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2.5rem;
}

.analyst-stat {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.analyst-label {
    font-size: 0.75rem;
    color: var(--muted);
}

.analyst-value {
    font-size: 1.4rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

    .analyst-value small {
        font-size: 0.75rem;
        font-weight: 400;
        color: var(--faint);
    }

    .analyst-value.rec-strong_buy,
    .analyst-value.rec-buy {
        color: #a6e3a1;
    }

    .analyst-value.rec-underperform,
    .analyst-value.rec-sell {
        color: #ff7a6b;
    }

.analyst-sub {
    font-size: 0.8rem;
    color: var(--muted-strong);
}

.analyst-body .up {
    color: #a6e3a1;
}

.analyst-body .down {
    color: #ff7a6b;
}

/* Kursmålenes spænd */
.analyst-range {
    margin-top: 1rem;
}

.range-track {
    position: relative;
    height: 10px;
    margin: 0 6px;
    border-radius: 999px;
    background: rgba(148, 170, 205, 0.1);
}

.range-span {
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: 999px;
    background: rgba(201, 162, 92, 0.35);
}

.range-mean {
    position: absolute;
    top: -4px;
    width: 3px;
    height: 18px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: var(--text);
}

.range-now {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 2px #0d1526;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.45rem;
    font-size: 0.75rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.range-key {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

    .range-key i {
        display: inline-block;
    }

.key-now {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--accent);
}

.key-mean {
    width: 3px;
    height: 11px;
    margin-left: 0.5rem;
    border-radius: 2px;
    background: var(--text);
}

/* Anbefalinger pr. måned: stablet fra køb (grøn) til sælg (rød) */
.analyst-trend {
    display: grid;
    gap: 0.35rem;
}

.trend-row {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
}

.trend-period {
    color: var(--muted);
}

.trend-bar {
    display: flex;
    gap: 2px;
    height: 18px;
}

.seg {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1rem;
    border-radius: 3px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #0a1120;
}

.seg-sb { background: #4fbf7f; }
.seg-b { background: #a6e3a1; }
.seg-h { background: #8a97ad; }
.seg-s { background: #ff9f93; }
.seg-ss { background: #e0503f; }

.analyst-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.9rem;
    margin-top: 0.5rem;
    font-size: 0.72rem;
    color: var(--muted);
}

    .analyst-legend span {
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
    }

    .analyst-legend i {
        width: 10px;
        height: 10px;
        border-radius: 2px;
    }

/* Finanshusenes vurderinger */
.analyst-table {
    max-height: 18rem;
    overflow: auto;
    border-radius: 10px;
    border: 1px solid rgba(148, 170, 205, 0.12);
}

    .analyst-table table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.8rem;
    }

    .analyst-table th {
        position: sticky;
        top: 0;
        padding: 0.45rem 0.6rem;
        background: #111b30;
        text-align: left;
        font-family: var(--font-mono);
        font-size: 0.65rem;
        font-weight: 400;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--muted);
    }

    .analyst-table td {
        padding: 0.4rem 0.6rem;
        border-top: 1px solid rgba(148, 170, 205, 0.08);
    }

    .analyst-table .num {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    .analyst-table .nowrap {
        white-space: nowrap;
    }

.act-up { color: #a6e3a1; }
.act-down { color: #ff7a6b; }
.act-init { color: var(--accent); }

.analyst-note {
    margin: 0.9rem 0 0;
    font-size: 0.75rem;
    color: var(--faint);
}

/* Amps-analysens score i "+"-vinduet (analyst.js, ampsSection): samlet score, delscorer som små søjler og et par ord.
   Samme grøn/grå/rød som AI'ens vurdering; afsnittet afsluttes med en streg som profilen ovenover. */
.amps-analyse {
    margin-bottom: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(233, 238, 244, 0.1);
}

    .amps-analyse h3 {
        margin-top: 0;
    }

.aa-head {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    margin: 0.2rem 0 0.6rem;
}

.aa-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
}

    .aa-value small {
        font-size: 0.8rem;
        font-weight: 400;
        color: var(--faint);
    }

.aa-verdict {
    font-weight: 600;
}

.aa-buy { --aa: #5dd88a; }
.aa-hold { --aa: #8a94a6; }
.aa-sell { --aa: #ff6b61; }

.aa-value.aa-buy, .aa-value.aa-sell, .aa-verdict.aa-buy, .aa-verdict.aa-sell {
    color: var(--aa);
}

.aa-parts {
    display: grid;
    gap: 0.3rem;
    max-width: 22rem;
}

.aa-row {
    display: grid;
    grid-template-columns: 6.5rem 1fr 1.5rem;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
}

.aa-bar {
    height: 0.45rem;
    border-radius: 999px;
    background: rgba(233, 238, 244, 0.08);
    overflow: hidden;
}

    .aa-bar > span {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: var(--aa);
    }

.aa-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.aa-words {
    margin: 0.7rem 0 0;
    line-height: 1.5;
}
/* Amps-analysens mærkat i listerne (AmpsAnalyseBadge.razor, analyst.js ampsMarkAnalyse): samme form som AI'ens mærkat,
   farven efter scoren (grøn 7–10, grå 4–6, rød 1–3); teksten om scoren står i title. */
.aa-badge {
    display: inline-flex;
    align-items: center;
    flex: none;
    margin-left: 0.3rem;
    padding: 0.05rem 0.38rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    line-height: 1.35;
    letter-spacing: 0.02em;
    white-space: nowrap;
    vertical-align: middle;
    cursor: help;
}

    .aa-badge.aa-buy { color: #7ed38c; background: rgba(126, 211, 140, 0.1); }
    .aa-badge.aa-hold { color: #a3adbd; background: rgba(163, 173, 189, 0.08); }
    .aa-badge.aa-sell { color: #ff8a7d; background: rgba(255, 122, 107, 0.1); }