/* MSP Vantage Backup -- the web console. The family's web app look, as in Sync's and Vault's (system type, quiet
   surfaces, the same colours): blue for action, violet for anything about keys, amber for anything waiting on a person. */
:root {
  --paper: #f4f5fb; --surface: #ffffff; --ink: #151937; --muted: #5d6383; --line: #e0e3ef; --hover: #eef0f9;
  --blue: #3355ee; --blue-ink: #ffffff; --violet: #6b3fe0; --violet-wash: #f2edfe; --red: #b42318; --red-wash: #fdecea;
  --amber: #9a5b00; --amber-wash: #fff4dd; --green: #16794a; --green-wash: #e6f5ec; --select: #e5e9fe;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1126; --surface: #171a33; --ink: #eceefb; --muted: #a3a8c6; --line: #2a2e50; --hover: #1f2343;
    --blue: #7690ff; --blue-ink: #0f1126; --violet: #ab8cff; --violet-wash: #241d45; --red: #ff8a80; --red-wash: #3a1d22;
    --amber: #ffc56b; --amber-wash: #392b12; --green: #6fdc9e; --green-wash: #14321f; --select: #262f62; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); } .small { font-size: 13px; } .error { color: var(--red); min-height: 1.5em; margin: 12px 0 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

button.primary { background: var(--blue); color: var(--blue-ink); border: 0; border-radius: 8px; padding: 10px 18px; font-weight: 600; cursor: pointer; }
button.primary:disabled { opacity: .5; cursor: default; }
button.quiet, .actions button { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; cursor: pointer; }
button.quiet:hover, .actions button:hover { background: var(--hover); }
.actions button.primary { background: var(--blue); color: var(--blue-ink); border-color: var(--blue); }
.actions button.primary:hover { background: var(--blue); filter: brightness(1.08); }
button.danger, .actions button.danger { color: var(--red); }
a.btnlink { display: inline-block; text-decoration: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 9px 16px; font-weight: 600; }
a.btnlink.primary { background: var(--blue); color: var(--blue-ink); border-color: var(--blue); }
button.linkish { background: none; border: 0; padding: 4px 0; color: var(--blue); cursor: pointer; text-align: left; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=search], input[type=url], input[type=tel], select, textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%;
}
textarea { resize: vertical; min-height: 90px; }

/* gate: sign in / set-up / unlock */
.gate { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: min(480px, 100%); }
.gate h1 { font-size: 26px; line-height: 1.2; margin: 18px 0 6px; font-weight: 650; letter-spacing: -.01em; }
.gate label { display: block; font-weight: 600; margin: 18px 0 6px; }
.gate .hint { font-size: 13px; color: var(--muted); margin: 6px 0 16px; }
.gate .primary { width: 100%; margin-top: 4px; }
.gate-actions { margin-top: 18px; display: grid; gap: 8px; }
.gate-logo { border-radius: 50%; }
.tick { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 14px 0; }
.tick input { margin-top: 4px; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 12px; }
.mono { font-family: var(--mono); }

/* shell (as Vault) */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100%; }
.rail { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 1px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 650; padding: 2px 8px 14px; }
.navhead { font-size: 12px; font-weight: 600; color: var(--muted); padding: 14px 10px 4px; }
.nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; background: none; border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer; color: var(--ink); }
.nav:hover { background: var(--hover); }
.nav[aria-current=page] { background: var(--select); font-weight: 600; }
.lockline { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 8px 0; display: grid; gap: 8px; }
.lockline p { margin: 0; overflow-wrap: anywhere; }
.lockbtn { width: 100%; border: 1px solid var(--violet); color: var(--violet); background: var(--violet-wash); border-radius: 8px; padding: 7px 14px; cursor: pointer; font-weight: 600; }
.main { padding: 18px 26px 40px; min-width: 0; outline: none; max-width: 1180px; }

/* page head, sections, tabs */
.crumbs { font-size: 13px; color: var(--muted); margin: 4px 0 2px; }
h1.page { font-size: 21px; font-weight: 650; margin: 0 0 4px; letter-spacing: -.01em; min-height: 30px; }
.lede { color: var(--muted); margin: 0 0 18px; max-width: 72ch; }
h2.sect { font-size: 16px; margin: 26px 0 8px; }
.bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 4px 0 16px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; cursor: pointer; color: var(--muted); margin-bottom: -1px; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--blue); font-weight: 600; }

/* tables (Vault's .tbl) */
table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.list th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 9px 14px; border-bottom: 1px solid var(--line); }
table.list td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--hover); }
table.list td.num, table.list th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.act { text-align: right; white-space: nowrap; }
td.act button + button { margin-left: 6px; }

/* states (Vault's .badge), codes (Vault's .safety) */
.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 6px; padding: 1px 7px; }
.pill.ok { background: var(--green-wash); color: var(--green); }
.pill.wait { background: var(--amber-wash); color: var(--amber); }
.pill.off { background: var(--hover); color: var(--muted); }
.fp { font-family: var(--mono); font-size: 17px; letter-spacing: .06em; background: var(--violet-wash); border-radius: 10px; padding: 12px 14px; margin: 8px 0 12px; display: block; }
.code { font-family: var(--mono); font-size: 15px; overflow-wrap: anywhere; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; margin: 6px 0 10px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; }

/* recovery kit words (Vault's .recovery-grid) */
.words { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 10px; margin: 10px 0 6px; }
.words span { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 14px; white-space: nowrap; }
.words i { color: var(--muted); font-size: 12px; margin-right: 6px; font-style: normal; }
@media (max-width: 520px) { .words { grid-template-columns: repeat(2, 1fr); } }
#dlg-body label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
#dlg-body p { margin: 0 0 10px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; max-width: calc(100% - 32px); z-index: 10; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; width: min(560px, calc(100% - 32px)); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(15, 17, 38, .45); }
dialog h2 { margin: 0 0 10px; font-size: 18px; }
.dlg-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.dlg-buttons button { padding: 8px 16px; }

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { width: 100%; padding-bottom: 8px; }
  .navhead, .lockline p { display: none; }
  .lockline { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; gap: 12px; align-items: center; }
  .lockbtn { width: auto; }
  .main { padding: 14px; }
  table.list { display: block; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.print-kit { display: none; }
@media print {
  body > *:not(#print-kit) { display: none !important; }
  .print-kit { display: block !important; color: #000; font: 14px/1.6 Arial, sans-serif; padding: 10mm; }
  .print-kit .words span { border: 1px solid #888; }
}
.notice { background: var(--amber-wash); color: var(--ink); border-radius: 8px; padding: 10px 12px; margin: 10px 0 0; max-width: 760px; }
.gate textarea { font-family: var(--mono); font-size: 14px; min-height: 96px; }
.gate .linkish { margin-top: 10px; }
