/* Settings and the managing pages (docs/designs/lyra-web-screens.md, 3.16
   to 3.23). The grouped list is drawn by iOS on the phone; here it is cards
   on the group colour with hairline dividers. */

/* --- the Settings list --- */
.set-main { max-width: calc(720px + 2 * var(--margin)); margin: 0 auto; padding: 18px var(--margin) 44px; display: flex; flex-direction: column; gap: 24px; }
.set-main .large-title { margin: 4px 0 -4px; }
.set-section { display: flex; flex-direction: column; gap: 8px; }
.set-section > .label-row { padding: 0 16px; }
.set-group { background: var(--group); border-radius: 14px; overflow: hidden; }
.set-line { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 16px; font-size: 17px; text-align: left; transition: background .12s ease-out; }
a.set-line:hover, button.set-line:hover { background: rgba(255,255,255,.035); }
a.set-line:active, button.set-line:active { background: rgba(255,255,255,.06); }
.set-line + .set-line::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--hairline); }
.set-name { flex: 1; min-width: 0; }
.set-value { color: var(--secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.set-value.warn { color: var(--accent); }
.set-chev { color: var(--tertiary); margin-right: -4px; }
.set-me { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.set-me-text { flex: 1; min-width: 0; }
.set-me-name { font-size: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-me-role { font-size: 15px; color: var(--secondary); }
.set-switch-btn { height: 34px; padding: 0 15px; border-radius: 999px; background: #fff; color: #000; font-size: 15px; font-weight: 600; flex: none; transition: opacity .12s ease-out, transform .12s ease-out; }
.set-switch-btn:active { opacity: .85; transform: scale(.98); }
.set-quiet { padding: 12px 16px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); font-size: 13px; color: var(--tertiary); }
.set-signout { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; border-radius: 14px; font-size: 17px; color: var(--error); }
.set-signout:hover:not(:disabled) { background: rgba(255,122,115,.07); }
.set-about { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: -10px; text-align: center; }
.set-version { font-size: 13px; color: var(--secondary); }
.set-tmdb { font-size: 11px; color: var(--tertiary); max-width: 420px; }

/* --- a sub-screen: Back, a small title, cards --- */
.set-page { min-height: 100vh; }
.set-col { max-width: calc(720px + 2 * var(--margin)); margin: 0 auto; }
.set-body { display: flex; flex-direction: column; gap: 12px; padding: 8px var(--margin) 44px; }
.set-body.loose { gap: 22px; padding-top: 12px; }
@media (min-width: 600px) {
  /* the glow starts at the very top, under the floating tabs */
  .set-page { margin-top: -68px; padding-top: 68px; }
}
.set-card { background: var(--field); border: 1px solid var(--line); border-radius: var(--r-card-lg); overflow: hidden; }
.set-info { display: flex; align-items: center; gap: 14px; padding: 16px; }
.set-info-title { font-size: 16px; font-weight: 600; }
.set-info-text { font-size: 13px; color: var(--secondary); margin-top: 2px; }
.set-badge { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: rgba(255,176,138,.12); color: var(--accent); flex: none; }
.set-badge.filled { background: var(--accent-gradient); color: var(--on-accent); }
.set-badge.filled .icon { stroke-width: 2.4; }
.card-line { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 14px 16px; font-size: 15px; font-weight: 600; text-align: left; }
button.card-line:hover:not(:disabled) { background: rgba(255,255,255,.03); }
.card-line + .card-line::before, .set-toggle + .set-toggle::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--hairline); }
.card-line > span:first-child { flex: 1; }
.card-line.destructive { color: var(--error); }
.card-line.peach { color: var(--accent); }
.set-foot { font-size: 12.5px; color: var(--tertiary); padding: 0 4px; }
.set-foot.error { color: var(--error); }
.set-foot.lock { display: flex; gap: 8px; align-items: flex-start; color: var(--secondary); font-size: 13px; }
.set-foot.lock .icon { margin-top: 1px; color: var(--tertiary); }
.set-wait { display: grid; place-items: center; padding: 34px 0; }
.set-empty { font-size: 14px; color: var(--secondary); text-align: center; padding: 30px 0; }

/* --- switches: peach when on --- */
.set-toggle { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.set-toggle-text { flex: 1; min-width: 0; }
.set-toggle-title { display: block; font-size: 15px; font-weight: 600; }
.set-toggle-detail { display: block; font-size: 13px; color: var(--secondary); margin-top: 2px; }
.switch { position: relative; width: 51px; height: 31px; border-radius: 999px; background: rgba(255,255,255,.16); flex: none; transition: background .2s ease-out; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.3); transition: transform .2s ease-out; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch:disabled { opacity: .45; }
.switch:focus-visible { border-radius: 999px; }

/* --- the sign-out sheet --- */
.sheet.signout { gap: 18px; padding-left: 20px; padding-right: 20px; }
.signout-head { display: flex; flex-direction: column; gap: 6px; }
.signout-head .sheet-text { margin: 0; }
.signout-list { display: flex; flex-direction: column; gap: 8px; }
.signout-row { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; }
.signout-poster { width: 29px; height: 43.5px; border-radius: 5px; overflow: hidden; background: var(--plum-gradient); flex: none; }
.signout-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signout-size { font-size: 12px; font-weight: 400; color: var(--tertiary); font-variant-numeric: tabular-nums; }
.signout-more { font-size: 13px; color: var(--tertiary); }
.signout-actions { display: flex; flex-direction: column; gap: 10px; }
.signout-actions .btn { min-height: 50px; }

/* --- the Set PIN sheet --- */
.sheet.setpin-sheet { padding: 0 24px calc(26px + env(safe-area-inset-bottom)); gap: 0; align-items: center; text-align: center; }
@media (max-width: 599px) { .sheet.setpin-sheet { min-height: min(680px, calc(100vh - 40px)); } }
.setpin-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; min-height: 56px; }
.setpin-cancel { justify-self: start; font-size: 16px; font-weight: 500; color: var(--accent); padding: 8px 2px; }
.setpin-cancel:disabled { color: var(--tertiary); }
.setpin-title { font-size: 17px; font-weight: 600; }
.setpin-sheet .pin-heading { margin-top: 24px; }
.setpin-sub { font-size: 14px; color: var(--secondary); margin-top: 6px; max-width: 340px; min-height: 40px; }
.setpin-sheet .pin-pad { margin-top: 20px; }
.setpin-sheet .pin-msg { margin-top: 22px; }

/* --- Wishlists --- */
.wish-picker { width: 100%; max-width: 420px; margin-bottom: 6px; }
.wish-row { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px; }
.wish-row + .wish-row::before { content: ""; position: absolute; top: 0; left: 76px; right: 0; height: 1px; background: var(--hairline); }
.wish-poster { width: 50px; height: 75px; border-radius: var(--r-thumb); overflow: hidden; background: var(--plum-gradient); flex: none; }
.wish-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wish-name { font-size: 15.5px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wish-who { font-size: 13px; color: var(--secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wish-note { font-size: 13px; font-style: italic; color: var(--tertiary); }
.wish-text .status-line { margin-top: 2px; }
.adm-more { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--secondary); flex: none; }
.adm-more:hover { background: var(--field-hover); color: var(--text); }
.note-field { width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r-field); background: var(--field); border: 1px solid var(--line); font-size: 16px; outline: none; transition: border-color .15s ease-out, box-shadow .15s ease-out; }
.note-field::placeholder, .fix-field::placeholder, .adm-search input::placeholder { color: var(--tertiary); }
.note-field:focus { border: 1.5px solid rgba(255,176,138,.85); box-shadow: 0 0 0 4px rgba(255,176,138,.10); }

/* --- Library, the files --- */
.adm-bar-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--accent); }
.adm-bar-btn:hover { background: var(--field-hover); }
.adm-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: rgba(255,255,255,.08); color: var(--tertiary); }
.adm-search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; font-size: 16px; color: var(--text); }
.adm-search:focus-within { box-shadow: 0 0 0 1.5px rgba(255,176,138,.85); }
.adm-chips { display: flex; gap: 8px; overflow-x: auto; margin: 4px calc(-1 * var(--margin)); padding: 0 var(--margin); scrollbar-width: none; }
.adm-chips::-webkit-scrollbar { display: none; }
.adm-chip { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 13px; border-radius: 999px; background: var(--field); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; white-space: nowrap; flex: none; transition: background .15s ease-out, color .15s ease-out; }
.adm-chip:hover { background: var(--field-hover); }
.adm-chip .n { color: var(--tertiary); font-variant-numeric: tabular-nums; }
.adm-chip.on { background: var(--accent-gradient); border-color: transparent; color: var(--on-accent); }
.adm-chip.on .n { color: rgba(41,15,51,.7); }
.adm-entry { position: relative; }
.adm-entry + .adm-entry::before, .adm-entry + .adm-more-row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--hairline); }
.adm-row { display: flex; align-items: center; gap: 4px; padding: 12px 8px 12px 14px; }
.adm-row.in-show { padding-left: 28px; }
.adm-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.adm-main.still { cursor: default; }
.adm-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.adm-head { display: flex; flex-direction: column; gap: 4px; width: 100%; min-width: 0; text-align: left; }
.adm-head:disabled { color: inherit; }
.adm-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-row.in-show .adm-name { font-size: 14px; }
.adm-sub { font-size: 12px; color: var(--tertiary); }
/* a file's name, cut in the middle: the start gives way, the end stays */
.adm-file { display: flex; max-width: 100%; font-size: 12px; color: var(--tertiary); white-space: pre; }
.adm-file .a { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.adm-file .b { flex: none; }
.adm-status { display: inline-flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.adm-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.adm-status.error { color: var(--error); } .adm-status.tertiary { color: var(--tertiary); } .adm-status.secondary { color: var(--secondary); }
.adm-status.accent { color: var(--accent); } .adm-status.good { color: var(--good); }
.adm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.vtag { padding: 2px 6px; border-radius: var(--r-tag); border: 1px solid transparent; font-size: 11px; font-weight: 600; line-height: 1.35; white-space: nowrap; }
button.vtag:hover { filter: brightness(1.25); }
.vtag.made { color: var(--text); background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.14); }
.vtag.making { color: var(--accent); background: rgba(255,176,138,.08); border-color: rgba(255,176,138,.45); }
.vtag.queued { color: var(--secondary); border: 1px dashed rgba(255,255,255,.25); }
.vtag.skipped { color: rgba(255,255,255,.25); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.3); }
.vtag.failed { color: var(--error); border-color: rgba(255,122,115,.4); }
.adm-reason { font-size: 12px; color: var(--error); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.adm-reason.damage { color: var(--accent); }
.adm-chev { color: var(--tertiary); transition: transform .25s ease-out; flex: none; margin: 0 4px; }
.adm-row.show .adm-chev { color: var(--secondary); margin: 0 14px 0 4px; }
.adm-row.open .adm-chev { transform: rotate(90deg); }
.adm-more-space { width: 36px; flex: none; }
.adm-more-row { position: relative; display: grid; place-items: center; padding: 18px 0; }
.adm-retry { font-size: 13px; font-weight: 500; color: var(--accent); }
.set-pop { position: fixed; z-index: 960; max-width: 260px; padding: 9px 12px; border-radius: 12px; background: var(--popover); border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(0,0,0,.5); font-size: 13px; }

/* a file's steps */
.adm-steps { padding: 0 14px 12px 14px; }
.adm-steps.in-show { padding-left: 28px; }
.adm-steps::before { content: ""; display: block; height: 1px; margin-bottom: 6px; background: var(--line); }
.adm-steps-note { font-size: 12.5px; color: var(--tertiary); padding: 6px 0; }
.step { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; }
.step-icon { display: grid; place-items: center; width: 16px; height: 18px; flex: none; }
.step-icon .done { color: var(--accent); } .step-icon .failed { color: var(--error); }
.step-wait { width: 13px; height: 13px; border-radius: 50%; border: 1.5px dashed var(--tertiary); }
.step-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.step-label { font-size: 14px; }
.step.running .step-label { font-weight: 600; } .step.done .step-label { color: var(--tertiary); }
.step-doing { font-size: 12px; color: var(--secondary); font-variant-numeric: tabular-nums; }
.step-bar { height: 3px; margin-top: 2px; border-radius: 2px; background: rgba(255,255,255,.10); overflow: hidden; }
.step-bar i { display: block; height: 100%; border-radius: 2px; background: var(--accent); transition: width 1s linear; }
.step-error { font-size: 12px; color: var(--error); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.step-right { font-size: 12.5px; color: var(--secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.step.running .step-right { color: var(--accent); } .step.failed .step-right { color: var(--error); }
.steps-foot { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.steps-foot div { display: flex; justify-content: space-between; gap: 10px; color: var(--secondary); }
.steps-foot b { font-weight: 400; color: var(--text); }
.steps-foot p { font-size: 12px; color: var(--tertiary); }

/* --- Fix Match --- */
.sheet.fix { padding: 0 20px calc(24px + env(safe-area-inset-bottom)); gap: 0; position: relative; height: min(720px, calc(100vh - 40px)); }
.fix-bar { position: sticky; top: 0; z-index: 1; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 56px; margin: 0 -20px; padding: 0 20px; background: var(--sheet); }
.fix-bar .setpin-cancel { justify-self: start; }
.fix-bar .adm-bar-btn { justify-self: end; margin-right: -10px; }
.fix-body { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.fix-what { font: 12px/1.4 var(--mono); color: var(--tertiary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.fix-search { display: flex; flex-direction: column; gap: 10px; }
.fix-fields { display: flex; gap: 8px; }
.fix-field { height: 44px; min-width: 0; padding: 0 12px; border: 0; border-radius: 12px; background: var(--field); font-size: 16px; outline: none; }
.fix-field:focus { box-shadow: 0 0 0 1.5px rgba(255,176,138,.85); }
.fix-field.title { flex: 1; } .fix-field.year { width: 88px; flex: none; }
.fix-go { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-gradient); color: var(--on-accent); flex: none; }
.fix-go .icon { stroke-width: 2.3; }
.fix-go:active { filter: brightness(.95); }
.fix-note { font-size: 14px; color: var(--secondary); padding-top: 4px; }
.fix-result { position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 10px 12px; text-align: left; }
.fix-result:hover { background: rgba(255,255,255,.04); }
.fix-result + .fix-result::before { content: ""; position: absolute; top: 0; left: 72px; right: 0; height: 1px; background: var(--hairline); }
.fix-poster { width: 48px; height: 72px; border-radius: var(--r-thumb); overflow: hidden; background: linear-gradient(135deg, var(--panel-top), var(--panel-bottom)); flex: none; }
.fix-result-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fix-result-name { font-size: 15px; font-weight: 600; }
.fix-result-name span { margin-left: 6px; font-size: 14px; font-weight: 400; color: var(--tertiary); }
.fix-result-overview { font-size: 12.5px; color: var(--secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fix-busy { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: rgba(27,19,32,.55); border-radius: inherit; }
.fix-busy .spinner { width: 34px; height: 34px; border-width: 3px; }

/* --- Prepare Films (view only in a browser) --- */
.prep-counts { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.prep-numbers { display: flex; align-items: center; width: 100%; }
.prep-number { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.prep-number b { font-size: 46px; font-weight: 600; letter-spacing: -1.4px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.prep-number span { font-size: 14px; color: var(--secondary); }
.prep-numbers .rule { width: 1px; height: 58px; background: var(--line); }
.prep-card { border-radius: var(--r-card-xl); background: var(--field); border: 1px solid var(--line); }
.prep-done { display: flex; align-items: center; justify-content: center; gap: 10px; height: 64px; font-size: 16px; font-weight: 600; }
.prep-done .icon { color: var(--accent); }
.prep-time { padding: 18px 22px 16px; }
.prep-today { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.prep-time.paused .prep-today { color: var(--tertiary); }
.prep-line { position: relative; height: 70px; margin-top: 14px; }
.prep-track, .prep-lit { position: absolute; left: 0; top: 6px; height: 4px; border-radius: 2px; }
.prep-track { right: 0; background: rgba(255,255,255,.10); }
.prep-lit { background: var(--accent); }
.prep-dot { position: absolute; left: -6px; top: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(255,176,138,.2); }
.prep-time.paused .prep-dot { background: rgba(255,255,255,.35); box-shadow: none; }
.prep-mark { position: absolute; top: 1px; width: 14px; height: 14px; border-radius: 50%; background: var(--canvas); border: 2.5px solid rgba(255,255,255,.4); }
.prep-mark.lit { border-color: var(--accent); }
.prep-mark.end { right: 0; }
.prep-stop { position: absolute; top: 28px; display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.prep-stop.end { right: 0; align-items: flex-end; }
.prep-stop b { font-size: 17px; font-weight: 600; }
.prep-stop span { font-size: 12.5px; color: var(--secondary); }
.prep-paused { position: absolute; left: 0; right: 0; top: 30px; text-align: center; font-size: 17px; font-weight: 600; color: var(--secondary); }
.prep-block { display: flex; flex-direction: column; gap: 10px; }
.prep-choices { display: flex; gap: 10px; }
.prep-choice { position: relative; flex: 1; min-width: 0; height: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-radius: var(--r-card-xl); background: var(--field); border: 1px solid var(--line); color: var(--secondary); }
.prep-choice .icon { height: 28px; }
.prep-choice b { font-size: 14px; font-weight: 600; }
.prep-choice small { font-size: 11.5px; color: var(--tertiary); min-height: 16px; }
.prep-choice.on { background: rgba(255,176,138,.10); border-color: rgba(255,176,138,.7); }
.prep-choice.on .icon { color: var(--accent); } .prep-choice.on b { color: var(--text); }
.prep-choice:not(.on) { opacity: .6; }
.prep-check { position: absolute; top: 8px; right: 8px; width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.prep-check .icon { height: auto; color: var(--on-accent) !important; stroke-width: 3; }
.ver-row { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 12px 16px; }
.ver-row + .ver-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--hairline); }
.ver-name { flex: 1 1 150px; min-width: 0; }
.ver-name b { display: block; font-size: 15px; font-weight: 600; }
.ver-name span { display: block; font-size: 12.5px; color: var(--secondary); margin-top: 1px; }
.ver-seg { display: flex; padding: 2px; border-radius: 9px; background: rgba(255,255,255,.07); flex: none; }
.ver-seg button { min-width: 44px; height: 28px; padding: 0 9px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--tertiary); font-variant-numeric: tabular-nums; }
.ver-seg button[aria-pressed="true"] { background: rgba(255,176,138,.16); color: var(--accent); font-weight: 600; }
.ver-fig { flex: 1 1 100%; font-size: 12.5px; color: var(--tertiary); font-variant-numeric: tabular-nums; }
@media (min-width: 600px) { .ver-row:not(.last) .ver-fig { flex: 0 0 190px; text-align: right; } .ver-row.last .ver-seg { margin-right: 204px; } }
