/* Shared styles. Tuned for phones outdoors in sunlight: light background,
   black text, heavy weights, huge touch targets, color always paired with text. */
:root {
  --bg: #f3f2ee;
  --card: #ffffff;
  --ink: #0b0b0b;
  --muted: #4a4a4a;
  --line: #0b0b0b;
  --green: #0b7a2b;
  --yellow: #ffd21f;
  --red: #c1121f;
  --gray: #5b5b5b;
  --blue: #0b4fb3;
  --focus: #0b4fb3;
  --radius: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 18px; line-height: 1.3;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: contain;
}
button, input, select { font: inherit; color: inherit; }
button {
  cursor: pointer; border: 3px solid var(--line); border-radius: var(--radius);
  background: var(--card); font-weight: 800; min-height: 56px; padding: 8px 14px;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
button:disabled { opacity: 0.35; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; }
button:active:not(:disabled) { transform: translateY(2px); }

/* Status colors — always used with a text label */
.c-green  { background: var(--green);  color: #fff; }
.c-yellow { background: var(--yellow); color: #000; }
.c-red    { background: var(--red);    color: #fff; }
.c-gray   { background: var(--gray);   color: #fff; }

/* Top bar */
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: #111; color: #fff; position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 18px; margin: 0; letter-spacing: 0.04em; flex: 1; }
.topbar .who { background: #333; color: #fff; border: 2px solid #777; min-height: 40px; padding: 8px 10px; font-size: 15px; font-weight: 800; border-radius: 10px; text-decoration: none; white-space: nowrap; }
.topbar span.who { background: none; border-color: transparent; padding-left: 0; padding-right: 0; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: #2ecc40; display: inline-block; }
body.offline .dot { background: #ff4136; }

/* Connection banner */
#conn-banner {
  display: none; position: sticky; top: 0; z-index: 30;
  background: var(--red); color: #fff; font-weight: 900; text-align: center;
  padding: 12px 10px; font-size: 18px; border-bottom: 4px solid #000;
}
body.offline #conn-banner { display: block; }
body.offline .needs-conn { pointer-events: none; opacity: 0.3; filter: grayscale(1); }
#fatal {
  display: none; position: fixed; inset: 0; z-index: 100; background: #111; color: #fff;
  padding: 40px 24px; text-align: center; font-size: 22px; font-weight: 800;
}
#fatal.show { display: block; }

/* Toast */
#toast {
  position: fixed; left: 50%; top: 70px; transform: translateX(-50%); z-index: 50;
  max-width: 92vw; padding: 14px 18px; border-radius: var(--radius); border: 3px solid #000;
  font-weight: 800; font-size: 18px; text-align: center; display: none; box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
#toast.show { display: block; }
#toast.ok { background: #d9f7df; }
#toast.err { background: #ffe0e0; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 13px; font-weight: 900;
  letter-spacing: 0.04em; border: 2px solid currentColor;
}
@keyframes flash { 0% { transform: scale(1.03); } 100% { transform: scale(1); } }
.flash { animation: flash 0.35s ease-out; }

/* Keep tap targets stable while contents re-render */
.card *, .chip * { pointer-events: none; }
