/* Home, Settings, upload and sign in (templates/app_base.html), from the approved mock. Colors: studio/tokens.css;
   the top bar: chrome.css. Controls match the sermon page (studio/editor.css). */
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { background: var(--bg); color: var(--text); font: 13px/1.45 var(--ui); -webkit-font-smoothing: antialiased; margin: 0; }
svg.i { width: 16px; height: 16px; flex: none; }
.num { font-variant-numeric: tabular-nums; }
:where(button, .btn) { font: inherit; color: var(--text); background: var(--surface-3); border: 1px solid var(--border-2); border-radius: 7px; padding: 0 11px; height: 30px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s, color .12s; }
:where(button, .btn):hover { background: var(--raise); border-color: var(--muted); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 1px; }
button.primary, .btn.primary { background: var(--accent); border-color: transparent; color: var(--on-color); font-weight: 600; }
button.primary:hover, .btn.primary:hover { background: var(--accent-2); }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-3); color: var(--text); }
button.danger, .btn.danger { color: var(--bad); }
button.sm, .btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
button.ic, .btn.ic { width: 30px; padding: 0; }
button.sm.ic, .btn.sm.ic { width: 26px; }
button[disabled], .btn[aria-disabled="true"] { opacity: .4; cursor: default; pointer-events: none; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 7px; padding: 0 9px; height: 30px; min-width: 0; }
input[type="checkbox"], input[type="radio"] { height: auto; accent-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: vertical; width: 100%; line-height: 1.55; padding: 8px 10px; height: auto; }
a { color: var(--accent); }
code { font: 12px var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grow { flex: 1; }
.label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

main.app { padding: 18px max(16px, env(safe-area-inset-right, 0px)) 80px max(16px, env(safe-area-inset-left, 0px)); max-width: 1440px; margin: 0 auto; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; min-width: 0; box-shadow: var(--shadow); }
.alert { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; margin-bottom: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bad-soft); font-size: 12.5px; }
.alert.warn { background: var(--warn-soft); }
.alert.ok { background: var(--ok-soft); }
.fold { border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.fold summary { cursor: pointer; padding: 8px 10px; font-size: 12.5px; color: var(--text-2); display: flex; gap: 8px; align-items: center; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::before { content: "›"; font-size: 14px; color: var(--muted); transition: transform .12s; }
.fold[open] summary::before { transform: rotate(90deg); }
.fold .body { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 10px; }

/* status dots (the calendar's legend) */
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--muted); display: inline-block; }
.d-ready { background: var(--accent); } .d-posted { background: var(--ok); } .d-done { background: var(--warn); }
.d-failed, .d-none { background: var(--bad); } .d-upcoming, .d-idle { background: transparent; box-shadow: 0 0 0 1.5px var(--border-2) inset; }
.d-work { background: transparent; box-shadow: 0 0 0 1.5px var(--accent) inset; }
.d-skipped { background: var(--muted); }

/* page head */
.ph { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; margin-bottom: 16px; }
.ph h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; font-weight: 680; }
.ph .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface-3); border-radius: 8px; border: 1px solid var(--border); }
.seg button { height: 24px; border: 0; background: transparent; color: var(--text-2); font-size: 12px; padding: 0 10px; border-radius: 6px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border-2) inset, 0 1px 2px rgba(0,0,0,.2); }

/* ---------- home ---------- */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 16px; align-items: start; }
.cal-h { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cal-h h2 { margin: 0 6px; font-size: 14px; font-weight: 650; }
.legend-s { display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.legend-s span { display: inline-flex; align-items: center; gap: 5px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal .dow { padding: 7px 10px; font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); }
.cal .day { min-height: 98px; padding: 7px; border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.other { background: var(--surface-2); }
.cal .day.other .d, .cal .day.other .svc { opacity: .55; }
.cal .d { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; padding-left: 2px; }
.cal .day.today .d { color: var(--on-color); background: var(--accent); border-radius: 99px; padding: 0 7px; align-self: flex-start; font-weight: 600; }
.svc { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px 7px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; text-decoration: none; color: var(--text); transition: border-color .12s, background .12s; }
a.svc:hover { border-color: var(--border-2); background: var(--surface-3); }
.svc .r1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.svc .t { font-weight: 600; font-size: 12px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.svc .p { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc.untitled .t { color: var(--text-2); font-weight: 500; }
.svc.next { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.svc.ghost { background: transparent; border-style: dashed; }
.svc.ghost .t { font-weight: 500; color: var(--muted); }
.svc.lost .t { color: var(--bad); }
.svc.sending .t { color: var(--accent); }
details.svc > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
details.svc > summary::-webkit-details-marker { display: none; }
details.svc > summary .p { text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 2px; }
.lostform { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.lostform select { height: 26px; font-size: 12px; width: 100%; }
.svc form.undo { margin: 0; }
.linkish { all: unset; cursor: pointer; font-size: 11px; color: var(--muted); text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 2px; }
.linkish:hover { color: var(--text); }
.linkish:focus-visible { outline: 2px solid var(--accent-ring); }

/* the list (phones, or the Calendar/List switch) */
.list { display: flex; flex-direction: column; }
.li { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--hair); color: var(--text); text-decoration: none; }
.li:first-child { border-top: 0; }
a.li:hover { background: var(--surface-2); }
.li .dt { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.li b { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .pp { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.li details summary { list-style: none; cursor: pointer; }
.li details summary::-webkit-details-marker { display: none; }
.list .none { padding: 18px 14px; color: var(--muted); }
.home-main.view-list .cal, .home-main.view-cal .list { display: none; }

/* right rail */
.rail-r { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.nextup { overflow: hidden; }
.nextup .thumb { aspect-ratio: 16 / 7; background: radial-gradient(120% 120% at 70% 0%, #3b4a6b 0%, #161b26 55%, #0a0c10 100%); position: relative; overflow: hidden; }
.nextup .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nextup .thumb .spk { position: absolute; left: 62%; bottom: 0; width: 15%; aspect-ratio: 1/1.6; background: radial-gradient(circle at 50% 22%, #8a8f99 0 15%, transparent 16%), radial-gradient(ellipse at 50% 100%, #4b505b 0 55%, transparent 56%); opacity: .85; }
.nextup .thumb .lbl { position: absolute; left: 12px; top: 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.45); padding: 3px 7px; border-radius: 5px; }
.nextup .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.nextup h3 { margin: 0; font-size: 16px; letter-spacing: -.015em; text-wrap: balance; overflow-wrap: anywhere; }
.nextup .meta { font-size: 12px; color: var(--muted); }
.nextup .facts { display: flex; gap: 6px 12px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.nextup .acts { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.box-h { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.box-h h2 { font-size: 13px; margin: 0; font-weight: 650; }
.box-h .n { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.att { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--hair); flex-wrap: wrap; }
.att:first-child { border-top: 0; }
.att .m { flex: 1 1 150px; min-width: 0; }
.att .m b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att .m span { display: block; font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.att .acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.att .acts form { margin: 0; display: flex; gap: 6px; align-items: center; }
.att .acts input[type="date"] { height: 26px; font-size: 12px; padding: 0 6px; }
.att .acts select { height: 26px; font-size: 12px; }
.att.calm .m span { color: var(--text-2); }
.att-more > summary { list-style: none; cursor: pointer; padding: 8px 14px; font-size: 12px; color: var(--text-2); border-top: 1px solid var(--hair); }
.att-more > summary::-webkit-details-marker { display: none; }
.att-more > summary:hover { color: var(--text); }
.waiting { border-top: 1px solid var(--border); }
.waiting .wh { padding: 8px 14px 0; }
.waiting .att { border-top: 0; padding-block: 6px; }
.waiting .att:last-child { padding-bottom: 10px; }
.waiting .att .m span { color: var(--text-2); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); }
.stats div { padding: 10px 14px; border-left: 1px solid var(--hair); }
.stats div:first-child { border-left: 0; }
.stats b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stats span { font-size: 11px; color: var(--muted); }
.calm-note { padding: 14px; color: var(--text-2); font-size: 12.5px; }

/* ---------- settings ---------- */
.set { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 20px; align-items: start; max-width: 1000px; }
.snav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 70px; }
.snav a { color: var(--text-2); text-decoration: none; padding: 7px 10px; border-radius: 7px; font-weight: 500; }
.snav a:hover { background: var(--surface-3); color: var(--text); }
.sbody { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sec { padding: 18px; display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 70px; }
.sec > h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.sec > .sub { margin: -8px 0 0; color: var(--muted); font-size: 12.5px; }
.sec .foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form .wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span, .field > .lab { font-size: 11.5px; color: var(--muted); }
.field input:not([type="checkbox"]), .field select { width: 100%; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field .err { font-size: 11.5px; color: var(--bad); }
.days { display: flex; flex-wrap: wrap; gap: 4px; }
.days label { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--surface-2); font-size: 12.5px; cursor: pointer; }
.days label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.file { display: flex; align-items: center; gap: 8px; min-width: 0; }
.file .fname { flex: 1; min-width: 0; height: 30px; display: flex; align-items: center; padding: 0 9px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--surface-2); color: var(--text-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12.5px; }
.file .fname.none { color: var(--muted); }
.file input[type="file"] { display: none; }
.conn { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--hair); flex-wrap: wrap; }
.conn:first-of-type { border-top: 0; padding-top: 0; }
.conn .lg { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.conn .lg svg { width: 16px; height: 16px; }
.conn .m { flex: 1; min-width: 180px; }
.conn .m b { display: block; font-size: 13px; }
.conn .m > span { font-size: 12px; color: var(--muted); }
.conn .more { flex-basis: 100%; display: flex; flex-direction: column; gap: 10px; padding-left: 44px; }
.conn .more .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.conn .more .row .grow { min-width: 0; overflow-wrap: anywhere; }
.conn .more form { margin: 0; }
.ok-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok); white-space: nowrap; }
.ok-tag.off { color: var(--muted); }
.ok-tag.warn { color: var(--warn); }
.once { padding: 12px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); display: flex; flex-direction: column; gap: 8px; }
.once .urlbox { display: flex; gap: 8px; }
.once .urlbox input { flex: 1; font: 12px var(--mono); }
.once p, .once ol { margin: 0; font-size: 12px; color: var(--text-2); }
.once ol { padding-left: 18px; }
.people { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.people td, .people th { text-align: left; padding: 9px 6px; border-top: 1px solid var(--hair); vertical-align: middle; }
.people th { font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; border-top: 0; }
.people td .em { display: block; font-size: 11.5px; color: var(--muted); }
.people select { height: 28px; }

@media (max-width: 900px) {
  .home { grid-template-columns: 1fr; }
  .set { grid-template-columns: 1fr; }
  .snav { position: static; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .home-main .cal { display: none !important; }
  .home-main .list { display: flex !important; }
  #viewSeg { display: none; }
  .form { grid-template-columns: 1fr; }
  .conn .more { padding-left: 0; }
  .li { grid-template-columns: 58px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; }
  .ph .sub { max-width: 100%; }
}
@media (max-width: 420px) {
  .li .st .lb { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
input:disabled, select:disabled, textarea:disabled, fieldset:disabled label { opacity: .7; cursor: default; }

/* ---------- upload (templates/jobs/submit.html) and sign in (templates/registration/) ---------- */
.up { max-width: 640px; display: flex; flex-direction: column; gap: 12px; }
.up > .seg { align-self: flex-start; }
.back { color: var(--muted); text-decoration: none; font-size: 12.5px; }
.back:hover { color: var(--text); }
.up-card { padding: 16px; }
.up-card, .up-card form { display: flex; flex-direction: column; gap: 12px; }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 132px; padding: 16px; border: 2px dashed var(--border-2); border-radius: 10px; background: var(--surface-2); color: var(--text-2); text-align: center; cursor: pointer; transition: background .12s, border-color .12s; }
.drop > span { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.drop:hover, .drop.over, .drop:focus-within { background: var(--surface-3); border-color: var(--accent); }
.drop.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--text); }
.drop.sm { min-height: 88px; }
.bar { display: block; width: 200px; max-width: 100%; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.err { color: var(--bad); font-size: 12.5px; margin: 0; }
.ok-t { color: var(--ok); font-weight: 600; }
button.wide, .btn.wide { width: 100%; height: 34px; }
.queue { display: flex; flex-direction: column; gap: 6px; }
.qi { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.qi .nm { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.qi .nm > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qi .bar { width: 100%; }
.auth { max-width: 360px; margin: 7vh auto 0; display: flex; flex-direction: column; gap: 14px; }
.auth-h { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.auth-h .mk { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--on-color); font-weight: 700; font-size: 17px; }
.auth-h h1 { margin: 6px 0 0; font-size: 22px; letter-spacing: -.02em; }
.auth form.panel, .auth .panel { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.auth label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.auth input:not([type="hidden"]) { height: 34px; width: 100%; }
.auth .alert { margin: 0; }
.auth .fine { text-align: center; font-size: 11.5px; color: var(--muted); margin: 0; }
.auth .fine a { color: var(--muted); }
