/* Simple Office dashboard. Brand colours come from the logo (navy #013a81, yellow #ffdd00). */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("vendor/fonts/inter-latin-wght-normal.woff2") format("woff2-variations"), url("vendor/fonts/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
  --brand: #013a81;
  --brand-600: #0a4ea6;
  --brand-700: #012d66;
  --accent: #ffdd00;
  --brand-soft: #e8eef8;
  --brand-text: #013a81;

  --page: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --line: #dde2eb;             /* dividers and card edges */
  --line-strong: #c8d0dd;      /* inputs, interactive cards, hover */
  --text: #0f172a;
  --muted: #64748b;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow: 0 10px 28px -10px rgba(16, 24, 40, .18), 0 2px 6px rgba(16, 24, 40, .06);
  --shadow-lg: 0 18px 50px -12px rgba(1, 58, 129, .28);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 68px;
  --bottom-h: 0px;

  /* One colour per area, so each part of the app is recognisable at a glance. */
  --chat: #6d4fe0;  --chat-soft: #efebfd;
  --mail: #0b6bcb;  --mail-soft: #e6f1fc;
  --files: #0f9488; --files-soft: #e2f5f2;
  --polls: #d9730d; --polls-soft: #fdf0e3;
  --team: #c0267a;  --team-soft: #fce8f3;
  --private: #475569; --private-soft: #eef1f5;
  --projects: #4f46e5; --projects-soft: #ecebfd;
  --hd: #0891b2; --hd-soft: #e0f4f8;
  --fin: #0f766e; --fin-soft: #e1f3f1;
  /* Task status: neutral grey (not started), blue, magenta, green. Checked for colour-blind separation; always shown with a text label. */
  --st-todo: #7b8aa3; --st-progress: #0b6bcb; --st-review: #b0399b; --st-done: #16a34a;
  --danger: #dc3545; --danger-soft: #fdecee;
  --online: #16a34a;

  --bubble-me: linear-gradient(135deg, #0a4ea6, #013a81);
  --bubble-other: #ffffff;

  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-bg: var(--page);
  --bs-body-color: var(--text);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--muted);
  --bs-link-color-rgb: 1, 58, 129;
}
[data-bs-theme="dark"] {
  --brand-soft: rgba(96, 150, 230, .16);
  --brand-text: #8db8f2;
  --page: #0a0f1c;
  --surface: #121a2b;
  --surface-2: #18223a;
  --line: #27344f;
  --line-strong: #364768;
  --text: #e5e9f2;
  --muted: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 10px 28px -10px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .3);
  --chat: #a08cff;  --chat-soft: rgba(160, 140, 255, .14);
  --mail: #5eaaf5;  --mail-soft: rgba(94, 170, 245, .14);
  --files: #37c9b8; --files-soft: rgba(55, 201, 184, .14);
  --polls: #f5a54a; --polls-soft: rgba(245, 165, 74, .14);
  --team: #f472b6;  --team-soft: rgba(244, 114, 182, .14);
  --private: #a5b4cb; --private-soft: rgba(165, 180, 203, .13);
  --projects: #9d97ff; --projects-soft: rgba(157, 151, 255, .14);
  --hd: #38c4e0; --hd-soft: rgba(56, 196, 224, .14);
  --fin: #2dd4bf; --fin-soft: rgba(45, 212, 191, .14);
  --st-todo: #6b778c; --st-progress: #3d95f5; --st-review: #cc5fb8; --st-done: #2aa862;
  --danger: #f2727f; --danger-soft: rgba(242, 114, 127, .14);
  --online: #34d399;
  --bubble-me: linear-gradient(135deg, #2563b8, #1a4a8f);
  --bubble-other: #1c2740;
  --bs-body-bg: var(--page);
  --bs-body-color: var(--text);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--muted);
  --bs-link-color-rgb: 141, 184, 242;
  --bs-tertiary-bg: var(--surface-2);
}

body { background: var(--page); color: var(--text); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
.min-w-0 { min-width: 0; }
a { color: var(--brand-text); }
::selection { background: rgba(1, 58, 129, .18); }
:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.text-body-secondary { color: var(--muted) !important; }

.tone-chat  { --tone: var(--chat);  --tone-soft: var(--chat-soft); }
.tone-mail  { --tone: var(--mail);  --tone-soft: var(--mail-soft); }
.tone-files { --tone: var(--files); --tone-soft: var(--files-soft); }
.tone-polls { --tone: var(--polls); --tone-soft: var(--polls-soft); }
.tone-danger { --tone: var(--danger); --tone-soft: var(--danger-soft); }
.tone-team  { --tone: var(--team);  --tone-soft: var(--team-soft); }
.tone-private { --tone: var(--private); --tone-soft: var(--private-soft); }
.tone-projects { --tone: var(--projects); --tone-soft: var(--projects-soft); }
.tone-hd { --tone: var(--hd); --tone-soft: var(--hd-soft); }
.tone-fin { --tone: var(--fin); --tone-soft: var(--fin-soft); }

/* ---------------------------------------------------------------- buttons and inputs */
.btn { border-radius: var(--radius-sm); font-weight: 500; }
.btn-brand { --bs-btn-color: #fff; --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600);
  --bs-btn-active-bg: var(--brand-700); --bs-btn-active-color: #fff; --bs-btn-active-border-color: var(--brand-700);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); --bs-btn-disabled-color: #fff;
  box-shadow: 0 4px 14px -4px rgba(1, 58, 129, .45); }
[data-bs-theme="dark"] .btn-brand { --bs-btn-bg: #1f5fb8; --bs-btn-border-color: #1f5fb8; --bs-btn-hover-bg: #2b6fcc; --bs-btn-hover-border-color: #2b6fcc; box-shadow: none; }
.btn-soft { --bs-btn-color: var(--brand-text); --bs-btn-bg: var(--brand-soft); --bs-btn-border-color: transparent;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand-700); --bs-btn-active-color: #fff; }
.btn-light-soft { --bs-btn-color: var(--text); --bs-btn-bg: var(--surface-2); --bs-btn-border-color: var(--line);
  --bs-btn-hover-bg: var(--line); --bs-btn-hover-border-color: var(--line); --bs-btn-hover-color: var(--text); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s, color .15s, border-color .15s; text-decoration: none; }
.icon-btn:hover { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--line); background-color: var(--surface); color: var(--text); }
.form-control:focus, .form-select:focus { border-color: #6b95d1; box-shadow: 0 0 0 4px rgba(10, 78, 166, .14); background-color: var(--surface); color: var(--text); }
.form-control::placeholder { color: var(--muted); opacity: .8; }
.form-label { font-weight: 500; font-size: .9rem; }

.search-box { position: relative; min-width: 0; }
.search-box > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box .form-control { padding-left: 2.4rem; }

.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; z-index: 2; }
.input-icon .form-control { padding-left: 2.75rem; }
.input-icon-btn { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: .35rem .5rem; border-radius: 8px; }
.input-icon-btn:hover { color: var(--text); background: var(--surface-2); }
.input-icon:has(.input-icon-btn) .form-control { padding-right: 3rem; }

/* Segmented control (tabs that switch a list). */
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; flex-shrink: 0; }
.segmented button { border: 0; background: none; color: var(--muted); font-weight: 500; font-size: .9rem; padding: .4rem .9rem; border-radius: 9px;
  display: inline-flex; align-items: center; gap: .4rem; transition: background .15s, color .15s; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--brand); color: #fff; box-shadow: 0 2px 8px -2px rgba(1, 58, 129, .5); }
[data-bs-theme="dark"] .segmented button.active { background: #1f5fb8; }

/* The logo has a transparent background, so it always sits on a white plate. */
.logo-plate { background: #fff; border-radius: 12px; padding: .45rem .75rem; display: inline-flex; justify-content: center; }
.logo-plate img { height: auto; max-width: 100%; display: block; }

/* ---------------------------------------------------------------- sign in */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr; background: var(--surface); }
.login-art { display: none; position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(1200px 600px at -10% -10%, #1d63c1 0%, transparent 55%), radial-gradient(900px 500px at 110% 110%, #0a2f66 0%, transparent 60%), linear-gradient(150deg, #013a81 0%, #01275a 100%); }
.login-art::before, .login-art::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .08); }
.login-art::before { width: 520px; height: 520px; right: -160px; top: -140px; }
.login-art::after { width: 380px; height: 380px; left: -120px; bottom: -120px; background: rgba(255, 221, 0, .06); border-color: rgba(255, 221, 0, .18); }
.login-art-inner { position: relative; z-index: 1; padding: 64px; max-width: 560px; }
.login-art h2 { font-size: 2.4rem; font-weight: 750; letter-spacing: -.02em; margin: 48px 0 28px; line-height: 1.15; }
.logo-plate-lg { padding: .7rem 1.1rem; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.login-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.login-points li { display: flex; align-items: center; gap: 14px; color: rgba(255, 255, 255, .88); }
.login-points i { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .1); color: var(--accent); font-size: 1.1rem; flex-shrink: 0; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: var(--surface); }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { letter-spacing: -.02em; }
.login-card.wide { max-width: 520px; }
.reg-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reg-choice .btn { font-weight: 600; }
.reg-choice .btn-check:checked + .btn { background: var(--brand); border-color: var(--brand); color: #fff; }
.join-code { font-family: var(--bs-font-monospace); font-size: 1.35rem; font-weight: 700; letter-spacing: .12em; }
@media (min-width: 992px) {
  .login-wrap { grid-template-columns: 1.1fr 1fr; }
  .login-art { display: flex; align-items: center; }
}

/* ---------------------------------------------------------------- app shell */
.app { min-height: 100vh; min-height: 100dvh; }
.sidebar { display: none; }
.main { min-width: 0; padding-bottom: var(--bottom-h); }

@media (min-width: 992px) {
  .app { display: grid; grid-template-columns: 264px 1fr; }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; padding: 20px 14px; color: #fff;
    background: linear-gradient(180deg, #01408c 0%, #012d66 55%, #01234f 100%);
    /* short windows: the menu scrolls on its own, without moving the page */
    overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
  .sidebar::-webkit-scrollbar { width: 6px; }
  .sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .25); border-radius: 3px; }
  .sidebar-logo, .sidebar-foot { flex-shrink: 0; }
  [data-bs-theme="dark"] .sidebar { background: linear-gradient(180deg, #0f1a30 0%, #0b1426 100%); border-right: 1px solid var(--line); }
}
.sidebar-logo { display: flex; justify-content: center; margin-bottom: 26px; }
.sidebar-logo .logo-plate { transition: transform .15s; }
.sidebar-logo:hover .logo-plate { transform: scale(1.03); }
.sidebar-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255, 255, 255, .5); padding: 0 12px 8px; font-weight: 600; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: rgba(255, 255, 255, .78);
  text-decoration: none; font-weight: 500; transition: background .15s, color .15s; position: relative; }
.side-nav a i { font-size: 1.15rem; width: 22px; text-align: center; }
.side-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-nav a.active { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.side-nav a.active i { color: var(--accent); }
.side-nav a.active::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.side-nav .nav-badge { margin-left: auto; }
.nav-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; font-size: .72rem; font-weight: 700; line-height: 22px; text-align: center;
  background: var(--accent); color: #1f2937; }
.sidebar-foot { margin-top: auto; }
.sidebar .online-chip { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .85); width: 100%; justify-content: center; }

.online-chip { display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; padding: .4rem .8rem; border-radius: 999px; background: var(--surface); color: var(--muted); border: 1px solid transparent; }
.app-header .online-chip { border-color: var(--line); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-online { background: var(--online); }
.dot.pulse { box-shadow: 0 0 0 0 rgba(22, 163, 74, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }

/* Header */
.app-header { position: sticky; top: 0; z-index: 1020; height: var(--header-h); display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: color-mix(in srgb, var(--page) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s; }
.app-header.scrolled { border-bottom-color: var(--line); }
@media (min-width: 768px) { .app-header { padding: 0 28px; } }
.header-back { width: 38px; height: 38px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; flex-shrink: 0; font-size: 1.1rem; transition: background .15s; }
.header-back:hover { background: var(--brand-soft); color: var(--brand-text); }
.header-logo { background: #fff; border-radius: 9px; padding: 4px 8px; display: inline-flex; flex-shrink: 0; }
.header-logo img { height: 24px; width: auto; }
.header-titles { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); line-height: 1.2; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand-text); text-decoration: underline; }
.crumb-sep { font-size: .65rem; opacity: .7; }
.crumb-current { color: var(--text); font-weight: 500; }
.page-title { font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.25; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.account-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 12px 3px 3px; color: var(--text); max-width: 220px; }
.account-btn:hover { box-shadow: var(--shadow-sm); }
@media (max-width: 767.98px) { .account-btn { padding: 3px; } }
.account-name { font-weight: 500; font-size: .9rem; max-width: 130px; }
.account-menu { min-width: 250px; border-radius: 14px; border-color: var(--line); box-shadow: var(--shadow); padding: 6px; background: var(--surface); }
.account-menu .dropdown-item { border-radius: 8px; padding: .5rem .75rem; display: flex; align-items: center; gap: .6rem; }
.theme-switch { display: flex; gap: 4px; }
.theme-switch button { flex: 1; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 8px; padding: .35rem 0; }
[data-theme-pref="light"] .theme-switch [data-theme="light"],
[data-theme-pref="auto"] .theme-switch [data-theme="auto"],
[data-theme-pref="dark"] .theme-switch [data-theme="dark"] { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; }

/* Content */
.content { padding: 4px 16px 24px; max-width: 1480px; }
@media (min-width: 768px) { .content { padding: 4px 28px 32px; } }
section[data-section]:not(.d-none) { animation: fade-in .25s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Bottom tabs */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; justify-content: space-around;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; color: var(--muted);
  text-decoration: none; font-size: .7rem; font-weight: 500; position: relative; }
.bottom-nav a i { font-size: 1.2rem; line-height: 1; padding: 3px 11px; border-radius: 999px; transition: background .15s; }
.bottom-nav a.active { color: var(--brand-text); }
.bottom-nav a.active i { background: var(--brand-soft); }
.bottom-nav .nav-badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 18px; height: 18px; line-height: 18px; font-size: .65rem; padding: 0 5px; }
@media (max-width: 991.98px) { :root { --bottom-h: 72px; } }
@media (min-width: 992px) { .bottom-nav { display: none; } }

/* ---------------------------------------------------------------- shared building blocks */
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 18px 10px; }
.panel-head h3 { font-size: 1rem; font-weight: 650; margin: 0; display: flex; align-items: center; gap: 10px; }
.panel-icon { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--tone-soft); color: var(--tone); font-size: .95rem; }
.panel-link { font-size: .85rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.panel-link:hover { text-decoration: underline; }
.panel-list { padding: 4px 8px 10px; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; color: inherit; text-decoration: none; cursor: pointer; min-width: 0; }
a.row-item:hover, button.row-item:hover, .row-item[data-peer]:hover { background: var(--surface-2); color: inherit; }
button.row-item { width: 100%; border: 0; background: none; text-align: left; }
.row-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-time { font-size: .75rem; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.row-empty { text-align: center; color: var(--muted); font-size: .88rem; padding: 26px 12px; }
.row-empty i { display: block; font-size: 1.6rem; margin-bottom: 6px; opacity: .6; }
.tile { width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--tone-soft, var(--brand-soft)); color: var(--tone, var(--brand-text)); font-size: 1.15rem; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mail); flex-shrink: 0; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--tone-soft); color: var(--tone); white-space: nowrap; }
.pill-muted { background: var(--surface-2); color: var(--muted); }
.pill-open { --tone: var(--online); --tone-soft: rgba(22, 163, 74, .12); }

.empty-state { margin: auto; text-align: center; padding: 32px; max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-icon { width: 58px; height: 58px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem;
  background: var(--tone-soft); color: var(--tone); margin-bottom: 6px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search-box { min-width: 200px; }

/* Avatars: a stable colour per person. */
.avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 650; font-size: .82rem; color: #fff; background: var(--av, var(--brand)); position: relative; letter-spacing: .02em; }
.avatar-sm { width: 32px; height: 32px; font-size: .72rem; }
.avatar-me { width: 34px; height: 34px; font-size: .78rem; background: var(--accent); color: #1f2937; }
.avatar.online::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--online); border: 2.5px solid var(--surface); }
.avatar-general { background: linear-gradient(135deg, #6d4fe0, #0b6bcb); }

/* ---------------------------------------------------------------- dashboard */
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 26px; color: #fff; margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-end; justify-content: space-between;
  background: radial-gradient(700px 300px at 100% 0%, rgba(255, 221, 0, .22), transparent 60%), radial-gradient(600px 300px at 0% 100%, rgba(29, 99, 193, .8), transparent 60%), linear-gradient(135deg, #01408c 0%, #012a60 100%);
  box-shadow: var(--shadow-lg); }
[data-bs-theme="dark"] .hero { background: radial-gradient(700px 300px at 100% 0%, rgba(255, 221, 0, .12), transparent 60%), linear-gradient(135deg, #133567 0%, #0d1f3d 100%); box-shadow: none; border: 1px solid var(--line); }
.hero::after { content: ""; position: absolute; width: 340px; height: 340px; right: -90px; bottom: -200px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .12); pointer-events: none; }
.hero-text { position: relative; z-index: 1; min-width: 0; }
.hero-date { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .7); font-weight: 600; }
.hero-title { font-size: 1.75rem; font-weight: 750; letter-spacing: -.025em; margin: 6px 0 4px; }
.hero-sub { margin: 0; color: rgba(255, 255, 255, .8); }
@media (min-width: 768px) { .hero { padding: 32px 34px; } .hero-title { font-size: 2.1rem; } }
.hero-actions { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; }
@media (min-width: 576px) { .hero-actions { grid-template-columns: repeat(4, auto); width: auto; } }
.quick { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px; min-width: 104px; border-radius: 14px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .16); color: #fff; font-size: .82rem; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .15s; backdrop-filter: blur(6px); }
.quick i { font-size: 1.3rem; color: var(--accent); }
.quick:hover { background: rgba(255, 255, 255, .2); color: #fff; transform: translateY(-2px); }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (min-width: 1200px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.stat { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; min-width: 0; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--tone) 35%, var(--line)); color: inherit; }
.stat-icon { width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem;
  background: var(--tone-soft); color: var(--tone); }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-value { font-size: 1.65rem; font-weight: 750; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .82rem; line-height: 1.3; }
.stat-go { position: absolute; top: 12px; right: 12px; color: var(--muted); opacity: 0; transition: opacity .15s; font-size: .85rem; }
.stat:hover .stat-go { opacity: 1; color: var(--tone); }
@media (max-width: 575.98px) { .stat { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; } .stat-icon { width: 40px; height: 40px; } }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 992px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mini-bar { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.mini-bar span { display: block; height: 100%; background: var(--polls); border-radius: 3px; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px; }

/* ---------------------------------------------------------------- messenger */
.messenger { display: flex; overflow: hidden; height: calc(100vh - var(--header-h) - 32px - var(--bottom-h)); height: calc(100dvh - var(--header-h) - 32px - var(--bottom-h)); min-height: 420px; }
.chat-list { width: 330px; flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.chat-list-head { padding: 14px; border-bottom: 1px solid var(--line); }
.chat-conversations { overflow-y: auto; flex: 1; padding: 6px; }
.conv-item { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; cursor: pointer; transition: background .12s; }
.conv-item:hover { background: var(--surface-2); }
.conv-item.active { background: var(--brand-soft); }
.conv-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-preview { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item.has-unread .conv-preview { color: var(--text); font-weight: 500; }
.conv-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--chat); color: #fff; font-size: .7rem; font-weight: 700; line-height: 20px; text-align: center; flex-shrink: 0; }
.chat-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--surface-2);
  background-image: radial-gradient(color-mix(in srgb, var(--line) 70%, transparent) 1px, transparent 1px); background-size: 18px 18px; }
.chat-active { display: flex; flex-direction: column; height: 100%; }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.chat-messages { flex: 1; overflow-y: auto; padding: 18px 18px 8px; }
.msg { display: flex; flex-direction: column; margin-bottom: 6px; max-width: min(75%, 560px); }
.msg.me { margin-left: auto; align-items: flex-end; }
.msg .who { font-size: .72rem; font-weight: 600; color: var(--chat); margin: 0 12px 2px; }
.msg .bubble { background: var(--bubble-other); padding: .55rem .9rem; border-radius: 18px 18px 18px 6px; white-space: pre-wrap; overflow-wrap: anywhere;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08); line-height: 1.45; }
.msg.me .bubble { background: var(--bubble-me); color: #fff; border-radius: 18px 18px 6px 18px; }
.msg .meta { font-size: .68rem; color: var(--muted); margin: 3px 10px 4px; }
.day-sep { display: flex; justify-content: center; margin: 14px 0; }
.day-sep span { font-size: .72rem; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 3px 12px; border-radius: 999px; }
.chat-composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 4px; background: var(--surface); border-top: 1px solid var(--line); }
.chat-composer textarea { resize: none; max-height: 160px; border-radius: 22px; padding: .6rem 1rem; background: var(--surface-2); }
.send-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; flex-shrink: 0; background: var(--brand); color: #fff; font-size: 1.05rem;
  display: inline-flex; align-items: center; justify-content: center; transition: transform .12s, background .15s; box-shadow: 0 4px 12px -3px rgba(1, 58, 129, .5); }
.send-btn:hover { background: var(--brand-600); transform: scale(1.05); }
[data-bs-theme="dark"] .send-btn { background: #1f5fb8; box-shadow: none; }
.composer-hint { font-size: .68rem; color: var(--muted); text-align: center; padding: 0 0 6px; background: var(--surface); }
@media (max-width: 767.98px) {
  .messenger { margin: 0 -16px; border-radius: 0; border-left: 0; border-right: 0; height: calc(100dvh - var(--header-h) - 4px - var(--bottom-h)); }
  .chat-list { width: 100%; border: 0; }
  .messenger.chat-open .chat-list { display: none; }
  .messenger:not(.chat-open) .chat-pane { display: none !important; }
  .composer-hint { display: none; }
  .chat-composer { padding-bottom: 10px; }
}

/* ---------------------------------------------------------------- inbox */
.mail-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 992px) { .mail-layout { grid-template-columns: minmax(300px, 5fr) 7fr; } }
.mail-list { max-height: calc(100dvh - var(--header-h) - 120px - var(--bottom-h)); overflow-y: auto; padding: 6px; }
.mail-item { display: flex; gap: 12px; padding: 12px; border-radius: 12px; cursor: pointer; transition: background .12s; position: relative; }
.mail-item:hover { background: var(--surface-2); }
.mail-item.active { background: var(--brand-soft); }
.mail-item .mail-subject { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; }
.mail-item.unread .mail-subject, .mail-item.unread .mail-from { font-weight: 700; }
.mail-from { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-preview { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-read-panel { min-height: 420px; }
.mail-reader { padding: 24px; height: 100%; display: flex; flex-direction: column; }
.mail-reader h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.015em; margin: 0; }
.mail-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mail-meta { display: flex; gap: 12px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.token-input { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; min-height: 40px; cursor: text; }
.token-input input { border: 0; outline: 0; flex: 1; min-width: 180px; background: transparent; color: inherit; }
.token { background: var(--brand-soft); color: var(--brand-text); border-radius: 1rem; padding: .15rem .3rem .15rem .7rem; font-size: .85rem; font-weight: 500; display: inline-flex; align-items: center; gap: .2rem; }
.token button { border: 0; background: none; color: inherit; line-height: 1; padding: 0 .25rem; font-size: 1rem; }

/* ---------------------------------------------------------------- public folder */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center;
  background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; margin-bottom: 16px; }
.dropzone .empty-icon { width: 48px; height: 48px; font-size: 1.35rem; border-radius: 14px; }
.dropzone:hover, .dropzone.over { border-color: var(--files); background: var(--files-soft); }
#upload-progress:not(:empty) { margin-bottom: 16px; display: grid; gap: 8px; }
.upload-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.upload-row .progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.upload-row .progress-bar { background: var(--files); border-radius: 3px; transition: width .2s; }
/* "Preparing…" state: the server is still building the zip, so there is no percentage yet — a bar that slides across. */
.upload-row .progress-bar.indeterminate { width: 40%; transition: none; animation: indet-slide 1.1s ease-in-out infinite; }
@keyframes indet-slide { 0% { margin-left: -42%; } 100% { margin-left: 100%; } }
.file-list { padding: 0 8px 8px; }
.file-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; transition: background .12s; }
/* the name never gets squeezed below a readable width: when the row is tight, the action buttons wrap below it */
.file-row > .min-w-0 { flex: 1 1 9rem; }
.file-row:hover { background: var(--surface-2); }
.file-row.selected { background: var(--brand-soft); }
.file-row .file-name { font-weight: 500; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.file-row .file-name:hover { color: var(--brand-text); text-decoration: underline; }
.file-list { container-type: inline-size; }
/* columns follow the width of the file list itself (not the window), so a narrow pane never crushes the name */
.file-cols { display: none; }
.file-head { display: none; }
@container (min-width: 680px) {
  .file-cols { display: grid; grid-template-columns: 90px 110px; gap: 12px; font-size: .86rem; color: var(--muted); flex-shrink: 0; }
  .file-cols > :nth-child(2) { display: none; }
  .file-cols > :first-child { text-align: right; }
  .file-row .row-sub { display: none; }
  .file-row { flex-wrap: nowrap; }
  .file-head { display: flex; gap: 12px; padding: 0 10px 6px; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
  .file-head .grow { flex: 1; padding-left: 52px; }
  .file-head .file-cols { display: grid; color: var(--muted); font-size: .72rem; }
  .file-head .acts { width: 80px; }
}
@container (min-width: 900px) {
  .file-cols { grid-template-columns: 90px 170px 110px; }
  .file-cols > :nth-child(2) { display: block; }
}
.file-acts { display: flex; gap: 6px; flex-shrink: 0; margin-inline-start: auto; }
.file-sel { flex-shrink: 0; margin: 0; width: 18px; height: 18px; cursor: pointer; }
.file-head .file-sel { align-self: center; }
.file-bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin: 0 8px 10px; border-radius: 12px; background: var(--brand-soft); border: 1px solid var(--line); }
.file-bulk .fb-count { font-weight: 600; }
.file-bulk .fb-actions { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.file-row .file-share.on { color: var(--brand-text); border-color: var(--brand-text); background: var(--brand-soft); }
.ft-pdf { --tone: #dc2626; --tone-soft: #fdecec; }
.ft-doc { --tone: #2563eb; --tone-soft: #e8effd; }
.ft-xls { --tone: #15803d; --tone-soft: #e5f4ea; }
.ft-ppt { --tone: #ea580c; --tone-soft: #fdeee4; }
.ft-img { --tone: #9333ea; --tone-soft: #f3e9fd; }
.ft-zip { --tone: #a16207; --tone-soft: #fbf3dc; }
.ft-media { --tone: #db2777; --tone-soft: #fce8f2; }
.ft-other { --tone: #475569; --tone-soft: #eef1f5; }
.ft-check { --tone: #0d9488; --tone-soft: #e2f4f1; }
[data-bs-theme="dark"] .ft-pdf, [data-bs-theme="dark"] .ft-doc, [data-bs-theme="dark"] .ft-xls, [data-bs-theme="dark"] .ft-ppt,
[data-bs-theme="dark"] .ft-img, [data-bs-theme="dark"] .ft-zip, [data-bs-theme="dark"] .ft-media, [data-bs-theme="dark"] .ft-other, [data-bs-theme="dark"] .ft-check { --tone-soft: rgba(255, 255, 255, .07); }
[data-bs-theme="dark"] .ft-pdf { --tone: #f87171; } [data-bs-theme="dark"] .ft-doc { --tone: #7aa7f7; } [data-bs-theme="dark"] .ft-xls { --tone: #4ade80; }
[data-bs-theme="dark"] .ft-ppt { --tone: #fb923c; } [data-bs-theme="dark"] .ft-img { --tone: #c084fc; } [data-bs-theme="dark"] .ft-zip { --tone: #facc15; }
[data-bs-theme="dark"] .ft-media { --tone: #f472b6; } [data-bs-theme="dark"] .ft-other { --tone: #94a3b8; } [data-bs-theme="dark"] .ft-check { --tone: #2dd4bf; }

/* ---------------------------------------------------------------- polls */
.polls-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 768px) { .polls-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .polls-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.poll-card { padding: 20px; display: flex; flex-direction: column; }
.poll-card h3 { font-size: 1.05rem; font-weight: 650; margin: 0; overflow-wrap: anywhere; line-height: 1.35; }
.poll-meta { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 16px; }
.poll-option { position: relative; display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left; border: 1.5px solid var(--line);
  border-radius: 12px; padding: .65rem .9rem; background: var(--surface); color: inherit; overflow: hidden; transition: border-color .15s, transform .1s; }
button.poll-option:hover { border-color: var(--polls); }
button.poll-option:active { transform: scale(.99); }
.poll-option .bar { position: absolute; inset: 0 auto 0 0; background: var(--polls-soft); z-index: 0; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.poll-option > *:not(.bar) { position: relative; z-index: 1; }
.poll-option.mine { border-color: var(--polls); }
.poll-option.mine .bar { background: color-mix(in srgb, var(--polls) 22%, transparent); }
.poll-option .check { color: var(--polls); font-size: 1.05rem; }
.poll-option .pct { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.poll-card.closed { opacity: .82; }
.poll-foot { font-size: .8rem; color: var(--muted); margin-top: auto; padding-top: 14px; }

/* ---------------------------------------------------------------- modals and toasts */
.modal-content { border: 0; border-radius: 18px; background: var(--surface); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .35); }
.modal-header { border-bottom-color: var(--line); padding: 18px 22px; }
.modal-title { font-weight: 650; font-size: 1.1rem; }
.modal-body { padding: 20px 22px; }
.modal-footer { border-top-color: var(--line); padding: 14px 22px; }
@media (max-width: 575.98px) { .modal-fullscreen-sm-down .modal-content { border-radius: 0; } }
.dropdown-menu { border-radius: 12px; border-color: var(--line); box-shadow: var(--shadow); background: var(--surface); padding: 6px; }
.dropdown-item { border-radius: 8px; }
.toasts { right: 0; bottom: var(--bottom-h); z-index: 1090; }
.toast { border-radius: 12px; box-shadow: var(--shadow); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Phones: full-width search under the main buttons; a light "back to chats" chevron. */
@media (max-width: 575.98px) {
  .toolbar .search-box { order: 10; flex-basis: 100%; }
  .toolbar .segmented + .search-box + .btn, .toolbar .segmented ~ .btn { margin-left: auto; }
}
.chat-back { border: 0; background: none; color: var(--brand-text); font-size: 1.3rem; padding: 0 2px 0 0; margin-left: -4px; line-height: 1; }

/* ---------------------------------------------------------------- first sign-in setup */
.setup-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background: radial-gradient(900px 500px at 0% 0%, rgba(29, 99, 193, .14), transparent 60%), radial-gradient(700px 400px at 100% 100%, rgba(255, 221, 0, .12), transparent 60%), var(--page); }
.setup-card { width: 100%; max-width: 640px; padding: 28px; box-shadow: var(--shadow); }
@media (min-width: 576px) { .setup-card { padding: 36px 40px; } }
.setup-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.setup-top .logo-plate { padding: 0; }
[data-bs-theme="dark"] .setup-top .logo-plate { padding: .35rem .6rem; }
.setup-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.setup-steps span { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.setup-steps span.done { background: var(--online); color: #fff; border-color: transparent; }
.setup-steps span.now { background: var(--brand); color: #fff; border-color: transparent; box-shadow: 0 0 0 4px var(--brand-soft); }
.setup-steps .line { flex: 0 0 36px; height: 2px; background: var(--line); border-radius: 1px; }
.pw-rules { list-style: none; padding: 0; margin: 14px 0 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 16px; font-size: .84rem; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 6px; }
.pw-rules li i::before { content: "\F287"; font-size: .55rem; } /* bi-circle-fill */
.pw-rules li.ok { color: var(--online); }
.pw-rules li.ok i::before { content: "\F26A"; font-size: .95rem; } /* bi-check-circle-fill */
.account-menu #me-role:empty { display: none; }

/* ---------------------------------------------------------------- searchable "To" field */
.combo { position: relative; }
.combo-menu { position: absolute; z-index: 1060; left: 0; right: 0; top: calc(100% + 4px); max-height: 300px; overflow-y: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.combo-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.combo-opt.active, .combo-opt:hover { background: var(--brand-soft); }
.combo-opt .row-title { font-size: .92rem; }
.combo-head { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 6px 10px 4px; }

/* ---------------------------------------------------------------- messenger groups */
.conv-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 12px 10px 4px; display: flex; justify-content: space-between; }

/* ---------------------------------------------------------------- attachments */
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; }
.attach-list:not(:empty) { margin-bottom: 10px; }
.att-pending { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line);
  max-width: 260px; font-size: .82rem; position: relative; overflow: hidden; }
.att-pending .tile { width: 30px; height: 30px; font-size: .9rem; border-radius: 8px; }
.att-pending .att-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--brand-600); transition: width .2s; }
.att-pending.failed { border-color: var(--danger); color: var(--danger); }
.att-pending button { border: 0; background: none; color: var(--muted); padding: 0 2px; line-height: 1; }
.att-pending button:hover { color: var(--danger); }
.att-name { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-size { display: block; font-size: .72rem; color: var(--muted); }
.chat-attach { padding: 10px 12px 0; margin: 0 !important; background: var(--surface); border-top: 1px solid var(--line); }
.attach-btn { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; margin: 0;
  color: var(--muted); font-size: 1.2rem; cursor: pointer; transition: background .15s, color .15s; }
.attach-btn:hover { background: var(--brand-soft); color: var(--brand-text); }
.about-editor { background: var(--surface, #fff); }
.about-editor.ql-container { height: auto; }   /* Quill makes the box itself the container */
.about-editor .ql-editor { min-height: 96px; max-height: 200px; }
.about-editor + .form-text, .ql-container + .form-text { margin-top: 4px; }
.attach-menu .dropdown-menu { min-width: 200px; }
.attach-menu label.dropdown-item { cursor: pointer; }
#pick-file-modal { z-index: 1065; }   /* above the compose window it can open over */
.modal-backdrop + .modal-backdrop { z-index: 1060; }
.pick-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; color: inherit; cursor: pointer; }
.pick-row:hover { background: var(--brand-soft); }
.pick-row .form-check-input { flex-shrink: 0; margin: 0; }
.pick-row.checked { background: var(--brand-soft); }
.pick-group { padding: 10px 10px 4px; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.pick-empty { padding: 24px 12px; text-align: center; color: var(--muted); }
.chat-pane.drop-over { outline: 3px dashed var(--chat); outline-offset: -10px; }

.att-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.msg.me .att-grid { justify-content: flex-end; }
.att-chip { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; max-width: 280px; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.att-chip:hover { border-color: var(--brand-600); color: var(--text); box-shadow: var(--shadow-sm); }
.att-chip .tile { width: 34px; height: 34px; font-size: 1rem; border-radius: 9px; }
.att-chip > i { color: var(--muted); margin-left: 4px; }
.att-img { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.att-img img { display: block; max-width: 240px; max-height: 200px; object-fit: cover; }
.mail-attachments { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.mail-attachments .att-img img { max-width: 200px; max-height: 160px; }

/* ---------------------------------------------------------------- notifications */
.notify-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--chat) 30%, var(--line)); box-shadow: var(--shadow-sm); }
.account-menu #notify-state.on { background: rgba(22, 163, 74, .12); color: var(--online); }

/* ---------------------------------------------------------------- rich text editor (Quill) and formatted messages */
.rich-editor { min-height: 220px; font-family: inherit; font-size: .95rem; }
.ql-toolbar.ql-snow { border: 1px solid var(--line); border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--surface-2); font-family: inherit; padding: 6px 8px; }
.ql-container.ql-snow { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius-sm) var(--radius-sm); background: var(--surface); font-family: inherit; font-size: .95rem; }
.rich-editor:focus-within, .rich-editor:focus-within + .ql-container, .ql-toolbar.ql-snow:has(+ .ql-container:focus-within) { border-color: #6b95d1; }
.ql-container.ql-snow:focus-within { border-color: #6b95d1; }
.ql-editor { min-height: 200px; max-height: 45vh; line-height: 1.6; color: var(--text); }
.ql-editor.ql-blank::before { color: var(--muted); font-style: normal; }
.ql-snow.ql-toolbar button:hover .ql-stroke, .ql-snow.ql-toolbar button.ql-active .ql-stroke, .ql-snow .ql-picker-label:hover .ql-stroke { stroke: var(--brand-600); }
.ql-snow.ql-toolbar button:hover .ql-fill, .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--brand-600); }
.ql-snow.ql-toolbar button.ql-active, .ql-snow .ql-picker-label.ql-active { color: var(--brand-600); }
.ql-snow .ql-picker-options { border-radius: 10px; box-shadow: var(--shadow) !important; background: var(--surface); }
.ql-snow .ql-tooltip { border-radius: 10px; box-shadow: var(--shadow); border-color: var(--line); background: var(--surface); color: var(--text); z-index: 5; }
.ql-snow .ql-tooltip input[type=text] { background: var(--surface); color: var(--text); border-color: var(--line); border-radius: 6px; }
[data-bs-theme="dark"] .ql-snow .ql-stroke { stroke: var(--text); }
[data-bs-theme="dark"] .ql-snow .ql-fill { fill: var(--text); }
[data-bs-theme="dark"] .ql-snow .ql-picker { color: var(--text); }
[data-bs-theme="dark"] .ql-snow .ql-picker-options { border-color: var(--line) !important; }
@media (max-width: 575.98px) { .ql-editor { max-height: none; min-height: 40vh; } }

.mail-body.rich { white-space: normal; }
.mail-body.rich p { margin: 0 0 .15rem; min-height: 1.2em; }
.mail-body.rich h1, .mail-body.rich h2, .mail-body.rich h3 { font-weight: 700; margin: 1rem 0 .4rem; letter-spacing: -.01em; }
.mail-body.rich h1 { font-size: 1.6rem; } .mail-body.rich h2 { font-size: 1.3rem; } .mail-body.rich h3 { font-size: 1.1rem; }
.mail-body.rich ul, .mail-body.rich ol { margin: .3rem 0 .6rem; padding-left: 1.6rem; }
.mail-body.rich blockquote, .ql-editor blockquote { border-left: 3px solid var(--line); margin: 0; padding: .05rem 0 .05rem 1rem; color: var(--muted); min-height: 1.2em; }
.mail-body.rich :not(blockquote) + blockquote { margin-top: .3rem; }
.mail-body.rich blockquote + :not(blockquote) { margin-top: .5rem; }
.mail-body.rich a { color: var(--brand-text); }
.mail-body .ql-align-center { text-align: center; } .mail-body .ql-align-right { text-align: right; } .mail-body .ql-align-justify { text-align: justify; }
.mail-body .ql-indent-1 { padding-left: 3em; } .mail-body .ql-indent-2 { padding-left: 6em; } .mail-body .ql-indent-3 { padding-left: 9em; }
.ql-snow .ql-editor blockquote { margin: 0; border-left: 3px solid var(--line); padding-left: 1rem; }
.ql-editor:focus, .ql-editor:focus-visible { outline: none; }

/* ---------- Files: folder list + folder contents ---------- */
.files-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 992px) {
  .files-layout { grid-template-columns: 290px minmax(0, 1fr); }
  .folder-nav { position: sticky; top: calc(var(--header-h) + 4px); max-height: calc(100dvh - var(--header-h) - 24px); overflow-y: auto; }
}
/* Phones and tablets: the folder list first, then one folder at a time (like the messenger). */
@media (max-width: 991.98px) {
  .files-layout:not(.folder-open) .files-main { display: none; }
  .files-layout.folder-open .folder-nav { display: none; }
}
.folder-nav { padding: 8px; }
.place { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; text-align: left; color: inherit;
  padding: 8px 10px; border-radius: 12px; transition: background .12s; }
.place:hover { background: var(--surface-2); }
.place.active { background: var(--brand-soft); }
.place .tile { width: 34px; height: 34px; border-radius: 10px; font-size: 1rem; }
.place-name { display: block; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-sub { display: block; font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-group { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 10px 4px; font-size: .7rem; font-weight: 650;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.place-group i { margin-right: 6px; }
.place-add { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: .85rem; }
.place-add:hover { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; }
.place-team + .place-team { margin-top: 4px; }
.place-team-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px 2px; font-size: .84rem; font-weight: 600; min-width: 0; }
.place-empty { display: flex; align-items: center; gap: 8px; width: 100%; border: 1px dashed var(--line); background: none; color: var(--muted);
  padding: 9px 12px; border-radius: 12px; font-size: .84rem; margin: 2px 0; }
.place-empty:hover { color: var(--brand-text); border-color: var(--brand-600); background: var(--brand-soft); }
.place-note { font-size: .84rem; color: var(--muted); padding: 6px 10px 10px; }
.folder-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; min-width: 0; }
.folder-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -.015em; margin: 0; }

/* ---------- Teams ---------- */
.group-title { font-size: .75rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 6px 2px 10px; }
.group-title:not(:first-child) { margin-top: 26px; }
.teams-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 768px) { .teams-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .teams-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.team-card { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 18px; text-align: left; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; }
.team-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--team) 35%, var(--line)); }
.team-card h3 { font-size: 1.02rem; font-weight: 650; margin: 0 0 2px; }
.avatar-stack { display: flex; padding-left: 6px; }
.avatar-stack .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-more { background: var(--surface-2); color: var(--muted); font-weight: 600; }
.team-sec { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; }
.team-sec:not(:first-child) { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.team-sec h6 { margin: 0; font-weight: 650; }
.team-note { display: flex; gap: 10px; align-items: center; font-size: .88rem; color: var(--muted); background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 12px; min-width: 0; }
.team-add { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; background: var(--surface-2); }
.picker-list { max-height: 300px; overflow-y: auto; margin-top: 8px; }
.people-picker .picker-list { border: 1px solid var(--line); border-radius: 12px; padding: 4px; background: var(--surface); }
.team-add .picker-list { background: var(--surface); border-radius: 10px; padding: 4px; }
.picker-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; margin: 0; min-width: 0; }
.picker-item:hover { background: var(--surface-2); }
.picker-item .form-check-input { flex-shrink: 0; margin: 0; width: 1.15em; height: 1.15em; }

/* ---------- Profile: work profile block ---------- */
.profile-sec { font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin: 4px 0 12px; }
.profile-sec span { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 4px; }

/* ---------- Projects: shared bits ---------- */
.pj-loading { display: flex; justify-content: center; padding: 48px 0; }
.pj-loading.small { padding: 16px 0; }
.st { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 600; padding: 2px 9px 2px 7px; border-radius: 999px; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 13%, transparent); color: color-mix(in srgb, var(--c) 78%, var(--text)); }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.st-todo, .sb-todo { --c: var(--st-todo); } .st-in_progress, .sb-in_progress { --c: var(--st-progress); }
.st-review, .sb-review { --c: var(--st-review); } .st-done, .sb-done { --c: var(--st-done); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex-shrink: 0; }
.prio { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 600; white-space: nowrap; color: var(--muted); }
.prio i { font-size: .7rem; }
.prio-low i { color: #94a3b8; } .prio-medium i { color: var(--mail); } .prio-high i { color: var(--polls); } .prio-urgent { color: var(--danger); } .prio-urgent i { color: var(--danger); }
.lbl { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 500; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.lbl-btn { cursor: pointer; } .lbl-btn:hover { color: var(--brand-text); border-color: var(--brand-600); }
.pbar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.pbar span { display: block; height: 100%; border-radius: 3px; background: var(--st-done); transition: width .4s; }
.pst { font-size: .72rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pst-active { background: color-mix(in srgb, var(--st-progress) 13%, transparent); color: var(--st-progress); }
.pst-on_hold { background: color-mix(in srgb, var(--polls) 14%, transparent); color: var(--polls); }
.pst-completed { background: color-mix(in srgb, var(--st-done) 14%, transparent); color: var(--st-done); }
.link-btn { border: 0; background: none; padding: 0; color: var(--brand-text); text-align: left; }
.link-btn:hover { text-decoration: underline; }
.group-title:first-child { margin-top: 0; }

/* ---------- Projects home ---------- */
.pj-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 768px) { .pj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .pj-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pj-card { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 18px; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.pj-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.pj-card h3 { font-size: 1.05rem; font-weight: 650; margin: 0 0 2px; }
.pj-desc { margin: 0; font-size: .86rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pj-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--muted); }
.pj-facts i { margin-right: 5px; }

/* ---------- Workload ---------- */
.wl-week { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.wl-list { padding: 6px; }
.wl-row { border-radius: 12px; }
.wl-row + .wl-row { border-top: 1px solid var(--line); }
.wl-row summary { display: flex; align-items: center; gap: 12px; padding: 10px; cursor: pointer; list-style: none; border-radius: 12px; }
.wl-row summary::-webkit-details-marker { display: none; }
.wl-row summary:hover { background: var(--surface-2); }
.wl-who { width: 220px; flex-shrink: 0; }
.wl-meter { flex: 1; min-width: 0; }
.wl-track { position: relative; height: 10px; border-radius: 5px; background: var(--surface-2); }
.wl-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.wl-cap { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); opacity: .55; border-radius: 1px; }
.wl-nums { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .8rem; margin-top: 5px; }
.wl-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 600; }
.wl-ok { --c: var(--st-done); } .wl-full { --c: var(--polls); } .wl-over { --c: var(--danger); } .wl-none { --c: var(--muted); }
.wl-fill.wl-ok, .wl-fill.wl-full, .wl-fill.wl-over { background: var(--c); }
.wl-tag { color: var(--c); }
.wl-side { width: 190px; flex-shrink: 0; text-align: right; }
.wl-chev { color: var(--muted); transition: transform .15s; }
.wl-row[open] .wl-chev { transform: rotate(180deg); }
.wl-detail { padding: 0 8px 8px 54px; }
@media (max-width: 767.98px) { .wl-who { width: 120px; } .wl-detail { padding-left: 8px; } }

/* ---------- Project page header and tabs ---------- */
.pj-back { display: inline-flex; align-items: center; gap: 4px; font-size: .84rem; text-decoration: none; color: var(--muted); margin-bottom: 6px; }
.pj-back:hover { color: var(--brand-text); }
.pj-title-row { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.pj-title { font-size: 1.35rem; font-weight: 750; letter-spacing: -.02em; margin: 0; }
.pj-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; font-size: .82rem; color: var(--muted); margin-top: 6px; }
.pj-meta i { margin-right: 5px; }
.pj-tabs { display: flex; gap: 2px; overflow-x: auto; margin: 16px 0 18px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.pj-tabs::-webkit-scrollbar { display: none; }
.pj-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .9rem;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.pj-tabs a:hover { color: var(--text); }
.pj-tabs a.active { color: var(--brand-text); border-bottom-color: var(--brand-600); }
.pj-filters .form-select { width: auto; max-width: 190px; }
@media (max-width: 767.98px) { .pj-filters .form-select { flex: 1 1 45%; max-width: none; } }

/* ---------- Overview ---------- */
.pj-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 992px) { .pj-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .pj-stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); } }
.pj-stats .stat:hover { transform: none; box-shadow: none; }
.stat-sub { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.stack-bar { display: flex; gap: 2px; height: 16px; border-radius: 5px; overflow: hidden; margin: 6px 0 12px; }
.stack-bar span { background: var(--c); min-width: 4px; }
.stack-bar span:first-child { border-radius: 4px 0 0 4px; } .stack-bar span:last-child { border-radius: 0 4px 4px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .82rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.vbars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 18px; overflow-x: auto; }
.vbar { flex: 1 0 44px; max-width: 90px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.vcol { width: 60%; max-width: 40px; background: var(--projects); border-radius: 4px 4px 0 0; }
.vcol.active { background: repeating-linear-gradient(135deg, var(--projects) 0 5px, color-mix(in srgb, var(--projects) 55%, var(--surface)) 5px 9px); }
.vval { font-size: .74rem; font-weight: 600; }
.vname { font-size: .72rem; color: var(--muted); max-width: 100%; }
.ms-diamond { width: 12px; height: 12px; transform: rotate(45deg); border-radius: 2px; background: var(--c); flex-shrink: 0; display: inline-block; margin: 0 4px; }
.ms-diamond.lg { width: 18px; height: 18px; margin: 6px; }
.ms-achieved { --c: var(--st-done); } .ms-risk { --c: var(--polls); } .ms-track { --c: var(--st-progress); }
.mst { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.mst-achieved { --c: var(--st-done); } .mst-risk { --c: #b45309; } .mst-track { --c: var(--st-progress); }
[data-bs-theme="dark"] .mst-risk { --c: var(--polls); }
.print-only { display: none; }

/* ---------- Board ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
@media (max-width: 991.98px) { .board { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; } .bcol { scroll-snap-align: start; } }
.bcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 240px; transition: background .12s, border-color .12s; }
.bcol.over { background: var(--brand-soft); border-color: var(--brand-600); }
.bcol-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; font-size: .9rem; }
.bcount { font-size: .72rem; font-weight: 700; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.bquick { margin-bottom: 8px; }
.bcards { display: flex; flex-direction: column; gap: 8px; }
.bempty { border: 1px dashed var(--line); border-radius: 12px; text-align: center; padding: 18px 8px; font-size: .8rem; color: var(--muted); }
.tcard { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: grab; box-shadow: var(--shadow-sm); transition: box-shadow .12s, transform .12s; }
.tcard:hover { box-shadow: var(--shadow); }
.tcard.crit { border-left-color: var(--danger); }
.tcard.dragging { opacity: .5; transform: rotate(1.5deg); }
.tc-epic { font-size: .72rem; color: var(--projects); font-weight: 600; margin-bottom: 3px; }
.tc-epic i { margin-right: 4px; }
.tc-title { font-weight: 550; font-size: .9rem; line-height: 1.35; overflow-wrap: anywhere; }
.tc-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tc-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; font-size: .74rem; color: var(--muted); }
.tc-foot i { margin-right: 3px; }
.tc-due.late, .tc-h.over { color: var(--danger); font-weight: 600; }

/* ---------- List (tree) ---------- */
.tree { padding: 4px 6px 8px; overflow-x: auto; }
.tree-head, .tree-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px; min-width: 760px; }
.tree-head { font-size: .7rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line); }
.tree-row { border-radius: 10px; cursor: pointer; padding-left: calc(8px + var(--lvl) * 22px); }
.tree-row:hover { background: var(--surface-2); }
.tree-row.k-epic { font-weight: 650; background: color-mix(in srgb, var(--projects) 5%, transparent); margin-top: 4px; }
.tree-row.is-done .tree-title { color: var(--muted); text-decoration: line-through; }
.tree-head .grow, .tree-row .grow { flex: 1; }
.c-st { width: 120px; flex-shrink: 0; } .c-pr { width: 78px; flex-shrink: 0; } .c-as { width: 110px; flex-shrink: 0; display: flex; align-items: center; gap: 6px; font-size: .82rem; }
.c-dt { width: 66px; flex-shrink: 0; font-size: .8rem; } .c-h { width: 92px; flex-shrink: 0; font-size: .8rem; text-align: right; }
.tree-toggle { width: 20px; height: 20px; border: 0; background: none; color: var(--muted); padding: 0; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; }
button.tree-toggle:hover { background: var(--line); color: var(--text); }
.k-icon { color: var(--muted); } .k-epic .k-icon { color: var(--projects); }
.tree-add { opacity: 0; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 7px; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: .8rem; }
.tree-row:hover .tree-add, .tree-add:focus { opacity: 1; }
.tree-add:hover { color: var(--brand-text); border-color: var(--brand-600); }
.tree-pct { display: flex; align-items: center; gap: 6px; width: 100%; font-weight: 500; }
.tree-pct .pbar { flex: 1; }

/* ---------- Timeline (Gantt) ---------- */
.gt-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--muted); margin-bottom: 10px; }
.gt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-crit { width: 18px; height: 10px; border-radius: 3px; border: 2px solid var(--danger); }
.lg-base { width: 18px; height: 4px; border-radius: 2px; background: var(--muted); opacity: .5; }
.lg-today { width: 2px; height: 12px; background: var(--danger); }
/*rtl:begin:ignore*/ /* the chart is drawn left to right in both languages (rtl.css sets its direction) */
.gt { overflow: auto; max-height: calc(100dvh - var(--header-h) - 230px - var(--bottom-h)); min-height: 300px; position: relative; }
.gt-inner { position: relative; }
.gt-header { display: flex; position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.gt-corner { width: 250px; flex-shrink: 0; position: sticky; left: 0; z-index: 5; background: var(--surface); padding: 10px 14px; font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-right: 1px solid var(--line); display: flex; align-items: flex-end; }
.gt-scale { position: relative; height: 52px; flex-shrink: 0; }
.gt-months { position: relative; height: 24px; }
.gt-month { position: absolute; top: 0; height: 24px; border-left: 1px solid var(--line); font-size: .74rem; font-weight: 600; overflow: hidden; }
.gt-month span { position: sticky; left: 258px; padding: 4px 6px; white-space: nowrap; display: inline-block; }
.gt-ticks { position: relative; height: 28px; }
.gt-tick { position: absolute; top: 0; height: 28px; border-left: 1px solid color-mix(in srgb, var(--line) 60%, transparent); font-size: .68rem; text-align: center; color: var(--muted); line-height: 1.05; padding-top: 2px; }
.gt-tick small { display: block; font-size: .58rem; opacity: .8; }
.gt-tick.wk { color: color-mix(in srgb, var(--muted) 60%, transparent); }
.gt-tick.today { color: #fff; background: var(--danger); border-radius: 6px; font-weight: 700; }
.gt-body { display: flex; position: relative; }
.gt-side { width: 250px; flex-shrink: 0; position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: 1px solid var(--line); }
.gt-side-row { display: flex; align-items: center; gap: 6px; padding: 0 10px 0 calc(8px + var(--lvl, 0) * 16px); font-size: .82rem; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); cursor: pointer; }
.gt-side-row:hover { background: var(--surface-2); }
.gt-side-row.k-epic { font-weight: 650; }
.gt-ms-row { font-weight: 600; color: var(--muted); font-size: .76rem; cursor: default; background: var(--surface-2); }
.gt-side-row .avatar-sm { width: 24px; height: 24px; font-size: .6rem; }
.gt-canvas { position: relative; flex-shrink: 0; }
.gt-weekend { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--surface-2) 75%, transparent); }
.gt-ms { position: absolute; left: 0; right: 0; top: 0; background: color-mix(in srgb, var(--surface-2) 70%, transparent); border-bottom: 1px solid var(--line); }
.gt-diamond { position: absolute; top: 11px; width: 12px; height: 12px; margin-left: -6px; transform: rotate(45deg); border-radius: 2px; background: var(--c); box-shadow: 0 0 0 2px var(--surface); z-index: 2; }
.gt-diamond.ghost { background: transparent; border: 2px dashed var(--muted); box-shadow: none; opacity: .7; }
.gt-ms-label { position: absolute; top: 8px; font-size: .72rem; font-weight: 600; white-space: nowrap; color: var(--text); }
.gt-row { position: absolute; left: 0; right: 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.gt-bar { position: absolute; top: 8px; height: 20px; border-radius: 6px; background: var(--c); color: #fff; font-size: .72rem; font-weight: 600; line-height: 20px; padding: 0 8px; white-space: nowrap; overflow: hidden; cursor: pointer; box-shadow: 0 0 0 2px var(--surface); z-index: 1; }
.gt-bar.sb-todo { color: #fff; }
.gt-bar[data-drag] { cursor: grab; touch-action: none; }
.gt-bar[data-drag]:active { cursor: grabbing; }
.gt-bar.crit { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--danger); }
.gt-bar.saving { opacity: .6; }
.gt-label { pointer-events: none; overflow: hidden; text-overflow: ellipsis; display: block; padding-right: 6px; }
.gt-handle { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; background: rgba(255, 255, 255, .25); }
.gt-outlabel { position: absolute; top: 9px; font-size: .74rem; color: var(--muted); white-space: nowrap; pointer-events: none; }
.gt-epic { position: absolute; top: 13px; height: 10px; background: var(--text); opacity: .75; border-radius: 2px; cursor: pointer; }
.gt-epic::before, .gt-epic::after { content: ""; position: absolute; bottom: -5px; border: 5px solid transparent; border-top-color: var(--text); }
.gt-epic::before { left: 0; border-left-color: var(--text); } .gt-epic::after { right: 0; border-right-color: var(--text); }
.gt-base { position: absolute; top: 30px; height: 4px; border-radius: 2px; background: var(--muted); opacity: .45; }
.gt-nodates { position: absolute; top: 9px; font-size: .74rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 6px; padding: 1px 8px; cursor: pointer; white-space: nowrap; }
.gt-svg { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; z-index: 2; }
.gt-dep { fill: none; stroke: var(--muted); stroke-width: 1.5; opacity: .8; }
.gt-dep.crit { stroke: var(--danger); stroke-width: 2; opacity: 1; }
.gt-arrowhead { fill: var(--muted); } .gt-arrowhead.crit { fill: var(--danger); }
.gt-today { stroke: var(--danger); stroke-width: 2; }
.gt-msline { stroke: var(--c); stroke-width: 1; stroke-dasharray: 4 4; opacity: .6; }
@media (max-width: 767.98px) { .gt-corner, .gt-side { width: 150px; } .gt-month span { left: 158px; } }
/*rtl:end:ignore*/

/* ---------- Sprints and milestones ---------- */
.sprint-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1200px) { .sprint-layout { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } .backlog { position: sticky; top: calc(var(--header-h) + 8px); } }
.sprint-card { margin-bottom: 14px; }
.sprint-card.sp-active { border-color: color-mix(in srgb, var(--projects) 45%, var(--line)); box-shadow: 0 0 0 3px var(--projects-soft); }
.sprint-card.sp-closed { opacity: .85; }
.spst { font-size: .68rem; font-weight: 650; padding: 1px 8px; border-radius: 999px; vertical-align: middle; margin-left: 4px; background: var(--surface-2); color: var(--muted); }
.spst-active { background: var(--projects-soft); color: var(--projects); }
.mini-task { cursor: pointer; }
.mini-task .sw { border-radius: 50%; }
.backlog .panel-list { max-height: 70vh; overflow-y: auto; }
.ms-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 992px) { .ms-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ms-card { padding: 18px; }
.ms-card h3 { font-size: 1.02rem; font-weight: 650; margin: 0 0 2px; }
.ms-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0 10px; font-size: .84rem; }
@media (max-width: 575.98px) { .ms-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ms-facts small, .ms-deliv small { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.ms-deliv { margin-top: 12px; font-size: .86rem; }
.ms-deliv ul { margin: 4px 0 0; padding-left: 18px; }
.ms-tasks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ms-tasks .sw { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- People ---------- */
.people-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1200px) { .people-layout { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }

/* ---------- Task window ---------- */
.task-modal-head { align-items: flex-start; gap: 12px; }
.tk-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.tk-crumbs .bi-chevron-right { font-size: .65rem; }
.tk-crumb { border: 0; background: none; padding: 0; color: var(--brand-text); font-size: .78rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-crumb:hover { text-decoration: underline; }
.kind-badge { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; font-size: .72rem; padding: 2px 8px; border-radius: 6px; background: var(--projects-soft); color: var(--projects); }
.tk-title { width: 100%; border: 1px solid transparent; background: transparent; color: var(--text); font-size: 1.3rem; font-weight: 700; letter-spacing: -.015em; border-radius: 8px; padding: 2px 6px; margin-left: -6px; }
.tk-title:hover { border-color: var(--line); }
.tk-title:focus { outline: none; border-color: #6b95d1; box-shadow: 0 0 0 4px rgba(10, 78, 166, .14); background: var(--surface); }
.task-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
@media (min-width: 992px) { .task-grid { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (max-width: 991.98px) { .task-side { order: -1; } }
.task-side { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; align-self: start; }
.tk-field { margin-bottom: 12px; }
.tk-field > label, .tk-label { display: block; font-size: .74rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.tk-actual { font-weight: 650; font-size: .95rem; padding: 4px 0; }
.tk-actual small { display: block; font-size: .72rem; color: var(--muted); font-weight: 500; }
.tk-actual.over, .tk-actual.over small { color: var(--danger); }
.tk-meta { font-size: .75rem; color: var(--muted); display: grid; gap: 3px; margin: 6px 0 4px; }
.tk-blocked { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: .88rem;
  background: color-mix(in srgb, var(--polls) 12%, transparent); border: 1px solid color-mix(in srgb, var(--polls) 35%, transparent); }
.tk-blocked > i { color: var(--polls); font-size: 1.1rem; }
.tk-desc { min-height: 96px; }
.tk-sec { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 8px; }
.tk-sec h6 { margin: 0; font-weight: 650; }
.tk-kid { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.tk-kid:hover { background: var(--surface-2); }
.tk-kid .form-check-input { margin: 0; flex-shrink: 0; }
.tk-kid-add { margin-top: 4px; }
.dep-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; padding: 3px 4px 3px 10px; border-radius: 999px; border: 1px solid var(--line); margin: 0 6px 6px 0; background: var(--surface); }
.dep-chip > i { color: var(--polls); } .dep-chip.ok > i { color: var(--st-done); }
.dep-x { border: 0; background: none; color: var(--muted); border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.dep-x:hover { background: var(--danger-soft); color: var(--danger); }
.tk-feed { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 18px; }
.tk-comment { display: flex; gap: 10px; margin-bottom: 14px; }
.tk-comment-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; margin-top: 2px; }
.tk-composer, .tk-timelog { margin-top: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.tk-composer .attach-list:not(:empty) { margin-top: 8px; }
.tk-activity { display: grid; gap: 8px; font-size: .85rem; }
.tk-activity .dot { background: var(--projects); margin-right: 8px; vertical-align: middle; }
.tk-logs { display: grid; gap: 2px; margin-bottom: 6px; }
.tk-log { display: flex; align-items: center; gap: 12px; font-size: .86rem; padding: 6px 8px; border-radius: 10px; }
.tk-log:hover { background: var(--surface-2); }

/* ---------- Printing a project status report ---------- */
@media print {
  .sidebar, .app-header, .bottom-nav, .pj-tabs, .pj-back, .pj-title-row .btn, .pj-report-actions, .toasts, .wl-chev { display: none !important; }
  .main { padding: 0 !important; } .content { padding: 0 !important; max-width: none; }
  .print-only { display: block; }
  .panel, .stat { box-shadow: none !important; break-inside: avoid; }
  .dash-grid { grid-template-columns: 1fr 1fr; }
  body { background: #fff; }
}
.epic-progress { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.epic-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; border: 0; background: none; text-align: left; color: inherit; padding: 6px 4px; border-radius: 8px; font-size: .86rem; }
.epic-row:hover { background: var(--surface-2); }
@media (min-width: 992px) { .dash-wide { grid-column: 1 / -1; } }

/* ==========================================================================
   Design refresh: clearer edges and depth. Cards keep a visible 1px edge plus a soft shadow;
   anything you can click gets a stronger edge and a lift on hover; inputs use the stronger edge.
   ========================================================================== */
.form-control, .form-select { border-color: var(--line-strong); }
.form-control:hover:not(:focus), .form-select:hover:not(:focus) { border-color: color-mix(in srgb, var(--line-strong) 70%, var(--muted)); }
.icon-btn, .place-add, .tree-add { border-color: var(--line-strong); }
.segmented { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-light-soft { --bs-btn-border-color: var(--line-strong); --bs-btn-hover-border-color: var(--line-strong); }

/* Clickable cards: edge darkens and the card lifts */
.stat, .pj-card, .team-card, .tcard { border-color: var(--line); box-shadow: var(--shadow-sm); }
a.stat:hover, .pj-card:hover, .team-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.ms-card, .sprint-card { box-shadow: var(--shadow-sm); }

/* Section headers inside panels get a divider so lists read as separate blocks */
.dash-grid .panel-head, .sprint-card .panel-head, .backlog .panel-head { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 4px; }

/* Board: tinted lanes with a status-coloured top, white cards with a clear edge */
.bcol { background: color-mix(in srgb, var(--surface-2) 60%, var(--page)); border: 1px solid var(--line); border-top: 3px solid var(--c, var(--line-strong)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
[data-bs-theme="dark"] .bcol { background: color-mix(in srgb, var(--surface) 55%, var(--page)); box-shadow: none; }
.bcol.over { background: var(--brand-soft); border-color: var(--brand-600); border-top-color: var(--c, var(--brand-600)); }
.bcol-head { border-bottom: 1px solid var(--line); margin: -2px -2px 10px; padding: 2px 6px 10px; }
.bcount { border-color: var(--line-strong); }
.tcard { border: 1px solid var(--line); border-left: 3px solid var(--line-strong); transition: border-color .12s, box-shadow .12s, transform .12s; }
.tcard:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.tcard:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.tcard.p-urgent { border-left-color: var(--danger); } .tcard.p-high { border-left-color: var(--polls); }
.tcard.p-medium { border-left-color: var(--mail); } .tcard.p-low { border-left-color: var(--st-todo); }
.bempty { border-color: var(--line-strong); background: color-mix(in srgb, var(--surface) 50%, transparent); }
.bquick .form-control { background: var(--surface); }

/* Lists and rows */
.tree { border-color: var(--line); }
.tree-row + .tree-row { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--line) 60%, transparent); }
.tree-row.k-epic { box-shadow: none; }
.file-row + .file-row, .member-row + .member-row { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--line) 60%, transparent); border-radius: 0; }
.file-row:hover, .member-row:hover { border-radius: 12px; }
.place.active { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-600) 30%, transparent); }
.wl-list { box-shadow: var(--shadow-sm); }

/* Timeline frame */
.gt { border-color: var(--line-strong); }
.gt-side, .gt-corner { border-right-color: var(--line-strong); }

/* Task window: side panel and composer read as their own surfaces */
.task-side, .tk-composer, .tk-timelog, .team-add { border-color: var(--line-strong); }
.modal-content { border: 1px solid var(--line); }
[data-bs-theme="dark"] .modal-content { border-color: var(--line-strong); }

/* ---------- Solid 2px edges on cards, panels and board lanes (user request 2026-10-21) ---------- */
.panel, .stat, .tcard, .bcol, .task-side, .tk-composer, .tk-timelog, .team-add, .modal-content, .wl-list, .people-picker .picker-list { border-width: 2px; border-style: solid; }
.panel, .stat, .tcard, .bcol { border-color: var(--line-strong); }
.tcard { border-left-width: 4px; }
.bcol { border-top-width: 4px; }
.gt { border-width: 2px; }

/* ---------- Profile photos ---------- */
.avatar.has-photo { background: var(--surface-2); padding: 0; overflow: visible; }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar-xl { width: 76px; height: 76px; font-size: 1.5rem; }
.profile-photo-row { display: flex; align-items: center; gap: 16px; }
.pj-people-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; border-radius: 999px; padding: 2px 6px 2px 0; }
.pj-people-link i { margin-right: -3px; }
.pj-people-link:hover { color: var(--brand-text); }
.pj-meta .btn-sm { padding: 2px 10px; font-size: .8rem; }
.pj-facts-grid { margin: 8px 0 0; }
.people-only, .settings-col { max-width: 900px; }
/* Task cost */
.tk-cost { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: .84rem; }
.tk-cost > div { display: flex; justify-content: space-between; padding: 3px 0; }
.tk-cost span { color: var(--muted); }
.tk-cost-total { border-top: 1px solid var(--line); margin-top: 3px; padding-top: 5px !important; }
.tk-cost-total b { font-size: .95rem; }
.tk-expense-row { padding: 2px 0 6px; }
.tk-expense-row .att-grid { margin: 0 8px 4px; }
.c-cost { width: 90px; flex-shrink: 0; font-size: .8rem; text-align: right; }
.tree-head, .tree-row { min-width: 860px; }
.ss-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: .9rem; }
.ss-preview small { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--muted); }
.storage-note { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 12px; flex-wrap: wrap; }
.storage-note .empty-icon { margin: 0; flex-shrink: 0; }
.sr-status { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: .9rem; }
.sr-fp { font-family: var(--bs-font-monospace); font-size: .78rem; word-break: break-all; }
.tk-cost-note { font-size: .72rem; color: var(--muted); margin-top: -3px; padding-top: 0 !important; }

/* ---------- Sign-in screen animation (login-art.js) ---------- */
.login-art { isolation: isolate; }
.la-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.la-orbit { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.login-art-inner { z-index: 4; }
.la-hub, .la-core { position: absolute; left: 0; top: 0; will-change: transform; }
.la-hub { width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .06)); border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .25);
  color: #fff; font-size: 1.35rem; transition: box-shadow .25s, border-color .25s; }
.la-hub small { position: absolute; top: 64px; font-size: .68rem; font-weight: 600; letter-spacing: .04em; color: rgba(255, 255, 255, .75); white-space: nowrap; }
.la-hub.ping { border-color: rgba(255, 221, 0, .9); box-shadow: 0 0 0 6px rgba(255, 221, 0, .15), 0 0 28px rgba(255, 221, 0, .55); }
.la-hub.ping i { color: var(--accent); }
.la-core { width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 2;
  background: radial-gradient(circle at 35% 30%, #fff6b0, #ffdd00 45%, #e0a800); color: #0b2c5f; font-size: 2.1rem;
  box-shadow: 0 0 0 10px rgba(255, 221, 0, .12), 0 0 60px rgba(255, 221, 0, .45), inset 0 -6px 14px rgba(0, 0, 0, .18); }
.la-core span { position: absolute; inset: -10px; border-radius: 50%; border: 2px solid rgba(255, 221, 0, .55); animation: la-pulse 3.2s ease-out infinite; }
.la-core span + span { animation-delay: 1.6s; }
@keyframes la-pulse { from { transform: scale(.85); opacity: .9; } to { transform: scale(2.3); opacity: 0; } }
/* headline word that rolls */
.la-word-wrap { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; }
.la-word { display: inline-block; color: var(--accent); transition: transform .35s cubic-bezier(.5, 0, .2, 1), opacity .35s; }
.la-word.out { transform: translateY(-105%); opacity: 0; }
.la-word.in { animation: la-in .4s cubic-bezier(.2, .8, .2, 1); }
@keyframes la-in { from { transform: translateY(105%); opacity: 0; } to { transform: none; opacity: 1; } }
/* the text arrives in steps */
.login-art-inner > * { animation: la-rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.login-art-inner > h2 { animation-delay: .12s; }
.login-points li { animation: la-rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.login-points li:nth-child(1) { animation-delay: .3s; } .login-points li:nth-child(2) { animation-delay: .38s; } .login-points li:nth-child(3) { animation-delay: .46s; }
.login-points li:nth-child(4) { animation-delay: .54s; } .login-points li:nth-child(5) { animation-delay: .62s; }
@keyframes la-rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.login-art-inner { text-shadow: 0 2px 18px rgba(0, 20, 60, .45); }
@media (prefers-reduced-motion: reduce) {
  .la-core span, .login-art-inner > *, .login-points li { animation: none; }
}
.login-art { align-items: flex-start !important; }
.login-art-inner { padding: 56px 64px 0; }
.login-art h2 { margin: 36px 0 12px; }
.la-sub { color: rgba(255, 255, 255, .8); font-size: 1.05rem; max-width: 440px; margin: 0; animation: la-rise .7s .22s cubic-bezier(.2, .8, .2, 1) both; }

/* ---------- Logo intro: a different animation each time the dashboard opens (playLogoFx in app.js) ---------- */
.sidebar-logo .logo-plate, #header-logo { position: relative; overflow: hidden; transform-origin: center; }
.sidebar-logo { perspective: 600px; }
.logo-plate img, #header-logo img { transform-origin: center; }
.logo-plate::after, #header-logo::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; }

/* 1 shine: a glare sweeps across */
.fx-shine::after { opacity: 1; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .95) 50%, rgba(255, 221, 0, .45) 55%, transparent 65%); animation: fx-shine 1.1s .1s ease-in-out both; }
@keyframes fx-shine { from { transform: translateX(-120%); } to { transform: translateX(120%); } }
/* 2 drop: falls in and bounces */
.fx-drop img { animation: fx-drop 1.1s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes fx-drop { 0% { transform: translateY(-160%); opacity: 0; } 55% { transform: translateY(8%); opacity: 1; } 75% { transform: translateY(-4%); } 100% { transform: none; } }
/* 3 flip: turns over in 3D */
.fx-flip { animation: fx-flip 1s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes fx-flip { from { transform: rotateY(-100deg); opacity: 0; } 60% { opacity: 1; } to { transform: none; } }
/* 4 focus: comes into focus */
.fx-focus img { animation: fx-focus 1.2s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes fx-focus { from { filter: blur(12px); transform: scale(1.5); opacity: 0; } to { filter: none; transform: none; opacity: 1; } }
/* 5 wipe: revealed left to right behind a yellow edge */
.fx-wipe img { animation: fx-wipe 1s cubic-bezier(.6, 0, .2, 1) both; }
.fx-wipe::after { opacity: 1; width: 6px; inset: 0 auto 0 0; background: #ffdd00; box-shadow: 0 0 14px #ffdd00; animation: fx-wipe-bar 1s cubic-bezier(.6, 0, .2, 1) both; }
@keyframes fx-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes fx-wipe-bar { from { left: 0; opacity: 1; } 90% { opacity: 1; } to { left: 100%; opacity: 0; } }
/* 6 spin: spins in from small */
.fx-spin { animation: fx-spin 1.1s cubic-bezier(.2, .9, .3, 1.15) both; }
@keyframes fx-spin { from { transform: rotate(-200deg) scale(.15); opacity: 0; } to { transform: none; opacity: 1; } }
/* 7 glitch: digital jitter with colour split */
.fx-glitch img { animation: fx-glitch .9s steps(1) both; }
@keyframes fx-glitch {
  0% { opacity: 0; } 10% { opacity: 1; transform: translate(-6px, 2px); filter: drop-shadow(4px 0 0 #ff2d55) drop-shadow(-4px 0 0 #00e5ff); clip-path: inset(10% 0 55% 0); }
  20% { transform: translate(5px, -2px); clip-path: inset(50% 0 10% 0); } 30% { transform: translate(-3px, 0); clip-path: inset(0 0 70% 0); filter: drop-shadow(-3px 0 0 #ff2d55) drop-shadow(3px 0 0 #00e5ff); }
  40% { transform: translate(4px, 1px); clip-path: inset(30% 0 30% 0); } 55% { transform: translate(-2px, 0); clip-path: none; filter: drop-shadow(2px 0 0 #ff2d55) drop-shadow(-2px 0 0 #00e5ff); }
  70% { transform: translate(1px, 0); filter: none; } 100% { transform: none; filter: none; clip-path: none; opacity: 1; } }
/* 8 swing: hangs from the top and swings to rest */
.fx-swing { transform-origin: top center !important; animation: fx-swing 1.4s ease-out both; }
@keyframes fx-swing { 0% { transform: rotate(28deg); } 25% { transform: rotate(-18deg); } 45% { transform: rotate(10deg); } 65% { transform: rotate(-5deg); } 82% { transform: rotate(2deg); } 100% { transform: none; } }
/* 9 rubber: stretches like a rubber band */
.fx-rubber { animation: fx-rubber 1s both; }
@keyframes fx-rubber { 0% { transform: scale3d(1, 1, 1); } 30% { transform: scale3d(1.25, .75, 1); } 40% { transform: scale3d(.75, 1.25, 1); } 50% { transform: scale3d(1.15, .85, 1); } 65% { transform: scale3d(.95, 1.05, 1); } 75% { transform: scale3d(1.05, .95, 1); } 100% { transform: none; } }
/* 10 pulse: heartbeat with a yellow ring */
.fx-pulse { animation: fx-pulse 1.4s ease-out both; }
@keyframes fx-pulse { 0% { transform: scale(.9); box-shadow: 0 0 0 0 rgba(255, 221, 0, .8); } 20% { transform: scale(1.08); } 35% { transform: scale(.97); } 50% { transform: scale(1.05); } 100% { transform: none; box-shadow: 0 0 0 22px rgba(255, 221, 0, 0); } }
/* 11 rise: stands up from lying flat */
.fx-rise { transform-origin: bottom center !important; animation: fx-rise 1.1s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes fx-rise { from { transform: rotateX(85deg) translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
/* 12 stamp: pressed down like a rubber stamp */
.fx-stamp { animation: fx-stamp .8s cubic-bezier(.3, 0, .2, 1) both; }
@keyframes fx-stamp { 0% { transform: scale(2.4) rotate(-8deg); opacity: 0; } 55% { transform: scale(.9) rotate(2deg); opacity: 1; } 75% { transform: scale(1.04) rotate(-1deg); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { [class*="fx-"], [class*="fx-"] img, [class*="fx-"]::after { animation: none !important; } }

/* ---------- Help desk ---------- */
.hst { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 600; padding: 2px 9px 2px 7px; border-radius: 999px; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 13%, transparent); color: color-mix(in srgb, var(--c) 80%, var(--text)); }
.hst::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.hst-new { --c: var(--hd); } .hst-open { --c: var(--st-progress); } .hst-in_progress { --c: var(--projects); }
.hst-waiting { --c: var(--polls); } .hst-resolved { --c: var(--st-done); } .hst-closed { --c: var(--st-todo); }
.sla { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 600; white-space: nowrap; color: var(--muted); }
.sla-ok { color: var(--muted); } .sla-soon { color: #b45309; } .sla-breach { color: var(--danger); } .sla-met { color: var(--st-done); } .sla-missed { color: var(--danger); } .sla-paused { color: var(--polls); }
[data-bs-theme="dark"] .sla-soon { color: var(--polls); }
.hd-views { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.hd-views button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font-weight: 500; font-size: .86rem; padding: .35rem .85rem; border-radius: 999px; white-space: nowrap; }
.hd-views button:hover { color: var(--text); }
.hd-views button.active { background: var(--hd); border-color: var(--hd); color: #fff; }
.hd-table { padding: 4px 6px 8px; overflow-x: auto; }
.hd-head, .hd-trow { display: flex; align-items: center; gap: 12px; padding: 10px; min-width: 900px; }
.hd-head { font-size: .7rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line); }
.hd-trow { color: inherit; text-decoration: none; border-radius: 10px; }
.hd-trow + .hd-trow { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--line) 60%, transparent); }
.hd-trow:hover { background: var(--surface-2); color: inherit; }
.hd-trow.is-new .row-title { font-weight: 700; }
.hd-head .grow, .hd-trow .grow { flex: 1; }
.c-num { width: 70px; flex-shrink: 0; font-weight: 650; font-size: .8rem; color: var(--hd); font-variant-numeric: tabular-nums; }
.c-cat { width: 120px; flex-shrink: 0; font-size: .82rem; } .c-pri { width: 80px; flex-shrink: 0; } .c-stat { width: 150px; flex-shrink: 0; }
.c-own { width: 120px; flex-shrink: 0; display: flex; align-items: center; gap: 6px; font-size: .82rem; } .c-sla { width: 190px; flex-shrink: 0; }
.hd-num { font-weight: 700; color: var(--hd); background: var(--hd-soft); border-radius: 8px; padding: 2px 9px; font-size: .85rem; }
.hd-grid { margin-top: 4px; }
.hd-thread { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.hd-msg { display: flex; gap: 12px; }
.hd-meta { font-size: .82rem; margin-bottom: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.hd-bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 10px 14px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.hd-first .hd-bubble { border-color: var(--line-strong); }
.hd-msg.is-agent .hd-bubble { background: color-mix(in srgb, var(--hd) 7%, var(--surface)); border-color: color-mix(in srgb, var(--hd) 30%, var(--line)); }
.hd-msg.is-note .hd-bubble { background: color-mix(in srgb, var(--polls) 10%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--polls) 55%, var(--line)); }
.hd-msg .att-grid { margin-top: 6px; }
.hd-composer { background: var(--surface); border: 2px solid var(--line-strong); border-radius: 14px; padding: 12px; }
.hd-composer .attach-list:not(:empty) { margin-top: 8px; }
.hd-rate { border-color: color-mix(in srgb, var(--st-done) 40%, var(--line)); margin-bottom: 16px; }
.hd-stars { display: flex; gap: 4px; }
.hd-stars button { border: 0; background: none; font-size: 1.6rem; color: var(--polls); padding: 0 2px; line-height: 1; }
.hd-stars button:hover { transform: scale(1.12); }
.stars { color: var(--polls); font-size: .8rem; white-space: nowrap; }
.hd-sla-box { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: .82rem; }
.hd-sla-box > div:not(.mt-1) { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.hd-sla-box span { color: var(--muted); }
.hd-req { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.hd-activity summary { font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.hd-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.hd-cat { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2); font-size: .85rem; }
.hd-sla { display: grid; gap: 8px; }
.hd-sla-row { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 12px; align-items: end; }
.hd-sla-row label { display: flex; flex-direction: column; gap: 3px; color: var(--muted); }
.hn-agent { background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px; }
.hbar { display: grid; grid-template-columns: minmax(0, 140px) 1fr 32px; gap: 10px; align-items: center; font-size: .86rem; padding: 4px 0; }
.hbar-track { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.hbar-track span { display: block; height: 100%; background: var(--hd); border-radius: 0 4px 4px 0; }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; }
.hd-col { background: var(--hd); }
.hd-days .vbar { flex-basis: 30px; }
.hd-days .vname { font-size: .62rem; }
/* Phones: the "More" button in the bottom bar */
.bottom-more { flex: 1; display: flex; }
.bottom-more > a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 500; position: relative; }
.bottom-more > a i { font-size: 1.2rem; line-height: 1; padding: 3px 11px; border-radius: 999px; }
.bottom-more > a.active { color: var(--brand-text); } .bottom-more > a.active i { background: var(--brand-soft); }
.bottom-more .dropdown-item { display: flex; align-items: center; padding: .6rem .9rem; }
.bottom-more .dropdown-item.active { background: var(--brand-soft); color: var(--brand-text); }
.bottom-nav .dropdown-item { flex-direction: row; font-size: .95rem; color: var(--text); gap: 0; border-radius: 8px; padding: .6rem .9rem; }
.bottom-nav .dropdown-item i { font-size: 1rem; padding: 0; background: none !important; }
.bottom-nav .dropdown-item .nav-badge { position: static; margin-left: auto; }
.hd-sla-row { align-items: center; max-width: 620px; }
.hd-sla-head { font-size: .72rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
/* Help desk: knowledge base */
.hd-kb-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px 24px; border-radius: var(--radius); color: #fff;
  background: radial-gradient(600px 240px at 100% 0%, rgba(255, 221, 0, .18), transparent 60%), linear-gradient(135deg, #0b7a96, #0b3f7a); }
.hd-kb-hero h2 { margin: 0; font-size: 1.35rem; font-weight: 750; }
.hd-kb-hero p { margin: 2px 0 0; color: rgba(255, 255, 255, .85); font-size: .9rem; }
.hd-kb-hero > div:first-child { flex: 1 1 260px; }
.hd-kb-search { flex: 2 1 320px; }
.hd-kb-search .form-control { border: 0; }
.hd-kb-hero .btn-light-soft { --bs-btn-bg: rgba(255, 255, 255, .15); --bs-btn-color: #fff; --bs-btn-border-color: rgba(255, 255, 255, .3); --bs-btn-hover-bg: rgba(255, 255, 255, .25); --bs-btn-hover-color: #fff; }
.kb-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 768px) { .kb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .kb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kb-card { display: flex; flex-direction: column; padding: 16px 18px; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.kb-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.kb-card h3 { font-size: 1rem; font-weight: 650; margin: 4px 0; }
.kb-card p { font-size: .85rem; color: var(--muted); margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kb-foot { display: flex; gap: 12px; font-size: .76rem; color: var(--muted); margin-top: auto; }
.kb-foot i { margin-right: 4px; }
.kb-article { max-width: 860px; padding: 24px 28px; }
.kb-article h1 { font-size: 1.6rem; font-weight: 750; letter-spacing: -.02em; margin: 4px 0 16px; }
.kb-body { line-height: 1.7; font-size: .98rem; overflow-wrap: anywhere; }
.kb-body h2 { font-size: 1.2rem; font-weight: 700; margin: 20px 0 8px; } .kb-body h3 { font-size: 1.05rem; font-weight: 700; margin: 16px 0 6px; }
.kb-body code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.kb-body blockquote { border-left: 3px solid var(--hd); padding-left: 12px; color: var(--muted); }
.kb-vote { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 22px; padding-top: 14px; font-size: .9rem; }
.kb-editor-wrap .ql-container { min-height: 260px; font-family: inherit; font-size: .95rem; border-color: var(--line-strong); border-radius: 0 0 10px 10px; }
.kb-editor-wrap .ql-toolbar { border-color: var(--line-strong); border-radius: 10px 10px 0 0; background: var(--surface-2); }
.hn-suggest { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--hd) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--hd) 30%, var(--line)); }
.hn-suggest a { display: block; padding: 3px 0; font-size: .88rem; text-decoration: none; }
.hn-suggest a:hover { text-decoration: underline; }
.hd-days { display: flex; gap: 6px; flex-wrap: wrap; }
.hd-day input { position: absolute; opacity: 0; }
.hd-day span { display: inline-block; padding: .3rem .7rem; border: 1px solid var(--line-strong); border-radius: 8px; font-size: .85rem; cursor: pointer; }
.hd-day input:checked + span { background: var(--hd); border-color: var(--hd); color: #fff; }
.hd-day input:focus-visible + span { outline: 2px solid var(--brand-600); outline-offset: 2px; }

/* ---------- Collapsible left menu (desktop) ---------- */
@media (min-width: 992px) {
  .app { position: relative; transition: grid-template-columns .25s ease; }
  .sidebar { position: sticky; }
  /* Sits on the sidebar's edge. It is a child of .app (not .sidebar, which clips its overflow), so it is never half-hidden. */
  .sidebar-toggle { position: absolute; top: 96px; left: 250px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); color: var(--brand-text);
    display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; z-index: 20; box-shadow: var(--shadow-sm); transition: left .25s, transform .25s, background .15s; }
  .sidebar-toggle:hover { background: var(--brand-soft); }
  .app.nav-collapsed { grid-template-columns: 84px 1fr; }
  .nav-collapsed .sidebar { padding: 20px 12px; }
  .nav-collapsed .sidebar-toggle { left: 70px; }
  .nav-collapsed .sidebar-toggle i { transform: rotate(180deg); }
  .nav-collapsed .sidebar-label, .nav-collapsed .side-nav a span, .nav-collapsed .oc-text { display: none; }
  .nav-collapsed .side-nav a { justify-content: center; padding: 12px 0; }
  .nav-collapsed .side-nav a.active::before { left: -12px; }
  .nav-collapsed .side-nav .nav-badge { position: absolute; top: 3px; right: 6px; margin: 0; min-width: 18px; height: 18px; line-height: 18px; font-size: .62rem; padding: 0 5px; }
  .nav-collapsed .sidebar-logo .logo-plate { width: 60px; padding: 8px 6px; overflow: hidden; justify-content: flex-start; }
  .nav-collapsed .sidebar-logo .logo-plate img { width: auto; height: 26px; max-width: none; }
  .nav-collapsed .online-chip { padding: .4rem 0; gap: .3rem; }
}
.sidebar-toggle { display: none; }
@media (min-width: 992px) { .sidebar-toggle { display: inline-flex; } }

/* ---------- Collapsible chat list (Messenger) ---------- */
.conv-av { position: relative; flex-shrink: 0; display: inline-flex; }
.conv-badge { display: none; position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--chat); color: #fff;
  font-size: .62rem; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.list-toggle.active { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; }
@media (min-width: 768px) {
  .chat-list { transition: width .25s ease; }
  .messenger.list-collapsed .chat-list { width: 78px; }
  .messenger.list-collapsed .chat-list-head { padding: 14px 10px; }
  .messenger.list-collapsed .chat-list-head .search-box, .messenger.list-collapsed #chat-new, .messenger.list-collapsed .conv-text, .messenger.list-collapsed .conv-group { display: none !important; }
  .messenger.list-collapsed .chat-list-head > div { justify-content: center; }
  .messenger.list-collapsed .conv-item { justify-content: center; padding: 8px 0; }
  .messenger.list-collapsed .conv-badge { display: block; }
  .messenger.list-collapsed .list-toggle i { transform: scaleX(-1); }
}

/* ---------- Collapsible message list (Inbox) ---------- */
@media (min-width: 992px) {
  .mail-layout.list-collapsed { grid-template-columns: minmax(0, 1fr); }
  .mail-layout.list-collapsed .mail-list-panel { display: none; }
  .mail-layout.list-collapsed .mail-read-panel { display: block !important; }
}

/* ---------- Message editor full screen ---------- */
.compose-max .modal-content { border-radius: 0; }
.compose-max .modal-body { display: flex; flex-direction: column; }
.compose-max .compose-editor-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.compose-max .compose-editor-wrap .ql-container { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.compose-max .compose-editor-wrap .ql-editor { flex: 1; max-height: none; }
#compose-max { width: 32px; height: 32px; }
/* Collapsed menu: a compact "e" mark instead of the cut-off logo */
@media (min-width: 992px) {
  .nav-collapsed .sidebar-logo .logo-plate { width: 52px; height: 52px; padding: 0; justify-content: center; align-items: center; border-radius: 14px; }
  .nav-collapsed .sidebar-logo .logo-plate img { display: none; }
  .nav-collapsed .sidebar-logo .logo-plate::before { content: "S"; font-size: 2rem; font-weight: 800; line-height: 1; color: #f2c200; letter-spacing: -.04em; margin-top: -4px;
    text-shadow: 3px 0 0 #013a81; }
}

/* Document window (smart_editor.html): fills the screen above the app, below dialogs so "unsaved changes" can ask */
.doc-editor { position: fixed; inset: 0; z-index: 1045; display: flex; flex-direction: column; background: var(--surface); }
.doc-editor-bar { display: flex; align-items: center; gap: 10px; padding: 6px 16px; border-bottom: 1px solid var(--line); min-height: 52px; }
.doc-editor-bar > .bi { font-size: 1.25rem; color: var(--muted); }
#doc-editor-frame { flex: 1; width: 100%; border: 0; background: #e2e5e9; }

/* File viewer: a window over the app. Maximized it fills the screen; minimized it shrinks to a bar in the corner
   (no backdrop) so people can keep working and bring it back. */
.viewer { position: fixed; inset: 0; z-index: 1046; display: flex; align-items: center; justify-content: center; padding: 24px; }
.viewer-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); }
.viewer-win { position: relative; display: flex; flex-direction: column; width: min(1100px, 100%); height: min(88vh, 100%);
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.viewer-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.viewer-bar .tile { flex-shrink: 0; }
.viewer-name { border: 0; background: none; padding: 0; text-align: start; color: inherit; cursor: default; }
.viewer-body { position: relative; flex: 1; min-height: 0; background: #e2e5e9; }
.viewer-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.viewer-body .viewer-img { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: auto; }
.viewer-body .viewer-img img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, .25); }
.viewer-body .viewer-note { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 24px; text-align: center; color: var(--muted); background: var(--surface); }
.viewer.max { padding: 0; }
.viewer.max .viewer-win { width: 100%; height: 100%; border-radius: 0; }
.viewer.min { inset: auto 16px calc(16px + var(--bottom-h)) auto; padding: 0; }
.viewer.min .viewer-backdrop, .viewer.min .viewer-body, .viewer.min #viewer-download, .viewer.min #viewer-print,
.viewer.min .viewer-zoom, .viewer.min .viewer-steps { display: none; }
.viewer-zoom, .viewer-steps { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
.viewer-zoom-label { width: auto; min-width: 46px; padding: 0 6px; font-size: .78rem; font-weight: 600; }
.viewer-bar .icon-btn:disabled { opacity: .4; cursor: default; }
.viewer-body .viewer-img img { transition: none; }
@media (max-width: 575.98px) { .viewer-bar .icon-btn { width: 32px; height: 32px; } .viewer-zoom-label { display: none; } }
.viewer.min .viewer-win { width: 340px; max-width: calc(100vw - 32px); height: auto; border: 1px solid var(--line); }
.viewer.min .viewer-bar { border-bottom: 0; }
.viewer.min .viewer-name { cursor: pointer; }
@media (max-width: 575.98px) { .viewer:not(.min) { padding: 0; } .viewer:not(.min) .viewer-win { width: 100%; height: 100%; border-radius: 0; } }

/* Finance */
.fin-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.fin-head .tile { flex-shrink: 0; }
.fin-setup { max-width: 860px; }
.fin-table { --bs-table-bg: transparent; font-size: .9rem; }
.fin-table th { font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
.fin-table td, .fin-table th { padding: 9px 12px; vertical-align: middle; border-color: color-mix(in srgb, var(--line) 70%, transparent); }
.fin-table tfoot th, .fin-table tfoot td { font-size: .88rem; text-transform: none; letter-spacing: 0; color: var(--text); border-top: 2px solid var(--line); }
.fin-table .num, .fin-table .text-end { font-variant-numeric: tabular-nums; }
.fin-zero { color: var(--muted); opacity: .6; }
.fin-desc { max-width: 420px; }
.fin-click { cursor: pointer; }
.fin-click:hover td { background: var(--surface-2); }
.fin-inactive td { color: var(--muted); }
.fin-sub td { background: var(--surface-2); font-weight: 600; }
.fin-current td { background: color-mix(in srgb, var(--fin-soft) 60%, transparent); }
.fin-meta { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: .88rem; }
.fin-meta span { display: block; font-size: .7rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fin-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 991.98px) { .fin-grid { grid-template-columns: 1fr; } }
.fin-checks { list-style: none; margin: 0; padding: 4px 18px 14px; }
.fin-checks li { padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); font-size: .9rem; }
.fin-checks li:last-child { border-bottom: 0; }
.fin-checks li, .fin-checks li > a { display: flex; gap: 10px; align-items: flex-start; }
.fin-checks li > a { color: inherit; text-decoration: none; }
.fin-checks a:hover span { text-decoration: underline; }
.fin-bars { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding: 8px 18px 0; }
.fin-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.fin-bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.fin-bar-pair span { width: 42%; max-width: 16px; min-height: 2px; border-radius: 4px 4px 0 0; }
.fin-bar small { color: var(--muted); font-size: .7rem; }
.fin-bars .r, .fin-legend .r { background: var(--fin); }
.fin-bars .e, .fin-legend .e { background: var(--polls); }
.fin-legend { display: flex; gap: 16px; padding: 8px 18px 16px; font-size: .8rem; color: var(--muted); }
.fin-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.fin-lines td { padding: 6px 8px; }
.fin-lines .fx { display: none; }
.fin-foreign .fin-lines .fx { display: table-cell; }
.fin-json { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin-top: 6px; }
.fin-json pre { margin: 4px 0 0; padding: 8px; background: var(--surface-2); border-radius: 8px; font-size: .75rem; max-height: 240px; overflow: auto; white-space: pre-wrap; word-break: break-word; }


/* Finance: simple view */
.fin-head .fin-mode { margin: 0 0 0 auto; white-space: nowrap; }
.fin-in { color: var(--online); }
.fin-out { color: var(--danger); }
.fin-cur { font-size: .55em; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.fin-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.fin-act { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow-sm); text-align: start; color: var(--text); transition: transform .15s, box-shadow .15s, border-color .15s; }
.fin-act:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.fin-act > i { font-size: 1.9rem; line-height: 1; }
.fin-act span { display: flex; flex-direction: column; min-width: 0; }
.fin-act b { font-size: 1.05rem; }
.fin-act small { color: var(--muted); }
.fin-act.in > i { color: var(--online); } .fin-act.in:hover { border-color: var(--online); }
.fin-act.out > i { color: var(--danger); } .fin-act.out:hover { border-color: var(--danger); }
.fin-act.move > i { color: var(--fin); } .fin-act.move:hover { border-color: var(--fin); }
@media (max-width: 575.98px) { .fin-actions { grid-template-columns: 1fr; gap: 8px; } .fin-act { padding: 12px 14px; } }
.fin-home { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
@media (max-width: 991.98px) { .fin-home { grid-template-columns: 1fr; } }
.fin-money-head { padding: 18px 18px 6px; }
.fin-money-head span { display: block; color: var(--muted); font-size: .85rem; }
.fin-money-head b { font-size: 2rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fin-wallets { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; padding: 10px 18px 18px; }
.fin-wallet { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid transparent; color: inherit; text-decoration: none; min-width: 0; }
.fin-wallet:hover { border-color: var(--fin); color: inherit; }
.fin-wallet > i { font-size: 1.3rem; color: var(--fin); }
.fin-wallet b { font-variant-numeric: tabular-nums; }
.fin-wallet.add { border: 1px dashed var(--line-strong, var(--line)); background: none; color: var(--muted); font-size: .85rem; }
.fin-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 4px 18px 14px; }
.fin-trio span { display: block; color: var(--muted); font-size: .8rem; }
.fin-trio b { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.fin-start { padding: 4px 18px 16px; }
.fin-start ol { margin: 8px 0 0; padding-left: 20px; } .fin-start li { margin-bottom: 4px; }
.fin-activity { padding: 0 8px 8px; }
.fin-act-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; }
.fin-act-row + .fin-act-row { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--line) 60%, transparent); }
.fin-act-row.cancelled { opacity: .55; }
.fin-act-row.cancelled .fin-act-amt { text-decoration: line-through; }
.fin-act-icon { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.1rem; }
.fin-act-icon.in { background: var(--fin-soft); color: var(--fin); }
.fin-act-icon.out { background: var(--danger-soft); color: var(--danger); }
.fin-act-amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-cancel { font-size: .8rem; color: var(--muted); text-decoration: none; }
.fin-cancel:hover { color: var(--danger); }
/* the money in / out / move form */
.fin-record .modal-content { border-top: 4px solid var(--fin); }
.fin-rec-in .modal-content { border-top-color: var(--online); }
.fin-rec-out .modal-content { border-top-color: var(--danger); }
.fin-amount { display: flex; align-items: baseline; gap: 8px; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.fin-amount:focus-within { border-color: var(--fin); }
.fin-amount input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font-size: 2.4rem; font-weight: 700; font-variant-numeric: tabular-nums; padding: 4px 0; }
.fin-amount span { color: var(--muted); font-weight: 600; }
.fin-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fin-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: .9rem; }
.fin-chip.on { background: var(--fin); border-color: var(--fin); color: #fff; }
.fin-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; max-height: 260px; overflow-y: auto; padding: 2px; }
.fin-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: .78rem; line-height: 1.2; text-align: center; }
.fin-tile i { font-size: 1.35rem; color: var(--fin); }
.fin-tile:hover { border-color: var(--fin); }
.fin-tile.on { background: var(--fin-soft); border-color: var(--fin); box-shadow: inset 0 0 0 1px var(--fin); font-weight: 600; }
.fin-tile.add { border-style: dashed; color: var(--muted); }
.fin-tile.add i { color: var(--muted); }
/* reports */
.fin-verdict { display: flex; gap: 16px; align-items: center; padding: 18px; }
.fin-verdict > i { font-size: 2.2rem; }
.fin-verdict.gain > i { color: var(--online); } .fin-verdict.loss > i { color: var(--danger); }
.fin-verdict-big { font-size: 1.45rem; font-weight: 700; }
.fin-grid-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 991.98px) { .fin-grid-even { grid-template-columns: 1fr; } }
.fin-cats { padding: 0 18px 14px; }
.fin-cat { display: flex; gap: 12px; align-items: center; padding: 7px 0; }
.fin-cat > i { color: var(--muted); font-size: 1.1rem; width: 22px; text-align: center; }
.fin-cat b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-cat-bar { height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 4px; overflow: hidden; }
.fin-cat-bar span { display: block; height: 100%; border-radius: 3px; }
.fin-cat-bar.in span { background: var(--fin); } .fin-cat-bar.out span { background: var(--polls); }
.fin-catlist { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 16px; }
.fin-catchip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); font-size: .85rem; }
.fin-catchip i { color: var(--fin); }
.fin-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.fin-icon { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 1.1rem; }
.fin-icon.on { border-color: var(--fin); background: var(--fin-soft); color: var(--fin); }
.fin-trio.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Finance: invoices and bills */
.fin-owed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
@media (max-width: 767.98px) { .fin-owed { grid-template-columns: 1fr; } }
.fin-owe { display: flex; gap: 14px; align-items: center; padding: 16px 18px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.fin-owe:hover { border-color: var(--fin); box-shadow: var(--shadow); color: inherit; }
.fin-owe > i { font-size: 1.8rem; }
.fin-owe.in > i { color: var(--fin); } .fin-owe.out > i { color: var(--polls); }
.fin-owe span { display: flex; flex-direction: column; }
.fin-owe .fin-owe-label { color: var(--muted); font-size: .85rem; }
.fin-owe b { font-size: 1.5rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.fin-owe .late { color: var(--danger); font-size: .85rem; font-weight: 600; }
.fin-owe .soon { color: var(--polls); font-size: .85rem; font-weight: 600; }
.fin-owe .ok { color: var(--muted); font-size: .85rem; }
.fin-totals { min-width: 260px; font-variant-numeric: tabular-nums; }
.fin-totals td { padding: 3px 0 3px 18px; text-align: right; }
.fin-totals td:first-child { color: var(--muted); text-align: left; padding-left: 0; }
.fin-totals .grand td { font-weight: 700; font-size: 1.05rem; color: var(--text); border-top: 1px solid var(--line); padding-top: 6px; }
.fin-docgrid { display: flex; flex-wrap: wrap; gap: 14px 32px; align-items: flex-start; }
.fin-lbl { display: block; font-size: .7rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fin-big { font-size: 1.6rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.fin-subhead { font-size: .8rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 6px 0 4px; }
.fin-alloc { max-height: 220px; overflow-y: auto; margin-bottom: 12px; }
.fin-catchip { border: 0; color: var(--text); }
.fin-catchip[data-taxedit]:hover { background: var(--fin-soft); }
.fin-off { opacity: .55; text-decoration: line-through; }
.brand-logo { object-fit: contain; }

/* Business card maker: its own page in an iframe, filling the space under the header */
.cards-wrap { height: calc(100vh - var(--header-h) - 32px - var(--bottom-h)); height: calc(100dvh - var(--header-h) - 32px - var(--bottom-h)); min-height: 480px;
  border: 1px solid var(--bs-border-color); border-radius: 14px; overflow: hidden; background: #fff; }
.cards-wrap iframe { display: block; width: 100%; height: 100%; border: 0; }
@media (max-width: 767.98px) { .cards-wrap { margin: 0 -16px; border-radius: 0; border-left: 0; border-right: 0; height: calc(100dvh - var(--header-h) - 4px - var(--bottom-h)); } }

/* Contacts */
.contact-cat-filter { width: auto; max-width: 220px; }
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.contact-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.contact-card h3 { font-size: 1rem; font-weight: 650; margin: 0 0 2px; }
.contact-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.contact-links { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; min-width: 0; }
.contact-links > * { display: flex; align-items: flex-start; gap: 8px; color: var(--text); text-decoration: none; min-width: 0; }
.contact-links > a:hover span { text-decoration: underline; }
.contact-links i { color: var(--muted); margin-top: 2px; }
.contact-links span { min-width: 0; overflow-wrap: anywhere; }
.contact-notes { font-size: .82rem; color: var(--muted); white-space: pre-line; border-top: 1px solid var(--line); padding-top: 8px; }
@media (max-width: 575.98px) { .contact-cat-filter { max-width: none; flex: 1 1 100%; } }

/* Joining a company: requests, replies and the company list */
.join-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px; border-radius: 12px; min-width: 0; }
.join-row + .join-row { border-top: 1px solid var(--line); border-radius: 0; }
.join-row > .row-title { align-self: center; }
.join-row .btn, .join-row .pill, .join-row .icon-btn { align-self: center; }
.join-letter { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .88rem; white-space: pre-line; overflow-wrap: anywhere; }
.join-companies { max-height: 55vh; overflow-y: auto; }
@media (max-width: 575.98px) { #dash-join-admin .join-row { flex-wrap: wrap; } #dash-join-admin .join-row > .d-flex { margin-left: 52px; } }

/* Company switcher (header) */
.cs-btn { display: inline-flex; align-items: center; gap: 8px; max-width: 260px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: 5px 10px; position: relative; }
.cs-btn:hover { background: var(--surface-2); }
.cs-btn-icon { color: var(--muted); }
.cs-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.cs-name { font-weight: 600; font-size: .88rem; max-width: 170px; }
.cs-role { font-size: .72rem; color: var(--muted); max-width: 170px; }
.cs-dot { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--mail); border: 2px solid var(--surface); }
.cs-menu { min-width: 280px; max-width: min(340px, calc(100vw - 24px)); }
.cs-item { display: flex; align-items: center; gap: 10px; padding-top: 8px; padding-bottom: 8px; white-space: normal; }
.cs-item.active, .cs-item:active { background: var(--brand-soft); color: var(--text); }
.cs-sub { color: var(--muted); }
.cs-check { color: var(--brand-text); font-size: 1.1rem; }
.cs-logo { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--av, var(--surface-2)); color: #fff; font-weight: 600; font-size: .8rem; }
.cs-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.cs-personal { background: var(--surface-2); color: var(--muted); font-size: 1rem; }
@media (max-width: 575.98px) { .cs-btn { max-width: 150px; padding: 5px 8px; } .cs-name { max-width: 90px; } }
.cs-menu > .dropdown-item > i { width: 20px; margin-right: 8px; }
.seg-count { font-size: .75rem; opacity: .75; margin-left: 2px; }
.seg-count:empty { display: none; }
#contact-filter { max-width: 100%; overflow-x: auto; }
#contact-filter button { white-space: nowrap; }

/* ---------------------------------------------------------------- interface language (i18n.js) */
.lang-switch .lang-picker { font-size: .85rem; }
.login-lang { display: flex; justify-content: flex-end; margin: -8px -8px 8px 0; }
.login-lang .lang-picker { width: auto; }

/* Files > Add Source Storage: the modal has its own title, and the form sits flush in its body */
#storage-modal #sr-form-title { display: none; }
#storage-modal #sr-form { margin-top: 0 !important; }

/* Files: copy / cut / paste. The bar under the folder head, its circular progress ring, cut rows and folder drop targets. */
.file-bulk .fb-icon { width: 32px; padding-left: 0; padding-right: 0; }
.clip-bar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px; }
.clip-bar .empty-icon { width: 40px; height: 40px; margin: 0; font-size: 1.1rem; flex-shrink: 0; }
.clip-ring { width: 44px; height: 44px; flex-shrink: 0; transform: rotate(-90deg); }
.clip-ring circle { fill: none; stroke-width: 3.5; }
.clip-ring .track { stroke: var(--surface-2); }
.clip-ring .bar { stroke: var(--files, var(--brand)); stroke-linecap: round; transition: stroke-dashoffset .3s ease; }
.clip-ring text { transform: rotate(90deg); transform-origin: 18px 18px; font-size: 9px; font-weight: 600; fill: var(--text); }
.clip-bar.busy .clip-ring { animation: clip-pulse 1.6s ease-in-out infinite; }
@keyframes clip-pulse { 50% { opacity: .75; } }
.file-row.is-cut { opacity: .5; }
.file-row[draggable="true"] { cursor: grab; }
.file-row[draggable="true"] a, .file-row[draggable="true"] button, .file-row[draggable="true"] input { cursor: pointer; }
.place.drop-on { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand-text); }

/* Files: folder sync. The settings modal's type groups and extension chips, the status bar, the log, the head button. */
.sync-types { display: grid; gap: 10px; }
.sync-types.disabled { opacity: .5; }
.sync-group { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.sync-group-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; margin-bottom: 8px; cursor: pointer; }
.sync-group-head .form-check-input { margin: 0; }
.sync-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sync-chip { display: inline-flex; align-items: center; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; font-family: var(--bs-font-monospace); cursor: pointer; user-select: none; color: var(--muted); }
.sync-chip input { position: absolute; opacity: 0; pointer-events: none; }
.sync-chip.on { background: var(--brand-soft); border-color: var(--brand-text); color: var(--brand-text); font-weight: 600; }
.sync-chip:focus-within { outline: 2px solid var(--brand-text); outline-offset: 1px; }
.sync-log { display: grid; gap: 2px; font-size: .85rem; }
.sync-log-row { display: flex; gap: 10px; align-items: baseline; padding: 4px 2px; border-bottom: 1px solid var(--line); }
.sync-log-time { color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.icon-btn.sync-on { color: var(--files); border-color: var(--files); background: var(--files-soft); }
.icon-btn.sync-busy i, .sync-bar .spin { animation: sync-spin 1s linear infinite; display: inline-block; }
@keyframes sync-spin { to { transform: rotate(360deg); } }
.place-sync { color: var(--files); font-size: .85rem; flex-shrink: 0; }

/* Files: folder sync direction cards (one or both ticked) */
.sync-dirs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.sync-dir { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.sync-dir .form-check-input { margin-top: 3px; flex-shrink: 0; }
.sync-dir.on { border-color: var(--files); background: var(--files-soft); }
.sync-dir:has(input:disabled) { opacity: .55; cursor: not-allowed; }

/* ---------------------------------------------------------------- calls (calls.js) */
.chat-header .chat-calls { display: flex; gap: 6px; margin-left: auto; flex-shrink: 0; }
.chat-header .chat-calls.d-none { display: none; }
.chat-calls .icon-btn { display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.chat-calls .icon-btn:disabled { opacity: .45; pointer-events: none; }
.msg.call-log { margin-left: auto; margin-right: auto; align-items: center; max-width: 100%; }
.call-line { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text, inherit);
  border-radius: 999px; padding: .35rem .9rem; font-size: .85rem; cursor: pointer; }
.call-line:hover { background: var(--brand-soft); }
.call-line i { color: var(--brand-text, var(--brand)); }
.msg.call-log.missed .call-line i { color: var(--danger); }

.call-screen { position: fixed; inset: 0; z-index: 2000; background: radial-gradient(circle at 50% 30%, #1d2a44, #070b14 70%); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.call-screen.d-none { display: none; }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; display: none; }
.call-screen.video.connected .call-remote { display: block; }
.call-info { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 0 16px; }
.call-info .avatar { width: 112px; height: 112px; font-size: 2.4rem; }
.call-name { font-size: 1.6rem; font-weight: 600; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-status { font-size: 1rem; opacity: .8; font-variant-numeric: tabular-nums; }
.call-screen.video.connected .call-info { position: absolute; top: 16px; left: 0; right: 0; gap: 2px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.call-screen.video.connected .call-info .call-av { display: none; }
.call-screen.video.connected .call-name { font-size: 1.1rem; }
.call-screen.video.connected .call-status { font-size: .85rem; }
.call-local { position: absolute; z-index: 2; right: 16px; bottom: 120px; width: 120px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px;
  background: #222; box-shadow: 0 4px 18px rgba(0,0,0,.5); transform: scaleX(-1); }
.call-screen.rear .call-local { transform: none; }
.call-screen.cam-off .call-local { opacity: .25; }
@media (min-width: 768px) { .call-local { width: 220px; aspect-ratio: 4 / 3; bottom: 130px; } }
.call-min { position: absolute; z-index: 2; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; }
.call-controls { position: absolute; z-index: 2; bottom: max(28px, env(safe-area-inset-bottom)); left: 0; right: 0; display: none; justify-content: center; gap: 18px; }
.call-screen.incoming .call-when-incoming, .call-screen.live .call-when-live { display: flex; }
.call-screen.over .call-controls, .call-screen.over .call-min { display: none; }
.call-screen.incoming .call-when-incoming { gap: 72px; }
.call-ctl { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .85rem; }
.call-btn { width: 58px; height: 58px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; font-size: 1.35rem;
  display: inline-flex; align-items: center; justify-content: center; transition: background .15s; }
.call-btn:hover { background: rgba(255,255,255,.26); }
.call-btn.off { background: #fff; color: #111; }
.call-btn.hang { background: #e5484d; }
.call-btn.hang:hover { background: #cf3238; }
.call-btn.ok { background: #1fa855; animation: call-pulse 1.4s infinite; }
.call-btn.d-none { display: none; }
@keyframes call-pulse { 0% { box-shadow: 0 0 0 0 rgba(31,168,85,.6); } 70% { box-shadow: 0 0 0 18px rgba(31,168,85,0); } 100% { box-shadow: 0 0 0 0 rgba(31,168,85,0); } }
@media (prefers-reduced-motion: reduce) { .call-btn.ok { animation: none; } }

/* small window while chatting: click to make it big again */
.call-screen.mini { inset: auto 16px 16px auto; width: 240px; height: 150px; border-radius: 16px; box-shadow: 0 8px 30px rgba(0,0,0,.45); cursor: pointer; }
.call-screen.mini .call-info { gap: 2px; }
.call-screen.mini .call-info .avatar { width: 44px; height: 44px; font-size: 1rem; }
.call-screen.mini .call-name { font-size: 1rem; max-width: 200px; }
.call-screen.mini .call-status { font-size: .8rem; }
.call-screen.mini .call-local, .call-screen.mini .call-min, .call-screen.mini .call-controls { display: none; }
.call-screen.mini.live .call-when-live { display: flex; bottom: 8px; gap: 8px; }
.call-screen.mini .call-when-live .call-btn:not(.hang):not(#call-mute) { display: none; }
.call-screen.mini .call-btn { width: 36px; height: 36px; font-size: .95rem; }
.call-screen.mini.video.connected .call-info { top: 6px; }
.call-screen.mini.live:not(.video.connected) .call-info { margin-bottom: 36px; }
