/* The admin console. Uses the theme's tokens, so it follows Forest (and any other theme). */
/* Healthy and live states: a green readable on the page's own colours, day or night. */
/* Material 3 roles from the theme (web/material.css), with fallbacks for older themes. */
.console { --c-container: var(--container, var(--surface)); --c-on-container: var(--on-container, var(--text)); --c-tonal: var(--tonal, var(--raised)); --c-on-tonal: var(--on-tonal, var(--text)); --c-pill: var(--control-radius, var(--radius));
  display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: 0; min-height: calc(100vh - 5rem); }
.console-search-box { position: relative; }
.console-search { width: 100%; font-size: .9rem; }
.console-results { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + .3rem); max-height: min(24rem, 60vh); overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: .375rem; list-style: none; background: var(--raised); color: var(--text); border: 1px solid color-mix(in srgb, var(--line) 65%, transparent); border-radius: var(--radius-lg); box-shadow: var(--shadow-menu); }
.console-results a { display: grid; gap: .1rem; padding: .45rem .8rem; border-radius: max(calc(var(--radius-lg) - .375rem), 4px); text-decoration: none; }
.console-results a:hover, .console-results a:focus-visible { background: color-mix(in srgb, var(--text) 8%, transparent); outline-offset: -2px; }
.console-results li.muted { padding: .45rem .55rem; }
.console-main { min-width: 0; width: 100%; max-width: 78rem; padding: 2rem clamp(1.25rem, 3vw, 3rem) 3rem; }
.console-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.console-head h1 { margin: 0; font-size: var(--type-page); }
.console-head p { color: var(--muted); margin: .5rem 0 0; max-width: 52rem; }
.page-intro { max-width: 52rem; margin: 0 0 1.25rem; }

/* Settings most servers never change sit in an "Advanced" fold at the end of their panel. */
.advanced-fold { margin-top: .75rem; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.advanced-fold > summary { display: inline-flex; align-items: center; gap: .5rem; min-height: var(--control-h); margin-inline: -.5rem; padding: 0 .5rem; border-radius: var(--control-radius); cursor: pointer; font-weight: 500; font-size: var(--control-font); color: var(--muted); list-style: none; }
.advanced-fold > summary::-webkit-details-marker { display: none; }
.advanced-fold > summary::before { content: ""; width: .45em; height: .45em; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.advanced-fold[open] > summary::before { transform: rotate(45deg); }
.advanced-fold > summary:hover { color: var(--text); background: var(--hover); }
@media (prefers-reduced-motion: reduce) { .advanced-fold > summary::before { transition: none; } }
/* A switch sits beside its name, not across a wide page from it. */
:is(.console, .settings, dialog.modal) .setting-switch { max-width: 36rem; }
.setting-switch.compact { justify-content: flex-start; gap: .6rem; font-weight: 400; font-size: .875rem; }
.setting-switch.compact input { flex-basis: 2.75rem; width: 2.75rem; height: 1.75rem; }
.setting-switch.compact input::before { width: .85rem; height: .85rem; left: .3rem; top: .3rem; }
.setting-switch.compact input:checked::before { width: 1.25rem; height: 1.25rem; left: .1rem; top: .1rem; transform: translateX(1rem); }
.stack.tight { gap: .35rem; }
.group-title { margin: 1.5rem 0 .6rem; font-size: var(--type-overline); font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.console-body > .group-title:first-of-type { margin-top: .5rem; }

/* Panels */
.card-panel { margin: 0 0 1rem; padding: var(--panel-pad); background: var(--c-container); color: var(--c-on-container); border: 0; border-radius: var(--radius-lg); min-width: 0; }
.card-panel > h2, .panel-head h2 { margin: 0 0 .75rem; font-size: var(--type-section); line-height: 1.3; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.card-panel .setting:last-child { border-bottom: 0; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.dash-grid > .card-panel { margin: 0; }
.dash-grid > .span-2 { grid-column: 1 / -1; }
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.status-card { display: flex; gap: .8rem; padding: 1.25rem; background: var(--c-container); color: var(--c-on-container); border: 0; border-radius: var(--radius-lg); min-width: 0; }
.status-card h3 { margin: 0 0 .35rem; font-size: var(--type-sub); }
.status-card p { margin: 0 0 .3rem; overflow-wrap: anywhere; }

/* Status dots, pills and badges */
.dot { flex: 0 0 auto; width: .7rem; height: .7rem; margin-top: .35rem; border-radius: 50%; background: color-mix(in srgb, var(--muted) 45%, transparent); }
.ok > .dot { background: var(--ok-dot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok-dot) 22%, transparent); }
.warning > .dot { background: var(--warn); }
.error > .dot { background: var(--danger); }
.unknown > .dot { background: transparent; border: 2px solid var(--muted); }
.pill { border-color: var(--line); color: var(--muted); }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok-dot) 55%, transparent); }
.pill.warning { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.pill.error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.pill.busy { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.setting-meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .45rem; }
.set-badge { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--muted); font-weight: 500; }
.set-badge.env { color: var(--warn); }
.set-badge.pending { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--raised)); }
.set-badge.live { color: var(--ok); }
.set-badge.restart { background: transparent; padding-inline: 0; }
.warn-text { color: var(--warn); }
.text-link { font-size: .875rem; width: auto; }

/* Fields */
.console .setting { padding: .9rem 0; }
.console .setting input:not([type="checkbox"]):not([type="radio"]), .console .setting select { max-width: 30rem; }
.narrow-input { width: 8rem !important; max-width: 8rem !important; }
.narrow-input[type="time"] { width: 10rem !important; max-width: 10rem !important; }
.field.inline { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.field.inline > span { font-weight: 400; }
.has-error input, .has-error select { border-color: var(--danger) !important; }
.field-error { margin: .4rem 0 0; color: var(--danger); font-size: .88rem; }
.flash { animation: flash 1.6s ease-out 1; border-radius: var(--radius); }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 25%, transparent); } to { background: transparent; } }
.day-picks { display: flex; gap: .4rem; flex-wrap: wrap; }
/* Days are chips (material.css), each holding its checkbox. */
.day input { width: 1rem; height: 1rem; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: .8rem; }
.toolbar input[type="search"] { flex: 1 1 12rem; max-width: 24rem; }
/* Jumps to a long page's parts: a bar of links that stays at the top as the page scrolls. */
.page-tabs { position: sticky; top: 0; z-index: 3; display: flex; gap: 2px; flex-wrap: wrap; margin: 0 0 1rem; padding: 3px; background: var(--c-container); border-radius: var(--c-pill);
  box-shadow: 0 6px 16px -10px rgb(0 0 0 / .5); }
.page-tabs a { display: inline-flex; align-items: center; min-height: calc(var(--control-h) - 8px); padding: 0 1rem; border-radius: max(0px, calc(var(--c-pill) - 3px)); color: var(--text); text-decoration: none; font-size: var(--control-font); font-weight: 500; }
.page-tabs a:hover { background: var(--hover); }
.page-tabs a:focus-visible { outline-offset: -2px; }

/* The save bar */
.save-bar { position: sticky; bottom: .75rem; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin-top: 1rem; padding: .75rem .75rem .75rem 1.25rem; background: var(--raised); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--radius-lg); box-shadow: var(--shadow-menu); }
.save-bar[hidden] { display: none; }
.save-bar-text { display: grid; gap: .15rem; min-width: 0; }
.restart-callout { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.restart-callout[hidden] { display: none; }
.restart-callout p { margin: 0; }

/* Dashboard */
.health-list, .plain { list-style: none; margin: 0; padding: 0; }
.check-row { display: flex; align-items: flex-start; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-row > div { flex: 1; min-width: 0; }
.check-row p { margin: .15rem 0 0; color: var(--muted); overflow-wrap: anywhere; }
.check-link { color: inherit; text-decoration: none; }
.check-link:hover { text-decoration: underline; }
.plain > li { padding: .45rem 0; }
.plain > li + li { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.meter { margin-bottom: .8rem; }
.meter-head { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .3rem; font-size: .9rem; }
.meter-track { height: .45rem; background: var(--raised); border-radius: 999px; overflow: hidden; }
.meter-fill { height: 100%; background: var(--accent); border-radius: 999px; }
progress { width: 100%; height: .45rem; accent-color: var(--accent); }
.alert-ok { color: var(--ok); margin: 0; }

/* Tasks */
.task-list { display: grid; gap: .9rem; }
.task-card { padding: 1.25rem; border: 0; border-radius: var(--radius-lg); background: color-mix(in srgb, var(--raised) 55%, var(--c-container)); min-width: 0; }
.task-card.busy { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.task-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.task-head h3 { margin: 0 0 .25rem; font-size: var(--type-sub); }
.task-head p { margin: 0; max-width: 44rem; }
.task-status { display: flex; gap: .4rem; align-items: flex-start; flex-wrap: wrap; }
.task-live { margin: .7rem 0; }
.task-live p { margin: 0 0 .35rem; overflow-wrap: anywhere; }
.task-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .25rem 1rem; margin: .8rem 0; font-size: .9rem; }
.task-facts dt { color: var(--muted); }
.task-facts dd { margin: 0; overflow-wrap: anywhere; }
.task-card .actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.task-card .actions select { width: auto; max-width: 12rem; }
.task-schedule { flex-basis: 100%; }
.task-schedule > summary { list-style: none; }
.task-schedule > summary::-webkit-details-marker { display: none; }
.task-edit { display: grid; gap: .7rem; margin-top: .8rem; padding: .9rem; border: 1px dashed var(--line); border-radius: var(--radius); }
.run-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; max-height: 60vh; overflow-y: auto; }
.run-row { padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); }
.run-head { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.run-row p { margin: .35rem 0 0; overflow-wrap: anywhere; }
.failures li { margin: .25rem 0; overflow-wrap: anywhere; }

/* Channels (channel-builder.js): the list, then a channel's settings with its preview beside them. */
.channel-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.channel-row { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; padding: 1.1rem 1.25rem; border-radius: var(--radius-lg); background: var(--c-container); color: var(--c-on-container); }
.cr-text { flex: 1 1 18rem; min-width: 0; }
.cr-text h2 { margin: 0 0 .2rem; font-size: var(--type-sub); }
.cr-text h2 a { text-decoration: none; }
.cr-text p { margin: .15rem 0; overflow-wrap: anywhere; }
.cr-actions { align-items: center; }
.cb { display: grid; grid-template-columns: minmax(0, 1fr) minmax(20rem, 28rem); gap: 1.25rem; align-items: start; }
.cb-side { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
@media (max-width: 1100px) { .cb { grid-template-columns: minmax(0, 1fr); } .cb-side { position: static; max-height: none; } }
.cb-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .8rem 1rem; margin: .6rem 0; }
/* A long collection or playlist name mustn't push a phone sideways. */
.cb-fields select { max-width: 100%; }
.cr-actions .setting-switch { gap: .6rem; font-weight: 400; font-size: .875rem; }
.cb-form .card-panel > .setting-switch { margin-top: .8rem; }
.cb-wide { grid-column: 1 / -1; }
.cb-fields textarea { width: 100%; }
.cb-logo-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cb-logo-row .cb-fields { flex: 1 1 20rem; }
.cb-block, .cb-slot { min-width: 0; margin: 0 0 .9rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); }
.cb-block legend, .cb-slot legend { padding: 0 .4rem; font-weight: 600; }
.cb-block-foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }
.cb-content { margin: .4rem 0; }
.cb-content input[type="search"] { width: 100%; max-width: 26rem; }
.cb-chosen { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .4rem; }
.cb-chosen li { padding: .55rem .7rem; border-radius: var(--radius); background: var(--raised); }
.cb-chosen-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.cb-chosen .checks { margin-top: .4rem; }
.cb-hits, .cb-episodes { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.cb-choice { display: grid; gap: .3rem; margin: 0 0 .6rem; padding: 0; border: 0; }
.cb-choice legend { margin-bottom: .3rem; color: var(--muted); font-size: .9rem; }
.cb-access { margin-top: .6rem; }
.cb-access p { margin: .2rem 0; }
/* The preview: warnings first, then what would play as a list or a timeline, coloured by block. */
.cb-preview .panel-head { align-items: center; }
.cb-warnings { margin: .6rem 0; padding: .6rem .8rem .6rem 1.8rem; border-left: 4px solid var(--warn); border-radius: var(--radius); background: color-mix(in srgb, var(--warn) 10%, transparent); font-size: .88rem; }
.cb-warnings li + li { margin-top: .3rem; }
.cb-day h3, .cb-tl-day h3 { margin: .9rem 0 .35rem; font-size: .95rem; }
.cb-rows { list-style: none; margin: 0; padding: 0; }
.cb-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; padding: .3rem 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); font-size: .88rem; }
.cb-row.card, .cb-row.trailer { color: var(--muted); }
.cb-time { flex: none; min-width: 6.5rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cb-what { flex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere; }
.cb-tag { padding: 0 .5rem; border: 1px solid var(--cb, var(--line)); border-radius: var(--control-radius); font-size: .72rem; font-weight: 600; }
.cb-tag.early { color: var(--warn); border-color: var(--warn); }
.cb-c0 { --cb: #6fae98; } .cb-c1 { --cb: #c9954f; } .cb-c2 { --cb: #7c95cf; } .cb-c3 { --cb: #bd7dad; }
.cb-c4 { --cb: #a3b35a; } .cb-c5 { --cb: #d57b6f; } .cb-c6 { --cb: #5fb2c2; } .cb-c7 { --cb: #a88ad3; }
.cb-timeline { position: relative; padding-top: 1.2rem; }
.cb-ticks { position: absolute; top: 0; left: 0; right: 0; height: 1.1rem; color: var(--muted); font-size: .7rem; }
.cb-ticks span { position: absolute; }
.cb-tl-bar { position: relative; height: 1.6rem; border-radius: 6px; background: var(--raised); overflow: hidden; }
.cb-tl-prog { position: absolute; top: 0; bottom: 0; background: var(--cb, var(--line)); border-right: 1px solid var(--c-container); }
.cb-tl-prog.card { background: repeating-linear-gradient(45deg, transparent 0 4px, color-mix(in srgb, var(--muted) 30%, transparent) 4px 8px); }
.cb-tl-prog.trailer { background: color-mix(in srgb, var(--muted) 45%, transparent); }

/* Tables */
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
table.data td { padding: .6rem; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); vertical-align: top; overflow-wrap: anywhere; }
table.data .actions { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
/* A More menu in a table's last column opens leftwards, and isn't cut off by the table's box. */
.console .table-wrap:has(details.more) { overflow: visible; }
.console td details.more .more-menu { left: auto; right: 0; }
.console td details.more > summary { min-height: var(--control-h-sm); padding: 0 var(--control-pad-sm); font-size: var(--control-font-sm); }
.setting-switch.compact > span { white-space: nowrap; }
/* The chooser goes under its words where they don't fit side by side (a phone). */
.file-pick { cursor: pointer; flex-wrap: wrap; white-space: normal; max-width: 100%; }
.file-pick input { max-width: 12rem; }

/* Storage, people, libraries */
.usage { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.usage-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .3rem; }
.usage p { margin: .3rem 0 0; }
.cleanup-list { max-height: 14rem; overflow-y: auto; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .7rem; }
.role { display: grid; gap: .3rem; padding: 1rem; text-align: left; color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); border: 1px solid transparent; border-radius: var(--radius); cursor: pointer; font: inherit; }
.role:hover:not(:disabled) { border-color: var(--muted); background: color-mix(in srgb, var(--text) 8%, transparent); }
.role:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.role:disabled { opacity: .5; cursor: default; }
.devices > li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.devices p { margin: .2rem 0 0; overflow-wrap: anywhere; }
.lib-access { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }
.access > li { padding: .3rem 0; }
.person-link { margin-top: .4rem; }
.person-cell .pill { margin-left: .4rem; }
/* Libraries: each library's name opens its details. */
.lib-name { margin: 0 0 .2rem; font-size: var(--type-sub); }
.lib-name a { color: inherit; text-decoration: none; }
.lib-name a:hover { text-decoration: underline; }
.lib-name .pill { margin-left: .5rem; }
.lib-info .folders { display: block; margin-top: .4rem; max-height: none; }
.lib-info .folders span { display: block; overflow-wrap: anywhere; }
/* Device defaults: the three kinds side by side where they fit. */
.device-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.device-grid > .card-panel { margin: 0; display: grid; gap: .8rem; align-content: start; }
.device-grid > .card-panel > h2 { margin: 0; }
/* About this server */
.brand-logo { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand-logo img { max-width: 14rem; max-height: 4rem; object-fit: contain; }
.about-facts li { overflow-wrap: anywhere; }
/* Your settings: each part of a page under its own heading. */
/* Your settings: each part of a page is a panel, as the admin console's are, its parts a step apart. */
.settings-section { display: grid; gap: 1rem; align-content: start; margin: 0 0 1rem; padding: var(--panel-pad); background: var(--c-container, var(--container)); color: var(--c-on-container, var(--on-container)); border-radius: var(--radius-lg); min-width: 0; }
.settings-section > *, .settings-section > * > :first-child { margin-block-start: 0; }
.settings-section > * { margin-block-end: 0; }
.settings-section > h2 { font-size: var(--type-section); line-height: 1.3; }
.profile-line { margin: 0 0 1.5rem; }
.problem-list > li { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.problem-list > li > label { flex: 1 1 14rem; }
.problem-list > li.problem { display: grid; gap: .35rem; padding: .85rem 0; border-top: 1px solid var(--line); }
.problem-list > li.problem p { margin: 0; }
.problem-meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.log-tail { max-height: 16rem; overflow: auto; margin: .5rem 0 0; padding: .75rem 1rem; background: var(--bg); border-radius: var(--radius); font: .78rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.lib-processing { margin: .6rem 0; }
.lib-processing > summary { cursor: pointer; font-weight: 600; }
.guidance li { margin: .4rem 0; }
.codec-list li p { margin: .2rem 0 .4rem; }
.codec-row { display: grid; grid-template-columns: minmax(6rem, auto) 1fr; align-items: center; gap: .15rem .75rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.codec-row:first-child { border-top: 0; }
.codec-row .pill { justify-self: start; }
.codec-row p { grid-column: 1 / -1; }
.slot-list li { padding: .2rem 0; font-variant-numeric: tabular-nums; }
.budget-table { width: 100%; border-collapse: collapse; margin-top: .75rem; font-variant-numeric: tabular-nums; }
.budget-table caption { text-align: left; padding-bottom: .35rem; }
.budget-table th, .budget-table td { text-align: left; padding: .4rem .75rem .4rem 0; border-bottom: 1px solid var(--line); }
@media (max-width: 640px) { .budget-table th:nth-child(3), .budget-table td:nth-child(3) { display: none; } }
.why-list li p { margin: .25rem 0 0; }
/* Online services: a section for each kind of media that opens and closes, and a row for each
   service in it, which opens to its keys. The arrow points right while closed, down while open. */
.services { display: grid; gap: .75rem; }
.card-panel.svc-section { margin: 0; padding: 0; }
.svc-section > summary { display: flex; align-items: center; gap: .35rem .75rem; min-height: 3.5rem; padding: .6rem var(--panel-pad) .6rem calc(var(--panel-pad) - .5rem);
  border-radius: var(--radius-lg); cursor: pointer; list-style: none; }
.svc-section > summary::-webkit-details-marker { display: none; }
.svc-section > summary:hover { background: var(--hover); }
.svc-section > summary:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.svc-section[open] > summary { border-end-start-radius: 0; border-end-end-radius: 0; }
.svc-title { flex: 1 1 auto; display: flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .9rem; min-width: 0; }
.svc-title h2 { margin: 0; font-size: var(--type-section); line-height: 1.3; }
.svc-status { color: var(--muted); font-size: .875rem; }
.svc-flag:empty { display: none; }
.svc-body { padding: 0 var(--panel-pad) .6rem; }
.svc-chev { flex: none; display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; color: var(--muted); }
.svc-chev::before { content: ""; width: .45rem; height: .45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateX(-.1rem) rotate(-45deg); transition: transform var(--motion-fast) ease; }
.svc-section[open] > summary .svc-chev::before, .svc-toggle[aria-expanded="true"] .svc-chev::before { transform: translateY(-.1rem) rotate(45deg); }
.svc-chev.none::before { visibility: hidden; }
.svc-section > summary:hover .svc-chev, button.svc-toggle:hover .svc-chev { color: var(--text); }
.svc-row { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: var(--radius); }
.svc-row-head { display: flex; align-items: center; gap: .5rem 1rem; padding: .3rem 0; }
.svc-toggle { flex: 1 1 auto; display: flex; align-items: center; gap: .5rem; min-width: 0; min-height: 2.75rem; margin: 0 0 0 -.5rem; padding: .35rem .5rem;
  border: 0; border-radius: var(--control-radius); background: none; color: inherit; font: inherit; text-align: left; text-transform: none; letter-spacing: 0; }
button.svc-toggle { cursor: pointer; }
button.svc-toggle:hover { background: var(--hover); }
button.svc-toggle:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.svc-text { display: grid; gap: .05rem; min-width: 0; }
.svc-name { font-weight: 500; }
.svc-about { color: var(--muted); font-size: .875rem; }
.svc-meta { flex: none; display: flex; align-items: center; gap: .75rem; }
.svc-result { margin: -.2rem 0 .6rem 2rem; font-size: .875rem; overflow-wrap: anywhere; }
.svc-result:empty { display: none; }
.svc-result.ok { color: var(--ok); }
.svc-result.error { color: var(--danger); }
.svc-panel { padding: 0 0 .9rem 2rem; }
.svc-panel .setting:first-child { padding-top: .35rem; }
.svc-key { margin: .35rem 0 0; font-size: .875rem; }
.svc-key a { color: var(--accent); text-underline-offset: 3px; }
.svc-trakt > .actions { margin-top: .5rem; }
/* Unsaved changes in a row or a section, so closing it hides nothing. */
.changed-dot { flex: none; width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); }
.changed-dot[hidden] { display: none; }
.svc-row, .svc-section { scroll-margin-top: 1rem; }
@media (max-width: 960px) { .svc-row, .svc-section { scroll-margin-top: 5rem; } }
@media (max-width: 640px) {
  .svc-row-head { flex-wrap: wrap; row-gap: 0; }
  .svc-toggle { flex-basis: 100%; }
  .svc-meta { flex: 1 1 100%; padding-left: 2rem; }
  .svc-meta .svc-test { margin-left: auto; }
  .svc-panel { padding-left: 0; }
}
@media (pointer: coarse) {
  .svc-meta .svc-test { min-height: 2.75rem; min-width: 4.5rem; }
  .svc-key a { display: inline-flex; align-items: center; min-height: 2.75rem; }
  /* Remove and Use default beside a setting, big enough for a finger. */
  .console .setting :is(.control-row, .setting-meta) > .text-link { display: inline-flex; align-items: center; min-height: 2.75rem; }
}
@media (prefers-reduced-motion: reduce) { .svc-chev::before { transition: none; } }
.logview { max-height: 60vh; }

.console-main > .settings-mobile-context { display: none; }
@media (max-width: 960px) {
  .console { grid-template-columns: 1fr; }
  .console-nav { display: none; }
  .console-main { padding: 1.5rem var(--gutter) 2.5rem; }
  .console-main > .settings-mobile-context { display: flex; gap: .5rem; margin-bottom: 1rem; }
  .console-main > .settings-mobile-context a { flex: 1; }
  .console .settings-select { display: block; width: 100%; margin-bottom: 1rem; }
  .dash-grid { grid-template-columns: 1fr; }
}
/* Wide tables become a list of cards where they'd otherwise scroll sideways: People sooner, as
   its cells hold controls. Each cell says which column it was. */
@media (max-width: 1100px) {
  table.people-table thead { display: none; }
  table.people-table tr { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .6rem 1.25rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
  table.people-table td { border: 0; padding: 0; }
  table.people-table td:first-child, table.people-table td:last-child { grid-column: 1 / -1; }
  table.people-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: .25rem; font-size: .75rem; font-weight: 600; color: var(--muted); }
  table.people-table td:first-child::before { display: none; }
}
@media (max-width: 800px) {
  table.backup-table thead { display: none; }
  table.backup-table tr { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
  table.backup-table td { border: 0; padding: 0; }
  table.backup-table td:first-child, table.backup-table td:last-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .card-panel { padding: .9rem; }
  .console-head h1 { font-size: 1.45rem; }
  .task-facts { grid-template-columns: 1fr; }
  .task-facts dt { margin-top: .3rem; }
  table.data thead { display: none; }
  table.data tr { display: grid; padding: .5rem 0; border-bottom: 1px solid var(--line); }
  table.data td { border: 0; padding: .2rem 0; }
  table.data td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; color: var(--muted); }
  table.people-table td[data-label]:not(:first-child)::before { content: attr(data-label); }
  .save-bar { bottom: .4rem; }
  .console td details.more .more-menu { left: 0; right: auto; }
}
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } }

.folder-map > li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.folder-map select { min-width: min(16rem, 100%); }
.contact-days { width: 100%; max-width: 30rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.contact-days th, .contact-days td { text-align: left; padding: .4rem .75rem .4rem 0; border-bottom: 1px solid var(--line); }
/* The HTTPS certificate on Remote access: a choice, its fields, and what Let's Encrypt is doing */
.https-choices { margin: .75rem 0 .5rem; }
.https-panel > .callout { margin: .9rem 0 0; }
.https-panel > .actions { margin-top: 1rem; }
.https-progress { margin-top: 1rem; }
.https-progress:empty { display: none; }
.https-progress > .callout { margin-bottom: .75rem; }
.https-progress details { margin-top: .5rem; }
.https-progress summary { cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem 1.25rem; margin: 1rem 0; }
.form-grid .field > .help { font-weight: 400; }
.offsite-list li { padding: .35rem 0; border-top: 1px solid var(--line); }
.role-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .6rem 0; border-top: 1px solid var(--line); }
/* ---------- The admin console and Your settings ----------
   On wide screens the header stays put, and the menu and the page each scroll on their own:
   neither pulls the other along. With a mouse each has a thin scrollbar (below). The menu fades
   at an edge while there's more of it that way (util.js scrollFades). Narrow screens keep one
   page that scrolls, with a list of sections instead of the menu. */
.shell-nav { flex-direction: column; min-height: 0; background: var(--surface); }
.shell-nav-head { flex: none; display: grid; gap: .75rem; padding: 1rem .75rem .75rem; }
.shell-nav-head:empty { padding: .5rem 0 0; }
.shell-nav-list { flex: 1 1 auto; min-height: 0; padding: .25rem .75rem 2rem; }
.shell-nav .settings-group { margin: 0 0 .9rem; }
.shell-nav .settings-group-title { margin: 0; padding: .6rem .9rem .35rem; font-size: .6875rem; line-height: 1rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.shell-nav-list a { display: flex; align-items: center; min-height: 2.5rem; padding: .45rem .9rem; margin: 1px 0; border-radius: var(--c-pill, var(--control-radius)); color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 400; line-height: 1.35;
  transition: background-color .12s ease, color .12s ease; }
.shell-nav-list a:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.shell-nav-list a[aria-current="page"] { background: var(--tonal); color: var(--on-tonal); font-weight: 500; }
/* Inside a scroller an outset ring would be clipped. */
.shell-nav-list a:focus-visible { outline-offset: -2px; }
/* Admin / Your settings: one segmented control, each half on one line. */
.shell-nav .settings-context { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.shell-nav .settings-context a { min-height: calc(var(--control-h-sm) - 6px); padding: 0 .5rem; font-size: var(--control-font-sm); }

/* Scrollers without scrollbars, which keep their scrolling to themselves. */
.shell-nav-list, .console-main, .settings-main, .console-results, .account-links, .top.compact-nav .nav, .more-menu, dialog.modal, .run-list, .cleanup-list {
  scrollbar-width: none; overscroll-behavior: contain; }
:is(.shell-nav-list, .console-main, .settings-main, .console-results, .account-links, .top.compact-nav .nav, .more-menu, dialog.modal, .run-list, .cleanup-list)::-webkit-scrollbar { display: none; }
/* Long logs keep a slim bar, shown while the pointer is over them. */
.log-tail, .logview { scrollbar-width: thin; scrollbar-color: transparent transparent; overscroll-behavior: contain; }
.log-tail:hover, .logview:hover { scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
/* In the admin console and Your settings, long pages show a thin scrollbar in the theme's colours
   on computers with a mouse, so they don't look cut off (web #34). Touch screens scroll without
   one, as before. A standard scrollbar-width wins over the -webkit- rules above in Chromium and
   Firefox; Safari gets the -webkit- look below. */
@media (hover: hover) and (pointer: fine) {
  :is(.console-main, .settings-main, .shell-nav-list, .console-results, .run-list, .cleanup-list),
  html:has(#page > :is(.console, .settings)), body:has(#page > :is(.console, .settings)) dialog.modal {
    scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 50%, transparent) transparent; }
  :is(.console-main, .settings-main, .shell-nav-list, .console-results, .run-list, .cleanup-list)::-webkit-scrollbar,
  html:has(#page > :is(.console, .settings))::-webkit-scrollbar, body:has(#page > :is(.console, .settings)) dialog.modal::-webkit-scrollbar { display: block; width: 10px; height: 10px; }
  :is(.console-main, .settings-main, .shell-nav-list, .console-results, .run-list, .cleanup-list)::-webkit-scrollbar-thumb,
  html:has(#page > :is(.console, .settings))::-webkit-scrollbar-thumb, body:has(#page > :is(.console, .settings)) dialog.modal::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--muted) 50%, transparent); background-clip: content-box; border: 3px solid transparent; border-radius: 999px; }
  :is(.console-main, .settings-main, .shell-nav-list, .console-results, .run-list, .cleanup-list)::-webkit-scrollbar-track { background: transparent; }
}
.scroll-fade.more-below { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 2.5rem), transparent); }
.scroll-fade.more-above { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 2rem); mask-image: linear-gradient(to bottom, transparent, #000 2rem); }
.scroll-fade.more-above.more-below { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 2rem, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to bottom, transparent, #000 2rem, #000 calc(100% - 2.5rem), transparent); }
/* Menus that can be long stop short of the screen's edge. */
.top.compact-nav .nav, .account-links { max-height: calc(100dvh - 6rem); overflow-y: auto; }

@media (min-width: 961px) {
  body:has(#page > .console) { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  body:has(#page > .console) > #page { flex: 1 1 auto; min-height: 0; padding: 0; }
  .console { height: 100%; min-height: 0; }
  .console-nav { display: flex; height: 100%; }
  .console .shell-nav-list { overflow-y: auto; }
  .console-main { max-width: none; height: 100%; overflow-y: auto; padding-block: 0; }
  .console-main > * { max-width: 72rem; }
  /* Space above and below comes from spacers, not padding: sticky tabs and the save bar stick to
     a scroller's padding edge, so padding would leave a band of page showing past them. */
  .console-main::before { content: ""; display: block; height: 2rem; }
  .console-main::after { content: ""; display: block; height: 3rem; }
}
@media (min-width: 801px) {
  body:has(#page > .settings) { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  body:has(#page > .settings) > #page { flex: 1 1 auto; min-height: 0; padding: 0; }
  .settings { height: 100%; min-height: 0; }
  .settings-nav { display: flex; height: 100%; align-self: stretch; overflow: visible; }
  .settings .shell-nav-list { overflow-y: auto; }
  .settings-main { max-width: none; height: 100%; overflow-y: auto; padding-block: 0; }
  .settings-main > * { max-width: 72rem; }
  .settings-main::before, .settings-main::after { content: ""; display: block; height: 2rem; }
}
/* Menus (the account menu, the compact library menu, More) are in material.css. */

/* The header lifts once the page scrolls under it. */
body:has(.console-main.scrolled, .settings-main.scrolled) #top { box-shadow: 0 1px 0 var(--line), 0 8px 20px color-mix(in srgb, #000 22%, transparent); }
#top { transition: box-shadow .2s ease; }
@media (prefers-reduced-motion: reduce) { #top, .shell-nav-list a { transition: none; } }

.theme-admin-list li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .25rem 1rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.theme-admin-list li:first-child { border-top: 0; }
.theme-admin-list li p { grid-column: 1 / -1; margin: 0; }
@media (max-width: 640px) { .theme-admin-list li { grid-template-columns: 1fr; } }

/* Games: a console's picture on Settings, Games. (Its tile on the games page is in style.css.) */
.console-picture { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: .6rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.console-picture img { width: 6rem; height: 3.5rem; object-fit: contain; }
.console-picture > span.muted { flex: 1 1 12rem; }
/* A photo from Wikipedia's credit under it, and the Screen settings each console starts with. */
.console-picture .photo-credit a { color: inherit; text-underline-offset: 2px; }
.game-screen { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem 1rem; margin-top: .6rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.game-screen > span.muted { align-self: center; }
.game-screen-field { display: grid; gap: .2rem; font-size: .8rem; color: var(--muted); }

/* Fix match (match.js): search any source, results with their source, then a preview. */
.match-search { display: flex; flex-wrap: wrap; gap: .5rem; }
.match-search input[type="search"] { flex: 1 1 14rem; min-width: 0; }
.match-search .match-year { width: 6.5rem; }
.match-body { min-height: 12rem; }
.match-hits { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; max-height: min(60vh, 34rem); overflow-y: auto; }
.match-hit { display: grid; grid-template-columns: 3.25rem 1fr; gap: .75rem; align-items: start; width: 100%; padding: .45rem; text-align: left;
  background: none; border: 1px solid transparent; border-radius: var(--radius); color: inherit; font: inherit; cursor: pointer; }
.match-hit:hover, .match-hit:focus-visible { border-color: var(--line); background: var(--raised); }
.match-hit img, .match-noart { width: 3.25rem; aspect-ratio: 2 / 3; object-fit: cover; border-radius: calc(var(--radius) * .6); background: var(--surface); }
.match-text { display: grid; gap: .2rem; min-width: 0; }
.match-name .pill { margin-left: .35rem; font-size: .75rem; vertical-align: middle; }
.match-plot { color: var(--muted); font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.match-preview { display: grid; grid-template-columns: 9rem 1fr; gap: 1.25rem; align-items: start; }
.match-preview h3 { margin: 0; }
.match-poster { width: 100%; border-radius: var(--radius); background: var(--surface); }
span.match-poster { display: block; aspect-ratio: 2 / 3; }
.match-overview { margin: 0; max-height: 9rem; overflow-y: auto; }
@media (max-width: 560px) { .match-preview { grid-template-columns: 1fr; } .match-poster { width: 8rem; } }

/* A title's ids and where its details came from, under its details (admins). */
.title-sources { margin: .5rem 0 0; font-size: .85rem; }
.title-sources p { margin: .15rem 0; }
.title-sources a { color: inherit; text-underline-offset: 2px; }

/* A library's sources, in the order they're tried: a fold with the ones in use on its line (its
   arrow is Online services' .svc-chev), and a row for each inside, what it knows under its name. */
.source-fold > summary { display: flex; align-items: center; gap: .5rem; min-height: 2.75rem; margin: 0 -.5rem; padding: .35rem .5rem; border-radius: var(--control-radius); cursor: pointer; list-style: none; }
.source-fold > summary::-webkit-details-marker { display: none; }
.source-fold > summary:hover { background: var(--hover); }
.source-fold > summary:hover .svc-chev { color: var(--text); }
.source-fold > summary:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.source-fold[open] > summary .svc-chev::before { transform: translateY(-.1rem) rotate(45deg); }
.source-fold-text { display: grid; gap: .05rem; min-width: 0; }
.source-fold-label { font-size: .875rem; font-weight: 500; }
.source-fold-now { color: var(--muted); font-size: .8125rem; }
.source-fold[open] .source-fold-now { display: none; }
.source-fold > .help { margin: .35rem 0 0; }
.source-order { list-style: none; margin: .25rem 0 0; padding: 0; display: grid; }
.source-order li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .3rem 0; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.source-order li:first-child { border-top: 0; }
.source-order label.check { align-items: center; min-width: 0; }
.source-order label.check input { margin-top: 0; }
.source-name { display: grid; min-width: 0; }
.source-name small { color: var(--muted); font-size: .8125rem; }
.source-needs { color: var(--warn); }
.source-moves { display: inline-flex; gap: .25rem; }
@media (pointer: coarse) {
  .source-order label.check { min-height: 2.75rem; }
  .source-moves .ghost.small { min-width: 2.75rem; min-height: 2.75rem; }
}

/* Live TV beyond the server's own channels (tv-admin.js): which page, the current one marked. */
.live-admin-tabs a[aria-current="page"] { background: var(--tonal); color: var(--on-tonal); }
.tv-sources { display: grid; gap: .8rem; }
.tv-source .panel-head { align-items: flex-start; }
.tv-source .panel-head h2 { margin: 0; }
.tv-channels { margin-top: .6rem; }
.tv-channel-table td { vertical-align: middle; }
.tv-channel-table input:not([type="checkbox"]) { width: 100%; min-width: 6rem; }
.tv-channel-table .narrow-input { min-width: 4.5rem; max-width: 6rem; }
.tv-logo { display: block; max-width: 4rem; max-height: 1.8rem; object-fit: contain; }
.tv-rules > li, .tv-links > li, .tv-found-list > li { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; }
.tv-rules p, .tv-links p { margin: .15rem 0 0; }
.tv-rec-table td { vertical-align: top; }
.tv-rec-table td p { margin: .2rem 0 0; }
.tv-address input { flex: 1; min-width: 0; font-family: var(--font-mono, monospace); font-size: .85rem; }

/* Invites (join-admin.js): the two ways in side by side where they fit, then who's waiting. */
.join-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 1rem; margin: 0 0 1rem; }
.join-ways > .card-panel { margin: 0; }
.join-way[data-field="ask"] > .stack { gap: .6rem; }
.join-way[data-field="ask"] > .stack > p { margin: 0; }
.join-list > li { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem 1rem; flex-wrap: wrap; padding: .9rem 0; border-top: 1px solid var(--line); }
.join-list > li:first-child { border-top: 0; padding-top: .25rem; }
.join-who { flex: 1 1 18rem; min-width: 0; }
.join-who p { margin: 0 0 .2rem; overflow-wrap: anywhere; }
.join-name { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
/* What they wrote, as they wrote it: their own line breaks, in a quiet quote. */
.join-message { margin: .5rem 0 0; padding: .45rem .8rem; border-left: 3px solid var(--line); color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
.join-request > .actions { flex: none; }
.join-note p { margin: 0; }

/* ---------- Live TV: a channel's Timetable (channel-timetable.js) ----------
   The week as a calendar: days across, times down, tiles in each block's colour. Empty time is
   hatched, or tinted where something plays between slots or round the clock; what the preview
   says airs there sits over it faintly, the Starting soon card and overruns as warnings. */
.cb-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cb-kept .callout { display: flex; align-items: center; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cb-tt { margin-bottom: 1rem; }
.cb-tt-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr)); gap: 0 1rem; align-items: start; }
.tt { --tt-line: color-mix(in srgb, var(--line) 60%, transparent); --tt-soft: color-mix(in srgb, var(--line) 28%, transparent); --tt-gutter: 3.25rem; position: relative; }
.tt-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.tt-empty-btn { min-width: 0; max-width: 100%; }
.tt-empty-sum { min-width: 0; overflow: hidden; color: color-mix(in srgb, currentColor 70%, transparent); font-weight: 400; text-overflow: ellipsis; }
.tt-warn { font-size: var(--control-font-sm); }
.tt-warn > summary { display: inline-flex; align-items: center; min-height: var(--control-h-sm); padding: 0 .6rem; border-radius: var(--control-radius); color: var(--warn); font-weight: 600; cursor: pointer; }
.tt-warn > summary:hover { background: var(--hover); }
.tt-warn[open] { flex-basis: 100%; }
.tt-warn .cb-warnings { margin: .35rem 0 0; }
.tt-problem { flex-basis: 100%; margin: 0; }
.tt-main { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 21.5rem; gap: 1rem; align-items: start; }
.tt-drawer .tt-main { grid-template-columns: minmax(0, 1fr); }
.tt-cal { position: relative; min-width: 0; overflow: hidden; border-radius: var(--radius-lg); background: var(--c-container); color: var(--c-on-container); }
.tt-scroll { height: min(72vh, 48rem); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
.tt-head, .tt-body { display: grid; grid-template-columns: var(--tt-gutter) repeat(7, minmax(5.25rem, 1fr)); min-width: max-content; }
.tt-head { position: sticky; top: 0; z-index: 6; background: var(--c-container); box-shadow: 0 1px 0 var(--tt-line); }
.tt-corner { position: sticky; left: 0; z-index: 1; background: var(--c-container); }
.tt-dayhead { display: flex; align-items: center; justify-content: space-between; gap: .2rem; min-width: 0; min-height: 2.75rem; padding: 0 .15rem 0 .6rem; border-left: 1px solid var(--tt-soft); font-size: .8125rem; font-weight: 600; }
.tt-dayname { white-space: nowrap; }
.tt-long { display: none; }
@media (min-width: 1680px) { .tt-docked .tt-long { display: inline; } .tt-docked .tt-short { display: none; } }
.tt-dayhead.today .tt-dayname { color: var(--accent); }
.tt-dayhead.today .tt-dayname::after { content: ""; display: inline-block; width: .4rem; height: .4rem; margin-left: .35rem; border-radius: 50%; background: var(--accent); vertical-align: .1em; }
.tt-daymenu > summary.icon-button { width: 2rem; height: 2rem; color: var(--muted); }
.tt-daymenu > summary.icon-button:hover { color: var(--text); }
.tt-daymenu .more-menu, .tt-itemmenu .more-menu { left: auto; right: 0; }
.tt .more.up > .more-menu { top: auto; bottom: calc(100% + .375rem); }
.tt-empty-btn > strong { white-space: nowrap; }
.tt-daymenu > summary svg, .tt-itemmenu > summary svg { width: 1.1rem; height: 1.1rem; fill: currentColor; }
.tt-times { position: sticky; left: 0; z-index: 5; background: var(--c-container); }
.tt-times span { position: absolute; right: .45rem; transform: translateY(-50%); color: var(--muted); font-size: .6875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tt-col { position: relative; min-width: 0; border-left: 1px solid var(--tt-soft); container-type: inline-size;
  background-image: linear-gradient(to bottom, var(--tt-line) 1px, transparent 1px), linear-gradient(to bottom, var(--tt-soft) 1px, transparent 1px);
  background-size: 100% var(--tt-hour), 100% calc(var(--tt-hour) / 2); }
.tt-col.today { background-color: color-mix(in srgb, var(--accent) 4%, transparent); }
.tt-cal.placing .tt-col { cursor: copy; }
/* Empty time: hatched with nothing set, tinted where blocks play between slots or round the clock. */
.tt-empty { position: absolute; left: 0; right: 0; cursor: cell; background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--muted) 9%, transparent) 7px 8px); }
.tt-empty.between { background: color-mix(in srgb, var(--muted) 5%, transparent); }
.tt-empty.round { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.tt-empty:hover { background-color: color-mix(in srgb, var(--text) 5%, transparent); }
.tt-empty-label { position: sticky; top: 2.9rem; display: block; padding: .3rem .45rem; overflow: hidden; color: var(--muted); font-size: .6875rem; white-space: nowrap; text-overflow: ellipsis; pointer-events: none; }
.tt-ghost-prog { position: absolute; left: 4px; right: 4px; z-index: 1; overflow: hidden; border-left: 2px solid color-mix(in srgb, var(--cb, var(--muted)) 65%, transparent); background: color-mix(in srgb, var(--cb, var(--muted)) 7%, transparent);
  box-shadow: inset 0 -1px 0 var(--c-container); pointer-events: none; }
.tt-ghost-prog.now { background: color-mix(in srgb, var(--cb, var(--muted)) 16%, transparent); }
.tt-ghost-prog span { display: block; padding: 0 .35rem; overflow: hidden; color: var(--muted); font-size: .6875rem; line-height: 14px; white-space: nowrap; text-overflow: ellipsis; }
.tt-gap { position: absolute; left: 4px; right: 4px; z-index: 1; overflow: hidden; border-radius: 4px; pointer-events: none; }
.tt-gap.card { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--warn) 24%, transparent) 0 6px, color-mix(in srgb, var(--warn) 9%, transparent) 6px 12px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 50%, transparent); }
.tt-gap.trailer { background: color-mix(in srgb, var(--muted) 13%, transparent); }
.tt-gap span { display: block; padding: .15rem .4rem; overflow: hidden; color: var(--warn); font-size: .6875rem; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.tt-gap.trailer span { color: var(--muted); font-weight: 500; }
/* Tiles. */
.tt-tile { position: absolute; left: 3px; right: 3px; z-index: 2; box-sizing: border-box; display: flex; align-items: flex-start; gap: .4rem; padding: .3rem .4rem; overflow: hidden;
  border-left: 3px solid var(--cb); border-radius: 6px; background: color-mix(in srgb, var(--cb) 26%, var(--c-container)); color: var(--c-on-container);
  box-shadow: 0 1px 2px rgb(0 0 0 / .18); cursor: grab; touch-action: pan-x pan-y; user-select: none; -webkit-user-select: none; transition: box-shadow var(--motion-fast) ease; }
.tt-tile:hover { box-shadow: 0 3px 10px rgb(0 0 0 / .28); }
.tt-tile:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.tt-tile.selected { z-index: 3; box-shadow: 0 0 0 2px var(--cb), 0 8px 20px rgb(0 0 0 / .32); touch-action: none; }
.tt-tile.cont-up { border-top-left-radius: 0; border-top-right-radius: 0; }
.tt-tile.cont-down { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.tt-tile.estimated:not(.cont-down) { border-bottom: 1px dashed color-mix(in srgb, var(--cb) 80%, var(--text)); }
.tt-tile.clash { left: 50%; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--danger) 20%, var(--c-container)) 0 6px, var(--c-container) 6px 12px); border-left-color: var(--danger); cursor: pointer; }
.tt-tile.lifted { opacity: .3; }
.tt-tile.ghost { z-index: 7; opacity: .94; box-shadow: 0 10px 26px rgb(0 0 0 / .4); pointer-events: none; }
.tt-tile.short { align-items: center; padding-block: 0; }
.tt-tile.short .tt-tile-text { display: flex; align-items: baseline; gap: .35rem; }
.tt-tile.short .tt-tile-name { -webkit-line-clamp: 1; }
/* Too short for words: the time goes, and a warning is a dot (its words are in the tile's label). */
.tt-tile.short .tt-tile-time { display: none; }
.tt-tile.short .tt-badge { flex: none; width: .5rem; height: .5rem; margin: 0; padding: 0; font-size: 0; }
.tt-tile-art { position: absolute; top: 0; right: 0; width: 60%; height: 100%; max-height: 7.5rem; object-fit: cover; object-position: center top; opacity: .55; pointer-events: none;
  -webkit-mask-image: linear-gradient(to left, rgb(0 0 0 / .95), transparent); mask-image: linear-gradient(to left, rgb(0 0 0 / .95), transparent); }
.tt-tile-text { position: relative; display: grid; gap: 1px; min-width: 0; }
.tt-tile-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: .75rem; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.tt-tile-time { overflow: hidden; color: color-mix(in srgb, currentColor 72%, transparent); font-size: .6875rem; font-variant-numeric: tabular-nums; white-space: nowrap; text-overflow: ellipsis; }
.tt-badge { justify-self: start; width: fit-content; max-width: 100%; margin-top: 2px; padding: 0 .4rem; overflow: hidden; border-radius: 999px; background: var(--warn); color: var(--bg); font-size: .625rem; font-weight: 700; line-height: 1.55; white-space: nowrap; text-overflow: ellipsis; }
.tt-badge.over, .tt-badge.none { background: var(--danger); }
.tt-badge.early { background: var(--muted); }
.tt-badge.card { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--text); }
.tt-grab { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; touch-action: none; }
.tt-grab::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 1.5rem; height: 3px; margin-left: -.75rem; border-radius: 2px; background: color-mix(in srgb, currentColor 50%, transparent); opacity: 0; transition: opacity var(--motion-fast) ease; }
.tt-tile:hover .tt-grab::after, .tt-tile.selected .tt-grab::after { opacity: 1; }
@media (pointer: coarse) {
  .tt-tile:not(.selected) .tt-grab { display: none; }
  .tt-tile.selected .tt-grab { height: 20px; }
  .tt-tile.selected .tt-grab::after { bottom: 6px; width: 2.25rem; height: 5px; margin-left: -1.125rem; border-radius: 3px; }
}
.tt-over { position: absolute; left: 3px; right: 3px; z-index: 2; overflow: hidden; border-radius: 0 0 6px 6px; pointer-events: none;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--danger) 32%, transparent) 0 5px, color-mix(in srgb, var(--danger) 12%, transparent) 5px 10px); }
.tt-over span { display: block; padding: 0 .4rem; color: var(--danger); font-size: .625rem; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.tt-target { position: absolute; left: 3px; right: 3px; z-index: 3; box-sizing: border-box; overflow: hidden; border: 2px dashed var(--accent); border-radius: 6px; background: color-mix(in srgb, var(--accent) 12%, transparent); pointer-events: none; }
.tt-target span { display: block; padding: .15rem .4rem; font-size: .6875rem; font-weight: 600; white-space: nowrap; }
.tt-now { position: absolute; left: -1px; right: 0; z-index: 4; height: 2px; background: var(--accent); pointer-events: none; }
.tt-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.tt-placing { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .4rem .5rem .4rem .9rem; background: var(--tonal); color: var(--on-tonal); font-size: .875rem; font-weight: 500; }
.tt-art { display: inline-grid; place-items: center; flex: none; width: 2rem; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 4px; background: color-mix(in srgb, var(--cb, var(--muted)) 35%, var(--c-container)); color: var(--c-on-container); font-size: .75rem; font-weight: 700; }
.tt-art img { width: 100%; height: 100%; object-fit: cover; }
.tt-art.tt-icon { aspect-ratio: 1; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.tt-icon svg { width: 1.2rem; height: 1.2rem; }
/* The panel: adding, or the tile being edited. Beside the grid on a wide screen, a drawer over it otherwise. */
.tt-panel { position: sticky; top: 1rem; box-sizing: border-box; max-height: min(72vh, 48rem); overflow-y: auto; overscroll-behavior: contain; padding: 1rem; border-radius: var(--radius-lg); background: var(--c-container); color: var(--c-on-container); scrollbar-width: thin; }
.tt-panel.drawer { position: absolute; z-index: 8; top: 0; right: 0; bottom: 0; width: min(23rem, calc(100% - 1.5rem)); max-height: none; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); background: var(--raised); box-shadow: var(--shadow-menu); }
.tt-dragging .tt-panel.drawer { opacity: 0; pointer-events: none; transition: opacity var(--motion-fast) ease; }
.tt-dragging, .tt-dragging * { cursor: grabbing !important; }
.tt-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.tt-panel-head h2, .tt-edit-title h2 { margin: 0; font-size: var(--type-sub); line-height: 1.3; }
.tt-panel-head p, .tt-edit-title p { margin: .15rem 0 0; }
.tt-add input[type="search"] { width: 100%; }
.tt-group h3 { margin: .9rem 0 .25rem; color: var(--muted); font-size: var(--type-overline); font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.tt-item { display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 2.75rem; margin: 0; padding: .3rem .45rem; border: 0; border-radius: var(--radius); background: transparent; color: inherit; font: inherit; text-align: left; cursor: grab; user-select: none; -webkit-user-select: none; }
.tt-item:hover { background: var(--hover); }
.tt-item:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.tt-item.pending { background: var(--tonal); color: var(--on-tonal); }
.tt-item-text { display: grid; flex: 1; min-width: 0; }
.tt-item-name { overflow: hidden; font-size: .875rem; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.tt-item-sub { overflow: hidden; color: var(--muted); font-size: .75rem; white-space: nowrap; text-overflow: ellipsis; }
.tt-item.pending .tt-item-sub { color: inherit; }
.tt-grip { flex: none; align-self: stretch; box-sizing: border-box; width: 1.75rem; margin-right: -.2rem; padding: .55rem .35rem; border-radius: var(--radius); touch-action: none; cursor: grab; opacity: .45;
  background: radial-gradient(circle, currentColor 1.3px, transparent 1.8px) center / 6px 6px content-box; }
@media (pointer: fine) { .tt-grip { display: none; } }
.tt-tip { margin: 1rem 0 0; }
.tt-edit-head { display: flex; align-items: flex-start; gap: .7rem; margin-bottom: .6rem; }
.tt-edit-head .tt-art { width: 2.75rem; }
.tt-edit-title { flex: 1; min-width: 0; }
.tt-edit-sec { padding: .8rem 0; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.tt-edit-sec h3 { margin: 0 0 .5rem; font-size: .8125rem; font-weight: 600; }
.tt-edit .cb-fields { grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); margin: .4rem 0; }
.tt-edit .cb-content input[type="search"] { max-width: none; }
.tt-edit .field + .field, .tt-edit .cb-content + .field { margin-top: .6rem; }
.tt-seg { display: flex; width: 100%; }
.tt-seg > button { flex: 1; min-height: calc(var(--control-h-sm) - 6px); padding: 0 .5rem; font-size: var(--control-font-sm); }
.tt-repeats { display: flex; flex-wrap: wrap; gap: .35rem; }
.tt-edit .day-picks, .tt-dialog .day-picks { gap: .3rem; margin-top: .5rem; }
.tt-edit .day-picks .day, .tt-dialog .day-picks .day { padding: 0 .6rem; }
.tt-overrun { display: grid; gap: .45rem; margin: 0; padding: 0; border: 0; }
.tt-overrun legend { margin-bottom: .5rem; font-size: .8125rem; font-weight: 600; }
.tt-probs { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 .5rem; padding: 0; list-style: none; }
.tt-probs li { padding: .05rem .55rem; border-radius: 999px; background: color-mix(in srgb, var(--warn) 20%, transparent); font-size: .75rem; font-weight: 600; }
.tt-probs li.over, .tt-probs li.none { background: color-mix(in srgb, var(--danger) 20%, transparent); }
.tt-airs { display: grid; gap: .25rem; margin: .35rem 0 0; padding: 0; font-size: .8125rem; list-style: none; }
.tt-airs li { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: .5rem; }
.tt-airs-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.tt-week > p { margin: 0; }
.tt-edit-actions { flex-wrap: wrap; padding-top: .8rem; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
/* What a tile plays this week, when it's pointed at. */
.tt-pop { position: fixed; z-index: 40; box-sizing: border-box; width: 19rem; max-width: calc(100vw - 1rem); max-height: 60vh; overflow: hidden; padding: .75rem .9rem; border: 1px solid color-mix(in srgb, var(--line) 65%, transparent); border-radius: var(--radius-lg);
  background: var(--raised); color: var(--text); box-shadow: var(--shadow-menu); font-size: .8125rem; pointer-events: none; }
.tt-pop[hidden] { display: none; }
.tt-pop p { margin: .1rem 0 .45rem; }
.more-menu.tt-ask { position: fixed; z-index: 50; min-width: 12rem; }
.tt-dragchip { position: fixed; z-index: 60; display: flex; align-items: center; gap: .5rem; padding: .3rem .75rem .3rem .3rem; border-radius: var(--control-radius); background: var(--raised); color: var(--text); box-shadow: var(--shadow-menu); font-size: .8125rem; font-weight: 600; pointer-events: none; }
.tt-dragchip .tt-art { width: 1.5rem; }
dialog.modal.tt-dialog { width: min(28rem, calc(100vw - 2rem)); }
.tt-choices { display: grid; gap: 2px; max-height: 55vh; overflow-y: auto; margin-top: .5rem; }
.tt-choice { justify-content: flex-start; width: 100%; background: transparent; text-transform: none; letter-spacing: 0; white-space: normal; text-align: left; }
.tt-choice:hover { background: var(--hover); }
.tt-dialog input[type="search"] { width: 100%; }
/* A phone: one day at a time. */
.tt-phone .tt-bar > .tt-empty-btn { flex: 1 1 100%; order: 3; justify-content: flex-start; min-height: 2.75rem; padding-block: .35rem; white-space: normal; text-align: left; }
.tt-phone .tt-empty-sum { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tt-days { display: flex; gap: .3rem; margin: 0 0 .5rem; overflow-x: auto; scrollbar-width: none; }
.tt-days::-webkit-scrollbar { display: none; }
.tt-days .chip-tab { position: relative; flex: 1 0 auto; min-width: 2.75rem; padding: 0 .55rem; }
.tt-dot { position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.tt-dayactions { flex-wrap: wrap; margin: 0 0 .75rem; }
.tt-list { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.tt-list-item { display: flex; align-items: stretch; gap: .25rem; min-width: 0; border-left: 3px solid var(--cb); border-radius: var(--radius); background: color-mix(in srgb, var(--cb) 20%, var(--c-container)); color: var(--c-on-container); }
.tt-list-item.clash { border-left-color: var(--danger); }
.tt-list-main { display: flex; flex: 1; align-items: flex-start; gap: .7rem; min-width: 0; margin: 0; padding: .6rem .5rem .6rem .7rem; border: 0; border-radius: var(--radius); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tt-list-main:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.tt-list-main .tt-art { width: 2.5rem; }
.tt-list-text { display: grid; gap: .1rem; min-width: 0; }
.tt-list-time { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.tt-list-item .tt-list-time { color: color-mix(in srgb, currentColor 72%, transparent); }
.tt-list-name { font-weight: 600; overflow-wrap: anywhere; }
.tt-list-sub { color: color-mix(in srgb, currentColor 72%, transparent); font-size: .8125rem; }
.tt-itemmenu { align-self: center; margin-right: .35rem; }
.tt-list-gap { display: flex; align-items: center; gap: .6rem; min-height: 2.75rem; padding: .3rem .4rem .3rem .75rem; border: 1px dashed color-mix(in srgb, var(--line) 85%, transparent); border-radius: var(--radius); color: var(--muted); font-size: .8125rem; }
.tt-list-what { display: grid; flex: 1; gap: .15rem; min-width: 0; }
.tt-list-what .tt-badge { justify-self: start; }
@media (max-width: 640px) {
  dialog.modal.tt-sheet { width: 100%; max-width: none; margin: auto 0 0; max-height: calc(100dvh - 2.5rem - env(safe-area-inset-top, 0px)); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding-bottom: calc(var(--panel-pad) + env(safe-area-inset-bottom, 0px)); padding-left: max(var(--panel-pad), env(safe-area-inset-left, 0px)); padding-right: max(var(--panel-pad), env(safe-area-inset-right, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .tt-tile, .tt-grab::after, .tt-dragging .tt-panel.drawer { transition: none; } }
