/* The top bar, in the stats dashboard's style (quickiecoin-stats web/src/styles/app.css, "shell"), and the controls in it.
   The tokens are the stats light tokens under a --qc- prefix, because this page's own --text (a font) and --surface (a
   colour) mean something else. Values and sources: quickiecoin-stats web/DESIGN.md. */

:root {
  --qc-surface: #ffffff;
  --qc-surface-tint: #f4f8fb;
  --qc-text: #10263b;
  --qc-text-muted: #4a6076;
  --qc-text-blue: #2e6fa8;
  --qc-border: #e1eaf2;
  --qc-border-strong: #c6dff3;
  --qc-accent-soft: #dcebf8;
  --qc-focus: #2e6fa8;

  --qc-font-display: 'Fredoka', system-ui, sans-serif;
  --qc-font-body: 'Outfit', system-ui, sans-serif;
  --qc-font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --qc-text-body: 15px;
  --qc-text-small: 13px;
  --qc-text-label: 11.5px;
  --qc-tracking-label: .14em;
  --qc-leading-tight: 1.05;
  --qc-leading-body: 1.4;

  --qc-space-1: 4px;
  --qc-space-2: 8px;
  --qc-space-3: 12px;
  --qc-radius-card: 16px;
  --qc-radius-field: 12px;
  --qc-radius-pill: 999px;
  --qc-shadow-pop: 0 12px 28px rgba(16, 38, 59, .22);
  --qc-press: 120ms ease-out;
  --qc-tap-min: 44px;
  --qc-header-h: 60px;
  --qc-gutter: 24px;
}

@media (max-width: 640px) { :root { --qc-gutter: 16px; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--qc-surface);
  border-bottom: 1px solid var(--qc-border);
}

.topbar :focus-visible { outline: 2px solid var(--qc-focus); outline-offset: 2px; }

.topbar-in {
  max-width: 1240px;
  margin: 0 auto;
  min-height: var(--qc-header-h);
  padding: var(--qc-space-2) var(--qc-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--qc-space-3);
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: var(--qc-space-2); }

.brand-sub {
  font-family: var(--qc-font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: var(--qc-leading-tight);
  color: var(--qc-text-blue);
}

.nav { display: flex; gap: var(--qc-space-1); margin-right: auto; margin-left: 16px; }

.nav a {
  font-family: var(--qc-font-body);
  font-size: var(--qc-text-body);
  font-weight: 500;
  color: var(--qc-text-muted);
  text-decoration: none;
  padding: var(--qc-space-2) var(--qc-space-3);
  border-radius: var(--qc-radius-pill);
}

.nav a:hover { color: var(--qc-text); }
.nav a[aria-current="page"] { background: var(--qc-accent-soft); color: var(--qc-text-blue); }

.topbar-actions { display: flex; align-items: center; gap: var(--qc-space-2); flex-wrap: wrap; }

.who {
  font-size: var(--qc-text-small);
  color: var(--qc-text-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* "Sign out" and "Sign out everywhere": the stats header's quiet buttons. */
.signout {
  font-family: var(--qc-font-display);
  font-weight: 600;
  font-size: var(--qc-text-body);
  min-height: var(--qc-tap-min);
  padding: 0 var(--qc-space-3);
  color: var(--qc-text-blue);
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: var(--qc-radius-pill);
  cursor: pointer;
}

.signout:hover:not(:disabled) { background: var(--qc-surface-tint); border-color: var(--qc-border); }
.signout:disabled { opacity: .5; cursor: default; }

/* Says which sign-out is which, and, in red, when one failed. Its own row under the bar. */
.session-note {
  flex: 1 1 100%;
  margin: 0;
  padding-bottom: var(--qc-space-2);
  text-align: right;
  font-size: 11px;
  line-height: 1.35;
  color: var(--qc-text-muted);
}

.session-note-bad { color: var(--bad); }

@media (max-width: 640px) {
  .brand-sub { font-size: var(--qc-text-body); }
  .nav { order: 3; width: 100%; margin: 0; }
  .who { display: none; }
  .session-note { text-align: left; }
}

/* App switcher. The stats spec (quickiecoin-stats web/DESIGN.md, "App switcher"), copied as it is with the token names prefixed
   --qc- (this page already has a --text and a --surface of its own). */
.appsw { position: relative; display: inline-flex; }
.appsw-btn { margin-left: calc(-1 * (var(--qc-space-3) + 1.5px)); display: inline-flex; align-items: center; gap: var(--qc-space-2); min-height: var(--qc-tap-min); padding: 0 var(--qc-space-3); background: transparent; color: var(--qc-text-blue); border: 1.5px solid transparent; border-radius: var(--qc-radius-pill); cursor: pointer; font: inherit; transition: background var(--qc-press), border-color var(--qc-press); }
.appsw-btn:hover { background: var(--qc-surface-tint); border-color: var(--qc-border); }
.appsw-btn[aria-expanded="true"] { background: var(--qc-accent-soft); border-color: var(--qc-border-strong); }
.appsw-word { font-family: var(--qc-font-display); font-weight: 600; font-size: var(--qc-text-body); line-height: var(--qc-leading-tight); }
.appsw-chev { flex: none; transition: transform var(--qc-press); }
.appsw-btn[aria-expanded="true"] .appsw-chev { transform: rotate(180deg); }
.appsw-panel { position: absolute; z-index: 30; top: calc(100% + var(--qc-space-2)); left: 0; width: 340px; max-width: calc(100vw - 2 * var(--qc-gutter)); padding: var(--qc-space-2); background: var(--qc-surface); border: 1px solid var(--qc-border-strong); border-radius: var(--qc-radius-card); box-shadow: var(--qc-shadow-pop); }
.appsw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--qc-space-1); }
.appsw-item { display: grid; grid-template-columns: 1fr auto; column-gap: var(--qc-space-3); row-gap: 2px; align-items: center; min-height: var(--qc-tap-min); padding: var(--qc-space-3); border-radius: var(--qc-radius-field); color: var(--qc-text); text-decoration: none; }
.appsw-item:hover { background: var(--qc-accent-soft); }
.appsw-item-on, .appsw-item-on:hover { background: var(--qc-surface-tint); }
.appsw-name { font-family: var(--qc-font-display); font-weight: 600; font-size: var(--qc-text-body); line-height: var(--qc-leading-tight); }
.appsw-item-on .appsw-name { color: var(--qc-text-blue); }
.appsw-cur { font-family: var(--qc-font-mono); font-size: var(--qc-text-label); font-weight: 600; letter-spacing: var(--qc-tracking-label); text-transform: uppercase; color: var(--qc-text-blue); }
.appsw-desc { grid-column: 1 / -1; font-size: var(--qc-text-small); line-height: var(--qc-leading-body); color: var(--qc-text-muted); }
@media (prefers-reduced-motion: reduce) { .appsw-btn, .appsw-chev { transition: none; } }
@media (max-width: 640px) { .appsw-panel { width: calc(100vw - 2 * var(--qc-gutter)); } }
