/* The Highlights shelf (Story 5613) -- every highlight made in a Leonardo reader.
   Bands, the group / sort row and Roll Up Tools come from contacts/entity-files.css;
   the sepia view matches the Record View look (contacts/entity-detail.css .ed-rview). */

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, .hl-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; }

.hl-controls { background: #fff; border-bottom: 1px solid #E2E2E5; padding: 8px 12px 0; }

.hl-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;
}
.hl-btn:hover { background: #ECF4FD; }
.hl-btn.primary, .hl-btn.on { background: #0A66C2; color: #fff; border-color: #0A66C2; }
.hl-btn:disabled { opacity: 0.5; cursor: default; }
.hl-btn[hidden] { display: none; }

.hl-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 8px 16px; }
.hl-empty { padding: 24px 12px; color: #666; text-align: center; font-size: 13px; }

/* ---- one highlight: the marked text on a strip of its own color ---- */
.hl-card {
    display: block; width: 100%; box-sizing: border-box; text-align: left;
    background: #fff; border: 1px solid #E2E2E5; border-left: 5px solid var(--hl-ink, #ffd600);
    border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer;
    font: inherit; color: inherit;
}
.hl-card:hover { border-color: #C9D7E8; border-left-color: var(--hl-ink, #ffd600); background: #FBFCFE; }
.hl-card.hl-flash { animation: hl-flash 1.6s ease-out 2; }
@keyframes hl-flash { 0% { box-shadow: 0 0 0 3px #0A66C2; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hl-text {
    margin: 0 0 6px; font: 15px/1.55 Georgia, "Iowan Old Style", "Times New Roman", serif; color: #222;
    white-space: pre-wrap; overflow-wrap: anywhere;
}
.hl-text mark { background: var(--hl-wash, rgba(255, 214, 0, 0.42)); color: inherit; padding: 0 1px; }
.hl-more { color: #0A66C2; font: 12px "Segoe UI", system-ui, sans-serif; }
.hl-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: #666; }
.hl-meta .hl-doc { font-weight: 600; color: #333; overflow-wrap: anywhere; }
.hl-meta .hl-src-tag { color: var(--hl-src, #666); }
.hl-meta .hl-unreg { color: #B42318; font-weight: 600; }

.hl-c-yellow { --hl-ink: #ffd600; --hl-wash: rgba(255, 214, 0, 0.42); }
.hl-c-blue   { --hl-ink: #40a9ff; --hl-wash: rgba(64, 169, 255, 0.40); }
.hl-c-pink   { --hl-ink: #ff69b4; --hl-wash: rgba(255, 105, 180, 0.36); }
.hl-c-orange { --hl-ink: #ff9500; --hl-wash: rgba(255, 149, 0, 0.40); }
.hl-c-green  { --hl-ink: #50c878; --hl-wash: rgba(80, 200, 120, 0.40); }
.hl-c-purple { --hl-ink: #a078ff; --hl-wash: rgba(160, 120, 255, 0.38); }
/* A Leonardo Books excerpt -- kept, not marked in a reader -- reads in a parchment tan. */
.hl-c-excerpt { --hl-ink: #b08850; --hl-wash: rgba(196, 160, 110, 0.32); }

/* ---- the sepia view (and the Sources sheet) ---- */
.hl-view-bg {
    position: fixed; inset: 0; background: rgba(20, 20, 28, 0.55);
    display: none; align-items: center; justify-content: center;
    z-index: 1000; padding: 16px; box-sizing: border-box;
}
.hl-view-bg.open { display: flex; }
.hl-view {
    width: min(720px, 100%); max-height: 92vh; max-height: 92dvh;
    display: flex; flex-direction: column; overflow: hidden;
    background: #f7f0df; color: #3b3323;
    border: 1px solid #d8c9a6; border-radius: 8px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    position: relative;   /* Story 5705: the X (picasso-sheet.css) sits top right */
}
.hl-view-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px 64px 14px 26px; -webkit-overflow-scrolling: touch; }
.hl-view-badge {
    display: inline-block; background: #9a6b2f; color: #fff;
    font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 12px;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
}
.hl-view-badge:empty { display: none; }
.hl-view-title {
    margin: 0 0 6px; font: 800 21px/1.25 "Segoe UI", system-ui, sans-serif; color: #3b3323; overflow-wrap: anywhere;
}
.hl-view-meta { font-size: 12px; color: #6f6144; padding-bottom: 12px; border-bottom: 1px solid #d8c9a6; }
.hl-view-text {
    margin: 16px 0; padding: 4px 0 4px 16px; border-left: 4px solid var(--hl-ink, #c9a54a);
    font: 18px/1.7 Georgia, "Iowan Old Style", "Times New Roman", serif; color: #3b3323;
    white-space: pre-wrap; overflow-wrap: anywhere;
}
.hl-view-notes h3 {
    font: 600 11px "Segoe UI", system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.5px;
    color: #6f6144; margin: 14px 0 6px;
}
.hl-note { padding: 8px 0; border-top: 1px dotted #d8c9a6; font: 15px/1.55 Georgia, serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.hl-note-date { display: block; font: 11px "Segoe UI", system-ui, sans-serif; color: #9c8c6a; margin-top: 2px; }
.hl-view-actions {
    flex: 0 0 auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px;
    padding: 10px 18px 14px; border-top: 1px solid #d8c9a6; background: #f3ead6;
}

.hl-src-row { padding: 10px 0; border-top: 1px dotted #d8c9a6; }
.hl-src-row:first-child { border-top: 0; }
.hl-src-name { font: 600 15px "Segoe UI", system-ui, sans-serif; display: flex; align-items: center; gap: 8px; }
.hl-src-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; background: #999; }
.hl-src-count { margin-left: auto; font: 12px "Segoe UI", system-ui, sans-serif; color: #6f6144; }
.hl-src-exp { font-size: 13px; color: #6f6144; margin-top: 3px; }
.hl-src-row.hl-src-unreg .hl-src-name { color: #B42318; }
.hl-src-link { margin-top: 6px; }

@media (max-width: 520px) {
    .hl-view-scroll { padding: 18px 58px 10px 18px; }
    .hl-view-title { font-size: 18px; }
    .hl-view-text { font-size: 16px; }
    .ef-seg button { padding-left: 8px; padding-right: 8px; }
}

/* Story 5615. entity-files.css squares every button in the sort row to 40px for the arrow icons; Sources is a
   word, so it was squeezed and its text spilled out over the button's edge on the phone. */
.ef-sort > #btnSources { flex: 0 0 auto; width: auto; padding: 0 12px; white-space: nowrap; }

/* A band's own loading line and its Show more (bands load when opened -- Story 5615). */
.hl-band-status { padding: 10px 4px; color: #6B6B70; font-size: 13px; }
.hl-band-more { padding: 4px 0 10px; text-align: center; }

/* The second fold level: a band grouped by source, color or month holds its documents, each folded with its own
   count; a document opens onto its highlights. Indented under the band, a lighter rule than the band's. */
.hl-docband { margin: 0 0 4px 10px; }
.hl-docband-toggle {
    display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box;
    background: none; border: none; border-bottom: 1px solid #E2E8F0; padding: 7px 2px; cursor: pointer;
    text-align: left; font: 600 13px "Segoe UI", system-ui, sans-serif; color: #334155;
}
.hl-docband-toggle:hover { background: #F8FAFC; }
.hl-docband-label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.hl-docband-count {
    flex: 0 0 auto; font-weight: 400; font-size: 11px; color: #475569;
    background: #F1F5F9; border-radius: 999px; padding: 1px 8px;
}
.hl-docband-body { padding: 8px 0 4px 10px; }
.hl-docband.collapsed .hl-docband-body { display: none; }
