/* ════════════════════════════════════════════
   In My Daughters Eyes (IMDE) v3.0.0
   Modern flat · grey-scale · no decorations
════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
    --g0:   #ffffff;
    --g50:  #f7f7f7;
    --g100: #efefef;
    --g150: #e4e4e4;
    --g200: #d4d4d4;
    --g300: #b0b0b0;
    --g400: #888888;
    --g500: #606060;
    --g700: #2c2c2c;
    --g900: #111111;

    --c-pos:     #3a7d57;
    --c-neg:     #b03030;
    --c-neu:     #707070;
    --c-pos-bg:  rgba(58,125,87,0.10);
    --c-neg-bg:  rgba(176,48,48,0.10);
    --c-neu-bg:  rgba(112,112,112,0.10);

    /* Heatmap positive levels */
    --hp1: rgba(58,125,87,0.15);
    --hp2: rgba(58,125,87,0.28);
    --hp3: rgba(58,125,87,0.45);
    --hp4: rgba(58,125,87,0.65);
    --hp5: rgba(58,125,87,0.85);
    /* Heatmap negative levels */
    --hn1: rgba(176,48,48,0.15);
    --hn2: rgba(176,48,48,0.28);
    --hn3: rgba(176,48,48,0.45);
    --hn4: rgba(176,48,48,0.65);
    --hn5: rgba(176,48,48,0.85);

    --radius:    4px;
    --radius-lg: 6px;
    --border:    1px solid var(--g150);
    --trans:     0.16s ease;
    --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.imde-wrap *,
.imde-wrap *::before,
.imde-wrap *::after { box-sizing:border-box; margin:0; padding:0; }

/* ── WRAPPER ── */
.imde-wrap {
    font-family: var(--font);
    font-size: 14px;
    color: var(--g700);
    background: var(--g0);
    border: var(--border);
    border-radius: var(--radius-lg);
    max-width: 1100px;
    margin: 2rem auto;
    overflow: hidden;
}

/* ── TWO-COLUMN BODY ── */
.imde-body {
    display: grid;
    grid-template-columns: 420px 1fr;
    min-height: 500px;
}

/* ── LEFT: INPUT ── */
.imde-col-input {
    padding: 20px 22px;
    border-right: var(--border);
    display: flex;
    flex-direction: column;
    background: var(--g0);
}

.imde-input-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.imde-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--g400);
}

.imde-char-count {
    font-size: 11px;
    color: var(--g400);
    font-variant-numeric: tabular-nums;
}
.imde-char-count.imde-near-limit { color: var(--c-neg); }

/* ── TEXTAREA ── */
.imde-textarea {
    width: 100%;
    flex: 1;
    border: var(--border);
    border-radius: var(--radius);
    background: var(--g0);
    color: var(--g700);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.7;
    padding: 12px 14px;
    resize: none;
    outline: none;
    transition: border-color var(--trans);
    display: block;
    min-height: 280px;
}
.imde-textarea:focus { border-color: var(--g400); }
.imde-textarea::placeholder { color: var(--g300); }

/* ── INPUT ACTIONS ── */
.imde-input-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.imde-spacer { flex: 1; }

/* ── STATUS ── */
.imde-status {
    font-size: 11px;
    color: var(--g400);
    font-style: italic;
}
.imde-status.is-analyzing { color: var(--g500); }
.imde-status.is-done      { color: var(--c-pos); font-style: normal; }
.imde-status.is-error     { color: var(--c-neg); font-style: normal; }

/* ── FEATURE 7: HISTORY PANEL ── */
.imde-history-panel {
    margin-top: 12px;
    border: var(--border);
    border-radius: var(--radius);
    background: var(--g50);
    overflow: hidden;
}

.imde-history-empty {
    font-size: 12px;
    color: var(--g400);
    padding: 14px;
    text-align: center;
    font-style: italic;
}

.imde-history-list {
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
}

.imde-history-item {
    display: grid;
    grid-template-columns: auto auto 1fr;
    grid-template-rows: auto auto;
    gap: 4px 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--g150);
    cursor: default;
    transition: background var(--trans);
}
.imde-history-item:last-child { border-bottom: none; }
.imde-history-item:hover { background: var(--g100); }

.imde-history-badge {
    grid-column: 1; grid-row: 1;
    font-size: 10px; font-weight: 500;
    padding: 2px 7px; border-radius: 2px;
    align-self: center;
}

.imde-history-score {
    grid-column: 2; grid-row: 1;
    font-size: 12px; font-weight: 600;
    color: var(--g700);
    font-variant-numeric: tabular-nums;
    align-self: center;
}

.imde-history-preview {
    grid-column: 3; grid-row: 1;
    font-size: 11px; color: var(--g500);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.imde-history-meta {
    grid-column: 1 / -1; grid-row: 2;
    font-size: 10px; color: var(--g300);
}

#imde-history-btn.is-active {
    background: var(--g700);
    color: var(--g0);
    border-color: var(--g700);
}

/* ── RIGHT: RESULTS ── */
.imde-col-results {
    background: var(--g50);
    overflow-y: auto;
    max-height: 720px;
}

/* ── EMPTY STATE ── */
.imde-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    padding: 40px;
}
.imde-empty-text {
    font-size: 13px;
    color: var(--g300);
    font-style: italic;
}

/* ── RESULTS STACK ── */
.imde-results {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--g150);
}

/* ── CARDS ── */
.imde-card {
    background: var(--g0);
    padding: 18px 22px;
    animation: imde-in 0.2s ease both;
}
@keyframes imde-in { from{opacity:0} to{opacity:1} }

.imde-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.imde-card-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--g400);
}

/* ── SCORE ── */
.imde-score-top {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 12px;
}
.imde-score-number {
    font-size: 44px;
    font-weight: 300;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--g900);
    font-variant-numeric: tabular-nums;
    transition: color var(--trans);
    flex-shrink: 0;
}
.imde-score-right { display: flex; flex-direction: column; gap: 4px; }
.imde-score-label {
    font-size: 13px; font-weight: 500;
    color: var(--g400); transition: color var(--trans);
}
.imde-pill {
    font-size: 10px; font-weight: 500;
    padding: 2px 8px; border-radius: 2px;
    background: var(--g100); color: var(--g500);
    border: 1px solid var(--g150); width: fit-content;
}

.imde-score-track {
    position: relative; height: 5px;
    background: var(--g100); border-radius: 3px;
    margin-bottom: 5px; overflow: visible;
}
.imde-score-fill {
    position: absolute; top: 0; height: 100%; border-radius: 3px;
    transition: left 0.4s ease, width 0.4s ease, background 0.3s ease;
}
.imde-score-midline {
    position: absolute; top: -3px; bottom: -3px;
    left: calc(50% - 0.5px); width: 1px;
    background: var(--g300); z-index: 1;
}
.imde-score-axis {
    display: flex; justify-content: space-between;
    font-size: 10px; color: var(--g300); margin-bottom: 10px;
}
.imde-tone-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.imde-tone-tag {
    font-size: 10px; padding: 2px 8px; border-radius: 2px;
    background: var(--g50); color: var(--g400); border: 1px solid var(--g150);
}

/* ── EMOTIONS ── */
.imde-emotion-grid { display: flex; flex-direction: column; gap: 7px; }
.imde-emotion-row {
    display: grid; grid-template-columns: 88px 1fr 34px;
    align-items: center; gap: 10px;
}
.imde-emotion-name { font-size: 11px; color: var(--g500); text-align: right; text-transform: capitalize; }
.imde-emotion-track { height: 3px; background: var(--g100); border-radius: 2px; overflow: hidden; }
.imde-emotion-fill {
    height: 100%; border-radius: 2px; width: 0;
    transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}
.imde-e-joy          { background: #9b9b9b; }
.imde-e-love         { background: #7a7a7a; }
.imde-e-anticipation { background: #888888; }
.imde-e-surprise     { background: #afafaf; }
.imde-e-sadness      { background: #606060; }
.imde-e-fear         { background: #505050; }
.imde-e-anger        { background: #333333; }
.imde-emotion-pct {
    font-size: 10px; color: var(--g400);
    text-align: right; font-variant-numeric: tabular-nums;
}

/* ── FEATURE 1: SENTENCE BADGES ── */
#imde-sentence-badges { display: flex; flex-direction: column; gap: 8px; }

.imde-sent-row {
    display: flex;
    align-items: baseline;
    gap: 9px;
    padding: 6px 0;
    border-bottom: 1px solid var(--g100);
}
.imde-sent-row:last-child { border-bottom: none; }

.imde-sent-badge {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 2px;
    flex-shrink: 0;
    white-space: nowrap;
}
.imde-sent-badge-pos { background: var(--c-pos-bg); color: var(--c-pos); border: 1px solid rgba(58,125,87,0.25); }
.imde-sent-badge-neg { background: var(--c-neg-bg); color: var(--c-neg); border: 1px solid rgba(176,48,48,0.25); }
.imde-sent-badge-neu { background: var(--g100);     color: var(--g400);  border: 1px solid var(--g200); }

.imde-sent-text {
    font-size: 12px;
    color: var(--g500);
    line-height: 1.5;
}

/* ── TABS ── */
.imde-tabs { display: flex; gap: 1px; }
.imde-tab {
    font-family: var(--font);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border: 1px solid var(--g200);
    border-radius: 0;
    cursor: pointer;
    background: var(--g0);
    color: var(--g400);
    transition: background var(--trans), color var(--trans);
}
.imde-tab:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.imde-tab:last-child  { border-radius: 0 var(--radius) var(--radius) 0; border-left: none; }
.imde-tab.is-active   { background: var(--g700); color: var(--g0); border-color: var(--g700); }
.imde-tab:hover:not(.is-active) { background: var(--g100); color: var(--g700); }

/* ── TEXT VIEWS (heatmap + highlight) ── */
.imde-text-view {
    font-size: 13px;
    line-height: 2.0;
    color: var(--g700);
    background: var(--g50);
    border: var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    min-height: 52px;
    margin-bottom: 10px;
    word-break: break-word;
}

/* ── FEATURE 5: HEATMAP TOKENS ── */
.imde-heat-0  { color: var(--g400); }
.imde-heat-p1 { background: var(--hp1); border-radius: 2px; padding: 1px 0; }
.imde-heat-p2 { background: var(--hp2); border-radius: 2px; padding: 1px 0; }
.imde-heat-p3 { background: var(--hp3); border-radius: 2px; padding: 1px 0; color: #fff; }
.imde-heat-p4 { background: var(--hp4); border-radius: 2px; padding: 1px 0; color: #fff; }
.imde-heat-p5 { background: var(--hp5); border-radius: 2px; padding: 1px 0; color: #fff; }
.imde-heat-n1 { background: var(--hn1); border-radius: 2px; padding: 1px 0; }
.imde-heat-n2 { background: var(--hn2); border-radius: 2px; padding: 1px 0; }
.imde-heat-n3 { background: var(--hn3); border-radius: 2px; padding: 1px 0; color: #fff; }
.imde-heat-n4 { background: var(--hn4); border-radius: 2px; padding: 1px 0; color: #fff; }
.imde-heat-n5 { background: var(--hn5); border-radius: 2px; padding: 1px 0; color: #fff; }
.imde-heat-negated { text-decoration: underline dotted; }

/* ── HIGHLIGHTED MARKS ── */
mark.imde-mark {
    border-radius: 2px; padding: 1px 0;
    cursor: default; font-style: inherit;
}
mark.imde-mark-positive { background: var(--c-pos-bg); border-bottom: 2px solid var(--c-pos); color: inherit; }
mark.imde-mark-negative { background: var(--c-neg-bg); border-bottom: 2px solid var(--c-neg); color: inherit; }
mark.imde-mark-neutral  { background: var(--c-neu-bg); border-bottom: 1px dashed var(--c-neu); color: inherit; }
mark.imde-mark:hover { opacity: 0.75; }

/* ── LEGEND ── */
.imde-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.imde-legend-item { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--g400); }
.imde-swatch { display: block; width: 14px; height: 3px; border-radius: 1px; }
.imde-swatch-pos { background: var(--c-pos); }
.imde-swatch-neg { background: var(--c-neg); }
.imde-swatch-neu { border: 1px dashed var(--c-neu); height: 0; margin-top: 1px; }

/* ── BREAKDOWN ── */
.imde-breakdown-list { list-style: none; display: flex; flex-direction: column; }

.imde-breakdown-item {
    display: grid; grid-template-columns: 3px 1fr; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid var(--g100);
}
.imde-breakdown-item:first-child { padding-top: 0; }
.imde-breakdown-item:last-child  { border-bottom: none; padding-bottom: 0; }

.imde-breakdown-bar { width: 3px; align-self: stretch; border-radius: 2px; min-height: 32px; }
.is-positive .imde-breakdown-bar { background: var(--c-pos); }
.is-negative .imde-breakdown-bar { background: var(--c-neg); }
.is-neutral  .imde-breakdown-bar { background: var(--g300); }

.imde-breakdown-phrase { font-size: 12px; font-weight: 500; color: var(--g700); margin-bottom: 3px; font-style: italic; }
.imde-breakdown-reason { font-size: 11px; color: var(--g500); line-height: 1.5; }
.imde-breakdown-meta   { font-size: 10px; color: var(--g300); margin-top: 3px; }

/* ── FEATURE 4: READABILITY ── */
.imde-read-top {
    display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px;
}
.imde-grade {
    font-size: 26px; font-weight: 300; letter-spacing: -0.03em;
    color: var(--g900); font-variant-numeric: tabular-nums;
}
.imde-ease-label {
    font-size: 11px; font-weight: 500; color: var(--g400);
}
.imde-read-stats {
    font-size: 11px; color: var(--g400); margin-bottom: 12px; line-height: 1.6;
}

.imde-sent-dist-wrap { }
.imde-sent-dist {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 36px;
    margin-bottom: 4px;
}
.imde-dist-bar {
    flex-shrink: 0;
    min-width: 4px;
    border-radius: 1px 1px 0 0;
    background: var(--g200);
    transition: background var(--trans);
    cursor: help;
}
.imde-dist-bar.imde-dist-short  { background: var(--g300); }
.imde-dist-bar.imde-dist-medium { background: var(--g500); }
.imde-dist-bar.imde-dist-long   { background: var(--g700); }

.imde-sent-dist-label { font-size: 10px; color: var(--g300); }

/* ── FEATURE 10: LANGUAGE FLAGS ── */
.imde-flag-group { margin-bottom: 12px; }
.imde-flag-group:last-child { margin-bottom: 0; }

.imde-flag-label {
    font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--g400); margin-bottom: 7px;
}

.imde-flag-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.imde-flag-item {
    font-size: 12px; color: var(--g500); line-height: 1.5;
    padding: 5px 8px;
    background: var(--g50); border: var(--border); border-radius: var(--radius);
    border-left: 3px solid var(--g300);
    font-style: italic;
}

.imde-hedge-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.imde-hedge-chip {
    font-size: 11px; padding: 3px 9px; border-radius: 2px;
    background: var(--g100); color: var(--g500);
    border: 1px solid var(--g200);
}

/* ── SENTENCE ARC ── */
#imde-flow-chart { min-height: 70px; }
.imde-flow-note { font-size: 10px; color: var(--g300); margin-top: 6px; }

/* ── SUMMARY ── */
.imde-summary-card { background: var(--g50); }
.imde-summary-text {
    font-size: 13px; line-height: 1.75;
    color: var(--g500); font-weight: 300;
}

/* ── BUTTONS ── */
.imde-btn {
    font-family: var(--font); font-size: 12px; font-weight: 500;
    border-radius: var(--radius); border: var(--border); cursor: pointer;
    padding: 6px 13px;
    transition: background var(--trans), border-color var(--trans), color var(--trans);
    line-height: 1; white-space: nowrap;
}
.imde-btn:focus-visible { outline: 2px solid var(--g400); outline-offset: 2px; }

.imde-btn-secondary { background: var(--g0); color: var(--g500); border-color: var(--g200); }
.imde-btn-secondary:hover  { background: var(--g50); border-color: var(--g300); color: var(--g700); }
.imde-btn-secondary:active { background: var(--g100); }
.imde-btn-sm { padding: 4px 9px; font-size: 10px; }

/* ── UTIL ── */
[hidden] { display: none !important; }

/* ── RESPONSIVE ── */
@media (max-width: 720px) {
    .imde-body { grid-template-columns: 1fr; }
    .imde-col-input { border-right: none; border-bottom: var(--border); }
    .imde-col-results { max-height: none; }
    .imde-textarea { min-height: 140px; resize: vertical; }
}

@media (max-width: 480px) {
    .imde-col-input { padding: 14px 16px; }
    .imde-card { padding: 14px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .imde-emotion-fill, .imde-score-fill, .imde-card { transition: none; animation: none; }
}

/* ── PROFANITY CARD ── */
.imde-profanity-count {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 2px;
    background: rgba(176,48,48,0.10);
    color: var(--c-neg);
    border: 1px solid rgba(176,48,48,0.25);
}

.imde-profanity-summary {
    font-size: 11px;
    color: var(--g500);
    margin-bottom: 10px;
    text-transform: capitalize;
}

.imde-profanity-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.imde-profanity-chip {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 2px;
    font-family: monospace;
    letter-spacing: 0.04em;
    cursor: default;
    border: 1px solid transparent;
}

/* Severity levels — increasingly strong red tint */
.imde-profanity-sev1 {
    background: rgba(176,48,48,0.07);
    color: var(--g500);
    border-color: rgba(176,48,48,0.18);
}
.imde-profanity-sev2 {
    background: rgba(176,48,48,0.14);
    color: var(--c-neg);
    border-color: rgba(176,48,48,0.30);
}
.imde-profanity-sev3 {
    background: rgba(176,48,48,0.22);
    color: var(--c-neg);
    border-color: rgba(176,48,48,0.45);
    font-weight: 600;
}

.imde-profanity-impact {
    font-size: 11px;
    color: var(--g400);
    padding: 6px 10px;
    background: var(--g50);
    border: var(--border);
    border-radius: var(--radius);
    font-variant-numeric: tabular-nums;
}

/* ════════════════════════════════════════════
   SHARED: generic bar track used by new cards
════════════════════════════════════════════ */
.imde-bar-track {
    height: 6px;
    background: var(--g100);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}
.imde-bar-fill {
    height: 100%;
    border-radius: 3px;
    width: 0;
    transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}
.imde-bar-axis {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--g300);
    margin-bottom: 8px;
}
.imde-card-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.imde-meta-text {
    font-size: 11px;
    color: var(--g400);
    line-height: 1.5;
    margin-top: 4px;
}

/* ════════════════════════════════════════════
   FEATURE 1: FORMALITY
════════════════════════════════════════════ */
.imde-formality-fill { background: var(--g600, var(--g700)); }
.imde-formality-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 9px;
    border-radius: 2px;
    background: var(--g100);
    color: var(--g500);
    border: 1px solid var(--g200);
}

/* ════════════════════════════════════════════
   FEATURE 2: PRONOUN DISTRIBUTION
════════════════════════════════════════════ */
#imde-pronoun-chart {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 10px;
}
.imde-pronoun-row {
    display: grid;
    grid-template-columns: 110px 1fr 36px;
    align-items: center;
    gap: 10px;
}
.imde-pronoun-label {
    font-size: 11px;
    color: var(--g500);
    text-align: right;
}
.imde-pronoun-track {
    height: 4px;
    background: var(--g100);
    border-radius: 2px;
    overflow: hidden;
}
.imde-pronoun-fill {
    height: 100%;
    border-radius: 2px;
    width: 0;
    transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}
.imde-pronoun-pct {
    font-size: 11px;
    color: var(--g400);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.imde-pronoun-note {
    font-size: 11px;
    color: var(--g500);
    font-style: italic;
    margin-top: 6px;
    line-height: 1.5;
}

/* ════════════════════════════════════════════
   FEATURE 3: SENTIMENT VELOCITY
════════════════════════════════════════════ */
#imde-vel-chart { min-height: 52px; margin-bottom: 8px; }

.imde-vel-badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 2px;
}
.imde-vel-rising  { background: var(--c-pos-bg); color: var(--c-pos); border: 1px solid rgba(58,125,87,0.25); }
.imde-vel-falling { background: var(--c-neg-bg); color: var(--c-neg); border: 1px solid rgba(176,48,48,0.25); }
.imde-vel-stable  { background: var(--g100);     color: var(--g400);  border: 1px solid var(--g200); }

.imde-vel-note {
    font-size: 11px;
    color: var(--g500);
    line-height: 1.5;
    margin-top: 3px;
    font-style: italic;
}
.imde-vel-note:empty { display: none; }

/* ════════════════════════════════════════════
   FEATURE 4: EMOTIONAL DENSITY
════════════════════════════════════════════ */
.imde-density-fill { background: var(--g500); }
.imde-density-label {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 9px;
    border-radius: 2px;
    background: var(--g100);
    color: var(--g500);
    border: 1px solid var(--g200);
}
.imde-density-note {
    font-size: 11px;
    color: var(--g500);
    font-style: italic;
    margin-top: 5px;
    line-height: 1.5;
}
.imde-density-note:empty { display: none; }

/* ════════════════════════════════════════════
   FEATURE 8: CERTAINTY
════════════════════════════════════════════ */
.imde-certainty-fill { background: var(--g700); transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }

.imde-certainty-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 9px;
    border-radius: 2px;
    border: 1px solid var(--g200);
}
.imde-certainty-confident   { background: var(--c-pos-bg); color: var(--c-pos); border-color: rgba(58,125,87,0.3); }
.imde-certainty-measured    { background: var(--g100);     color: var(--g500);  border-color: var(--g200); }
.imde-certainty-uncertain   { background: rgba(176,48,48,0.07); color: var(--g500); border-color: rgba(176,48,48,0.2); }
.imde-certainty-speculative { background: var(--c-neg-bg); color: var(--c-neg); border-color: rgba(176,48,48,0.3); }

.imde-certainty-words {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}
.imde-certainty-chip {
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 2px;
    background: var(--g50);
    color: var(--g500);
    border: 1px solid var(--g150);
}
