/* Roadmap idea 5: the passage synopsis (pages/synopsis.html, js/synopsis.js). Plain CSS (output.css is precompiled
   Tailwind, so new utility classes would not exist), loaded in both looks: the classic colours (bblue-500 brown,
   bgray-500 grey, black rules, the witness view's yellow lemma mark and red omission caret), the classic fonts
   (Montserrat, STIX Two Text), and the new look's faces where it sets them (next.css --font-ui, --font-read).
   Every class is prefixed sy-. */

.sy-page {
    --sy-brown: rgb(155 115 58);
    --sy-grey: rgb(240 240 240);
    --sy-rule: rgb(209 213 219);
    --sy-muted: rgb(107 114 128);
    --sy-red: rgb(220 38 38);
    --sy-ui: var(--font-ui, Montserrat, ui-sans-serif, system-ui, sans-serif);
    --sy-read: var(--font-read, 'STIX Two Text', Georgia, serif);
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    overflow-y: auto;
    /* the page scrolls in this box: positioned, so that what is placed absolutely inside it (the screen readers' text,
       .sy-sr) is placed and clipped by it too; else Chrome lays such text out against the whole document, which then
       grows past the window and scrolls on into a blank screen after the last row (#403 review) */
    position: relative;
    background: #fff;
    color: rgb(17 24 39);
    font-family: var(--sy-ui);
    font-size: 15px;
    line-height: 1.45;
}
.sy-page *, .sy-page *::before, .sy-page *::after { box-sizing: border-box; }
.sy-wrap { max-width: 72rem; margin: 0 auto; padding: 1rem 1.5rem 3rem; }

/* heading and passage picker */
.sy-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; margin-bottom: .75rem; }
.sy-head h1 { margin: 0; font-family: var(--sy-read); font-size: 1.5rem; font-weight: 600; line-height: 1.25; }
.sy-passage { white-space: nowrap; }
.sy-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; }
.sy-pick { display: flex; align-items: center; gap: .375rem; margin: 0; }
.sy-pick label { font-size: .8125rem; }
.sy-step { color: var(--sy-brown); white-space: nowrap; }
.sy-step:hover, .sy-siglum:hover, .sy-folios a:hover, .sy-plabel:hover { text-decoration: underline; }
.sy-page select { border: 2px solid var(--sy-brown); border-radius: .25rem; background: #fff; padding: .125rem .375rem;
    max-width: 100%; font: inherit; font-size: .875rem; }
.sy-button { border: 1px solid var(--sy-brown); border-radius: .25rem; background: #fff; color: var(--sy-brown);
    padding: .125rem .5rem; font: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer; }
.sy-button:hover { background: var(--sy-brown); color: #fff; }
/* under a mouse the new look gives a button without a fill its light tint of the brown (next.css) instead of the
   brown above: the text stays brown, not white on the tint */
@media (hover: hover) { html[data-ui="next"] .sy-button:not(:disabled):hover { color: var(--sy-brown); } }

/* the tools: base, group, switches, downloads; those that need the script (sy-js) appear once it has run */
.sy-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding: .5rem .75rem;
    background: var(--sy-grey); border: 1px solid #000; }
.sy-page:not(.sy-ready) .sy-js { display: none !important; }
.sy-field { display: inline-flex; align-items: center; gap: .375rem; font-size: .8125rem; }
.sy-switches { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.25rem; }
.sy-check { display: inline-flex; align-items: center; gap: .375rem; white-space: nowrap; cursor: pointer; }
.sy-check input { accent-color: var(--sy-brown); width: 1rem; height: 1rem; margin: 0; }
.sy-downloads { display: inline-flex; align-items: center; gap: .375rem; margin-left: auto; font-size: .8125rem; }
.sy-toggle { display: inline-flex; align-items: center; gap: .375rem; color: inherit; white-space: nowrap; }
.sy-box { width: 1rem; height: 1rem; border: 2px solid var(--sy-brown); border-radius: .2rem; background: #fff;
    display: inline-flex; align-items: center; justify-content: center; flex: none; }
.sy-on .sy-box { background: var(--sy-brown); }
.sy-on .sy-box::after { content: ""; width: .3rem; height: .55rem; margin-top: -.1rem;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* beta: the CSV for the matrix editor, a drawer under the tools (closed until asked for) */
.sy-matrix { border: 1px solid #000; border-top: 0; background: #fff; font-size: .8125rem; }
.sy-matrix > summary { display: flex; flex-wrap: wrap; align-items: center; gap: .125rem .5rem; padding: .375rem .75rem;
    cursor: pointer; list-style: none; }
.sy-matrix > summary::-webkit-details-marker { display: none; }
.sy-matrix > summary::before { content: ""; flex: none; width: .45rem; height: .45rem; margin: 0 .25rem 0 .1rem;
    border: solid var(--sy-brown); border-width: 0 2px 2px 0; transform: rotate(-45deg); }
.sy-matrix[open] > summary::before { transform: rotate(45deg); margin-top: -.2rem; }
.sy-matrix > summary:focus-visible { outline: 2px solid var(--sy-brown); outline-offset: -2px; }
.sy-matrix > summary:hover .sy-matrix-name { text-decoration: underline; }
.sy-matrix-name { font-weight: 600; color: var(--sy-brown); }
.sy-beta { padding: 0 .375rem; border: 1px solid var(--sy-brown); border-radius: 999px; color: var(--sy-brown);
    font-size: .625rem; font-weight: 700; line-height: 1.5; letter-spacing: .06em; text-transform: uppercase; }
.sy-matrix-hint { color: var(--sy-muted); }
/* the "alpha" pill beside the Family tree link: a block of its own, so the link's underline on hover leaves it out */
.sy-family-tree .sy-beta { display: inline-block; vertical-align: middle; margin-left: .125rem; }
.sy-matrix-body { max-width: 60rem; padding: .125rem .75rem .75rem 1.6rem; }
.sy-matrix-do { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: .25rem 0 .5rem; }
/* "Preparing…" while the file is made: brown text on white (under a mouse in the new look, on its light tint from
   next.css), also after a tap, and without the new look's colour transition, which the work would freeze half-way */
.sy-matrix-do .sy-button[aria-busy="true"], .sy-matrix-do .sy-button[aria-busy="true"]:hover { background: #fff;
    color: var(--sy-brown); cursor: progress; transition: none; }
.sy-check.sy-matrix-ac { flex: 1 1 18rem; align-items: flex-start; white-space: normal; }
.sy-matrix-ac input { margin-top: .1rem; flex: none; }
.sy-matrix-steps { margin: 0; padding-left: 1.25rem; list-style: decimal; }
.sy-matrix-steps li { margin: .125rem 0; padding-left: .125rem; }
.sy-matrix-body a { color: var(--sy-brown); text-decoration: underline; }
.sy-matrix-note { margin: .5rem 0 0; color: var(--sy-muted); }
/* the matrix editor hosted here (settings.MATRIX_EDITOR_HOSTED): "Open in the matrix editor", the panel's main action,
   is filled with the brown (the darker brown under a mouse, as next.css's brown buttons; by id, above the new look's
   light tint for buttons without a fill); Download CSV stays as it was; the credit under the help */
#sy-page .sy-button.sy-primary { background: var(--sy-brown); border-color: var(--sy-brown); color: #fff;
    padding: .25rem .75rem; }
#sy-page .sy-button.sy-primary:hover { background: rgb(132 98 49); border-color: rgb(132 98 49); color: #fff; }
.sy-matrix-blocked { margin: 0 0 .5rem; color: var(--sy-red); }
.sy-matrix-credit { margin: .5rem 0 0; color: var(--sy-muted); }

.sy-note { margin: .75rem 0 .25rem; font-size: .875rem; color: rgb(55 65 81); max-width: 60rem; }
.sy-note[hidden] { display: none; }

/* #403: a corrected alignment (saved from the matrix editor): its banner above the key, the note on rows shown as
   corrected while their transcription has changed (or not in it), and in the matrix editor's drawer saving a file and
   History. The warning is brown on a light tint and a border, so it does not depend on colour alone. */
.sy-sa-banner { margin: .5rem 0; padding: .375rem .75rem; border-left: 3px solid var(--sy-brown); background: var(--sy-grey);
    font-size: .875rem; max-width: 60rem; }
.sy-sa-banner[hidden], .sy-sa-banner [hidden], .sy-sa-history[hidden], .sy-sa-actions[hidden], .sy-sa-row[hidden],
.sy-sa-partial[hidden], .sy-sa-open-note[hidden] { display: none; }
.sy-sa-banner p { margin: .125rem 0; }
.sy-sa-banner a { color: var(--sy-brown); text-decoration: underline; }
.sy-sa-banner .sy-button { margin-left: .25rem; padding: 0 .5rem; font-size: .8125rem; }
.sy-sa-stale { margin-top: .25rem; padding: .25rem .5rem; border: 1px solid var(--sy-brown); border-radius: .25rem;
    background: #fff; overflow-wrap: anywhere; }
.sy-sa-row { font-size: .8125rem; color: var(--sy-brown); font-style: italic; }
.sy-sa-open-note { margin: -.25rem 0 .5rem; color: var(--sy-muted); }
.sy-sa-save, .sy-sa-history { margin-top: .75rem; padding-top: .5rem; border-top: 1px solid var(--sy-rule); }
.sy-sa-title { margin: 0 0 .25rem; font-size: .875rem; font-weight: 600; }
.sy-sa-steps { margin: 0 0 .5rem; padding-left: 1.25rem; list-style: decimal; }
.sy-sa-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: .25rem 0; }
.sy-sa-file input { max-width: 100%; font: inherit; }
.sy-sa-status { margin: .25rem 0; font-weight: 600; overflow-wrap: anywhere; }
.sy-sa-status:empty { display: none; }
.sy-sa-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .25rem 0; }
.sy-sa-kept, .sy-sa-partial, .sy-sa-earlier { margin: .25rem 0; color: var(--sy-muted); }
.sy-sa-versions { margin: 0; padding: 0; list-style: none; }
.sy-sa-version { padding: .375rem 0; border-bottom: 1px solid var(--sy-rule); }
.sy-sa-version:last-child { border-bottom: 0; }
.sy-sa-current .sy-sa-when strong { color: var(--sy-brown); }
.sy-sa-summary { margin: .125rem 0; padding-left: 1.25rem; list-style: disc; overflow-wrap: anywhere; }
.sy-sa-more > summary { cursor: pointer; color: var(--sy-brown); }
.sy-sa-do { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .25rem; }
.sy-sa-do form, .sy-sa-remove { margin: 0; }
.sy-sa-remove { margin-top: .5rem; }
#sy-page .sy-sa-do .sy-button, #sy-page .sy-sa-remove .sy-button { text-decoration: none; padding: 0 .5rem; }
.sy-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; margin: .25rem 0; font-size: .8125rem; }
.sy-summary { margin: .25rem 0 .75rem; font-size: .875rem; color: var(--sy-muted); }
.sy-missing { overflow-wrap: anywhere; }
.sy-empty { margin: 2rem 0; font-size: 1.125rem; }
.sy-similar { color: var(--sy-brown); text-decoration: underline; white-space: nowrap; }

/* one witness a row */
.sy-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--sy-rule); }
.sy-row { padding: .625rem 0 .75rem .75rem; border-bottom: 1px solid var(--sy-rule); border-left: 3px solid transparent; }
.sy-row[hidden] { display: none; }
.sy-row.sy-base { background: var(--sy-grey); border-left-color: var(--sy-brown); }
.sy-row-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .125rem .75rem; margin-bottom: .25rem; }
.sy-siglum { color: var(--sy-brown); font-weight: 700; font-size: 1rem; }
.sy-folios { font-size: .8125rem; color: var(--sy-muted); }
.sy-folios a { color: var(--sy-brown); }
.sy-count { margin-left: auto; padding-right: .5rem; font-size: .8125rem; color: var(--sy-muted); white-space: nowrap; }
.sy-base .sy-count { color: var(--sy-brown); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: .75rem; }
.sy-text { font-family: var(--sy-read); font-size: 1.0625rem; line-height: 1.75; overflow-wrap: anywhere; padding-right: .5rem; }
/* before the script has run (or without it): the transcription as stored, its line breaks kept */
.sy-raw { white-space: pre-wrap; }
.sy-src + .sy-src { margin-top: .25rem; }

/* line tags ({C3D_057v9}) and notes: small and grey, raised; hidden with "Line markers" off */
.sy-tag { font-family: var(--sy-ui); font-size: .625rem; line-height: 1; color: var(--sy-muted); vertical-align: .6em;
    margin: 0 .1em; user-select: none; }
.sy-hide-tags .sy-tag { display: none; }
.sy-brk { color: var(--sy-muted); }
.sy-plabel { font-family: var(--sy-ui); font-size: .75rem; font-weight: 600; line-height: 1; padding: .1em .3em;
    background: rgb(209 213 219); color: inherit; vertical-align: .15em; border-radius: 2px; }
.sy-plabel-prev, .sy-plabel-next { background: #fff; outline: 1px dashed rgb(156 163 175); }

/* the marks: colour and shape, so they do not depend on colour alone */
.sy-w { color: inherit; border-radius: 2px; padding: 0 .05em; text-decoration: none; }
mark.sy-chg { background: #fde047; }                                                 /* the witness view's lemma mark */
ins.sy-add { background: #f2ddb0; border-bottom: 2px solid var(--sy-brown); }        /* its search-hit mark */
mark.sy-sp { background: transparent; border-bottom: 2px dotted var(--sy-brown); border-radius: 0; }
/* #403: words in another order than the base, one box around them (a box on each line when they break across lines);
   a border, so that it shows in forced-colours mode too; the brown has 3:1 and more on white and on the base's grey */
mark.sy-tr { background: transparent; border: 1px dashed var(--sy-brown); border-radius: 3px; padding: 0 .1em;
    -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.sy-om { display: inline; border: 0; background: none; padding: 0 .05em; margin: 0; font: inherit; color: var(--sy-red);
    font-weight: 700; cursor: pointer; line-height: 1; }
.sy-om > [aria-hidden] { font-size: 1.3em; position: relative; top: .15em; }
.sy-om-text { display: none; font-family: var(--sy-ui); font-size: .8125rem; font-weight: 600; color: var(--sy-red);
    text-decoration: line-through; margin-left: .15em; }
.sy-om[aria-expanded="true"] .sy-om-text { display: inline; }
.sy-om-key { cursor: default; }
.sy-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* the screen readers' text in a row's text (the base's words that a mark stands for, a ‸'s name) is not the witness's
   text: it stays out of what a reader selects and copies (#403 review) */
.sy-text .sy-sr { -webkit-user-select: none; user-select: none; }
.sy-legend .sy-w { padding: 0 .25em; }

/* the new look: its reading face a little larger, as on the critical text */
html[data-ui="next"] .sy-text { font-size: 1.125rem; }
html[data-ui="next"] .sy-head h1 { font-size: 1.625rem; }

@media (max-width: 767px) {
    .sy-wrap { padding: .75rem 1rem 2rem; }
    .sy-head { gap: .5rem; }
    .sy-head h1 { font-size: 1.25rem; }
    /* a long passage name (collection 129's run to 58 characters) goes under "Compare witnesses" whole, its number
       with it ("3 Preliminaries", not "Compare witnesses 3" / "Preliminaries"), and wraps there instead of making the
       page wider than the screen */
    .sy-passage { display: inline-block; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
    /* ‹ picker › on one line; the names of the passages either side give way to the arrows */
    .sy-nav { width: 100%; flex-wrap: nowrap; gap: .5rem; }
    .sy-step-name, .sy-pick label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
        white-space: nowrap; }
    .sy-step { flex: none; padding: .375rem .75rem; font-size: 1.25rem; line-height: 1; }
    .sy-pick { flex: 1 1 0; min-width: 0; }
    .sy-pick select { width: 100%; min-width: 0; }
    /* Base and Group side by side, each label above its picker */
    .sy-controls { gap: .5rem .75rem; padding: .5rem; }
    .sy-field { flex: 1 1 40%; min-width: 0; display: grid; gap: .125rem; }
    .sy-field select { width: 100%; min-width: 0; }
    .sy-switches { flex: 1 1 100%; gap: 0 1rem; }
    .sy-downloads { margin-left: 0; flex: 1 1 100%; }
    .sy-row { padding-left: .5rem; }
    .sy-count { margin-left: 0; flex-basis: 100%; }
    .sy-matrix > summary { padding: .5rem; }
    .sy-matrix-hint { flex-basis: 100%; padding-left: 1rem; }
    .sy-matrix-body { padding: 0 .5rem .75rem; }
    .sy-matrix-do .sy-button { flex: 1 1 100%; }
    .sy-sa-form .sy-button, .sy-sa-file, .sy-sa-file input { flex: 1 1 100%; width: 100%; }
    /* iOS Safari zooms in on fields under 16 px */
    .sy-page select { font-size: 16px; }
}
@media (pointer: coarse) {
    .sy-page select, .sy-button { min-height: 2.5rem; }
    .sy-check input, .sy-box { width: 1.25rem; height: 1.25rem; }
    .sy-check, .sy-toggle { min-height: 2.5rem; }
    .sy-matrix > summary { min-height: 2.75rem; }
    .sy-check.sy-matrix-ac { align-items: center; }
    .sy-matrix-ac input { margin-top: 0; }
    .sy-step { min-height: 2.5rem; display: inline-flex; align-items: center; }
    .sy-om { padding: .2em .2em; }
}
