/* Leonardo Library -- Research shelf. Phone-first, mirrors the Web Links /
   Quotes "qm-" design so the Library reads as one system. This stylesheet
   serves BOTH the Research list page (research.html) and the Project
   workspace (project.html). List classes are prefixed rs- ; workspace
   classes are prefixed pw- ; shared modal/field classes reuse the qm- names.

   Full-width chrome, single-scroller shell: the shell is a flex column that
   fills the viewport and hides its own overflow; every chrome row is
   flex:0 0 auto and exactly one content child (.rs-body / .pw-content)
   is flex:1 with its own scroll. The body never scrolls. */

:root {
    --qm-ink:    #1d2330;
    --qm-muted:  #6b7280;
    --qm-line:   #e6e8ef;
    --qm-bg:     #f4f5f9;
    --qm-card:   #ffffff;
    --qm-accent: #3f51b5;
    --qm-accent-dk: #32419a;
    --qm-accent-soft: #e8eaf6;
    --qm-gold:   #f0a500;
    --qm-danger: #c2384a;
    --qm-green:  #2e8b57;
    --qm-blue:   #2f6fb0;
    --qm-gray:   #8a909c;
}

* { box-sizing: border-box; }

body {
    background: var(--qm-bg);
    color: var(--qm-ink);
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- single-scroller shell --------------------------------------------- */
.rs-shell, .pw-shell {
    display: flex; flex-direction: column;
    height: 100vh; height: 100dvh; overflow: hidden;
}

/* nav band spans the full viewport; content below is constrained */
.lw-nav { min-height: 6px; background: #2f2a52; color: #fff; flex: 0 0 auto; }

/* ---- top / stats -------------------------------------------------------- */
.qm-top { background: #2f2a52; color: #fff; flex: 0 0 auto; }
.qm-stats { display: flex; gap: 0; padding: 6px 8px; max-width: 1000px; margin: 0 auto; width: 100%; }
.qm-stat {
    flex: 1 1 0; min-width: 56px; text-align: center;
    padding: 3px 2px; border-right: 1px solid rgba(255,255,255,.16);
}
.qm-stat:last-child { border-right: none; }
.qm-stat .n { font-size: 16px; font-weight: 700; display: block; line-height: 1.1; }
.qm-stat .l { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: #cfc9f2; }

/* ---- action buttons ----------------------------------------------------- */
.qm-actions {
    display: flex; gap: 7px; padding: 9px 10px; flex-wrap: wrap;
    background: #fff; border-bottom: 1px solid var(--qm-line); flex: 0 0 auto;
}
.qm-actions-inner, .qm-searchbar, .qm-filters, .qm-groupbar, .qm-toolbar { max-width: 1000px; margin: 0 auto; width: 100%; }
.qm-actions { justify-content: center; }
.qm-btn {
    font: inherit; font-size: 13px; font-weight: 600;
    border: 1px solid var(--qm-line); border-radius: 999px;
    background: #fff; color: var(--qm-ink);
    padding: 8px 13px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background .12s, border-color .12s, transform .05s;
    text-decoration: none;
}
.qm-btn:hover { background: var(--qm-accent-soft); border-color: #c2c9ec; }
.qm-btn:active { transform: scale(.97); }
.qm-btn.primary { background: var(--qm-accent); border-color: var(--qm-accent); color: #fff; }
.qm-btn.primary:hover { background: var(--qm-accent-dk); }
.qm-btn.danger { color: var(--qm-danger); border-color: #f0b6bf; }
.qm-btn.danger:hover { background: #fdecef; border-color: #f0b6bf; }
.qm-btn .ic { font-size: 15px; line-height: 1; }

/* ---- slim always-on toolbar + collapsible options panel -----------------
   The Research chrome used to eat most of the phone screen before a single
   card rendered. Only a one-line summary and the Options wedge stay on
   screen; the stat band, New research / Programs / Sort / Group by / Expand
   all / Collapse all live inside .qm-options, closed until you open it.
   .qm-toolbar / .qm-options / .optbtn are shared across every Library shelf
   and live in /library-header.css. */

/* ---- search + filter ---------------------------------------------------- */
.qm-searchbar {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 10px; background: #fff; border-bottom: 1px solid var(--qm-line);
    cursor: pointer; font-size: 13px; font-weight: 600; color: var(--qm-ink); flex: 0 0 auto;
}
.qm-searchbar .chev { margin-left: auto; transition: transform .15s; color: var(--qm-muted); }
.qm-searchbar.open .chev { transform: rotate(180deg); }
.qm-searchbar .activedot { display: none; width: 8px; height: 8px; border-radius: 50%; background: var(--qm-accent); }
.qm-searchbar.filtered .activedot { display: inline-block; }

.qm-filterswrap { flex: 0 0 auto; background: #fff; }
.qm-filters {
    display: none; flex-direction: column; gap: 10px;
    padding: 12px 10px; background: #fff; border-bottom: 1px solid var(--qm-line);
}
.qm-filters.open { display: flex; }
.qm-filters label { font-size: 11px; font-weight: 600; color: var(--qm-muted); margin-bottom: -4px; }
.qm-filters input, .qm-filters select {
    width: 100%; box-sizing: border-box;
    padding: 11px 12px; font: inherit; font-size: 15px;
    border: 1px solid var(--qm-line); border-radius: 10px; background: #fff; outline: none;
}
.qm-filters input:focus, .qm-filters select:focus { border-color: var(--qm-accent); box-shadow: 0 0 0 3px rgba(63,81,181,.15); }
.qm-filters .favrow { display: flex; align-items: center; gap: 8px; }
.qm-filters .favrow input { width: 20px; height: 20px; }
.qm-filters .favrow label { margin: 0; font-size: 14px; color: var(--qm-ink); }
.qm-filters .clearrow { display: flex; justify-content: flex-end; gap: 8px; }
.qm-filters .ps-select {
    width: 100%; box-sizing: border-box; padding: 11px 12px; font: inherit; font-size: 15px;
    border: 1px solid var(--qm-line); border-radius: 10px; background: #fff;
}

/* ---- group-by bar ------------------------------------------------------- */
.qm-groupbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; flex-wrap: wrap; flex: 0 0 auto; background: #fff; border-bottom: 1px solid var(--qm-line); }
.qm-groupbar .lbl { font-size: 12px; color: var(--qm-muted); }
.qm-seg { display: inline-flex; border: 1px solid var(--qm-line); border-radius: 999px; overflow: hidden; background: #fff; }
.qm-seg button { font: inherit; font-size: 12px; font-weight: 600; border: none; background: transparent; color: var(--qm-muted); padding: 6px 11px; cursor: pointer; }
.qm-seg button.on { background: var(--qm-accent); color: #fff; }
.qm-sortsel, .qm-groupbar .ps-select {
    font: inherit; font-size: 12px; font-weight: 600; color: var(--qm-ink);
    border: 1px solid var(--qm-line); border-radius: 999px; background: #fff;
    padding: 6px 11px; cursor: pointer; outline: none;
}
.qm-sortsel:focus, .qm-groupbar .ps-select:focus { border-color: var(--qm-accent); box-shadow: 0 0 0 3px rgba(63,81,181,.15); }

/* ---- the one scrolling child ------------------------------------------- */
.rs-body { flex: 1 1 auto; overflow: auto; padding: 10px 10px 90px; }
.rs-bodyinner { max-width: 1000px; margin: 0 auto; }

.qm-group { border: 1px solid var(--qm-line); border-radius: 12px; background: #fff; margin-bottom: 10px; overflow: hidden; }
.qm-group-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; user-select: none; background: var(--qm-accent-soft); }
.qm-group-h .chev { transition: transform .15s; color: var(--qm-accent); font-size: 12px; }
.qm-group.open .qm-group-h .chev { transform: rotate(90deg); }
.qm-group-h .t { font-size: 14px; font-weight: 800; color: var(--qm-accent); }
.qm-group-h .c { margin-left: auto; font-size: 11px; color: var(--qm-muted); background: #fff; padding: 1px 9px; border-radius: 999px; }
.qm-group-body { display: none; padding: 8px 10px 10px; }
.qm-group.open .qm-group-body { display: block; }

/* ---- research project cards (list page) --------------------------------- */
.rs-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.qm-group-body .rs-cards { grid-template-columns: 1fr; }

.rs-card {
    background: var(--qm-card);
    border: 1px solid var(--qm-line);
    border-left: 4px solid var(--qm-accent);
    border-radius: 12px;
    padding: 13px 15px 11px;
    box-shadow: 0 1px 2px rgba(20,20,50,.04);
    cursor: pointer;
    display: flex; flex-direction: column; gap: 7px;
    transition: box-shadow .12s, transform .06s;
}
.rs-card:hover { box-shadow: 0 4px 14px rgba(40,30,90,.14); transform: translateY(-1px); }
.rs-card:active { transform: scale(.995); }

.rs-card-head { display: flex; align-items: flex-start; gap: 8px; }
.rs-card-title { font-size: 17px; font-weight: 700; color: var(--qm-accent); word-break: break-word; flex: 1; }
.rs-card-star {
    border: none; background: transparent; cursor: pointer; font-size: 20px; line-height: 1;
    color: var(--qm-muted); padding: 2px 4px; border-radius: 8px; flex: 0 0 auto;
    min-width: 34px; min-height: 34px;
}
.rs-card-star.on { color: var(--qm-gold); }
.rs-card-star:hover { background: var(--qm-accent-soft); }
/* Pin this project / program to Quick Launch (Story 2428) -- sits beside the star. */
.rs-card-ql {
    border: none; background: transparent; cursor: pointer; font-size: 17px; line-height: 1;
    color: var(--qm-muted); padding: 2px 4px; border-radius: 8px; flex: 0 0 auto;
    min-width: 34px; min-height: 34px; opacity: .55;
}
.rs-card-ql.on { color: #b57f00; opacity: 1; }
.rs-card-ql:hover { background: var(--qm-accent-soft); opacity: 1; }

/* Byline: the authors of the project's sources, directly under the title so a card
   reads like a citation. Two lines max -- some rows carry full affiliations, and the
   whole string is on the title attribute for anyone who wants it. */
.rs-card-authors {
    font-size: 12.5px; color: var(--qm-muted); line-height: 1.35; word-break: break-word;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* "+12 more" on a program card -- present but never competing with the names. */
.rs-card-more { font-style: italic; opacity: 0.8; }

/* Byline under the title in a project banner. The banner is dark, so this is a
   dimmed white rather than the card byline's grey. */
.pw-byline {
    font-size: 13px; font-weight: 500; line-height: 1.35; margin-top: 3px;
    color: rgba(255,255,255,.72); word-break: break-word;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pw-byline .none { font-style: italic; color: rgba(255,255,255,.45); }

.rs-card-q { font-size: 13.5px; color: #3a3f4b; line-height: 1.45; word-break: break-word; }
.rs-card-q.empty { color: var(--qm-muted); font-style: italic; }

.rs-pill {
    display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .4px; padding: 2px 9px; border-radius: 999px; color: #fff;
}
.rs-pill.active   { background: var(--qm-green); }
.rs-pill.concluded{ background: var(--qm-blue); }
.rs-pill.shelved  { background: var(--qm-gray); }
.rs-pill.rs-type  { background: var(--qm-accent); text-transform: none; letter-spacing: 0; }

.rs-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.rs-counts { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.rs-count { font-size: 11px; color: var(--qm-muted); background: #f1f2f7; padding: 2px 9px; border-radius: 999px; }
.rs-count b { color: var(--qm-ink); font-weight: 700; }
.rs-card-when { font-size: 11px; color: var(--qm-muted); }
.rs-card-cats { display: flex; gap: 5px; flex-wrap: wrap; }
.qm-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; background: var(--qm-accent-soft); color: var(--qm-accent); padding: 2px 8px; border-radius: 999px; }
.rs-card-rating { color: var(--qm-gold); font-size: 13px; letter-spacing: 1px; }

.qm-empty { text-align: center; color: var(--qm-muted); padding: 50px 20px; font-size: 14px; }
.qm-empty .big { font-size: 40px; display: block; margin-bottom: 8px; opacity: .5; }

/* ---- floating add ------------------------------------------------------- */
.qm-fab {
    position: fixed; right: 18px; bottom: 22px; z-index: 60;
    width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
    background: var(--qm-accent); color: #fff; font-size: 28px; line-height: 1;
    box-shadow: 0 6px 18px rgba(63,81,181,.45);
}
.qm-fab:active { transform: scale(.94); }

/* ---- status bar --------------------------------------------------------- */
.qm-statusbar { background: #232733; color: #aeb4c2; padding: 5px 12px; font-size: 11px; flex: 0 0 auto; }

/* ======================================================================== */
/*  PROJECT WORKSPACE (project.html)                                         */
/* ======================================================================== */

/* Question banner -- always visible at the top of the workspace */
.pw-banner { background: #2f2a52; color: #fff; flex: 0 0 auto; }
.pw-banner-inner { max-width: 1000px; margin: 0 auto; width: 100%; padding: 12px 14px 14px; }
.pw-banner-top { display: flex; align-items: flex-start; gap: 10px; }
.pw-back {
    color: #cfc9f2; text-decoration: none; font-size: 22px; line-height: 1;
    padding: 2px 6px; border-radius: 8px; flex: 0 0 auto;
}
.pw-back:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.pw-titlewrap { flex: 1; min-width: 0; }
.pw-title { font-size: 20px; font-weight: 800; word-break: break-word; }
.pw-banner-star {
    border: none; background: transparent; cursor: pointer; font-size: 22px; line-height: 1;
    color: #cfc9f2; padding: 2px 6px; border-radius: 8px; flex: 0 0 auto; min-width: 34px; min-height: 34px;
}
.pw-banner-star.on { color: var(--qm-gold); }
.pw-question { font-size: 14px; color: #e7e4fb; margin-top: 6px; line-height: 1.45; word-break: break-word; }
.pw-question .lbl, .pw-thesis .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: #a79fe0; font-weight: 700; margin-right: 6px; }
.pw-thesis { font-size: 13.5px; color: #d7d3f5; margin-top: 5px; line-height: 1.45; word-break: break-word; }
.pw-banner-meta { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }

/* tab row */
.pw-tabs { background: #fff; border-bottom: 1px solid var(--qm-line); flex: 0 0 auto; overflow-x: auto; }
.pw-tabs-inner { display: flex; gap: 2px; max-width: 1000px; margin: 0 auto; width: 100%; padding: 0 6px; }
.pw-tab {
    font: inherit; font-size: 13px; font-weight: 600; color: var(--qm-muted);
    border: none; background: transparent; padding: 12px 14px; cursor: pointer;
    border-bottom: 3px solid transparent; white-space: nowrap;
}
.pw-tab.on { color: var(--qm-accent); border-bottom-color: var(--qm-accent); }
.pw-tab .cnt { font-size: 10px; color: #fff; background: var(--qm-gray); border-radius: 999px; padding: 1px 6px; margin-left: 5px; vertical-align: middle; }
.pw-tab.on .cnt { background: var(--qm-accent); }

/* the one scrolling child of the workspace */
.pw-content { flex: 1 1 auto; overflow: auto; padding: 14px 12px 90px; }
.pw-content-inner { max-width: 1000px; margin: 0 auto; }
.pw-panel { display: none; }
.pw-panel.on { display: block; }

.pw-secttitle { font-size: 13px; font-weight: 800; color: var(--qm-accent); text-transform: uppercase; letter-spacing: .5px; margin: 4px 0 10px; display: flex; align-items: center; gap: 8px; }
.pw-secttitle .rs-count { text-transform: none; letter-spacing: 0; }

/* Overview form */
.pw-form { background: #fff; border: 1px solid var(--qm-line); border-radius: 14px; padding: 14px 16px 18px; }
.pw-panelbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.pw-panelbar .grow { flex: 1; }

.qm-field { margin-top: 12px; }
.qm-field:first-of-type { margin-top: 2px; }
.qm-field label { display: block; font-size: 12px; font-weight: 600; color: var(--qm-muted); margin-bottom: 5px; }
.qm-field input[type=text], .qm-field input[type=number], .qm-field select, .qm-field textarea {
    width: 100%; box-sizing: border-box;
    padding: 11px 12px; font: inherit; font-size: 15px;
    border: 1px solid var(--qm-line); border-radius: 10px; outline: none; background: #fff;
}
.qm-field textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.qm-field input:focus, .qm-field select:focus, .qm-field textarea:focus { border-color: var(--qm-accent); box-shadow: 0 0 0 3px rgba(63,81,181,.15); }
.qm-field .hint { font-size: 11px; color: var(--qm-muted); margin-top: 4px; }
.qm-field .picker-wrap { position: relative; }
.qm-row2 { display: flex; gap: 12px; flex-wrap: wrap; }
.qm-row2 > .qm-field { flex: 1; min-width: 160px; }

/* multi-select chip editors */
.qm-tagedit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 24px; }
.qm-tagedit .picked { display: inline-flex; align-items: center; gap: 5px; background: var(--qm-accent-soft); color: var(--qm-accent); font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 999px; }
.qm-tagedit .picked .x { cursor: pointer; font-weight: 700; }
.qm-tagedit .hint { color: var(--qm-muted); font-size: 12px; }
.qm-tagaddrow { display: flex; gap: 8px; margin-top: 8px; }
.qm-tagaddrow .picker-wrap { flex: 1; }
.qm-tagaddrow .picker-wrap input.picker-input { width: 100%; }
.qm-tagaddrow .qm-btn { flex: 0 0 auto; }

/* generic item cards (sources / notes / themes / conclusions) */
.pw-item {
    background: #fff; border: 1px solid var(--qm-line); border-left: 4px solid var(--qm-accent);
    border-radius: 10px; padding: 11px 13px 9px; margin-bottom: 9px;
    box-shadow: 0 1px 2px rgba(20,20,50,.04);
}
.pw-item-head { display: flex; align-items: flex-start; gap: 8px; }
.pw-item-title { font-size: 15px; font-weight: 700; color: var(--qm-ink); word-break: break-word; flex: 1; }
.pw-item-sub { font-size: 12.5px; color: var(--qm-muted); margin-top: 3px; word-break: break-word; }
.pw-item-body { font-size: 13.5px; color: #3a3f4b; margin-top: 5px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.pw-item-commentary { font-size: 12.5px; color: var(--qm-muted); margin-top: 5px; padding-left: 10px; border-left: 2px solid var(--qm-line); white-space: pre-wrap; }
/* Optional note heading (Story 2298): clearly the note's title, but quiet enough
   not to compete with the body it sits on top of. */
.pw-note-label { font-size: 14px; font-weight: 700; color: #23283a; margin-top: 2px; line-height: 1.35; word-break: break-word; }
.pw-item-actions { display: flex; gap: 4px; justify-content: flex-end; margin-top: 6px; padding-top: 6px; border-top: 1px dashed #eef0f6; flex-wrap: wrap; align-items: center; }
.pw-item-actions .spacer { flex: 1 1 auto; }
/* Arrange (Story 5757): while the themes are being put in order each card shrinks
   to its head line and shows a grip to drag. */
.pw-arranging .pw-item-body, .pw-arranging .pw-item-actions { display: none; }
.pw-arranging .pw-item { padding-bottom: 11px; }
.pw-arranging .pw-item.dragging { opacity: .6; box-shadow: 0 4px 14px rgba(20,20,50,.18); }
.pw-grip { cursor: grab; touch-action: none; user-select: none; color: var(--qm-muted); font-size: 16px; line-height: 1; padding: 2px 6px 2px 0; letter-spacing: -3px; }
#themeArrangeBtn.on { background: var(--qm-accent); color: #fff; border-color: var(--qm-accent); }
.qm-icobtn {
    border: none; background: transparent; cursor: pointer;
    font-size: 18px; line-height: 1; padding: 7px 10px; border-radius: 8px; color: var(--qm-muted);
    min-width: 38px; min-height: 38px; display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none;
}
.qm-icobtn:hover { background: var(--qm-accent-soft); }
.qm-icobtn.star.on { color: var(--qm-gold); }
.qm-icobtn.del:hover { background: #fdecef; color: var(--qm-danger); }

/* pills for kind / stance / theme / confidence / reliability */
.pw-chip { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 2px 8px; border-radius: 999px; }
.pw-chip.kind-excerpt { background: #e4eefb; color: #2f6fb0; }
.pw-chip.kind-note    { background: #eee9f7; color: #6a4bb3; }
.pw-chip.theme        { background: var(--qm-accent-soft); color: var(--qm-accent); text-transform: none; letter-spacing: 0; font-weight: 600; }
.pw-chip.stance-supports    { background: #e3f5ea; color: #1f8a4c; }
.pw-chip.stance-complicates { background: #fff3df; color: #b3730d; }
.pw-chip.stance-against     { background: #fdecef; color: var(--qm-danger); }
.pw-chip.stance-neutral     { background: #eef0f5; color: #5a6070; }
.pw-chip.conf-tentative { background: #eef0f5; color: #5a6070; }
.pw-chip.conf-leaning   { background: #fff3df; color: #b3730d; }
.pw-chip.conf-confident { background: #e4eefb; color: #2f6fb0; }
.pw-chip.conf-settled   { background: #e3f5ea; color: #1f8a4c; }
.pw-chip.rel { background: #f1f2f7; color: var(--qm-muted); text-transform: none; letter-spacing: 0; }
.pw-chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* notes filter bar */
.pw-notefilters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; background: #fff; border: 1px solid var(--qm-line); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.pw-notefilters .nf { display: flex; flex-direction: column; gap: 4px; min-width: 130px; flex: 1; }
.pw-notefilters label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--qm-muted); }
.pw-notefilters .ps-select, .pw-notefilters select { width: 100%; padding: 8px 10px; font: inherit; font-size: 14px; border: 1px solid var(--qm-line); border-radius: 8px; background: #fff; }
.pw-notefilters .nf-caption { flex: 1 0 100%; font-size: 12px; color: var(--qm-muted); margin: 0 2px 2px; line-height: 1.4; }
.pw-notefilters .nf-caption .nf-plus-inline { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 5px; background: var(--qm-accent); color: #fff; font-weight: 700; font-size: 12px; line-height: 1; vertical-align: middle; }
.pw-notefilters .nf-ctl { display: flex; gap: 6px; align-items: stretch; }
.pw-notefilters .nf-ctl .ps-select, .pw-notefilters .nf-ctl select { flex: 1 1 auto; width: auto; min-width: 0; }
.pw-notefilters .nf-add { flex: 0 0 auto; width: 38px; border: 1px solid var(--qm-accent); border-radius: 8px; background: var(--qm-accent); color: #fff; font-size: 20px; font-weight: 700; line-height: 1; cursor: pointer; padding: 0; }
.pw-notefilters .nf-add:hover { background: var(--qm-accent-dk); border-color: var(--qm-accent-dk); }
.pw-notefilters .keycheck { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; min-width: 0; padding-bottom: 6px; }
.pw-notefilters .keycheck input { width: 18px; height: 18px; }
.pw-notefilters .keycheck label { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--qm-ink); font-weight: 600; }

/* report tab */
.pw-report-card { background: #fff; border: 1px solid var(--qm-line); border-radius: 14px; padding: 22px 20px; text-align: center; }
.pw-report-card .big { font-size: 42px; opacity: .6; }
.pw-report-card h3 { margin: 8px 0 6px; font-size: 18px; color: var(--qm-ink); }
.pw-report-card p { color: var(--qm-muted); font-size: 13.5px; max-width: 460px; margin: 0 auto 16px; line-height: 1.5; }

/* ---- modal (shared) ----------------------------------------------------- */
.qm-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(20,18,40,.55); display: none; align-items: flex-end; justify-content: center; }
.qm-overlay.show { display: flex; }
.qm-modal { background: #fff; width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 16px 16px 22px; box-shadow: 0 -8px 30px rgba(0,0,0,.25); }
@media (min-width: 640px) { .qm-overlay { align-items: center; } .qm-modal { border-radius: 16px; } }
.qm-modal h2 { margin: 2px 0 12px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.qm-modal-btns { display: flex; gap: 8px; margin-top: 16px; }
.qm-modal-btns .qm-btn { flex: 1; justify-content: center; padding: 11px; }
.qm-modal-btns .qm-btn.del { flex: 0 0 auto; }
.wl-checkline { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--qm-ink); }
.wl-checkline input { width: 18px; height: 18px; }

/* PicassoVoice wrap fix (mirrors Web Links) */
.qm-field .voice-mic-wrap, .qm-filters .voice-mic-wrap { display: block; width: 100%; }

/* ---- clickable star rating input ---- */
.star-input { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.star-input .star-btn {
    background: none; border: none; cursor: pointer; padding: 2px 3px;
    font-size: 26px; line-height: 1; color: #d1d5db; transition: color .1s;
}
.star-input .star-btn.on { color: #f5b301; }
.star-input .star-btn:hover { color: #f5b301; }
.star-input .star-clear {
    background: none; border: none; cursor: pointer; margin-left: 8px;
    font-size: 12px; color: #9ca3af; text-decoration: underline; padding: 4px;
}
.star-input .star-clear:hover { color: #6b7280; }

/* ---- collapsible thesis in the banner ---- */
.pw-thesis-text { display: block; }
.pw-thesis-text.clamped {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.pw-morebtn {
    background: none; border: none; cursor: pointer; padding: 2px 0; margin-top: 2px;
    font-size: 12px; font-weight: 600; color: #c7d2fe; text-decoration: underline;
}
.pw-morebtn:hover { color: #fff; }

/* ---- Files tab: add-source chooser + pick list (Nook / Leonardo Files) ---- */
.pw-srclist { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 8px; }
.pw-srcbtn {
    display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
    width: 100%; text-align: left; cursor: pointer;
    background: #f7f7fb; border: 1px solid #d9dbe8; border-radius: 10px;
    padding: 12px 14px; font: inherit;
}
.pw-srcbtn:hover { background: #eef0fa; border-color: #b9bedd; }
.pw-srcbtn .t { font-weight: 600; font-size: 14px; color: #2f2a52; }
.pw-srcbtn .s { font-size: 12px; color: #6b7280; }

/* ====================================================================== */
/*  RESEARCH PROGRAMS -- the container above a research project.          */
/*  programs.html (the shelf of programs) and program.html (one program)  */
/*  reuse the rs-* card and pw-* workspace classes above; these are the   */
/*  few pieces they add.                                                  */
/* ====================================================================== */

/* the "N projects" / program-name chip -- deliberately a different hue */
/* from rs-type so a program never reads as a type at a glance          */
.rs-pill.rs-prog { background: #6A5ACD; text-transform: none; letter-spacing: 0; }

/* the program-name chip on a PROJECT card, on the research shelf */
.rs-card-prog {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; color: #4b3fa7; background: #ece9fb;
    border: 1px solid #d7d1f5; border-radius: 999px; padding: 2px 9px;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rs-card-prog .ic { font-size: 10px; opacity: .8; }

/* "Research program" eyebrow above the program title in the banner */
.pw-kicker {
    font-size: 10px; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; color: #c9c2f5; margin-bottom: 1px;
}

/* the add-a-project row on the program's Projects tab */
.pw-addrow { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.pw-addrow .picker-wrap { min-width: 0; }

/* per-member action buttons inside a roster card */
.pw-rowbtns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* a hint line that is not inside a qm-field (panel-level explanations) */
.pw-panel > .hint { font-size: 11.5px; color: var(--qm-muted); margin: 2px 0 12px; }
.pw-form > .hint  { font-size: 11.5px; color: var(--qm-muted); margin-top: 8px; }

/* ======================================================================
   TO-DO LIST (Story 2315) -- the project's working state: what is open,
   what is finished, and the note you left yourself on each item.
   ====================================================================== */
.pw-todobar {
    display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
    background: #fff; border: 1px solid var(--qm-line); border-radius: 12px;
    padding: 10px 12px; margin-bottom: 10px;
}
.pw-todobar .td-progress { flex: 1 1 200px; min-width: 160px; }
.pw-todobar .td-bar { height: 8px; border-radius: 999px; background: #eceef5; overflow: hidden; }
.pw-todobar .td-fill { height: 100%; width: 0; background: var(--qm-accent); border-radius: 999px; transition: width .18s ease; }
.pw-todobar .td-count { font-size: 11.5px; color: var(--qm-muted); margin-top: 5px; }
.pw-todobar .nf { display: flex; flex-direction: column; gap: 4px; min-width: 140px; flex: 0 1 180px; }
.pw-todobar .nf label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--qm-muted); }
.pw-todobar .ps-select, .pw-todobar select { width: 100%; padding: 8px 10px; font: inherit; font-size: 14px; border: 1px solid var(--qm-line); border-radius: 8px; background: #fff; }
.pw-todobar .wl-checkline { flex: 0 0 auto; padding-bottom: 6px; font-weight: 600; }

.td-item { display: flex; gap: 10px; align-items: flex-start; }
.td-check {
    flex: 0 0 auto; width: 26px; height: 26px; margin-top: 1px; border-radius: 8px;
    border: 2px solid var(--qm-line); background: #fff; cursor: pointer;
    font-size: 15px; line-height: 1; color: #fff; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.td-check.on { background: var(--qm-accent); border-color: var(--qm-accent); }
.td-main { flex: 1 1 auto; min-width: 0; }
.td-text { font-size: 14.5px; font-weight: 600; color: var(--qm-ink); line-height: 1.35; word-break: break-word; }
/* Story 5757: done is never struck through. A quieter title and a mark instead. */
.pw-item.td-done .td-text { color: var(--qm-muted); font-weight: 500; }
.pw-item.td-done .td-text::before { content: "\2713  "; color: #2E7D32; font-weight: 700; }
.pw-item.td-skip .td-text { color: var(--qm-muted); font-weight: 500; opacity: .8; font-style: italic; }
.td-note { font-size: 13px; color: #4b5163; margin-top: 5px; white-space: pre-wrap; word-break: break-word; }
.td-when { font-size: 11px; color: var(--qm-muted); margin-top: 5px; }
.pw-chip.td-next    { background: #e8ecff; color: #33409b; }
.pw-chip.td-doing   { background: #e2f5ea; color: #1d6f43; }
.pw-chip.td-blocked { background: #fdecef; color: #a1233c; }
.pw-chip.td-someday { background: #f1f2f6; color: #5b6070; }
.pw-chip.td-skipped { background: #f1f2f6; color: #5b6070; }

/* ---- web links tab (Story 2315) ---------------------------------------- */
.wl-url { font-size: 12.5px; color: var(--qm-accent); word-break: break-all; margin-top: 3px; }
