/* ───── Backbone handover (27 Oct 2026): the agency's unlock page + wizard, the in-app next step, the owner's sheet ───── */
@font-face { font-family: "Instrument Serif"; src: url("/fonts/InstrumentSerif-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/Geist-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/Geist-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/Geist-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

/* the standalone page carries its own tokens (it doesn't load app.css); same palette as the app */
body.hv-page {
  --accent: #2B45E0; --accent-ink: #ffffff; --accent-soft: #e8ebfc;
  --bg: #f6f7fb; --surface: #ffffff; --ink: #14161c; --muted: #5b6070; --rule: #dde1ea; --notice: #eef0f5;
  --ok: #17784e; --ok-bg: #e3f6ec; --warn: #8a4b00; --warn-bg: #fff4e5; --bad: #b42318; --bad-bg: #fdecea;
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 16px/1.5 "Geist", -apple-system, system-ui, sans-serif; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
@media (prefers-color-scheme: dark) {
  body.hv-page {
    --accent: #6f84ff; --accent-ink: #0b0d14; --accent-soft: #1d2340;
    --bg: #0d0f15; --surface: #161922; --ink: #eceef4; --muted: #9aa0b2; --rule: #262a36; --notice: #151822;
    --ok: #5fd39b; --ok-bg: #0f2a1e; --warn: #f2b45a; --warn-bg: #2b1f0c; --bad: #ff8a80; --bad-bg: #2d1414;
  }
}
.hv-page *, .hv-page *::before, .hv-page *::after { box-sizing: border-box; }
.hv-page [hidden] { display: none !important; }
.hv-page button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
.hv-top { display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; max-width: 640px; margin: 0 auto; }
.hv-top img { border-radius: 8px; border: 1px solid var(--rule); }
.hv-top span { font-family: "Instrument Serif", Georgia, serif; font-size: 24px; line-height: 1; }
.hv-wrap { max-width: 640px; margin: 0 auto; padding: 4px 16px calc(40px + env(safe-area-inset-bottom)); }
.hv-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 20px; padding: 26px 24px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.hv-card h1 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 36px; line-height: 1.08; margin: 0 0 10px; letter-spacing: -.01em; }
.hv-card h2 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 26px; margin: 26px 0 8px; }
.hv-kick, .hv-next .hv-kick { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.hv-lead { font-size: 17px; color: var(--ink); margin: 0 0 18px; }
.hv-q { font-weight: 600; margin: 4px 0 10px; }
.hv-note, .hv-small, .hv-help { color: var(--muted); font-size: 14px; }
.hv-small { margin: 8px 0 0; }
.hv-help { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--rule); }
.hv-mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .04em; }
.hv-card code { font-family: ui-monospace, Menlo, monospace; font-size: .9em; background: var(--notice); padding: 1px 5px; border-radius: 5px; }

.hv-form { display: flex; flex-direction: column; gap: 14px; }
.hv-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; }
.hv-form input { font: inherit; font-weight: 400; font-size: 17px; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink); width: 100%; min-height: 50px; }
.hv-form input:focus, .hv-lim input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.hv-keyrow { display: flex; gap: 8px; }
.hv-eye { flex: none; padding: 0 14px; border-radius: 12px; border: 1px solid var(--rule) !important; font-weight: 600; font-size: 14px; color: var(--muted) !important; }

.hv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 50px; padding: 12px 20px; border-radius: 14px;
  background: var(--accent) !important; color: var(--accent-ink) !important; font-weight: 600; font-size: 16px; text-decoration: none; border: 0; text-align: center; }
.hv-btn:hover:not(:disabled) { filter: brightness(1.08); }
.hv-btn:disabled { opacity: .45; cursor: default; }
.hv-btn.wide { width: 100%; margin-top: 18px; }
.hv-btn.ghost { background: transparent !important; color: var(--accent) !important; border: 1px solid var(--rule); }
.hv-btn.ghost.danger { color: var(--bad) !important; }
.hv-link, .hv-page .hv-link { display: block; margin: 14px auto 0; color: var(--accent); font-weight: 500; font-size: 15px; padding: 10px; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.hv-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.hv-row .hv-btn { flex: 1 1 auto; }

.hv-err, .hv-bad, .hv-ok, .hv-warn { padding: 12px 14px; border-radius: 12px; font-size: 15px; margin: 12px 0 0; }
.hv-err, .hv-bad { background: var(--bad-bg); color: var(--bad); }
.hv-ok { background: var(--ok-bg); color: var(--ok); }
.hv-warn { background: var(--warn-bg); color: var(--warn); }

/* progress */
.hv-page .hv-back { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 6px -8px; padding: 10px 8px; min-height: 44px; color: var(--accent); font-weight: 500; font-size: 15px; background: none; border: 0; cursor: pointer; }
.hv-form label small { color: var(--muted); font-weight: 400; }
.hv-prog { list-style: none; display: flex; gap: 6px; padding: 0; margin: 4px 0 14px; }
.hv-prog li { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.hv-prog li::before { content: ""; height: 4px; border-radius: 2px; background: var(--rule); }
.hv-prog li.did::before, .hv-prog li.now::before { background: var(--accent); }
.hv-prog li.now { color: var(--ink); font-weight: 600; }
.hv-prog i { display: none; }
.hv-prog span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* recovery phrase */
.hv-points { padding-left: 20px; margin: 0 0 6px; } .hv-points li { margin: 8px 0; }
.hv-words { list-style: none; counter-reset: w; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 4px 0 18px; }
.hv-words li { counter-increment: w; display: flex; align-items: baseline; gap: 8px; padding: 11px 12px; border: 1px solid var(--rule); border-radius: 12px; background: var(--bg); }
.hv-words li::before { content: counter(w); font-size: 12px; color: var(--muted); min-width: 16px; }
.hv-words span { font-family: ui-monospace, Menlo, monospace; font-size: 17px; font-weight: 600; }
.hv-check { display: flex; align-items: center; gap: 10px; font-weight: 500; padding: 8px 0; }
.hv-check input { width: 22px; height: 22px; accent-color: var(--accent); }

/* providers */
.hv-provs { display: flex; flex-direction: column; gap: 10px; }
.hv-prov { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 4px; padding: 14px 16px; border: 1.5px solid var(--rule); border-radius: 16px; cursor: pointer; }
.hv-prov.on { border-color: var(--accent); background: var(--accent-soft); }
.hv-prov input { grid-row: 1 / span 4; width: 22px; height: 22px; margin-top: 2px; accent-color: var(--accent); }
.hv-pn b { font-size: 18px; } .hv-pn small { color: var(--muted); }
.hv-tag { font-size: 13px; font-weight: 600; color: var(--accent); } .hv-tag.alt { color: var(--muted); }
.hv-why { font-size: 14.5px; color: var(--muted); }
.hv-pill { justify-self: start; font-size: 12.5px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--notice); color: var(--muted); }
.hv-pill.ok { background: var(--ok-bg); color: var(--ok); } .hv-pill.warn { background: var(--warn-bg); color: var(--warn); } .hv-pill.bad { background: var(--bad-bg); color: var(--bad); }

/* one provider: the steps, one at a time */
.hv-steps { list-style: none; padding: 0; margin: 4px 0 0; }
.hv-step { border-left: 2px solid var(--rule); padding: 0 0 14px 18px; margin-left: 13px; position: relative; }
.hv-step:last-child { border-left-color: transparent; }
.hv-sh { display: flex; align-items: center; gap: 10px; margin-left: -33px; min-height: 30px; }
.hv-sh i { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 600;
  background: var(--surface); border: 2px solid var(--rule); color: var(--muted); }
.hv-step.now .hv-sh i { border-color: var(--accent); color: var(--accent); }
.hv-step.did .hv-sh { cursor: pointer; } .hv-step.did .hv-sh i { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.hv-step.did .hv-sh b { color: var(--muted); font-weight: 500; }
.hv-step.todo .hv-sh b { color: var(--muted); font-weight: 500; }
.hv-sb { padding: 6px 0 4px; }
.hv-sb > p { margin: 0 0 12px; }
.hv-sb > .hv-btn { margin: 0 8px 8px 0; }
.hv-open { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.hv-lim { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; padding: 10px 14px; border: 1px solid var(--rule); border-radius: 12px; background: var(--bg); }
.hv-lim span { display: flex; align-items: center; gap: 4px; font-size: 18px; }
.hv-lim input { width: 110px; font: inherit; font-size: 18px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); color: var(--ink); }
.hv-sb .hv-small { margin: 8px 0 12px; }
.hv-run { list-style: none; padding: 0; margin: 14px 0 0; }
.hv-run li { display: flex; align-items: center; gap: 10px; padding: 6px 0; color: var(--muted); }
.hv-run li i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--rule); flex: none; }
.hv-run li.now { color: var(--ink); } .hv-run li.now i { border-color: var(--accent); border-top-color: transparent; animation: hvspin .8s linear infinite; }
.hv-run li.did { color: var(--ink); } .hv-run li.did i { background: var(--ok); border-color: var(--ok); }
.hv-run li.bad i { background: var(--bad); border-color: var(--bad); }
@keyframes hvspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hv-run li.now i { animation: none; } }

/* agents */
.hv-agents { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.hv-agents li { padding: 14px 16px; border: 1px solid var(--rule); border-radius: 16px; }
.hv-ah { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hv-ah b { font-size: 18px; }
.hv-agents p { margin: 6px 0 6px; font-size: 15px; }
.hv-agents small { color: var(--muted); font-size: 13px; }
.hv-sw { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; font-weight: 600; min-height: 44px; }
.hv-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hv-sw span { width: 46px; height: 28px; border-radius: 14px; background: var(--rule); position: relative; transition: background .15s; }
.hv-sw span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.hv-sw input:checked + span { background: var(--accent); } .hv-sw input:checked + span::after { transform: translateX(18px); }
.hv-sw input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.hv-sw em { font-style: normal; min-width: 24px; color: var(--muted); }
.hv-next-list { padding-left: 22px; margin: 0; } .hv-next-list li { margin: 8px 0; }
.hv-sum { list-style: none; padding: 0; margin: 0 0 6px; }
.hv-sum li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.hv-sum b.ok { color: var(--ok); } .hv-sum b.todo { color: var(--warn); } .hv-sum a { color: var(--accent); font-size: 14px; }
.hv-page .hv-sum .hv-link { display: inline-block; margin: 0; padding: 10px 4px; font-size: 14px; }

@media (max-width: 480px) {
  .hv-card { padding: 20px 16px; border-radius: 18px; }
  .hv-card h1 { font-size: 30px; }
  .hv-words { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hv-prog li:not(.now) span { visibility: hidden; }        /* only the current step is named on a phone */
  .hv-prog li.now span { overflow: visible; }
  .hv-prog li:nth-child(n+3).now span { direction: rtl; }   /* later steps' names run leftwards, inside the screen */
  .hv-sum li { grid-template-columns: 1fr auto; } .hv-sum li a, .hv-sum li .hv-link { grid-column: 2; }
}

/* ───── inside Backbone HQ: the next step at the top of Keystone's Setup tab ───── */
.hv-next { border: 1.5px solid var(--accent) !important; background: var(--accent-soft) !important; }
.hv-next h3 { margin: 0 0 6px; }
.hv-next p { margin: 0 0 12px; }
.hv-next .hv-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; }

/* ───── owner: the Cloud tab's handover panel + the printable handover sheet ───── */
.hv-own .hv-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 8px 0 14px; font-size: 14px; }
.hv-own .hv-kv dt { color: var(--muted); } .hv-own .hv-kv dd { margin: 0; }
.hv-own form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hv-own form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.hv-own form input, .hv-own form select { font: inherit; font-weight: 400; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink); min-height: 40px; }
.hv-own form .full { grid-column: 1 / -1; }
.hv-own .cl-row2 { flex-wrap: wrap; }
@media (max-width: 600px) { .hv-own form { grid-template-columns: 1fr; } }
.hv-sheet { background: #fff; color: #14161c; border: 1px solid #dde1ea; border-radius: 14px; padding: 26px 26px 22px; margin-top: 10px; font-family: "Geist", system-ui, sans-serif; }
.hv-sheet .hv-brand { font-family: "Instrument Serif", Georgia, serif; font-size: 22px; color: #2B45E0; }
.hv-sheet h2 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 32px; margin: 4px 0 2px; line-height: 1.1; }
.hv-sheet .hv-for { color: #5b6070; margin: 0 0 16px; }
.hv-sheet .hv-box { border: 2px solid #2B45E0; border-radius: 12px; padding: 14px 16px; margin: 0 0 16px; }
.hv-sheet .hv-box small { display: block; color: #5b6070; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.hv-sheet .hv-url { font-size: 18px; font-weight: 600; word-break: break-all; }
.hv-sheet .hv-key { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 26px; font-weight: 600; letter-spacing: .06em; margin: 4px 0; word-break: break-all; }
.hv-sheet h3 { font-size: 15px; margin: 16px 0 6px; }
.hv-sheet ol, .hv-sheet ul { margin: 0; padding-left: 20px; font-size: 14px; } .hv-sheet li { margin: 4px 0; }
.hv-sheet .hv-fine { font-size: 12px; color: #5b6070; margin: 16px 0 0; border-top: 1px solid #dde1ea; padding-top: 10px; }
.hv-once { background: #fff4e5; color: #8a4b00; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin: 8px 0; }
@media (max-width: 600px) { .hv-sheet { padding: 18px 16px; } .hv-sheet .hv-key { font-size: 20px; } }
@media print {
  body.hv-printing > *:not(.hv-print-root) { display: none !important; }
  body.hv-printing { position: static !important; overflow: visible !important; background: #fff !important; }
  body.hv-printing .hv-print-root { display: block !important; position: static !important; }
  body.hv-printing .hv-sheet { border: 0; margin: 0; }
}

/* ───── Desktop (28 Oct 2026): the unlock / handover wizard stays one focused card (that's how a set-up flow reads
   best on a laptop too), with more room, lists side by side and mouse states. Below 1024px is untouched. ───── */
@media (min-width: 1024px) {
  .hv-top { max-width: 760px; padding: 28px 16px 16px; }
  .hv-wrap { max-width: 760px; padding: 8px 16px 64px; }
  .hv-card { padding: 36px 44px 32px; border-radius: 22px; box-shadow: 0 1px 2px rgba(0,0,0,.03), 0 12px 40px rgba(20, 22, 28, .06); }
  .hv-card h1 { font-size: 40px; }
  .hv-btn { min-height: 46px; cursor: pointer; }
  .hv-btn.ghost:hover:not(:disabled) { filter: none; border-color: var(--accent); }
  .hv-link:hover, .hv-page .hv-back:hover { text-decoration-thickness: 2px; }
  .hv-page .hv-back { min-height: 36px; }
  .hv-words { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hv-prov { transition: border-color .12s, background .12s; }
  .hv-prov:not(.on):hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--rule)); }
  .hv-agents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .hv-sw { min-height: 36px; }
  .hv-step.did .hv-sh:hover b { color: var(--accent); }
  .hv-page button:focus-visible, .hv-page a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  /* in HQ: the next-step card in Setup */
  .hv-next .hv-btn { min-height: 40px; }
  .hv-next .hv-btn:hover { filter: brightness(1.08); }
  /* owner: the handover panel's form in the Cloud drawer */
  .hv-own form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Social media manager handover (28 Oct 2026): the accounts step, and the Home Screen sign-in link on the last step */
.hv-accts .hv-btn { margin-top: 4px; }
.hv-phone { margin: 22px 0 6px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 16px; }
.hv-phone h2 { margin-top: 0; }
.hv-phone .hv-keyrow { margin-top: 8px; }
.hv-phone .hv-keyrow input { flex: 1 1 auto; min-width: 0; }
/* Backbone's browser rows on "Connect your accounts" (28 Oct 2026) */
.hv-brrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-top: 8px; font-size: 14px; }
.hv-brrow a.hv-btn { text-decoration: none; min-height: 44px; }
