/* ===========================================================================
   gate.css — everything live.js renders, and nothing else

   WHY THIS FILE EXISTS. web/import.html was the last screen with a wholly
   private stylesheet, which is why it was also the last one with a wholly
   private sign-in. Folding it onto the common gate meant giving it the CSS the
   gate needs — and linking the whole of app.css turned out to be the wrong way
   to do that. build-shell has a check for exactly this failure: a page that
   reuses an app.css class name inherits the half it did not set. import.html
   defines .btn, .card and main, and so does app.css. The two merge rather than
   one winning, and the result is a page that is subtly wrong in ways neither
   stylesheet reads as wrong on its own.

   Satisfying that check property by property would have been gaming it. So the
   rules live.js actually renders are HERE, in one file, and a page can take
   the gate without taking a design system it was not built against.

   app.css imports this at its top, so the eight screens that link app.css and
   the four built pages that inline it are unchanged and there is still exactly
   one definition of each rule.

   THE TOKENS BELOW ARE FALLBACKS, not the source of truth. app.css redefines
   every one of them immediately after importing this — including the dark-mode
   values — so these only apply on a page that links gate.css alone. Three of
   them (--forest-d, --raise, --line2) exist nowhere in import.html and the
   gate would render with unset colors without them.
   =========================================================================== */
:root{
  --cream:#f2f0ea; --surf:#faf9f5; --raise:#ffffff;
  --ink:#22301a; --muted:#6f6a5e; --line:#e4e0d2; --line2:#d6d1bf;
  --forest:#2e5e1e; --forest-d:#234a16; --sage:#87a05c;
  --red:#8b1a1a;
}

/* ---------- the account button and its menu ---------- */
.who{
  width:28px; height:28px; border-radius:50%; background:var(--sage); color:#12240b;
  display:grid; place-items:center; font-weight:700; font-size:11.5px; border:0;
}
.who:hover{background:#9dba7f}

/* The account menu. It carried hardcoded initials and no handler on all four
   screens, so the only way out of the app was to find the one page that still
   had a Sign out button. Two people sharing a machine could not tell whose
   session they were in. Mounted from live.js — see mountAccountMenu(). */
.whomenu{
  position:fixed; z-index:60; min-width:200px; padding:6px;
  background:var(--raise); border:1px solid var(--line2); border-radius:12px;
  box-shadow:var(--shadow); color:var(--ink);
}
.whomenu[hidden]{display:none}
.whomenu .whoem{
  padding:7px 10px 8px; font-size:12px; color:var(--muted);
  border-bottom:1px solid var(--line); margin-bottom:4px;
  overflow:hidden; text-overflow:ellipsis;
}
/* The control-room entry is an <a> rather than a <button> because it goes to a
   page, so middle-click and Back work — the same reason the rail uses links.
   It has to look like every other item in the menu, so the selector carries
   both and the anchor drops its underline. */
.whomenu button, .whomenu a[role="menuitem"]{
  display:block; width:100%; text-align:left; background:none; border:0;
  padding:8px 10px; border-radius:8px; font:inherit; font-size:13px; font-weight:600;
  color:var(--ink);
}
.whomenu a[role="menuitem"]{text-decoration:none; box-sizing:border-box}
.whomenu button:hover:not(:disabled),
.whomenu a[role="menuitem"]:hover{background:var(--cream)}
.whomenu button:disabled{color:var(--muted)}

/* ---------- the sign-in gate, the recovery panel, the no-account card ----- */
.gate{width:min(380px,100%); background:var(--surf); border:1px solid var(--line);
      border-radius:16px; padding:26px 24px 22px; box-shadow:var(--shadow);
      display:flex; flex-direction:column; gap:12px}
.gate h1{margin:0; font-size:20px; letter-spacing:-.015em}
.gate .lede{margin:0 0 6px; color:var(--muted); font-size:13.5px}
.gate label{display:flex; flex-direction:column; gap:5px; font-size:12px;
            font-weight:600; color:var(--muted)}
.gate input{font:inherit; font-weight:400; color:var(--ink); padding:9px 11px;
            border:1px solid var(--line2); border-radius:10px; background:var(--raise)}
.gate input:focus-visible{outline:2px solid var(--forest); outline-offset:1px;
                          border-color:var(--forest)}
.gate button[type=submit]{background:var(--forest); color:#fff; border:0;
  border-radius:11px; padding:10px 14px; font:inherit; font-weight:600; cursor:pointer}
.gate button[type=submit]:hover{background:var(--forest-d)}
.gate button[type=submit]:disabled{opacity:.55; cursor:default}
.gate .linkish{background:none; border:0; color:var(--forest); font:inherit;
  font-size:12.5px; text-decoration:underline; cursor:pointer; padding:2px}
/* THE LINK BUTTON IS A BUTTON NOW, not an underlined afterthought. It was
   styled as a footnote to the password, which is right for somebody who has an
   account and wrong for somebody who does not — and for that second person it
   is the ONLY control on this card that does anything. Bill, the first person
   outside the three of us to try the sandbox: "I wasn't able to create an
   account." He was looking at the control that creates one. */
.gate .gtalt{background:var(--raise); color:var(--forest); border:1px solid var(--forest);
  border-radius:11px; padding:9px 14px; font:inherit; font-weight:600; cursor:pointer}
.gate .gtalt:hover{background:var(--forest); color:#fff}
.gate .gtalt:disabled{opacity:.55; cursor:default}
/* `gt` prefixes for the same reason .gtwho has one, forty lines down: .hint and
   .note are short, useful words and this stylesheet is shared by every page. */
.gate .gthint{margin:0; font-size:12.5px; color:var(--muted); line-height:1.5;
  border-top:1px solid var(--line); padding-top:12px}
.gate .gthint b{color:var(--ink); font-weight:600}
/* A SENT LINK IS NOT AN ERROR, and until now it was painted like one: the
   success message and the failure message shared .err, so "a sign-in link is on
   its way" arrived in red under a red-alert role. Anybody would read that as a
   failure, and at least one person did. */
.gate .err{margin:2px 0 0; font-size:12.5px; color:var(--red); line-height:1.45}
.gate .gtnote{margin:2px 0 0; font-size:12.5px; color:var(--ink); line-height:1.5;
  background:var(--forest-bg); border-radius:9px; padding:9px 10px;
  /* The message is two sentences and a paragraph break, written as \n in one
     string so the two halves cannot drift apart in two elements. */
  white-space:pre-line}
/* The "you belong to nothing yet" card, which is the same card as the sign-in
   one and deliberately so: it is the same moment, one step further along.
   .gtwho rather than .who — .who is the round account initials button forty
   lines up, and reusing it here would inherit a 28px circle and clip the
   address it exists to show. The third such collision in this stylesheet, and
   the reason the build guards against them. */
.gate .gtwho{margin:0; font-size:13.5px; font-weight:600; color:var(--ink);
  background:var(--raise); border:1px solid var(--line2); border-radius:10px;
  padding:9px 11px; overflow-wrap:anywhere}
.gate button[data-out]{background:none; border:1px solid var(--line2); color:var(--ink);
  border-radius:11px; padding:9px 14px; font:inherit; font-weight:600; cursor:pointer;
  align-self:flex-start}
.gate button[data-out]:hover{border-color:var(--forest); color:var(--forest)}
