/* Ninth Draft (Story 3540) -- the Leonardo Library shelf for the Hollis Grist column.
   Pinned chrome: the icon band, header, tabs and controls never scroll; .nd-body is the
   one scroller. Sheets come from files/file-kit.css, the rendered text from
   picasso-markdown.css. */

body { background: #F2F2F4; margin: 0; font-family: "Segoe UI", system-ui, sans-serif; }

.page-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
#lwIconBand, .ct-header, .nd-tabs, .nd-controls { flex: 0 0 auto; }

.ct-header {
    background: #3C3C3C; color: #fff; padding: 10px 16px;
    display: flex; align-items: center; gap: 12px;
}
.ct-header h1 { margin: 0; font-size: 14pt; font-weight: 600; flex: 1; }
.ct-header button { color: #fff; background: transparent; border: 1px solid #6A6A6A; border-radius: 3px;
    padding: 4px 12px; font: inherit; cursor: pointer; }

/* ---- tabs ---- */
.nd-tabs { display: flex; background: #fff; border-bottom: 1px solid #E2E2E5; }
.nd-tabs button {
    flex: 1 1 0; background: none; border: none; border-bottom: 3px solid transparent;
    padding: 10px 8px; font: 600 13px "Segoe UI", system-ui, sans-serif; color: #475569; cursor: pointer;
}
.nd-tabs button.on { color: #0A66C2; border-bottom-color: #0A66C2; }

/* ---- controls ---- */
.nd-controls { background: #fff; border-bottom: 1px solid #E2E2E5; padding: 8px 12px; }
.nd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.nd-chip {
    background: #fff; color: #334155; border: 1px solid #CBD5E1; border-radius: 999px;
    padding: 4px 12px; font: 12px "Segoe UI", system-ui, sans-serif; cursor: pointer;
}
.nd-chip.on { background: #0A66C2; color: #fff; border-color: #0A66C2; }
.nd-chip .n { opacity: .8; margin-left: 4px; }
.nd-search {
    display: block; width: 100%; box-sizing: border-box; padding: 8px 10px;
    border: 1px solid #C9D0D8; border-radius: 4px; font: 14px "Segoe UI", system-ui, sans-serif;
}
.nd-summary { margin-top: 6px; font-size: 12px; color: #475569; }
.nd-summary .warn { color: #B45309; font-weight: 600; }

.nd-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 8px 24px; }
.nd-more { text-align: center; padding: 8px; }
.nd-empty { color: #64748B; font-size: 13px; padding: 20px 4px; }

.nd-btn {
    background: #fff; color: #0A66C2; border: 1px solid #C9D7E8; border-radius: 4px;
    padding: 6px 12px; font: 12px "Segoe UI", system-ui, sans-serif; cursor: pointer;
}
.nd-btn:hover { background: #ECF4FD; }
.nd-btn.primary { background: #0A66C2; color: #fff; border-color: #0A66C2; }
.nd-btn.danger { color: #B00020; border-color: #E8B4BE; }
.nd-btn:disabled { opacity: .5; cursor: default; }

/* ---- a piece ---- */
.nd-card {
    background: #fff; border: 1px solid #E2E2E5; border-left: 4px solid #CBD5E1; border-radius: 6px;
    margin-bottom: 10px;
}
.nd-card.st-ready  { border-left-color: #0A66C2; }
.nd-card.st-posted { border-left-color: #15803D; }
.nd-card.st-dead   { border-left-color: #94A3B8; background: #F8FAFC; }
.nd-card.nd-flash { animation: nd-flash 1.6s ease-out 2; }
@keyframes nd-flash { 0% { background: #DBEAFE; } 100% { background: #fff; } }

.nd-head { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; cursor: pointer; }
.nd-num { flex: 0 0 auto; font: 700 13px Consolas, "Courier New", monospace; color: #64748B; padding-top: 2px; }
.nd-headmain { flex: 1 1 auto; min-width: 0; }
.nd-title { margin: 0; font-size: 15px; font-weight: 700; color: #111; word-break: break-word; }
.st-dead .nd-title { color: #64748B; }
.nd-tick { color: #15803D; margin-right: 4px; }
.nd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: #475569; }
.nd-pill { border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 600; background: #EEF2F7; color: #334155; }
.nd-pill.st-drafted { background: #F1F5F9; color: #475569; }
.nd-pill.st-ready   { background: #DBEAFE; color: #1D4ED8; }
.nd-pill.st-posted  { background: #DCFCE7; color: #15803D; }
.nd-pill.st-dead    { background: #E2E8F0; color: #475569; }
.nd-pill.attn       { background: #FEF3C7; color: #92400E; }
.nd-preview { margin: 6px 0 0; font-size: 13px; color: #334155; line-height: 1.4; }
.nd-chev { flex: 0 0 auto; color: #94A3B8; transition: transform .15s; padding-top: 2px; }
.nd-card.open .nd-chev { transform: rotate(90deg); }

.nd-detail { border-top: 1px solid #E2E8F0; padding: 10px 12px 12px; }
.nd-facts { font-size: 12px; color: #334155; margin-bottom: 8px; }
.nd-facts div { margin-top: 2px; }
.nd-facts a { color: #0A66C2; word-break: break-all; }
.nd-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.nd-text { font-size: 14px; line-height: 1.55; color: #1F2937; max-width: 44em; }

/* ---- comments ---- */
.nd-comments { margin-top: 14px; border-top: 1px dashed #CBD5E1; padding-top: 10px; }
.nd-comments h3 { margin: 0 0 8px; font-size: 13px; color: #0F172A; }
.nd-comment { border: 1px solid #E2E8F0; border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; background: #FAFBFC; }
.nd-comment .who { font-size: 12px; color: #475569; }
.nd-comment .who b { color: #0F172A; }
.nd-comment .said, .nd-comment .reply { white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.45; margin-top: 4px; }
.nd-comment .reply { border-left: 3px solid #0A66C2; padding-left: 8px; margin-top: 8px; color: #1F2937; }
.nd-comment .reply.sent { border-left-color: #15803D; }
.nd-comment .noreply { margin-top: 8px; font-size: 12px; color: #92400E; }
.nd-comment .sentmark { color: #15803D; font-size: 12px; margin-top: 4px; }

/* ---- the ledger ---- */
.nd-masthead { background: #fff; border: 1px solid #E2E2E5; border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
.nd-masthead h3, .nd-topic h3 { margin: 0 0 6px; font-size: 13px; color: #0F172A; }
.nd-masthead blockquote { margin: 0; font-size: 13px; line-height: 1.5; color: #1F2937; }
.nd-topic { background: #fff; border: 1px solid #E2E2E5; border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; }
.nd-topic ul { margin: 0; padding-left: 18px; }
.nd-topic li { font-size: 13px; line-height: 1.45; margin-bottom: 6px; color: #1F2937; }
.nd-cite { background: none; border: none; padding: 0; color: #0A66C2; cursor: pointer; font: inherit; font-size: 12px; }

/* ---- sheets ---- */
.nd-form { display: flex; flex-direction: column; gap: 10px; }
.nd-form label { font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: #475569; }
.nd-form input[type="text"], .nd-form input[type="date"], .nd-form textarea {
    display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 8px 10px;
    border: 1px solid #C9D0D8; border-radius: 4px; font: 14px "Segoe UI", system-ui, sans-serif;
}
.nd-form textarea { min-height: 110px; resize: vertical; }
.nd-form .picker-wrap { margin-top: 4px; }

/* ---- folds and roll-up (Story 5757) ---- */
.nd-rollbar { display: flex; align-items: center; gap: 6px; width: 100%; border: none; background: none;
    padding: 0; font: inherit; cursor: pointer; text-align: left; color: inherit; }
.nd-rollbar .ef-caret { color: #94A3B8; flex: 0 0 auto; }
.nd-rollbar:hover .ef-caret { color: #0A66C2; }
.nd-rollbar .nd-summary { margin-top: 0; flex: 1 1 auto; min-width: 0; }
.nd-tools { margin-top: 8px; }
.nd-controls.ef-tools-collapsed .nd-tools { display: none; }
.nd-searchrow { display: flex; gap: 6px; align-items: center; }
.nd-searchrow .nd-search { flex: 1 1 auto; min-width: 0; }
.nd-foldall { flex: 0 0 auto; }
.nd-foldall[hidden] { display: none; }
.nd-ledgerbar { display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-size: 12px; color: #475569; padding: 2px 2px 8px; }
.nd-foldhead { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.nd-foldhead .t { flex: 1 1 auto; min-width: 0; }
.nd-foldhead .nd-chev { padding-top: 0; }
.nd-fold:not(.folded) > .nd-foldhead .nd-chev { transform: rotate(90deg); }
.nd-fold.folded > .nd-foldhead { margin-bottom: 0; }
.nd-fold.folded > .nd-foldbody { display: none; }
.nd-foldn { font-weight: 600; font-size: 11px; color: #475569; background: #EEF2F7; border-radius: 999px; padding: 1px 8px; }
/* Story 6820: Reader and Listen among the piece's actions */
.nd-actions .pr-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
