/* Active-session island: a small black pill in the top bar (js/session-island.js). Calm: no flashes, 0.6 s morph. */
.si {
  --si-bg: #0b0b0d;
  --si-c: var(--blue, #1f6bff);
  --si-c2: var(--blue, #1f6bff);
  --si-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --si-t: 0.6s;
  position: relative; flex: none; width: 0; height: 44px;
  margin-inline-start: auto; z-index: 45;
  opacity: 0; transition: opacity var(--si-t) var(--ease-soft, ease);
}
.si.is-in { opacity: 1; }
.si[hidden] { display: none; }
/* the pill sits next to the bar actions: they stop taking the free space themselves */
.nav:has(~ .si), .si ~ .bar-actions { margin-inline-start: 0; }

.si-card {
  position: absolute; top: 5px; left: 0; box-sizing: border-box; overflow: hidden;
  display: grid; grid-template-rows: auto auto; align-content: start;
  border: 1px solid transparent; border-radius: 17px; color: #f3f3f1;
  background:
    linear-gradient(var(--si-bg), var(--si-bg)) padding-box,
    linear-gradient(100deg, color-mix(in srgb, var(--si-c) 60%, transparent), color-mix(in srgb, var(--si-c2) 60%, transparent)) border-box;
  font-family: var(--font-text, "Cairo", system-ui, sans-serif);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition: width var(--si-t) var(--si-ease), left var(--si-t) var(--si-ease), border-radius var(--si-t) var(--si-ease), box-shadow var(--si-t) var(--si-ease);
}
.si.is-open .si-card { border-radius: 24px; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6); }

.si-head {
  display: flex; align-items: center; gap: 8px; box-sizing: border-box;
  width: max-content; height: 32px; padding: 0 12px; margin: 0;
  background: none; border: 0; color: inherit; font: inherit; cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.si.is-open .si-head { width: 100%; height: 38px; }
.si-head:focus-visible { outline: 2px solid var(--blue-strong, #4a88ff); outline-offset: 2px; border-radius: 17px; }
.si-dot {
  flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--si-c);
  box-shadow: 0 0 8px color-mix(in srgb, var(--si-c) 70%, transparent);
  animation: si-breathe 4s ease-in-out infinite;
}
@keyframes si-breathe { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
.si-name {
  max-width: 160px; overflow: hidden; font-weight: 600; font-size: 0.8125rem; line-height: 1;
  transition: max-width var(--si-t) var(--si-ease), opacity var(--si-t) ease;
}
.si-time {
  font-family: var(--font-display, "Barlow Condensed", system-ui, sans-serif); font-weight: 700; font-size: 1.0625rem;
  line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; transition: color var(--si-t) ease;
}
.si-time.is-low { color: var(--yellow, #f5c518); }
.si-chev { flex: none; width: 0; opacity: 0; font-size: 0.75rem; color: #a9a9b0; transition: opacity var(--si-t) ease; }
.si.is-open .si-chev { width: auto; opacity: 1; margin-inline-start: auto; }
.si-time { margin-inline-start: 0; }
.si.is-open .si-name { flex: 1; text-align: start; }

.si-more { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows var(--si-t) var(--si-ease), opacity var(--si-t) ease; }
.si.is-open .si-more { grid-template-rows: 1fr; opacity: 1; }
.si-more-in { min-height: 0; overflow: hidden; }
.si-body { padding: 4px 14px 14px; }
.si-rows { margin: 0 0 12px; padding: 10px 0; border-block: 1px solid rgba(255, 255, 255, 0.08); display: grid; gap: 6px; }
.si-row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.8125rem; line-height: 1.4; }
.si-row dt { color: #a9a9b0; margin: 0; }
.si-row dd { margin: 0; font-weight: 600; }
.si-row dd bdi { unicode-bidi: isolate; }
.si-acts { display: flex; gap: 8px; }
.si-btn {
  flex: 1; box-sizing: border-box; min-height: 40px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  font: 700 0.8125rem/1.2 var(--font-text, "Cairo", system-ui, sans-serif); text-decoration: none; white-space: nowrap;
  color: #f3f3f1; background: rgba(255, 255, 255, 0.08); border: 0;
  transition: background-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}
.si-btn:focus-visible { outline: 2px solid var(--blue-strong, #4a88ff); outline-offset: 2px; }
.si-btn[disabled] { opacity: 0.5; cursor: default; }
.si-btn.is-danger { background: rgba(229, 35, 47, 0.18); color: #ff6a73; }
.si-btn.is-solid { background: var(--red, #e5232f); color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .si-btn:hover:not([disabled]) { background: rgba(255, 255, 255, 0.16); }
  .si-btn.is-danger:hover:not([disabled]) { background: rgba(229, 35, 47, 0.3); }
  .si-btn.is-solid:hover:not([disabled]) { background: var(--red-strong, #ff3946); }
}
.si-ask { margin: 0 0 10px; font-size: 0.8125rem; line-height: 1.5; font-weight: 600; }
.si-msg { margin: 0; min-height: 40px; display: flex; align-items: center; font-size: 0.8125rem; line-height: 1.5; font-weight: 600; }
.si-msg.is-err { color: #ff8a92; }
.si-view[hidden] { display: none; }
.si.is-gone { opacity: 0; }

/* phone: just a dot and the time; the name appears when it opens (an overlay below the pill) */
@media (max-width: 720px) {
  .si:not(.is-open) .si-name { max-width: 0; opacity: 0; }
  .si:not(.is-open) .si-head { gap: 6px; padding: 0 10px; }
  .si-time { font-size: 1rem; }
}

/* ---------- signed in: "Welcome, George · Log out" in place of "Log in / Sign up" (js/session-island.js) ---------- */
.si-acc { display: inline-flex; align-items: center; gap: 2px; min-width: 0; }
.bar-actions .si-acc .link-quiet { display: inline-block; white-space: nowrap; padding: 10px 6px; }
.si-hi { max-width: 16em; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.si-out { background: none; border: 0; cursor: pointer; color: var(--muted, #a9a9b0); font: inherit; font-size: var(--step-small); font-weight: 600; }
.si-out:disabled { cursor: progress; opacity: 0.7; }
@media (hover: hover) and (pointer: fine) { .si-out:hover { color: var(--ink, #fff); } }
@media (max-width: 720px) {
  .bar-actions .si-acc .link-quiet { padding: 10px 4px; }
  .si-hi { max-width: 7.5em; }
}
/* the hub bar also carries "Change branch": on small phones the greeting gives way (the session pill and Log out stay) */
@media (max-width: 440px) { .bar-actions.hub-actions .si-acc .si-hi { display: none; } }
@media (max-width: 380px) { .bar-actions .si-acc .si-hi { display: none; } }
