/* sibnotes-reader.css — the UMI's document reading view (folding-sibnotes-reader S3).
 *
 * The view is a layer INSIDE the UMI: on a desktop it covers the media pane (the details, Say It and Fergi stay
 * beside it); on a phone it covers the focal pane and the details, between the bars (the context bar keeps the
 * UMI's Say It). Its geometry is measured from the panes by sibnotes-reader.js, so it follows the UMI's own
 * layout rather than restating it. Reading type: a serif page on warm paper, ≥17px on a phone. */

.snr-view {
    position: absolute;
    z-index: 5;
    display: flex;
    flex-direction: column;
    background: #f7f2e8;
    color: #2b2620;
    font-family: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
    overflow: hidden;
    box-sizing: border-box;
}
.snr-view *, .snr-view *::before, .snr-view *::after { box-sizing: border-box; }

/* ── the bar ── */
.snr-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #efe6d4;
    border-bottom: 1px solid #ddd0b6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.snr-back {
    flex: none;
    border: 1px solid #c9b996;
    background: #fffaf0;
    color: #4a3f2f;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    min-height: 36px;
}
.snr-heading { flex: 1; min-width: 0; }
.snr-title {
    font-family: Georgia, serif;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.snr-sub { font-size: 13px; color: #6b5d47; margin-top: 2px; }
.snr-star {
    flex: none;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid #c9b996;
    background: #fffaf0;
    font-size: 20px;
    color: #8a7550;
    cursor: pointer;
}
.snr-star.on { color: #c58a00; background: #fff3cf; border-color: #e0b84a; }
.snr-q-chip {
    flex: none;
    border: none;
    border-radius: 999px;
    background: #7a4fb3;
    color: #fff;
    font-size: 13px;
    padding: 6px 12px;
    min-height: 32px;
    cursor: pointer;
}

/* ── the three ways of reading ── */
.snr-modes {
    display: flex;
    gap: 6px;
    padding: 8px 16px;
    background: #f3ead9;
    border-bottom: 1px solid #e4d8bf;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.snr-mode {
    border: 1px solid #d6c7a7;
    background: #fffaf0;
    color: #4a3f2f;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 14px;
    min-height: 34px;
    cursor: pointer;
}
.snr-mode.on { background: #4a3f2f; color: #fffaf0; border-color: #4a3f2f; }

.snr-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 0 16px; }

/* ── the page ── */
.snr-page { max-width: 46rem; margin: 0 auto; padding: 20px 24px 8px; outline: none; }
.snr-page[data-snr-mode="side"], .snr-page[data-snr-mode="pages"] { max-width: none; }
.snr-summary {
    font-style: italic;
    color: #5d503c;
    border-left: 3px solid #d6c7a7;
    padding-left: 12px;
    margin: 0 0 18px;
    font-size: 16px;
    line-height: 1.5;
}
.snr-pageblock { margin: 0 0 22px; }
.snr-page-label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8a7a60;
    margin: 0 0 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.snr-legib { text-transform: none; letter-spacing: 0; }
.snr-dot { color: #7a4fb3; text-transform: none; }
.snr-view p.flow {
    font-size: 18px;
    line-height: 1.65;
    margin: 0 0 14px;
    padding: 2px 6px;
    border-radius: 6px;
    cursor: text;
}
.snr-view p.flow.ed { color: #7d6f58; font-style: italic; font-size: 16px; }
.snr-view p.note { color: #6b5d47; font-size: 15px; border-left: 3px solid #e4d8bf; padding-left: 10px; }
.snr-view mark { background: #fbe7a6; color: inherit; padding: 0 2px; border-radius: 3px; }
.snr-view sup.pg { color: #8a7a60; font-size: 11px; }
.snr-w { border-radius: 3px; }
.snr-view p.snr-live { background: #ece0ff; box-shadow: inset 3px 0 0 #7a4fb3; }
.snr-view .snr-w.snr-live { background: #cdb4f5; }
.snr-view p.snr-has-note { box-shadow: inset 3px 0 0 #c9a7f0; }
.snr-empty { color: #8a7a60; font-style: italic; }
.snr-reader-note { font-size: 13px; color: #7d6f58; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

/* side by side: the page beside its transcript; stacked on a phone */
.snr-side-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.snr-tx p.flow { font-size: 16px; }

/* a page's picture, contained, turned by the Vault's rotation */
.snr-plate {
    position: relative;
    margin: 0;
    width: 100%;
    max-height: 78vh;
    background: #e9dfcb;
    border: 1px solid #d6c7a7;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
}
.snr-plate.large { max-width: 900px; margin: 0 auto; }
.snr-plate img {
    position: absolute;
    left: 50%; top: 50%;
    width: 100%; height: 100%;
    object-fit: contain;
    transform-origin: 50% 50%;
}
.snr-plate.snr-live { outline: 3px solid #7a4fb3; outline-offset: 2px; }
.snr-plate-missing {
    padding: 28px 16px;
    text-align: center;
    color: #8a7a60;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
}
.snr-turn-tools { display: inline-flex; gap: 10px; text-transform: none; letter-spacing: 0; }

/* ── questions, filed under, the family's notes ── */
.snr-q-panel {
    max-width: 46rem;
    margin: 14px auto 0;
    padding: 12px 16px;
    background: #f1e8ff;
    border: 1px solid #d8c4f5;
    border-radius: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.snr-question { padding: 6px 0; border-top: 1px solid #e3d4fa; }
.snr-question:first-of-type { border-top: none; }
.snr-qtext { margin: 0 0 6px; font-size: 16px; color: #3b2a55; }
.snr-qacts { display: flex; gap: 14px; }
.snr-label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8a7a60;
    margin: 0 0 6px;
}
.snr-filed, .snr-notes {
    max-width: 46rem;
    margin: 6px auto 0;
    padding: 0 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.snr-filed { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.snr-filed .snr-label { margin: 0 6px 0 0; }
.snr-chip {
    display: inline-block;
    border: 1px solid #d6c7a7;
    background: #fffaf0;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 13px;
    color: #4a3f2f;
}
button.snr-chip { cursor: pointer; min-height: 30px; }
.snr-chip.add { border-style: dashed; }
.snr-notes { margin-top: 14px; }
.snr-note {
    background: #fffaf0;
    border: 1px solid #e4d8bf;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 0 0 8px;
}
.snr-note.anchored { cursor: pointer; }
.snr-note-head { font-size: 13px; color: #5d503c; display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.snr-note-where { color: #8a7a60; }
.snr-note-state { margin-left: auto; font-size: 12px; color: #8a7a60; }
.snr-note-state.applied { color: #2f7a4a; }
.snr-note-state.failed { color: #a5552a; }
.snr-note-words { margin: 4px 0 0; font-size: 15px; line-height: 1.45; color: #2b2620; white-space: pre-wrap; }

/* ── the note bar ── */
.snr-notebar {
    flex: none;
    padding: 10px 16px 12px;
    background: #efe6d4;
    border-top: 1px solid #ddd0b6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.snr-answering { font-size: 13px; color: #3b2a55; margin-bottom: 6px; }
.snr-anchor-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.snr-anchor-chip { font-size: 13px; color: #4a3f2f; font-weight: 600; }
.snr-compose { display: flex; gap: 8px; align-items: flex-end; }
.snr-field {
    flex: 1;
    min-width: 0;
    resize: vertical;
    min-height: 44px;
    max-height: 30vh;
    font: 16px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;  /* 16px: iOS does not zoom */
    padding: 8px 10px;
    border: 1px solid #c9b996;
    border-radius: 10px;
    background: #fffdf8;
    color: #2b2620;
}
.snr-send {
    flex: none;
    min-height: 44px;
    padding: 0 16px;
    border: none;
    border-radius: 10px;
    background: #4a3f2f;
    color: #fffaf0;
    font-size: 15px;
    cursor: pointer;
}
.snr-send:disabled, .snr-field:disabled { opacity: 0.55; cursor: default; }
.snr-hint { font-size: 12px; color: #7d6f58; margin-top: 6px; }
.snr-status { font-size: 13px; color: #2f5a7a; margin-top: 4px; min-height: 1em; }
.snr-link {
    border: none;
    background: none;
    padding: 2px 0;
    color: #5a3d8a;
    text-decoration: underline;
    font-size: 13px;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.snr-link.strong { font-weight: 600; }

/* ── the entry in the UMI's details ── */
.snr-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0 0 12px;
    padding: 12px 14px;
    border: 1px solid #d6c7a7;
    border-radius: 12px;
    background: #f7f2e8;
    color: #2b2620;
    text-align: left;
    cursor: pointer;
    font: 15px/1.3 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 48px;
}
.snr-entry:hover { background: #efe6d4; }
.snr-entry-glyph { font-size: 22px; flex: none; }
.snr-entry-text b { font-family: Georgia, serif; font-size: 16px; }
#umBody.snr-updated { animation: snr-updated 2.4s ease-out; }
@keyframes snr-updated { 0% { box-shadow: inset 0 0 0 3px #7a4fb3; } 100% { box-shadow: inset 0 0 0 0 transparent; } }

/* ── the phone ── */
.snr-view.snr-phone .snr-bar { padding: 8px 12px; gap: 8px; }
.snr-view.snr-phone .snr-title { font-size: 16px; }
.snr-view.snr-phone .snr-modes { padding: 6px 12px; overflow-x: auto; }
.snr-view.snr-phone .snr-mode { padding: 6px 12px; flex: none; }
.snr-view.snr-phone .snr-page { padding: 14px 14px 6px; }
.snr-view.snr-phone p.flow { font-size: 17px; }
.snr-view.snr-phone .snr-side-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.snr-view.snr-phone .snr-filed, .snr-view.snr-phone .snr-notes { padding: 0 14px; }
.snr-view.snr-phone .snr-notebar { padding: 8px 12px 10px; }
.snr-view.snr-phone .snr-hint { display: none; }
@media (max-width: 768px) {
    .snr-side-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    #umBody.snr-updated { animation: none; }
}
