/* Signage Studio pages. Colours and fonts come from theme.css. */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.55 var(--font-body);
}
a { color: var(--brand); text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 600; line-height: 1.2; color: var(--brand); }
h1 { font-size: 2.1rem; margin: 1.6rem 0 .6rem; }
h2 { font-size: 1.45rem; margin: 2.2rem 0 .8rem; }
h3 { font-size: 1.12rem; margin: 1rem 0 .5rem; }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.lead { max-width: 70ch; color: var(--ink-soft); font-size: 1.05rem; }
.hint, .meta { color: var(--ink-soft); font-size: .88rem; }
.meta { display: block; }
.empty { padding: 28px; border: 1px dashed var(--rule); border-radius: var(--radius); background: var(--surface); color: var(--ink-soft); }
.notice { padding: 14px 18px; background: #fff7e6; border-left: 4px solid var(--accent); }
.muted { opacity: .55; }
.nowrap { white-space: nowrap; }

/* Header */
.site-header { background: var(--brand); color: var(--brand-ink); border-bottom: 4px solid var(--accent); }
.header-row { display: flex; align-items: center; gap: 28px; min-height: 68px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--brand-ink); text-decoration: none; font-family: var(--font-heading); font-size: 1.2rem; }
.brand-mark { width: 14px; height: 22px; border: 2px solid var(--accent); border-radius: 2px; position: relative; }
.brand-mark::after { content: ""; position: absolute; left: 50%; top: 4px; width: 2px; height: 10px; margin-left: -1px; background: var(--accent); box-shadow: -3px 3px 0 -0px transparent; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.main-nav a { color: var(--brand-ink); text-decoration: none; padding: 8px 12px; border-radius: var(--radius); opacity: .85; }
.main-nav a:hover { opacity: 1; background: rgba(255,255,255,.08); }
.main-nav a[aria-current="page"] { opacity: 1; box-shadow: inset 0 -3px 0 var(--accent); border-radius: 0; }
.who { display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.who small { opacity: .75; }
.who form { margin: 0; }
.link-btn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-decoration-color: var(--accent); cursor: pointer; font: inherit; }
.site-header .link-btn { color: var(--brand-ink); }
main.wrap { padding-bottom: 60px; }
.site-footer { border-top: 1px solid var(--rule); padding: 20px 0; color: var(--ink-soft); font-size: .85rem; }

/* Flash */
.flash { padding: 12px 16px; border-radius: var(--radius); margin: 18px 0 0; background: #e8f2ea; border-left: 4px solid var(--ok); }
.flash-error { background: #f9e7e7; border-left-color: var(--danger); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: var(--radius);
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font: inherit; font-size: .95rem;
  cursor: pointer; text-decoration: none; line-height: 1.2;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:disabled { opacity: .4; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-small { padding: 5px 10px; font-size: .85rem; }
form.inline { display: inline; margin: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions { white-space: nowrap; text-align: right; }

/* Forms */
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .92rem; }
label.check, label.pill { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.label-like { font-weight: 600; font-size: .92rem; margin: 6px 0 0; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: #fff; border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 8px 10px; width: 100%;
}
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
input[type=color] { padding: 2px; height: 38px; }
input[type=range] { padding: 0; accent-color: var(--accent); }
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; font-size: .92rem; padding: 0; margin-bottom: 6px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.small { gap: 8px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.four { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: end; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; margin: 16px 0; }
.kind-pick, .days { display: flex; flex-wrap: wrap; gap: 8px; }
.kind-pick legend, .days legend { width: 100%; }
.pill { border: 1px solid var(--rule); border-radius: 999px; padding: 6px 14px; background: #fff; cursor: pointer; }
.pill:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, #fff); }
.inline-label { flex-direction: row; align-items: center; font-weight: 400; }
.inline-label select { width: auto; }

/* Tables */
table.data { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.data th, .data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.data th { font-size: .82rem; color: var(--ink-soft); font-weight: 600; background: color-mix(in srgb, var(--paper) 60%, #fff); }
.data select { width: auto; }

/* Auth */
.auth-card { max-width: 440px; margin: 60px auto; background: var(--surface); border: 1px solid var(--rule); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: 32px; }
.auth-card h1 { margin-top: 0; }

/* Page heads */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* Previews */
.preview-16x9, .preview-frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.preview-16x9 iframe, .preview-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.preview-frame iframe { pointer-events: none; }

/* Cards */
.card-list, .screen-cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card, .screen-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.card-body { padding: 14px 16px 16px; }
.card-body h2, .card-body h3 { margin: 0 0 4px; font-size: 1.15rem; }
.status { font-family: var(--font-body); font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; vertical-align: middle; margin-left: 6px; }
.status-ok { background: #e3f1e6; color: var(--ok); }
.status-late { background: #fbeee0; color: #8a5a12; }
.status-never { background: #ececec; color: #555; }

/* Media */
.upload-box { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 12px; align-items: end; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; }
.upload-box .hint { grid-column: 1 / -1; margin: 0; }
.drop { position: relative; border: 2px dashed var(--rule); border-radius: var(--radius); padding: 14px; text-align: center; font-weight: 400; color: var(--ink-soft); cursor: pointer; }
.drop:hover { border-color: var(--accent); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.filter-bar { display: flex; gap: 12px; align-items: end; margin: 20px 0; flex-wrap: wrap; }
.filter-bar label { min-width: 180px; }
.media-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.media-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.media-card .title { word-break: break-word; }
.thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: contain; display: block; }
.badge { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.7); color: #fff; font-size: .72rem; padding: 2px 6px; border-radius: 3px; }
.checker { background-color: #e9e7e1; background-image: linear-gradient(45deg, #d8d5cd 25%, transparent 25%, transparent 75%, #d8d5cd 75%), linear-gradient(45deg, #d8d5cd 25%, transparent 25%, transparent 75%, #d8d5cd 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }

/* Playlist editor */
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 32px; align-items: start; }
.split aside { align-self: stretch; }   /* full height of the row, so the preview inside can stay in view (1.3.1) */
.slide-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: s; }
.slide-row { display: grid; grid-template-columns: 30px 120px 1fr; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 8px; counter-increment: s; }
.slide-row::before { content: counter(s); font-family: var(--font-heading); color: var(--ink-soft); text-align: center; }
.slide-thumb { aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: .8rem; color: var(--ink-soft); }
.slide-thumb img { width: 100%; height: 100%; object-fit: cover; }
.slide-actions { grid-column: 2 / -1; display: flex; gap: 6px; flex-wrap: wrap; }

/* Slide look, live preview, feed switches (1.1) */
.slide-row.is-editing { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.style-box { background: color-mix(in srgb, var(--paper) 55%, #fff); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px 16px; }
.style-box legend { font-family: var(--font-heading); font-size: 1.05rem; color: var(--brand); float: left; width: 100%; margin-bottom: 2px; }
.style-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.style-row .label-like { margin: 0; min-width: 9.5em; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg .pill { padding: 5px 12px; font-size: .9rem; }
.checks-inline { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.preview-tabs { display: flex; gap: 0; margin-bottom: 8px; border-bottom: 1px solid var(--rule); }
.preview-tabs button { font: inherit; font-size: .92rem; padding: 7px 14px; border: 1px solid transparent; border-bottom: 0; background: none; color: var(--ink-soft); cursor: pointer; border-radius: var(--radius) var(--radius) 0 0; margin-bottom: -1px; }
.preview-tabs button[aria-selected="true"] { color: var(--brand); background: var(--surface); border-color: var(--rule); font-weight: 600; }
#slide-preview.is-placeholder .sg-block { opacity: .45; }
.sg-noscript { color: #fff; padding: 20px; }
.feed-box { border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.feed-box legend { padding: 0 4px; }
.roster-mini { list-style: none; padding: 0; margin: 6px 0 0; font-size: .92rem; }
.roster-mini li { padding: 2px 0; }
.roster-mini span { display: inline-block; min-width: 9em; font-weight: 600; color: var(--brand); }
.font-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.font-list li { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 12px; }
.font-list .sample { display: block; font-size: 1.5rem; line-height: 1.2; color: var(--brand); }

/* Layout editor */
.editor-top { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 20px 0; flex-wrap: wrap; }
.title-field { min-width: 280px; }
.title-field input { font-family: var(--font-heading); font-size: 1.4rem; }
.editor-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.layers h2 { margin-top: 0; font-size: 1.1rem; }
.layers ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.layers button { width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--rule); background: var(--surface); border-radius: var(--radius); font: inherit; cursor: pointer; color: var(--ink); }
.layers button[aria-current="true"] { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.stage-col { position: sticky; top: 16px; }
.preview-controls { margin-top: 10px; }
.settings-col fieldset { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.settings-col legend { font-family: var(--font-heading); font-size: 1.1rem; color: var(--brand); float: left; width: 100%; margin-bottom: 4px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }

/* Schedule */
.now-strip { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0; }
.now-card { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 12px 16px; min-width: 240px; }
.now-card strong { display: block; font-family: var(--font-heading); font-size: 1.15rem; color: var(--brand); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px; min-height: 140px; }
.day.today { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.day h3 { margin: 0 0 8px; font-size: 1rem; }
.block { border-radius: 4px; padding: 8px; margin-bottom: 6px; background: color-mix(in srgb, var(--brand) 7%, #fff); font-size: .86rem; }
.block strong { display: block; }
.block .time { font-variant-numeric: tabular-nums; color: var(--ink-soft); }

/* Portal items */
.portal-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.portal-item { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: start; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px; }
.portal-item img { width: 120px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.portal-item p { margin: 4px 0 0; }
.portal-item:not(:has(img)) { grid-template-columns: 1fr auto; }

/* Dashboard */
.urgent-section .panel { border-left: 4px solid var(--danger); }
.urgent-live { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; background: #f9e7e7; border-radius: var(--radius); margin: 10px 0; }
.urgent-live .meta { display: inline; }
.activity { list-style: none; padding: 0; margin: 0; }
.activity li { padding: 8px 0; border-bottom: 1px solid var(--rule); }
.activity .meta { display: inline; margin-right: 6px; }

/* Screens */
.key-box { background: #fff7e6; border: 1px solid var(--accent); border-radius: var(--radius); padding: 14px; margin: 10px 0; }

/* Narrow screens */
@media (max-width: 1100px) {
  .editor-grid { grid-template-columns: 1fr; }
  .layers ol { flex-direction: row; flex-wrap: wrap; }
  .layers button { width: auto; }
}
@media (max-width: 860px) {
  .split, .upload-box { grid-template-columns: 1fr; }
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; }
  .two, .three { grid-template-columns: 1fr; }
  .four { grid-template-columns: 1fr 1fr; }
  .data, .data tbody, .data tr, .data td { display: block; }
  .data thead { display: none; }
  .data tr { border-bottom: 1px solid var(--rule); padding: 8px 0; }
  .data td { border: 0; padding: 4px 12px; }
  .actions { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* 1.2: layout editor sub-boxes and range read-outs */
.sub-box { border: 1px dashed var(--rule); border-radius: var(--radius); padding: 12px 14px; }
.sub-box h3 { margin: 4px 0 0; font-size: 1rem; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input { flex: 1; }
.range-row output { min-width: 3.2em; font-weight: 400; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.settings-col fieldset h3 { margin: 6px 0 0; font-size: 1rem; }

/* 1.3.1: the live preview stays in view while you scroll down through the settings.
   Wide screens: the preview column sticks beside the settings. Narrower screens (one column):
   a smaller preview docks at the top of the window and the settings scroll underneath it. */
.preview-dock { padding: 12px 0 10px; margin-top: calc(2.2rem - 12px); }
.split.has-form .preview-dock { position: sticky; top: 0; z-index: 20; background: var(--paper); }   /* while a slide is open */
.preview-dock h2 { margin: 0 0 .6rem; }
.preview-dock .hint { margin: 8px 0 0; }
@media (max-width: 1100px) {
  .stage-col {
    position: sticky; top: 0; z-index: 20; background: var(--paper); padding: 8px 0;
    box-shadow: 0 10px 10px -10px rgba(0, 0, 0, .35);
  }
  .stage-col .preview-16x9 { width: min(100%, calc(40vh * 16 / 9)); margin: 0 auto; }
  .stage-col .preview-controls { justify-content: center; margin-top: 6px; }
  .stage-col > .hint { display: none; }
}
@media (max-width: 860px) {
  /* One column: lift the preview above the slide form and dock it while a slide is being edited. */
  .split > aside { display: contents; }
  .split > aside > .preview-dock { order: -1; margin-top: 0; }
  .split.has-form > aside > .preview-dock { box-shadow: 0 10px 10px -10px rgba(0, 0, 0, .35); }
  .split.has-form .preview-dock h2, .split.has-form .preview-dock .hint { display: none; }
  .split.has-form .preview-dock .preview-16x9 { width: min(100%, calc(40vh * 16 / 9)); margin: 0 auto; }
  .split.has-form #slide-form { scroll-margin-top: calc(40vh + 70px); }
}
@media (max-height: 560px) {
  /* Very short windows (a phone held sideways): don't let the preview take over the screen. */
  .stage-col, .split.has-form .preview-dock { position: static; box-shadow: none; }
}

/* ---------- 1.4: TV power control ---------- */
.tv-all { margin: 8px 0 4px; }
.tv-card .tv-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tv-card h2 { margin: 0; }
.tv-state { padding: 4px 12px; border: 1px solid var(--rule); font-weight: 600; background: #fff; }
.tv-state-on { border-color: var(--ok); color: var(--ok); }
.tv-state-off { border-color: var(--ink-soft); color: var(--ink-soft); }
.tv-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 6px; }
.tv-buttons form { margin: 0; }
.tv-btn { min-width: 8.5rem; min-height: 48px; justify-content: center; font-size: 1.05rem; }
.tv-correct form { display: inline; margin: 0 4px; }
.tv-log { list-style: none; margin: 10px 0 0; padding: 0; font-size: .85rem; color: var(--ink-soft); }
.tv-log li { padding: 3px 0; border-top: 1px dotted var(--rule); }
.tv-log-failed strong, .tv-log-missed strong { color: var(--danger); }
.tv-log-sent strong { color: var(--ok); }
.tv-admin { margin: 12px 0; border-top: 1px solid var(--rule); padding-top: 10px; }
.tv-admin summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.tv-code-row { display: grid; grid-template-columns: 8.5rem 13rem 1fr auto; gap: 8px; align-items: center; }
.tv-code-name { font-weight: 600; }
@media (max-width: 720px) {
  .tv-code-row { grid-template-columns: 1fr 1fr; }
  .tv-code-row .tv-code-name, .tv-code-row input { grid-column: 1 / -1; }
  .tv-btn { flex: 1 1 40%; }
}

/* 1.5: screens resting in their screen-off hours */
.status-rest { background: #e8ecf3; color: #3d4e6a; }

/* 1.5: Settings → How often the screens check */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.poll-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 0; border-bottom: 1px solid var(--rule, #dcd8cf); }
.poll-range label { flex-direction: row; align-items: center; gap: 6px; }
.poll-days { display: flex; flex-wrap: wrap; gap: 4px 10px; border: 0; margin: 0; padding: 0; min-width: 0; }
.poll-days label { font-weight: 400; gap: 4px; }
.poll-range input[type="time"] { width: auto; }
#polling h3 { margin: 12px 0 0; font-size: 1.05rem; }

/* 1.7: TV hours on the TVs page */
.tv-hours-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 10px 0 0; padding: 9px 12px; background: color-mix(in srgb, var(--paper) 60%, #fff); border-left: 4px solid var(--brand); }
.tv-hours-now { font-weight: 600; }
.tv-hours-src { color: var(--ink-soft); font-size: .88rem; }
.tv-hours-line form { margin: 0; font-size: .88rem; }
.tv-hours-line a { font-size: .88rem; }

.tv-check { margin-top: 12px; border-top: 1px solid var(--rule); padding-top: 8px; }
.tv-check > summary, .tv-edit > summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.tv-check-badge { display: inline-block; margin-left: 6px; padding: 1px 10px; border: 1px solid var(--rule); border-radius: 999px; font-size: .82rem; font-weight: 600; background: #fff; }
.tv-check.is-ok .tv-check-badge { color: var(--ok); border-color: var(--ok); }
.tv-check.is-warn .tv-check-badge { color: #8a5a00; border-color: #c98a00; background: #fff7e6; }
.tv-check.is-bad .tv-check-badge { color: var(--danger); border-color: var(--danger); background: #f9e7e7; }
.tv-check-list { list-style: none; margin: 10px 0; padding: 0; font-size: .92rem; }
.tv-check-list li { display: grid; grid-template-columns: 1.6rem 1fr; padding: 5px 0; border-top: 1px dotted var(--rule); }
.tv-check-list li .sr-only { grid-column: 1; }
.tv-check-mark { font-weight: 700; text-align: center; }
.tv-check-list .tv-check-ok .tv-check-mark { color: var(--ok); }
.tv-check-list .tv-check-info { color: var(--ink-soft); }
.tv-check-list .tv-check-warn .tv-check-mark { color: #8a5a00; }
.tv-check-list .tv-check-bad { color: var(--danger); }
.tv-check form.row { margin: 0 0 4px; }
.tv-check form.row .hint { margin: 0; flex: 1 1 14rem; }

.tv-hours h3 { margin: 10px 0 0; font-size: 1.05rem; }
.tv-week { display: grid; gap: 5px; max-width: 46rem; }
.tv-week-row, .tv-week-scale { display: grid; grid-template-columns: 2.6rem minmax(7rem, 1fr) minmax(9rem, 15rem); gap: 12px; align-items: center; }
.tv-week-day { font-weight: 600; font-size: .9rem; }
.tv-week-row.is-today .tv-week-day { color: var(--accent); }
.tv-week-bar { position: relative; height: 14px; background: #e7e3da; border-radius: 3px; overflow: hidden; }
.tv-week-bar i { position: absolute; top: 0; bottom: 0; background: var(--brand); }
.tv-week-ticks { display: grid; grid-template-columns: repeat(4, 1fr); font-size: .72rem; color: var(--ink-soft); }
.tv-week-ticks i { font-style: normal; border-left: 1px solid var(--rule); padding-left: 4px; }
.tv-week-words { font-size: .88rem; }
.tv-week-words.is-off { color: var(--ink-soft); }
.tv-edit { margin-top: 4px; }
.tv-edit[open] > summary { margin-bottom: 8px; }

.tv-uses { border-top: 1px solid var(--rule); padding: 12px 0 2px; margin: 0; }
.tv-uses p { margin: 0; }
.tv-uses-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.tv-uses-pick legend { padding: 0; margin-bottom: 8px; font-family: var(--font-heading); font-weight: 600; color: var(--brand); }
.tv-uses .tv-own, .tv-uses .tv-none-note { display: none; margin-top: 12px; }
.tv-uses:has(input[value="own"]:checked) .tv-own { display: flex; }
.tv-uses:has(input[value="none"]:checked) .tv-none-note { display: block; }
.tv-power-form { margin-top: 14px; padding-top: 10px; border-top: 1px dotted var(--rule); }
.tv-power-form h3 { margin: 0; font-size: 1rem; }
@media (max-width: 560px) {
  .tv-week-row, .tv-week-scale { grid-template-columns: 2.6rem 1fr; gap: 2px 10px; }
  .tv-week-words { grid-column: 2; }
  .tv-week-scale span:last-child { display: none; }
}
