/* ── Reusable (?) info tooltip ──────────────────────────────────────
   Hover or focus shows the body. Used in the feedback panel and in
   per-prediction controls on the predict page. */
.info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: help;
    margin-left: 4px;
    vertical-align: middle;
}

.info-tip .info-tip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #d6d6cc;
    color: #4a4a3f;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    user-select: none;
}

.info-tip:hover .info-tip-icon,
.info-tip:focus-visible .info-tip-icon {
    background: #4a6fa5;
    color: #fff;
}

.info-tip .info-tip-body {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(2px);
    width: max-content;
    max-width: 260px;
    padding: 8px 10px;
    background: #2b2b2b;
    color: #f5f5f0;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 400;
    text-align: left;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease, transform 0.12s ease;
    z-index: 100;
    white-space: normal;
}

.info-tip:hover .info-tip-body,
.info-tip:focus-visible .info-tip-body,
.info-tip:focus-within .info-tip-body {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Chemist feedback panel — inline per precursor card. */
.feedback-panel {
    margin-top: 10px;
    padding: 10px 12px;
    background: #f7f7f4;
    border: 1px solid #e6e6df;
    border-radius: 6px;
    font-size: 13px;
}

.feedback-panel.fb-disabled {
    background: #f0f0ec;
    color: #888;
}

.feedback-panel .fb-banner {
    margin-bottom: 8px;
    padding: 6px 8px;
    background: #fff7e6;
    border: 1px solid #f0d28a;
    border-radius: 4px;
    color: #7a5a1c;
    font-size: 12px;
}

.feedback-panel .fb-banner code {
    background: #fdecc4;
    padding: 0 4px;
    border-radius: 3px;
}

/* ── Section title strip on top of the panel ─────────────────────── */
.feedback-panel .fb-section-title {
    display: flex;
    align-items: center;
    margin: -2px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e6e6df;
}

.feedback-panel .fb-section-title-text {
    font-weight: 700;
    font-size: 13px;
    color: #1a1a2e;
    letter-spacing: 0.01em;
}

.feedback-panel.fb-disabled .fb-section-title-text { color: #999; }

/* ── Plausibility slider row ──────────────────────────────────────── */
.feedback-panel .fb-rate-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.feedback-panel .fb-rate-name {
    font-weight: 600;
    color: #333;
}

.feedback-panel.fb-disabled .fb-rate-name { color: #999; }

.feedback-panel .fb-rate-slider {
    flex: 1;
    min-width: 120px;
    max-width: 240px;
}

.feedback-panel .fb-rate-value {
    display: inline-block;
    min-width: 1.2em;
    text-align: center;
    font-weight: 600;
    color: #4a6fa5;
}

.feedback-panel .fb-rate-scale {
    font-size: 11px;
    color: #888;
    margin-left: auto;
}

/* ── Dropdown row + buttons ───────────────────────────────────────── */
.feedback-panel .fb-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex-wrap: wrap;
}

.feedback-panel .fb-btn {
    padding: 4px 10px;
    border: 1px solid #c8c8bd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.2;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.feedback-panel .fb-btn:hover:not(:disabled) {
    background: #f0f0e8;
    border-color: #a0a090;
}

.feedback-panel .fb-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.feedback-panel details { margin: 0; }

.feedback-panel summary.fb-summary {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid #c8c8bd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    position: relative;
}

.feedback-panel summary.fb-summary::-webkit-details-marker { display: none; }
.feedback-panel summary.fb-summary::after { content: ' ▾'; color: #888; }
.feedback-panel details[open] summary.fb-summary::after { content: ' ▴'; }

.feedback-panel.fb-disabled summary.fb-summary {
    pointer-events: none;
    opacity: 0.5;
}

/* Persistent tick on the summary once the chemist has saved any value for
   that control (set/cleared by JS). */
.feedback-panel .fb-summary-tick {
    display: inline-block;
    margin-left: 6px;
    color: #2d8a47;
    font-weight: 700;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.feedback-panel .fb-summary-tick.fb-saved {
    opacity: 1;
    transform: scale(1);
}

.feedback-panel .fb-tag-body,
.feedback-panel .fb-comment-body {
    margin-top: 8px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e6e6df;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 260px;
}

.feedback-panel .fb-tag-body label {
    font-size: 12px;
    color: #333;
    display: block;
}

.feedback-panel .fb-tag-positive {
    color: #2d6a3e;
    font-weight: 600;
}

.feedback-panel .fb-tag-divider {
    margin: 4px 0;
    border: none;
    border-top: 1px dashed #d0d0c4;
}

.feedback-panel .fb-text {
    width: 100%;
    font-family: inherit;
    font-size: 12px;
    padding: 6px;
    border: 1px solid #c8c8bd;
    border-radius: 4px;
    resize: vertical;
}

/* ── Inline status indicator: appears next to whatever the user just did ── */
.feedback-panel .fb-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.feedback-panel .fb-status-inline {
    font-size: 12px;
    font-weight: 600;
    color: #2d8a47;             /* success green by default */
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
    white-space: nowrap;
}

.feedback-panel .fb-status-inline.fb-visible {
    opacity: 1;
    transform: translateY(0);
}

.feedback-panel .fb-status-inline.fb-error {
    color: #b54a4a;
}
