/* The gateway's own pages (app/mu/pages.py, docs/MULTIUSER.md §9): the
   layout only. The colours, the type and every component — cards, buttons,
   fields, alerts, badges — are the dashboard's (/explorer/ui/styles.css),
   so a page here and the dashboard read as one product. */

.gw [hidden] { display: none !important; }   /* hidden wins over a component's own display (.alert, .card) */

/* -- before signing in: one card in the middle --------------------------------------------- */
.gw-auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gw-auth-card { width: min(440px, 100%); }
.gw-auth-card .card-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.gw-brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 0; }
.gw-brand b { display: block; font-size: 1.08rem; }
.gw-brand div > span { color: var(--muted); font-size: .8rem; }
.gw-foot { margin: 0; font-size: .84rem; text-align: center; }

/* -- signed in: the bar, then the page's cards ------------------------------------------------- */
.gw-top { flex-wrap: wrap; row-gap: 8px; }
.gw-home { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; white-space: nowrap; }
a.gw-home:hover { text-decoration: none; }
.gw-home .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
.gw-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.gw-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.gw-nav a:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.gw-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--text); }
.gw-nav a[aria-current="page"] .ic { color: var(--accent); }
.gw-who { max-width: 16rem; }
.gw-who b { overflow: hidden; text-overflow: ellipsis; }
.gw-main { width: 100%; max-width: 940px; margin: 0 auto; padding: 24px 28px 64px; display: flex; flex-direction: column; gap: 18px; }
.gw-main.wide { max-width: 1360px; }
.gw-main > .page-head { margin-bottom: 0; }
.gw-main .card-body > * + * { margin-top: 14px; }   /* a card's parts: alerts, facts, forms, actions */

/* -- forms and actions ------------------------------------------------------------------------ */
.gw-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.gw-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.gw-fieldset:disabled { opacity: .6; }
.gw-inline { display: inline-flex; margin: 0; }
.gw-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gw-stack { flex-direction: column; align-items: stretch; margin-top: 10px; }
.gw-field-row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; margin: 0; }
.gw-field-row .field { flex: 1 1 180px; }
.gw-field-row > .input { flex: 1 1 140px; width: auto; }
.gw-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .88rem; color: var(--text-2); }
.gw-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.gw-note { font-size: .8rem; margin: 0; }
.gw-sub { margin: 18px 0 8px; font-size: .9rem; }
.gw-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; }

/* the connection's choices, each with what it costs */
.gw-options { display: flex; flex-direction: column; gap: 8px; }
.gw-option { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: start; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-solid); cursor: pointer; }
.gw-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.gw-option input { margin: 5px 0 0; accent-color: var(--accent); }
.gw-option b { display: block; font-size: .92rem; }
.gw-option small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.gw-option.off { opacity: .55; cursor: not-allowed; }

/* the agent: steps, commands to copy, the pairing code */
.gw-steps { margin: 14px 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 10px; }
.gw-steps li > .gw-cmd { margin-top: 6px; }
.gw-more { margin: 4px 0 14px; }
.gw-more summary { cursor: pointer; color: var(--text-2); font-size: .84rem; font-weight: 600; }
.gw-cmd { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: var(--radius-xs);
  background: var(--surface-2); border: 1px solid var(--border); direction: ltr; }
.gw-cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font: 500 .84rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.gw-secret { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0; }
.gw-secret code { font: 600 .95rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; direction: ltr; unicode-bidi: isolate;
  padding: 6px 10px; border-radius: 8px; background: var(--surface-solid); border: 1px solid var(--border-strong); overflow-wrap: anywhere; }
.gw-secret code.gw-code { font-size: 1.5rem; letter-spacing: .14em; }

/* the admin's tables: a long name or reason wraps in its cell, the table stays in its card */
.gw-table td { vertical-align: top; white-space: normal; overflow-wrap: break-word; }
.gw-table td:first-child { min-width: 8rem; }
.gw-table details summary { cursor: pointer; color: var(--text-2); font-size: .84rem; font-weight: 600; white-space: nowrap; }
.gw-table details[open] { min-width: 300px; }
.gw-table td.wrap bdi { overflow-wrap: anywhere; white-space: normal; }
.gw-log { max-height: 560px; margin: 0; }

@media (max-width: 640px) {
  .gw-main { padding: 18px 16px 56px; }
  .gw-home b { display: none; }
  .gw-nav a span { display: none; }
  .gw-who { max-width: 9rem; }
  .gw-auth-card .card-body { padding: 16px; }
  .gw-brand { padding: 18px 16px 0; }
}
