:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e3e6eb;
  --text: #1b1f27;
  --muted: #667085;
  --accent: #4f46e5;
  --accent-soft: #eef0ff;
  --accent-text: #3730a3;
  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --radius: 10px;

  --st-todo: #98a2b3;
  --st-in_progress: #2e90fa;
  --st-blocked: #f04438;
  --st-in_review: #9e77ed;
  --st-done: #12b76a;
  --st-verified: #0e7490;

  --pr-low: #98a2b3;
  --pr-medium: #2e90fa;
  --pr-high: #f79009;
  --pr-critical: #f04438;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1f232c;
    --border: #2a2f3a;
    --text: #e6e8ec;
    --muted: #98a1b3;
    --accent: #818cf8;
    --accent-soft: #23264a;
    --accent-text: #c7cbff;
    --danger: #f97066;
    --danger-soft: #3a1714;
    --warn: #fdb022;
    --warn-soft: #33260c;
    --ok: #47cd89;
    --ok-soft: #0f2a1d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --surface: #171a21; --surface-2: #1f232c; --border: #2a2f3a; --text: #e6e8ec; --muted: #98a1b3;
  --accent: #818cf8; --accent-soft: #23264a; --accent-text: #c7cbff; --danger: #f97066; --danger-soft: #3a1714;
  --warn: #fdb022; --warn-soft: #33260c; --ok: #47cd89; --ok-soft: #0f2a1d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.25; margin: 0; display: flex; gap: 10px; align-items: center; }
h2 { font-size: 15px; margin: 0 0 12px; }
p { margin: 4px 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; justify-content: center; }
.right { text-align: right; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between, .between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.pad { padding: 16px; }
.danger-text { color: var(--danger); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ------------------------------------------------------------------ controls */
input, select, textarea {
  font: inherit; color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  min-width: 0;
}
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none !important;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.success:hover { filter: brightness(1.08); background: var(--ok); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.ghost.danger { color: var(--danger); background: transparent; }
.btn.ghost.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.link:hover { text-decoration: underline; }
.icon-btn {
  background: none; border: 0; cursor: pointer; color: var(--muted);
  width: 32px; height: 32px; border-radius: 8px; font-size: 16px;
  display: inline-grid; place-items: center; position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.small { width: 24px; height: 24px; font-size: 12px; }

.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
label.inline { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > input, .field > select { width: 100%; }
.field-label { font-weight: 500; font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ------------------------------------------------------------------ badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500; line-height: 1;
  padding: 4px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  white-space: nowrap;
}
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge[class*="status-"]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); }
.status-todo { --dot: var(--st-todo); }
.status-in_progress { --dot: var(--st-in_progress); }
.status-blocked { --dot: var(--st-blocked); }
.status-in_review { --dot: var(--st-in_review); }
.status-done { --dot: var(--st-done); }
.status-verified { --dot: var(--st-verified); }
.badge.status-verified { background: color-mix(in srgb, var(--st-verified) 14%, transparent); color: var(--text); }

.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.prio i { width: 8px; height: 8px; border-radius: 2px; background: var(--pc); }
.prio-low { --pc: var(--pr-low); }
.prio-medium { --pc: var(--pr-medium); }
.prio-high { --pc: var(--pr-high); }
.prio-critical { --pc: var(--pr-critical); }
.prio-critical { color: var(--danger); font-weight: 600; }

.type {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
  padding: 2px 6px; border-radius: 4px; background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.type-bug { background: var(--danger-soft); color: var(--danger); }
.type-feature { background: var(--ok-soft); color: var(--ok); }
.type-improvement { background: var(--accent-soft); color: var(--accent-text); }

.key-pill {
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 4px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-text); margin-right: 8px;
}
.key { font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); white-space: nowrap; }

.avatar {
  --hue: 240;
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 600;
  background: hsl(var(--hue) 70% 88%);
  color: hsl(var(--hue) 55% 30%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .avatar { background: hsl(var(--hue) 35% 28%); color: hsl(var(--hue) 70% 85%); }
}
:root[data-theme="dark"] .avatar { background: hsl(var(--hue) 35% 28%); color: hsl(var(--hue) 70% 85%); }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.avatar.unassigned { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--border); }
.avatars { display: flex; }
.avatars .avatar { border: 2px solid var(--surface); margin-left: -6px; }
.avatars .avatar:first-child { margin-left: 0; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: inherit; }
.user-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags:empty { display: none; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface-2); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 13px;
}
.tag button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit; font-size: 13px; cursor: pointer;
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px;
  padding: 18px 12px;
  background: var(--surface); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--text); padding: 0 8px; }
.brand:hover { text-decoration: none; }
.logo {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 800;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-foot { margin-top: auto; padding: 0 10px; }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 28px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.menu-btn { display: none; }
.search { flex: 1; max-width: 460px; }
.search input { width: 100%; background: var(--surface); }
.topbar .dropdown:first-of-type { margin-left: auto; }
main { padding: 24px 28px 48px; max-width: 1320px; width: 100%; outline: none; display: flex; flex-direction: column; gap: 18px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }
.crumbs .copy { width: 24px; height: 24px; font-size: 13px; }

/* dropdown menus */
.dropdown { position: relative; }
.menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px;
}
.dropdown.open .menu { display: block; }
.menu > button {
  display: block; width: 100%; text-align: left; font: inherit; color: inherit;
  background: none; border: 0; padding: 8px 10px; border-radius: 6px; cursor: pointer;
}
.menu > button:hover { background: var(--surface-2); }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: flex; flex-direction: column; }
.menu-head.row { flex-direction: row; justify-content: space-between; align-items: center; }
.menu-foot { display: block; text-align: center; padding: 8px; border-top: 1px solid var(--border); margin-top: 6px; font-size: 13px; }
.avatar-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }

.bell .count {
  position: absolute; top: 1px; right: 0;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
}
.notif-menu { width: min(380px, calc(100vw - 32px)); }
.notif-list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.notif-list.page-list { max-height: none; }
.notif > button {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  font: inherit; color: inherit; background: none; border: 0; padding: 10px; border-radius: 8px; cursor: pointer;
}
.page-list .notif > button { border-radius: 0; border-bottom: 1px solid var(--border); padding: 14px 16px; }
.notif > button:hover { background: var(--surface-2); }
.notif.unread > button { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.notif-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: none; }
.none { padding: 14px; text-align: center; }

/* ------------------------------------------------------------------ cards / tables */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.card.flush > .card-head { padding: 16px 18px 0; }
.card-head h2 { margin: 0; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-2.tight { grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3.tight { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stats.compact { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-bottom: 16px; }
.stat {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; color: inherit;
}
.stats.compact .stat { box-shadow: none; background: var(--surface-2); border-color: transparent; }
a.stat:hover { border-color: var(--accent); text-decoration: none; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat.warn .stat-value { color: var(--warn); }
.stat.danger .stat-value { color: var(--danger); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface);
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table.tickets tbody tr, .table.report tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.inactive td { opacity: .55; }
.table td.nowrap { white-space: nowrap; }
.table td.overdue { color: var(--danger); font-weight: 500; }
.table td.num, .table.report td { font-variant-numeric: tabular-nums; }
.title-cell { display: flex; gap: 8px; align-items: center; min-width: 220px; }
.title-cell span:last-child { overflow: hidden; text-overflow: ellipsis; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }

.filters-card { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters input[type="search"] { flex: 1 1 240px; }
.ticket-list { display: flex; flex-direction: column; gap: 12px; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.pager:empty { display: none; }
.pager > span { margin-right: auto; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 32px; }
.spin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.alert.error { background: var(--danger-soft); color: var(--danger); }

/* ------------------------------------------------------------------ dashboard */
.project-sum { list-style: none; margin: 0; padding: 0; }
.project-sum li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.project-sum li:last-child { border-bottom: 0; }
.project-sum a { color: var(--text); display: flex; align-items: center; min-width: 0; }

.status-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.status-bar .seg { background: var(--dot); }
.status-bar .seg.empty { flex: 1; background: var(--surface-2); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--dot); }
.legend strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ projects */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.project-card { display: flex; flex-direction: column; gap: 10px; color: inherit; }
.project-card:hover { border-color: var(--accent); text-decoration: none; }
.project-card.archived { opacity: .65; }
.project-meta { display: flex; gap: 16px; color: var(--muted); font-size: 13px; }
.project-meta strong { color: var(--text); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a, .tabs button {
  font: inherit; font-weight: 500; background: none; border: 0; cursor: pointer;
  padding: 9px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs .active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs.small { margin: -18px -18px 16px; padding: 0 12px; }
.tab-body { display: flex; flex-direction: column; gap: 16px; }


.add-member .row > .picker { flex: 1 1 260px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }

/* picker / autocomplete */
.picker { position: relative; min-width: 0; }
.picker input { width: 100%; }
.picker-list {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  list-style: none; margin: 0; padding: 4px; max-height: 260px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg);
}
.picker.open .picker-list, .picker-list.open { display: block; }
.picker-list li { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.picker-list li .muted { margin-left: auto; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-list li.active, .picker-list li:hover { background: var(--accent-soft); }
.picker-list li.none { cursor: default; justify-content: center; }
.picker-list li.none:hover { background: none; }

/* ------------------------------------------------------------------ ticket page */
.ticket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.ticket-head-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; }
.ticket-head-actions { display: flex; gap: 8px; align-items: center; }
.ticket-title { font-size: 24px; overflow-wrap: anywhere; }
.ticket-title.editable { cursor: text; border-radius: 6px; margin: -2px -6px; padding: 2px 6px; }
.ticket-title.editable:hover { background: var(--surface-2); }
.title-input { font-size: 22px; font-weight: 700; width: 100%; }
.status-select { font-weight: 600; padding-left: 26px; background-image: radial-gradient(circle at 13px 50%, var(--dot) 4.5px, transparent 5px); }

.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.ticket-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.ticket-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 72px; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }

.props { display: flex; flex-direction: column; gap: 12px; }
.prop { display: grid; grid-template-columns: 90px 1fr; gap: 8px; align-items: center; }
.prop-label { color: var(--muted); font-size: 13px; }
.prop-value { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.prop-value > select, .prop-value > input, .prop-value .picker { width: 100%; }
.inline-edit { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.props.dates .prop-value { font-size: 13px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--ok); }
.progress span.over { background: var(--danger); }

.comments { display: flex; flex-direction: column; }
.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment:first-child { padding-top: 0; }
.comment-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.comment-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.comment-body { overflow-wrap: anywhere; }
.mention { background: var(--accent-soft); color: var(--accent-text); border-radius: 4px; padding: 0 3px; font-weight: 500; }
.composer-wrap { display: flex; gap: 12px; padding-top: 16px; }
.composer { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.composer-input { position: relative; }
.mention-pop { top: auto; bottom: calc(100% + 4px); }

.files { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.files.inline { margin-top: 0; }
.file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; flex-wrap: wrap; }
.file .link { font-weight: 500; overflow-wrap: anywhere; text-align: left; }
.file .icon-btn { margin-left: auto; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 22px; cursor: pointer; text-align: center;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.busy { opacity: .6; pointer-events: none; }

.worklog-form input[type="number"] { width: 100px; }
.worklogs, .timeline { list-style: none; margin: 16px 0 0; padding: 0; }
.worklogs li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.timeline { margin: 0; }
.timeline li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.timeline .change { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ reports */
.score { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.score-bar { width: 60px; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.score-bar i { display: block; height: 100%; background: var(--sc); }
.score.good { --sc: var(--ok); }
.score.ok { --sc: var(--warn); }
.score.low { --sc: var(--danger); }
.note { max-width: 820px; }
.dev-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dev-head h2 { margin: 0; font-size: 20px; }
.dev-score { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.dev-score .score strong { font-size: 22px; }
.metrics { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; margin: 0; }
.metrics dt { color: var(--muted); }
.metrics dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ modal / toasts */
.backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 17, 21, .45);
  display: grid; place-items: start center; padding: 8vh 16px 16px; overflow-y: auto;
  animation: fade .12s ease-out;
}
.modal {
  width: 100%; max-width: 480px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  animation: rise .15s ease-out;
}
.modal.wide { max-width: 680px; }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 0; }
.modal header h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 16px 18px 18px; }
.modal-body > input { width: 100%; margin-top: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

#toasts { position: fixed; bottom: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast {
  background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-lg);
  font-size: 13px; max-width: 380px; transition: opacity .4s, transform .4s; animation: rise .15s ease-out;
}
.toast.error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ------------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 32px 28px;
}
.login-card .brand { justify-content: center; font-size: 18px; margin-bottom: 4px; }
.login-card .form { margin-top: 8px; }

/* ------------------------------------------------------------------ responsive */
.nav-scrim { display: none; }
@media (max-width: 1100px) {
  .hide-md { display: none; }
  .ticket-layout { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 60; width: 248px;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .35); }
  .menu-btn { display: inline-grid; }
  .grid-2, .ticket-layout { grid-template-columns: minmax(0, 1fr); }
  .ticket-side { position: static; order: -1; }
  .topbar { padding: 10px 16px; }
  main { padding: 18px 16px 40px; }
}
@media (max-width: 600px) {
  .hide-sm { display: none; }
  .grid-2.tight, .grid-3.tight { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 22px; }
  .title-cell { min-width: 160px; }
  .ticket-head-actions { width: 100%; }
  .dev-score { margin-left: 0; align-items: flex-start; }
}

/* ------------------------------------------------------------------ verification */
.banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; margin-top: 14px; border-radius: var(--radius); border: 1px solid var(--border);
}
.banner.pending { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.banner.verified { background: color-mix(in srgb, var(--st-verified) 12%, var(--surface)); border-color: color-mix(in srgb, var(--st-verified) 35%, transparent); }
.banner-icon { font-size: 18px; }
.card.highlight { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.card-sub { padding: 0 18px 10px; margin-top: -6px; color: var(--muted); font-size: 13px; }
.card:not(.flush) > .card-sub { padding: 0; }
.chip-row { padding: 0 18px 14px; }
.chip.person { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; }
.chip.person strong { color: var(--danger); }
.copy-key { padding: 2px 8px; font-size: 12px; }

/* ------------------------------------------------------------------ markdown editor */
.md-editor { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.md-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.md-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border); background: var(--surface-2); padding: 4px 6px; border-radius: 10px 10px 0 0; }
.md-tabs { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 2px; }
.md-tabs button { font: inherit; font-size: 12px; font-weight: 600; background: none; border: 0; cursor: pointer; padding: 4px 10px; border-radius: 5px; color: var(--muted); }
.md-tabs button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }
.md-toolbar { display: flex; align-items: center; flex-wrap: wrap; flex: 1; gap: 2px; }
.md-group { display: flex; gap: 1px; padding: 0 4px; border-right: 1px solid var(--border); }
.md-group:last-child { border-right: 0; }
.md-toolbar button, .md-icon {
  font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; min-width: 28px; height: 28px; padding: 0 6px;
  background: none; border: 0; border-radius: 6px; color: var(--muted); cursor: pointer;
}
.md-toolbar button:hover, .md-icon:hover { background: var(--surface); color: var(--text); }
.md-side { display: flex; gap: 2px; margin-left: auto; }
.md-body { display: grid; grid-template-columns: 1fr; min-height: 0; flex: 1; }
.md-write { position: relative; min-width: 0; display: flex; }
.md-editor textarea.md-input {
  border: 0; border-radius: 0; box-shadow: none !important; width: 100%; resize: vertical; background: transparent;
  font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 12px 14px; tab-size: 2;
}
.md-preview { padding: 12px 16px; min-height: 140px; overflow: auto; min-width: 0; }
.md-editor[data-mode="write"] .md-preview { display: none; }
.md-editor[data-mode="preview"] .md-write, .md-editor[data-mode="preview"] .md-toolbar { display: none; }
.md-editor[data-mode="split"] .md-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.md-editor[data-mode="split"] .md-preview { border-left: 1px solid var(--border); max-height: 520px; }
.md-foot { display: flex; justify-content: space-between; gap: 8px; padding: 4px 10px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }
.md-slash {
  position: absolute; left: 14px; top: 34px; z-index: 30; list-style: none; margin: 0; padding: 4px; min-width: 260px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg);
}
.md-slash li { display: flex; justify-content: space-between; gap: 16px; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.md-slash li .muted { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.md-slash li.active, .md-slash li:hover { background: var(--accent-soft); }
.md-editor.md-full { position: fixed; inset: 16px; z-index: 150; box-shadow: var(--shadow-lg); }
.md-editor.md-full .md-body { min-height: 0; }
.md-editor.md-full textarea.md-input { resize: none; height: 100%; }
.md-editor.md-full .md-preview { max-height: none; }
body.md-full-open::after { content: ""; position: fixed; inset: 0; background: rgba(15, 17, 21, .45); z-index: 140; }
.md-help-table code { white-space: pre-wrap; font-size: 12px; }
@media (max-width: 700px) { .md-editor[data-mode="split"] .md-body { grid-template-columns: 1fr; } .md-editor[data-mode="split"] .md-preview { border-left: 0; border-top: 1px solid var(--border); } }

/* ------------------------------------------------------------------ rendered markdown */
.markdown { line-height: 1.65; overflow-wrap: anywhere; font-size: 14px; }
.markdown.plain { white-space: pre-wrap; }
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }
.markdown p, .markdown ul, .markdown ol, .markdown blockquote, .markdown .md-table-wrap, .markdown .md-codeblock, .markdown details, .markdown .md-mermaid { margin: 0 0 12px; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 { margin: 20px 0 8px; line-height: 1.3; display: block; position: relative; scroll-margin-top: 80px; }
.markdown h1 { font-size: 22px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.markdown h2 { font-size: 18px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.markdown h3 { font-size: 16px; } .markdown h4 { font-size: 14px; } .markdown h5, .markdown h6 { font-size: 13px; color: var(--muted); }
.md-anchor { margin-left: 6px; color: var(--muted); opacity: 0; text-decoration: none !important; font-weight: 400; }
.markdown :is(h1, h2, h3, h4, h5, h6):hover .md-anchor { opacity: 1; }
.md-flash { animation: md-flash 1.2s ease-out; }
@keyframes md-flash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.markdown ul, .markdown ol { padding-left: 24px; }
.markdown li + li { margin-top: 3px; }
.markdown li > ul, .markdown li > ol { margin: 3px 0 0; }
.markdown ul.task-list, .markdown .task-list { list-style: none; padding-left: 4px; }
.markdown li.task-item { list-style: none; }
.markdown li.task-item > ul { padding-left: 22px; }
.md-task { width: 15px; height: 15px; margin: 0 8px 0 0; vertical-align: -2px; accent-color: var(--ok); cursor: pointer; }
.md-task:disabled { cursor: default; opacity: 1; }
.markdown li.task-item:has(> .md-task:checked) { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.markdown code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.markdown mark { background: color-mix(in srgb, #fde047 55%, transparent); color: inherit; padding: 0 2px; border-radius: 3px; }
.markdown blockquote { border-left: 3px solid var(--border); padding: 4px 14px; color: var(--muted); }
.markdown hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.markdown img { max-width: 100%; border-radius: 8px; }
.markdown a.md-ticket { font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--accent-soft); color: var(--accent-text); padding: 1px 5px; border-radius: 4px; text-decoration: none; }
.markdown details { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; background: var(--surface); }
.markdown details > summary { cursor: pointer; font-weight: 600; }
.markdown details[open] > summary { margin-bottom: 8px; }
.md-table-wrap { overflow-x: auto; }
.markdown table { border-collapse: collapse; min-width: 50%; }
.markdown th, .markdown td { border: 1px solid var(--border); padding: 6px 12px; text-align: left; }
.markdown th { background: var(--surface-2); font-weight: 600; }
.markdown tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }

/* code blocks */
.md-codeblock { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--code-bg); }
.md-codebar { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 4px 12px; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.md-copy { border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; padding: 3px 8px; border-radius: 5px; }
.md-copy:hover { background: var(--surface); color: var(--text); }
.markdown pre { margin: 0; padding: 12px 14px; overflow-x: auto; background: var(--code-bg); }
.markdown pre code { background: none; padding: 0; font-size: 12.5px; line-height: 1.6; color: var(--code-fg); }
:root { --code-bg: #f6f8fa; --code-fg: #24292f; --hl-kw: #cf222e; --hl-str: #0a3069; --hl-num: #0550ae; --hl-fn: #8250df; --hl-cm: #6e7781; --hl-ty: #953800; --hl-var: #116329; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --code-bg: #0d1117; --code-fg: #e6edf3; --hl-kw: #ff7b72; --hl-str: #a5d6ff; --hl-num: #79c0ff; --hl-fn: #d2a8ff; --hl-cm: #8b949e; --hl-ty: #ffa657; --hl-var: #7ee787; } }
:root[data-theme="dark"] { --code-bg: #0d1117; --code-fg: #e6edf3; --hl-kw: #ff7b72; --hl-str: #a5d6ff; --hl-num: #79c0ff; --hl-fn: #d2a8ff; --hl-cm: #8b949e; --hl-ty: #ffa657; --hl-var: #7ee787; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-doctag, .hljs-meta .hljs-keyword { color: var(--hl-kw); }
.hljs-string, .hljs-regexp, .hljs-meta .hljs-string, .hljs-addition { color: var(--hl-str); }
.hljs-number, .hljs-literal, .hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-selector-attr { color: var(--hl-num); }
.hljs-title, .hljs-title.function_, .hljs-section { color: var(--hl-fn); }
.hljs-comment, .hljs-quote, .hljs-meta { color: var(--hl-cm); font-style: italic; }
.hljs-type, .hljs-title.class_, .hljs-params, .hljs-symbol, .hljs-name { color: var(--hl-ty); }
.hljs-tag, .hljs-selector-class, .hljs-selector-id, .hljs-property { color: var(--hl-var); }
.hljs-deletion { color: var(--hl-kw); }
.hljs-emphasis { font-style: italic; } .hljs-strong { font-weight: 700; }

/* callouts */
.md-callout { --c: var(--accent); border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 8%, transparent); border-radius: 0 8px 8px 0; color: var(--text); padding: 8px 14px; }
.md-callout-title { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--c); margin-bottom: 4px; }
.md-callout > p:last-child { margin-bottom: 0; }
.md-callout-note { --c: #0969da; } .md-callout-tip { --c: #1a7f37; } .md-callout-important { --c: #8250df; }
.md-callout-warning { --c: #9a6700; } .md-callout-caution { --c: #cf222e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .md-callout-note { --c: #4493f8; } :root:not([data-theme="light"]) .md-callout-tip { --c: #3fb950; } :root:not([data-theme="light"]) .md-callout-important { --c: #ab7df8; } :root:not([data-theme="light"]) .md-callout-warning { --c: #d29922; } :root:not([data-theme="light"]) .md-callout-caution { --c: #f85149; } }

/* math, diagrams, footnotes */
.md-math[data-display="1"] { display: block; text-align: center; overflow-x: auto; padding: 6px 0; margin: 0 0 12px; }
.md-mermaid { overflow-x: auto; text-align: center; border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: var(--surface); }
.md-mermaid:not(.rendered) pre { text-align: left; color: var(--muted); }
.md-mermaid svg { max-width: 100%; height: auto; }
.md-error { color: var(--danger); font-size: 12px; text-align: left; }
.markdown .footnotes { margin-top: 20px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.markdown .footnotes h2 { font-size: 13px; border: 0; margin-top: 0; }
.markdown sup a { text-decoration: none; font-weight: 600; }
.comment-body .markdown, .comment-body.markdown { white-space: normal; }

/* ------------------------------------------------------------------ integrations */
.metrics.left dd { text-align: left; font-weight: 500; }
.metrics.left { grid-template-columns: max-content 1fr; }
.actions-row { margin-top: 16px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; line-height: 1.6; }
.steps code, .page-head code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.slack-preview { font-size: 14px; line-height: 1.65; background: var(--surface-2); border-radius: 8px; padding: 12px 14px; border-left: 4px solid #4a154b; }

/* ------------------------------------------------------------------ upcoming tasks */
.up-toolbar { gap: 12px; }
.up-group { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.up-group h2 { display: flex; align-items: center; margin: 0; }
.up-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.up-card { display: flex; flex-direction: column; gap: 8px; color: inherit; }
.up-card:hover { border-color: var(--accent); text-decoration: none; }
.up-title { font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.up-meta { gap: 12px; margin-top: auto; }
.badge.up-draft { background: var(--surface-2); color: var(--muted); }
.badge.up-ready { background: var(--ok-soft); color: var(--ok); }
.badge.up-converted { background: var(--accent-soft); color: var(--accent-text); }
.badge.up-dropped { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.ac-meter { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ac-bar { width: 54px; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.ac-bar i { display: block; height: 100%; background: var(--ok); }
.refs { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ref-rows { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.ref-rows:empty { display: none; }
.ref-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; gap: 6px; align-items: center; }
.ref-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ref-list li { display: flex; flex-direction: column; overflow-wrap: anywhere; }
@media (max-width: 600px) { .ref-row { grid-template-columns: 1fr auto; } .ref-row input:first-child { grid-column: 1 / -1; } }

/* ------------------------------------------------------------------ releases */
.rel-section { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.rel-section h2 { display: flex; align-items: center; margin: 0; }
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rel-card { display: flex; flex-direction: column; gap: 6px; color: inherit; }
.rel-card:hover { border-color: var(--accent); text-decoration: none; }
.rel-name { font: 700 16px ui-monospace, SFMono-Regular, Menlo, monospace; }
.rel-meta { gap: 10px; margin-top: 4px; }
.badge.rel-released { background: var(--ok-soft); color: var(--ok); }
.badge.rel-planned { background: var(--accent-soft); color: var(--accent-text); }
.badge.rel-chip { background: var(--surface-2); color: var(--text); text-decoration: none; }
.badge.rel-chip:hover { background: var(--accent-soft); }
.warn-text { color: var(--warn); }
.rel-type h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 18px 4px; }
.pick-list { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.pick-row, .pick-all { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: normal; }
.pick-all { background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.pick-row:last-child { border-bottom: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ------------------------------------------------------------------ overlap warnings */
.overlap-note {
  border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--border)); background: var(--warn-soft);
  border-radius: 8px; padding: 10px 12px; font-size: 13px;
}
.overlap-note strong { display: block; margin-bottom: 6px; color: var(--warn); }
.overlap-note ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.overlap-note li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.overlap-note.compact { padding: 8px 10px; font-size: 12px; width: 100%; }
.clash-slot:empty { display: none; }
.clash-slot { width: 100%; }

/* ------------------------------------------------------------------ gantt / timeline */
.tl-range { font-size: 13px; margin-left: 6px; white-space: nowrap; }
.gantt-toolbar { padding: 10px 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.gantt-toolbar > .row { gap: 10px; }
.chips.seg { gap: 0; }
.chips.seg .chip { border-radius: 0; margin-left: -1px; }
.chips.seg .chip:first-child { border-radius: 999px 0 0 999px; margin-left: 0; }
.chips.seg .chip:last-child { border-radius: 0 999px 999px 0; }
.chips.seg .chip[aria-pressed="true"] { position: relative; z-index: 1; }

.gantt { --g-left: 430px; --g-row: 34px; position: relative; }
.g-scroll { overflow: auto; max-height: calc(100vh - 250px); min-height: 240px; }
.g-grid { width: calc(var(--g-left) + var(--g-width)); position: relative; }
.g-header { position: sticky; top: 0; z-index: 6; display: flex; background: var(--surface); border-bottom: 1px solid var(--border); }
.g-left {
  width: var(--g-left); flex: none; position: sticky; left: 0; z-index: 4; background: var(--surface);
  display: flex; align-items: center; gap: 8px; padding: 0 12px; border-right: 1px solid var(--border); min-width: 0;
}
.g-left-head { z-index: 7; align-items: flex-end; padding-bottom: 8px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.c-key { width: 64px; flex: none; }
.c-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.c-date { width: 54px; flex: none; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.c-dur { width: 34px; flex: none; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.g-scale { position: relative; }
.g-tier { position: relative; }
.g-tier span { position: absolute; top: 0; overflow: hidden; white-space: nowrap; }
.g-tier.top { height: 24px; border-bottom: 1px solid var(--border); }
.g-tier.top span { height: 24px; line-height: 24px; padding-left: 8px; font-size: 12px; font-weight: 600; border-left: 1px solid var(--border); }
.g-tier span em { font-style: normal; }
/* keep the month / year name visible while scrolling through it */
.g-tier.top span { overflow: visible; }
.g-tier.top span em { position: sticky; left: calc(var(--g-left) + 8px); }
.g-tier.bottom { height: 30px; }
.g-tier.bottom span { height: 30px; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); border-left: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.g-tier.bottom span.day { flex-direction: column; line-height: 1.1; }
.g-tier.bottom span.day b { font-weight: 600; color: var(--text); font-size: 12px; }
.g-tier.bottom span.day i { font-style: normal; font-size: 10px; }
.g-tier.bottom span.we { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.g-tier.bottom span.we b { color: var(--muted); }
.g-tier.bottom span.is-today b { color: #fff; background: var(--accent); border-radius: 999px; padding: 1px 6px; }
.g-tier.milestones { height: 22px; border-top: 1px solid var(--border); }
.g-milestone { position: absolute; top: 3px; display: flex; align-items: center; gap: 4px; transform: translateX(-7px); font-size: 11px; color: var(--text); white-space: nowrap; text-decoration: none !important; }
.g-milestone i { width: 12px; height: 12px; transform: rotate(45deg); background: var(--accent); border-radius: 2px; flex: none; }
.g-milestone.released i { background: var(--ok); }
.g-milestone span { font-weight: 600; margin-left: 7px; }

.g-body { position: relative; }
.g-bg-wrap { position: absolute; top: 0; bottom: 0; left: var(--g-left); pointer-events: none; z-index: 0; }
.g-bg { position: relative; height: 100%; }
.g-bg .we { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.g-bg .line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); }
.g-bg .mline { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); }
.g-bg .mline.released { border-left-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.g-bg .today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); }
.g-bg .today em { position: absolute; top: 2px; left: 4px; font-style: normal; font-size: 10px; font-weight: 700; color: var(--accent); white-space: nowrap; }

.g-row { display: flex; height: var(--g-row); border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.g-row:hover > .g-left, .g-row:hover > .g-right { background-color: color-mix(in srgb, var(--accent-soft) 35%, transparent); }
.g-row:hover > .g-left { background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface)); }
.g-row .g-left { font-size: 13px; }
.g-row .c-key { font-size: 11px; }
.g-right { position: relative; z-index: 1; }
.g-group { height: 40px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.g-group > .g-left { background: var(--surface-2); cursor: pointer; font-weight: 600; }
.g-group:hover > .g-left { background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface-2)); }
.g-toggle { border: 0; background: none; color: var(--muted); cursor: pointer; width: 18px; padding: 0; font-size: 12px; }
.g-gname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-stats { font-weight: 400; margin-left: auto; white-space: nowrap; }
.g-heat { position: absolute; left: 0; right: 0; top: 12px; height: 16px; }
.g-heat span { position: absolute; top: 0; height: 16px; border-right: 1px solid var(--surface-2); }
.g-heat .h1 { background: color-mix(in srgb, var(--ok) 35%, transparent); }
.g-heat .h2 { background: color-mix(in srgb, var(--warn) 55%, transparent); }
.g-heat .h3 { background: color-mix(in srgb, var(--danger) 70%, transparent); }
.g-collapsed-note { position: absolute; top: 12px; pointer-events: none; }
.g-unsched { height: 28px; }
.g-unsched .g-left { font-size: 12px; }

.g-bar {
  position: absolute; top: 6px; height: calc(var(--g-row) - 12px); border-radius: 6px; overflow: hidden;
  background: color-mix(in srgb, var(--dot) 22%, var(--surface)); border: 1px solid color-mix(in srgb, var(--dot) 65%, transparent);
  text-decoration: none !important; touch-action: none; user-select: none;
}
.g-bar .g-fill { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--dot) 70%, transparent); }
.g-bar.status-blocked { background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--dot) 25%, transparent) 0 6px, transparent 6px 12px); }
.g-bar.est { border-left: 2px dashed var(--muted); }
.g-bar.clash { box-shadow: 0 0 0 2px var(--danger); }
.g-bar.overdue { border-color: var(--danger); }
.g-bar.finished { opacity: .5; }
.g-bar.cl { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-width: 0; }
.g-bar.cr { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.g-bar.movable { cursor: grab; }
.g-bar.dragging { cursor: grabbing; box-shadow: var(--shadow-lg); z-index: 5; opacity: .9; }
.g-bar:hover { filter: brightness(1.04); z-index: 3; }
.g-handle { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 1; }
.g-handle.l { left: 0; }
.g-handle.r { right: 0; }
.g-bar.movable:hover .g-handle { background: color-mix(in srgb, var(--dot) 45%, transparent); }
.g-label { position: absolute; top: 0; height: var(--g-row); display: flex; align-items: center; gap: 2px; font-size: 12px; white-space: nowrap; pointer-events: none; }
.g-label b { font: 600 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.g-clash { color: var(--danger); font-size: 12px; }

.g-tip {
  position: fixed; z-index: 300; width: 270px; pointer-events: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 12px;
}
.g-tip-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.g-tip-head b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.g-tip-title { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.g-tip dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; }
.g-tip dt { color: var(--muted); }
.g-tip dd { margin: 0; }
.g-tip-warn { margin-top: 8px; color: var(--danger); font-weight: 600; }
.g-tip-hint { margin-top: 6px; color: var(--muted); }

.g-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 14px; border-top: 1px solid var(--border); }
.g-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg:not(.avatar) { display: inline-block; width: 20px; height: 10px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--border); }
.lg.bar { background: linear-gradient(90deg, color-mix(in srgb, var(--st-in_progress) 70%, transparent) 55%, color-mix(in srgb, var(--st-in_progress) 22%, var(--surface)) 55%); border-color: var(--st-in_progress); }
.lg.clash { box-shadow: 0 0 0 2px var(--danger); }
.lg.heat { width: 36px; border: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--ok) 35%, transparent) 33%, color-mix(in srgb, var(--warn) 55%, transparent) 33% 66%, color-mix(in srgb, var(--danger) 70%, transparent) 66%); }
.lg.est { border-left: 2px dashed var(--muted); }
.lg.ms { width: 10px; height: 10px; transform: rotate(45deg); background: var(--accent); border: 0; border-radius: 2px; }

@media (max-width: 900px) {
  .gantt { --g-left: 240px; }
  .gantt .c-date, .gantt .c-dur { display: none; }
}
@media (max-width: 600px) {
  .gantt { --g-left: 150px; }
  .gantt .c-key { display: none; }
  .g-stats { display: none; }
}

.overlap-count {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font-size: 12px; color: var(--warn); background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--border)); border-radius: 6px; padding: 2px 8px;
}
.overlap-count strong { font-weight: 700; }
.overlap-count .link { font-weight: 600; }

/* ------------------------------------------------------------------ board (kanban) */
.board-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.board-search { flex: 0 1 240px; }
.person-filters { display: flex; align-items: center; }
.person-filter {
  border: 0; background: none; padding: 0; margin-left: -4px; cursor: pointer; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--bg); transition: transform .1s;
}
.person-filter:first-child { margin-left: 0; }
.person-filter:hover { transform: translateY(-2px); z-index: 1; }
.person-filter[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); z-index: 2; }
.person-filter .avatar { width: 28px; height: 28px; font-size: 11px; }
.board-hint { margin-left: auto; }

.board {
  display: flex; gap: 12px; align-items: flex-start;
  overflow-x: auto; padding-bottom: 10px; margin-top: 4px;
  scroll-snap-type: x proximity;
}
.column {
  flex: 0 0 280px; width: 280px; scroll-snap-align: start;
  display: flex; flex-direction: column; max-height: calc(100vh - 290px); min-height: 160px;
  background: var(--surface-2); border-radius: 12px; border: 2px solid transparent;
  transition: border-color .12s, background .12s;
}
.column.drop { border-color: var(--accent); border-style: dashed; background: var(--accent-soft); }
.col-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px;
  font-weight: 600; font-size: 13px; position: sticky; top: 0;
}
.col-name { white-space: nowrap; }
.col-count {
  margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--surface); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums;
}
.col-release { width: 26px; height: 26px; font-size: 13px; }
.col-body { display: flex; flex-direction: column; gap: 8px; padding: 2px 8px 10px; overflow-y: auto; min-height: 60px; }
.col-body > * { flex: 0 0 auto; } /* cards keep their height; the column scrolls instead */
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dot); flex: none; }
.col-empty {
  border: 1px dashed var(--border); border-radius: 8px; padding: 18px 8px;
  text-align: center; font-size: 12px; color: var(--muted);
}
.col-more { display: block; text-align: center; font-size: 12px; padding: 4px; }
.col-add {
  border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; text-align: left;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.col-add:hover { background: var(--surface); color: var(--text); }

.ticket-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px 10px 14px; color: inherit; text-decoration: none !important;
  box-shadow: var(--shadow); cursor: grab; overflow: hidden;
}
/* priority stripe on the left edge */
.ticket-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--pc, var(--border)); }
.prio-edge-low { --pc: var(--pr-low); }
.prio-edge-medium { --pc: var(--pr-medium); }
.prio-edge-high { --pc: var(--pr-high); }
.prio-edge-critical { --pc: var(--pr-critical); }
.ticket-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: 0 4px 14px rgba(16, 24, 40, .1); }
.ticket-card:active { cursor: grabbing; }
.ticket-card.is-dragging { opacity: .4; }
.tc-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tc-top .key { font-size: 11px; }
.tc-top .type { font-size: 10px; padding: 1px 5px; }
.tc-flag { font-size: 11px; color: var(--warn); font-weight: 600; }
.tc-prio { margin-left: auto; flex: none; }
.tc-prio .prio { font-size: 11px; }
.tc-title {
  margin: 0; font-weight: 500; font-size: 14px; line-height: 1.4; color: var(--text);
  overflow-wrap: anywhere; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.tc-meta { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.tc-foot > .avatar { flex: none; }
.chip-due {
  display: inline-flex; align-items: center; gap: 2px; white-space: nowrap;
  font-size: 11px; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 2px 6px;
}
.chip-due.soon { color: var(--warn); background: var(--warn-soft); }
.chip-due.overdue { color: var(--danger); background: var(--danger-soft); font-weight: 600; }
.tc-time { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tc-bar { width: 36px; height: 4px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.tc-bar i { display: block; height: 100%; background: var(--ok); }
.tc-bar i.over { background: var(--danger); }

@media (max-width: 600px) {
  .column { flex-basis: 82vw; width: 82vw; max-height: none; }
  .board-hint { display: none; }
  .board-search { flex: 1 1 100%; }
}

/* ------------------------------------------------------------------ documentation */
.docs-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.docs-side { position: sticky; top: 72px; max-height: calc(100vh - 96px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.docs-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.doc-tree-project + .doc-tree-project { margin-top: 6px; border-top: 1px solid var(--border); padding-top: 6px; }
.doc-tree-head { display: flex; align-items: center; gap: 6px; padding: 4px 4px; font-weight: 600; font-size: 13px; }
.doc-tree-head .key-pill { margin-right: 0; }
.doc-tree-list { list-style: none; margin: 0; padding: 0; }
.doc-tree-item { display: flex; align-items: center; gap: 2px; padding: 5px 8px; border-radius: 6px; color: var(--text); font-size: 13px; text-decoration: none !important; min-width: 0; }
.doc-tree-item:hover { background: var(--surface-2); }
.doc-tree-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.doc-twisty { border: 0; background: none; color: var(--muted); width: 16px; flex: none; cursor: pointer; padding: 0; font-size: 11px; }
.doc-twisty-gap { width: 16px; flex: none; }
.doc-tree-empty { padding: 2px 28px 6px; margin: 0; }
.doc-search-row .doc-search { width: 100%; font-size: 15px; padding: 10px 14px; }
.doc-results { list-style: none; margin: 0; padding: 0; }
.doc-results li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.doc-results li:last-child { border-bottom: 0; }
.doc-results p { margin: 4px 0 0; }
.doc-page { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.doc-title { font-size: 28px; line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.doc-meta { display: flex; align-items: center; gap: 8px; }
.doc-body { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 16px; align-items: start; }
.doc-body:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.doc-article { padding: 24px 28px; }
.doc-article .markdown { font-size: 15px; }
.doc-toc { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; border-left: 2px solid var(--border); padding-left: 10px; max-height: calc(100vh - 100px); overflow-y: auto; }
.doc-toc-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.doc-toc a { color: var(--muted); padding: 2px 0; text-decoration: none; }
.doc-toc a:hover { color: var(--accent); }
.doc-toc a.toc-h2 { padding-left: 10px; }
.doc-toc a.toc-h3 { padding-left: 20px; }
.doc-children h2 { margin-bottom: 10px; }
.doc-child-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.doc-child { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; color: inherit; text-decoration: none !important; }
.doc-child:hover { border-color: var(--accent); }
.doc-edit-head { display: flex; gap: 12px; align-items: center; }
.doc-title-input { flex: 1; font-size: 22px; font-weight: 700; padding: 8px 12px; }
.doc-edit-meta { gap: 16px; }
.doc-editing .md-editor textarea.md-input { min-height: 420px; }
.doc-editing .md-editor[data-mode="split"] .md-preview { max-height: 640px; }
.doc-history { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.doc-rev-list { display: flex; flex-direction: column; }
.doc-rev { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; font: inherit; border: 0; border-bottom: 1px solid var(--border); background: none; padding: 10px 14px; cursor: pointer; color: inherit; }
.doc-rev:hover { background: var(--surface-2); }
.doc-rev.active { background: var(--accent-soft); }
.doc-rev-view .doc-title { font-size: 22px; margin-bottom: 10px; }
@media (max-width: 1100px) { .doc-body { grid-template-columns: minmax(0, 1fr); } .doc-toc { display: none; } }
@media (max-width: 900px) {
  .docs-layout, .doc-history { grid-template-columns: minmax(0, 1fr); }
  .docs-side { position: static; max-height: 260px; }
  .doc-article { padding: 16px; }
}

/* ------------------------------------------------------------------ dashboard */
:root { --series-1: #2a78d6; --series-2: #eb6834; --grid: #eceef2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --series-1: #3987e5; --series-2: #d95926; --grid: #262b35; } }
:root[data-theme="dark"] { --series-1: #3987e5; --series-2: #d95926; --grid: #262b35; }

.dash-body { display: flex; flex-direction: column; gap: 18px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; color: inherit; text-decoration: none !important;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
a.kpi:hover { border-color: var(--accent); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--kpi-edge, transparent); }
.kpi.danger { --kpi-edge: var(--danger); } .kpi.warn { --kpi-edge: var(--warn); } .kpi.good { --kpi-edge: var(--ok); } .kpi.accent { --kpi-edge: var(--accent); }
.kpi.danger .kpi-value { color: var(--danger); }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-hint { font-size: 12px; color: var(--muted); }
.kpi-delta { font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.kpi-delta.good { color: var(--ok); } .kpi-delta.bad { color: var(--danger); } .kpi-delta.neutral { color: var(--muted); }
.c-spark { width: 96px; height: 28px; flex: none; }
.c-spark-line { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dash-grid.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dash-stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.dash-sub { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; }
.card-head p { margin: 2px 0 0; }
.mix-total { margin-bottom: 10px; }
.mix-total .kpi-value { font-size: 24px; }
.prio-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.prio-bars li { display: grid; grid-template-columns: 82px 1fr 28px; align-items: center; gap: 8px; font-size: 13px; }
.prio-bars strong { text-align: right; font-variant-numeric: tabular-nums; }
.prio-track { height: 10px; background: var(--surface-2); border-radius: 0 4px 4px 0; overflow: hidden; }
.prio-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--pc); min-width: 0; }

/* charts */
.chart { position: relative; }
.c-svg { width: 100%; height: auto; display: block; overflow: visible; }
.c-grid { stroke: var(--grid); stroke-width: 1; }
.c-axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.c-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-area { opacity: .1; }
.c-dot { stroke: var(--surface); stroke-width: 2; }
.c-cross { stroke: var(--muted); stroke-width: 1; opacity: .6; }
.c-hit { fill: transparent; cursor: crosshair; }
.c-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.c-legend span { display: inline-flex; align-items: center; gap: 6px; }
.c-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-tip {
  position: fixed; z-index: 400; pointer-events: none; min-width: 140px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 12px;
}
.chart-tip-head { font-weight: 600; margin-bottom: 4px; }
.chart-tip-row { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; }
.chart-tip-row i { width: 10px; height: 10px; border-radius: 3px; }
.chart-tip-row strong { font-variant-numeric: tabular-nums; }

/* stacked bars (workload) */
.c-bars { display: flex; flex-direction: column; gap: 4px; }
.c-bar-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 34px; }
.c-bar-label { min-width: 0; overflow: hidden; }
.c-bar-label .user-chip { color: var(--text); text-decoration: none; }
.c-bar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.c-bar { display: flex; gap: 2px; height: 16px; min-width: 4px; }
.c-seg { display: block; height: 100%; min-width: 3px; cursor: default; }
.c-seg:last-child { border-radius: 0 4px 4px 0; }
.c-bar-value { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.c-bar-extra { display: flex; gap: 8px; align-items: center; white-space: nowrap; }

/* lists */
.due-list { list-style: none; margin: 0; padding: 0 0 6px; }
.due-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 18px; border-top: 1px solid var(--border); }
.due-main { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); text-decoration: none !important; }
.due-main:hover .ellipsis, .due-main:hover strong { color: var(--accent); }
.due-meta { display: flex; align-items: center; gap: 8px; flex: none; }
.feed { list-style: none; margin: 0; padding: 0 0 6px; }
.feed-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 18px; border-top: 1px solid var(--border); font-size: 13px; }
.feed-body { min-width: 0; }
.feed-body .badge { font-size: 11px; padding: 2px 6px; }
.feed-time { white-space: nowrap; }
@media (max-width: 1000px) { .dash-grid, .dash-grid.even { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .c-bar-row { grid-template-columns: 110px minmax(0, 1fr); } .c-bar-extra { grid-column: 2; } .kpi-value { font-size: 24px; } }

:root[data-theme="dark"] .md-callout-note { --c: #4493f8; } :root[data-theme="dark"] .md-callout-tip { --c: #3fb950; }
:root[data-theme="dark"] .md-callout-important { --c: #ab7df8; } :root[data-theme="dark"] .md-callout-warning { --c: #d29922; }
:root[data-theme="dark"] .md-callout-caution { --c: #f85149; }
.menu-theme { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-theme .chip { font-size: 12px; padding: 3px 9px; }
.theme-btn { font-size: 15px; }

/* ------------------------------------------------------------------ advanced ticket table */
.list-search { flex: 1 1 280px; }
.filters-card .chips .chip { display: inline-flex; align-items: center; gap: 6px; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.list-tools { gap: 8px; }
.list-tools select { padding: 4px 8px; font-size: 13px; }
.list-summary { font-weight: 600; }
.col-menu { min-width: 230px; max-height: 70vh; overflow-y: auto; }
.col-option { display: flex; padding: 6px 10px; border-radius: 6px; font-size: 13px; }
.col-option:hover { background: var(--surface-2); }
.view-row { display: flex; align-items: center; gap: 4px; }
.view-apply { flex: 1; text-align: left; font: inherit; color: inherit; background: none; border: 0; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.view-apply:hover { background: var(--surface-2); }

.bulk-bar {
  position: sticky; top: 64px; z-index: 15; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: var(--shadow);
}
.bulk-bar select { padding: 4px 8px; font-size: 13px; }
.bulk-assign { width: 200px; }
.bulk-assign input { padding: 4px 8px; font-size: 13px; }

.tl-table-box { transition: opacity .15s; }
.tl-table-box.is-loading { opacity: .55; pointer-events: none; }
.adv-wrap { max-height: calc(100vh - 230px); overflow: auto; }
.adv-table { min-width: 760px; }
.adv-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); box-shadow: inset 0 -1px 0 var(--border); border-bottom: 0; }
.adv-table th.col-check, .adv-table td.col-check { width: 36px; padding-right: 0; }
.adv-table td, .adv-table th { white-space: nowrap; }
.adv-table td.col-title { max-width: 420px; overflow: hidden; }
.adv-table .title-cell { min-width: 200px; }
.adv-table .title-cell .ellipsis { white-space: nowrap; }
.adv-table td.col-key { white-space: nowrap; }
.adv-table td.col-key .key { color: var(--accent); }
.adv-table td.col-project { white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.adv-table tbody tr.is-selected td { background: color-mix(in srgb, var(--accent-soft) 70%, transparent); }
.adv-table.compact td { padding-top: 5px; padding-bottom: 5px; font-size: 13px; }
.adv-table.compact th { padding-top: 7px; padding-bottom: 7px; }
.adv-table.compact .avatar.sm { width: 18px; height: 18px; font-size: 9px; }
th.sortable { padding: 0; }
.th-sort {
  display: inline-flex; align-items: center; gap: 4px; width: 100%; padding: 10px 14px; font: inherit; font-weight: 600;
  color: inherit; background: none; border: 0; cursor: pointer; white-space: nowrap; text-align: left;
}
.adv-table.compact .th-sort { padding: 7px 14px; }
.th-sort:hover { color: var(--text); }
.sort-ind { opacity: .35; font-size: 11px; }
th.sorted { color: var(--text); }
th.sorted .sort-ind { opacity: 1; color: var(--accent); }
.status-trigger { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; padding: 0; cursor: pointer; border-radius: 999px; }
.status-trigger .caret { font-size: 10px; color: var(--muted); opacity: 0; transition: opacity .1s; }
tr:hover .status-trigger .caret, .status-trigger:focus-visible .caret { opacity: 1; }
.status-pop { display: block; position: fixed; z-index: 200; min-width: 170px; }
.status-pop button { display: flex; align-items: center; gap: 8px; }
.status-pop button:disabled { opacity: .45; cursor: default; }
.group-row td { background: var(--surface-2); cursor: pointer; font-size: 13px; padding-top: 7px; padding-bottom: 7px; }
.group-row td > * { vertical-align: middle; }
.group-row .g-caret { display: inline-block; width: 16px; color: var(--muted); }
.group-row .status-dot, .group-row .avatar { display: inline-block; margin-right: 6px; }
.group-row:hover td { background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface-2)); }
.group-note { border-top: 1px solid var(--border); margin: 0; }
@media (max-width: 700px) { .bulk-bar { top: 56px; } .bulk-assign { width: 100%; } .list-toolbar { align-items: flex-start; } }

/* ======================================================================================
   DESIGN SYSTEM v2 - typography, tokens, shell, controls. Loaded last so it wins.
   ====================================================================================== */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/vendor/inter/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/vendor/inter/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/vendor/inter/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/vendor/inter/inter-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #f7f8fa; --surface: #ffffff; --surface-2: #f2f4f7; --surface-3: #e9ecf1;
  --border: #e4e7ec; --border-strong: #d0d5dd;
  --text: #101828; --text-2: #344054; --muted: #667085;
  --accent: #4f46e5; --accent-hover: #4338ca; --accent-soft: #eef0ff; --accent-text: #3730a3;
  --radius: 12px; --radius-sm: 8px; --radius-xs: 6px;
  --ctl-h: 36px; --ctl-h-sm: 30px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, .08), 0 2px 4px -2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 16px 32px -8px rgba(16, 24, 40, .18), 0 4px 8px -4px rgba(16, 24, 40, .06);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  --sidebar-w: 248px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d12; --surface: #13161d; --surface-2: #1a1e27; --surface-3: #232836;
    --border: #252a36; --border-strong: #343b4b;
    --text: #e8eaef; --text-2: #c5cad3; --muted: #8a93a6;
    --accent: #8188f8; --accent-hover: #9aa0fa; --accent-soft: #1f2245; --accent-text: #c3c6ff;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 3px rgba(0, 0, 0, .45); --shadow-md: 0 4px 10px rgba(0, 0, 0, .45);
    --shadow-lg: 0 18px 40px -8px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d12; --surface: #13161d; --surface-2: #1a1e27; --surface-3: #232836;
  --border: #252a36; --border-strong: #343b4b;
  --text: #e8eaef; --text-2: #c5cad3; --muted: #8a93a6;
  --accent: #8188f8; --accent-hover: #9aa0fa; --accent-soft: #1f2245; --accent-text: #c3c6ff;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 3px rgba(0, 0, 0, .45); --shadow-md: 0 4px 10px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 40px -8px rgba(0, 0, 0, .7);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; line-height: 1.5; letter-spacing: -0.006em;
  font-feature-settings: "cv11", "ss01", "ss03"; text-rendering: optimizeLegibility;
}
h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.022em; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.ic { flex: none; vertical-align: middle; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-xs); }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
  font: 500 11px/1 "Inter", system-ui, sans-serif; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px;
}
kbd + kbd { margin-left: 3px; }

/* ---------- controls */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select {
  height: var(--ctl-h); border-radius: var(--radius-sm); border-color: var(--border-strong); background: var(--surface);
  padding: 0 11px; font-size: 14px; box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s;
}
textarea { border-radius: var(--radius-sm); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
input:hover:not(:focus):not(:disabled), select:hover:not(:focus):not(:disabled), textarea:hover:not(:focus) { border-color: color-mix(in srgb, var(--muted) 55%, var(--border-strong)); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--ring); }
input:disabled, select:disabled { opacity: .6; cursor: not-allowed; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.list-tools select, .bulk-bar select, .board-toolbar select { height: var(--ctl-h-sm); font-size: 13px; padding: 0 30px 0 10px; }
input[type="checkbox"] { width: 16px; height: 16px; border-radius: 4px; cursor: pointer; }
.md-editor textarea.md-input, .md-editor textarea.md-input:focus { box-shadow: none; }
.field-label { font-size: 13px; font-weight: 500; color: var(--text-2); }

.btn {
  height: var(--ctl-h); padding: 0 14px; gap: 6px; border-radius: var(--radius-sm); font-weight: 500; font-size: 14px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-xs);
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: var(--ctl-h-sm); padding: 0 10px; font-size: 13px; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.primary:hover { background: var(--accent-hover); filter: none; }
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .btn.primary:hover { color: #0b0d12; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary, :root:not([data-theme="light"]) .btn.primary:hover { color: #0b0d12; } }
.btn.danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn.ghost { box-shadow: none; border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.ghost.danger { color: var(--danger); }
.btn.ghost.danger:hover { background: var(--danger-soft); }
.btn.success { box-shadow: var(--shadow-xs); }
.icon-btn { width: 34px; height: 34px; border-radius: var(--radius-sm); color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.link { font-weight: 500; }

/* ---------- surfaces */
.card { border-radius: var(--radius); border-color: var(--border); box-shadow: var(--shadow-xs); }
.card-head h2 { font-size: 15px; }
.page-head { align-items: center; padding-bottom: 2px; }
.page-head h1 + p, .page-head .muted { margin-top: 4px; }
.page-head .actions { gap: 8px; }
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); text-decoration: none; }

.tabs { gap: 2px; border-bottom-color: var(--border); }
.tabs a, .tabs button { font-size: 14px; padding: 10px 12px; color: var(--muted); border-bottom-width: 2px; }
.tabs .active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.table th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface); letter-spacing: 0; }
.table td { border-bottom-color: var(--border); color: var(--text-2); }
.table tbody tr { transition: background .08s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }

.badge { border-radius: var(--radius-xs); font-size: 12px; font-weight: 500; padding: 3px 8px; line-height: 16px; }
.type { border-radius: 5px; font-size: 10.5px; letter-spacing: .04em; padding: 2px 6px; }
.key { color: var(--muted); }
.chip { height: 28px; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; border-color: var(--border-strong); color: var(--text-2); }
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-text); }

.menu { border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; border-color: var(--border); }
.menu > button, .menu .view-apply { display: flex; align-items: center; gap: 10px; border-radius: var(--radius-xs); padding: 8px 10px; font-size: 14px; color: var(--text-2); }
.menu > button:hover { background: var(--surface-2); color: var(--text); }
.menu > button .ic { color: var(--muted); }
.menu-kbd { margin-left: auto; }

.empty { padding: 44px 20px; }
.empty-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); color: var(--muted); margin-bottom: 12px; }
.empty strong { font-size: 15px; }
.empty p { margin: 4px auto 14px; max-width: 360px; }

.skeleton-block { display: flex; flex-direction: column; gap: 12px; padding: 22px; }
.skeleton {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ---------- modal + toasts */
.backdrop { background: rgba(10, 12, 18, .5); backdrop-filter: blur(2px); padding-top: 10vh; }
.modal { border-radius: 14px; border-color: var(--border); box-shadow: var(--shadow-lg); }
.modal header { padding: 16px 20px 14px; border-bottom: 1px solid var(--border); }
.modal header h2 { font-size: 16px; }
.modal-body { padding: 18px 20px 20px; }
.form-actions { margin-top: 6px; }

#toasts { bottom: 20px; right: 20px; gap: 10px; }
.toast {
  display: flex; align-items: flex-start; gap: 10px; min-width: 280px; max-width: 420px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 12px 12px 12px 14px; font-size: 13.5px;
  animation: toast-in .2s ease-out; transition: opacity .2s, transform .2s;
}
.toast.error { background: var(--surface); color: var(--text); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.toast-icon { margin-top: 1px; color: var(--ok); }
.toast.error .toast-icon { color: var(--danger); }
.toast-text { flex: 1; }
.toast-close { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 5px; display: inline-grid; }
.toast-close:hover { background: var(--surface-2); color: var(--text); }
.toast.out { opacity: 0; transform: translateX(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- shell */
.shell { grid-template-columns: var(--sidebar-w) 1fr; }
body.nav-collapsed { --sidebar-w: 64px; }
.sidebar { padding: 12px 10px; gap: 6px; background: var(--surface); border-right-color: var(--border); }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 2px 4px 6px; }
.brand { padding: 0 4px; gap: 10px; font-size: 15px; font-weight: 650; letter-spacing: -0.02em; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #a855f7)); color: #fff; }
.collapse-btn { width: 28px; height: 28px; }
body.nav-collapsed .collapse-btn .ic { transform: rotate(180deg); }
.sidebar-search {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; margin-bottom: 6px;
  font: inherit; font-size: 13.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.sidebar-search:hover { color: var(--text); border-color: var(--border-strong); }
.sidebar-search .kbd-hint { margin-left: auto; display: inline-flex; }
.nav { gap: 14px; overflow-y: auto; flex: 1; margin: 0 -2px; padding: 0 2px; }
.nav-section { display: flex; flex-direction: column; gap: 1px; }
.nav-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 10px 4px; }
.nav a.nav-link { position: relative; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: var(--text-2); }
.nav a.nav-link .ic { color: var(--muted); }
.nav a.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav a.nav-link.active { background: var(--accent-soft); color: var(--accent-text); }
.nav a.nav-link.active .ic { color: var(--accent); }
.nav-badge { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; }
.nav-badge[hidden] { display: none; }
.sidebar-foot { margin-top: 4px; padding: 6px 0 0; border-top: 1px solid var(--border); }
.account { width: 100%; }
.account-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; background: none; border-radius: var(--radius-sm); cursor: pointer; font: inherit; color: inherit; text-align: left; }
.account-btn:hover { background: var(--surface-2); }
.account-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.account-text strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-text span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-caret { color: var(--muted); }
.account .account-menu { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; width: 280px; }
.menu-theme .chip { height: 26px; gap: 4px; }
body.nav-collapsed .nav-text, body.nav-collapsed .brand-text, body.nav-collapsed .nav-title, body.nav-collapsed .account-text,
body.nav-collapsed .account-caret, body.nav-collapsed .kbd-hint { display: none; }
body.nav-collapsed .sidebar-top { flex-direction: column; }
body.nav-collapsed .nav a.nav-link, body.nav-collapsed .sidebar-search, body.nav-collapsed .account-btn { justify-content: center; padding-left: 0; padding-right: 0; }
body.nav-collapsed .nav-badge { position: absolute; top: 2px; right: 6px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }

.topbar { height: 56px; padding: 0 24px; gap: 12px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom-color: var(--border); }
.top-search {
  display: flex; align-items: center; gap: 10px; flex: 0 1 420px; height: 36px; padding: 0 10px 0 12px;
  font: inherit; font-size: 14px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs); cursor: pointer; text-align: left;
}
.top-search:hover { border-color: var(--border-strong); color: var(--text-2); }
.top-search > span:not(.kbd-hint) { flex: 1; }
.top-search .kbd-hint { display: inline-flex; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topbar-actions .new-btn { margin-right: 6px; }
.topbar .dropdown:first-of-type { margin-left: 0; }
.bell .count { top: 3px; right: 3px; box-shadow: 0 0 0 2px var(--surface); }
main { padding: 28px 32px 56px; gap: 20px; max-width: 1360px; }

/* ---------- command palette */
.pal-backdrop { position: fixed; inset: 0; z-index: 500; background: rgba(10, 12, 18, .45); backdrop-filter: blur(2px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fade .12s ease-out; }
.pal { width: 100%; max-width: 640px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; animation: rise .14s ease-out; }
.pal-search { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.pal-search .pal-input, .pal-search .pal-input:focus { flex: 1; height: 54px; border: 0; box-shadow: none; padding: 0; font-size: 16px; background: transparent; }
.pal-list { overflow-y: auto; padding: 6px; flex: 1; }
.pal-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 10px 4px; }
.pal-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-2); font-size: 14px; }
.pal-item .ic { color: var(--muted); }
.pal-item.active { background: var(--accent-soft); color: var(--text); }
.pal-item.active .ic { color: var(--accent); }
.pal-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-sub { color: var(--muted); font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.pal-hint { margin-left: auto; display: inline-flex; }
.pal-empty { padding: 28px; text-align: center; color: var(--muted); }
.pal-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); background: var(--surface-2); }
.pal-foot span { display: inline-flex; align-items: center; gap: 4px; }
.shortcuts { display: flex; flex-direction: column; }
.shortcut-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 14px; }
.shortcut-row:last-child { border-bottom: 0; }
.shortcut-keys { display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- login */
.login { background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%), var(--bg); }
.login-card { max-width: 400px; padding: 36px 32px; border-radius: 16px; gap: 14px; box-shadow: var(--shadow-lg); }
.login-card .brand { flex-direction: column; gap: 14px; font-size: 20px; margin-bottom: 0; }
.login-card .logo { width: 44px; height: 44px; border-radius: 12px; font-size: 20px; }
.login-card p.muted { margin-top: -6px; }
.login-card .btn.block { height: 40px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  body.nav-collapsed { --sidebar-w: 248px; }
  body.nav-collapsed .nav-text, body.nav-collapsed .brand-text, body.nav-collapsed .nav-title, body.nav-collapsed .account-text { display: revert; }
  .collapse-btn { display: none; }
  .sidebar { width: 264px; }
  .topbar { padding: 0 14px; }
  .top-search { flex: 1; }
  .top-search .kbd-hint, .topbar-actions .new-btn span { display: none; }
  .topbar-actions .new-btn { width: 34px; padding: 0; justify-content: center; }
  main { padding: 18px 16px 40px; }
}
.ic-count, .chip-due, .tag, .badge, .rel-chip { display: inline-flex; align-items: center; gap: 4px; }
.btn .ic, .chip .ic { margin: 0 -1px; }

/* polish fixes */
.status-select {
  background-image: radial-gradient(circle at 14px 50%, var(--dot) 4.5px, transparent 5px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: 0 0, right 10px center; background-size: auto, 16px; background-repeat: no-repeat; padding-left: 28px;
}
main:focus, main:focus-visible { box-shadow: none; outline: none; }
.menu-theme { flex-direction: column; align-items: stretch; gap: 6px; }
.menu-theme .chips.seg { flex-wrap: nowrap; }
.menu-theme .chip { flex: 1; justify-content: center; }
.top-search > span:not(.kbd-hint) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .topbar-actions .icon-btn[title^="Keyboard"] { display: none; } }
.stats + .card, .stats + .note, .card + .note { margin-top: 14px; }

/* ---------- needs attention */
.nav-count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; display: inline-grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-variant-numeric: tabular-nums; }
.nav-count[hidden] { display: none; }
.nav-count.att-overdue { background: var(--danger-soft); color: var(--danger); }
.nav-count.att-verify { background: var(--accent-soft); color: var(--accent-text); }
.nav a.nav-link[hidden] { display: none; }
body.nav-collapsed .nav-count { position: absolute; top: 1px; right: 4px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
.att-head { display: flex; gap: 14px; align-items: flex-start; }
.att-head p { max-width: 720px; }
.att-icon { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); color: var(--muted); margin-top: 2px; }
.att-icon.att-overdue { background: var(--danger-soft); color: var(--danger); }
.att-icon.att-verify { background: var(--accent-soft); color: var(--accent); }
.att-icon.att-unassigned { background: var(--warn-soft); color: var(--warn); }

/* ======================================================================================
   LOGIN
   ====================================================================================== */
.lp { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr); background: var(--bg); transition: opacity .4s ease, transform .4s ease; }
.lp.leaving { opacity: 0; transform: scale(.985); }
.lp-brand { position: relative; overflow: hidden; color: #fff; background: #0e0b2b; isolation: isolate; display: flex; }
.lp-aurora { position: absolute; inset: -20%; z-index: -2; filter: blur(60px); opacity: .9; }
.lp-aurora i { position: absolute; border-radius: 50%; mix-blend-mode: screen; animation: drift 18s ease-in-out infinite alternate; }
.lp-aurora .a1 { width: 60%; height: 60%; left: 5%; top: 5%; background: #4f46e5; }
.lp-aurora .a2 { width: 55%; height: 55%; right: 0; top: 25%; background: #9333ea; animation-duration: 22s; animation-delay: -6s; }
.lp-aurora .a3 { width: 50%; height: 50%; left: 25%; bottom: 0; background: #0ea5e9; animation-duration: 26s; animation-delay: -12s; opacity: .7; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(8%, -6%) scale(1.12); } 100% { transform: translate(-6%, 8%) scale(.95); } }
.lp-grid-bg {
  position: absolute; inset: 0; z-index: -1; opacity: .18;
  background-image: linear-gradient(rgba(255,255,255,.25) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.25) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 40% 40%, #000 30%, transparent 75%);
}
.lp-brand-inner { width: 100%; max-width: 640px; margin: auto; padding: 48px 56px; display: flex; flex-direction: column; gap: 30px; }
.lp-logo { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; letter-spacing: -.02em; }
.lp-logo .logo { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); backdrop-filter: blur(6px); }
.lp-headline { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; font-weight: 700; letter-spacing: -.035em; margin: 0; display: flex; flex-direction: column; min-height: 2.3em; transition: opacity .28s, transform .28s; }
.lp-headline.out { opacity: 0; transform: translateY(8px); }
.lp-grad { background: linear-gradient(90deg, #c7d2fe, #f0abfc 50%, #a5f3fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-sub { margin: 14px 0 0; color: rgba(255,255,255,.72); font-size: 15.5px; line-height: 1.6; max-width: 480px; }
.lp-dots { display: flex; gap: 6px; margin-top: 18px; }
.lp-dots button { width: 22px; height: 4px; border-radius: 999px; border: 0; background: rgba(255,255,255,.25); cursor: pointer; padding: 0; transition: width .3s, background .3s; }
.lp-dots button.on { width: 36px; background: #fff; }
.lp-features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.lp-features li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: rgba(255,255,255,.85); animation: rise .6s ease-out both; animation-delay: calc(.5s + var(--i) * .08s); }
.lp-fi { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); flex: none; }

/* animated mini board */
.lp-board {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; height: 270px; padding: 12px;
  border-radius: 16px; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 30px 60px -20px rgba(0,0,0,.5);
  backdrop-filter: blur(10px); animation: rise .7s ease-out both .2s;
}
.lp-col { border-radius: 10px; background: rgba(255,255,255,.05); padding: 8px; }
.lp-col-head { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .05em; }
.lp-col-head i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; }
.lp-col-1 .lp-col-head i { background: #60a5fa; } .lp-col-2 .lp-col-head i { background: #34d399; }
.lp-card {
  position: absolute; left: 20px; top: 44px; width: calc((100% - 44px) / 3 - 16px);
  transform: translate(var(--x), var(--y)); transition: transform .7s cubic-bezier(.2, .8, .2, 1);
  background: #fff; color: #101828; border-radius: 9px; padding: 8px 9px; box-shadow: 0 6px 16px -6px rgba(0,0,0,.45);
  animation: card-in .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(.35s + var(--d));
}
.lp-card.lp-moving { box-shadow: 0 18px 30px -10px rgba(0,0,0,.55); z-index: 2; }
@keyframes card-in { from { opacity: 0; transform: translate(var(--x), calc(var(--y) + 14px)) scale(.96); } }
.lp-card-top { display: flex; justify-content: space-between; align-items: center; font: 600 9.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: #667085; }
.lp-card-top b { font: 600 8.5px "Inter", sans-serif; text-transform: uppercase; letter-spacing: .04em; padding: 1px 4px; border-radius: 3px; background: #eef0ff; color: #3730a3; }
.lp-tag-bug .lp-card-top b { background: #fef3f2; color: #b42318; } .lp-tag-feature .lp-card-top b { background: #ecfdf3; color: #067647; }
.lp-tag-task .lp-card-top b { background: #f2f4f7; color: #475467; }
.lp-card-title { font-size: 11.5px; font-weight: 600; margin: 4px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.lp-bar { flex: 1; height: 3px; border-radius: 99px; background: #eaecf0; overflow: hidden; }
.lp-bar i { display: block; height: 100%; background: #4f46e5; border-radius: 99px; }
.lp-av { width: 16px; height: 16px; border-radius: 50%; background: #e0e7ff; color: #3730a3; font-size: 7px; font-weight: 700; display: grid; place-items: center; }

/* form side */
.lp-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.lp-card-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 22px; animation: rise .5s ease-out both .1s; }
.lp-card-form.shake { animation: shake .45s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
.lp-form-head h1 { font-size: 28px; letter-spacing: -.03em; margin: 0; }
.lp-form-head p { margin: 6px 0 0; }
.lp-mobile-logo { display: none; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 16px; }
.lp-form { display: flex; flex-direction: column; gap: 16px; }
.lp-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.lp-input { position: relative; display: flex; align-items: center; }
.lp-input > .ic { position: absolute; left: 12px; color: var(--muted); pointer-events: none; transition: color .15s; }
.lp-input:focus-within > .ic { color: var(--accent); }
.lp .lp-input input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { width: 100%; height: 44px; padding-left: 38px; font-size: 15px; border-radius: 10px; }
.lp .lp-input input[name="password"]:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { padding-right: 42px; }
.lp-eye { position: absolute; right: 6px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 8px; cursor: pointer; }
.lp-eye:hover { background: var(--surface-2); color: var(--text); }
.lp-caps { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--warn); }
.lp-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.lp-hint { color: var(--muted); font-size: 12px; }
.lp-error { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 13.5px; animation: rise .25s ease-out; }
.lp-error[hidden] { display: none; }
.lp-submit { height: 46px; font-size: 15px; font-weight: 600; border-radius: 10px; position: relative; overflow: hidden; }
.lp-submit .lp-arrow { transition: transform .2s; }
.lp-submit:hover .lp-arrow { transform: translateX(3px); }
.lp-spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
.lp-submit.loading .lp-submit-text, .lp-submit.loading .lp-arrow { display: none; }
.lp-submit.loading .lp-spinner { display: inline-block; }
.lp-submit.done { background: var(--ok); }
.lp-foot { display: inline-flex; align-items: center; gap: 6px; justify-content: center; font-size: 12px; margin: 0; }
@media (max-width: 960px) {
  .lp { grid-template-columns: 1fr; }
  .lp-brand { display: none; }
  .lp-mobile-logo { display: flex; }
  .lp-side { background: radial-gradient(900px 500px at 50% -20%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), var(--bg); }
}

/* ======================================================================================
   MOTION
   ====================================================================================== */
.route-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 1000; background: linear-gradient(90deg, var(--accent), #a855f7); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent); opacity: 0; pointer-events: none; }
.route-progress.run { opacity: 1; width: 70%; transition: width 2s cubic-bezier(.1, .7, .2, 1); }
.route-progress.finish { width: 100%; opacity: 0; transition: width .2s ease, opacity .3s ease .2s; }

@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
main.page-enter > * { animation: page-in .32s cubic-bezier(.2, .8, .2, 1) both; }
main.page-enter > *:nth-child(2) { animation-delay: .04s; } main.page-enter > *:nth-child(3) { animation-delay: .08s; }
main.page-enter > *:nth-child(4) { animation-delay: .12s; } main.page-enter > *:nth-child(n+5) { animation-delay: .16s; }
body.app-enter .shell { animation: page-in .5s cubic-bezier(.2, .8, .2, 1) both; }
body.app-enter .sidebar { animation: slide-in .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes slide-in { from { opacity: 0; transform: translateX(-12px); } }

/* cascades: tiles, cards, rows */
.dash-enter .kpi, .dash-enter .dash-grid > *, .dash-enter .dash-stack > * { animation: pop-in .4s cubic-bezier(.2, .8, .2, 1) both; }
.dash-enter .kpi:nth-child(1) { animation-delay: .02s; } .dash-enter .kpi:nth-child(2) { animation-delay: .05s; }
.dash-enter .kpi:nth-child(3) { animation-delay: .08s; } .dash-enter .kpi:nth-child(4) { animation-delay: .11s; }
.dash-enter .kpi:nth-child(5) { animation-delay: .14s; } .dash-enter .kpi:nth-child(6) { animation-delay: .17s; }
.dash-enter .kpi:nth-child(7) { animation-delay: .2s; } .dash-enter .kpi:nth-child(8) { animation-delay: .23s; }
.dash-enter .dash-grid > *, .dash-enter .dash-stack > * { animation-delay: .22s; }
.dash-enter .c-line { stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: draw 1.2s cubic-bezier(.4, 0, .2, 1) .3s forwards; }
.dash-enter .c-area { animation: fade-area .8s ease .8s both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade-area { from { opacity: 0; } to { opacity: .1; } }
.dash-enter .c-bar, .dash-enter .prio-fill, .dash-enter .status-bar .seg { transform-origin: left; animation: grow-x .7s cubic-bezier(.2, .8, .2, 1) .3s both; }
@keyframes grow-x { from { transform: scaleX(0); } }
main.page-enter .project-grid > *, main.page-enter .up-grid > *, main.page-enter .rel-grid > *, main.page-enter .doc-child-grid > * { animation: pop-in .38s cubic-bezier(.2, .8, .2, 1) both; }
main.page-enter .project-grid > *:nth-child(2), main.page-enter .up-grid > *:nth-child(2), main.page-enter .rel-grid > *:nth-child(2) { animation-delay: .05s; }
main.page-enter .project-grid > *:nth-child(3), main.page-enter .up-grid > *:nth-child(3), main.page-enter .rel-grid > *:nth-child(3) { animation-delay: .1s; }
main.page-enter .project-grid > *:nth-child(n+4), main.page-enter .up-grid > *:nth-child(n+4), main.page-enter .rel-grid > *:nth-child(n+4) { animation-delay: .15s; }
main.page-enter .adv-table tbody tr, main.page-enter .table.tickets tbody tr { animation: page-in .3s ease-out both; }
main.page-enter .adv-table tbody tr:nth-child(2) { animation-delay: .02s; } main.page-enter .adv-table tbody tr:nth-child(3) { animation-delay: .04s; }
main.page-enter .adv-table tbody tr:nth-child(4) { animation-delay: .06s; } main.page-enter .adv-table tbody tr:nth-child(5) { animation-delay: .08s; }
main.page-enter .adv-table tbody tr:nth-child(n+6) { animation-delay: .1s; }
main.page-enter .ticket-card { animation: pop-in .35s cubic-bezier(.2, .8, .2, 1) both; }
main.page-enter .column:nth-child(2) .ticket-card { animation-delay: .04s; } main.page-enter .column:nth-child(3) .ticket-card { animation-delay: .08s; }
main.page-enter .column:nth-child(n+4) .ticket-card { animation-delay: .12s; }

/* interaction feedback */
.btn, .chip, .icon-btn, .nav a.nav-link, .person-filter, .status-trigger { transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .12s; }
.btn:active:not(:disabled), .chip:active, .icon-btn:active, .person-filter:active { transform: scale(.97); }
.btn.primary { position: relative; }
.btn.primary:hover:not(:disabled) { box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--accent) 55%, transparent); }
.kpi, .project-card, .up-card, .rel-card, .doc-child, .ticket-card, a.stat { transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .18s, border-color .18s; }
a.kpi:hover, .project-card:hover, .up-card:hover, .rel-card:hover, .doc-child:hover, a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ticket-card:hover { transform: translateY(-1px); }
.nav a.nav-link .ic { transition: transform .15s; }
.nav a.nav-link:hover .ic { transform: translateX(1px); }
.dropdown.open > .menu, .status-pop, .col-menu, .picker.open .picker-list, .md-slash:not([hidden]) { animation: menu-in .14s cubic-bezier(.2, .8, .2, 1); transform-origin: top; }
.account .account-menu { transform-origin: bottom left; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.modal { animation: modal-in .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
input[type="checkbox"]:checked { animation: check-pop .2s ease-out; }
@keyframes check-pop { 50% { transform: scale(1.15); } }
.nav-badge, .nav-count, .bell .count { animation: badge-in .3s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes badge-in { from { transform: scale(.4); opacity: 0; } }
.column.drop { transition: background .15s, border-color .15s; }
.ticket-card.is-dragging { transform: rotate(1.5deg) scale(1.02); }
tr.is-selected td { transition: background .15s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .lp-aurora i { animation: none; }
}

/* ======================================================================================
   SPRINTS
   ====================================================================================== */
.sprint-toolbar { gap: 10px; }
.sprint-toolbar p { margin: 0; }
.sprint-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.sprint-head .row { gap: 10px; }
.sprint-name { margin: 0; font-size: 17px; letter-spacing: -.015em; }
.sprint-dates { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; }
.sprint-goal { display: flex; align-items: flex-start; gap: 6px; margin: 8px 0 0; color: var(--text-2); font-size: 13.5px; max-width: 760px; }
.sprint-goal .ic { margin-top: 3px; color: var(--accent); }
.sprint-actions { gap: 6px; }
.sprint-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 3px 8px; border-radius: 999px; background: var(--surface-2); }
.sprint-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.sprint-status.active { background: var(--ok-soft); color: var(--ok); }
.sprint-status.active i { background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 6px transparent; } }
.sprint-status.backlog { background: var(--surface-3); color: var(--text-2); }
.sprint-days { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.sprint-days.ok { background: var(--accent-soft); color: var(--accent-text); }
.sprint-days.soon { background: var(--warn-soft); color: var(--warn); }
.sprint-days.over { background: var(--danger-soft); color: var(--danger); }
.sprint-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); text-decoration: none !important; white-space: nowrap; }
.sprint-chip.st-active { background: var(--ok-soft); color: var(--ok); }
.sprint-chip:hover { filter: brightness(.97); }

.sprint-active { border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.sprint-stats { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.sprint-kpi { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.sprint-kpi strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.sprint-progress { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.sp-bar { position: relative; height: 10px; border-radius: 999px; background: var(--surface-3); }
.sp-bar.small { height: 6px; width: 90px; }
.sp-bar i.done { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--ok); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.sp-bar b.time { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 2px; opacity: .55; }
.sprint-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.sprint-chart { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.chart-title { margin-bottom: 4px; font-weight: 600; }
.c-dashed { stroke-dasharray: 5 5; opacity: .7; }
.dash-enter .c-dashed, main.page-enter .c-dashed { animation: none; stroke-dashoffset: 0; }

.sp-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.sp-row { display: grid; grid-template-columns: auto auto auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; transition: background .12s; }
.sp-row:not(:has(input)) { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.sp-row:last-child { border-bottom: 0; }
.sp-row:hover { background: var(--surface-2); }
.sp-row.is-selected { background: var(--accent-soft); }
.sp-row.is-done .sp-title { color: var(--muted); text-decoration: line-through; }
.sp-row.dragging { opacity: .45; }
.sp-row[draggable="true"] { cursor: grab; }
.sp-row .key { font-size: 11.5px; text-decoration: none; }
.sp-title { color: var(--text); text-decoration: none !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-title:hover { color: var(--accent); }
.sp-meta { display: flex; align-items: center; gap: 8px; }
.sp-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; border: 1px dashed var(--border); border-radius: 10px; margin: 8px; }
.sprint-planned, .sprint-backlog, .sprint-active { transition: border-color .15s, background .15s; }
.card.drop { border-color: var(--accent); border-style: dashed; background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface)); }
.sprint-history-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 14px 18px; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.sprint-history-toggle:hover { background: var(--surface-2); }
.sprint-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sprint-summary > div { display: flex; flex-direction: column; align-items: center; padding: 12px; border-radius: 10px; background: var(--surface-2); }
.sprint-summary strong { font-size: 22px; }

.sprint-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 4px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs); }
.sprint-banner .row { gap: 10px; }
.sprint-banner-goal { max-width: 420px; }
.sprint-banner-progress { gap: 10px; }
.dash-sprints .sprint-line .due-main { gap: 10px; }
@media (max-width: 1000px) { .sprint-body { grid-template-columns: minmax(0, 1fr); } .sprint-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .sp-row { grid-template-columns: auto auto minmax(0, 1fr); } .sp-row .type, .sp-meta .prio { display: none; } .sp-meta { grid-column: 1 / -1; } }

/* ---------- settings pages (Slack) */
.slack-settings { display: flex; flex-direction: column; gap: 14px; }
.settings-card { padding: 20px 22px; }
.settings-row { display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-label h2 { margin: 0 0 4px; }
.settings-label p { margin: 0 0 8px; }
.settings-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.settings-body .form { gap: 12px; }
.settings-body .row input { flex: 1; }
.settings-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.field-label.mt { margin-top: 6px; }
.field-label { display: inline-flex; align-items: center; gap: 8px; }
.src-tag { display: inline-flex; font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.src-tag.panel { background: var(--accent-soft); color: var(--accent-text); }
.secret-saved { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.secret-saved code { font-size: 12px; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; color: var(--text-2); }
.secret-saved.removing code { text-decoration: line-through; opacity: .6; }
.channel-list { display: flex; flex-wrap: wrap; gap: 6px; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.type-option { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: border-color .12s, background .12s; }
.type-option:hover { border-color: var(--border-strong); }
.type-option:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.type-option > span { display: flex; flex-direction: column; gap: 2px; }
.type-option input { margin-top: 2px; }
.slack-status { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.slack-status .actions-row { margin: 0; gap: 6px; }
/* toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; justify-self: end; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); transition: background .2s; flex: none; }
.switch .slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::after { transform: translateX(18px); }
.switch input:focus-visible + .slider { box-shadow: var(--ring); }
@media (max-width: 800px) { .settings-row { grid-template-columns: 1fr; gap: 14px; } .switch { justify-self: start; } }

/* ============================================================================ team chat */
body.chat-page main { padding: 0; max-width: none; gap: 0; }
body.chat-page { overflow: hidden; }
.nav-badge.chat-count.dot-only { min-width: 8px; width: 8px; height: 8px; padding: 0; }
.chat {
  --chat-side: 264px; --chat-panel: 380px;
  display: grid; grid-template-columns: var(--chat-side) minmax(0, 1fr); height: calc(100dvh - 56px); min-height: 420px;
  background: var(--surface);
}
.chat.has-panel { grid-template-columns: var(--chat-side) minmax(0, 1fr) var(--chat-panel); }

/* ---- sidebar */
.chat-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); background: var(--bg); }
.chat-side-head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 8px 16px; }
.chat-side-head strong { font-size: 16px; letter-spacing: -.01em; }
.chat-side-actions { margin-left: auto; display: flex; gap: 2px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 20%, transparent); }
.live-dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.chat-side-filter { margin: 4px 12px 8px; display: flex; align-items: center; gap: 6px; padding: 0 10px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); }
.chat-side-filter:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.chat-filter { border: 0; background: transparent; outline: none; flex: 1; min-width: 0; font: inherit; font-size: 13px; color: var(--text); padding: 0; height: 100%; box-shadow: none !important; }
.chat-side-scroll { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.chat-sec { margin-top: 8px; }
.chat-sec-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 0 4px; }
.chat-sec-toggle { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 4px; cursor: pointer; border-radius: 6px; }
.chat-sec-toggle:hover { color: var(--text); }
.chat-sec-head .icon-btn.sm { width: 24px; height: 24px; opacity: .7; }
.chat-sec-head .icon-btn.sm:hover { opacity: 1; }
.chat-sec-empty { margin: 2px 10px 6px; font-size: 12.5px; color: var(--muted); }
.chat-item { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 8px 0 10px; border-radius: 8px; color: var(--text-2, var(--text)); text-decoration: none; font-size: 14px; position: relative; }
.chat-item:hover { background: var(--surface-2); text-decoration: none; }
.chat-item.active { background: var(--accent-soft); color: var(--accent-text); }
.chat-item.unread .chat-item-name { font-weight: 700; color: var(--text); }
.chat-item.active.unread .chat-item-name { color: var(--accent-text); }
.chat-item.muted-ch { opacity: .6; }
.chat-item-ic { width: 22px; display: inline-grid; place-items: center; color: var(--muted); flex: none; }
.chat-item.active .chat-item-ic { color: inherit; }
.chat-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-mute { color: var(--muted); flex: none; }
.chat-item-badge { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; flex: none; }
.chat-side-foot { border-top: 1px solid var(--border); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.chat-side-foot .btn { justify-content: flex-start; width: 100%; color: var(--muted); }
.notify-hint { color: var(--accent-text) !important; }

.pres-avatar { position: relative; display: inline-flex; flex: none; }
.pres-dot { position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--surface); box-shadow: inset 0 0 0 1.5px var(--muted); }
.pres-dot.on { background: #12b76a; box-shadow: none; }
.chat-side .pres-dot { border-color: var(--bg); }
.chat-item.active .pres-dot { border-color: var(--accent-soft); }
.msg-gutter .pres-dot { width: 11px; height: 11px; }
.group-avatar { width: 22px; height: 22px; border-radius: 7px; background: var(--surface-3, var(--surface-2)); color: var(--text-2, var(--text)); display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; }

/* ---- main column */
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); min-height: 60px; }
.chat-back { display: none; }
.chat-head-main { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.chat-title { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 2px 6px 2px 2px; margin-left: -2px; border-radius: 6px; font: inherit; font-size: 16px; font-weight: 700; color: var(--text); cursor: pointer; max-width: 100%; }
.chat-title:hover { background: var(--surface-2); }
.chat-title-ic { color: var(--muted); display: inline-flex; }
.chat-title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-topic, .chat-sub { border: 0; background: none; padding: 0 2px; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.chat-topic:hover:not(:disabled) { color: var(--text); }
.chat-sub { cursor: default; }
.pres-word::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; box-shadow: inset 0 0 0 1.5px var(--muted); }
.pres-word.on::before { background: #12b76a; box-shadow: none; }
.chat-head-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.chat-head-actions .icon-btn { position: relative; }
.head-count { position: absolute; top: 3px; right: 2px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.chat-people { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 8px; margin-right: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-2, var(--text)); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chat-people:hover { background: var(--surface-2); }
.chat-people .avatars { display: inline-flex; padding-left: 6px; }

.chat-body { position: relative; flex: 1; min-height: 0; display: flex; }
.chat-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 0 12px; overscroll-behavior: contain; }
.chat-top { min-height: 4px; }
.chat-loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; font-size: 12.5px; color: var(--muted); }
.chat-loading .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: chat-spin .8s linear infinite; }
@keyframes chat-spin { to { transform: rotate(360deg); } }
.chat-intro { padding: 28px 24px 16px; }
.chat-intro-ic { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 12px; }
.chat-intro-ic .avatar.lg { width: 56px; height: 56px; border-radius: 14px; }
.chat-intro h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.02em; }
.chat-intro p { margin: 0; max-width: 60ch; }
.chat-welcome { display: grid; place-items: center; height: 100%; padding: 24px; }

.day-sep { position: sticky; top: 0; z-index: 2; display: flex; justify-content: center; margin: 14px 0 6px; pointer-events: none; }
.day-sep::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--border); z-index: -1; }
.day-sep span { pointer-events: auto; padding: 3px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 12px; font-weight: 600; color: var(--text-2, var(--text)); box-shadow: var(--shadow-xs, none); }
.unread-sep { display: flex; align-items: center; gap: 8px; margin: 6px 16px 2px; color: var(--danger); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.unread-sep::before { content: ""; flex: 1; border-top: 1px solid var(--danger); }
.unread-sep span { order: 2; }
.unread-sep::after { content: ""; width: 10px; order: 3; }

/* ---- messages */
.msg { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 12px; padding: 6px 20px 6px 16px; }
.msg.grouped { padding-top: 1px; padding-bottom: 1px; }
.msg:hover, .msg:focus-within { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.msg.mentioned { background: color-mix(in srgb, #f5b100 9%, transparent); box-shadow: inset 3px 0 0 #e8a400; }
.msg.mentioned:hover { background: color-mix(in srgb, #f5b100 14%, transparent); }
.msg.pinned { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.msg.flash { animation: msg-flash 2.4s ease-out; }
@keyframes msg-flash { 0%, 30% { background: color-mix(in srgb, var(--accent) 22%, transparent); } 100% { background: transparent; } }
.msg.arrive { animation: msg-in .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg-gutter { display: flex; justify-content: center; padding-top: 2px; }
.msg-gutter .avatar { width: 36px; height: 36px; border-radius: 10px; font-size: 13px; }
.msg-gtime { visibility: hidden; font-size: 10.5px; color: var(--muted); line-height: 22px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.msg.grouped:hover .msg-gtime { visibility: visible; }
.msg-main { min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; line-height: 1.3; }
.msg-author { font-size: 14.5px; font-weight: 700; color: var(--text); }
.msg-time { font-size: 12px; color: var(--muted); text-decoration: none; font-variant-numeric: tabular-nums; }
.msg-time:hover { text-decoration: underline; color: var(--text-2, var(--text)); }
.msg-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px; font-size: 10.5px; font-weight: 700; background: var(--surface-3, var(--surface-2)); color: var(--text-2, var(--muted)); text-transform: uppercase; letter-spacing: .03em; margin-left: 6px; }
.msg-tag.ok { background: var(--ok-soft); color: var(--ok); }
.msg-head .msg-tag { margin-left: 0; }
.msg-pin { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--accent-text); font-weight: 600; }
.msg-body { font-size: 14.5px; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.msg-body .markdown { font-size: inherit; }
.msg-md > :first-child { margin-top: 0; }
.msg-md > :last-child { margin-bottom: 0; }
.msg-md p { margin: 0 0 4px; }
.msg-md pre { margin: 6px 0; max-width: 100%; }
.msg-md blockquote { margin: 4px 0; }
.msg-md ul, .msg-md ol { margin: 2px 0 4px; padding-left: 22px; }
.msg-md img { max-width: min(100%, 420px); border-radius: 8px; }
.msg-md.jumbo { font-size: 36px; line-height: 1.2; }
.msg-edited { margin-left: 4px; font-size: 11.5px; color: var(--muted); }
.msg-md + .msg-edited { display: inline-block; }
.msg-deleted { margin: 0; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-style: italic; font-size: 13.5px; }
.mention { white-space: nowrap; }
.mention.me { background: color-mix(in srgb, #f5b100 30%, transparent); color: var(--text); }
.mention.broadcast { background: color-mix(in srgb, #f5b100 22%, transparent); color: var(--text); }

.msg-files { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.msg-images { display: flex; flex-wrap: wrap; gap: 6px; }
.msg-image { padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; line-height: 0; min-width: 80px; min-height: 60px; }
.msg-image img { display: block; max-width: min(360px, 100%); max-height: 280px; object-fit: cover; }
.msg-images.multi .msg-image img { width: 160px; height: 120px; }
.msg-file { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); max-width: 380px; }
.msg-file-ic { position: relative; width: 36px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.msg-file-ic span { position: absolute; bottom: 3px; font-size: 8px; font-weight: 800; letter-spacing: .02em; }
.msg-file-ic svg { margin-top: -8px; }
.msg-file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.msg-file-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.msg-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.reaction { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-2, var(--text)); cursor: pointer; transition: transform .12s, background .12s; }
.reaction:hover { border-color: var(--border-strong, var(--muted)); background: var(--surface-2); }
.reaction:active { transform: scale(.94); }
.reaction.mine { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-soft); color: var(--accent-text); }
.reaction-e { font-size: 15px; line-height: 1; }
.reaction.add { color: var(--muted); opacity: 0; padding: 0 6px; gap: 0; }
.msg:hover .reaction.add, .reaction.add:focus-visible { opacity: 1; }

.thread-sum { display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; padding: 4px 8px 4px 6px; border: 1px solid transparent; border-radius: 8px; background: none; font: inherit; font-size: 13px; cursor: pointer; color: var(--muted); max-width: 100%; }
.thread-sum:hover { border-color: var(--border); background: var(--surface); }
.thread-sum-n { color: var(--accent); font-weight: 700; }
.thread-sum-go { display: none; align-items: center; gap: 2px; }
.thread-sum:hover .thread-sum-go { display: inline-flex; }
.thread-sum:hover .thread-sum-t { display: none; }

.msg-actions { position: absolute; top: -14px; right: 16px; z-index: 3; display: none; align-items: center; gap: 1px; padding: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-md, var(--shadow)); }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { display: flex; }
.msg-actions:has(+ *) { display: none; }
.ma { width: 30px; height: 30px; border: 0; background: none; border-radius: 7px; display: grid; place-items: center; color: var(--muted); cursor: pointer; font-size: 16px; }
.ma:hover { background: var(--surface-2); color: var(--text); }
.ma-emoji { font-size: 15px; }
.msg-edit { display: flex; flex-direction: column; gap: 6px; margin: 4px 0; }
.msg-edit-input { width: 100%; resize: none; font: inherit; font-size: 14.5px; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: var(--ring); outline: none; }
.msg-edit-bar { display: flex; align-items: center; gap: 6px; }
.msg-edit-bar .muted { margin-right: auto; }

.chat-jump { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 4; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); cursor: pointer; animation: pop-in .2s ease-out; }
.chat-jump.new { background: var(--accent); border-color: var(--accent); color: #fff; }
.chat-jump[hidden] { display: none; }
.chat-drop { position: absolute; inset: 8px; z-index: 6; display: none; place-items: center; border: 2px dashed var(--accent); border-radius: 14px; background: color-mix(in srgb, var(--accent-soft) 88%, transparent); color: var(--accent-text); pointer-events: none; }
.chat-drop.on { display: grid; }
.chat-drop div { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 15px; }

.chat-typing { height: 22px; padding: 0 20px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.thread-typing { height: 20px; padding: 0 16px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .15s; } .typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.chat-banner { margin: 0 16px 16px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.chat-banner .btn { margin-left: auto; }
.chat-banner.join { justify-content: center; }
.chat-banner.join .btn { margin-left: 8px; }

/* ---- composer */
.chat-composer { padding: 0 16px 16px; position: relative; }
.chat-panel .chat-composer { padding: 0 12px 12px; }
.cc-box { position: relative; border: 1px solid var(--border-strong, var(--border)); border-radius: 12px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.cc-box:focus-within { border-color: color-mix(in srgb, var(--accent) 65%, var(--border)); box-shadow: var(--ring); }
.cc-input { display: block; width: 100%; resize: none; border: 0 !important; outline: none; background: transparent; box-shadow: none !important; font: inherit; font-size: 14.5px; line-height: 1.5; padding: 11px 14px 4px; color: var(--text); max-height: 260px; min-height: 42px; }
.cc-bar { display: flex; align-items: center; gap: 8px; padding: 4px 6px 6px 8px; }
.cc-tools { display: flex; align-items: center; gap: 1px; flex-wrap: wrap; }
.ctool { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.ctool:hover { background: var(--surface-2); color: var(--text); }
.ctool-sep { width: 1px; height: 16px; background: var(--border); margin: 0 4px; }
.cc-hint { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
.cc-hint kbd { font-size: 10px; padding: 0 4px; }
.cc-send { width: 34px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; transition: transform .1s, opacity .15s, background .15s; flex: none; }
.cc-send:hover:not(:disabled) { background: var(--accent-hover, var(--accent)); }
.cc-send:active:not(:disabled) { transform: scale(.94); }
.cc-send:disabled { background: var(--surface-3, var(--surface-2)); color: var(--muted); cursor: default; }
.cc-files { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 8px; }
.cc-files[hidden] { display: none; }
.cfile { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); max-width: 260px; animation: pop-in .18s ease-out; }
.cfile-thumb { width: 36px; height: 36px; border-radius: 7px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.cfile-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cfile-meta { display: flex; flex-direction: column; min-width: 0; }
.cfile-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-ac { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); z-index: 20; margin: 0; padding: 4px; list-style: none; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; }
.cc-ac[hidden] { display: none; }
.cc-ac li { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.cc-ac li .muted { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-ac li.active { background: var(--accent-soft); color: var(--accent-text); }
.ac-emoji { font-size: 18px; width: 22px; text-align: center; }
.ac-at { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-2); }

/* ---- popovers: emoji picker and menus */
.chat-pop { position: fixed; z-index: 1000; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); animation: pop-in .14s ease-out; }
.chat-menu { display: flex; flex-direction: column; padding: 4px; min-width: 210px; }
.chat-menu button { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 0; border-radius: 7px; background: none; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; text-align: left; }
.chat-menu button:hover { background: var(--surface-2); }
.chat-menu button.danger { color: var(--danger); }
.chat-menu button.danger:hover { background: var(--danger-soft); }
.chat-menu button svg { color: var(--muted); }
.chat-menu button.danger svg { color: inherit; }
.chat-menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 2px; }
.menu-ic { width: 15px; }
.emoji-pop { width: 340px; display: flex; flex-direction: column; overflow: hidden; }
.emoji-search { margin: 10px 10px 6px; height: 32px; }
.emoji-tabs { display: flex; gap: 2px; padding: 0 8px 6px; border-bottom: 1px solid var(--border); }
.emoji-tab { flex: 1; height: 30px; border: 0; background: none; border-radius: 6px; font-size: 16px; cursor: pointer; filter: grayscale(.6); }
.emoji-tab:hover { background: var(--surface-2); filter: none; }
.emoji-grid { height: 260px; overflow-y: auto; padding: 4px 8px 8px; }
.emoji-cat { position: sticky; top: 0; background: var(--surface); padding: 6px 2px 4px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.emoji-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-cell { height: 36px; border: 0; background: none; border-radius: 8px; font-size: 21px; cursor: pointer; transition: transform .1s; }
.emoji-cell:hover { background: var(--surface-2); transform: scale(1.15); }
.emoji-none { padding: 16px; text-align: center; }

/* ---- right panel */
.chat-panel { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--border); background: var(--surface); animation: panel-in .2s cubic-bezier(.2, .8, .2, 1); }
.chat-panel[hidden] { display: none; }
@keyframes panel-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--border); min-height: 60px; }
.panel-head > div { display: flex; flex-direction: column; min-width: 0; }
.panel-head strong { font-size: 15px; }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.chat-panel.is-thread .panel-body { padding: 0; gap: 0; overflow: hidden; }
.thread-scroll { flex: 1; overflow-y: auto; padding: 8px 0; }
.thread-scroll .msg { padding-right: 12px; padding-left: 12px; }
.thread-count { display: flex; align-items: center; gap: 8px; margin: 6px 16px; font-size: 12px; color: var(--muted); font-weight: 600; }
.thread-count::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.panel-search { height: 36px; }
.search-hint { margin: 8px 2px; }
.search-results { display: flex; flex-direction: column; gap: 8px; }
.result-card { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; color: var(--text); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.result-card:hover { border-color: var(--border-strong, var(--muted)); box-shadow: var(--shadow); }
.result-head { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.result-time { margin-left: auto; }
.result-body { font-size: 13.5px; max-height: 110px; overflow: hidden; }
.result-body mark { background: color-mix(in srgb, #f5b100 40%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.member-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.member-list li { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; }
.member-list li:hover { background: var(--surface-2); }
.member-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.member-meta strong { font-size: 13.5px; }
.member-meta .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-actions { display: flex; gap: 2px; opacity: 0; }
.member-list li:hover .member-actions, .member-actions:focus-within { opacity: 1; }
.panel-add { align-self: flex-start; }
.panel-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery-cell { aspect-ratio: 1; padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.gallery-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.panel-file { display: flex; flex-direction: column; gap: 4px; }
.panel-file .msg-file { max-width: none; }
.details-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 12px 0 8px; }
.details-hero h3 { margin: 4px 0 0; font-size: 18px; }
.details-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.details-block { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.details-block p { margin: 4px 0; }
.details-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.details-actions .btn { justify-content: flex-start; }

/* ---- dialogs */
.people-chooser { display: flex; flex-direction: column; gap: 8px; }
.people-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.people-chips:empty { display: none; }
.person-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 4px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 600; }
.person-chip button { width: 20px; height: 20px; border: 0; border-radius: 50%; background: none; color: inherit; display: grid; place-items: center; cursor: pointer; }
.person-chip button:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.people-list { list-style: none; margin: 0; padding: 4px; border: 1px solid var(--border); border-radius: 10px; max-height: 280px; overflow-y: auto; }
.people-list li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.people-list li:hover { background: var(--surface-2); }
.people-list li.none { cursor: default; padding: 12px; }
.pl-name { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; }
.pl-check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-strong, var(--border)); display: grid; place-items: center; color: transparent; }
.people-list li.on .pl-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.private-toggle { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.private-toggle > span { display: flex; flex-direction: column; }
.browse { display: flex; flex-direction: column; gap: 12px; }
.browse .row input { flex: 1; }
.browse-list { display: flex; flex-direction: column; max-height: 60vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.browse-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.browse-row:last-child { border-bottom: 0; }
.browse-row:hover { background: var(--surface-2); }
.browse-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.browse-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.browse-meta strong { display: flex; align-items: center; gap: 6px; }
.browse-actions { display: flex; gap: 6px; }
.lightbox { display: flex; flex-direction: column; gap: 10px; }
.lightbox-img { max-width: 100%; max-height: 72vh; object-fit: contain; margin: 0 auto; border-radius: 8px; background: var(--surface-2); min-height: 120px; }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; }

/* ---- responsive */
@media (max-width: 1200px) {
  .chat.has-panel { grid-template-columns: var(--chat-side) minmax(0, 1fr); }
  .chat-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(var(--chat-panel), 100%); z-index: 30; box-shadow: var(--shadow-lg); }
  .chat { position: relative; }
}
@media (max-width: 860px) {
  .chat, .chat.has-panel { grid-template-columns: 1fr; height: calc(100dvh - 56px); }
  .chat .chat-main { display: none; }
  .chat.has-current .chat-side { display: none; }
  .chat.has-current .chat-main { display: flex; }
  .chat-back { display: inline-grid; }
  .chat-side { border-right: 0; }
  .cc-hint, .chat-people .avatars { display: none; }
  .chat-head { padding: 8px 8px 8px 4px; }
  .msg { padding-left: 10px; padding-right: 10px; grid-template-columns: 34px minmax(0, 1fr); gap: 0 10px; }
  .msg-gutter .avatar { width: 32px; height: 32px; }
  .chat-composer { padding: 0 8px 8px; }
  .chat-panel { width: 100%; }
  .emoji-pop { width: min(340px, calc(100vw - 16px)); }
}
@media (prefers-reduced-motion: reduce) {
  .msg.arrive, .chat-panel, .chat-pop, .cfile { animation: none; }
  .typing-dots i { animation: none; opacity: .7; }
}

/* ---- chat extras: header call buttons, call log cards, snippets, paste hint */
.head-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.call-join { background: #12b76a; border-color: #12b76a; color: #fff; gap: 6px; margin-right: 4px; }
.call-join:hover { background: #0e9f5b; border-color: #0e9f5b; color: #fff; }
.call-join.in { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.call-join-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: live-pulse 1.4s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }
.call-card { display: inline-flex; align-items: center; gap: 12px; margin: 2px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); min-width: 260px; max-width: 100%; flex-wrap: wrap; }
.call-card-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2, var(--text)); flex: none; }
.call-card.live { border-color: color-mix(in srgb, #12b76a 45%, var(--border)); background: color-mix(in srgb, #12b76a 6%, var(--surface)); }
.call-card.live .call-card-ic { background: #12b76a; color: #fff; animation: live-ring 1.8s ease-out infinite; }
@keyframes live-ring { 0% { box-shadow: 0 0 0 0 rgba(18, 183, 106, .45); } 100% { box-shadow: 0 0 0 12px rgba(18, 183, 106, 0); } }
.call-card.missed .call-card-ic { background: var(--danger-soft); color: var(--danger); }
.call-card-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.call-card .avatars { display: inline-flex; padding-left: 6px; }
.paste-hint { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 7px 10px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; animation: pop-in .18s ease-out; }
.paste-hint[hidden] { display: none; }
.paste-hint .link { font-weight: 700; }
.paste-hint .link.muted { margin-left: auto; font-weight: 500; }
.snippet-form { gap: 10px; }
.snippet-bar { display: flex; align-items: center; gap: 10px; }
.snippet-bar select { width: auto; min-width: 180px; }
.snippet-hint { margin-left: auto; }
.snippet-code { font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.55; tab-size: 2; white-space: pre; overflow: auto; min-height: 260px; background: var(--surface-2); }
.msg-md .md-codeblock { position: relative; max-width: 100%; }
.msg-md .md-codeblock.folded pre { max-height: 330px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.code-more { display: block; width: 100%; padding: 6px; border: 0; border-top: 1px solid var(--border); background: var(--surface-2); color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; border-radius: 0 0 8px 8px; }

/* ---- animated big emoji (sent on their own) */
.msg-md.jumbo { display: flex; flex-wrap: wrap; gap: 4px; font-size: 40px; line-height: 1.15; padding: 2px 0; }
.jumbo-e { display: inline-block; transform-origin: 50% 80%; animation: var(--fx, emo-bounce) 1.1s cubic-bezier(.3, 1.4, .5, 1) calc(var(--i) * .12s) 3 both; will-change: transform; }
.msg:hover .jumbo-e { animation-iteration-count: infinite; }
.jumbo-e[data-fx="bounce"] { --fx: emo-bounce; }
.jumbo-e[data-fx="laugh"] { --fx: emo-laugh; }
.jumbo-e[data-fx="beat"] { --fx: emo-beat; }
.jumbo-e[data-fx="pop"] { --fx: emo-pop; }
.jumbo-e[data-fx="party"] { --fx: emo-party; }
.jumbo-e[data-fx="flicker"] { --fx: emo-flicker; }
.jumbo-e[data-fx="launch"] { --fx: emo-launch; }
.jumbo-e[data-fx="wave"] { --fx: emo-wave; transform-origin: 70% 90%; }
.jumbo-e[data-fx="sob"] { --fx: emo-sob; }
.jumbo-e[data-fx="shock"] { --fx: emo-shock; }
.jumbo-e[data-fx="think"] { --fx: emo-think; }
.jumbo-e[data-fx="shine"] { --fx: emo-shine; }
.jumbo-e[data-fx="wobble"] { --fx: emo-wobble; }
.jumbo-e[data-fx="sleep"] { --fx: emo-sleep; }
.jumbo-e[data-fx="rage"] { --fx: emo-rage; }
.jumbo-e[data-fx="crawl"] { --fx: emo-crawl; }
@keyframes emo-bounce { 0%, 100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-14px) scale(1.08, .94); } 55% { transform: translateY(0) scale(1.1, .88); } 75% { transform: translateY(-5px); } }
@keyframes emo-laugh { 0%, 100% { transform: rotate(0) scale(1); } 15% { transform: rotate(-14deg) scale(1.12); } 30% { transform: rotate(12deg) scale(1.12); } 45% { transform: rotate(-10deg) scale(1.1); } 60% { transform: rotate(8deg) scale(1.06); } 75% { transform: rotate(-4deg); } }
@keyframes emo-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.3); } 30% { transform: scale(.95); } 45% { transform: scale(1.22); } 65% { transform: scale(1); } }
@keyframes emo-pop { 0% { transform: scale(.4) rotate(-20deg); } 40% { transform: scale(1.35) rotate(8deg); } 65% { transform: scale(.92) rotate(-4deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes emo-party { 0%, 100% { transform: rotate(0) translateY(0); } 20% { transform: rotate(-18deg) translateY(-8px) scale(1.15); } 40% { transform: rotate(16deg) translateY(-12px) scale(1.2); } 60% { transform: rotate(-10deg) translateY(-4px); } 80% { transform: rotate(6deg); } }
@keyframes emo-flicker { 0%, 100% { transform: scale(1) skewX(0); filter: brightness(1); } 25% { transform: scale(1.12, 1.2) skewX(-6deg); filter: brightness(1.25); } 50% { transform: scale(.96, 1.06) skewX(5deg); } 75% { transform: scale(1.1, 1.16) skewX(-3deg); filter: brightness(1.2); } }
@keyframes emo-launch { 0% { transform: translate(0, 0) rotate(0); } 15% { transform: translate(-3px, 3px) rotate(-6deg); } 20% { transform: translate(3px, 2px) rotate(4deg); } 55% { transform: translate(40px, -40px) scale(.7); opacity: 0; } 56% { transform: translate(-30px, 30px) scale(.7); opacity: 0; } 100% { transform: translate(0, 0); opacity: 1; } }
@keyframes emo-wave { 0%, 100% { transform: rotate(0); } 15%, 45% { transform: rotate(22deg); } 30%, 60% { transform: rotate(-12deg); } 75% { transform: rotate(10deg); } }
@keyframes emo-sob { 0%, 100% { transform: translateY(0) scale(1); } 20%, 60% { transform: translateY(3px) scale(1.06, .92); } 40%, 80% { transform: translateY(-3px) scale(.96, 1.05); } }
@keyframes emo-shock { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.35); } 30% { transform: scale(1.3) translateX(-3px); } 40% { transform: scale(1.3) translateX(3px); } 50% { transform: scale(1.3) translateX(-2px); } 70% { transform: scale(1); } }
@keyframes emo-think { 0%, 100% { transform: rotate(0) translateY(0); } 30% { transform: rotate(-12deg) translateY(-3px); } 60% { transform: rotate(-12deg) translateY(-3px) scale(1.05); } }
@keyframes emo-shine { 0%, 100% { transform: scale(1) rotate(0); filter: drop-shadow(0 0 0 transparent); } 40% { transform: scale(1.2) rotate(12deg); filter: drop-shadow(0 0 10px rgba(255, 200, 0, .7)); } 70% { transform: scale(1.05) rotate(-6deg); } }
@keyframes emo-wobble { 0%, 100% { transform: skew(0) scale(1); } 20% { transform: skew(-12deg, 4deg) scale(1.1, .9); } 40% { transform: skew(10deg, -3deg) scale(.92, 1.1); } 60% { transform: skew(-6deg) scale(1.05, .96); } 80% { transform: skew(3deg); } }
@keyframes emo-sleep { 0%, 100% { transform: rotate(0) scale(1); opacity: 1; } 50% { transform: rotate(-8deg) scale(.94) translateY(3px); opacity: .8; } }
@keyframes emo-rage { 0%, 100% { transform: translate(0) scale(1); filter: none; } 10%, 30%, 50%, 70% { transform: translate(-3px, 1px) scale(1.12); filter: saturate(1.6) hue-rotate(-10deg); } 20%, 40%, 60% { transform: translate(3px, -1px) scale(1.12); } }
@keyframes emo-crawl { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(10px) rotate(6deg); } 50% { transform: translateX(18px) rotate(-4deg); } 75% { transform: translateX(8px) rotate(4deg); } }

/* emoji showers across the conversation */
.fx-layer { position: absolute; inset: 0; z-index: 7; overflow: hidden; pointer-events: none; }
.fx-p { position: absolute; bottom: -50px; line-height: 1; animation: fx-rise var(--d) cubic-bezier(.2, .6, .4, 1) var(--delay) both; will-change: transform, opacity; }
.fx-layer.fall .fx-p { top: -50px; bottom: auto; animation-name: fx-fall; }
.fx-layer.fly .fx-p { animation-name: fx-fly; }
@keyframes fx-rise { 0% { transform: translate(0, 0) rotate(0) scale(.6); opacity: 0; } 12% { opacity: 1; } 100% { transform: translate(var(--x), -110vh) rotate(var(--r)) scale(1.1); opacity: 0; } }
@keyframes fx-fall { 0% { transform: translate(0, 0) rotate(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate(var(--x), 110vh) rotate(var(--r)); opacity: .2; } }
@keyframes fx-fly { 0% { transform: translate(-30vw, 0) rotate(45deg) scale(.6); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(60vw, -110vh) rotate(45deg) scale(1.2); opacity: 0; } }
.fx-mini { position: fixed; z-index: 2000; pointer-events: none; font-size: 18px; line-height: 1; transform: translate(-50%, 0); animation: fx-mini .85s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes fx-mini { from { transform: translate(-50%, 0) scale(.6); opacity: 1; } to { transform: translate(calc(-50% + var(--x)), var(--y)) rotate(var(--r)) scale(1.2); opacity: 0; } }
.reaction.bump { animation: reaction-bump .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes reaction-bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ---- incoming call */
.call-ring { position: fixed; top: 72px; right: 20px; z-index: 3000; width: 340px; max-width: calc(100vw - 32px); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 18px 18px; border-radius: 20px; color: #fff; text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, #3b3f9e 0%, #1d1f4a 55%, #121331 100%); box-shadow: 0 24px 60px -12px rgba(10, 12, 40, .6), 0 0 0 1px rgba(255, 255, 255, .06) inset; animation: ring-in .35s cubic-bezier(.2, 1.2, .4, 1); }
.call-ring.out { animation: ring-out .25s ease-in forwards; }
@keyframes ring-in { from { opacity: 0; transform: translateY(-16px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes ring-out { to { opacity: 0; transform: translateY(-12px) scale(.96); } }
.ring-avatar { position: relative; width: 76px; height: 76px; display: grid; place-items: center; }
.ring-avatar .avatar.lg { width: 72px; height: 72px; font-size: 24px; position: relative; z-index: 1; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.ring-wave { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); animation: ring-wave 1.8s ease-out infinite; }
.ring-wave.w2 { animation-delay: .9s; }
@keyframes ring-wave { from { transform: scale(1); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
.ring-text { display: flex; flex-direction: column; gap: 2px; }
.ring-text strong { font-size: 18px; }
.ring-text span { color: rgba(255, 255, 255, .78); font-size: 13.5px; }
.ring-text .muted { color: rgba(255, 255, 255, .6) !important; }
.ring-actions { display: flex; gap: 18px; margin-top: 4px; }
.call-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; cursor: pointer; transition: transform .12s, filter .12s; }
.call-btn:hover { transform: scale(1.08); filter: brightness(1.1); }
.call-btn.accept { background: #12b76a; animation: accept-bob 1.2s ease-in-out infinite; }
.call-btn.accept + .call-btn.accept { animation-delay: .15s; }
.call-btn.decline { background: #f04438; }
.hang { transform: rotate(135deg); }
@keyframes accept-bob { 0%, 100% { transform: translateY(0); box-shadow: 0 0 0 0 rgba(18, 183, 106, .5); } 50% { transform: translateY(-3px); box-shadow: 0 0 0 10px rgba(18, 183, 106, 0); } }

/* ---- call window */
.call-ui { position: fixed; z-index: 2500; inset: 4vh 4vw; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: #0d0f16; color: #f2f4f8; box-shadow: 0 30px 80px -10px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06); animation: call-in .3s cubic-bezier(.2, .9, .3, 1); }
@keyframes call-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.call-ui:fullscreen { inset: 0; border-radius: 0; }
.call-ui.mini { inset: auto 20px 20px auto; width: 340px; height: auto; border-radius: 16px; }
.call-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 10px 16px; background: linear-gradient(rgba(255, 255, 255, .04), transparent); }
.call-ui.mini .call-head { cursor: grab; }
.call-head-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.call-head-title strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-live { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: #12b76a; color: #fff; flex: none; }
.call-status { font-size: 13px; color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; }
.call-people { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: rgba(255, 255, 255, .7); }
.call-net { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.call-net i { width: 3px; border-radius: 1px; background: rgba(255, 255, 255, .25); }
.call-net i:nth-child(1) { height: 5px; } .call-net i:nth-child(2) { height: 8px; } .call-net i:nth-child(3) { height: 12px; }
.call-net.good i { background: #47cd89; }
.call-net.fair i:nth-child(-n+2) { background: #fdb022; }
.call-net.poor i:nth-child(1) { background: #f97066; }
.call-head .icon-btn { color: rgba(255, 255, 255, .8); }
.call-head .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.call-stage { flex: 1; min-height: 0; display: grid; gap: 10px; padding: 10px 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); grid-auto-rows: minmax(0, 1fr); align-content: center; }
.call-stage.n1 { grid-template-columns: 1fr; }
.call-stage.n2 { grid-template-columns: repeat(2, 1fr); }
.call-stage.n3, .call-stage.n4 { grid-template-columns: repeat(2, 1fr); }
.call-stage.n5, .call-stage.n6 { grid-template-columns: repeat(3, 1fr); }
.call-stage.n7, .call-stage.n8, .call-stage.n9 { grid-template-columns: repeat(3, 1fr); }
.call-stage.layout-spotlight { grid-template-columns: 1fr 200px; grid-template-rows: 1fr; }
.call-main { min-height: 0; display: grid; }
.call-strip { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 0; }
.call-strip .call-tile { aspect-ratio: 16 / 10; flex: none; }
.call-stage.layout-mini { position: relative; display: block; padding: 0 10px; height: 190px; }
.call-stage.layout-mini > .call-tile:first-child { position: absolute; inset: 0 10px; }
.call-stage.layout-mini > .call-tile:last-child:not(:first-child) { position: absolute; right: 18px; bottom: 8px; width: 96px; height: 64px; z-index: 2; border: 2px solid #0d0f16; }
.call-stage.layout-mini > .call-tile:not(:first-child):not(:last-child) { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.call-stage.layout-mini .call-tile-name { font-size: 11px; }
.call-tile { position: relative; min-height: 0; border-radius: 14px; overflow: hidden; background: radial-gradient(120% 120% at 50% 0%, #232838, #151823); display: grid; place-items: center; transition: box-shadow .15s; }
.call-tile video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.call-tile.screen video, .call-main .call-tile video { object-fit: contain; }
.call-tile.mirror video { transform: scaleX(-1); }
.call-tile video.hidden-video { position: absolute; width: 1px; height: 1px; opacity: 0; }
.call-tile.speaking { box-shadow: 0 0 0 3px #47cd89, 0 0 24px rgba(71, 205, 137, .35); }
.call-tile.pinned { box-shadow: 0 0 0 2px rgba(129, 136, 248, .8); }
.call-tile.pinned.speaking { box-shadow: 0 0 0 3px #47cd89; }
.call-tile-avatar { position: relative; display: grid; place-items: center; }
.call-tile-avatar .avatar.lg { width: 84px; height: 84px; font-size: 28px; position: relative; z-index: 1; }
.call-ring-level { position: absolute; inset: -6px; border-radius: 50%; background: rgba(71, 205, 137, .35); transform: scale(calc(1 + var(--level, 0) * .5)); opacity: calc(var(--level, 0) * 1.2); transition: transform .12s, opacity .12s; }
.call-tile-name { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 20px); padding: 4px 10px; border-radius: 8px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); font-size: 13px; font-weight: 600; }
.call-tile-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted-ic { color: #f97066; flex: none; }
.tile-tag { padding: 0 6px; border-radius: 5px; background: rgba(129, 136, 248, .4); font-size: 11px; }
.call-tile-state { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .55); font-size: 12px; }
.call-waiting { position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px; background: rgba(0, 0, 0, .5); font-size: 14px; color: rgba(255, 255, 255, .85); white-space: nowrap; animation: live-pulse 2.4s ease-in-out infinite; }
.call-ui.mini .call-waiting { bottom: 70px; font-size: 12px; }
.call-controls { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 12px 14px 16px; flex-wrap: wrap; }
.call-ctl { display: flex; flex-direction: column; align-items: center; gap: 5px; border: 0; background: none; color: #fff; cursor: pointer; font: inherit; padding: 0; }
.call-ctl > svg { width: 50px; height: 50px; padding: 14px; border-radius: 50%; background: rgba(255, 255, 255, .12); box-sizing: border-box; transition: background .15s, transform .12s; }
.call-ctl:hover > svg { background: rgba(255, 255, 255, .2); }
.call-ctl:active > svg { transform: scale(.94); }
.call-ctl.off > svg { background: #fff; color: #111; }
.call-ctl.sharing > svg { background: #8188f8; color: #fff; }
.call-ctl.danger > svg { background: #f04438; width: 62px; border-radius: 26px; }
.call-ctl.danger:hover > svg { background: #d92d20; }
.call-ctl-label { font-size: 11px; color: rgba(255, 255, 255, .7); }
.call-ui.mini .call-ctl-label { display: none; }
.call-ui.mini .call-controls { padding: 8px 10px 12px; }
.call-ui.mini .call-ctl > svg { width: 42px; height: 42px; padding: 11px; }
.call-settings { position: absolute; z-index: 5; width: 320px; padding: 14px; border-radius: 14px; background: #1b1f2c; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 20px 50px rgba(0, 0, 0, .5); display: flex; flex-direction: column; gap: 10px; animation: pop-in .15s ease-out; }
.call-set-head { display: flex; align-items: center; justify-content: space-between; }
.call-set-head .icon-btn { color: #fff; }
.call-set-row { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: rgba(255, 255, 255, .7); }
.call-set-row select { background: #11141d; color: #fff; border: 1px solid rgba(255, 255, 255, .15); border-radius: 8px; height: 34px; padding: 0 8px; }
.call-set-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.call-set-check > span { display: flex; flex-direction: column; }
.call-set-check .muted { color: rgba(255, 255, 255, .55) !important; }
.call-set-tip { color: rgba(255, 255, 255, .5) !important; margin: 0; }
@media (max-width: 860px) {
  .call-ui { inset: 0; border-radius: 0; }
  .call-ui.mini { inset: auto 10px 10px auto; width: min(320px, calc(100vw - 20px)); }
  .call-stage, .call-stage.n2, .call-stage.n3, .call-stage.n4 { grid-template-columns: 1fr; }
  .call-stage.layout-spotlight { grid-template-columns: 1fr; grid-template-rows: 1fr 110px; }
  .call-strip { flex-direction: row; overflow-x: auto; }
  .call-strip .call-tile { width: 150px; }
  .call-controls { gap: 6px; }
  .call-ctl-label { display: none; }
  .call-ring { top: 12px; right: 12px; left: 12px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .jumbo-e, .call-btn.accept, .ring-wave, .call-card.live .call-card-ic, .call-join-dot, .call-waiting { animation: none !important; }
}

/* ---- chat polish */
.call-ui.mini .call-stage { flex: none; height: 190px; }
.ring-avatar .avatar.lg { position: absolute; inset: 2px; width: auto; height: auto; border-radius: 50%; display: grid; place-items: center; }
.chat-panel .cc-hint { display: none; }
.chat-panel .cc-tools { flex-wrap: nowrap; overflow: hidden; min-width: 0; }
.chat-panel .cc-tools .ctool[title^="Strikethrough"], .chat-panel .cc-tools .ctool[title="Bulleted list"], .chat-panel .cc-tools .ctool[title="Link"] { display: none; }
.chat-panel .cc-bar { justify-content: space-between; }
@media (max-width: 860px) {
  .chat-head-actions .chat-people, .chat-head-actions .head-sep,
  .chat-head-actions .icon-btn[title="Pinned messages"], .chat-head-actions .icon-btn[title="Files"] { display: none; }
  .chat-head-main { min-width: 0; }
  .cc-tools .ctool[title^="Strikethrough"], .cc-tools .ctool[title="Bulleted list"] { display: none; }
}
.call-tile-avatar .avatar.lg, .ring-avatar .avatar.lg { border-radius: 50%; display: grid; place-items: center; line-height: 1; background: hsl(var(--hue) 45% 42%); color: #fff; font-weight: 700; }
.chat.has-panel .chat-main .cc-hint { display: none; }

/* ---- add people to a running call */
.call-add { max-height: min(460px, 70vh); }
.call-search { background: #11141d !important; color: #fff !important; border: 1px solid rgba(255, 255, 255, .15) !important; border-radius: 8px; height: 34px; padding: 0 10px; }
.call-people-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 60px; max-height: 260px; display: flex; flex-direction: column; gap: 2px; }
.call-people-list li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.call-people-list li:hover { background: rgba(255, 255, 255, .07); }
.call-people-list li.on { background: rgba(129, 136, 248, .2); }
.cp-name { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; }
.cp-name span { font-size: 11.5px; font-weight: 400; color: rgba(255, 255, 255, .55); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-online { font-size: 11px; color: #47cd89; }
.cp-check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid rgba(255, 255, 255, .3); display: grid; place-items: center; color: transparent; flex: none; }
.call-people-list li.on .cp-check { background: #8188f8; border-color: #8188f8; color: #fff; }
.cp-none { color: rgba(255, 255, 255, .5); cursor: default !important; font-size: 13px; }
.call-ring-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; border: 0; border-radius: 10px; background: #12b76a; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.call-ring-btn:disabled { background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .45); cursor: default; }
.call-tile.ringing { opacity: .85; }
.call-tile.ringing .call-tile-avatar { width: 96px; height: 96px; }
.call-tile.ringing .ring-wave { border-color: rgba(71, 205, 137, .55); }
.call-tile.ringing .call-tile-state { animation: live-pulse 1.6s ease-in-out infinite; }

/* ---- in-call reactions and raised hands */
.call-react-bar { position: absolute; z-index: 6; display: flex; gap: 2px; padding: 6px; border-radius: 999px; background: #1b1f2c; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); animation: pop-in .15s ease-out; max-width: calc(100% - 16px); overflow-x: auto; }
.call-react { width: 42px; height: 42px; border: 0; border-radius: 50%; background: none; font-size: 24px; cursor: pointer; transition: transform .12s, background .12s; flex: none; }
.call-react:hover { background: rgba(255, 255, 255, .1); transform: scale(1.25) translateY(-3px); }
.call-react:active { transform: scale(.9); }
.call-fx { position: absolute; z-index: 8; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 4px; transform: translateX(-50%); animation: call-fx-rise 3s cubic-bezier(.2, .7, .3, 1) forwards; }
.call-fx-e { font-size: 56px; line-height: 1; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45)); animation: call-fx-wobble .6s ease-in-out infinite alternate; }
.call-fx-name { padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; font-weight: 700; }
@keyframes call-fx-rise { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.4); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 20% { transform: translate(-50%, -10px) scale(1); } 100% { opacity: 0; transform: translate(calc(-50% + var(--sway)), -260px) scale(.9); } }
@keyframes call-fx-wobble { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
.call-shower { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 7; }
.call-stage { position: relative; }
.call-shower span { position: absolute; bottom: -50px; line-height: 1; animation: fx-rise var(--d) cubic-bezier(.2, .6, .4, 1) var(--delay) both; }
.call-hand { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #fdb022; font-size: 20px; box-shadow: 0 4px 12px rgba(0, 0, 0, .35); animation: hand-wave 1.2s ease-in-out infinite; transform-origin: 70% 90%; }
@keyframes hand-wave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(14deg); } 75% { transform: rotate(-10deg); } }
.call-ctl.hand-up > svg { background: #fdb022; color: #111; }
.call-ui.mini .call-react { width: 34px; height: 34px; font-size: 19px; }
@media (prefers-reduced-motion: reduce) { .call-fx, .call-fx-e, .call-hand { animation: none; } }
