/* Team Hub v1.0 — design system */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef0f6;
  --border: #e3e6ef;
  --border-strong: #cfd4e2;
  --text: #1d2233;
  --text-2: #4a5168;
  --muted: #7c849b;
  --primary: #5b5bd6;
  --primary-2: #4a4ac4;
  --primary-soft: #ececfd;
  --danger: #e03131;
  --danger-soft: #fdecec;
  --warning: #e8590c;
  --warning-soft: #fff4e6;
  --success: #2f9e44;
  --success-soft: #ebfbee;
  --info-soft: #e7f1ff;
  --shadow-sm: 0 1px 2px rgba(20, 24, 40, .06);
  --shadow: 0 4px 16px rgba(20, 24, 40, .08);
  --shadow-lg: 0 20px 50px rgba(20, 24, 40, .22);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 240px;
  --head: #3f4a6b;
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}
[data-theme='dark'] {
  --bg: #0f1117;
  --surface: #171a23;
  --surface-2: #1c202b;
  --surface-3: #232836;
  --border: #2a3040;
  --border-strong: #394157;
  --text: #e6e8ef;
  --text-2: #b8bdcc;
  --muted: #858ca1;
  --primary: #7c7cf0;
  --primary-2: #9090f5;
  --primary-soft: #24264a;
  --danger-soft: #3a1d22;
  --warning-soft: #3a2a17;
  --success-soft: #17301f;
  --info-soft: #1a2940;
  --shadow: 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .6);
  --head: #2c3450;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; } h3 { font-size: 15px; } h4 { font-size: 13px; margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
p { margin: 0 0 8px; }
code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.pad { padding: 12px 4px; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 2px; }
.stack-lg > * + * { margin-top: 28px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.icon { flex: none; display: inline-block; vertical-align: middle; }
.mobile-only { display: none !important; }

/* ---------- inputs ---------- */
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 8px 10px; outline: none; width: 100%; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
textarea { resize: vertical; }
input[type='checkbox'], input[type='radio'] { width: auto; accent-color: var(--primary); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 550; font-size: 13.5px;
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; text-decoration: none !important;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-ghost { border-color: transparent; background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; margin-top: 10px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; position: relative; width: 36px; height: 36px; border-radius: 9px;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer; text-decoration: none !important;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.xs { width: 26px; height: 26px; border-radius: 6px; }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }

.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 10px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; font: inherit; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--primary-soft); color: var(--primary); }
.seg-text button { padding: 7px 14px; font-weight: 550; }

/* ---------- auth ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-page.single { grid-template-columns: 1fr; place-items: center; background: var(--bg); }
.auth-art {
  background: radial-gradient(500px 340px at 88% 8%, rgba(255, 208, 77, .22), transparent 70%),
    radial-gradient(1200px 700px at 0% 0%, #6a45e6 0%, #4a2fc4 40%, #241f7a 100%); color: #fff; padding: 64px;
  display: flex; flex-direction: column; justify-content: center; gap: 28px;
}
.auth-art h2 { font-size: 30px; line-height: 1.25; max-width: 520px; font-weight: 600; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; font-size: 15px; opacity: .95; }
.auth-points li { display: flex; gap: 12px; align-items: center; }
.auth-page > form, .auth-card { align-self: center; justify-self: center; }
.auth-card { width: min(400px, 92vw); background: var(--surface); padding: 36px; border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font-size: 24px; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; font-weight: 700; font-size: 16px; }
.brand.big { font-size: 22px; padding: 0; }
/* StarG brand: logo + wordmark ("Star" in text colour, "G" in the logo's violet; gold on dark backgrounds) */
.brand-logo { width: 34px; height: 34px; border-radius: 9px; flex: none; box-shadow: 0 4px 12px rgba(81, 53, 214, .28); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.brand-name b { font-weight: 800; background: linear-gradient(135deg, #5135d6, #9447ef); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme='dark'] .brand-name b, .auth-art .brand-name b { background: linear-gradient(135deg, #ffe08a, #ffb020); -webkit-background-clip: text; background-clip: text; }
.brand-tag { font-size: 10px; font-weight: 600; letter-spacing: .08em; white-space: nowrap; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.brand .version { margin-left: auto; }
.brand.big .brand-logo { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 10px 30px rgba(10, 6, 50, .45); }
.brand.big .brand-name { font-size: 34px; }
.brand.big .brand-tag { color: rgba(255, 255, 255, .72); font-size: 12px; }
.brand.big { gap: 14px; }
.version { font-size: 11px; color: var(--muted); font-weight: 500; background: var(--surface-3); padding: 2px 6px; border-radius: 6px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 4px 10px; }
.nav-section { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 16px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-weight: 520; margin-bottom: 2px; text-decoration: none !important; }
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; min-width: 20px; text-align: center; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 12px; }
.me-card { display: flex; gap: 10px; align-items: center; }
.me-card b { display: block; font-size: 13px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 22px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-weight: 650; font-size: 15px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.clock { font-size: 12.5px; margin-right: 8px; }
.content { padding: 24px; flex: 1; min-width: 0; }
.content.page-chat { padding: 0; }
.sidebar-scrim { display: none; }

/* ---------- avatars & badges ---------- */
.avatar-wrap { position: relative; display: inline-flex; flex: none; }
.avatar { border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 650; object-fit: cover; flex: none; }
.presence { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #adb5bd; border: 2px solid var(--surface); }
.presence.on { background: #2f9e44; }
.user-tag { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.role-badge { display: inline-block; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }
.role-admin { background: #fde8f0; color: #c2255c; }
.role-member { background: #e7f1ff; color: #1c6ed6; }
.role-guest { background: #fff4e6; color: #d9480f; }
[data-theme='dark'] .role-admin { background: #3b1b29; color: #f783ac; }
[data-theme='dark'] .role-member { background: #1a2940; color: #74c0fc; }
[data-theme='dark'] .role-guest { background: #3a2a17; color: #ffa94d; }
.badge-dot { position: absolute; top: 3px; right: 2px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; padding: 0 5px; line-height: 16px; min-width: 16px; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; line-height: 18px; }
.tone-gray { background: #eef0f4; color: #5c637a; }
.tone-blue { background: #e3edff; color: #1c5fc9; }
.tone-blue-solid { background: #1c5fc9; color: #fff; }
.tone-green { background: #e3f7e8; color: #237a35; }
.tone-teal { background: #dff6f3; color: #0b7a6d; }
.tone-red { background: #fde6e6; color: #c92a2a; }
.tone-amber { background: #ffecb3; color: #8a5a00; }
.tone-violet { background: #efe7ff; color: #6741d9; }
.tone-cyan { background: #e0f6fb; color: #0b7285; }
.tone-pink { background: #ffe3ef; color: #c2255c; }
.tone-orange { background: #ffe8d9; color: #c2410c; }
[data-theme='dark'] .tone-gray { background: #2a3040; color: #b8bdcc; }
[data-theme='dark'] .tone-blue { background: #1b2d4d; color: #8ab4ff; }
[data-theme='dark'] .tone-blue-solid { background: #3b6fd8; }
[data-theme='dark'] .tone-green { background: #17301f; color: #8ce99a; }
[data-theme='dark'] .tone-teal { background: #12302d; color: #63e6be; }
[data-theme='dark'] .tone-red { background: #3a1d22; color: #ffa8a8; }
[data-theme='dark'] .tone-amber { background: #3a2f12; color: #ffd43b; }
[data-theme='dark'] .tone-violet { background: #2a2149; color: #b197fc; }
[data-theme='dark'] .tone-cyan { background: #12303a; color: #66d9e8; }
[data-theme='dark'] .tone-pink { background: #3b1b29; color: #faa2c1; }
[data-theme='dark'] .tone-orange { background: #3a2417; color: #ffa94d; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.chip-toggle { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); cursor: pointer; }
.chip-toggle.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { display: flex; gap: 12px; align-items: center; }
.page-title p { margin: 2px 0 0; }
.page-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 16px; color: var(--muted); text-align: center; }
.empty-title { font-weight: 600; color: var(--text-2); }
.spinner-wrap { display: grid; place-items: center; padding: 40px; }
.spinner-wrap.full { height: 100vh; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; display: flex; gap: 8px; align-items: center; margin-bottom: 12px; border: 0; text-align: left; font-family: inherit; width: 100%; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-warning { background: var(--warning-soft); color: var(--warning); display: block; }
.alert-info { background: var(--info-soft); color: var(--text-2); }
.alert.as-btn { cursor: pointer; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab { border: 0; background: transparent; font: inherit; font-weight: 550; color: var(--muted); padding: 9px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-count { background: var(--surface-3); color: var(--text-2); border-radius: 10px; font-size: 11px; padding: 0 7px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field-hint { font-size: 11.5px; color: var(--muted); }
.form-grid, .form-grid-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid-inner { grid-column: 1 / -1; }
.form-grid.narrow { max-width: 420px; grid-template-columns: 1fr; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; cursor: pointer; }
.input-row { display: flex; gap: 6px; }
.suggest { display: block; }
.file-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 38px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; background: var(--surface-3); font-size: 12.5px; max-width: 100%; color: var(--text); }
.file-chip img { width: 26px; height: 26px; object-fit: cover; border-radius: 4px; }
.file-link { display: inline-flex; align-items: center; gap: 5px; max-width: 160px; }
.file-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-input { margin: 8px 0; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; outline: 1px solid var(--border); }
.swatch.active { border-color: var(--surface); outline: 2px solid var(--text); }
.role-pick { display: grid; gap: 8px; }
.role-option { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.role-option.active { border-color: var(--primary); background: var(--primary-soft); }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 18, 30, .5); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal-wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.confirm-msg { color: var(--text-2); white-space: pre-line; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- dropdowns ---------- */
.bell-wrap, .user-menu { position: relative; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 60; min-width: 220px; overflow: hidden; }
.dropdown-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 0; background: transparent; font: inherit; color: var(--text); cursor: pointer; text-decoration: none !important; }
.dropdown-item:hover { background: var(--surface-2); }
.user-btn { border: 0; background: transparent; padding: 2px; border-radius: 50%; cursor: pointer; }
.notif-panel { width: 370px; }
.notif-list { max-height: 440px; overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--primary-soft); }
.notif-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; flex: none; color: var(--primary); }
.notif-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.notif-text span { color: var(--text-2); }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #1d2233; color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; gap: 8px; align-items: center; max-width: 380px; font-size: 13.5px; animation: pop .2s; }
.toast-success { background: #237a35; }
.toast-error { background: #c92a2a; }
.toast-warning { background: #c2410c; }

/* ---------- alarm overlay ---------- */
.alarm-backdrop { position: fixed; inset: 0; background: rgba(15, 18, 30, .6); display: grid; place-items: center; z-index: 150; animation: fade .2s; }
.alarm-card { background: var(--surface); border-radius: 20px; padding: 32px; width: min(440px, 92vw); text-align: center; box-shadow: var(--shadow-lg); animation: pop .25s; }
.alarm-card h2 { font-size: 20px; margin: 14px 0 6px; }
.alarm-icon { width: 76px; height: 76px; border-radius: 50%; background: var(--warning-soft); color: var(--warning); display: grid; place-items: center; margin: 0 auto; }
.alarm-icon.ring { animation: ring 1s ease-in-out infinite; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(0); } }
.alarm-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ---------- dashboard ---------- */
.welcome { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.welcome h1 { font-size: 24px; margin-bottom: 4px; }
.welcome-actions { display: flex; gap: 8px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.kpi:disabled { cursor: default; color: var(--text); }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { border-color: var(--primary); }
.kpi-icon { grid-row: span 2; width: 38px; height: 38px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.kpi-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.kpi-label { font-size: 12px; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.ann-list { display: flex; flex-direction: column; gap: 10px; max-height: 340px; overflow-y: auto; }
.ann { border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: 10px; padding: 10px 14px; background: var(--surface-2); }
.ann-important { border-left-color: #f59f00; }
.ann-urgent { border-left-color: var(--danger); background: var(--danger-soft); }
.ann.pinned { box-shadow: inset 0 0 0 1px var(--primary-soft); }
.ann-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ann-pin { color: var(--primary); display: inline-flex; }
.ann-body { margin: 6px 0 2px; white-space: pre-wrap; color: var(--text-2); }
.ann-actions { display: inline-flex; gap: 2px; }
.upnext { display: flex; flex-direction: column; gap: 6px; }
.upnext-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--border); }
.upnext-item.soon { border-color: #f59f00; background: var(--warning-soft); }
.upnext-time { display: flex; flex-direction: column; }
.upnext-main { display: flex; flex-direction: column; gap: 2px; cursor: pointer; min-width: 0; }
.upnext-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upnext-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.countdown { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.countdown.hot { color: var(--warning); }
.due.soon { color: var(--warning); font-weight: 600; }
.due.overdue { color: var(--danger); font-weight: 600; }
.alarms .quick-alarms { display: flex; gap: 4px; margin-bottom: 8px; }
.alarm-form { display: grid; gap: 8px; padding: 10px; background: var(--surface-2); border-radius: 10px; margin-bottom: 10px; }
.alarm-list { display: flex; flex-direction: column; gap: 4px; }
.alarm-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; }
.alarm-item:hover { background: var(--surface-2); }
.alarm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); flex: none; }
.alarm-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table.small td { padding: 7px 10px; font-size: 13px; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.progress-cell { min-width: 190px; }
.progress-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.progress { flex: 1; height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 6px; transition: width .3s; }
.progress-label { font-size: 12px; color: var(--text-2); white-space: nowrap; font-weight: 550; }
.user-cell { display: flex; gap: 10px; align-items: center; }
.inactive-row { opacity: .55; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }

/* ---------- spreadsheet grid ---------- */
.grid-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.grid-toolbar { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.grid-toolbar.standalone { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 14px; }
.grid-toolbar-right { margin-left: auto; display: flex; gap: 6px; }
.grid-count { font-size: 12px; }
.search-box { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 8px; background: var(--surface); color: var(--muted); min-width: 220px; }
.search-box input { border: 0; box-shadow: none !important; padding: 7px 0; background: transparent; }
.filter-select { width: auto; padding: 6px 28px 6px 10px; font-size: 13px; }
.grid-scroll { overflow: auto; max-height: calc(100vh - 290px); }
.sheet { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.sheet thead th {
  position: sticky; top: 0; z-index: 2; background: var(--head); color: #fff; font-weight: 600; text-align: left; padding: 9px 10px;
  border-right: 1px solid rgba(255, 255, 255, .12); white-space: nowrap; user-select: none;
}
.sheet thead th.sortable { cursor: pointer; }
.sheet thead th.sortable:hover { filter: brightness(1.15); }
.sort-ind { font-size: 9px; margin-left: 6px; opacity: .8; }
.sheet td { padding: 0 10px; height: 38px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); vertical-align: middle; background: var(--surface); }
.sheet tbody tr:nth-child(even) td { background: var(--surface-2); }
.sheet tbody tr:hover td { background: var(--primary-soft); }
.sheet td.rownum, .sheet th.rownum { width: 42px; min-width: 42px; text-align: center; color: var(--muted); font-size: 11.5px; background: var(--surface-3) !important; }
.sheet th.rownum { color: #fff; background: var(--head) !important; filter: brightness(.9); }
.sheet td.cell.editable { cursor: cell; }
.sheet td.cell.editable:hover { box-shadow: inset 0 0 0 1px var(--primary); }
.sheet td.cell.editing { padding: 0; box-shadow: inset 0 0 0 2px var(--primary); background: var(--surface) !important; }
.sheet tr.readonly td.cell { color: var(--text-2); }
.cell-input, .sheet td.editing input, .sheet td.editing select, .sheet td.editing textarea { border: 0; border-radius: 0; height: 100%; min-height: 37px; box-shadow: none !important; background: var(--surface); width: 100%; padding: 6px 10px; }
.sheet td.editing textarea { min-height: 70px; }
.cell-input-wrap { display: block; }
.cell-text { display: block; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-textarea .cell-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cell-link { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.actions-col { width: 80px; text-align: right; }
.sheet td.actions-col { padding: 0 6px; }
.sheet tr .row-actions { opacity: .35; transition: opacity .15s; }
.sheet tr:hover .row-actions { opacity: 1; }
.add-row { display: flex; gap: 6px; align-items: center; width: 100%; border: 0; border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); padding: 10px 14px; font: inherit; cursor: pointer; }
.add-row:hover { background: var(--surface-2); color: var(--primary); }
.sheet.small td, .sheet.small th { height: auto; padding: 5px 8px; font-size: 12px; }
.import-preview { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; margin-top: 10px; }
.import-blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 12px; }
.import-block { border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ib-head { display: flex; flex-direction: column; gap: 2px; }
.ib-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secret { display: inline-flex; align-items: center; gap: 4px; }
.secret code { letter-spacing: .04em; }

/* ---------- profiles board (sheet layout) ---------- */
.stat-strip { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; color: var(--text-2); }
.owner-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 16px; align-items: start; padding-bottom: 12px; }
.owner-sheet { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.owner-tag { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--owner); color: #fff; font-weight: 650; }
.owner-count { background: rgba(255, 255, 255, .25); padding: 0 8px; border-radius: 9px; font-size: 12px; }
.owner-table thead th { background: color-mix(in srgb, var(--owner) 78%, #000); position: static; }
.owner-table td { height: 34px; }

/* ---------- pipeline ---------- */
.pipeline { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 2px; }
.pipe { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 7px 12px; cursor: pointer; font: inherit; color: var(--text); white-space: nowrap; }
.pipe b { font-size: 16px; }
.pipe.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---------- projects ---------- */
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.project-card { text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s; }
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pc-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.pc-head b { font-size: 15px; }
.pc-meta { display: flex; gap: 14px; color: var(--text-2); font-size: 13px; flex-wrap: wrap; }
.pc-meta span { display: inline-flex; gap: 5px; align-items: center; }
.pc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pc-due { display: flex; gap: 5px; align-items: center; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.detail-grid > div { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.desc { white-space: pre-wrap; color: var(--text-2); background: var(--surface-2); padding: 10px 12px; border-radius: 8px; }
.progress-hero { background: var(--surface-2); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.ph-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.ph-stats > div { display: flex; flex-direction: column; }
.big-num { font-size: 24px; font-weight: 700; }
.bump { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.log-form { display: grid; grid-template-columns: 140px 80px 70px 80px 1fr auto; gap: 8px; }
.log-table { max-height: 240px; overflow-y: auto; }

/* ---------- calendar ---------- */
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; }
.calendar-side { display: flex; flex-direction: column; gap: 16px; }
.legend { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.legend-item:hover { background: var(--surface-2); }
.legend-item > span:nth-child(3) { flex: 1; }
.legend-swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.mini-list { display: flex; flex-direction: column; gap: 4px; }
.mini-item { display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; color: var(--text); background: transparent; border: 0; padding: 7px 6px; border-radius: 8px; cursor: pointer; }
.mini-item:hover { background: var(--surface-2); }
.mini-bar { width: 4px; align-self: stretch; border-radius: 4px; flex: none; }
.mini-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mini-when { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.calendar-host { --fc-border-color: var(--border); --fc-page-bg-color: var(--surface); --fc-neutral-bg-color: var(--surface-2); --fc-today-bg-color: var(--primary-soft); --fc-list-event-hover-bg-color: var(--surface-2); --fc-button-bg-color: var(--surface); --fc-button-border-color: var(--border-strong); --fc-button-text-color: var(--text); --fc-button-hover-bg-color: var(--surface-3); --fc-button-hover-border-color: var(--border-strong); --fc-button-active-bg-color: var(--primary); --fc-button-active-border-color: var(--primary); --fc-now-indicator-color: var(--danger); font-size: 13px; }
.calendar-host .fc-button { font-size: 12.5px; font-weight: 550; padding: 5px 10px; box-shadow: none !important; }
.calendar-host .fc-button-active { color: #fff !important; }
.calendar-host .fc-toolbar-title { font-size: 17px; font-weight: 650; }
.calendar-host .fc-event { cursor: pointer; border-radius: 5px; padding: 1px 3px; font-size: 12px; }
.calendar-host .fc-daygrid-event-dot { border-color: currentColor; }
.calendar-host .fc-daygrid-dot-event { color: var(--text); }
.calendar-host .ev-done { opacity: .6; }
.calendar-host .ev-cancelled { opacity: .45; text-decoration: line-through; }
.calendar-host.compact .fc-toolbar-title { font-size: 15px; }
.calendar-host .fc-col-header-cell-cushion, .calendar-host .fc-daygrid-day-number { color: var(--text-2); text-decoration: none; }
.calendar-host .fc-list-day-cushion { background: var(--surface-2); }

/* ---------- team ---------- */
.role-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.role-card { text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; cursor: pointer; }
.role-card > div { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.role-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.role-count { font-size: 22px; }

/* ---------- settings ---------- */
.settings-card { max-width: 880px; padding: 24px; }
.avatar-edit { display: flex; gap: 14px; align-items: center; }
.lists-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 12px 0; }

/* ---------- chat ---------- */
.chat { display: grid; grid-template-columns: 270px minmax(0, 1fr); height: calc(100vh - 58px); }
.chat-list { border-right: 1px solid var(--border); background: var(--surface); overflow-y: auto; padding: 8px; }
.chat-list-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 8px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.conv { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font: inherit; color: var(--text-2); text-align: left; }
.conv:hover { background: var(--surface-3); }
.conv.active { background: var(--primary-soft); color: var(--primary); }
.conv.has-unread .conv-name { font-weight: 700; color: var(--text); }
.conv.dim { opacity: .75; }
.conv-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-icon { width: 22px; height: 22px; display: grid; place-items: center; color: var(--muted); flex: none; }
.conv-icon.big { width: 32px; height: 32px; background: var(--surface-3); border-radius: 8px; }
.people-pick { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; }
.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); position: relative; }
.thread-head { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--border); }
.thread-title { display: flex; flex-direction: column; min-width: 0; }
.thread-body { flex: 1; display: flex; min-height: 0; }
.messages { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.load-older { align-self: center; }
.day-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 600; margin: 14px 0 6px; }
.day-sep::before, .day-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.msg-group { display: flex; gap: 10px; padding: 6px 0; }
.msg-col { flex: 1; min-width: 0; }
.msg-meta { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.msg { position: relative; padding: 2px 70px 2px 0; border-radius: 6px; }
.msg:hover { background: var(--surface-2); }
.msg-body { white-space: pre-wrap; word-wrap: break-word; line-height: 1.5; }
.msg-actions { position: absolute; right: 4px; top: 0; display: none; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.msg:hover .msg-actions { display: flex; }
.msg-edit { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.att-image { display: block; border: 0; padding: 0; margin: 6px 0; background: none; cursor: zoom-in; }
.att-image img { max-width: min(360px, 100%); max-height: 280px; border-radius: 10px; border: 1px solid var(--border); display: block; }
.att-video { max-width: min(460px, 100%); max-height: 320px; border-radius: 10px; margin: 6px 0; background: #000; display: block; }
.att-audio { margin: 6px 0; width: min(360px, 100%); display: block; }
.att-file { display: inline-flex; gap: 10px; align-items: center; margin: 6px 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); max-width: 380px; text-decoration: none !important; }
.att-file:hover { border-color: var(--primary); }
.att-icon { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.att-info { display: flex; flex-direction: column; min-width: 0; }
.att-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.typing { height: 18px; padding: 0 22px; font-size: 12px; color: var(--muted); font-style: italic; }
.composer { padding: 6px 18px 16px; }
.composer-row { display: flex; gap: 8px; align-items: flex-end; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; padding: 6px; }
.composer-row:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.composer textarea { border: 0; box-shadow: none !important; resize: none; padding: 8px 4px; max-height: 160px; background: transparent; }
.send-btn { padding: 8px 12px; }
.pending-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.files-panel { width: 300px; border-left: 1px solid var(--border); background: var(--surface); padding: 14px; overflow-y: auto; }
.shared-file { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.shared-file .thumb { border: 0; padding: 0; background: none; cursor: zoom-in; }
.shared-file .thumb img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }
.sf-info { display: flex; flex-direction: column; min-width: 0; }
.sf-info a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-overlay { position: absolute; inset: 10px; border: 3px dashed var(--primary); border-radius: 16px; background: color-mix(in srgb, var(--primary-soft) 85%, transparent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--primary); pointer-events: none; z-index: 5; }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .85); display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; z-index: 120; cursor: zoom-out; padding: 30px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 120px); border-radius: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: 1 / -1; }
  .lists-grid { grid-template-columns: 1fr 1fr; }
  .role-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .mobile-only { display: inline-flex !important; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .app.sidebar-open .sidebar { transform: none; }
  .app.sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 25; }
  .content { padding: 16px; }
  .clock { display: none; }
  .dash-grid, .calendar-layout { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .form-grid, .form-grid-inner, .detail-grid, .lists-grid { grid-template-columns: 1fr; }
  .log-form { grid-template-columns: 1fr 1fr; }
  .chat { grid-template-columns: 1fr; }
  .chat.show-list .thread { display: none; }
  .chat.show-thread .chat-list { display: none; }
  .files-panel { position: absolute; right: 0; top: 0; bottom: 0; z-index: 4; }
  .owner-board { grid-template-columns: 1fr; }
  .search-box { min-width: 0; flex: 1; }
  .notif-panel { width: min(370px, 92vw); }
}

/* Inline input + button row (e.g. "new type" in forms) */
.row-gap { display: flex; gap: 8px; align-items: center; }
.row-gap > input { flex: 1; min-width: 0; }

/* Sign-in details shown after creating an account / resetting a password */
.kv-table { width: 100%; border-collapse: collapse; }
.kv-table th { text-align: left; font-weight: 500; color: var(--muted, #6b7280); padding: 8px 12px 8px 0; width: 40%; white-space: nowrap; }
.kv-table td { padding: 8px 0; }
.kv-table code { font-size: 15px; }
.select-all { user-select: all; }

/* Channel people picker (admin) */
.people-panel { display: flex; flex-direction: column; gap: 12px; }
.people-panel .role-pick { display: flex; flex-direction: column; gap: 8px; }
.role-option.disabled { opacity: .55; cursor: not-allowed; }
.conv.pick { cursor: pointer; }
.conv.pick input { margin: 0 4px 0 0; }

/* Job applications */
.apps-bar { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin-bottom: 12px; }
.apps-profile { display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.kpi-mini { display: flex; flex-direction: column; justify-content: center; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 6px 14px; min-width: 92px; }
.kpi-mini b { font-size: 18px; line-height: 1.1; }
.kpi-mini span { font-size: 12px; color: var(--muted); }
.day-tabs .pipe { flex-direction: column; gap: 0; padding: 5px 12px; }
.day-tabs .pipe span { font-size: 12px; color: var(--muted); }
.pc-people { display: inline-flex; align-items: center; gap: 6px; }

/* Payments */
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.filter-row select, .filter-row input { width: auto; min-width: 150px; }
.kpi-neg .kpi-value { color: var(--danger); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.num.neg, span.num.neg { color: var(--text-2); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.pay-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
.pay-grid .card { padding: 16px; }
@media (max-width: 900px) { .pay-grid { grid-template-columns: 1fr; } }
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rank-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-val { font-variant-numeric: tabular-nums; color: var(--text-2); }
.rank-track { height: 6px; border-radius: 3px; background: var(--surface-3); }
.rank-bar { height: 6px; border-radius: 3px; background: var(--series-1); min-width: 2px; }
/* Chart series (validated pair: blue / orange, light and dark). */
:root { --series-1: #2a78d6; --series-2: #eb6834; }
[data-theme='dark'] { --series-1: #3987e5; --series-2: #d95926; }
.chart-wrap { position: relative; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.chart-legend span, .chart-tip div { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.sw-inc { background: var(--series-1); }
.sw-out { background: var(--series-2); }
.bar-chart { width: 100%; height: auto; display: block; }
.bar-chart .grid { stroke: var(--border); stroke-width: 1; }
.bar-chart .axis { fill: var(--muted); font-size: 11px; }
.bar-chart .bar-inc { fill: var(--series-1); }
.bar-chart .bar-out { fill: var(--series-2); }
.bar-chart .hover-band { fill: var(--surface-3); }
.chart-tip { position: absolute; top: 28px; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: 8px 10px; font-size: 12px; pointer-events: none; display: flex; flex-direction: column; gap: 3px; min-width: 150px; z-index: 2; }
.chart-tip div { justify-content: flex-start; }
.chart-tip span { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text); }
.chart-tip .tip-net { border-top: 1px solid var(--border); padding-top: 3px; color: var(--text-2); }
.request-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.request-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; flex-wrap: wrap; }
.rq-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rq-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rq-amount { font-size: 17px; font-variant-numeric: tabular-nums; }
.rq-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.rq-meta span { display: inline-flex; align-items: center; gap: 6px; }
.rq-notes { color: var(--text-2); }
.rq-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ---- Calendar time zones & availability ---- */
.tz-picker { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.tz-picker select { max-width: 260px; padding: 6px 8px; font-size: 13px; }
.tz-note { margin: -6px 0 10px; }
.calendar-card.marking { outline: 2px dashed var(--success); outline-offset: 2px; }
.calendar-host .fc-event.ev-avail { border-style: dashed; border-width: 1px 1px 1px 4px; font-weight: 500; }
.calendar-host .fc-timegrid-event.ev-avail { z-index: 0 !important; }
.calendar-host .fc-event.ev-avail .fc-event-main, .calendar-host .fc-event.ev-avail .fc-event-title, .calendar-host .fc-event.ev-avail .fc-event-time { color: var(--text); }
.mini-bar.avail-bar { background: transparent; border: 2px dashed var(--success); width: 0; }
.alert-success { background: var(--success-soft); color: var(--success); display: block; }
.avail-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-btn { border: 1px solid currentColor; background: var(--surface); color: inherit; border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.chip-btn:hover:not(:disabled) { background: var(--surface-2); }
.chip-btn:disabled { opacity: .6; cursor: default; }

/* ---- Calls & meetings ---- */
.call-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; display: inline-grid; place-items: center; cursor: pointer; background: #2b3245; color: #fff; position: relative; transition: background .15s, transform .1s; font: inherit; }
.call-btn:hover { background: #3a4359; }
.call-btn:active { transform: scale(.96); }
.call-btn.off { background: #e03131; }
.call-btn.off:hover { background: #c92a2a; }
.call-btn.active { background: #3b5bdb; }
.call-btn.danger { background: #e03131; }
.call-btn.danger:hover { background: #c92a2a; }
.call-btn.ok { background: #2f9e44; }
.call-btn.ok:hover { background: #2b8a3e; }
.call-btn.ghost { background: transparent; }
.call-btn.ghost:hover { background: rgba(255,255,255,.12); }
.call-btn.wide { width: auto; border-radius: 24px; padding: 0 18px; display: inline-flex; gap: 8px; align-items: center; font-weight: 600; }
.call-count { position: absolute; top: -2px; right: -2px; background: #fff; color: #1d2233; font-size: 10px; font-weight: 700; border-radius: 9px; padding: 0 5px; min-width: 16px; line-height: 16px; }

.call-window { position: fixed; inset: 0; z-index: 140; background: #11141d; color: #e9ecf5; display: flex; flex-direction: column; animation: fade .15s; }
.call-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; }
.call-title { display: flex; flex-direction: column; }
.call-title b { font-size: 16px; }
.call-title span { font-size: 12.5px; color: #a3abc2; }
.call-notice { margin: 0 16px 8px; padding: 8px 12px; background: #3d3112; color: #ffd98a; border-radius: 8px; font-size: 13px; }
.call-stage { flex: 1; min-height: 0; display: flex; gap: 10px; padding: 0 16px; position: relative; }
.call-spot { flex: 1; min-width: 0; display: flex; }
.call-spot .tile { flex: 1; aspect-ratio: auto; }
.call-grid { flex: 1; display: grid; gap: 10px; min-height: 0; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); grid-auto-rows: minmax(0, 1fr); align-content: center; }
.call-grid.n1 { grid-template-columns: minmax(0, 960px); justify-content: center; }
.call-grid.n2, .call-grid.n3, .call-grid.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.call-grid.n5, .call-grid.n6, .call-grid.n7, .call-grid.n8, .call-grid.n9 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.call-stage.spotlight .call-grid { flex: 0 0 220px; grid-template-columns: 1fr; grid-auto-rows: 130px; align-content: start; overflow-y: auto; }
.tile { position: relative; background: #1d2230; border-radius: 14px; overflow: hidden; min-height: 120px; aspect-ratio: 16 / 9; max-height: 100%; outline: 3px solid transparent; outline-offset: -3px; transition: outline-color .15s; }
.tile.speaking { outline-color: #40c057; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.tile.is-screen video { object-fit: contain; }
.tile:not(.has-video) video { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tile video.mirror { transform: scaleX(-1); }
.tile-avatar { position: absolute; inset: 0; display: grid; place-items: center; }
.tile-label { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; background: rgba(0,0,0,.55); color: #fff; padding: 3px 9px; border-radius: 6px; font-size: 12.5px; max-width: calc(100% - 16px); }
.tile-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-state { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.6); color: #ffd98a; font-size: 12px; padding: 2px 8px; border-radius: 6px; }
.call-controls { display: flex; justify-content: center; gap: 12px; padding: 14px; flex-wrap: wrap; }
.call-panel { position: absolute; right: 16px; top: 0; bottom: 0; width: 290px; background: var(--surface); color: var(--text); border-radius: 14px; padding: 14px; overflow-y: auto; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 10px; z-index: 2; }
.cp-list { display: flex; flex-direction: column; gap: 4px; }
.cp-row { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 13.5px; }
.cp-row span { flex: 1; }
.cp-row.dim { opacity: .6; }
.cp-end { margin-top: auto; }
.hidden-audio { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

.call-mini { position: fixed; right: 18px; bottom: 18px; width: 300px; z-index: 140; background: #11141d; color: #e9ecf5; border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.call-mini-view { cursor: pointer; }
.call-mini-view .tile { border-radius: 0; min-height: 0; }
.call-mini-bar { display: flex; align-items: center; gap: 6px; padding: 8px; }
.call-mini-bar .call-btn { width: 36px; height: 36px; }
.cm-title { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.cm-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-title .muted { color: #a3abc2; }

.incoming-call { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 160; background: #1d2233; color: #fff; border-radius: 16px; padding: 14px 16px; display: flex; gap: 22px; align-items: center; box-shadow: var(--shadow-lg); min-width: min(420px, 94vw); }
.ic-who { display: flex; gap: 12px; align-items: center; flex: 1; }
.ic-who > div { display: flex; flex-direction: column; }
.ic-who .muted { color: #b8bfd3; }
.ic-actions { display: flex; gap: 10px; }
.ic-pulse { border-radius: 50%; display: inline-flex; animation: ring-pulse 1.4s infinite; }
@keyframes ring-pulse { 0% { box-shadow: 0 0 0 0 rgba(64,192,87,.6); } 70% { box-shadow: 0 0 0 14px rgba(64,192,87,0); } 100% { box-shadow: 0 0 0 0 rgba(64,192,87,0); } }

.live-call { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 14px; background: var(--success-soft); border-bottom: 1px solid var(--border); }
.lc-text { display: flex; flex-direction: column; flex: 1; min-width: 160px; }
.lc-faces { display: inline-flex; padding-left: 6px; }
.lc-faces .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #e03131; display: inline-block; animation: blink 1.4s infinite; flex: none; }
@keyframes blink { 50% { opacity: .35; } }
.call-msg { display: flex; align-items: center; gap: 10px; margin: 8px auto; padding: 7px 14px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface-2); width: fit-content; max-width: 100%; font-size: 13px; }
.call-msg.missed { color: var(--danger); border-color: var(--danger-soft); background: var(--danger-soft); }
.call-msg.live { border-color: var(--success); }
.cmsg-icon { display: inline-grid; place-items: center; }

.meetings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.meetings-grid .card-head h3 { display: inline-flex; align-items: center; gap: 8px; }
.live-list { display: flex; flex-direction: column; gap: 10px; }
.live-item { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.live-item > .muted { display: block; padding: 6px 14px 0; }
.live-item .live-call { border-bottom: 0; background: transparent; }
.seg-btn { gap: 6px; }
.pick-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.pick-tools input { flex: 1; }
.meet-pick { max-height: 300px; overflow-y: auto; }
.meet-tips { margin-top: 16px; }
.meet-tips ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.7; }
@media (max-width: 900px) {
  .meetings-grid { grid-template-columns: 1fr; }
  .call-grid, .call-grid.n2, .call-grid.n3, .call-grid.n4 { grid-template-columns: 1fr; }
  .call-stage.spotlight { flex-direction: column; }
  .call-stage.spotlight .call-grid { flex: 0 0 auto; grid-auto-flow: column; grid-auto-columns: 140px; grid-auto-rows: 90px; overflow-x: auto; }
  .call-panel { left: 16px; width: auto; }
  .call-mini { width: 220px; }
  .hide-sm { display: none; }
}

/* ---- Media: viewer, chat players, embeds, voice messages ---- */
.media-viewer { position: fixed; inset: 0; z-index: 130; background: rgba(8, 10, 16, .94); color: #eef0f6; display: flex; flex-direction: column; animation: fade .15s; }
.mv-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; flex-wrap: wrap; }
.mv-title { display: flex; flex-direction: column; min-width: 0; }
.mv-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.mv-title span { font-size: 12px; color: #a3abc2; }
.mv-btn { background: rgba(255,255,255,.08); color: #eef0f6; border: 0; border-radius: 8px; padding: 7px 10px; cursor: pointer; display: inline-flex; align-items: center; font: inherit; font-size: 13px; text-decoration: none !important; }
.mv-btn:hover { background: rgba(255,255,255,.16); }
.mv-btn.on { background: #3b5bdb; }
.mv-ctl select { background: rgba(255,255,255,.08); color: #eef0f6; border: 0; border-radius: 8px; padding: 6px 8px; width: auto; }
.mv-ctl select option { color: #1d2233; }
.mv-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; padding: 0 64px; }
.mv-img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; border-radius: 6px; }
.mv-img.zoomed { max-width: none; max-height: none; cursor: zoom-out; }
.mv-stage:has(.mv-img.zoomed) { overflow: auto; align-items: flex-start; justify-content: flex-start; }
.mv-video { max-width: 100%; max-height: 100%; background: #000; border-radius: 6px; }
.mv-audio { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(520px, 100%); text-align: center; }
.mv-audio audio { width: 100%; }
.mv-audio-art { width: 140px; height: 140px; border-radius: 24px; background: linear-gradient(135deg, #3b5bdb, #7048e8); display: grid; place-items: center; color: #fff; }
.mv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; display: grid; place-items: center; }
.mv-nav:hover { background: rgba(255,255,255,.2); }
.mv-nav.prev { left: 10px; }
.mv-nav.next { right: 10px; }
.mv-strip { display: flex; gap: 6px; padding: 10px 14px; overflow-x: auto; justify-content: center; }
.mv-thumb { flex: none; width: 54px; height: 54px; border-radius: 8px; border: 2px solid transparent; background: rgba(255,255,255,.08); color: #cfd4e2; cursor: pointer; display: grid; place-items: center; padding: 0; overflow: hidden; }
.mv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mv-thumb.active { border-color: #fff; }
.att-media { position: relative; width: fit-content; max-width: 100%; }
.att-expand { position: absolute; top: 12px; right: 8px; border: 0; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; width: 28px; height: 28px; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.att-media:hover .att-expand, .att-expand:focus-visible { opacity: 1; }
.att-audio-card { display: flex; align-items: center; gap: 10px; margin: 6px 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); width: min(420px, 100%); }
.att-audio-card .att-audio { margin: 0; width: 100%; height: 36px; }
.aac-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.att-audio-card.voice .aac-icon { background: var(--success-soft); color: var(--success); }
.aac-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.aac-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shared-file .thumb.play { width: 40px; height: 40px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; cursor: pointer; }
.embed-cover { display: flex; gap: 12px; align-items: center; margin: 6px 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); cursor: pointer; width: min(460px, 100%); text-align: left; font: inherit; }
.embed-cover:hover { border-color: var(--primary); }
.embed-play { width: 42px; height: 42px; border-radius: 50%; background: #e03131; color: #fff; display: grid; place-items: center; flex: none; }
.embed-cover.audio .embed-play { background: var(--primary); }
.embed-text { display: flex; flex-direction: column; min-width: 0; }
.embed-text .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embed-frame { width: min(560px, 100%); aspect-ratio: 16 / 9; margin: 6px 0; border-radius: 12px; overflow: hidden; background: #000; }
.embed-frame.tall { width: min(320px, 100%); aspect-ratio: 9 / 16; }
.embed-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.voice-rec { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--danger); border-radius: 12px; padding: 8px 10px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }

/* ---- Admin view of other people's DMs ---- */
.team-dms-toggle { width: 100%; border: 0; background: none; cursor: pointer; font: inherit; gap: 6px; }
.team-dms-toggle b { flex: 1; text-align: left; }
.team-dms-toggle .icon { transition: transform .15s; }
.team-dms-toggle .icon.flip { transform: rotate(180deg); }
.dm-pair { display: inline-flex; flex: none; }
.dm-pair .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.admin-view-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--warning-soft); color: var(--warning); font-size: 13px; border-bottom: 1px solid var(--border); }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; }
.auth-mobile-brand img { width: 40px; height: 40px; border-radius: 11px; }
@media (max-width: 900px) { .auth-mobile-brand { display: flex; } }

/* Desktop alerts: permission banner and per-kind switches */
.alerts-prompt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 24px 0; padding: 10px 14px; border-radius: 12px; background: var(--primary-soft); color: var(--text); border: 1px solid var(--border); }
.alerts-prompt > span { flex: 1; min-width: 220px; }
.alerts-prompt svg { color: var(--primary); flex: none; }
.alert-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 18px; margin-top: 10px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.check-row input { margin-top: 3px; }
.check-row span { display: flex; flex-direction: column; gap: 2px; }
.alert-kinds > p { grid-column: 1 / -1; margin: 0; }
/* Sound choices */
.sound-grid { display: grid; gap: 10px; max-width: 620px; }
.sound-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center; }
.sound-row select { width: 100%; }
.sound-row .btn.playing { color: var(--primary); border-color: var(--primary); }
.volume-row { display: flex; align-items: center; gap: 10px; }
.volume-row input[type=range] { flex: 1; max-width: 300px; accent-color: var(--primary); }
@media (max-width: 640px) { .sound-row { grid-template-columns: 1fr auto; } .sound-row > b { grid-column: 1 / -1; } .alerts-prompt { margin: 10px 12px 0; } }
/* Push (alerts while StarG is closed) */
.push-box { margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--border); border-radius: 12px; }
.push-box h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; }
.push-box p { margin: 8px 0 0; }

/* View as: admin sees StarG as someone else (read-only) */
.view-as-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 24px; background: var(--warning-soft); color: var(--text); border-bottom: 2px solid var(--warning); font-size: 13.5px; position: sticky; top: 0; z-index: 30; }
.view-as-bar > svg { color: var(--warning); flex: none; }
.view-as-bar > span { flex: 1; min-width: 220px; }
.app.viewing-as .sidebar { box-shadow: inset -3px 0 0 var(--warning); }

/* Installed app on phones and tablets: use the real visible height (mobile browser bars come and go) and keep
   content clear of the notch, status bar and home indicator. env() is 0 everywhere else, so desktop is unchanged. */
@supports (height: 100dvh) {
  .auth-page, .app { min-height: 100dvh; }
  .sidebar, .spinner-wrap.full { height: 100dvh; }
  .chat { height: calc(100dvh - 58px - env(safe-area-inset-top)); }
}
.topbar { height: calc(58px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); padding-left: max(22px, env(safe-area-inset-left)); padding-right: max(22px, env(safe-area-inset-right)); }
.sidebar { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); padding-left: env(safe-area-inset-left); }
.content { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.toasts { bottom: calc(20px + env(safe-area-inset-bottom)); }
.auth-page { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
/* Installed (no browser bar): text selection on buttons and long-press menus feel out of place in an app. */
@media (display-mode: standalone) { .nav-item, .btn, .icon-btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } }

/* Get the app: install button and per-device steps */
.install-card { display: grid; gap: 14px; }
.install-hero { display: flex; gap: 14px; align-items: center; }
.install-hero img { width: 56px; height: 56px; border-radius: 14px; flex: none; box-shadow: 0 6px 18px rgba(81, 53, 214, .3); }
.install-devices { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.install-device { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-2, var(--surface)); }
.install-device.current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.install-device h4 { margin: 0 0 6px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.install-device ol { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); display: grid; gap: 3px; }
.install-installed { display: flex; gap: 8px; align-items: center; color: var(--success, #2f8f5b); font-weight: 600; }
.auth-install { display: flex; justify-content: center; gap: 8px; margin-top: 4px; }

/* ---- My Plans ---- */
.card-title { font-size: 14px; font-weight: 650; margin: 0 0 12px; }
.link-btn { border: 0; background: transparent; font: inherit; color: inherit; padding: 0; cursor: pointer; text-align: left; width: 100%; }
.link-btn:hover .rank-name { color: var(--primary); }
.plans-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.plans-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.plans-when { font-size: 15px; min-width: 150px; text-align: center; }
.plans-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.plans-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 960px) { .plans-grid { grid-template-columns: 1fr; } }
.plan-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.plan-count { font-size: 16px; }
.plan-ring .ring-track { fill: none; stroke: var(--surface-3); stroke-width: 7; }
.plan-ring .ring-fill { fill: none; stroke: var(--series-1); stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray .3s; }
.plan-ring .ring-label { font-size: 14px; font-weight: 700; fill: var(--text); }
.plan-leftover { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 12px; font-size: 13px; }
.plan-leftover > span { flex: 1; }
.plan-add { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.plan-add input { flex: 1; min-width: 0; }
.plan-star { color: var(--muted); }
.plan-star.on, .plan-flag { color: var(--warning); }
.plan-flag { display: inline-flex; }
.plan-list { list-style: none; margin: 0; padding: 0; }
.plan-item { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); min-height: 44px; }
.plan-item:last-child { border-bottom: 0; }
.plan-item input[type='checkbox'] { width: 18px; height: 18px; flex: none; cursor: pointer; }
.plan-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.plan-edit { flex: 1; min-width: 0; padding: 4px 8px; }
.plan-item.done .plan-title { color: var(--muted); text-decoration: line-through; }
.plan-actions { opacity: 0; transition: opacity .15s; }
.plan-item:hover .plan-actions, .plan-item:focus-within .plan-actions { opacity: 1; }
@media (hover: none) { .plan-actions { opacity: 1; } }
.plan-reflect textarea { width: 100%; margin-top: 10px; resize: vertical; }
.rating { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rating-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-2); font: inherit; font-size: 11px; cursor: pointer; }
.rating-btn b { font-size: 16px; color: var(--text); }
.rating-btn.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.rating-btn.active b { color: var(--primary); }
.rating-btn:disabled { cursor: default; }
.plan-breakdown li { list-style: none; }
.bar-chart .bar-zero { stroke: var(--series-1); stroke-width: 2; opacity: .5; }
.bar-chart .bar-none { stroke: var(--border-strong); stroke-width: 2; }
.bar-chart .axis-current { fill: var(--text); font-weight: 700; }
.plan-team-sum { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 10px; color: var(--text-2); }

/* ---- Statistics ---- */
.stats-grid { margin: 0 0 16px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 900px) { .stats-grid { grid-template-columns: 1fr; } }
.stats-people { margin-bottom: 16px; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover, .table th.sorted { color: var(--text); }
.table tr.selected td { background: var(--primary-soft); }

/* ---- Automatic updates ---- */
.update-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 3000;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: min(620px, calc(100vw - 24px)); padding: 10px 14px; border-radius: 12px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: 13px; }
.update-bar > span { flex: 1; min-width: 200px; }
.update-bar svg { color: var(--primary); flex: none; }
.plan-approval { border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
.plan-approval.state-changes { border-color: var(--danger); background: var(--danger-soft); }
.plan-approval.state-approved { border-color: var(--success); background: var(--success-soft); }
.plan-approval-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-approval-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.plan-approval-note { margin-top: 6px; font-size: 13px; color: var(--text); }
.plan-approval-ask { margin-top: 8px; }
.plan-approval-ask textarea { width: 100%; }
.plans-team { display: flex; flex-direction: column; gap: 16px; }
.plan-queue.empty-queue { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.plan-queue.empty-queue svg { color: var(--success); }
.plan-queue-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.plan-queue-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.plan-queue-head { display: flex; flex-direction: column; gap: 4px; }
.plan-queue-items { margin: 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.plan-queue-items li.done { color: var(--muted); text-decoration: line-through; }
.plan-queue-items .plan-flag { margin-right: 4px; vertical-align: -1px; }
.plan-queue-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- Backgrounds (Settings → Appearance) ---- */
#app-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
#app-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#app-bg .scrim { position: absolute; inset: 0; background: var(--bg); opacity: var(--bg-dim, .4); }
html.has-bg body { background: #05040f; }
html.has-bg .sidebar, html.has-bg .topbar { background: color-mix(in srgb, var(--surface) 82%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); }
html.has-bg .page-header { background: color-mix(in srgb, var(--surface) 72%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); border-radius: var(--radius); padding: 12px 16px; }
html.has-bg .card, html.has-bg .kpi, html.has-bg .grid-card { box-shadow: 0 8px 28px rgba(5, 4, 20, .18); }
html.has-bg .plans-bar, html.has-bg .filter-row { background: color-mix(in srgb, var(--surface) 72%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-radius: var(--radius); padding: 8px 10px; }
.appearance h3 { margin: 22px 0 6px; }
.appearance h3:first-child { margin-top: 0; }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 12px 0; }
.bg-tile { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 6px 6px 10px; border-radius: 14px; border: 2px solid transparent; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
.bg-tile:hover { border-color: var(--border-strong); }
.bg-tile.active { border-color: var(--primary); background: var(--primary-soft); }
.bg-tile b { font-size: 13px; padding: 0 4px; }
.bg-tile .small { padding: 0 4px; line-height: 1.3; }
.bg-swatch { position: relative; display: grid; place-items: center; height: 84px; border-radius: 10px; margin-bottom: 6px; color: var(--muted); border: 1px solid var(--border); overflow: hidden; }
.bg-tile.classic .bg-swatch::after { content: ''; position: absolute; left: 10px; right: 30px; top: 14px; height: 12px; border-radius: 4px; background: var(--surface); box-shadow: 0 24px 0 var(--surface), 0 48px 0 var(--surface); }
.bg-live { position: absolute; left: 6px; top: 6px; font-size: 9px; font-weight: 800; letter-spacing: .1em; color: #fff; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); padding: 1px 5px; border-radius: 5px; }
.bg-check { position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; }
.bg-controls { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin: 6px 0 4px; }
.bg-slider { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bg-slider input { width: 220px; accent-color: var(--primary); }
.appearance .seg button { gap: 6px; padding: 7px 14px; }
.stats-grid { align-items: start; }

/* ---- Plans on the dashboard ---- */
.dash-plans { display: flex; flex-direction: column; gap: 10px; }
.dash-plans .card-head { margin-bottom: 2px; }
.dash-plan-today { display: flex; align-items: center; gap: 12px; }
.dash-plan-today b { margin-right: 6px; }
.dash-plan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dash-plan-list li { display: flex; align-items: center; gap: 8px; padding: 6px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.dash-plan-list li:last-child { border-bottom: 0; }
.dash-plan-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dash-plan-list li.done .dash-plan-title { color: var(--muted); text-decoration: line-through; }
.dash-plan-list input { width: 16px; height: 16px; flex: none; cursor: pointer; margin: 0; }
.dash-plan-list .plan-flag { color: var(--warning); }
.dash-plan-add { margin: 0; }
.dash-plan-add input { padding: 6px 10px; font-size: 13px; }
.dash-plan-row { display: grid; grid-template-columns: 78px 1fr auto; align-items: center; gap: 10px; color: var(--text); padding: 6px 4px; border-radius: 8px; text-decoration: none !important; }
.dash-plan-row:hover { background: var(--surface-2); }
.dash-plan-label { font-size: 13px; font-weight: 600; }
.seg-sm button { padding: 5px 9px; font-size: 12px; }
.dash-team-plans { display: flex; flex-direction: column; gap: 12px; }
.dash-team-plans .card-head { margin-bottom: 0; flex-wrap: wrap; }
.dash-team-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.dash-team-sum > * { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
.dash-team-sum b { font-size: 20px; line-height: 1.15; }
.dash-team-sum b small { font-size: 13px; font-weight: 500; color: var(--muted); }
.dash-team-sum span { font-size: 12px; color: var(--muted); }
.dash-team-pending.has { border-color: var(--warning); background: var(--warning-soft); }
.dash-team-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-height: 320px; overflow: auto; }
.dash-team-list a { display: grid; grid-template-columns: minmax(120px, 190px) 1fr 160px; align-items: center; gap: 12px; padding: 7px 4px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
.dash-team-list li:last-child a { border-bottom: 0; }
.dash-team-list a:hover { background: var(--surface-2); }
.dash-team-list .chip, .dash-team-list .muted { justify-self: start; }
.dash-team-name { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .dash-team-list a { grid-template-columns: 1fr auto; } .dash-team-list .progress-wrap { grid-column: 1 / -1; grid-row: 2; } }

/* ---- Admin: delete a person's chat history ---- */
.history-dialog { display: flex; flex-direction: column; gap: 12px; }
.history-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.history-opt input { margin-top: 3px; width: 16px; height: 16px; flex: none; }
.history-opt.empty { opacity: .6; cursor: default; }
.history-people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.history-sure { padding: 10px 12px; border-radius: 10px; background: var(--danger-soft, #fdecec); align-items: flex-start; }
.history-sure input { margin-top: 3px; }

/* ---- Announcements banner (top of the dashboard) ---- */
.ann-hero {
  position: relative; overflow: hidden; isolation: isolate; margin-bottom: 18px; padding: 18px 20px 20px; border-radius: 18px; color: #fff;
  background:
    radial-gradient(ellipse 60% 90% at 0% 0%, rgba(255, 120, 200, .55), transparent 60%),
    radial-gradient(ellipse 50% 80% at 100% 100%, rgba(40, 200, 255, .45), transparent 60%),
    linear-gradient(120deg, #2a1b8f 0%, #5b2ee0 45%, #b02fd0 100%);
  box-shadow: 0 14px 40px -18px rgba(91, 46, 224, .75), inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.ann-hero-glow { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle at 12% 30%, #fff 0 1px, transparent 1.6px), radial-gradient(circle at 78% 18%, #ffe3a3 0 1px, transparent 1.6px),
    radial-gradient(circle at 56% 70%, #fff 0 .8px, transparent 1.4px), radial-gradient(circle at 90% 62%, #cdd8ff 0 1px, transparent 1.6px),
    radial-gradient(circle at 32% 85%, #fff 0 .8px, transparent 1.4px);
  opacity: .8; }
.ann-hero-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ann-hero-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(255, 255, 255, .18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 0 22px rgba(255, 211, 107, .45); color: #ffe08a; transform: rotate(-8deg); }
/* Stroke lettering: outlined letters with a coloured echo behind them. */
.ann-hero-title {
  position: relative; margin: 0; font-size: clamp(24px, 3.4vw, 36px); font-weight: 900; letter-spacing: .06em; text-transform: uppercase; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.6px #fff; text-shadow: 3px 3px 0 rgba(255, 79, 184, .9), 6px 6px 0 rgba(40, 200, 255, .55);
}
@supports not (-webkit-text-stroke: 1px #fff) { .ann-hero-title { color: #fff; } }
.ann-hero-count { min-width: 28px; height: 28px; padding: 0 8px; border-radius: 99px; display: inline-grid; place-items: center; font-weight: 800; font-size: 14px;
  color: #2a1b8f; background: #ffd36b; box-shadow: 0 0 0 3px rgba(255, 211, 107, .35); }
.ann-hero-new { background: #fff; color: #3b22b8; border-color: transparent; font-weight: 700; }
.ann-hero-new:hover { background: #ffe9a8; color: #2a1b8f; }
.ann-hero-empty { margin: 0; font-size: 15px; color: rgba(255, 255, 255, .88); }

.ann-hero-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; max-height: 470px; overflow-y: auto; padding: 4px; margin: -4px; }
.ann-hero-list.single { grid-template-columns: 1fr; }
.ann-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, .13); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .28); border-top: 4px solid #7fe3ff; }
.ann-card.p-important { border-top-color: #ffd36b; background: linear-gradient(160deg, rgba(255, 211, 107, .26), rgba(255, 255, 255, .1)); }
.ann-card.p-urgent { border-top-color: #ff5a5a; background: linear-gradient(160deg, rgba(255, 70, 70, .42), rgba(255, 140, 60, .2));
  box-shadow: 0 0 0 1px rgba(255, 110, 110, .55), 0 0 26px rgba(255, 70, 70, .45); animation: ann-pulse 2.4s ease-in-out infinite; }
.ann-card.pinned { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
.ann-card.p-urgent.pinned { box-shadow: 0 0 0 1px rgba(255, 110, 110, .55), 0 0 26px rgba(255, 70, 70, .45), inset 0 0 0 1px rgba(255, 255, 255, .5); }
@keyframes ann-pulse { 50% { box-shadow: 0 0 0 1px rgba(255, 140, 140, .9), 0 0 38px rgba(255, 70, 70, .7); } }
@media (prefers-reduced-motion: reduce) { .ann-card.p-urgent { animation: none; } }
.ann-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ann-tag { font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; color: #10213a; background: #7fe3ff; }
.p-important .ann-tag { background: #ffd36b; color: #3d2600; }
.p-urgent .ann-tag { background: #fff; color: #c41d1d; }
.ann-pinned { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, .9); padding: 2px 8px; border-radius: 99px; background: rgba(0, 0, 0, .18); }
.ann-card .ann-actions .icon-btn { color: rgba(255, 255, 255, .85); }
.ann-card .ann-actions .icon-btn:hover { background: rgba(255, 255, 255, .2); color: #fff; }
/* Titles: bold white letters with a dark outline painted behind them, readable on every colour. */
.ann-card-title { margin: 0; font-size: 20px; font-weight: 850; line-height: 1.2; color: #fff; overflow-wrap: anywhere;
  -webkit-text-stroke: 4px rgba(20, 8, 70, .55); paint-order: stroke fill; text-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.ann-card-body { margin: 0; white-space: pre-wrap; font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, .95); overflow-wrap: anywhere; }
.ann-card-foot { margin-top: auto; font-size: 12px; color: rgba(255, 255, 255, .75); }
@media (max-width: 640px) { .ann-hero { padding: 14px; border-radius: 14px; } .ann-hero-head { gap: 9px; } .ann-hero-icon { width: 36px; height: 36px; } .ann-hero-title { font-size: clamp(18px, 5.4vw, 30px); letter-spacing: .03em; } .ann-hero-new { width: 100%; justify-content: center; } .ann-hero-list { grid-template-columns: 1fr; } .ann-card-title { font-size: 18px; } }

.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---- Announcement text styles (chosen per announcement) ---- */
.ann-card { --ann-ink: #fff; }
.ann-card-title { color: var(--ann-ink); }
.ann-card.ts-align-center { text-align: center; }
.ann-card.ts-align-center .ann-card-top { justify-content: center; }
.ann-card.ts-size-large .ann-card-title { font-size: 26px; }
.ann-card.ts-size-large .ann-card-body { font-size: 16px; }
.ann-card.ts-size-huge .ann-card-title { font-size: 34px; line-height: 1.12; }
.ann-card.ts-size-huge .ann-card-body { font-size: 18px; }

/* Each look, used on cards (.ann-card-title) and on the picker samples (.ann-font-sample). */
.ts-stroke .ann-card-title, .ann-font-sample.ts-stroke { color: var(--ann-ink); font-weight: 850; -webkit-text-stroke: 4px rgba(20, 8, 70, .55); paint-order: stroke fill; text-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.ts-neon .ann-card-title, .ann-font-sample.ts-neon { color: #fff; font-weight: 700; -webkit-text-stroke: 0; letter-spacing: .03em;
  text-shadow: 0 0 2px #fff, 0 0 6px var(--ann-ink), 0 0 14px var(--ann-ink), 0 0 28px var(--ann-ink); }
.ts-gradient .ann-card-title, .ann-font-sample.ts-gradient { font-weight: 900; -webkit-text-stroke: 0; text-shadow: none;
  background: linear-gradient(90deg, #ffd36b, #ff7ad9 45%, #7fe3ff); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 3px rgba(20, 8, 70, .45)); }
.ts-retro .ann-card-title, .ann-font-sample.ts-retro { color: var(--ann-ink); font-weight: 900; text-transform: uppercase; letter-spacing: .03em; -webkit-text-stroke: 0;
  text-shadow: 2px 2px 0 #ff4fb8, 4px 4px 0 #6a3df0, 6px 6px 0 rgba(20, 8, 70, .55); }
.ts-hollow .ann-card-title, .ann-font-sample.ts-hollow { color: transparent; font-weight: 900; text-transform: uppercase; letter-spacing: .04em;
  -webkit-text-stroke: 1.5px var(--ann-ink); text-shadow: 3px 3px 0 rgba(255, 79, 184, .7); }
@supports not (-webkit-text-stroke: 1px #fff) { .ts-hollow .ann-card-title, .ann-font-sample.ts-hollow { color: var(--ann-ink); } }
.ts-script .ann-card-title, .ann-font-sample.ts-script { color: var(--ann-ink); font-family: 'Segoe Script', 'Brush Script MT', 'Snell Roundhand', 'Apple Chancery', cursive;
  font-weight: 700; -webkit-text-stroke: 0; text-shadow: 0 2px 8px rgba(20, 8, 70, .5); }
.ts-script .ann-card-body { font-family: 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive; }
.ts-typewriter .ann-card-title, .ann-font-sample.ts-typewriter { color: var(--ann-ink); font-family: 'Courier New', Courier, ui-monospace, monospace; font-weight: 700;
  -webkit-text-stroke: 0; letter-spacing: .02em; text-shadow: 0 1px 0 rgba(20, 8, 70, .6); }
.ts-typewriter .ann-card-body { font-family: 'Courier New', Courier, ui-monospace, monospace; }
.ts-plain .ann-card-title, .ann-font-sample.ts-plain { color: var(--ann-ink); font-weight: 700; -webkit-text-stroke: 0; text-shadow: none; }

/* Picker */
.ann-style { display: flex; flex-direction: column; gap: 12px; }
.ann-style-fonts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 520px) { .ann-style-fonts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ann-font-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 0 7px; border: 2px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--surface); color: var(--text); cursor: pointer; font: inherit; font-size: 12px; }
.ann-font-tile:hover { border-color: var(--border-strong); }
.ann-font-tile.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ann-font-swatch { display: block; width: 100%; padding: 8px 0 6px; text-align: center; background: linear-gradient(120deg, #2a1b8f 0%, #5b2ee0 45%, #b02fd0 100%); }
.ann-font-sample { display: inline-block; font-size: 26px; line-height: 1.15; }
.ann-style-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ann-style-label { font-size: 12px; font-weight: 600; color: var(--muted); min-width: 44px; }
.ann-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.ann-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); cursor: pointer; padding: 0; }
.ann-swatch.active { outline: 3px solid var(--primary); outline-offset: 2px; }
.ann-preview { margin: 0; padding: 12px; }
.ann-preview .ann-card { animation: none; }
.ann-preview-label { font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .75); margin-bottom: 8px; }
@media (max-width: 640px) { .ann-card.ts-size-large .ann-card-title { font-size: 22px; } .ann-card.ts-size-huge .ann-card-title { font-size: 27px; } }

/* Team progress: a person's other current plans under the approval status */
.plan-others { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.plan-other { border: 0; border-radius: 99px; padding: 2px 8px; font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; opacity: .9; }
.plan-other:hover { opacity: 1; text-decoration: underline; }
.seg-count { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; margin-left: 3px; border-radius: 99px; font-size: 10px; font-weight: 700; background: var(--surface-3, rgba(127,127,127,.2)); }
.seg button.active .seg-count { background: var(--primary); color: #fff; }

.team-dms-empty { margin: 2px 12px 8px; }

/* Get the app: top bar and sidebar */
.install-top { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.install-nav { width: 100%; border: 1px dashed var(--border-strong); background: transparent; color: inherit; font: inherit; cursor: pointer; margin-bottom: 8px; text-align: left; }
.install-nav:hover { border-style: solid; }

.alerts-prompt.alerts-blocked { border-color: var(--warning, #d97706); }

/* Help */
.help-page { max-width: 980px; }
.help-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.help-bar .grow { flex: 1; }
.help-gtypes { flex-wrap: wrap; }
.help-note { margin: -4px 0 10px; }
.help-topics { display: flex; flex-direction: column; gap: 10px; }
.help-topic { padding: 0; }
.help-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.help-head b { flex: 1; font-size: 15px; }
.help-head .flip { transform: rotate(180deg); }
.help-icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); flex: none; }
.help-list { margin: 0; padding: 0 20px 6px 58px; display: flex; flex-direction: column; gap: 8px; line-height: 1.5; }
.help-list .chip { vertical-align: 1px; }
.help-open { margin: 6px 16px 14px 58px; }
@media (max-width: 640px) { .help-list { padding-left: 34px; } .help-open { margin-left: 16px; } }

/* Replies */
.msg-quote { display: flex; align-items: center; gap: 6px; max-width: min(520px, 100%); margin: 2px 0 3px; padding: 4px 10px; border: 0; border-left: 3px solid var(--primary);
  border-radius: 6px; background: var(--primary-soft); color: var(--text); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.msg-quote:hover { filter: brightness(.97); }
.msg-quote b { flex: none; }
.msg-quote span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.msg-quote svg { flex: none; color: var(--primary); }
.msg-quote.gone { cursor: default; border-left-color: var(--border-strong); background: var(--surface-2); font-style: italic; }
.reply-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 6px 8px 6px 10px; border-left: 3px solid var(--primary); border-radius: 8px; background: var(--primary-soft); }
.reply-bar > svg { color: var(--primary); flex: none; }
.reply-bar-quote { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; border: 0; background: transparent; color: inherit; font: inherit; font-size: 13px; text-align: left; cursor: pointer; padding: 0; }
.reply-bar-quote span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes msg-flash { 0%, 40% { background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary); } 100% { background: transparent; box-shadow: none; } }
.msg.flash { animation: msg-flash 1.8s ease-out; }
.msg:focus-within .msg-actions { display: flex; }

/* Reactions */
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 2px; }
.reaction { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border: 1px solid var(--border); border-radius: 99px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; line-height: 1; }
.reaction:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-2); }
.reaction:disabled { cursor: default; }
.reaction.mine { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.reaction-emoji { font-size: 15px; }
.reaction-add { color: var(--muted); padding: 0 7px; opacity: 0; transition: opacity .15s; }
.msg:hover .reaction-add, .msg.picking .reaction-add, .reaction-add:focus { opacity: 1; }
@media (hover: none) { .reaction-add { opacity: 1; } }
.quick-react { font-size: 14px; line-height: 1; width: 24px; }
.msg.picking .msg-actions { display: flex; }
.emoji-picker { position: absolute; right: 4px; top: 30px; z-index: 30; width: 300px; max-width: calc(100vw - 24px); padding: 8px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,.18)); }
.emoji-picker.up { top: auto; bottom: 100%; }
.emoji-quick { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.emoji-tabs { display: flex; gap: 2px; padding: 6px 0; }
.emoji-tabs button { flex: 1; border: 0; border-radius: 6px; background: transparent; font-size: 16px; padding: 3px 0; cursor: pointer; opacity: .55; }
.emoji-tabs button.active { background: var(--primary-soft); opacity: 1; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 190px; overflow-y: auto; }
.emoji-btn { border: 0; border-radius: 8px; background: transparent; font-size: 20px; line-height: 1; padding: 5px 0; cursor: pointer; }
.emoji-btn.big { font-size: 22px; }
.emoji-btn:hover { background: var(--surface-2); transform: scale(1.15); }

/* Admin: delete a DM from the chat list */
.conv-del { display: none; place-items: center; width: 22px; height: 22px; margin-left: auto; border-radius: 6px; color: var(--danger); flex: none; }
.conv-del:hover { background: var(--danger-soft); }
.conv:hover .conv-del, .conv:focus-within .conv-del, .conv.active .conv-del { display: inline-grid; }
.conv:hover .nav-badge, .conv:hover .conv-eye { display: none; }
@media (hover: none) { .conv.active .conv-del { display: inline-grid; } }

/* Pinned messages */
.msg.pinned { background: color-mix(in srgb, var(--warning, #d97706) 7%, transparent); }
.msg-pinned { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--warning, #b45309); margin: 2px 0 1px; }
.msg-actions .icon-btn.active { color: var(--warning, #b45309); }
.pin-strip { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 16px; border: 0; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--warning, #d97706) 9%, var(--surface)); color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.pin-strip > svg { color: var(--warning, #b45309); flex: none; }
.pin-strip-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-strip-more { flex: none; font-size: 12px; font-weight: 600; color: var(--primary); padding: 2px 8px; border-radius: 99px; background: var(--primary-soft); }
.pin-item { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.pin-item-head { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.pin-item-head .muted { margin-left: auto; }
.pin-item-body { border: 0; border-left: 3px solid var(--warning, #d97706); border-radius: 6px; padding: 6px 9px; background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 13px; text-align: left; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.pin-item-foot { display: flex; align-items: center; gap: 4px; }
.pin-item-foot .spacer { flex: 1; }

/* Chat list: profile-type groups */
.chat-group-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 3px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); opacity: .85; }
.chat-group-head .muted { font-weight: 600; }

/* Text that sits right on a picture background gets a glass panel, so it stays readable in light and dark mode */
html.has-bg .welcome, html.has-bg .tabs { background: color-mix(in srgb, var(--surface) 78%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); border-radius: var(--radius); }
html.has-bg .welcome { padding: 14px 18px; }
html.has-bg .tabs { padding: 2px 8px 0; }
html.has-bg .tz-note { display: inline-block; padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--surface) 78%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
/* Calendar toolbar on phones: title on its own line, buttons wrap instead of running off the screen */
@media (max-width: 640px) {
  .calendar-host .fc-header-toolbar { flex-wrap: wrap; gap: 8px; }
  .calendar-host .fc-toolbar-chunk { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .calendar-host .fc-toolbar-chunk:nth-child(2) { order: -1; width: 100%; text-align: center; justify-content: center; }
  .calendar-host .fc-toolbar-title { font-size: 16px; }
  .calendar-host .fc .fc-button { padding: 4px 8px; font-size: 13px; }
}
