/* chrome.css — Top chrome chips + the settings modal.
   Load order is index.html's link order; it preserves the pre-split cascade.
   Rule: new styles go in the file that owns the feature, never back into one blob. */
/* ============ Chrome: brand / hint / week affordance ============ */
.chip-btn {
  font: 500 12px/1 var(--sans); letter-spacing: 0.04em;
  color: var(--muted); background: var(--panel-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; cursor: pointer;
  transition: all 0.16s ease; display: inline-flex; align-items: center; gap: 8px;
}
.chip-btn:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.chip-btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--glow-rgb), 0.20); }
.chip-btn svg { width: 15px; height: 15px; }
/* icon-only chip (the settings gear): square-ish, centered glyph */
.chip-icon { padding: 9px; border-radius: 999px; }
.chip-icon svg { width: 17px; height: 17px; }

/* ============ Account affordances (P14b) ============
   chrome.css already owns the settings modal's Google-account row, so the
   two new account entry points live here with it: the quiet chip beside the
   gear, and the one-time offer that follows a first landed plan.
   Both are token-only (no color literals, no face-identity geometry), so
   capsule, lumen and folio each get them in their own re-tokened ground. */
.acct-chip {
  padding: 7px 12px; font-size: 11.5px; letter-spacing: 0.05em;
  max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acct-chip .acct-dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--accent); opacity: 0.75; flex: none;
}

/* The offer: a quiet card above the compose field. Never modal, never a
   focus trap, never over the eyes — it sits low and can be ignored. */
.signin-offer {
  position: fixed; z-index: 40;
  right: 16px; bottom: 16px; transform: translateY(10px);
  width: min(360px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 16px;
  background: var(--panel-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.signin-offer.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.signin-offer p {
  margin: 0; font: 400 13px/1.5 var(--sans); color: var(--muted);
}
.signin-offer .signin-row { display: flex; align-items: center; gap: 8px; }
.signin-offer .signin-note { font: 400 12px/1.4 var(--sans); color: var(--faint); }

@media (prefers-reduced-motion: reduce) {
  .signin-offer { transition: opacity 0.01s linear; transform: none; }
  .signin-offer.show { transform: none; }
}

/* ============ Settings modal (P5-02) ============
   Centered dialog over a dimmed backdrop. Styled off the same Nocturne
   tokens as the rest of the app. Controls: on/off switches, a calendar
   entry point. */
.modal-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 24px;
  background: rgba(8, 12, 16, 0.46);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity 0.24s ease;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  width: min(440px, 94vw); max-height: 88vh; overflow-y: auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--panel-shadow);
  padding: 22px 24px 24px;
  transform: translateY(10px) scale(0.985);
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-overlay.show .modal { transform: translateY(0) scale(1); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.modal-title { font-family: var(--serif); font-weight: 500; font-size: 22px; color: var(--text); margin: 0; }
.modal-x {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer;
  transition: all 0.16s ease;
}
.modal-x:hover { color: var(--text); border-color: var(--accent); }
.modal-x:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--glow-rgb), 0.20); }
.modal-x svg { width: 16px; height: 16px; }

.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 16px 0; border-top: 1px solid var(--line);
}
.setting-row.col { flex-direction: column; align-items: stretch; gap: 12px; }
.setting-meta { min-width: 0; }
.setting-label { font: 600 14px/1.2 var(--sans); color: var(--text); margin: 0 0 3px; }
.setting-caption { font: 400 12px/1.4 var(--sans); color: var(--faint); margin: 0; }
.setting-soon {
  font: 600 10px/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 6px; margin-left: 4px; white-space: nowrap;
}

/* ---- on/off switch ---- */
.switch {
  position: relative; flex: none; width: 46px; height: 27px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--ground); cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.switch:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(var(--glow-rgb), 0.20); }
.switch .switch-knob {
  position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%;
  background: var(--faint); transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.18s ease;
}
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on .switch-knob { transform: translateX(19px); background: var(--ground); }

/* A column setting whose header still pairs label + switch side by side
   (the Reminders row, P9-03d). */
.setting-meta-row {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
}

/* ---- segmented control ----
   Reintroduced for the Face picker (P10-01) — a restored copy of the
   segmented style P10-00 removed with the theme section. Face-agnostic
   chrome: it styles the same in every face (tokens do the adapting). */
.segmented {
  display: inline-flex; gap: 4px; padding: 4px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--ground); width: max-content;
}
.seg {
  font: 500 12px/1 var(--sans); letter-spacing: 0.03em;
  color: var(--muted); background: transparent;
  border: 1px solid transparent; border-radius: 999px;
  padding: 8px 16px; cursor: pointer;
  transition: all 0.16s ease;
}
.seg:hover { color: var(--text); }
.seg:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--glow-rgb), 0.20); }
.seg.on { color: var(--ground); background: var(--accent); }

/* ---- calendar row ---- */
.cal-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-note {
  font: 500 12px/1 var(--mono); color: var(--faint);
  opacity: 0; transition: opacity 0.2s ease;
}
.cal-note.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .modal-overlay, .modal, .switch .switch-knob { transition: none !important; }
}

/* ============ Auth gate: the sign-in wall ============
   The whole interactive surface sits behind Google sign-in. `data-auth` on
   #app drives it (set in app.js authGate):
     pending — /v1/session hasn't answered yet. Show only the eyes; hide the
               dock, the peek handle, the conversation surface AND the wall,
               so nothing flashes the wrong state for signed-in users.
     out     — not signed in. Hide the input; show the wall.
     in      — full app (or guest access when sign-in is disabled server-side).
   The eyes (.face-rig) are never gated: the presence stays alive behind the
   wall. */
#app[data-auth="pending"] #dock,
#app[data-auth="pending"] #peek-handle,
#app[data-auth="pending"] .surface,
#app[data-auth="out"] #dock,
#app[data-auth="out"] #peek-handle,
#app[data-auth="out"] #horizon,
#app[data-auth="out"] .surface {
  display: none !important;
}
/* The wall shows only when the gate has decided we are signed out. */
#auth-wall { display: none; }
#app[data-auth="out"] #auth-wall { display: block; }

#auth-wall {
  position: absolute; left: 50%; bottom: clamp(40px, 12vh, 120px);
  transform: translateX(-50%);
  width: min(560px, 90vw);
  text-align: center;
  z-index: 45;
  animation: aw-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes aw-rise {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.aw-title {
  font: 500 clamp(26px, 4vw, 38px)/1.05 var(--serif);
  letter-spacing: -0.01em; color: var(--text); margin: 0 0 14px;
  text-wrap: balance;
}
.aw-sub {
  font: 400 15px/1.55 var(--sans); color: var(--muted);
  margin: 0 auto 26px; max-width: 46ch;
}
.aw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 11px;
  font: 600 15px/1 var(--sans); letter-spacing: 0.01em;
  color: var(--text); background: var(--panel-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 13px 26px; cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.aw-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.aw-btn:focus-visible {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--glow-rgb), 0.22);
}
.aw-btn:active { transform: translateY(0) scale(0.98); }
.aw-g { flex: 0 0 auto; }
.aw-note {
  font: 500 13px/1.4 var(--sans); color: var(--faint);
  margin: 16px 0 0; min-height: 16px;
  opacity: 0; transition: opacity 0.2s ease;
}
.aw-note.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  #auth-wall { animation: none; }
}

