/* ============ 1SN Studio OS - glassmorphism theme ============ */
:root {
  /* dark grey base with pastel navy accents */
  --bg-0: #16171c;
  --bg-1: #1e2028;
  --glass: rgba(158, 175, 210, 0.055);
  --glass-strong: rgba(158, 175, 210, 0.1);
  --border: rgba(170, 186, 220, 0.16);
  --border-soft: rgba(170, 186, 220, 0.08);
  --text: #e9ecf4;
  --text-dim: #a2abc2;
  --text-faint: #6f7891;
  --accent: #7d96cc;      /* pastel navy */
  --accent-deep: #5f77aa;
  --accent-2: #a3bce6;    /* lighter pastel blue */
  --green: #7fd8ae;
  --amber: #eec98a;
  --red: #e8899a;
  --pink: #c9a3e0;
  /* glass panel family: every overlay surface derives from these */
  --panel: rgba(22, 26, 48, 0.78);
  --panel-strong: rgba(24, 28, 46, 0.86);
  --panel-soft: rgba(16, 19, 32, 0.78);
  --veil: rgba(5, 7, 15, 0.45);
  --input-bg: rgba(0, 0, 0, 0.25);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --sidebar-w: 240px;
  --font-head: 'Montserrat', 'Segoe UI', sans-serif;
  --font-body: 'Barlow', 'Segoe UI', sans-serif; /* DIN-style grotesque */
}
/* ---------- light theme: same glass, bright palette (per-user setting) ---------- */
html.theme-light {
  --bg-0: #e8ecf4;
  --bg-1: #ffffff;
  /* light glass must be MUCH stronger than dark: white at .5 over an arbitrary
     bright wallpaper is unreadable soup - cards stay translucent but assertive */
  --glass: rgba(255, 255, 255, 0.82);
  --glass-strong: rgba(255, 255, 255, 0.94);
  --border: rgba(28, 42, 85, 0.3);
  --border-soft: rgba(28, 42, 85, 0.16);
  --text: #161b29;
  --text-dim: #38405b;
  --text-faint: #5d6683;
  --accent-2: #4f68a0;   /* darker so links stay readable on light */
  --panel: rgba(248, 250, 255, 0.88);
  --panel-strong: rgba(251, 252, 255, 0.94);
  --panel-soft: rgba(242, 245, 251, 0.88);
  --veil: rgba(120, 132, 165, 0.4);
  --input-bg: rgba(20, 30, 60, 0.08);
  --shadow: 0 8px 32px rgba(60, 72, 110, 0.22);
}
html.theme-light body::before, html.theme-light body::after { opacity: .16; }
/* the white company logo needs its dark habitat even on light */
html.theme-light .brand {
  background: #1d2230; border-radius: 14px; padding: 14px 8px 16px; margin-bottom: 12px;
  border-bottom: none;
}
html.theme-light .brand-name { color: #aab3cc; }
html.theme-light .nav a.active { color: var(--text); }
html.theme-light .btn:hover { background: rgba(40, 60, 110, 0.12); }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  /* the virtual HQ photo, fitted to height, behind everything - every glass
     panel blurs and tints it. Soft scrim keeps text readable. */
  background-color: var(--bg-0);
  background-image: linear-gradient(rgba(13, 14, 19, .5), rgba(13, 14, 19, .68)),
                    url('../../bg.jpg');
  background-position: center;
  background-size: auto, cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-size: 14.5px;
  letter-spacing: .1px;
  overflow-x: hidden;
}
h1, h2, h3, h4, .brand, .stat .num, .topbar h1, .btn, .tabs a, .badge, .kcol h4 {
  font-family: var(--font-head);
}
/* animated aurora backdrop */
body::before, body::after {
  content: ''; position: fixed; z-index: -1; border-radius: 50%;
  filter: blur(120px); opacity: .5; pointer-events: none;
}
body::before {
  width: 60vw; height: 60vw; top: -20vw; left: -15vw;
  background: radial-gradient(circle, #2c3556 0%, transparent 70%);
  animation: drift1 24s ease-in-out infinite alternate;
}
body::after {
  width: 50vw; height: 50vw; bottom: -20vw; right: -10vw;
  background: radial-gradient(circle, #24344d 0%, transparent 70%);
  animation: drift2 30s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(12vw, 8vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-10vw, -8vh) scale(1.1); } }

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); position: fixed; inset: 0 auto 0 0; z-index: 50;
  background: var(--panel-soft); backdrop-filter: blur(22px);
  border-right: 1px solid var(--border-soft);
  display: flex; flex-direction: column; padding: 18px 14px;
}
.main {
  margin-left: var(--sidebar-w); flex: 1; padding: 26px 32px 60px;
  min-width: 0;
}
.brand {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 14px 8px 22px; font-weight: 700; text-align: center;
  border-bottom: 1px solid var(--border-soft); margin-bottom: 12px;
}
.brand-logo {
  max-width: 170px; max-height: 96px; object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .45));
}
.brand-name {
  font-size: 13px; letter-spacing: 2.2px; text-transform: uppercase;
  color: var(--text-dim); font-weight: 600;
}
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-size: 16px; color: #fff;
  box-shadow: 0 4px 18px rgba(125, 150, 204, 0.45);
}
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: var(--radius-sm); color: var(--text-dim);
  font-weight: 500; transition: all .18s; text-decoration: none;
}
.nav a:hover { background: var(--glass); color: var(--text); }
.nav a.active {
  background: linear-gradient(90deg, rgba(125,150,204,.3), rgba(163,188,230,.12));
  color: #fff; border: 1px solid rgba(125, 150, 204, 0.4);
}
.nav .icon { width: 20px; text-align: center; font-size: 15px; }
.nav .sep { margin: 12px 12px 6px; font-size: 10px; text-transform: uppercase;
  letter-spacing: 1.4px; color: var(--text-faint); }
.sidebar .me {
  display: flex; gap: 10px; align-items: center; padding: 12px 10px;
  border-top: 1px solid var(--border-soft); margin-top: 10px;
}
.sidebar .me .who { flex: 1; min-width: 0; }
.sidebar .me .who b { display: block; font-size: 13px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.sidebar .me .who span { font-size: 11px; color: var(--text-faint); text-transform: capitalize; }

/* ---------- header ---------- */
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
/* the title sits straight on the wallpaper - a soft halo keeps it readable on any image */
.topbar h1 { font-size: 22px; font-weight: 650; text-shadow: 0 1px 12px rgba(8, 10, 16, .6); }
.topbar .sub { color: var(--text-dim); font-size: 13px; margin-top: 3px; text-shadow: 0 1px 10px rgba(8, 10, 16, .5); }
html.theme-light .topbar h1 { text-shadow: 0 1px 10px rgba(255, 255, 255, .85), 0 0 26px rgba(255, 255, 255, .6); }
html.theme-light .topbar .sub { text-shadow: 0 1px 8px rgba(255, 255, 255, .8), 0 0 20px rgba(255, 255, 255, .55); }
.topbar .spacer { flex: 1; }

/* ---------- glass cards ---------- */
.card {
  background: var(--glass); backdrop-filter: blur(18px);
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card h3 { font-size: 14px; font-weight: 600; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px; }
.card h3 .grow { flex: 1; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .g4 { grid-template-columns: 1fr 1fr; }
  .g3 { grid-template-columns: 1fr; } .g2 { grid-template-columns: 1fr; } }

/* stat tiles */
.stat { display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.stat .num { font-size: 30px; font-weight: 700; letter-spacing: -.5px; }
.stat .lbl { color: var(--text-dim); font-size: 12.5px; }
.stat .chip-ico {
  position: absolute; right: 16px; top: 16px; width: 40px; height: 40px;
  border-radius: 12px; display: grid; place-items: center; font-size: 18px;
  background: var(--glass-strong);
}

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px;
  border-radius: 11px; border: 1px solid var(--border);
  background: var(--glass-strong); color: var(--text); font-size: 13px;
  font-weight: 550; cursor: pointer; transition: all .15s; text-decoration: none !important;
  font-family: inherit;
}
.btn:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 18px rgba(125, 150, 204, 0.4);
}
.btn.danger { background: rgba(255,107,129,.15); border-color: rgba(255,107,129,.4); color: var(--red); }
.btn.off { background: rgba(232,137,154,.18); border-color: rgba(232,137,154,.45); }
.btn.active-share { background: rgba(127,216,174,.2); border-color: rgba(127,216,174,.5); }
.btn.sm { padding: 5px 11px; font-size: 12px; border-radius: 9px; }
.btn.icon-only { padding: 8px 10px; }

input, select, textarea {
  width: 100%; padding: 10px 13px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--input-bg);
  color: var(--text); font-size: 13.5px; font-family: inherit; outline: none;
  transition: border .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
select option { background: var(--bg-1); }
label { display: block; font-size: 12px; color: var(--text-dim); margin: 12px 0 5px; font-weight: 550; }
label:first-child { margin-top: 0; }
textarea { resize: vertical; min-height: 90px; }
::placeholder { color: var(--text-faint); }

/* ---------- table ---------- */
table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-faint); padding: 8px 12px; border-bottom: 1px solid var(--border-soft);
}
table.list td { padding: 11px 12px; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
table.list tr:last-child td { border-bottom: none; }
table.list tr.rowlink { cursor: pointer; transition: background .12s; }
table.list tr.rowlink:hover { background: var(--glass); }

/* ---------- badges / avatars ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .3px;
}
.b-pipeline { background: rgba(226,109,248,.16); color: var(--pink); }
.b-active   { background: rgba(61,220,151,.15); color: var(--green); }
.b-on_hold  { background: rgba(255,197,85,.15); color: var(--amber); }
.b-completed{ background: rgba(70,198,242,.15); color: var(--accent-2); }
.b-archived { background: rgba(255,255,255,.08); color: var(--text-dim); }
.b-low    { background: rgba(255,255,255,.08); color: var(--text-dim); }
.b-medium { background: rgba(70,198,242,.15);  color: var(--accent-2); }
.b-high   { background: rgba(255,197,85,.16);  color: var(--amber); }
.b-urgent { background: rgba(255,107,129,.18); color: var(--red); }
.b-admin { background: rgba(125,150,204,.22); color: #b8c8ea; }
.b-sales { background: rgba(61,220,151,.15); color: var(--green); }
.b-dev   { background: rgba(70,198,242,.15); color: var(--accent-2); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: 12px; font-weight: 700;
  color: #fff; border: 2px solid rgba(255,255,255,.18);
  /* never let flex/grid squash the circle */
  flex: none; aspect-ratio: 1 / 1; align-self: center; box-sizing: border-box; overflow: hidden;
}
.avatar.sm { width: 24px; height: 24px; font-size: 9.5px; }
.row > img, .linkcard .fav, .brand-logo { flex-shrink: 0; }
.avstack { display: flex; }
.avstack .avatar { margin-left: -8px; }
.avstack .avatar:first-child { margin-left: 0; }

/* progress bars (flex so bars can show multiple coloured segments) */
.bar { height: 7px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden;
  display: flex; }
.bar > i { display: block; height: 100%; border-radius: 99px; flex: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s; }
.bar > i.seg-personal { background: linear-gradient(90deg, var(--pink), #dfc2f0); }
.bar > i.warn { background: linear-gradient(90deg, var(--amber), #ff9556); }
.bar > i.over { background: linear-gradient(90deg, #ff8a5c, var(--red)); }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr));
  gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 12px; }
.kcol { background: rgba(255,255,255,.035); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 12px; min-height: 200px; }
.kcol h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-dim); padding: 4px 6px 12px; display: flex; gap: 8px; align-items: center; }
.kcol h4 .cnt { background: var(--glass-strong); border-radius: 99px;
  padding: 1px 8px; font-size: 11px; }
.kcards { display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.kcard {
  background: var(--glass-strong); backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft); border-radius: 13px; padding: 12px;
  cursor: grab; transition: transform .12s, box-shadow .12s;
}
.kcard:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.kcard.dragging { opacity: .55; }
.kcard .t { font-weight: 550; font-size: 13px; margin-bottom: 8px; line-height: 1.35; }
.kcard .meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-faint); }
.kcard .meta .grow { flex: 1; }
.kcard .blocked { color: var(--red); font-size: 11px; margin-top: 6px; }
.kcard .due { font-size: 11px; }
.kcard .due.overdue { color: var(--red); }

/* ---------- modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: var(--veil); backdrop-filter: blur(12px);
  z-index: 200; display: none; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 5vh 16px;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--panel); backdrop-filter: blur(34px);
  border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow);
  width: 100%; max-width: 560px; padding: 26px; animation: pop .18s ease;
}
.modal.wide { max-width: 820px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal h2 { font-size: 17px; margin-bottom: 6px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ---------- misc ---------- */
.row { display: flex; gap: 12px; align-items: center; }
.row .grow { flex: 1; min-width: 0; }
.muted { color: var(--text-dim); font-size: 12.5px; }
.faint { color: var(--text-faint); }
.empty { text-align: center; color: var(--text-faint); padding: 34px 10px; font-size: 13px; }
.tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.tabs a {
  padding: 8px 16px; border-radius: 11px; font-size: 13px; font-weight: 550;
  color: var(--text-dim); border: 1px solid transparent; text-decoration: none !important;
}
.tabs a.active { background: var(--glass-strong); color: #fff; border-color: var(--border); }
.tabs a:hover { color: #fff; }
.toast-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 400;
  display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--panel-strong); backdrop-filter: blur(24px); border: 1px solid var(--border);
  border-left: 3px solid var(--green); border-radius: 12px; padding: 12px 18px;
  font-size: 13px; box-shadow: var(--shadow); animation: chipPop .2s;
}
@keyframes chipPop { from { opacity: 0; transform: translate(-50%,-100%) scale(.95); } to { opacity: 1; transform: translate(-50%,-100%) scale(1); } }
.toast.err { border-left-color: var(--red); }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chart-box { position: relative; height: 260px; }

/* notifications bell */
.bell { position: relative; }
.bell .n {
  position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff;
  font-size: 10px; border-radius: 99px; padding: 1px 5px; font-weight: 700;
}
.notif-drop {
  position: absolute; right: 0; top: 46px; width: 340px; max-height: 420px; overflow-y: auto;
  background: var(--panel-strong); backdrop-filter: blur(30px); z-index: 150;
  border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
  display: none;
}
.notif-drop.open { display: block; }
.notif-drop .item { padding: 12px 16px; border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px; cursor: pointer; }
.notif-drop .item.unread { background: rgba(125,150,204,.1); }
.notif-drop .item:hover { background: var(--glass); }
.notif-drop .item .when { color: var(--text-faint); font-size: 11px; margin-top: 3px; }

/* gantt / frappe overrides (must beat the CDN stylesheet) */
.gantt-container { border-radius: var(--radius); background: rgba(255,255,255,.03); }
.gantt .grid-background { fill: transparent !important; }
.gantt .grid-header { fill: rgba(255,255,255,.04) !important; }
.gantt .grid-row { fill: transparent !important; }
.gantt .grid-row:nth-child(even) { fill: rgba(255,255,255,.025) !important; }
.gantt .row-line, .gantt .tick { stroke: rgba(255,255,255,.08) !important; }
.gantt .today-highlight { fill: rgba(125,150,204,.16) !important; }
.gantt text { fill: var(--text-dim) !important; }
.gantt .bar-label { fill: #fff !important; }
.gantt .bar { fill: rgba(125,150,204,.5) !important; stroke: none !important; }
.gantt .bar-progress { fill: var(--accent-deep) !important; }
.gantt .arrow { stroke: var(--accent-2) !important; }
.gantt .bar-wrapper:hover .bar { fill: rgba(125,150,204,.65) !important; }
.gantt .upper-text { fill: var(--text) !important; }
.gantt .lower-text { fill: var(--text-faint) !important; }
.gantt .handle { fill: rgba(255,255,255,.4) !important; }
/* status colours: completed = green, in review = amber */
.gantt .bar-wrapper.g-done .bar { fill: rgba(61,220,151,.30) !important; }
.gantt .bar-wrapper.g-done .bar-progress { fill: var(--green) !important; }
.gantt .bar-wrapper.g-review .bar-progress { fill: var(--amber) !important; }
.popup-wrapper { background: rgba(22,26,48,.97) !important; border-radius: 10px; }

/* fullcalendar glass overrides - all theme-variable driven so light mode works */
.fc { --fc-border-color: var(--border-soft); --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: var(--glass); --fc-today-bg-color: rgba(125,150,204,.22);
  --fc-button-bg-color: var(--glass-strong); --fc-button-border-color: var(--border);
  --fc-button-hover-bg-color: rgba(125,150,204,.3); --fc-button-hover-border-color: var(--accent);
  --fc-button-active-bg-color: var(--accent); --fc-button-active-border-color: var(--accent);
  --fc-button-text-color: var(--text);
  color: var(--text); }
.fc .fc-toolbar-title { font-size: 17px; }
.fc a { color: var(--text); }
.fc .fc-daygrid-day-number, .fc .fc-col-header-cell-cushion { color: var(--text-dim); font-weight: 600; }
.fc .fc-event-title, .fc .fc-event-time { font-weight: 600; }

/* meeting */
.videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px; }
.vtile { position: relative; background: #000; border-radius: var(--radius);
  overflow: hidden; aspect-ratio: 16/10; border: 1px solid var(--border-soft);
  cursor: pointer; transition: border-color .15s; }
.vtile:hover { border-color: var(--accent); }

/* spotlight: the clicked speaker fills the stage, everyone else shrinks to a film strip.
   Height-driven so it always fits the viewport: page header + thumbnails + control bar
   stay visible; the video letterboxes instead of cropping. */
.videos.spotlight { display: flex; flex-wrap: wrap; gap: 10px; }
.videos.spotlight .vtile.spot {
  width: 100%; order: -1;
  aspect-ratio: auto;
  height: clamp(260px, calc(100vh - 380px), 68vh);
  border-color: var(--accent); box-shadow: 0 0 0 2px rgba(125,150,204,.35), var(--shadow);
}
.videos.spotlight .vtile.spot video { object-fit: contain; background: #000; }
.videos.spotlight .vtile:not(.spot) { width: 170px; flex: none; aspect-ratio: 16/10; }
.videos.spotlight .vtile:not(.spot) .name { font-size: 10px; padding: 2px 8px; left: 6px; bottom: 6px; }

/* ---------- presence ---------- */
.live-dot {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(127,216,174,.6);
  animation: livepulse 2.2s ease-out infinite;
}
@keyframes livepulse {
  0% { box-shadow: 0 0 0 0 rgba(127,216,174,.55); }
  70% { box-shadow: 0 0 0 7px rgba(127,216,174,0); }
  100% { box-shadow: 0 0 0 0 rgba(127,216,174,0); }
}
.live-dot.away {
  background: var(--amber);
  animation: none;
  box-shadow: none;
}
.pill-online {
  border-radius: 999px; gap: 8px; font-size: 12.5px;
  background: rgba(127,216,174,.1); border-color: rgba(127,216,174,.3);
}
.pill-online:hover { background: rgba(127,216,174,.18); }
.nav .live-badge {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  background: rgba(127,216,174,.12); border: 1px solid rgba(127,216,174,.3);
  border-radius: 999px; padding: 1px 8px; font-size: 11px; color: var(--green);
}
.nav .live-badge .live-dot { width: 7px; height: 7px; }
.nav .count-badge, .nav .alert-badge, .nav .new-badge, .nav .holiday-badge {
  margin-left: auto; border-radius: 999px; padding: 1px 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px; flex: none;
}
.nav .count-badge { background: rgba(125,150,204,.16); color: var(--accent-2);
  border: 1px solid rgba(125,150,204,.3); }
.nav .alert-badge { background: rgba(232,137,154,.16); color: var(--red);
  border: 1px solid rgba(232,137,154,.4); }
.nav .new-badge { background: rgba(127,216,174,.15); color: var(--green);
  border: 1px solid rgba(127,216,174,.4); letter-spacing: 1px; }
.nav .holiday-badge { background: rgba(238,201,138,.15); color: var(--amber);
  border: 1px solid rgba(238,201,138,.4); }
/* keep a live badge and a count badge from fighting for the right edge */
.nav a .live-badge + .count-badge { margin-left: 6px; }
.link-new-tag {
  position: absolute; top: -7px; right: 10px;
  background: var(--green); color: #10251b; border-radius: 999px;
  font-size: 9px; font-weight: 800; letter-spacing: 1px; padding: 2px 8px;
}
#online-drop .item.row { gap: 10px; }

/* world clock */
.world-clock { display: flex; gap: 16px; align-items: center; }
.wc-item { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.wc-time { font-family: var(--font-head); font-weight: 700; font-size: 14.5px; letter-spacing: .5px; }
.wc-zone { font-size: 8.5px; letter-spacing: 1.6px; color: var(--text-faint); }
@media (max-width: 1150px) { .world-clock { display: none; } }

/* ---------- Gatherish virtual office ---------- */
.gmap-stage { position: relative; display: flex; gap: 12px; align-items: stretch; }
.gmap-root {
  position: relative; overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: var(--glass);   /* the map PNG is transparent - theme shows through */
  cursor: grab; user-select: none; touch-action: none; flex: 1; min-width: 0;
}
.gmap-root:active { cursor: grabbing; }
.gmap-root.mini {
  position: absolute; left: 14px; bottom: 14px; width: 250px; flex: none;
  z-index: 40; cursor: pointer; border: 2px solid var(--accent);
  box-shadow: 0 10px 30px rgba(0,0,0,.6);
}
.gmap-root.mini .gmap-office, .gmap-root.mini .gmap-name { display: none !important; }
.gmap-backhint {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 45;
  background: rgba(24,26,36,.9); border-radius: 99px; padding: 3px 12px;
  font-size: 11px; color: #a3bce6; pointer-events: none; white-space: nowrap;
}
.gmap-panel {
  display: none; width: 280px; flex: none; max-height: 100%; overflow-y: auto;
  background: var(--glass); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 10px;
}
.gmap-panel.open { display: block; }
.gmap-panel .vtile { aspect-ratio: 16/10; margin-bottom: 10px; cursor: pointer; }
.gmap-panel .vtile:hover { border-color: var(--accent-2); }
.gmap-focus {
  display: none; flex: 1; min-width: 0; position: relative;
  background: #0e1015; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border-soft);
}
.gmap-focus.open { display: block; }
.gmap-focus video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.gmap-focus .name {
  position: absolute; left: 14px; top: 12px; background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px); padding: 4px 14px; border-radius: 99px; font-size: 13px;
}
.gmap-focus.open ~ .gmap-panel { }
.gmap-stage:has(.gmap-focus.open) .gmap-root:not(.mini) { display: none; }
.gmap-world { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.gmap-img { display: block; pointer-events: none; }
.gmap-office {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 5px;
  background: rgba(22, 24, 32, .82); backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 12px; font-size: 13px; font-weight: 600; font-family: var(--font-head);
  color: #e9ecf4; cursor: pointer; white-space: nowrap; z-index: 5; transition: all .15s;
}
.gmap-office:hover { border-color: var(--accent-2); background: rgba(125,150,204,.3); transform: translate(-50%, -50%) scale(1.08); }
.gmap-office.gmap-hq { border-color: rgba(127,216,174,.5); color: var(--green); font-size: 14px; padding: 6px 16px; }
.gmap-avatar {
  position: absolute; transform: translate(-50%, -60%);
  display: flex; flex-direction: column; align-items: center;
  z-index: 10; cursor: pointer;
  transition: left 1.2s linear, top 1.2s linear;   /* remote avatars glide */
  filter: drop-shadow(0 4px 7px rgba(0,0,0,.55));
}
.gmap-avatar.me { transition: none; z-index: 12; }
.gmap-avatar .avatar { border: 3px solid #fff; }
.gmap-root.mini .gmap-avatar { transform: translate(-50%, -60%) scale(.55); }
.gmap-avatar.me .avatar { border-color: var(--accent-2); }
.gmap-avatar.offline { opacity: .35; filter: grayscale(.9) drop-shadow(0 4px 7px rgba(0,0,0,.55)); }
/* name only on hover - keeps the map clean */
.gmap-name {
  display: none; position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  font-size: 10.5px; font-weight: 700; font-family: var(--font-head); color: #fff;
  background: rgba(20, 22, 30, .9); padding: 2px 9px; border-radius: 99px;
  white-space: nowrap; z-index: 15;
}
.gmap-avatar:hover .gmap-name, .gmap-avatar.me .gmap-name { display: block; }
.gmap-status {
  position: absolute; top: -5px; right: -9px; font-size: 17px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.6));
}
.gmap-bubble {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: #fff; color: #1b1e26; font-size: 12px; font-weight: 550;
  padding: 6px 12px; border-radius: 12px; max-width: 220px; width: max-content;
  z-index: 20; animation: bubblePop .2s;
}
@keyframes bubblePop { from { opacity: 0; transform: translateX(-50%) scale(.95); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
.gmap-bubble::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #fff;
}
/* pinned status bubble: sticky-note look, stays until switched off in the rail */
.gmap-bubble.pinned { background: #ffe9a8; color: #4a3d17; animation: none; }
.gmap-bubble.pinned::after { border-top-color: #ffe9a8; }
.rail-bubble {
  flex: none; background: rgba(255,255,255,.03); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 10px 12px;
}
.gmap-chip {
  position: absolute; transform: translate(-50%, -100%);
  display: flex; align-items: center; gap: 8px; z-index: 30;
  background: var(--panel-strong); backdrop-filter: blur(20px);
  border: 1px solid var(--accent); border-radius: 14px; padding: 8px 12px;
  font-size: 13px; box-shadow: var(--shadow); animation: chipPop .2s;
}
@keyframes chipPop { from { opacity: 0; transform: translate(-50%,-100%) scale(.95); } to { opacity: 1; transform: translate(-50%,-100%) scale(1); } }

/* ---------- Expoverse hall cards ---------- */
.hall-card { cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; }
.hall-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 14px 34px rgba(0,0,0,.4); }
.hall-card .callsign {
  font-size: 10.5px; letter-spacing: 2.5px; color: var(--text-faint);
  font-family: var(--font-head); font-weight: 700;
}
.hall-booths { display: flex; gap: 6px; margin: 14px 0 10px; }
.hall-booths a {
  flex: 1; aspect-ratio: 1; max-width: 36px; min-width: 0; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  font-size: 11px; font-weight: 700; color: #fff; text-decoration: none;
  border: 1px solid var(--border-soft); background: var(--glass-strong);
  transition: transform .12s, border-color .12s;
}
.hall-booths a:hover { transform: scale(1.2); border-color: #fff; z-index: 2; }
.hall-booths a.vacant { color: var(--text-faint); background: rgba(255,255,255,.03); }
.hall-booths a img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.hall-occbar { height: 5px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.hall-occbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ---------- Gatherish(TM) wordmark ----------
   Self-contained lockup on its own dark plate + glowing presence dot, so it
   stays crisp on ANY background (buttons, cards, light or dark). */
.gatherish-logo {
  font-family: var(--font-head); font-weight: 800; font-size: 19px; line-height: 1;
  display: inline-flex; align-items: baseline; white-space: nowrap;
  padding: 7px 13px 8px; border-radius: 12px; letter-spacing: .4px;
  color: #fff;
  background: linear-gradient(125deg, #23283a, #2b3350 62%, #223243);
  border: 1px solid rgba(125,150,204,.55);
  box-shadow: 0 3px 14px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.09);
}
.gatherish-logo::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; align-self: center;
  margin-right: 8px; background: var(--green);
  box-shadow: 0 0 9px rgba(127,216,174,.9);
}
.gatherish-logo i {
  font-style: italic; font-weight: 800; display: inline-block;
  transform: rotate(-5deg) translateY(-1px); margin-left: 2px;
  color: #7fd8ae; text-shadow: 0 1px 8px rgba(127,216,174,.45);
}
.gatherish-logo sup {
  font-size: .36em; margin-left: 4px; font-weight: 700; letter-spacing: 1px;
  color: rgba(255,255,255,.55);
}
.gatherish-logo.mini { font-size: 12.5px; padding: 4px 9px 5px; border-radius: 9px; }
.gatherish-logo.mini::before { width: 6px; height: 6px; margin-right: 6px; }

/* ---------- Gatherish shell: frame + always-on right rail ---------- */
body.shell-body { display: flex; height: 100vh; margin: 0; padding: 0; overflow: hidden; }
.shell-main { flex: 1; position: relative; min-width: 0; height: 100%; display: flex; flex-direction: column; }
.shell-frame { width: 100%; flex: 1; min-height: 0; border: 0; display: block; background: var(--bg-0); }
/* sticky tool panel under the app */
.shell-toolbar {
  flex: none; display: flex; gap: 8px; align-items: center; padding: 7px 12px;
  background: var(--panel-soft); backdrop-filter: blur(16px); border-top: 1px solid var(--border-soft); overflow-x: auto;
}
.shell-toolbar { justify-content: center; }
.tool-launch-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 22px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid var(--border-soft); color: var(--text);
  font-family: var(--font-head); font-weight: 700; font-size: 13px; cursor: pointer; transition: all .15s;
}
.tool-launch-btn:hover { border-color: var(--accent-2); background: rgba(125,150,204,.18); }
.tool-launch-btn .material-symbols-outlined { font-size: 20px; }
/* Win11-style launcher popup: centered above the bar */
.tool-grid {
  display: none; position: absolute; bottom: 56px; left: 50%; transform: translateX(-50%);
  z-index: 80; width: min(560px, 92%); max-height: 60vh; overflow-y: auto;
  background: var(--panel); backdrop-filter: blur(28px);
  border: 1px solid var(--border); border-radius: 18px; padding: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px;
}
.tool-grid.open { display: grid; animation: riseUp .22s cubic-bezier(.2,.9,.3,1.15); }
/* generic pop scales from centre and DROPS the translateX(-50%) centring, which
   made the panel lurch sideways - this keyframe keeps X and slides upward */
@keyframes riseUp {
  from { opacity: 0; transform: translate(-50%, 18px) scale(.97); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ---------- global team chat (lives in the shell, center bottom) ---------- */
.chat-unread {
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  background: #ff6b81; color: #fff; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.chat-panel {
  display: none; position: absolute; bottom: 56px; left: 50%; transform: translateX(-50%);
  z-index: 78; width: min(600px, 94%); height: min(66vh, 640px);
  flex-direction: column; gap: 8px;
  background: var(--panel); backdrop-filter: blur(28px);
  border: 1px solid var(--border); border-radius: 18px; padding: 14px 14px 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
.chat-panel.open { display: flex; animation: riseUp .22s cubic-bezier(.2,.9,.3,1.15); }
.chat-head { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border-soft); }
.chat-msgs { flex: 1; overflow-y: auto; min-height: 0; padding: 4px 2px; }
.chat-day { display: flex; align-items: center; gap: 10px; margin: 12px 0 6px; }
.chat-day::before, .chat-day::after { content: ''; flex: 1; border-top: 1px solid var(--border-soft); }
.chat-day span { font-size: 10.5px; font-weight: 700; letter-spacing: 1px; color: var(--text-faint); font-family: var(--font-head); }
.cmsg { position: relative; display: flex; gap: 10px; padding: 5px 8px; border-radius: 10px; }
.cmsg.grouped { padding-top: 1px; }
.cmsg:hover { background: rgba(125,150,204,.08); }
.cmsg.pinged { background: rgba(238,201,138,.12); }
.cmsg .cav { width: 30px; flex: none; }
.cmsg .cbody { min-width: 0; flex: 1; }
.cmsg .chead { display: flex; align-items: baseline; gap: 8px; }
.cmsg .chead b { font-size: 13px; font-family: var(--font-head); }
.cmsg .chead span { font-size: 10.5px; color: var(--text-faint); }
.cmsg .ctext { font-size: 13px; line-height: 1.45; overflow-wrap: break-word; }
.cmsg .ctext a { color: var(--accent-2); }
.mention {
  background: rgba(125,150,204,.22); color: var(--accent-2); font-weight: 700;
  padding: 1px 6px; border-radius: 7px;
}
.mention.me { background: rgba(238,201,138,.3); color: #eec98a; }
html.theme-light .mention.me { color: #6e5410; }
.cimg {
  max-width: 260px; max-height: 190px; border-radius: 10px; display: block; margin-top: 5px;
  border: 1px solid var(--border-soft); cursor: zoom-in; transition: border-color .15s;
}
.cimg:hover { border-color: var(--accent-2); }
.cvid { max-width: 320px; max-height: 220px; border-radius: 10px; display: block; margin-top: 5px; background: #000; border: 1px solid var(--border-soft); }
.caud { display: block; margin-top: 5px; max-width: 300px; }
.cvcap { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 11.5px; }
.cvcap a { color: var(--text-dim); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cvcap a:hover { color: var(--accent-2); }
.cvcap .fs { color: var(--text-faint); flex: none; }
.cv-expand {
  flex: none; cursor: pointer; background: rgba(255,255,255,.06); color: var(--text-dim);
  border: 1px solid var(--border-soft); border-radius: 7px; padding: 1px 7px; font-size: 13px;
}
.cv-expand:hover { color: var(--accent-2); border-color: var(--accent-2); }
.ctext.jumbo { font-size: 32px; line-height: 1.25; }
.chat-emojis {
  position: absolute; bottom: 64px; left: 12px; right: 12px; z-index: 6; max-height: 220px; overflow-y: auto;
  background: var(--panel-strong); backdrop-filter: blur(24px);
  border: 1px solid var(--border); border-radius: 12px; padding: 8px;
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 2px;
}
.chat-emojis button {
  background: none; border: none; cursor: pointer; font-size: 21px; line-height: 1;
  padding: 6px 0; border-radius: 8px;
}
.chat-emojis button:hover { background: rgba(125,150,204,.2); }
.chat-lightbox {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(8,9,13,.88); backdrop-filter: blur(10px);
  align-items: center; justify-content: center;
}
.chat-lightbox.open { display: flex; }
.chat-lightbox .lb-body img, .chat-lightbox .lb-body video {
  max-width: 92vw; max-height: 88vh; border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.7);
}
.chat-lightbox .lb-close { position: absolute; top: 16px; right: 18px; z-index: 2; }
.cfile {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 5px; max-width: 100%;
  padding: 7px 12px; border-radius: 10px; text-decoration: none; color: var(--text);
  background: rgba(255,255,255,.05); border: 1px solid var(--border-soft); font-size: 12.5px;
}
.cfile:hover { border-color: var(--accent-2); }
.cfile .material-symbols-outlined { font-size: 19px; color: var(--accent-2); }
.cfile .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cfile .fs { color: var(--text-faint); font-size: 11px; flex: none; }
.cdel {
  position: absolute; top: 4px; right: 6px; display: none; cursor: pointer;
  background: none; border: none; color: var(--text-faint); padding: 3px;
}
.cmsg:hover .cdel { display: block; }
.cdel:hover { color: #ff6b81; }
.chat-attach {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  padding: 7px 12px; border-radius: 10px;
  background: rgba(125,150,204,.12); border: 1px dashed var(--border);
}
.chat-attach .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.chat-attach .fs { color: var(--text-faint); font-size: 11px; }
.chat-attach button { margin-left: auto; background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 2px; }
.chat-attach button:hover { color: #ff6b81; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; }
.chat-compose textarea {
  flex: 1; resize: none; min-height: 40px; max-height: 120px; font-size: 13px; line-height: 1.4;
}
.chat-compose .chat-tool {
  width: 42px; height: 40px; padding: 0; flex: none; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
}
.chat-compose .chat-tool .material-symbols-outlined { font-size: 21px; }
.chat-mentions {
  position: absolute; bottom: 64px; left: 60px; z-index: 5; min-width: 200px;
  background: var(--panel-strong); backdrop-filter: blur(24px);
  border: 1px solid var(--border); border-radius: 12px; padding: 5px;
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
}
.chat-mentions button {
  display: block; width: 100%; text-align: left; padding: 7px 11px; border-radius: 8px;
  background: none; border: none; color: var(--text); font-size: 13px; cursor: pointer;
}
.chat-mentions button:hover, .chat-mentions button.sel { background: rgba(125,150,204,.2); color: var(--accent-2); }
.tool-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 6px 12px; border-radius: 12px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--text); transition: all .13s;
}
.tool-tile:hover { background: rgba(125,150,204,.14); border-color: var(--border-soft); }
.tool-tile .material-symbols-outlined { font-size: 34px; color: var(--accent-2); }
.tool-tile img { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; }
.tool-tile .emo { font-size: 28px; line-height: 1; }
.tool-tile .t {
  font-size: 11.5px; font-weight: 600; font-family: var(--font-head); text-align: center;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap;
}
.tool-modal { width: min(1200px, 95vw); max-width: none; height: 88vh; display: flex; flex-direction: column; }
.tool-modal iframe { flex: 1; width: 100%; border: 0; border-radius: 10px; background: #fff; }
/* Material Symbols library grid in the tool admin form */
.emoji-lib { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.emoji-lib button {
  width: 38px; height: 38px; border-radius: 8px; cursor: pointer; color: var(--accent-2);
  background: rgba(255,255,255,.04); border: 1px solid var(--border-soft);
  display: inline-flex; align-items: center; justify-content: center;
}
.emoji-lib button .material-symbols-outlined { font-size: 21px; }
.emoji-lib button:hover, .emoji-lib button.sel { border-color: var(--accent-2); background: rgba(125,150,204,.2); }
.shell-rail {
  width: 320px; flex: none; height: 100%; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 10px; padding: 12px 12px 14px;
  background: var(--panel-soft); backdrop-filter: blur(18px); border-left: 1px solid var(--border-soft);
}
.rail-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rail-head .badge { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.rail-top { display: flex; gap: 8px; flex: none; align-items: stretch; }
.rail-top .map-tile { flex: 1; min-width: 0; }
.grid-btn {
  width: 74px; flex: none; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border-soft); background: var(--panel-soft); backdrop-filter: blur(12px);
  color: var(--text-dim); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; font-family: var(--font-head); font-size: 10.5px; font-weight: 700; letter-spacing: .4px;
  transition: border-color .15s, color .15s;
}
.grid-btn:hover { border-color: var(--accent-2); color: var(--text); }
.grid-btn .material-symbols-outlined { font-size: 26px; }
.map-tile {
  position: relative; border-radius: 12px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--border-soft); flex: none; transition: border-color .15s;
}
.map-tile img { width: 100%; display: block; }
.map-tile .name {
  position: absolute; left: 8px; bottom: 8px; font-size: 11.5px; font-weight: 700; color: #fff;
  font-family: var(--font-head); background: rgba(16,18,26,.7); backdrop-filter: blur(8px); padding: 3px 10px; border-radius: 99px;
}
.map-tile:hover { border-color: var(--accent-2); }
.rail-videos { flex: 1; overflow-y: auto; display: block !important; min-height: 0; }
.rail-videos .vtile { aspect-ratio: 16/10; margin-bottom: 10px; cursor: pointer; }
.rail-videos .vtile:hover { border-color: var(--accent-2); }
.rail-return { display: flex; align-items: center; justify-content: center; gap: 6px; flex: none; }
.rail-ctrl .btn.icon-only {
  width: 46px; height: 40px; padding: 0; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
}
.rail-ctrl .btn .material-symbols-outlined { font-size: 23px; line-height: 1; }
/* enlarged speaker over the page area */
.stage { display: none; position: absolute; inset: 0; z-index: 60; background: #0e1015; }
.stage.open { display: block; }
.stage video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.stage .name {
  position: absolute; top: 14px; left: 16px; background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px); padding: 5px 15px; border-radius: 99px; font-size: 13px;
}
.stage-close { position: absolute; top: 12px; right: 14px; }
/* everyone-at-once grid over the page area - same surface as the single speaker.
   Column count is set inline by buildGrid() (balanced 2x1 / 2x2 / 3x2 / 3x3 ...),
   --grows carries the row count so tiles size to fill the height without distorting */
.stage-grid {
  display: none; position: absolute; inset: 0; overflow-y: auto;
  padding: 18px; gap: 14px; align-content: center; justify-items: center;
}
.stage.grid > video, .stage.grid > .name { display: none; }
.stage.grid .stage-grid { display: grid; }
.stage-grid .gtile {
  position: relative; width: 100%; aspect-ratio: 16/10;
  max-height: calc((100vh - 130px) / var(--grows, 1));
  max-width: calc((100vh - 130px) / var(--grows, 1) * 1.6);
  border-radius: 14px; overflow: hidden; cursor: pointer;
  background: #000; border: 1px solid rgba(255,255,255,.14); transition: border-color .15s;
}
.stage-grid .gtile:hover { border-color: var(--accent-2); }
.stage-grid .gtile video { width: 100%; height: 100%; object-fit: cover; }
.stage-grid .gtile .name {
  position: absolute; top: auto; left: 10px; bottom: 10px; color: #fff; background: rgba(16,18,26,.7);
  backdrop-filter: blur(8px); padding: 3px 11px; border-radius: 99px;
  font-size: 12px; font-weight: 600; font-family: var(--font-head);
}
.stage-map {
  position: absolute; left: 14px; bottom: 14px; width: 230px; cursor: pointer;
  border: 2px solid var(--accent); border-radius: 12px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.6); transition: transform .15s;
}
.stage-map:hover { transform: scale(1.03); }
.stage-map img { width: 100%; display: block; opacity: .9; }
.stage-map span {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); color: #fff;
  background: rgba(16,18,26,.85); padding: 4px 12px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; font-family: var(--font-head); white-space: nowrap;
}
/* pages rendered inside the shell: the rail owns the call UI */
html.in-shell #gmap-callbar, html.in-shell .gmap-panel { display: none !important; }

/* ---------- persistent call dock (call follows you across pages) ---------- */
.call-dock {
  position: fixed; top: 74px; right: 14px; bottom: 14px; width: 248px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); backdrop-filter: blur(24px);
  border: 1px solid var(--accent); border-radius: 16px; padding: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55); animation: pop .25s;
}
.cd-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-size: 13px; min-width: 0; }
.cd-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-videos { flex: 1; overflow-y: auto; display: block !important; min-height: 0; }
.call-dock .vtile { aspect-ratio: 16/10; margin-bottom: 10px; width: 100%; }
.cd-ctrl { display: flex; gap: 6px; justify-content: center; }
.cd-return { display: flex; align-items: center; justify-content: center; gap: 6px; }
.main { transition: margin-right .25s; }
body.has-dock .main { margin-right: 276px; }

/* ---------- Social: Tech TV + The Wire ---------- */
.social-card { display: flex; flex-direction: column; cursor: pointer; transition: transform .15s, border-color .15s; }
.social-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.social-thumb {
  position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 16/9;
  background: rgba(255,255,255,.04); flex: none;
}
.social-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.social-thumb .play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(16,18,26,.78); color: #fff; font-size: 19px; padding-left: 4px;
  border: 2px solid rgba(255,255,255,.5); transition: transform .15s, background .15s;
}
.social-card:hover .play { transform: translate(-50%,-50%) scale(1.12); background: var(--accent); }
.video-modal { width: min(920px, 94vw); max-width: none; }
.video-frame { aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: #000; }
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Financials ---------- */
.fin-charts { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
@media (max-width: 1250px) { .fin-charts { grid-template-columns: 1fr; } }
.fin-stage { display: inline-flex; gap: 4px; }
.fin-stage span {
  font-size: 9.5px; font-weight: 700; letter-spacing: .5px; padding: 3px 8px; border-radius: 99px;
  background: rgba(255,255,255,.06); color: var(--text-faint); font-family: var(--font-head);
}
.fin-stage span.on { background: rgba(125,150,204,.25); color: var(--accent-2); }
.fin-stage span.on.paid { background: rgba(61,220,151,.22); color: var(--green); }

/* ---------- appearance: wallpaper picker ---------- */
.bg-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px;
  max-height: 330px; overflow-y: auto; padding-right: 4px;
}
.bg-tile {
  position: relative; border-radius: 12px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; aspect-ratio: 16/9; transition: border-color .13s, transform .13s;
}
.bg-tile:hover { transform: scale(1.03); }
.bg-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bg-tile span {
  position: absolute; left: 6px; bottom: 6px; font-size: 10px; font-weight: 600;
  background: rgba(16,18,26,.75); backdrop-filter: blur(6px); padding: 2px 8px; border-radius: 99px;
  max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bg-tile.sel { border-color: var(--accent-2); box-shadow: 0 0 0 2px rgba(163,188,230,.3); }
input[type=range] { padding: 0; height: 26px; accent-color: var(--accent); border: none; background: transparent; }

/* status selector */
.status-drop {
  position: absolute; right: 0; top: 46px; width: 230px; z-index: 150;
  background: var(--panel-strong); backdrop-filter: blur(26px);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
  display: none; overflow: hidden;
}
.status-drop.open { display: block; }
.status-drop button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; color: var(--text); font-family: inherit;
  font-size: 13px; padding: 10px 14px; cursor: pointer; text-align: left;
}
.status-drop button:hover { background: var(--glass); }
.status-drop button.current { background: rgba(125,150,204,.14); }

/* incoming-call popup */
.call-popup {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; z-index: 500;
  background: var(--panel-strong); backdrop-filter: blur(26px);
  border: 1px solid var(--accent); border-radius: 16px;
  padding: 14px 20px; box-shadow: 0 12px 40px rgba(0,0,0,.55);
  min-width: 340px; animation: callpulse 1.2s ease-in-out infinite;
}
.call-popup .ring-ico { font-size: 26px; animation: shake .5s ease-in-out infinite; }
@keyframes callpulse {
  0%, 100% { box-shadow: 0 12px 40px rgba(0,0,0,.55), 0 0 0 0 rgba(125,150,204,.5); }
  50% { box-shadow: 0 12px 40px rgba(0,0,0,.55), 0 0 0 12px rgba(125,150,204,0); }
}
@keyframes shake {
  0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); }
}
.vtile video { width: 100%; height: 100%; object-fit: cover; }
.vtile .name { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px); padding: 4px 12px; border-radius: 99px; font-size: 12px; }
.meet-ctrl { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 12px; background: rgba(22,26,48,.85); backdrop-filter: blur(26px);
  padding: 12px 18px; border-radius: 99px; border: 1px solid var(--border);
  box-shadow: var(--shadow); z-index: 90; }
.meet-ctrl .btn { border-radius: 99px; width: 46px; height: 46px; justify-content: center; padding: 0; font-size: 17px; }
.meet-ctrl .btn.off { background: rgba(255,107,129,.25); border-color: rgba(255,107,129,.45); }

/* whiteboard */
#wb-canvas { background: rgba(255,255,255,.04); border-radius: var(--radius);
  border: 1px solid var(--border-soft); cursor: crosshair; touch-action: none;
  width: 100%; display: block; }
.wb-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.wb-tools .swatch { width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; }
.wb-tools .swatch.sel { border-color: #fff; transform: scale(1.12); }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; padding: 38px; text-align: center; }
.login-card .logo-big { width: 62px; height: 62px; border-radius: 18px; margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-size: 28px;
  box-shadow: 0 8px 32px rgba(125,150,204,.45); }
.login-card form { text-align: left; margin-top: 24px; }

/* markdown-ish wiki body */
.wiki-body { line-height: 1.7; font-size: 14px; }
.wiki-body h1, .wiki-body h2, .wiki-body h3 { margin: 18px 0 8px; }
.wiki-body p { margin: 8px 0; }
.wiki-body code { background: rgba(255,255,255,.1); padding: 1px 6px; border-radius: 5px;
  font-size: 12.5px; }
.wiki-body ul { margin: 8px 0 8px 22px; }

/* ---------- Quill dark-glass theme ---------- */
.ql-toolbar.ql-snow {
  border: 1px solid var(--border); border-bottom: none;
  border-radius: 11px 11px 0 0; background: rgba(255,255,255,.06);
}
.ql-container.ql-snow {
  border: 1px solid var(--border); border-radius: 0 0 11px 11px;
  background: rgba(0,0,0,.25); color: var(--text);
  font-family: inherit; font-size: 13.5px;
}
.quill-host .ql-editor { min-height: 100%; }
.ql-editor.ql-blank::before { color: var(--text-faint); font-style: normal; }
.ql-snow .ql-stroke { stroke: var(--text-dim); }
.ql-snow .ql-fill { fill: var(--text-dim); }
.ql-snow .ql-picker { color: var(--text-dim); }
.ql-snow .ql-picker-options { background: var(--bg-1); border-color: var(--border) !important; }
.ql-snow .ql-toolbar button:hover .ql-stroke, .ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button.ql-active .ql-stroke, .ql-snow.ql-toolbar button.ql-active .ql-stroke
  { stroke: var(--accent-2); }
.ql-snow .ql-toolbar button:hover .ql-fill, .ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow .ql-toolbar button.ql-active .ql-fill, .ql-snow.ql-toolbar button.ql-active .ql-fill
  { fill: var(--accent-2); }
.ql-snow .ql-tooltip {
  background: var(--bg-1); border-color: var(--border); color: var(--text);
  box-shadow: var(--shadow); border-radius: 10px;
}
.ql-snow .ql-tooltip input[type=text] { background: rgba(0,0,0,.3); border-color: var(--border); color: var(--text); }
.wiki-body img { max-width: 100%; border-radius: 10px; }
.wiki-body blockquote { border-left: 3px solid var(--accent); margin: 10px 0; padding: 4px 14px; color: var(--text-dim); }
.wiki-body pre { background: rgba(0,0,0,.35); padding: 12px 16px; border-radius: 10px; overflow-x: auto; }
.wiki-body ol { margin: 8px 0 8px 22px; }
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }

/* ---------- links directory ---------- */
.linkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.linkcard {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px;
  background: var(--glass-strong); border: 1px solid var(--border-soft);
  border-radius: 12px; text-decoration: none !important; color: inherit;
  transition: transform .12s, background .12s; position: relative;
}
.linkcard:hover { transform: translateY(-2px); background: rgba(255,255,255,.13); }
.linkcard .fav {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 30px;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff;
}
.linkcard b { font-size: 13px; display: block; }
.linkcard .u { font-size: 11px; color: var(--text-faint); word-break: break-all;
  display: block; margin-top: 2px; max-height: 28px; overflow: hidden; }
.linkcard .lc-actions { position: absolute; top: 6px; right: 8px; display: none; gap: 4px; }
.linkcard:hover .lc-actions { display: flex; }
.lc-actions button { background: rgba(0,0,0,.5); border: none; color: var(--text-dim);
  border-radius: 6px; padding: 3px 7px; cursor: pointer; font-size: 11px; }
.lc-actions button:hover { color: #fff; }

.priority-flag { font-size: 11px; letter-spacing: .5px; }

/* date pickers: the native calendar icon is black - invert it so it shows on dark */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.85) sepia(0.15) saturate(2) hue-rotate(180deg);
  cursor: pointer; opacity: .9;
}
input[type="date"], input[type="datetime-local"] { color-scheme: dark; }

/* task modal: single column while creating (side panel hidden) */
.modal.wide.single { max-width: 620px; }
.modal.wide.single .grid.g2 { grid-template-columns: 1fr; }

/* priority ranking list */
.rank-list .rank-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border-soft); border-radius: 12px; margin-bottom: 8px;
  background: var(--glass);
}
.rank-list.draggable .rank-row { cursor: grab; }
.rank-list .rank-row.dragging { opacity: .5; }
.rank-num {
  font-family: var(--font-head); font-weight: 800; font-size: 15px;
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--glass-strong); color: var(--accent-2);
}
.rank-row:nth-child(1) .rank-num { background: rgba(238,201,138,.2); color: var(--amber); }
.rank-row:nth-child(2) .rank-num,
.rank-row:nth-child(3) .rank-num { background: rgba(125,150,204,.2); }

/* phase blocks on project overview */
.phase-block { border: 1px solid var(--border-soft); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 10px; background: rgba(158,175,210,.03); }
.phase-block .ptask { display: flex; align-items: center; gap: 8px;
  padding: 5px 2px 5px 10px; font-size: 13px; border-radius: 8px; cursor: pointer; }
.phase-block .ptask:hover { background: var(--glass); }
.phase-block .ptask .st { width: 9px; height: 9px; border-radius: 50%; flex: none; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 860px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 18px; }
}
