/* Styles for the batch-2 features (API keys, branding, previews, ZIP, captcha). Kept apart from
   app.css so parallel work on app.css merges cleanly. */
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
code.secret { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); word-break: break-all; font-size: .9rem; user-select: all; }
.files li.muted { opacity: .6; }
.zip-all { margin: 12px 0 0; }
.brand-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line); font-weight: 600; }
.brand-bar img { max-height: 40px; max-width: 160px; object-fit: contain; }
.brand-who { display: grid; gap: 2px; }
.brand-tagline { font-weight: 400; color: var(--body); font-size: .92rem; white-space: pre-line; }
.brand-cover { display: block; width: 100%; max-height: 240px; object-fit: cover; margin: 0 0 16px;
  border-radius: var(--radius); }
.dl > .brand-cover { width: calc(100% + 52px); max-width: none; margin: -26px -26px 20px;
  border-radius: var(--radius) var(--radius) 0 0; }
.brand-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; padding-block: 24px;
  color: var(--ink-2); font-size: .88rem; text-align: center; }
.brand-head-logo { width: auto !important; max-width: 200px; height: 34px !important; object-fit: contain; }
/* owner branding (brand.js): header follows the page colour, corners follow the owner's choice */
.branded header.nav { background: var(--head-bg, var(--nav-bg)); }
.branded .btn.primary { box-shadow: none; }
/* TasPod's own wordmark keeps its font; an owner's name in its place (white label) uses theirs */
.branded .logo .word:not(.brand-word) { font-family: Sora, Manrope, "Segoe UI", system-ui, sans-serif; }
.branded .badge { color: var(--ink); background: var(--brand-soft); border-color: var(--line-strong); }
.branded h1, .branded h2, .branded h3 { font-family: var(--font-display); }
.bc-rounded { --radius: 12px; --radius-sm: 8px; --radius-lg: 16px; }
.bc-rounded .btn, .bc-rounded input, .bc-rounded select, .bc-rounded textarea { border-radius: 8px; }
.bc-square { --radius: 3px; --radius-sm: 2px; --radius-lg: 4px; }
.bc-square .btn, .bc-square input, .bc-square select, .bc-square textarea, .bc-square .badge { border-radius: 2px; }
/* Account page: branding form and live preview */
.brand-preview { display: grid; gap: 10px; padding: 14px; border: 1px dashed var(--line);
  border-radius: 10px; }
.brand-preview .btn { justify-self: start; pointer-events: none; }
#b-form.stack { max-width: 760px; }
.b-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 16px; }
.b-grid input[type="color"] { width: 100%; min-height: 40px; padding: 2px; }
.b-sub { margin: 18px 0 4px; font-size: 1rem; }
.b-assets { display: grid; gap: 10px; }
.b-asset { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.b-asset img { max-height: 40px; max-width: 160px; object-fit: contain; }
.b-live { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg);
  color: var(--body); font-family: var(--font); }
.b-live .b-live-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--head-bg, var(--bg)); color: var(--ink); font: 700 1rem/1 var(--font-display); }
.b-live .b-live-head img { height: 26px; max-width: 140px; object-fit: contain; }
.b-live .b-live-body { padding: 16px; }
.b-live .b-live-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.b-live .brand-cover { width: calc(100% + 32px); max-width: none; max-height: 120px; margin: -16px -16px 14px;
  border-radius: var(--radius) var(--radius) 0 0; }
.b-live h3 { margin: 0 0 6px; color: var(--ink); font-family: var(--font-display); }
.b-live .btn { pointer-events: none; }
.b-live a { color: var(--link); }
.b-live .brand-foot { padding-block: 10px 0; }
#w-form { max-width: none; }
#w-form > label.f { max-width: 480px; }
#w-form > .btn { justify-self: start; }
.w-events { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 14px; margin: 0; min-width: 0; }
.w-events legend { padding: 0 4px; font-weight: 600; }
.w-event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.w-event { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--ease); }
.w-event:hover { border-color: var(--line-strong); }
.w-event:has(input:checked) { border-color: var(--brand); background: var(--glass); }
.w-event input { margin: 3px 0 0; flex: none; }
.w-event > span { display: grid; gap: 3px; min-width: 0; }
.w-event-name { font: 600 .86rem/1.3 var(--font-mono); color: var(--ink); background: none; padding: 0; overflow-wrap: anywhere; }
.w-event-desc { font-size: .86rem; line-height: 1.45; color: var(--ink-2); }
.w-history { list-style: none; margin: 6px 0 0; padding: 0; }

/* Backups page */
.bk .section-title { margin: 8px 0 10px; font-size: 1.25rem; }
.bk-devices { display: grid; gap: 14px; }
.bk-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px; }
.bk-head h3 { margin: 0; font-size: 1.1rem; }
.bk-head .sub { margin: 4px 0 0; }
.pill { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--brand-soft); color: var(--ink-2); vertical-align: middle; }
.pill.ok { background: rgba(24, 194, 156, .12); color: var(--ok-ink); }
pre.cmd { white-space: pre-wrap; word-break: break-all; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 6px 0; font-size: .85rem; }
.dl-list { margin: 6px 0 0; padding-left: 18px; }
#job-dlg { width: min(560px, calc(100vw - 32px)); }
#job-form.stack.wide { max-width: none; }
#job-form textarea { width: 100%; font: inherit; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
#job-form fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; display: grid; gap: 8px; }
#job-form legend { padding: 0 4px; font-weight: 600; }
#job-form .num { width: 5.5em; }
.bk-sched .days { display: flex; flex-wrap: wrap; gap: 4px 12px; padding-left: 22px; }
#crumbs a { color: inherit; }

/* Browse a backup (backup-browse.html), on the My Files shell */
.bb-job { padding: 0 12px; }
.bb-machine { margin: 0; font-size: .82rem; color: var(--ink-2); overflow-wrap: anywhere; }
.bb-jobname { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
#snaps { display: grid; gap: 2px; max-height: calc(100vh - 240px); overflow-y: auto; }
.bb-snap { flex-direction: column; align-items: flex-start; gap: 0; }
.bb-snap .bb-date { font-size: .9rem; }
.bb-snap .bb-state { font-size: .75rem; color: var(--ink-2); }
.bb-snap .bb-state.partial { color: var(--amber); }
.bb-snap .bb-state.failed { color: var(--danger); }
.bb-snap:disabled { opacity: .55; cursor: default; }
.bb-when { margin: 4px 0 10px; }
.bb-name { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.bb-in { font: inherit; font-size: .8rem; color: var(--ink-2); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.bb-in:hover { color: var(--brand); text-decoration: underline; }
.bb-restore { margin-top: 24px; }
.rs-form { max-width: none; }
.rs-form fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; display: grid; gap: 8px; margin: 0; }
.rs-form legend { font-weight: 650; font-size: .9rem; padding: 0 4px; }
.rs-form .sub { margin: 0; }
#rs-folder { margin-left: 26px; }
/* Backups page: restores */
.rs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rs-item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.rs-item .rs-main { min-width: 0; flex: 1 1 260px; }
.rs-item .rs-head { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.rs-item .rs-meta { margin: 2px 0 0; font-size: .85rem; color: var(--ink-2); overflow-wrap: anywhere; }
.rs-state { font-size: .85rem; font-weight: 650; white-space: nowrap; }
.rs-state.done { color: var(--ok); } .rs-state.failed { color: var(--danger); }
.rs-state.queued, .rs-state.running { color: var(--brand); } .rs-state.cancelled { color: var(--ink-2); }
.rs-item details { flex-basis: 100%; font-size: .85rem; }

/* Quick Send from My Files and backups (send-copy.js) */
.sc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sc-link { display: flex; gap: 8px; align-items: center; }
.sc-link input { flex: 1; min-width: 0; }
@media (max-width: 520px) { .sc-row { grid-template-columns: 1fr; } }
.sc-form .notice.ok { background: var(--ok-soft); color: var(--ok); }

/* an owner's own colours (brand.js sets --bg on the page) win over the visitor's day / night choice */
.branded[style*="--bg"] .theme-toggle { display: none; }
