@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/fraunces-latin-600-normal.woff2") format("woff2");
}

/* Sync2VA Connect: dark glass over the Sync2VA artwork.
   Two lights, as in the logo: Volt blue and Ember orange. Blue is "you" and the app's actions; orange marks staff and
   what needs attention; green only ever means "here now". Glass panels let the artwork show through, but messages
   always sit on a solid enough surface to read on a phone in the evening. Titles in Fraunces, messages in the
   phone's own font. */

:root {
  --void: #050a18;
  --abyss: #0a1430;
  --volt: #2f8cff;
  --volt-hi: #78b9ff;
  --volt-deep: #1957d6;
  --ember: #ff8a1f;
  --ember-hi: #ffb35c;
  --ice: #eaf2ff;
  --ice-2: #c7d4ea;
  --mist: #93a3bf;
  --live: #35e39b;
  --danger: #ff6b5e;
  --line: rgba(150, 185, 255, 0.14);
  --line-hi: rgba(170, 205, 255, 0.26);
  --glass: linear-gradient(160deg, rgba(24, 42, 86, 0.58), rgba(8, 15, 36, 0.66));
  --glass-solid: rgba(9, 17, 38, 0.86);
  --glass-deep: rgba(5, 10, 24, 0.55);
  --hover: rgba(120, 170, 255, 0.08);
  --inset: inset 0 1px 0 rgba(255, 255, 255, 0.09), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  --shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.75), 0 2px 6px rgba(0, 0, 0, 0.3);
  --blur: blur(24px) saturate(150%);
  --radius: 24px;
  --art-opacity: 0.36; /* how strongly the Sync2VA artwork shows behind the glass */
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --lx: 0;
  --ly: 0;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 15px/1.45 var(--sans);
  color: var(--ice);
  background: var(--void);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--volt-hi); }
button { font: inherit; color: inherit; }
.ic { flex: none; display: block; }
.display { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; font-optical-sizing: auto; }
.muted { color: var(--mist); }
.small { font-size: 13px; }
.pad { padding: 12px 16px; margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--volt-hi); outline-offset: 2px; }
::selection { background: rgba(47, 140, 255, 0.45); color: #fff; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
[data-motion="calm"] *, [data-motion="calm"] *::before, [data-motion="calm"] *::after { animation: none !important; }

/* ---------- the scene behind everything ---------- */
.scene {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(1100px 700px at 72% 6%, rgba(23, 68, 160, 0.55), transparent 62%),
    radial-gradient(900px 620px at 12% 100%, rgba(150, 64, 8, 0.42), transparent 60%),
    linear-gradient(180deg, #060c1d, #04081a);
}
.scene-art {
  position: absolute; inset: -5%;
  background: url("brand/backdrop.jpg") center 40% / cover no-repeat;
  background-image: image-set(url("brand/backdrop.webp") type("image/webp"), url("brand/backdrop.jpg") type("image/jpeg"));
  background-position: center 40%;
  background-size: cover;
  opacity: var(--art-opacity);
  transform: scale(1.08);
  will-change: transform;
}
#scene-canvas { position: absolute; inset: 0; mix-blend-mode: screen; opacity: 0.95; }
.scene-veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 35%, rgba(2, 5, 14, 0.62) 100%),
    linear-gradient(180deg, rgba(3, 6, 16, 0.25), rgba(3, 6, 16, 0.45));
}
[data-chat="closed"] .scene-art { opacity: calc(var(--art-opacity) * 0.7); filter: saturate(0.6); }
@media (max-width: 759px) {
  /* On a phone the logo sits whole in the middle of the screen, fading softly at its top and bottom */
  .scene-art {
    inset: 0; background-size: auto 56%; background-position: 50% 45%; --art-opacity: 0.4;
    -webkit-mask-image: linear-gradient(180deg, transparent 17%, #000 34%, #000 62%, transparent 79%);
    mask-image: linear-gradient(180deg, transparent 17%, #000 34%, #000 62%, transparent 79%);
  }
}
/* Sign-in and setup: the artwork goes soft and out of focus behind the sharp logo in front (depth of field) */
.plain .scene-art, .mg .scene-art { filter: blur(16px) saturate(1.25); --art-opacity: 0.55; }

/* ---------- glass ---------- */
.glass, .pane-list, .pane-info.is-on, .sheet, .signin-card, .card, .table-wrap, .mg-top, .toast {
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--inset), var(--shadow);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .pane-list, .pane-info.is-on, .sheet, .signin-card, .card, .table-wrap, .mg-top, .toast, .thread-head, .composer-wrap { background: var(--glass-solid); }
}
/* The 3D tilt: cards marked data-tilt lean toward the pointer, with a soft glare (computers, Full motion) */
[data-tilt] {
  position: relative;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-tilt].is-tilting { transition: transform 0.08s linear; }
[data-tilt]::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.4s ease;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.13), transparent 45%);
}
[data-tilt].is-tilting::after { opacity: 1; }

/* ---------- buttons, fields, notes ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 14px; border: 1px solid var(--line-hi);
  font-weight: 600; text-decoration: none; cursor: pointer; color: var(--ice);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 6px 16px -8px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  border-color: rgba(140, 195, 255, 0.5); color: #fff;
  background: linear-gradient(180deg, #2a78ec 0%, #1f66e0 50%, #1a56cc 100%);
  box-shadow: inset 0 1px 0 rgba(170, 215, 255, 0.5), inset 0 -2px 6px rgba(0, 30, 90, 0.35), 0 12px 30px -10px rgba(47, 140, 255, 0.75);
}
.btn-danger {
  border-color: rgba(255, 170, 150, 0.4); color: #fff;
  background: linear-gradient(180deg, #ff8273, #e5483c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 12px 28px -12px rgba(229, 72, 60, 0.8);
}
.btn-quiet { background: rgba(255, 255, 255, 0.04); }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.link { background: none; border: 0; padding: 0; color: var(--volt-hi); cursor: pointer; text-decoration: underline; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid transparent; background: transparent; color: var(--ice-2); cursor: pointer; flex: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.icon-btn:hover { background: var(--hover); border-color: var(--line); }
.field { display: grid; gap: 6px; margin: 0 0 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ice-2); }
.field input, .field textarea, .field select, input[type=text], input[type=date], input[type=time], input[type=number], input[type=email], input[type=password], select {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-hi);
  background: rgba(3, 8, 22, 0.55); color: var(--ice); font: inherit; font-size: 16px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus, .field textarea:focus, select:focus, input:focus { outline: none; border-color: var(--volt); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35), 0 0 0 4px rgba(47, 140, 255, 0.18); }
input::placeholder, textarea::placeholder { color: rgba(147, 163, 191, 0.75); }
::-webkit-calendar-picker-indicator { filter: invert(0.85); }
.field textarea { resize: vertical; }
.note { padding: 10px 14px; border-radius: 12px; margin: 0 0 14px; font-size: 14px; border: 1px solid; }
.note-error { background: rgba(255, 90, 75, 0.12); color: #ffc2bb; border-color: rgba(255, 107, 94, 0.35); }
.note-info { background: rgba(47, 140, 255, 0.12); color: #cfe3ff; border-color: rgba(47, 140, 255, 0.35); }
.note-ok { background: rgba(53, 227, 155, 0.10); color: #b8f5da; border-color: rgba(53, 227, 155, 0.3); }
.radio { display: flex; gap: 10px; align-items: center; min-height: 40px; cursor: pointer; }
.radio input, input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--volt); }
.row-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* ---------- avatars: small 3D spheres; staff in deep blue ---------- */
.av {
  --size: 44px;
  --c1: #3a4f7d; --c2: #1a2647; --ink: #e9f0ff;
  position: relative; display: inline-grid; place-items: center; width: var(--size); height: var(--size);
  border-radius: 50%; flex: none; font-weight: 700; font-size: calc(var(--size) * 0.36); letter-spacing: 0.02em; color: var(--ink);
  background: radial-gradient(circle at 32% 26%, var(--c1) 0%, var(--c2) 72%);
  box-shadow: inset 0 -3px 8px rgba(0, 0, 0, 0.45), inset 0 2px 3px rgba(255, 255, 255, 0.22), 0 6px 14px -6px rgba(0, 0, 0, 0.7);
}
.av-in { line-height: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45); position: relative; z-index: 1; }
.av-xs { --size: 28px; }
.av-sm { --size: 34px; }
.av-lg { --size: 58px; }
.av-staff { --c1: #4f9bff; --c2: #123a8f; }
.av-t1 { --c1: #6c7fb8; --c2: #27335e; }
.av-t2 { --c1: #4f9c86; --c2: #183f37; }
.av-t3 { --c1: #a46a98; --c2: #43213f; }
.av-t4 { --c1: #b08c4f; --c2: #4a3613; }
.av-t5 { --c1: #4f98a6; --c2: #163e48; }
.av-t6 { --c1: #8371c4; --c2: #2c2257; }
/* The live ring: the logo's two rings, blue and orange, turning slowly around someone who is here now */
.av.is-live::before {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--volt), var(--volt-hi) 25%, var(--ember) 50%, var(--ember-hi) 75%, var(--volt));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  animation: spin 7s linear infinite;
}
.av.is-live::after {
  content: ""; position: absolute; right: -2px; bottom: -2px; width: 30%; height: 30%; min-width: 9px; min-height: 9px; border-radius: 50%;
  background: var(--live); border: 2px solid var(--void); box-shadow: 0 0 10px rgba(53, 227, 155, 0.8); z-index: 2;
}
@keyframes spin { to { transform: rotate(360deg); } }
.tile {
  display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; flex: none; position: relative;
  font: 800 10.5px/1 var(--sans); letter-spacing: 0.06em; color: #fff;
  background: linear-gradient(150deg, #1d3f86, #0b1838);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -3px 8px rgba(0, 0, 0, 0.4), 0 8px 18px -8px rgba(47, 140, 255, 0.55);
  border: 1px solid rgba(120, 185, 255, 0.35);
}
.tile-class::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: 5px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--volt), var(--ember)); }
.tile-room { background: linear-gradient(150deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03)); color: var(--ice-2); border-color: var(--line-hi); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); }

/* ---------- the app frame: floating glass panels on a computer, full screen on a phone ---------- */
.app-body { overflow: hidden; }
.app { position: relative; z-index: 1; height: 100vh; height: 100dvh; display: grid; grid-template-columns: 1fr; }
.boot { display: grid; place-items: center; align-content: center; gap: 14px; height: 100%; color: var(--mist); }
.boot img { mix-blend-mode: screen; animation: float 4s ease-in-out infinite; }
.pane { min-height: 0; min-width: 0; }
/* On a phone the chat list lies straight on the scene (the logo shows through); on a computer it's a glass panel */
.pane-list { display: flex; flex-direction: column; border-width: 0; box-shadow: none; background: linear-gradient(180deg, rgba(5, 10, 24, 0.18), rgba(5, 10, 24, 0.42)); -webkit-backdrop-filter: none; backdrop-filter: none; }
.pane-list .row-title { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5); }
.pane-thread { display: none; flex-direction: column; position: relative; }
.pane-info { display: none; }
.app[data-view="thread"] .pane-list { display: none; }
.app[data-view="thread"] .pane-thread { display: flex; }
@media (min-width: 760px) {
  .app { grid-template-columns: minmax(320px, 380px) 1fr; gap: 14px; padding: 14px; }
  .app[data-view] .pane-list { display: flex; border-width: 1px; border-radius: var(--radius); box-shadow: var(--inset), var(--shadow); overflow: hidden; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
  .app[data-view] .pane-thread { display: flex; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: rgba(4, 9, 22, 0.32); }
  .back { display: none !important; }
}
@media (min-width: 1180px) { .app.info-on { grid-template-columns: 380px 1fr 330px; } }
.pane-info.is-on { display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 30; overflow: auto; background: var(--glass-solid); }
@media (min-width: 1180px) { .pane-info.is-on { position: static; border-radius: var(--radius); background: var(--glass); } }

/* ---------- chat list ---------- */
.list-head { padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 8px; display: grid; gap: 12px; }
.list-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 40px; height: auto; mix-blend-mode: screen; }
.list-title h1 {
  font-size: 32px; margin: 0; line-height: 1;
  background: linear-gradient(180deg, #ffffff 30%, #a9cbff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.list-actions { display: flex; align-items: center; gap: 4px; }
.me-btn { position: relative; border: 0; background: none; padding: 3px; border-radius: 50%; cursor: pointer; }
.dot-badge {
  position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; z-index: 3;
  background: linear-gradient(180deg, var(--ember-hi), var(--ember)); color: #2b1300; font: 800 11px/18px var(--sans);
  box-shadow: 0 0 12px rgba(255, 138, 31, 0.7);
}
.hours-chip {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 14px;
  border-radius: 999px; border: 1px solid var(--line-hi); background: rgba(3, 8, 22, 0.45); font-size: 13px; color: var(--ice-2); cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.hours-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mist); }
.hours-chip.is-open .hours-dot { background: var(--live); box-shadow: 0 0 0 0 rgba(53, 227, 155, 0.6); animation: breathe 2.8s ease-in-out infinite; }
.hours-chip.is-closed { color: var(--mist); }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(53, 227, 155, 0.55); } 50% { box-shadow: 0 0 0 6px rgba(53, 227, 155, 0); } }

/* Staff online: the card students should notice first */
.strip {
  border-radius: 20px; padding: 14px 14px 12px; color: #fff; overflow: hidden;
  background:
    radial-gradient(140% 120% at 0% 0%, rgba(47, 140, 255, 0.35), transparent 55%),
    radial-gradient(120% 140% at 100% 100%, rgba(255, 138, 31, 0.28), transparent 55%),
    linear-gradient(160deg, rgba(20, 40, 92, 0.85), rgba(8, 16, 40, 0.9));
  border: 1px solid rgba(140, 190, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 18px 40px -18px rgba(47, 140, 255, 0.55);
}
.strip.is-empty { background: rgba(3, 8, 22, 0.42); color: var(--ice-2); border: 1px dashed var(--line-hi); box-shadow: none; }
.strip-head { display: flex; align-items: center; gap: 8px; }
.strip-title { font-family: var(--serif); font-weight: 600; font-size: 17px; }
.strip-count { font: 800 12px/20px var(--sans); min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--live); color: #04281a; text-align: center; box-shadow: 0 0 12px rgba(53, 227, 155, 0.6); }
.strip-note { margin: 4px 0 0; font-size: 13px; color: var(--mist); }
.strip-row { display: flex; gap: 4px; overflow-x: auto; margin: 10px -4px 0; padding: 6px 4px 2px; scrollbar-width: none; transform: translateZ(18px); }
.strip-row::-webkit-scrollbar { display: none; }
.strip-person {
  display: grid; justify-items: center; gap: 2px; width: 72px; flex: none; background: none; border: 0; color: inherit; cursor: pointer;
  padding: 6px 0; border-radius: 14px; transition: transform 0.2s ease, background 0.2s ease;
}
.strip-person:hover { background: rgba(255, 255, 255, 0.07); transform: translateY(-2px); }
.strip-name { font-size: 13px; font-weight: 600; margin-top: 7px; max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-role { font-size: 11px; color: rgba(220, 232, 255, 0.72); }

.search {
  display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border-radius: 14px;
  background: rgba(3, 8, 22, 0.5); border: 1px solid var(--line); color: var(--mist);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}
.search:focus-within { border-color: var(--volt); }
.search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--ice); outline: none; padding: 8px 0; box-shadow: none; min-height: 0; }
.list-scroll { flex: 1; overflow-y: auto; padding: 0 8px calc(16px + var(--safe-b)); scrollbar-width: thin; scrollbar-color: rgba(150, 185, 255, 0.2) transparent; }
.list-label { font: 600 12.5px/1 var(--sans); color: var(--mist); margin: 18px 12px 8px; letter-spacing: 0.01em; }
.list-empty { padding: 24px 12px; color: var(--mist); text-align: center; }
.row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 1px solid transparent; border-radius: 16px;
  background: none; text-align: left; cursor: pointer; color: var(--ice);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.row:hover { background: var(--hover); border-color: var(--line); }
.row.is-open {
  background: linear-gradient(90deg, rgba(47, 140, 255, 0.20), rgba(47, 140, 255, 0.05));
  border-color: rgba(120, 185, 255, 0.3);
}
.row.is-open::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: linear-gradient(var(--volt-hi), var(--volt)); box-shadow: 0 0 10px var(--volt); }
.row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-top, .row-bottom { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-time { font-size: 12px; color: var(--mist); flex: none; }
.row-preview { flex: 1; min-width: 0; font-size: 14px; color: var(--mist); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.is-unread .row-title { font-weight: 700; color: #fff; }
.row.is-unread .row-preview { color: var(--ice); font-weight: 600; }
.row.is-unread .row-time { color: var(--ember-hi); font-weight: 600; }
.row-muted { color: var(--mist); }
.badge {
  flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; color: #2b1300; text-align: center;
  background: linear-gradient(180deg, var(--ember-hi), var(--ember)); font: 800 12px/22px var(--sans);
  box-shadow: 0 0 14px rgba(255, 138, 31, 0.55);
}

/* ---------- a chat ---------- */
.thread-empty { margin: auto; display: grid; justify-items: center; gap: 4px; text-align: center; padding: 24px; color: var(--mist); }
.thread-empty img { mix-blend-mode: screen; animation: float 5s ease-in-out infinite; }
.thread-empty .display { font-size: 24px; color: var(--ice); margin: 10px 0 0; }
.thread-head {
  display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; min-height: 68px;
  background: linear-gradient(180deg, rgba(14, 28, 62, 0.72), rgba(8, 16, 38, 0.62));
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  position: relative; z-index: 2;
}
.thread-id { flex: 1; min-width: 0; display: grid; text-align: left; background: none; border: 0; padding: 2px 4px; cursor: pointer; }
.thread-title { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.thread-sub { font-size: 13px; color: var(--mist); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-sub.is-live { color: var(--live); font-weight: 600; text-shadow: 0 0 12px rgba(53, 227, 155, 0.35); }
.thread-sub.is-live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 8px var(--live); }

/* The messages float over the softened artwork; each bubble has its own surface for reading */
.msgs {
  flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px 10px;
  background: linear-gradient(180deg, rgba(4, 9, 22, 0.42), rgba(4, 9, 22, 0.28));
  scrollbar-width: thin; scrollbar-color: rgba(150, 185, 255, 0.2) transparent;
}
.msgs-inner { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; }
.msgs-loading, .msgs-more, .msgs-start { text-align: center; color: var(--mist); font-size: 13px; margin: 12px 0; }
.intro {
  text-align: center; max-width: 440px; margin: 36px auto 24px; padding: 22px 20px; border-radius: 22px;
  background: var(--glass); border: 1px solid var(--line); box-shadow: var(--inset), var(--shadow);
}
.intro .display { font-size: 23px; margin: 0 0 8px; color: #fff; }
.day { display: flex; justify-content: center; margin: 18px 0 10px; }
.day span {
  font-size: 12px; font-weight: 600; color: var(--ice-2); padding: 4px 12px; border-radius: 999px;
  background: rgba(10, 20, 48, 0.75); border: 1px solid var(--line); box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.7);
}

.msg { display: flex; align-items: flex-end; gap: 8px; margin-top: 3px; position: relative; }
.msg.run-start { margin-top: 12px; }
.msg.is-mine { justify-content: flex-end; }
.msg-av { width: 28px; flex: none; }
.msg.run-end .msg-av { margin-bottom: 19px; }
.msg-col { display: flex; flex-direction: column; max-width: min(78%, 560px); min-width: 0; }
.msg.is-mine .msg-col { align-items: flex-end; }
.msg-name { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--mist); margin: 0 0 4px 12px; }
.role-badge {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.02em; color: #2b1300; padding: 2px 8px; border-radius: 999px;
  background: linear-gradient(180deg, var(--ember-hi), var(--ember)); box-shadow: 0 0 10px rgba(255, 138, 31, 0.45);
}
.bubble {
  padding: 9px 13px; border-radius: 20px; color: var(--ice); position: relative;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; max-width: 100%;
  background: linear-gradient(180deg, rgba(34, 52, 96, 0.92), rgba(22, 36, 72, 0.92));
  border: 1px solid rgba(150, 185, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 8px 18px -12px rgba(0, 0, 0, 0.8);
}
/* Staff messages glow in Ember, so students spot their coach's answers at a glance */
.msg.is-staff .bubble {
  background: linear-gradient(180deg, rgba(92, 50, 16, 0.94), rgba(64, 34, 12, 0.94));
  border-color: rgba(255, 160, 80, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 200, 150, 0.15), 0 10px 24px -14px rgba(255, 138, 31, 0.65);
}
.msg.is-mine .bubble {
  color: #fff; border-color: rgba(150, 205, 255, 0.45);
  background: linear-gradient(160deg, #2470ea 0%, #1d5fd9 45%, #1748b8 100%);
  box-shadow: inset 0 1px 0 rgba(160, 210, 255, 0.45), inset 0 0 0 1px rgba(90, 160, 255, 0.25), 0 12px 26px -12px rgba(47, 140, 255, 0.85);
}
.msg.is-mine .bubble a { color: #fff; }
.msg.is-theirs:not(.run-start) .bubble { border-top-left-radius: 7px; }
.msg.is-theirs:not(.run-end) .bubble { border-bottom-left-radius: 7px; }
.msg.is-mine:not(.run-start) .bubble { border-top-right-radius: 7px; }
.msg.is-mine:not(.run-end) .bubble { border-bottom-right-radius: 7px; }
.bubble.is-deleted { background: rgba(4, 9, 22, 0.5) !important; color: var(--mist) !important; border: 1px dashed var(--line-hi) !important; box-shadow: none !important; font-style: italic; font-size: 14px; }
.bubble.has-photo { padding: 4px; }
.bubble.has-photo .msg-text { display: block; padding: 6px 9px 4px; }
.photo { display: block; padding: 0; border: 0; background: rgba(255, 255, 255, 0.05); border-radius: 16px; overflow: hidden; cursor: zoom-in; width: min(280px, 62vw); max-height: 360px; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.msg-meta, .msg-seen { font-size: 11px; color: var(--mist); margin: 4px 8px 0; }
.msg-meta.is-error { color: var(--danger); }
.msg-seen { font-weight: 600; color: var(--volt-hi); }
.msg-more {
  align-self: center; opacity: 0; border: 0; background: none; color: var(--mist); width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
}
.msg.is-mine .msg-more { order: -1; }
.msg:hover .msg-more, .msg-more:focus-visible { opacity: 1; }
.msg-more:hover { background: var(--hover); color: var(--ice); }
@media (pointer: coarse) { .msg-more { display: none; } .bubble { -webkit-user-select: none; user-select: none; } }
/* A message that just arrived lands softly (only once; scrolling back or redrawing never animates) */
.msg.is-new .bubble { animation: land 0.42s cubic-bezier(0.2, 0.9, 0.25, 1.2); }
@keyframes land { from { transform: translateY(8px) scale(0.97); opacity: 0; } }
.jump {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); display: inline-flex; gap: 6px; align-items: center; z-index: 3;
  border: 1px solid rgba(140, 195, 255, 0.5); border-radius: 999px; color: #fff; padding: 8px 14px; font-weight: 600; font-size: 13px; cursor: pointer;
  background: linear-gradient(180deg, #4aa0ff, var(--volt-deep)); box-shadow: 0 12px 30px -10px rgba(47, 140, 255, 0.8);
}

/* ---------- writing ---------- */
.composer-wrap {
  padding: 10px 12px calc(10px + var(--safe-b)); position: relative; z-index: 2;
  background: linear-gradient(180deg, rgba(8, 16, 38, 0.62), rgba(10, 20, 46, 0.78));
  border-top: 1px solid var(--line);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.composer { display: flex; align-items: flex-end; gap: 8px; max-width: 820px; margin: 0 auto; }
.composer-input {
  flex: 1; min-width: 0; resize: none; max-height: 160px; min-height: 44px; padding: 11px 16px; border-radius: 22px;
  border: 1px solid var(--line-hi); background: rgba(3, 8, 22, 0.6); color: var(--ice); font: inherit; font-size: 16px; line-height: 1.35; outline: none;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.composer-input:focus { border-color: var(--volt); box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 4px rgba(47, 140, 255, 0.16); }
/* The send button: a small glowing orb, blue with an orange rim of light (the logo's two colours) */
.send {
  position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 0; color: #fff; cursor: pointer; flex: none;
  background: radial-gradient(circle at 35% 28%, #8cc6ff 0%, var(--volt) 42%, var(--volt-deep) 100%);
  box-shadow: inset 0 -3px 6px rgba(0, 20, 70, 0.45), inset 0 0 0 1.5px rgba(255, 170, 90, 0.55), 0 10px 24px -8px rgba(47, 140, 255, 0.9), 0 0 0 4px rgba(255, 138, 31, 0.08);
  transition: transform 0.15s ease, filter 0.2s ease;
}
.send:hover { filter: brightness(1.12); transform: translateY(-1px); }
.send:active { transform: scale(0.94); }
.preview { display: flex; align-items: center; gap: 10px; max-width: 820px; margin: 0 auto 8px; font-size: 13px; color: var(--mist); }
.preview img { width: 58px; height: 58px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line-hi); }
.preview span { flex: 1; }
.locked { display: flex; gap: 12px; align-items: flex-start; max-width: 820px; margin: 0 auto; padding: 10px 6px; color: var(--ice-2); }
.locked .ic { margin-top: 2px; color: var(--ember-hi); }
.locked-title { margin: 0; font-weight: 700; color: #fff; }
.locked-text { margin: 2px 0 0; font-size: 14px; color: var(--mist); }
.staff-note { display: flex; gap: 6px; align-items: center; max-width: 820px; margin: 0 auto 8px; font-size: 13px; color: var(--ember-hi); }

/* ---------- sheets, menus, details ---------- */
.sheet-back {
  position: fixed; inset: 0; z-index: 50; background: rgba(2, 5, 14, 0.55); display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity 0.18s ease;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.sheet-back.is-on { opacity: 1; }
.sheet {
  width: 100%; max-width: 480px; max-height: 88vh; overflow: auto; border-radius: 26px 26px 0 0;
  padding: 6px 4px calc(12px + var(--safe-b)); transform: translateY(24px); transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  background: linear-gradient(160deg, rgba(24, 42, 86, 0.82), rgba(8, 15, 36, 0.9));
}
.sheet-wide { max-width: 560px; }
.sheet-back.is-on .sheet { transform: none; }
@media (min-width: 760px) {
  .sheet-back { align-items: center; }
  .sheet { border-radius: 26px; }
  .sheet-back .sheet { transform: translateY(18px) scale(0.98); }
  .sheet-back.is-on .sheet { transform: none; }
}
.sheet-head, .info-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 6px 18px; }
.sheet-title { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 600; color: #fff; }
.sheet-body { padding: 4px 16px 8px; }
.menu { display: grid; padding: 4px 8px; }
.menu-item {
  display: flex; align-items: center; gap: 14px; min-height: 50px; padding: 0 12px; border: 1px solid transparent; border-radius: 14px;
  background: none; text-align: left; cursor: pointer; color: var(--ice); text-decoration: none; font-size: 15px;
}
.menu-item:hover { background: var(--hover); border-color: var(--line); }
.menu-item .ic { color: var(--volt-hi); }
.menu-item.is-danger, .menu-item.is-danger .ic { color: var(--danger); }
.menu-note { font-size: 13px; color: var(--mist); padding: 6px 12px; margin: 0; }
.me-head { display: flex; gap: 14px; align-items: center; padding: 8px 20px 12px; }
.me-head p { margin: 0; }
.me-name { font-weight: 700; font-size: 17px; color: #fff; }
.people { margin-top: 8px; display: grid; }
.person { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid transparent; background: none; border-radius: 14px; cursor: pointer; text-align: left; color: var(--ice); }
.person:hover { background: var(--hover); border-color: var(--line); }
.person-name { flex: 1; font-weight: 600; }
.person-role { font-size: 13px; color: var(--mist); }
.info-body { padding: 0 16px 24px; }
.info-title { font-size: 24px; margin: 6px 0 2px; color: #fff; }
.info-note { font-size: 14px; color: var(--mist); padding: 0 12px; }
.member { display: flex; align-items: center; gap: 12px; padding: 7px 4px; }
.member-main { flex: 1; min-width: 0; display: grid; }
.member-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-sub { font-size: 13px; color: var(--mist); }
.member-sub.is-live { color: var(--live); font-weight: 600; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(2, 5, 14, 0.94); display: grid; place-items: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8); }
.lightbox-close { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: 10px; color: #fff; }
.toasts { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; width: min(92vw, 440px); }
.toast { color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 14px; transition: opacity 0.4s ease; border-color: rgba(120, 185, 255, 0.35); }
.toast-error { background: linear-gradient(160deg, rgba(120, 30, 24, 0.9), rgba(70, 16, 14, 0.92)); border-color: rgba(255, 107, 94, 0.45); }
.toast.is-out { opacity: 0; }
.gone { margin: auto; text-align: center; padding: 24px; display: grid; gap: 10px; justify-items: center; }
.gone h1 { font-size: 30px; margin: 0; }
body.is-offline .thread-head::after { content: "Offline. Reconnecting…"; font-size: 12px; color: var(--danger); margin-left: auto; }

/* ---------- sign-in, setup, errors ---------- */
.plain-main { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 28px 18px; }
.signin { width: 100%; max-width: 440px; display: grid; gap: 16px; }
.signin.wide { max-width: 760px; }
.signin-hero { display: grid; justify-items: center; gap: 2px; text-align: center; }
/* The Sync2VA lockup floats a little in front of the artwork, moving against the pointer for depth.
   (.plain-main has no z-index on purpose: the lockup's "screen" blending has to reach the scene behind it.) */
.lockup {
  width: min(290px, 74vw); height: auto; display: block;
  transform: translate3d(calc(var(--lx) * -12px), calc(var(--ly) * -9px), 0);
  mix-blend-mode: screen; /* the dark around the logo melts into the scene; only the light of the logo remains */
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
.signin-hero h1 { font-family: var(--serif); font-size: 40px; line-height: 1; margin: 6px 0 0; background: linear-gradient(180deg, #fff 35%, #9fc6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.signin-hero p { margin: 6px 0 0; color: var(--ice-2); }
.signin-card { border-radius: 26px; padding: 24px; }
.signin-lead { margin: 0 0 18px; color: var(--ice-2); }
.signin-lead strong { color: #fff; }
.signin-help { font-size: 14px; color: var(--mist); margin: 16px 0 0; }
.signin-foot { font-size: 13px; color: var(--mist); text-align: center; margin: 0; }
@media (min-width: 900px) {
  .signin:not(.wide) { max-width: 960px; grid-template-columns: 1fr 420px; align-items: center; gap: 48px; }
  .signin:not(.wide) .signin-hero { justify-items: start; text-align: left; }
  .signin:not(.wide) .lockup { width: 420px; margin-left: -30px; }
  .signin:not(.wide) .signin-hero h1 { font-size: 56px; }
  .signin-foot { grid-column: 1 / -1; }
}
.plain-title { font-family: var(--serif); font-size: 28px; margin: 0 0 10px; color: #fff; }
.h3 { font-size: 16px; margin: 18px 0 8px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checks li { display: grid; gap: 2px; padding: 9px 12px; border-radius: 12px; background: rgba(3, 8, 22, 0.45); border: 1px solid var(--line); font-size: 14px; }
.checks li.ok strong { color: var(--live); }
.checks li.bad strong { color: var(--danger); }
.checks li span { color: var(--mist); }
.noscript { position: relative; z-index: 2; padding: 20px; text-align: center; }

/* ---------- Manage pages ---------- */
.mg { min-height: 100vh; }
.mg-top {
  position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 16px;
  border-width: 0 0 1px; border-radius: 0; color: #fff;
}
@media (max-width: 860px) { .mg-nav { order: 3; flex-basis: 100%; margin-left: -12px; } }
.mg-top a { color: #fff; text-decoration: none; }
.mg-brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 20px; font-weight: 600; }
.mg-brand img { width: 34px; height: auto; mix-blend-mode: screen; }
.mg-nav { display: flex; gap: 2px; overflow-x: auto; margin-left: 8px; scrollbar-width: none; }
.mg-nav a { padding: 8px 12px; border-radius: 12px; font-size: 14px; white-space: nowrap; color: var(--ice-2) !important; border: 1px solid transparent; }
.mg-nav a:hover { background: var(--hover); }
.mg-nav a.is-on { background: linear-gradient(180deg, rgba(47, 140, 255, 0.28), rgba(47, 140, 255, 0.12)); border-color: rgba(120, 185, 255, 0.35); color: #fff !important; }
.mg-back { margin-left: auto; font-size: 14px; white-space: nowrap; padding: 7px 14px; border-radius: 12px; border: 1px solid var(--line-hi); }
.mg-main { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 28px 16px 60px; }
.mg-main h1 { font-family: var(--serif); font-size: 32px; margin: 0 0 6px; background: linear-gradient(180deg, #fff 35%, #a9cbff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mg-lead { color: var(--ice-2); margin: 0 0 22px; max-width: 70ch; }
.card { border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card h2 { font-size: 17px; margin: 0 0 10px; color: #fff; }
.grid2 { display: grid; gap: 16px; }
@media (min-width: 860px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.state { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 700; margin: 0 0 4px; color: #fff; }
.state-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--mist); }
.state.is-open .state-dot { background: var(--live); box-shadow: 0 0 0 4px rgba(53, 227, 155, 0.18), 0 0 12px var(--live); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.inline-form select, .inline-form input { width: auto; min-width: 120px; }
.inline-form .until-time { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mist); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.t th, .t td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.t th { font-size: 12px; font-weight: 600; color: var(--mist); background: rgba(3, 8, 22, 0.35); white-space: nowrap; }
.t td:first-child { white-space: nowrap; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: rgba(120, 170, 255, 0.04); }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t a { font-weight: 600; text-decoration: none; }
.bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); min-width: 60px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--volt), var(--ember)); border-radius: 3px; box-shadow: 0 0 10px rgba(47, 140, 255, 0.5); }
.days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(14px, 1fr); gap: 3px; align-items: end; height: 34px; min-width: 120px; }
.days span { background: linear-gradient(180deg, var(--volt-hi), var(--volt)); border-radius: 3px; min-height: 2px; opacity: 0.9; }
.days span.zero { background: rgba(255, 255, 255, 0.08); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filters label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ice-2); }
.filters .checks-inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; min-height: 46px; }
.filters .checks-inline label { display: flex; gap: 6px; align-items: center; font-weight: 400; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: var(--ice-2); border: 1px solid var(--line); }
.pill-open { background: rgba(255, 138, 31, 0.16); color: var(--ember-hi); border-color: rgba(255, 160, 80, 0.4); }
.pill-ok { background: rgba(53, 227, 155, 0.12); color: var(--live); border-color: rgba(53, 227, 155, 0.35); }
.ctx { display: grid; gap: 6px; }
.ctx-msg { padding: 9px 13px; border-radius: 14px; background: rgba(3, 8, 22, 0.45); border: 1px solid var(--line); font-size: 14px; }
.ctx-msg.is-reported { background: rgba(255, 138, 31, 0.12); border-color: rgba(255, 160, 80, 0.55); box-shadow: 0 0 0 1px rgba(255, 138, 31, 0.3), 0 0 22px -6px rgba(255, 138, 31, 0.5); }
.ctx-who { font-weight: 700; font-size: 13px; color: #fff; }
.ctx-when { color: var(--mist); font-size: 12px; margin-left: 6px; }
.ctx-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.ctx-photo { max-width: 220px; border-radius: 12px; display: block; margin-top: 6px; }
.week { display: grid; gap: 8px; }
.week-row { display: grid; grid-template-columns: 120px 80px 150px 150px; gap: 10px; align-items: center; }
@media (max-width: 560px) { .week-row { grid-template-columns: 1fr 1fr; } .week-row .day-name { grid-column: 1 / -1; } }
.spans { display: flex; flex-wrap: wrap; gap: 6px; }
.spans span { font-size: 13px; padding: 4px 9px; border-radius: 9px; background: rgba(3, 8, 22, 0.45); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.timeline { position: relative; height: 22px; background: rgba(3, 8, 22, 0.5); border: 1px solid var(--line); border-radius: 7px; margin: 6px 0; }
.timeline span { position: absolute; top: 3px; bottom: 3px; background: linear-gradient(90deg, var(--live), #22b877); border-radius: 3px; min-width: 2px; box-shadow: 0 0 8px rgba(53, 227, 155, 0.5); }
.flash { margin-bottom: 16px; }
.member-check { display: flex; gap: 8px; align-items: center; min-height: 36px; }
.member-grid { display: grid; gap: 2px 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 8px 0 14px; }
