/*! connection.css 1.2.0 | DJ2000-UK/app-workbench */
/* The header chip from connection.js ("Offline · 3 to sync") and the sign-in banner
   under the header ("Syncing paused. Sign in to continue.").
   Every colour is one of the app's own tokens (--ink, --muted-bright, --amber,
   --panel, --line-strong, --void, --header-solid, --warning), which Kaizen, Shinpo,
   Hokyu and djcns.css all define. The chip follows the palette and stays calm:
   offline is normal. The banner is one thin line in the header's own colour, tinted
   with the warning orange, so it belongs to each palette and still reads as a
   warning (DJ, 2026-11-30: "less obnoxious, but still visible"). */

.conn-slot { display: flex; min-width: 0; justify-content: flex-start; }
.conn-slot:empty { display: none; }

.conn {
  display: inline-flex;
  box-sizing: border-box;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  color: var(--muted-bright);
  font-family: var(--font-sans, inherit);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.2;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
}
.conn__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.conn__text { overflow: hidden; text-overflow: ellipsis; }
.conn__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.conn--offline .conn__dot { background: var(--muted); }
.conn--waiting,
.conn--signin { border-color: color-mix(in srgb, var(--amber) 45%, transparent); color: var(--amber); }

/* Sign in is a link: a full 44 px target. */
.conn--signin { min-height: 44px; padding-inline: 14px 16px; cursor: pointer; }
.conn--signin:hover { background: color-mix(in srgb, var(--amber) 12%, var(--panel)); }
.conn--signin:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.conn--signin .conn__text::after { content: " ›"; }

@media (prefers-reduced-motion: no-preference) {
  .conn { animation: conn-in .2s ease-out; }
  @keyframes conn-in { from { opacity: 0; transform: translateY(-3px); } }
}

/* The sign-in banner. connection.js keeps its slot sticky under the header, as
   wide as the header and level with it (--conn-banner-top, --conn-banner-left,
   --conn-banner-width), and sets --conn-banner-height on the root for toasts. */
.conn-banner-slot {
  position: relative;
  box-sizing: border-box;
  width: var(--conn-banner-width, auto);
  margin-left: var(--conn-banner-left, 0px);
}
.conn-banner-slot[data-stuck="true"] { position: sticky; top: var(--conn-banner-top, 0px); }
.conn-banner-slot:empty { display: none; }

.conn-banner {
  /* The tint, opaque, so the page never shows through while it scrolls under. */
  --conn-banner-bg: color-mix(in srgb, var(--warning, var(--amber)) 15%, var(--header-solid, var(--void)));
  display: flex;
  box-sizing: border-box;
  width: 100%;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 5px max(14px, env(safe-area-inset-right, 0px)) 5px max(14px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid color-mix(in srgb, var(--warning, var(--amber)) 34%, transparent);
  background: var(--conn-banner-bg);
  color: var(--ink);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--void) 34%, transparent);
  font-family: var(--font-sans, inherit);
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
  text-transform: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* A finger needs 44 px (docs/PRINCIPLES.md); a mouse makes do with the thin line. */
@media (pointer: coarse) { .conn-banner { min-height: 44px; } }
.conn-banner__icon { flex: none; width: 16px; height: 16px; color: var(--warning, var(--amber)); fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.conn-banner__text { min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conn-banner__text strong { font-weight: 650; }
.conn-banner__action { color: var(--warning, var(--amber)); font-weight: 600; }
.conn-banner__go { flex: none; color: var(--warning, var(--amber)); font-size: 20px; font-weight: 500; line-height: 1; }
.conn-banner:hover,
.conn-banner:active { --conn-banner-bg: color-mix(in srgb, var(--warning, var(--amber)) 22%, var(--header-solid, var(--void))); }
.conn-banner:focus-visible { outline: 2px solid var(--warning, var(--amber)); outline-offset: -4px; }

@media (prefers-reduced-motion: no-preference) {
  .conn-banner { animation: conn-banner-in .22s ease-out; }
  @keyframes conn-banner-in { from { opacity: 0; transform: translateY(-4px); } }
}
