/* Card rows (includes/card-rows.js) and the browse pane, as styled in edit-card.php. Shared by mcq.php; edit-card.php keeps its own copy inline. */
.browse-status {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    line-height: 1.45;
}

.card-pane-tabs {
    display: flex;
    gap: 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.2rem;
    margin-bottom: 1rem;
    background: var(--card-background);
    /* Labels never wrap (see the button rule), so on a narrow screen the row scrolls
       within itself rather than pushing the page sideways. Only reachable when all three
       counts are long at once. */
    overflow-x: auto;
}
.card-pane-tabs button {
    /* Grows to share the row, but never shrinks below its own label - shrinking is what
       would force a wrap, and a tab that wraps costs more than the word it saves. */
    flex: 1 0 auto;
    padding: 0.4rem 0.6rem;
    font-size: 0.82rem;
    white-space: nowrap;
    font-weight: 500;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
}
.card-pane-tabs button.active { background: var(--primary-blue); color: #fff; }
.card-pane-tabs button:hover:not(.active) { background: var(--secondary-gray-light); }
.linked-card {
    display: block;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    text-decoration: none;
    color: inherit;
}
.linked-card:hover { background: var(--secondary-gray-light); }
.linked-card.flagged {
    background: #fef2f2;
    border-color: #fca5a5;
}
.linked-card.flagged:hover { background: #fee2e2; }
.linked-card .lc-title { font-weight: 600; font-size: 0.88rem; margin-bottom: 2px; }
.linked-card .lc-meta { font-size: 0.76rem; color: var(--text-secondary); }
.lc-badge {
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 1px 7px;
    margin-left: 0.35rem;
}
.lc-badge.global   { background: #dbeafe; color: #1e40af; }
.lc-badge.yours    { background: #dcfce7; color: #166534; }
.lc-badge.inferred { background: #fef9c3; color: #854d0e; }
.lc-badge.lp       { background: #fef9c3; color: #854d0e; }

.linked-card .lc-head { cursor: pointer; }
.linked-card .lc-body { margin-top: 0.6rem; border-top: 1px solid var(--border-color); padding-top: 0.6rem; }
.linked-card .lc-content {
    font-size: 0.85rem;
    line-height: 1.5;
    max-height: 320px;
    overflow: auto;
    margin-bottom: 0.6rem;
}
.linked-card .lc-content img { max-width: 100%; height: auto; }
.lc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    font-size: 0.78rem;
}
.lc-actions input[type="number"] {
    width: 3.4rem;
    padding: 0.15rem 0.3rem;
    font-size: 0.78rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}
.lc-actions .lc-btn {
    padding: 0.2rem 0.55rem;
    font-size: 0.78rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--card-background);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.lc-actions .lc-btn.flagged { background: #fee2e2; border-color: #fecaca; color: #b91c1c; }
.lc-actions .lc-btn:disabled { opacity: 0.6; cursor: default; }
/* "Apply tag…" / "Add current reference" / "Add current summary" - see includes/card-rows.js */
.lc-actions.lc-remembered { margin-top: 0.4rem; }
.lc-actions.lc-remembered:empty { display: none; }

/* Summaries are a different kind of thing from cards, so they read as one */
.summary-section-head {
    margin: 1.25rem 0 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6d28d9;
}
.linked-summary {
    display: block;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd6fe;
    background: #f5f3ff;
    border-radius: var(--radius-md);
    margin-bottom: 0.4rem;
    text-decoration: none;
    color: inherit;
}
.linked-summary:hover { background: #ede9fe; }
.linked-summary .ls-title { font-weight: 600; font-size: 0.86rem; color: #5b21b6; }
.linked-summary .ls-meta { font-size: 0.75rem; color: var(--text-secondary); }

.linked-cards-empty {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.75rem 0;
}

/* ---------------------------------------------------------------------------
   Similarity report (see assets/similarity-check.js). The rows above are reused
   wholesale - all that is added here is the summary line, the disclosure, and one
   more badge - so a card looks the same here as it does in the article panel.
   --------------------------------------------------------------------------- */
.similarity-report { margin-top: 0.5rem; align-self: start; }
.similarity-report.checking { opacity: 0.55; transition: opacity 0.15s; }
.similarity-report .sim-matches { margin-top: 0.5rem; }

.sim-summary { font-size: 0.8rem; }
.sim-summary .sim-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    padding: 0.35rem 0.55rem;
    font-size: 0.8rem;
    font-family: inherit;
    text-align: left;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--card-background);
    color: inherit;
    cursor: pointer;
}
.sim-summary .sim-toggle:hover { background: var(--secondary-gray-light); }
.sim-summary .sim-arrow { font-size: 0.65rem; color: var(--text-secondary); }

/* Colour carries the warning, so the summary is readable at a glance without
   anyone having to parse the percentage. */
.sim-summary.sim-low  .sim-toggle { border-color: var(--border-color); color: var(--text-secondary); }
.sim-summary.sim-mid  .sim-toggle { border-color: #fcd34d; background: #fffbeb; color: #92400e; }
.sim-summary.sim-high .sim-toggle { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; }
.sim-summary.sim-error {
    padding: 0.35rem 0.55rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.lc-badge.sim { background: var(--secondary-gray-light); color: var(--text-secondary); }
.lc-badge.sim.mid  { background: #fef3c7; color: #92400e; }
.lc-badge.sim.high { background: #fee2e2; color: #b91c1c; }

/* Confidence / relevance from include_study listings (MCQ Cards tab) - same bands as iOS */
.lc-rates { white-space: nowrap; }
.lc-badge.rate { margin-left: 0.25rem; font-variant-numeric: tabular-nums; padding: 1px 5px; }
.lc-badge.rate.none     { background: var(--secondary-gray-light); color: var(--text-secondary); }
.lc-badge.rate.c.low    { background: #fee2e2; color: #b91c1c; }
.lc-badge.rate.c.mid    { background: #ffedd5; color: #9a3412; }
.lc-badge.rate.c.high   { background: #dcfce7; color: #166534; }
.lc-badge.rate.r.low    { background: #ccfbf1; color: #0f766e; }
.lc-badge.rate.r.mid    { background: #99f6e4; color: #115e59; }
.lc-badge.rate.r.high   { background: #134e4a; color: #ccfbf1; }
.lc-actions.lc-exams { margin-top: 0.4rem; align-items: center; }
.lc-actions.lc-exams:empty { display: none; }
.lc-exams-now { font-size: 0.78rem; color: var(--text-secondary); }
