/* The new page through the hub (home-hub.js): the sign-in and pairing screens of
   remote/gate.js and the connection banner. The screens use the class names of the classic
   page (btn, field, status-line, host-row ...); here they take the colours of the new page.
   Everything is scoped under #gate, so nothing leaks into the page. */

.gate { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.gate[hidden] { display: none; }
#gate .gate-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-sizing: border-box; color: var(--ink); }
#gate .logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; white-space: nowrap; margin-bottom: 14px; }
#gate .logo-mark { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; }
#gate h2 { font-size: 17px; margin: 0 0 12px; }
#gate p { margin: 8px 0; line-height: 1.45; }
#gate .muted { color: var(--muted); }
#gate .form { display: grid; gap: 10px; }
#gate .field label { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
#gate .field input { width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 16px; }
#gate .field input:focus { border-color: var(--accent); outline: none; }
#gate .check { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
#gate .status-line { font-size: 12px; margin-top: 6px; color: var(--muted); }
#gate .status-line.bad { color: var(--bad); }
#gate .status-line.ok { color: var(--ok); }
#gate .m-actions { display: flex; gap: 6px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
#gate .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 7px; padding: 6px 12px; font-size: .85rem; font-weight: 600; min-height: 36px; }
#gate .btn.sm { padding: 3px 9px; min-height: 30px; font-size: .8rem; }
#gate .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
#gate .btn.danger { border-color: var(--bad); color: var(--bad); }
#gate pre.out { font-family: var(--f-mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; background: var(--sunk); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; user-select: all; }
#gate .copy-row { display: flex; gap: 8px; align-items: flex-start; }
#gate .copy-row pre.out { flex: 1; min-width: 0; margin: 0; }
#gate .fingerprint { font-size: 18px; letter-spacing: 1px; text-align: center; }
#gate .host-row { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
#gate .host-row:hover { border-color: var(--accent); }
#gate .sd { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--idle); }
#gate .sd.back { background: var(--ok); }
#gate .tag.warn { font-size: 11px; color: var(--warn); border: 1px solid var(--warn); border-radius: 6px; padding: 0 5px; }

/* The connection banner, in the flow under the top bar: it pushes the page down and never
   lies over the bar, so the machine button and the menus stay in reach at every width. */
.conn-banner { margin: 8px auto 0; width: min(640px, calc(100% - 24px)); box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; font-size: 12.5px; line-height: 1.45; background: var(--warn-soft); color: var(--ink); border: 1px solid var(--warn); }
.conn-banner[hidden] { display: none; }
.conn-banner.bad { background: var(--bad-soft); border-color: var(--bad); }
.conn-banner .grow { flex: 1 1 220px; min-width: 0; }
/* The machine of the page in the top bar, and the list of the hub's machines. */
.act.machine { max-width: 14em; font-weight: 500; }
.act.machine span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.machine-list { display: grid; gap: 6px; margin: 8px 0; }
.machine-row { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.machine-row:hover { border-color: var(--accent); }
.machine-row.current { border-color: var(--accent); }
.machine-row small { display: block; color: var(--muted); }
.machine-row .sd { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--idle); }
.machine-row .sd.back { background: var(--ok); }
/* The offer to set up the run passkey after a pairing: at the foot of the screen, above the page. */
.conn-banner.offer { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 80; margin: 0; background: var(--accent-soft); border-color: var(--accent); }
