:root {
  color-scheme: dark;
  --bg: #0a0e1e;
  --surface: rgba(20, 25, 53, 0.82);
  --surface-2: rgba(29, 36, 72, 0.78);
  --surface-3: rgba(38, 47, 90, 0.82);
  --sidebar: rgba(13, 18, 39, 0.94);
  --topbar: rgba(18, 22, 52, 0.82);
  --text: #f4f7ff;
  --muted: #aab3d0;
  --subtle: #7781a4;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #7c8cff;
  --accent-2: #52d9e9;
  --accent-3: #e96fb7;
  --success: #49d7a0;
  --warning: #ffbd55;
  --danger: #ff6f85;
  --info: #68b8ff;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.26);
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-width: 236px;
  --sidebar-collapsed: 76px;
  --topbar-height: 64px;
  --row-height: 48px;
  --pad: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2fb;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-2: rgba(247, 249, 255, 0.92);
  --surface-3: rgba(235, 240, 252, 0.96);
  --sidebar: rgba(249, 251, 255, 0.96);
  --topbar: rgba(255, 255, 255, 0.88);
  --text: #18203c;
  --muted: #5f6988;
  --subtle: #8992ad;
  --border: rgba(35, 47, 85, 0.12);
  --border-strong: rgba(35, 47, 85, 0.20);
  --shadow: 0 18px 55px rgba(51, 65, 112, 0.16);
  --shadow-soft: 0 8px 28px rgba(51, 65, 112, 0.12);
}

html[data-density="compact"] {
  --row-height: 39px;
  --pad: 12px;
  --radius: 13px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
::selection { background: rgba(124, 140, 255, .38); }

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  inset: 0;
  z-index: -2;
}
body::before {
  background:
    radial-gradient(circle at 77% 15%, rgba(86, 214, 229, .23), transparent 28%),
    radial-gradient(circle at 62% 70%, rgba(149, 89, 255, .25), transparent 33%),
    radial-gradient(circle at 20% 80%, rgba(240, 100, 178, .16), transparent 28%),
    linear-gradient(145deg, #0b0f20 0%, #13173c 48%, #0d1634 100%);
}
body::after {
  opacity: .45;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 75%, transparent);
}
html[data-theme="light"] body::before {
  background:
    radial-gradient(circle at 77% 15%, rgba(86, 214, 229, .25), transparent 28%),
    radial-gradient(circle at 62% 70%, rgba(149, 89, 255, .18), transparent 33%),
    radial-gradient(circle at 20% 80%, rgba(240, 100, 178, .13), transparent 28%),
    linear-gradient(145deg, #eef2fb 0%, #e8edfb 48%, #f2f6ff 100%);
}

.app-shell { height: 100vh; max-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); overflow: hidden; transition: grid-template-columns .22s ease; }
.app-shell.sidebar-collapsed { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }

.sidebar {
  min-width: 0;
  height: 100vh;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(24px) saturate(145%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 20;
}
.brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 17px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.brand img { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 8px 20px rgba(97, 119, 255, .22); }
.brand-copy { min-width: 0; line-height: 1.05; transition: opacity .15s ease; }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.brand-tag { margin-top: 5px; font-size: 8px; text-transform: uppercase; letter-spacing: .1em; color: var(--subtle); white-space: nowrap; }
.sidebar-collapsed .brand { padding-inline: 18px; }
.sidebar-collapsed .brand-copy { opacity: 0; width: 0; }

.nav-scroll { overflow-y: auto; overflow-x: hidden; padding: 14px 10px 12px; scrollbar-width: thin; flex: 1; }
.nav-section { margin-bottom: 16px; }
.nav-label { padding: 4px 10px 7px; color: var(--subtle); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; white-space: nowrap; transition: opacity .15s; }
.sidebar-collapsed .nav-label { opacity: 0; height: 8px; padding: 0; }
.nav-item {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 11px;
  margin: 2px 0;
  text-align: left;
  position: relative;
  white-space: nowrap;
  transition: background .16s, color .16s, transform .16s;
}
.nav-item:hover { color: var(--text); background: rgba(124, 140, 255, .10); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(124,140,255,.28), rgba(82,217,233,.12)); box-shadow: inset 0 0 0 1px rgba(139, 155, 255, .20); }
html[data-theme="light"] .nav-item.active { color: #263260; }
.nav-item.active::before { content: ""; position: absolute; left: -10px; width: 3px; height: 24px; border-radius: 4px; background: linear-gradient(var(--accent-2), var(--accent)); }
.nav-icon { width: 21px; height: 21px; display: inline-flex; flex: 0 0 21px; align-items: center; justify-content: center; }
.nav-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 650; transition: opacity .15s; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; font-size: 10px; font-weight: 800; color: #fff; background: var(--danger); }
.sidebar-collapsed .nav-item { justify-content: center; padding: 0; }
.sidebar-collapsed .nav-text, .sidebar-collapsed .nav-badge { opacity: 0; width: 0; margin: 0; padding: 0; overflow: hidden; }

.sidebar-footer { padding: 10px; border-top: 1px solid var(--border); }
.collapse-btn { width: 100%; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: flex; align-items: center; gap: 11px; padding: 0 12px; }
.collapse-btn:hover { background: rgba(124,140,255,.10); color: var(--text); }
.collapse-btn svg { width: 19px; height: 19px; transition: transform .22s; }
.sidebar-collapsed .collapse-btn { justify-content: center; padding: 0; }
.sidebar-collapsed .collapse-btn svg { transform: rotate(180deg); }
.sidebar-collapsed .collapse-btn span { display: none; }

.app-main { min-width: 0; height: 100vh; max-height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: var(--topbar-height);
  flex: 0 0 var(--topbar-height);
  background: var(--topbar);
  backdrop-filter: blur(22px) saturate(145%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 12px;
  z-index: 15;
  min-width: 0;
}
.workspace-switcher {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 11px;
  min-width: 180px;
  max-width: 235px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  font-weight: 750;
  font-size: 13px;
}
.workspace-dot { width: 9px; height: 9px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 0 0 4px rgba(91, 211, 229, .10); }
.workspace-switcher .chev { margin-left: auto; color: var(--subtle); }
.sidebar-workspace-switcher { display: none; }
.global-search { flex: 1; max-width: 660px; position: relative; min-width: 160px; }
.global-search input { width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 11px; background: rgba(255,255,255,.055); padding: 0 78px 0 40px; outline: none; transition: border .16s, background .16s, box-shadow .16s; }
.global-search input:focus { border-color: rgba(124,140,255,.62); background: rgba(255,255,255,.08); box-shadow: 0 0 0 3px rgba(124,140,255,.12); }
.global-search .search-icon { position: absolute; left: 13px; top: 10px; width: 19px; height: 19px; color: var(--subtle); }
.global-search kbd { position: absolute; right: 9px; top: 8px; height: 24px; border: 1px solid var(--border); border-bottom-color: var(--border-strong); background: var(--surface-2); border-radius: 6px; padding: 3px 7px; color: var(--subtle); font-size: 10px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.icon-btn, .top-btn {
  height: 39px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.055);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background .15s, color .15s, transform .15s;
}
.icon-btn { width: 39px; padding: 0; position: relative; }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover, .top-btn:hover { color: var(--text); background: rgba(124,140,255,.13); }
.icon-btn:active, .top-btn:active { transform: translateY(1px); }
.top-btn { padding: 0 12px; gap: 7px; font-weight: 750; font-size: 12px; }
.create-btn { border: 0; color: #fff; background: linear-gradient(135deg, #6879f8, #8865f4 55%, #c764c1); box-shadow: 0 8px 24px rgba(101, 104, 246, .27); }
.create-btn:hover { color: #fff; filter: brightness(1.06); background: linear-gradient(135deg, #6879f8, #8865f4 55%, #c764c1); }
.notification-dot { position: absolute; right: 7px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--topbar); }
.timer-live { color: #fff; border-color: rgba(73,215,160,.4); background: rgba(73,215,160,.16); }
.avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-weight: 850; font-size: 12px; color: #fff; background: linear-gradient(135deg, #6378ff, #e468b4); box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }

.content-shell { min-height: 0; min-width: 0; flex: 1; display: flex; flex-direction: column; overflow: hidden; height: calc(100vh - var(--topbar-height)); }
.contextbar {
  min-height: 54px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--border);
  background: rgba(18, 22, 52, .34);
  backdrop-filter: blur(14px);
  overflow-x: auto;
  scrollbar-width: none;
  flex: 0 0 auto;
}
html[data-theme="light"] .contextbar { background: rgba(255,255,255,.38); }
.contextbar::-webkit-scrollbar { display: none; }
.context-title { margin-right: 7px; min-width: max-content; }
.context-title h1 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.context-title p { margin: 2px 0 0; font-size: 11px; color: var(--subtle); }
.context-actions { display: contents; }
.context-spacer { flex: 1; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.04); }
.segmented button { border: 0; background: transparent; color: var(--muted); height: 31px; padding: 0 11px; border-radius: 7px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.segmented button.active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-soft); }
.filter-select, .toolbar-input {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  padding: 0 11px;
  outline: none;
  font-size: 12px;
  min-width: 140px;
}
.toolbar-input { width: 190px; }
.action-btn {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}
.action-btn svg { width: 16px; height: 16px; }
.action-btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.action-btn.primary { color: #fff; border-color: transparent; background: linear-gradient(135deg, #5f78f4, #8c65ef); }
.action-btn.success { color: #07251b; border-color: transparent; background: var(--success); }
.action-btn.danger { color: #fff; border-color: transparent; background: var(--danger); }
.action-btn.ghost { background: transparent; }

.content { flex: 1; min-height: 0; min-width: 0; overflow-y: auto !important; overflow-x: hidden; padding: var(--pad); scrollbar-width: auto; -webkit-overflow-scrolling: touch; }
.view { min-height: max-content; display: flex; flex-direction: column; gap: 16px; padding-bottom: 40px; }
.page-grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px) saturate(135%);
  min-width: 0;
}
.panel-header { min-height: 54px; display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-bottom: 1px solid var(--border); }
.panel-header h2 { margin: 0; font-size: 14px; letter-spacing: -.015em; }
.panel-header p { margin: 2px 0 0; color: var(--subtle); font-size: 10px; }
.panel-header .panel-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.panel-body { padding: 15px; }
.panel-empty { min-height: 180px; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 28px; }
.panel-empty strong { display: block; color: var(--text); margin-bottom: 5px; }

.metric-card { padding: 16px; position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; right: -28px; bottom: -40px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, var(--metric-glow, rgba(124,140,255,.26)), transparent 65%); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.metric-icon { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; color: var(--metric-color, var(--accent)); background: color-mix(in srgb, var(--metric-color, var(--accent)) 16%, transparent); }
.metric-icon svg { width: 18px; height: 18px; }
.metric-value { font-size: 27px; font-weight: 850; letter-spacing: -.045em; margin: 13px 0 4px; }
.metric-foot { color: var(--subtle); font-size: 10px; }
.metric-change { color: var(--success); font-weight: 800; }

.chart-bars { height: 210px; display: flex; align-items: flex-end; gap: 12px; padding: 16px 7px 6px; }
.chart-bar-wrap { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.chart-bar { width: min(36px, 78%); min-height: 3px; border-radius: 8px 8px 4px 4px; background: linear-gradient(to top, var(--accent), var(--accent-2)); box-shadow: 0 8px 22px rgba(91, 125, 255, .22); transition: height .35s ease; }
.chart-label { color: var(--subtle); font-size: 9px; white-space: nowrap; overflow: hidden; max-width: 100%; text-overflow: ellipsis; }
.chart-value { font-size: 9px; font-weight: 800; color: var(--muted); }

.progress-ring { width: 158px; height: 158px; margin: 11px auto 7px; position: relative; display: grid; place-items: center; }
.progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring .track { stroke: rgba(255,255,255,.08); }
.progress-ring .value { stroke: url(#ringGradient); stroke-linecap: round; transition: stroke-dashoffset .4s; }
.progress-ring-center { position: absolute; text-align: center; }
.progress-ring-center strong { display: block; font-size: 28px; letter-spacing: -.04em; }
.progress-ring-center span { color: var(--subtle); font-size: 10px; }

.activity-list { display: grid; gap: 1px; }
.activity-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(124,140,255,.13); color: var(--accent-2); }
.activity-icon svg { width: 15px; height: 15px; }
.activity-copy { min-width: 0; font-size: 11px; color: var(--muted); line-height: 1.45; }
.activity-copy strong { color: var(--text); }
.activity-time { color: var(--subtle); font-size: 9px; white-space: nowrap; }

.kanban-wrap { min-height: 100%; overflow-x: auto; overflow-y: hidden; padding-bottom: 8px; }
.kanban { min-width: max-content; display: flex; gap: 12px; height: calc(100vh - 160px); align-items: stretch; }
.kanban-column { width: 292px; min-width: 292px; border: 1px solid var(--border); background: rgba(11, 15, 37, .38); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
html[data-theme="light"] .kanban-column { background: rgba(255,255,255,.38); }
.kanban-header { height: 54px; padding: 10px 12px; background: linear-gradient(90deg, color-mix(in srgb, var(--stage) 78%, transparent), color-mix(in srgb, var(--stage) 52%, transparent)); border-bottom: 1px solid rgba(255,255,255,.13); color: #fff; }
.kanban-title-row { display: flex; align-items: center; gap: 8px; }
.kanban-title { font-size: 12px; font-weight: 850; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-count { margin-left: auto; min-width: 21px; height: 21px; display: grid; place-items: center; border-radius: 999px; background: rgba(8,12,30,.28); font-size: 9px; font-weight: 850; }
.kanban-total { margin-top: 4px; opacity: .85; font-size: 9px; }
.kanban-cards { flex: 1; overflow-y: auto; padding: 9px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
.kanban-cards.drag-over { background: rgba(124,140,255,.10); outline: 2px dashed rgba(124,140,255,.44); outline-offset: -5px; }
.kanban-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 11px; box-shadow: 0 8px 22px rgba(0,0,0,.13); cursor: grab; transition: transform .15s, border .15s, opacity .15s; }
.kanban-card:hover { transform: translateY(-2px); border-color: rgba(124,140,255,.38); }
.kanban-card.dragging { opacity: .5; transform: rotate(1.5deg); }
.card-title { font-size: 12px; font-weight: 800; line-height: 1.35; margin-bottom: 6px; }
.card-sub { color: var(--muted); font-size: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-meta { margin-top: 10px; display: flex; align-items: center; gap: 7px; }
.card-value { font-size: 11px; font-weight: 850; }
.card-date { margin-left: auto; color: var(--subtle); font-size: 9px; }
.card-avatar { width: 23px; height: 23px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, #5d74ee, #d26ab3); color: #fff; font-size: 8px; font-weight: 850; }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tag { min-height: 20px; padding: 3px 7px; border-radius: 999px; background: rgba(124,140,255,.12); color: #bdc6ff; font-size: 8px; font-weight: 800; letter-spacing: .02em; }
html[data-theme="light"] .tag { color: #4f5b9c; }
.add-card { margin: 0 9px 9px; height: 34px; border: 1px dashed var(--border-strong); border-radius: 9px; background: transparent; color: var(--subtle); font-size: 11px; font-weight: 700; }
.add-card:hover { color: var(--text); border-color: rgba(124,140,255,.5); background: rgba(124,140,255,.07); }

.table-panel { overflow: hidden; }
.table-scroll { overflow: auto; max-height: calc(100vh - 190px); }
.data-table { width: 100%; border-collapse: collapse; min-width: 820px; }
.data-table th { height: 39px; position: sticky; top: 0; z-index: 2; background: color-mix(in srgb, var(--surface-2) 94%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: 0 12px; text-align: left; color: var(--subtle); text-transform: uppercase; letter-spacing: .06em; font-size: 8px; font-weight: 850; }
.data-table td { height: var(--row-height); border-bottom: 1px solid var(--border); padding: 8px 12px; font-size: 11px; color: var(--muted); }
.data-table tr { transition: background .12s; }
.data-table tbody tr:hover { background: rgba(124,140,255,.07); }
.data-table tr.clickable { cursor: pointer; }
.data-table strong { color: var(--text); }
.table-primary { display: flex; align-items: center; gap: 10px; }
.table-avatar { width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 9px; font-weight: 850; flex: 0 0 auto; background: linear-gradient(135deg, #5e73e8, #cd66b2); }
.table-primary-copy { min-width: 0; }
.table-primary-copy strong, .table-primary-copy span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.table-primary-copy span { font-size: 9px; color: var(--subtle); margin-top: 2px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 3px 8px; border-radius: 999px; font-size: 8px; font-weight: 850; background: rgba(124,140,255,.12); color: #bdc6ff; white-space: nowrap; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.success { color: var(--success); background: rgba(73,215,160,.11); }
.status-pill.warning { color: var(--warning); background: rgba(255,189,85,.12); }
.status-pill.danger { color: var(--danger); background: rgba(255,111,133,.12); }
.status-pill.info { color: var(--info); background: rgba(104,184,255,.12); }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.mini-btn { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--subtle); display: grid; place-items: center; }
.mini-btn:hover { color: var(--text); background: var(--surface-3); }
.mini-btn svg { width: 14px; height: 14px; }

.task-board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 12px; min-width: 980px; min-height: calc(100vh - 175px); }
.task-column { border: 1px solid var(--border); border-radius: var(--radius); background: rgba(11,15,37,.36); padding: 10px; }
.task-column-head { display: flex; align-items: center; gap: 8px; padding: 4px 3px 11px; }
.task-column-head strong { font-size: 12px; }
.task-column-head span { margin-left: auto; font-size: 9px; color: var(--subtle); }
.task-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 11px; margin-bottom: 8px; cursor: pointer; }
.task-card:hover { border-color: rgba(124,140,255,.40); }
.task-top { display: flex; gap: 8px; align-items: flex-start; }
.priority-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; background: var(--info); flex: 0 0 auto; }
.priority-dot.high { background: var(--danger); }
.priority-dot.medium { background: var(--warning); }
.priority-dot.low { background: var(--success); }
.task-title { font-size: 11px; font-weight: 800; line-height: 1.4; }
.task-project { color: var(--subtle); font-size: 9px; margin-top: 5px; }
.task-foot { margin-top: 10px; display: flex; align-items: center; color: var(--subtle); font-size: 9px; }

.projects-panel{padding:18px}.project-catalogue{display:grid;grid-template-columns:repeat(auto-fit,minmax(290px,1fr));gap:14px;padding:2px}.project-card{padding:20px;border:1px solid var(--border);border-radius:18px;background:linear-gradient(145deg,rgba(124,140,255,.08),rgba(73,217,181,.035));cursor:pointer;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}.project-card:hover{transform:translateY(-2px);border-color:rgba(124,140,255,.5);box-shadow:0 16px 34px rgba(5,8,30,.22)}.project-card-top{display:flex;align-items:center;gap:10px}.project-card-top .status-pill{margin-left:auto}.project-card-top .row-actions{margin-left:2px}.project-mark{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;color:#fff;background:linear-gradient(135deg,var(--primary),var(--accent))}.project-mark svg{width:19px;height:19px}.project-card h3{font-size:19px;margin:17px 0 8px}.project-meta{display:flex;gap:8px;flex-wrap:wrap;color:var(--muted);font-size:12px}.project-meta span:not(:last-child)::after{content:"/";margin-left:8px}.project-progress{margin-top:20px}.project-progress>div:first-child{display:flex;justify-content:space-between;font-size:12px;color:var(--muted)}.project-progress strong{color:var(--text)}.progress-track{height:7px;border-radius:999px;background:rgba(255,255,255,.07);overflow:hidden;margin-top:8px}.progress-track i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--primary),var(--accent))}.project-foot{display:flex;justify-content:space-between;align-items:center;margin-top:18px;padding-top:14px;border-top:1px solid var(--border);font-size:12px;color:var(--muted)}.project-foot span{display:flex;align-items:center;gap:6px}.project-foot svg{width:14px;height:14px}.project-foot strong{color:var(--text)}.project-empty{min-height:360px}.project-empty svg{width:44px;height:44px;color:var(--primary)}

@media(max-width:700px){.projects-panel{padding:12px}.projects-panel>.panel-header{align-items:flex-start}.project-catalogue{grid-template-columns:1fr}.project-card{padding:17px}}
.project-progress .progress-track i{background:linear-gradient(90deg,#20b978,#57dfa2);box-shadow:0 0 12px rgba(73,217,160,.38)}
.project-task-overview{margin-top:16px;border:1px solid var(--border);border-radius:13px;overflow:hidden;background:rgba(7,12,38,.2)}
.project-task-toggle{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:12px;padding:12px 14px;border:0;background:rgba(255,255,255,.025);color:var(--text);cursor:pointer;text-align:left}
.project-task-toggle:hover{background:rgba(73,217,160,.07)}
.project-task-toggle:disabled{cursor:default;opacity:.65}
.project-task-toggle span{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:800}
.project-task-toggle span svg{width:15px;height:15px;color:var(--success)}
.project-task-toggle strong{font-size:11px;color:var(--success)}
.project-task-toggle em{font-style:normal;font-size:10px;color:var(--muted)}
.project-task-list{border-top:1px solid var(--border);padding:5px;background:rgba(2,7,28,.18)}
.project-task-row{width:100%;display:grid;grid-template-columns:24px minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px;border:0;border-radius:9px;background:transparent;color:var(--text);text-align:left;cursor:pointer}
.project-task-row:hover{background:rgba(124,140,255,.09)}
.project-task-check{width:20px;height:20px;border:1px solid rgba(255,255,255,.18);border-radius:6px;display:grid;place-items:center}
.project-task-check.complete{border-color:rgba(73,217,160,.55);background:rgba(73,217,160,.16);color:var(--success)}
.project-task-check svg{width:12px;height:12px}
.project-task-copy{min-width:0;display:flex;flex-direction:column;gap:3px}
.project-task-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}
.project-task-copy small{font-size:9px;color:var(--muted)}
@media(max-width:700px){.project-task-toggle{grid-template-columns:minmax(0,1fr) auto}.project-task-toggle em{grid-column:1/-1}.project-task-row{grid-template-columns:24px minmax(0,1fr)}.project-task-row>.status-pill{grid-column:2}}
.telegram-chat-composer{margin:0 18px 16px;padding:14px;border:1px solid var(--border);border-radius:14px;background:var(--surface-2)}.telegram-chat-composer textarea{width:100%;resize:vertical;min-height:76px}.telegram-chat-composer>div{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px;color:var(--muted);font-size:11px}.telegram-chat-composer strong{color:var(--text)}
@media(max-width:700px){.telegram-chat-composer{margin:0 12px 12px}.telegram-chat-composer>div{align-items:flex-start;flex-direction:column}.telegram-chat-composer .action-btn{width:100%;justify-content:center}}
.task-foot .overdue { color: var(--danger); font-weight: 800; }
.task-foot .card-avatar { margin-left: auto; }

.calendar-shell { display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 14px; }
.calendar { overflow: hidden; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.calendar-weekdays div { height: 34px; display: grid; place-items: center; color: var(--subtle); font-size: 9px; font-weight: 800; border-bottom: 1px solid var(--border); }
.calendar-day { min-height: 112px; padding: 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: rgba(255,255,255,.012); overflow: hidden; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.muted { opacity: .42; }
.calendar-day.today { background: rgba(124,140,255,.08); box-shadow: inset 0 0 0 1px rgba(124,140,255,.30); }
.day-number { width: 25px; height: 25px; border-radius: 8px; display: grid; place-items: center; font-size: 10px; font-weight: 800; }
.today .day-number { background: var(--accent); color: #fff; }
.calendar-event { margin-top: 5px; border-left: 3px solid var(--event-color, var(--accent)); border-radius: 6px; padding: 4px 6px; background: color-mix(in srgb, var(--event-color, var(--accent)) 14%, transparent); font-size: 8px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.upcoming-list { display: grid; gap: 8px; }
.upcoming-item { border: 1px solid var(--border); border-radius: 11px; padding: 10px; background: rgba(255,255,255,.02); }
.upcoming-time { color: var(--accent-2); font-size: 9px; font-weight: 850; }
.upcoming-title { font-size: 11px; font-weight: 800; margin-top: 5px; }
.upcoming-sub { color: var(--subtle); font-size: 9px; margin-top: 3px; }

.inbox-layout { height: calc(100vh - 158px); display: grid; grid-template-columns: 330px minmax(0,1fr); overflow: hidden; }
.conversation-list { border-right: 1px solid var(--border); overflow-y: auto; }
.conversation-search { padding: 10px; position: sticky; top: 0; background: var(--surface); z-index: 2; border-bottom: 1px solid var(--border); }
.conversation-search input { width: 100%; height: 35px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); padding: 0 10px; outline: none; }
.conversation-item { min-height: 76px; padding: 11px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 9px; cursor: pointer; }
.conversation-item:hover, .conversation-item.active { background: rgba(124,140,255,.08); }
.conv-avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 850; background: linear-gradient(135deg, #5e76ed, #5ad9d4); }
.conv-name { font-size: 11px; font-weight: 820; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-preview { color: var(--subtle); font-size: 9px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { color: var(--subtle); font-size: 8px; text-align: right; }
.unread { width: 18px; height: 18px; margin: 7px 0 0 auto; border-radius: 999px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 8px; font-weight: 850; }
.chat-pane { min-width: 0; display: grid; grid-template-rows: 58px minmax(0,1fr) auto; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.chat-head-copy strong { display: block; font-size: 12px; }
.chat-head-copy span { display: block; margin-top: 2px; color: var(--subtle); font-size: 9px; }
.chat-head .panel-actions { margin-left: auto; }
.messages { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 9px; }
.message { max-width: min(680px, 80%); padding: 9px 11px; border-radius: 12px 12px 12px 3px; background: var(--surface-3); align-self: flex-start; font-size: 11px; line-height: 1.45; }
.message.out { align-self: flex-end; border-radius: 12px 12px 3px 12px; color: #fff; background: linear-gradient(135deg, #6279ef, #8c68ee); }
.message-time { display: block; opacity: .65; font-size: 8px; margin-top: 5px; text-align: right; }
.composer { padding: 11px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 40px; max-height: 120px; resize: vertical; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); padding: 10px; outline: none; }
.mailbox-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; margin-bottom: 12px; }
.mailbox-toolbar-copy { display: flex; align-items: center; gap: 11px; min-width: 0; }
.mailbox-toolbar-copy > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mailbox-toolbar-copy strong { font-size: 13px; }
.mailbox-toolbar-copy span { color: var(--subtle); font-size: 9px; }
.mailbox-logo { flex: 0 0 auto; background: linear-gradient(135deg, #6478f0, #46d4c0); }
.mailbox-alert { margin-bottom: 12px; }
.conv-subject { margin-top: 3px; color: var(--text); font-size: 9px; font-weight: 760; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mailbox-list-empty { min-height: 250px; padding: 28px 18px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; text-align: center; color: var(--subtle); }
.mailbox-list-empty strong { color: var(--text); font-size: 12px; }
.mailbox-list-empty span { max-width: 240px; font-size: 9px; line-height: 1.55; }
.mailbox-empty-pane { place-items: center; padding: 30px; text-align: center; }
.mailbox-empty-pane > div { max-width: 430px; }
.mailbox-empty-pane h2 { margin: 12px 0 6px; }
.mailbox-empty-pane p { color: var(--subtle); line-height: 1.6; }
.message-envelope { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 9px; }
.message-envelope span { opacity: .72; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.mail-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.mail-attachments span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 8px; background: rgba(255,255,255,.08); font-size: 8px; }
.mail-attachments svg { width: 12px; height: 12px; }
.mail-from-select { min-width: 178px; display: flex; flex-direction: column; gap: 4px; color: var(--subtle); font-size: 8px; font-weight: 750; }
.mail-from-select select { width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); padding: 0 9px; outline: none; }
.mail-composer { display: grid; grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) auto; align-items: end; }
.mail-composer textarea { width: 100%; }
.mail-alias-list { display: flex; flex-wrap: wrap; gap: 7px; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 12px; }
.entity-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 14px; box-shadow: var(--shadow-soft); min-width: 0; }
.entity-card:hover { border-color: rgba(124,140,255,.34); }
.entity-card-top { display: flex; align-items: flex-start; gap: 10px; }
.entity-logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 17px; font-weight: 850; color: #fff; background: linear-gradient(135deg, #6179f0, #cf66b1); flex: 0 0 auto; }
.entity-card-copy { min-width: 0; }
.entity-card-copy h3 { margin: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entity-card-copy p { margin: 4px 0 0; color: var(--subtle); font-size: 9px; line-height: 1.4; }
.entity-card .kebab { margin-left: auto; }
.entity-card-stats { margin-top: 13px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.entity-stat { border-radius: 10px; background: rgba(255,255,255,.035); padding: 8px; }
.entity-stat span { display: block; color: var(--subtle); font-size: 8px; }
.entity-stat strong { display: block; margin-top: 4px; font-size: 12px; }

.integration-toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.integration-categories { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); padding: 0 10px; color: var(--muted); font-size: 9px; font-weight: 780; }
.chip.active { color: #fff; border-color: transparent; background: var(--accent); }
.integration-card { display: flex; flex-direction: column; min-height: 188px; }
.integration-logo { width: 45px; height: 45px; border-radius: 13px; display: grid; place-items: center; font-size: 18px; font-weight: 900; color: #fff; background: var(--integration-bg, linear-gradient(135deg,#677cf1,#61d7dd)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.integration-card h3 { margin: 12px 0 4px; font-size: 12px; }
.integration-card p { margin: 0; color: var(--subtle); font-size: 9px; line-height: 1.5; flex: 1; }
.integration-foot { margin-top: 12px; display: flex; align-items: center; gap: 7px; }
.integration-foot .action-btn { margin-left: auto; height: 31px; font-size: 9px; }

.automation-flow { display: flex; align-items: stretch; gap: 12px; overflow-x: auto; padding: 8px 2px 14px; }
.flow-node { width: 230px; min-width: 230px; border: 1px solid var(--border); border-radius: 13px; padding: 12px; background: var(--surface-2); position: relative; }
.flow-node:not(:last-child)::after { content: "→"; position: absolute; right: -18px; top: 50%; transform: translateY(-50%); color: var(--subtle); font-weight: 900; }
.flow-node-type { color: var(--accent-2); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.flow-node strong { display: block; margin-top: 7px; font-size: 11px; }
.flow-node p { margin: 5px 0 0; color: var(--subtle); font-size: 9px; line-height: 1.4; }

.knowledge-layout { height: calc(100vh - 158px); display: grid; grid-template-columns: 265px minmax(0,1fr); overflow: hidden; }
.knowledge-nav { border-right: 1px solid var(--border); overflow-y: auto; padding: 10px; }
.knowledge-item { width: 100%; border: 0; border-radius: 9px; background: transparent; color: var(--muted); padding: 9px 10px; text-align: left; font-size: 10px; margin-bottom: 3px; }
.knowledge-item:hover, .knowledge-item.active { background: rgba(124,140,255,.09); color: var(--text); }
.knowledge-article { overflow-y: auto; padding: clamp(20px, 5vw, 55px); }
.article-wrap { max-width: 820px; margin: 0 auto; }
.article-wrap h1 { margin: 0 0 10px; font-size: clamp(27px,4vw,42px); letter-spacing: -.045em; }
.article-meta { color: var(--subtle); font-size: 10px; margin-bottom: 28px; }
.article-content { color: var(--muted); font-size: 13px; line-height: 1.75; }
.article-content h2 { color: var(--text); margin-top: 28px; }
.article-content code { background: var(--surface-3); border: 1px solid var(--border); border-radius: 5px; padding: 2px 5px; }

.settings-layout { display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 15px; }
.settings-nav { padding: 9px; align-self: start; position: sticky; top: 0; }
.settings-nav button { width: 100%; height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; padding: 0 10px; font-size: 10px; font-weight: 750; }
.settings-nav button:hover, .settings-nav button.active { color: var(--text); background: rgba(124,140,255,.09); }
.settings-section { padding: 18px; margin-bottom: 13px; }
.settings-section h2 { margin: 0 0 5px; font-size: 15px; }
.settings-section > p { margin: 0 0 17px; color: var(--subtle); font-size: 10px; }
.setting-row { min-height: 57px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 16px; border-top: 1px solid var(--border); padding: 10px 0; }
.setting-row:first-of-type { border-top: 0; }
.setting-copy strong { display: block; font-size: 11px; }
.setting-copy span { display: block; margin-top: 3px; color: var(--subtle); font-size: 9px; line-height: 1.4; }
.switch { width: 42px; height: 24px; border: 0; border-radius: 999px; background: var(--surface-3); padding: 3px; transition: background .17s; }
.switch::after { content: ""; display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 7px rgba(0,0,0,.22); transition: transform .17s; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(18px); }
.theme-options { display: flex; gap: 8px; }
.theme-option { width: 98px; height: 61px; border: 2px solid transparent; border-radius: 11px; padding: 6px; background: var(--surface-2); position: relative; }
.theme-option.active { border-color: var(--accent); }
.theme-preview { width: 100%; height: 100%; border-radius: 7px; overflow: hidden; display: grid; grid-template-columns: 23% 1fr; background: #eceff8; }
.theme-preview.dark { background: #11162f; }
.theme-preview span:first-child { background: #1b2140; }
.theme-preview.light span:first-child { background: #fff; }
.theme-preview span:last-child { margin: 6px; border-radius: 4px; background: rgba(124,140,255,.28); }

.drawer-backdrop, .modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(3, 6, 18, .46);
  backdrop-filter: blur(3px);
  animation: fade-in .14s ease;
}
.drawer { position: fixed; z-index: 90; top: 0; right: 0; bottom: 0; width: min(590px, 94vw); background: color-mix(in srgb, var(--sidebar) 96%, transparent); border-left: 1px solid var(--border-strong); box-shadow: -24px 0 70px rgba(0,0,0,.35); display: grid; grid-template-rows: auto minmax(0,1fr) auto; animation: slide-in .20s ease; backdrop-filter: blur(28px) saturate(150%); }
.drawer-head { min-height: 68px; display: flex; align-items: center; gap: 11px; padding: 12px 15px; border-bottom: 1px solid var(--border); }
.drawer-head-copy { min-width: 0; }
.drawer-head-copy h2 { margin: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-head-copy p { margin: 4px 0 0; color: var(--subtle); font-size: 9px; }
.drawer-head .close-btn { margin-left: auto; }
.drawer-body { overflow-y: auto; padding: 16px; }
.drawer-foot { min-height: 61px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 15px; border-top: 1px solid var(--border); }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.detail-block { border: 1px solid var(--border); border-radius: 11px; padding: 10px; background: rgba(255,255,255,.025); }
.detail-block.full { grid-column: 1 / -1; }
.detail-label { color: var(--subtle); font-size: 8px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.detail-value { margin-top: 5px; font-size: 11px; color: var(--text); line-height: 1.45; overflow-wrap: anywhere; }
.detail-section { margin-top: 18px; }
.detail-section h3 { margin: 0 0 8px; font-size: 12px; }
.timeline { position: relative; padding-left: 17px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 5px; bottom: 5px; width: 1px; background: var(--border-strong); }
.timeline-item { position: relative; padding: 0 0 13px 11px; }
.timeline-item::before { content: ""; position: absolute; left: -15px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 13%, transparent); }
.timeline-item strong { display: block; font-size: 10px; }
.timeline-item p { margin: 4px 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.timeline-item time { color: var(--subtle); font-size: 8px; }

.modal { position: fixed; z-index: 100; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(660px, calc(100vw - 32px)); max-height: calc(100vh - 40px); background: color-mix(in srgb, var(--sidebar) 97%, transparent); border: 1.5px solid var(--border-strong); border-radius: 20px; box-shadow: 0 30px 95px rgba(0,0,0,.55); display: flex; flex-direction: column; overflow: hidden; animation: modal-in .18s ease; backdrop-filter: blur(30px) saturate(150%); }
.modal.wide { width: min(920px, calc(100vw - 32px)); }
.modal-head { min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 750; }
.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.modal-head .close-btn { margin-left: auto; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px; scrollbar-width: thin; scrollbar-color: rgba(124,140,255,.3) transparent; }
.modal-foot { min-height: 64px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--border); flex: 0 0 auto; }
.prospect-import-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.prospect-import-summary article { padding: 16px; border: 1px solid var(--border); border-radius: 15px; background: color-mix(in srgb, var(--panel) 88%, transparent); display: grid; gap: 5px; }
.prospect-import-summary strong { font-size: 26px; line-height: 1; color: var(--text); }
.prospect-import-summary span, .import-row-sub, .import-truncated { color: var(--muted); font-size: 12px; }
.import-note { display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--info) 35%, var(--border)); border-radius: 12px; color: var(--muted); background: color-mix(in srgb, var(--info) 8%, transparent); }
.import-note svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--info); }
.prospect-import-table { max-height: 430px; border: 1px solid var(--border); border-radius: 14px; }
.prospect-import-table td:first-child { min-width: 190px; }
.prospect-import-table td:last-child { min-width: 220px; color: var(--muted); }
.import-row-sub { display: block; margin-top: 3px; }
.import-truncated { margin: 10px 2px 0; }
.prospect-import-loading { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); }
.loading-spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.form-field { min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { display: block; color: var(--muted); font-size: 11px; font-weight: 700; margin-bottom: 6px; letter-spacing: .01em; }
.form-field input, .form-field select, .form-field textarea { width: 100%; border: 1.5px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.04); outline: none; padding: 0 12px; font-size: 13px; color: var(--text); transition: border .15s, box-shadow .15s; }
.form-field input, .form-field select { height: 42px; }
.form-field textarea { min-height: 100px; resize: vertical; padding-top: 10px; line-height: 1.5; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,140,255,.20); background: rgba(255,255,255,.07); }
.form-field select { appearance: auto; -webkit-appearance: auto; cursor: pointer; color: var(--text); background-color: var(--surface-2); }
.form-field select option { background: var(--bg); color: var(--text); padding: 8px; }
html[data-theme="light"] .form-field select { background-color: #fff; color: #17203a; }
html[data-theme="light"] .form-field select option { background: #fff; color: #17203a; }
.form-help { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.form-error { color: var(--danger); font-size: 9px; margin-top: 5px; }
.quick-create-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.quick-create-card { min-height: 100px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--muted); padding: 12px; text-align: left; }
.quick-create-card:hover { border-color: rgba(124,140,255,.42); color: var(--text); background: var(--surface-3); }
.quick-create-card svg { width: 22px; height: 22px; color: var(--accent-2); }
.quick-create-card strong { display: block; color: var(--text); margin-top: 8px; font-size: 11px; }
.quick-create-card span { display: block; margin-top: 4px; font-size: 8px; line-height: 1.35; }

.dropdown { position: fixed; z-index: 110; width: 310px; max-height: 420px; overflow-y: auto; border: 1px solid var(--border-strong); border-radius: 14px; background: color-mix(in srgb, var(--sidebar) 97%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(28px) saturate(150%); animation: dropdown-in .14s ease; }
.dropdown-head { padding: 12px; display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.dropdown-head strong { font-size: 11px; }
.dropdown-head button { margin-left: auto; border: 0; background: transparent; color: var(--accent-2); font-size: 9px; }
.dropdown-item { padding: 10px 12px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 9px; cursor: pointer; }
.dropdown-item:last-child { border-bottom: 0; }
.dropdown-item:hover { background: rgba(124,140,255,.08); }
.dropdown-item.unseen { background: rgba(124,140,255,.05); }
.dropdown-copy { min-width: 0; font-size: 9px; color: var(--muted); line-height: 1.45; }
.dropdown-copy strong { color: var(--text); }
.dropdown-copy time { display: block; color: var(--subtle); margin-top: 3px; font-size: 8px; }

.search-results { position: fixed; z-index: 120; top: 58px; left: min(calc(var(--sidebar-width) + 200px), 31vw); width: min(620px, calc(100vw - 320px)); max-height: 460px; overflow-y: auto; border: 1px solid var(--border-strong); border-radius: 14px; background: color-mix(in srgb, var(--sidebar) 97%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(28px); }
.sidebar-collapsed .search-results { left: 150px; }
.search-result-section { padding: 9px 10px 4px; color: var(--subtle); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.search-result { width: 100%; min-height: 48px; border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--muted); padding: 8px 11px; display: flex; align-items: center; gap: 10px; text-align: left; }
.search-result:hover { background: rgba(124,140,255,.08); }
.search-result-icon { width: 30px; height: 30px; border-radius: 9px; background: rgba(124,140,255,.12); display: grid; place-items: center; color: var(--accent-2); }
.search-result-copy { min-width: 0; }
.search-result-copy strong { display: block; color: var(--text); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-copy span { display: block; color: var(--subtle); margin-top: 3px; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.command-palette { position: fixed; z-index: 140; top: 14vh; left: 50%; transform: translateX(-50%); width: min(650px, calc(100vw - 28px)); border: 1px solid var(--border-strong); border-radius: 16px; background: color-mix(in srgb, var(--sidebar) 97%, transparent); box-shadow: 0 35px 100px rgba(0,0,0,.5); overflow: hidden; backdrop-filter: blur(30px) saturate(150%); animation: command-in .16s ease; }
.command-input { width: 100%; height: 57px; border: 0; border-bottom: 1px solid var(--border); background: transparent; padding: 0 17px; outline: none; font-size: 14px; }
.command-list { max-height: 430px; overflow-y: auto; padding: 7px; }
.command-group-label { padding: 9px 9px 5px; color: var(--subtle); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.command-item { width: 100%; min-height: 43px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); display: flex; align-items: center; gap: 10px; padding: 7px 9px; text-align: left; }
.command-item:hover, .command-item.selected { background: rgba(124,140,255,.10); color: var(--text); }
.command-item svg { width: 18px; height: 18px; color: var(--accent-2); }
.command-item span { font-size: 10px; font-weight: 760; }
.command-item kbd { margin-left: auto; color: var(--subtle); border: 1px solid var(--border); border-radius: 5px; padding: 2px 5px; font-size: 8px; }

.toast-stack { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: grid; gap: 8px; width: min(350px, calc(100vw - 32px)); }
.toast { min-height: 52px; border: 1px solid var(--border-strong); border-radius: 12px; background: color-mix(in srgb, var(--sidebar) 96%, transparent); box-shadow: var(--shadow); display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 9px 11px; animation: toast-in .20s ease; backdrop-filter: blur(24px); }
.toast-icon { width: 29px; height: 29px; border-radius: 9px; display: grid; place-items: center; color: var(--success); background: rgba(73,215,160,.12); }
.toast-copy strong { display: block; font-size: 10px; }
.toast-copy span { display: block; color: var(--subtle); margin-top: 3px; font-size: 8px; line-height: 1.4; }
.toast button { border: 0; background: transparent; color: var(--subtle); }

.empty-state { min-height: 320px; display: grid; place-items: center; text-align: center; padding: 30px; }
.empty-state-icon { width: 66px; height: 66px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto 15px; background: rgba(124,140,255,.12); color: var(--accent-2); }
.empty-state-icon svg { width: 31px; height: 31px; }
.empty-state h2 { margin: 0; font-size: 16px; }
.empty-state p { max-width: 440px; margin: 7px auto 14px; color: var(--subtle); font-size: 10px; line-height: 1.6; }

.skeleton { border-radius: 8px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.10), rgba(255,255,255,.04)); background-size: 220% 100%; animation: shimmer 1.2s infinite; }
hr.soft { border: 0; border-top: 1px solid var(--border); margin: 15px 0; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-right { text-align: right; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.ml-auto { margin-left: auto; }
.hidden { display: none !important; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { transform: translateX(25px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes modal-in { from { transform: translate(-50%,-47%) scale(.98); opacity: 0; } to { transform: translate(-50%,-50%) scale(1); opacity: 1; } }
@keyframes dropdown-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes command-in { from { opacity: 0; transform: translate(-50%,-8px) scale(.98); } to { opacity: 1; transform: translate(-50%,0) scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grid-main { grid-template-columns: 1fr; }
  .calendar-shell { grid-template-columns: 1fr; }
  .calendar-shell > aside { display: none; }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 76px; }
  .brand-copy, .nav-text, .nav-badge, .nav-label, .collapse-btn span { display: none; }
  .brand { padding: 0 18px; }
  .nav-item { justify-content: center; padding: 0; }
  .collapse-btn { justify-content: center; padding: 0; }
  .workspace-switcher { min-width: 45px; width: 45px; padding: 0; justify-content: center; }
  .workspace-switcher > span:not(.workspace-dot) { display: none; }
  .top-btn span { display: none; }
  .top-btn { width: 39px; padding: 0; }
  .inbox-layout { grid-template-columns: 265px minmax(0,1fr); }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { display: none; }
  .search-results { left: 100px; width: calc(100vw - 130px); }
}

@media (max-width: 680px) {
  body { overflow: auto; }
  .app-shell, .app-shell.sidebar-collapsed { grid-template-columns: 1fr; grid-template-rows: minmax(0,1fr) 66px; }
  .sidebar { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: 66px; border-right: 0; border-top: 1px solid var(--border); flex-direction: row; z-index: 60; }
  .brand, .sidebar-footer, .nav-label { display: none; }
  .nav-scroll { width: 100%; padding: 7px 8px; overflow-x: auto; overflow-y: hidden; }
  .nav-section { display: contents; }
  .nav-scroll { display: flex; gap: 3px; }
  .nav-item { width: 58px; min-width: 58px; height: 52px; flex-direction: column; justify-content: center; gap: 3px; padding: 0; margin: 0; }
  .nav-item.active::before { left: 50%; top: -7px; width: 24px; height: 3px; transform: translateX(-50%); }
  .nav-text { display: block; opacity: 1; width: auto; font-size: 7px; max-width: 55px; }
  .nav-icon { width: 18px; height: 18px; }
  .nav-icon svg { width: 18px; height: 18px; }
  .app-main { grid-row: 1; height: calc(100vh - 66px); }
  .topbar { padding: 0 10px; gap: 7px; }
  .workspace-switcher { display: none; }
  .global-search { min-width: 0; }
  .global-search kbd { display: none; }
  .global-search input { padding-right: 10px; }
  .top-actions .icon-btn:nth-of-type(1), .top-actions .top-btn:not(.create-btn) { display: none; }
  .avatar { display: none; }
  .contextbar { padding: 8px 10px; }
  .context-title p { display: none; }
  .context-title h1 { font-size: 15px; }
  .toolbar-input, .filter-select { min-width: 120px; width: 120px; }
  .content { padding: 10px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .kanban { height: calc(100vh - 210px); }
  .kanban-column { width: 265px; min-width: 265px; }
  .inbox-layout { height: calc(100vh - 205px); grid-template-columns: 1fr; }
  .conversation-list { border-right: 0; }
  .chat-pane { display: none; }
  .inbox-layout.chat-open .conversation-list { display: none; }
  .inbox-layout.chat-open .chat-pane { display: grid; }
  .knowledge-layout { height: calc(100vh - 205px); grid-template-columns: 1fr; }
  .knowledge-nav { display: none; }
  .calendar-day { min-height: 79px; padding: 4px; }
  .calendar-event { padding: 3px; font-size: 0; width: 8px; height: 8px; border: 0; border-radius: 50%; display: inline-block; background: var(--event-color); }
  .quick-create-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .detail-block.full, .form-field.full { grid-column: auto; }
  .search-results { top: 58px; left: 10px; width: calc(100vw - 20px); }
  .task-board { min-width: 900px; }
}

body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

.segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.segmented button svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

/* ── Login / access gate ──────────────────────────────────────────────────── */
.login-mode {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  grid-template-columns: none !important;
}
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100vw;
  background: var(--bg);
  background-image: radial-gradient(ellipse at 20% 20%, rgba(124,140,255,.14) 0%, transparent 60%),
                    radial-gradient(ellipse at 80% 80%, rgba(233,111,183,.12) 0%, transparent 60%);
}
.login-card {
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 36px 32px;
  width: 100%;
  max-width: 410px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  margin: auto;
}
.login-card input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(124,140,255,.18);
}
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.google-btn:hover {
  background: var(--surface-3);
  border-color: var(--accent);
}
.login-divider {
  display: flex;
  align-items: center;
  margin: 18px 0;
  color: var(--subtle);
  font-size: 11px;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border);
}
.login-divider span {
  padding: 0 10px;
}
.accent-blue { color: var(--info); }

/* ── Modern Responsive Mobile & Team Chat Suite Styles ── */
.team-chat-suite {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 240px;
  height: calc(100vh - 120px);
  max-height: calc(100dvh - 100px);
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  position: relative;
}

.team-chat-sidebar-left {
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.team-chat-sidebar-right {
  background: var(--surface-2);
  border-left: 1px solid var(--border);
  padding: 14px;
  overflow-y: auto;
}

/* Social CRM */
.social-crm { display: grid; gap: 14px; padding-bottom: 26px; }
.social-intro { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(260px,.7fr); gap: 24px; align-items: center; padding: 22px; overflow: hidden; position: relative; }
.social-intro::after { content: ""; position: absolute; width: 260px; height: 260px; right: -90px; top: -130px; border-radius: 50%; background: radial-gradient(circle, rgba(220,58,133,.18), transparent 68%); pointer-events: none; }
.social-intro h2 { margin: 5px 0 6px; font-size: 20px; }
.social-intro p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; max-width: 720px; }
.social-security-note, .social-vault-banner { display: flex; gap: 10px; align-items: flex-start; border: 1px solid rgba(73,215,160,.24); background: rgba(73,215,160,.08); border-radius: 13px; padding: 13px; color: var(--success); position: relative; z-index: 1; }
.social-security-note svg, .social-vault-banner svg { width: 20px; height: 20px; flex: 0 0 20px; }
.social-security-note strong, .social-vault-banner strong { display: block; color: var(--text); font-size: 10px; }
.social-security-note span, .social-vault-banner span { display: block; color: var(--muted); font-size: 9px; line-height: 1.5; margin-top: 3px; }
.social-alert { display: flex; gap: 10px; align-items: center; border: 1px solid rgba(255,111,133,.3); background: rgba(255,111,133,.08); border-radius: 12px; padding: 12px 14px; color: var(--danger); }
.social-alert svg { width: 20px; height: 20px; }
.social-alert strong, .social-alert span { display: block; font-size: 10px; }
.social-alert span { color: var(--muted); margin-top: 3px; }
.social-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.social-metric-card { min-height: 104px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, transparent), color-mix(in srgb, var(--surface-2) 92%, transparent)); }
.social-metric-card > span { color: var(--muted); font-size: 9px; font-weight: 700; }
.social-metric-card strong { display: block; margin: 8px 0 5px; font-size: 25px; letter-spacing: -.03em; }
.social-metric-card small { color: var(--subtle); font-size: 8px; line-height: 1.35; }
.social-provider-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.social-provider-card { border: 1px solid var(--border); border-radius: 15px; background: var(--surface); padding: 16px; min-width: 0; display: flex; flex-direction: column; gap: 13px; }
.social-provider-card::before { content: ""; height: 3px; border-radius: 999px; background: var(--social-provider); margin: -16px -16px 2px; }
.social-provider-head { display: grid; grid-template-columns: 39px minmax(0,1fr) auto; gap: 10px; align-items: start; }
.social-provider-mark { width: 39px; height: 39px; border-radius: 12px; display: grid; place-items: center; background: var(--social-provider); color: #fff; font-size: 14px; font-weight: 900; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.social-provider-head h3 { margin: 2px 0 3px; font-size: 12px; }
.social-provider-head p { margin: 0; color: var(--subtle); font-size: 8px; line-height: 1.45; }
.social-provider-empty { min-height: 38px; color: var(--muted); font-size: 9px; line-height: 1.5; padding: 10px; border: 1px dashed var(--border); border-radius: 10px; }
.social-provider-accounts { display: grid; gap: 6px; }
.social-provider-accounts > div { background: var(--surface-2); border-radius: 9px; padding: 8px 10px; }
.social-provider-accounts strong, .social-provider-accounts span { display: block; font-size: 9px; }
.social-provider-accounts span { color: var(--subtle); font-size: 8px; margin-top: 2px; }
.social-provider-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: auto; }
.social-provider-actions .action-btn { flex: 1 1 auto; justify-content: center; font-size: 8px; }
.social-detail-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(290px,.8fr); gap: 10px; }
.social-trend-panel, .social-health-panel { min-height: 260px; }
.social-bars { height: 170px; display: flex; align-items: end; gap: 5px; padding: 12px 18px 17px; }
.social-bar-wrap { height: 100%; min-width: 12px; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; }
.social-bar { width: 100%; max-width: 24px; min-height: 5px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg,#dc3a85,#6f48d8); }
.social-bar-wrap span { color: var(--subtle); font-size: 7px; transform: rotate(-35deg); white-space: nowrap; }
.social-chart-empty { min-height: 176px; display: grid; place-content: center; text-align: center; padding: 24px; }
.social-chart-empty strong, .social-chart-empty span { display: block; font-size: 10px; }
.social-chart-empty span { color: var(--subtle); font-size: 9px; margin-top: 5px; }
.social-health-row { display: grid; grid-template-columns: 9px minmax(0,1fr) auto 28px; gap: 8px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--border); }
.social-health-row strong, .social-health-row small { display: block; font-size: 9px; }
.social-health-row small { color: var(--subtle); margin-top: 2px; }
.social-platform-dot { width: 8px; height: 8px; border-radius: 50%; background: #7c8cff; }
.social-platform-dot.instagram { background: #dc3a85; }.social-platform-dot.facebook { background: #1877f2; }.social-platform-dot.tiktok { background: #27e7e7; }
.social-thumb { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; background: var(--surface-3); }
.social-content-panel .panel-empty { min-height: 160px; }
.social-vault-banner { margin-bottom: 16px; }
.social-provider-switch { margin-bottom: 15px; }
.social-configured-summary { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; margin-bottom: 15px; }
.social-configured-summary strong, .social-configured-summary small { display: block; font-size: 9px; }.social-configured-summary small { color: var(--subtle); margin-top: 2px; }
.social-callback-box { margin-top: 15px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.social-callback-box strong { display: block; font-size: 9px; margin-bottom: 6px; }.social-callback-box code { display: block; color: var(--accent-2); font-size: 8px; word-break: break-all; }

@media (max-width: 1100px) {
  .social-metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .social-provider-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .social-intro, .social-detail-grid { grid-template-columns: 1fr; }
  .social-intro { padding: 16px; }
  .social-metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .social-provider-head { grid-template-columns: 39px minmax(0,1fr); }
  .social-provider-head > .status-pill { grid-column: 1 / -1; width: fit-content; }
  .social-trend-panel, .social-health-panel { min-height: auto; }
}

@media (max-width: 430px) {
  .social-metric-grid { grid-template-columns: 1fr; }
  .social-metric-card { min-height: 92px; }
  .social-provider-actions { flex-direction: column; }
  .social-provider-actions .action-btn { width: 100%; }
}

/* CRM AI Team */
.ai-team-workspace { display: grid; gap: 12px; padding-bottom: 28px; }
.ai-team-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.ai-team-summary > div { min-height: 82px; display: flex; flex-direction: column; justify-content: center; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(145deg,var(--surface),var(--surface-2)); }
.ai-team-summary strong { font-size: 22px; letter-spacing: -.03em; }
.ai-team-summary span { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 700; }
.ai-team-nav { display: flex; gap: 5px; padding: 5px; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.ai-team-nav button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 9px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.ai-team-nav button:hover,.ai-team-nav button.active { color: var(--text); background: var(--surface-3); }
.ai-team-layout { display: grid; grid-template-columns: minmax(230px,.62fr) minmax(0,1.6fr); gap: 10px; min-height: 590px; }
.ai-split { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; align-items: start; }
.ai-agent-list .panel-body { display: grid; gap: 6px; padding: 8px; }
.ai-agent-card { width: 100%; display: grid; grid-template-columns: 36px minmax(0,1fr) 8px; gap: 9px; align-items: center; padding: 10px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.ai-agent-card:hover,.ai-agent-card.active { border-color: rgba(124,140,255,.34); background: rgba(124,140,255,.09); }
.ai-agent-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(135deg,var(--accent),var(--accent-2)); color: #fff; font-size: 10px; font-weight: 900; }
.ai-agent-card strong,.ai-agent-card small { display: block; }
.ai-agent-card strong { font-size: 10px; }
.ai-agent-card small { margin-top: 3px; overflow: hidden; color: var(--subtle); font-size: 8px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.ai-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px color-mix(in srgb,var(--muted) 13%,transparent); }
.ai-status-dot.idle { background: var(--success); }.ai-status-dot.working { background: var(--warning); }.ai-status-dot.waiting { background: var(--info); }.ai-status-dot.failed { background: var(--danger); }
.ai-chat-panel { display: grid; grid-template-rows: auto auto auto minmax(240px,1fr) auto; min-width: 0; overflow: hidden; }
.ai-agent-header { align-items: flex-start; }
.ai-permissions { display: flex; gap: 5px; padding: 8px 14px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.ai-permissions span { padding: 4px 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--subtle); font-size: 7px; white-space: nowrap; }
.ai-provider-notice,.ai-inline-error { display: flex; gap: 9px; align-items: flex-start; margin: 10px 14px 0; padding: 10px 12px; border: 1px solid rgba(255,189,85,.28); border-radius: 11px; background: rgba(255,189,85,.08); color: var(--warning); }
.ai-provider-notice svg,.ai-inline-error svg { width: 18px; height: 18px; flex: 0 0 18px; }.ai-provider-notice strong,.ai-provider-notice span { display: block; }.ai-provider-notice strong { color: var(--text); font-size: 9px; }.ai-provider-notice span { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.ai-inline-error { margin: 0; align-items: center; color: var(--danger); border-color: rgba(255,111,133,.3); background: rgba(255,111,133,.08); font-size: 9px; }
.ai-chat-messages { min-height: 250px; max-height: 510px; display: flex; flex-direction: column; gap: 9px; padding: 14px; overflow-y: auto; }
.ai-message { max-width: 88%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 13px 13px 13px 4px; background: var(--surface-2); }
.ai-message.user { align-self: flex-end; border-color: rgba(124,140,255,.28); border-radius: 13px 13px 4px 13px; background: rgba(124,140,255,.1); }
.ai-message header { display: flex; justify-content: space-between; gap: 14px; }.ai-message strong,.ai-message time { font-size: 8px; }.ai-message time { color: var(--subtle); }.ai-message p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.ai-chat-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.ai-chat-form textarea { min-height: 68px; resize: vertical; }.ai-chat-form .action-btn { align-self: end; min-height: 36px; }
.ai-context-chip { grid-column: 1/-1; display: flex; align-items: center; gap: 6px; color: var(--accent-2); font-size: 8px; }.ai-context-chip svg { width: 13px; height: 13px; }.ai-context-chip button { margin-left: auto; border: 0; background: transparent; color: var(--muted); cursor: pointer; }.ai-context-chip button svg { width: 14px; }
.ai-inline-form { display: grid; gap: 8px; border-bottom: 1px solid var(--border); }
.ai-inline-form input,.ai-inline-form textarea,.ai-inline-form select,.ai-chat-form textarea { width: 100%; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text); padding: 9px 10px; font: inherit; font-size: 9px; }
.ai-inline-form textarea { min-height: 70px; resize: vertical; }.ai-inline-form label { display: grid; gap: 5px; color: var(--muted); font-size: 8px; }.ai-form-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }.ai-inline-form .check-row { display: flex; align-items: center; }.ai-inline-form .check-row input { width: auto; }
.ai-research-consent { gap: 7px; align-items: center; color: var(--text); font-size: 9px; line-height: 1.35; }
.ai-research-consent input { flex: 0 0 auto; width: auto; }
.ai-research-consent small { flex-basis: 100%; color: var(--muted); padding-left: 20px; }
.ai-chat-form .ai-research-consent { display: flex; flex-wrap: wrap; grid-column: 1 / -1; }
.ai-item-list { display: grid; gap: 8px; max-height: 620px; overflow-y: auto; }
.ai-item-list article { padding: 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.ai-item-list article header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }.ai-item-list article strong { font-size: 10px; }.ai-item-list article p { margin: 7px 0; color: var(--muted); font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }.ai-item-list article small { color: var(--subtle); font-size: 8px; }.ai-item-list article pre { max-height: 230px; overflow: auto; padding: 9px; border-radius: 8px; background: var(--surface-3); color: var(--muted); font-size: 8px; white-space: pre-wrap; }.ai-item-list article > .action-btn { margin-top: 9px; }
.ai-approval-actions { display: flex; gap: 7px; margin-top: 10px; }
.ai-timeline { display: grid; gap: 0; }
.ai-timeline article { display: grid; grid-template-columns: 10px minmax(0,1fr); gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--border); }.ai-timeline article i { width: 8px; height: 8px; margin-top: 3px; border-radius: 50%; background: var(--accent); }.ai-timeline article.error i { background: var(--danger); }.ai-timeline article.warning i { background: var(--warning); }.ai-timeline strong,.ai-timeline p,.ai-timeline time { display: block; font-size: 9px; }.ai-timeline p { margin: 4px 0; color: var(--muted); }.ai-timeline time { color: var(--subtle); font-size: 8px; }
.ai-budget { padding: 14px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }.ai-budget strong { font-size: 25px; }.ai-budget > span { color: var(--muted); font-size: 12px; }.ai-budget > div { height: 8px; margin: 12px 0; overflow: hidden; border-radius: 999px; background: var(--surface-3); }.ai-budget > div i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--accent),var(--accent-2)); }.ai-budget p { margin: 0; color: var(--muted); font-size: 8px; }
.error-text { color: var(--danger) !important; }

@media (max-width: 1050px) {
  .ai-team-layout,.ai-split { grid-template-columns: 1fr; }
  .ai-agent-list .panel-body { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .ai-team-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ai-agent-list .panel-body { grid-template-columns: 1fr; }
  .ai-chat-form { grid-template-columns: 1fr; }
  .ai-chat-form .action-btn { width: 100%; justify-content: center; }
  .ai-form-row { grid-template-columns: 1fr; }
}

.team-chat-main-pane {
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--surface);
}

.mobile-chat-toggle {
  display: none;
}

/* Tablet screens: Hide right info panel */
@media (max-width: 992px) {
  .team-chat-suite {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .team-chat-sidebar-right {
    display: none !important;
  }
}

/* Mobile screens (< 768px): Single pane view with drawer/toggle */
@media (max-width: 768px) {
  .team-chat-suite {
    grid-template-columns: 1fr;
    height: calc(100dvh - 70px);
    margin: -8px -8px 0 -8px;
    border-radius: 0;
    border: none;
  }
  
  .mobile-chat-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .team-chat-sidebar-left {
    display: none;
  }

  .team-chat-suite.mobile-show-channels .team-chat-sidebar-left {
    display: flex !important;
    position: absolute;
    inset: 0;
    z-index: 50;
  }

  .team-chat-suite.mobile-show-channels .team-chat-main-pane {
    display: none !important;
  }
  
  /* Mobile grid & form responsiveness */
  .grid-4, .grid-3, .grid-2, .grid-main {
    grid-template-columns: 1fr !important;
  }

  .page-grid {
    gap: 12px;
  }

  .top-bar {
    padding: 8px 12px;
  }

  .main-layout {
    padding: 8px;
  }
}

/* Mobile field interface */
.mobile-tabbar,
.mobile-menu-btn,
.mobile-wordmark,
.mobile-nav-close,
.mobile-nav-scrim {
  display: none;
}

@media (max-width: 767px) {
  .prospect-import-summary { grid-template-columns: 1fr; }
  .prospect-import-table { max-height: 48vh; }
  :root {
    --topbar-height: 58px;
    --mobile-tabbar-height: 72px;
    --pad: 12px;
    --radius: 15px;
    --row-height: 52px;
  }

  html,
  body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overscroll-behavior: none;
  }

  body {
    position: fixed;
    inset: 0;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
  }

  button,
  a,
  input,
  select,
  textarea {
    touch-action: manipulation;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .app-shell,
  .app-shell.sidebar-collapsed {
    display: block;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .app-main {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
  }

  .mobile-tabbar {
    position: fixed;
    z-index: 75;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: var(--mobile-tabbar-height);
    padding: 7px 8px max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-strong);
    background: color-mix(in srgb, var(--sidebar) 96%, transparent);
    box-shadow: 0 -12px 35px rgba(0,0,0,.18);
    backdrop-filter: blur(26px) saturate(165%);
    display: grid;
    grid-template-columns: repeat(5,minmax(0,1fr));
    align-items: stretch;
  }

  .mobile-tab {
    min-width: 0;
    min-height: 54px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 3px 2px;
    font-size: 9px;
    font-weight: 760;
  }

  .mobile-tab.active {
    color: var(--text);
    background: linear-gradient(180deg,rgba(124,140,255,.18),rgba(82,217,233,.08));
  }

  .mobile-tab-icon {
    position: relative;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
  }

  .mobile-tab-icon svg {
    width: 21px;
    height: 21px;
  }

  .mobile-tab-icon i {
    position: absolute;
    top: -5px;
    right: -10px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid var(--sidebar);
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 7px;
    font-style: normal;
    font-weight: 900;
  }

  .sidebar,
  .sidebar-collapsed .sidebar {
    position: fixed;
    z-index: 92;
    inset: 0 auto 0 0;
    width: min(88vw,340px);
    height: 100dvh;
    border: 0;
    border-right: 1px solid var(--border-strong);
    border-radius: 0 22px 22px 0;
    box-shadow: 24px 0 70px rgba(0,0,0,.42);
    display: flex;
    flex-direction: column;
    transform: translateX(-105%);
    transition: transform .22s ease;
  }

  .mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-nav-scrim {
    position: fixed;
    z-index: 91;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(4,7,20,.62);
    backdrop-filter: blur(5px);
  }

  .mobile-nav-open .mobile-nav-scrim {
    display: block;
    animation: fade-in .18s ease;
  }

  .sidebar .brand,
  .sidebar-collapsed .brand {
    min-height: calc(70px + env(safe-area-inset-top));
    height: auto;
    padding: max(12px,env(safe-area-inset-top)) 16px 12px;
    display: flex;
  }

  .sidebar .brand img {
    width: 40px;
    height: 40px;
  }

  .sidebar-workspace-switcher {
    width: calc(100% - 24px);
    min-height: 58px;
    margin: 12px 12px 0;
    padding: 8px 11px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface-2) 92%, transparent);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 11px;
    text-align: left;
    flex: 0 0 auto;
  }

  .sidebar-workspace-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
  }

  .sidebar-workspace-copy small {
    color: var(--subtle);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
  }

  .sidebar-workspace-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
  }

  .sidebar-workspace-switcher .chev {
    width: 18px;
    height: 18px;
    margin-left: auto;
    color: var(--subtle);
  }

  .workspace-dropdown {
    inset: max(82px,calc(env(safe-area-inset-top) + 70px)) 12px auto 12px !important;
    width: auto;
    max-height: min(62dvh,520px);
  }

  .sidebar .brand-copy,
  .sidebar-collapsed .brand-copy {
    display: block;
    width: auto;
    opacity: 1;
  }

  .mobile-nav-close {
    margin-left: auto;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-2);
    color: var(--muted);
    display: grid;
    place-items: center;
  }

  .mobile-nav-close svg {
    width: 20px;
    height: 20px;
  }

  .sidebar .nav-scroll,
  .sidebar-collapsed .nav-scroll {
    width: 100%;
    padding: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    display: block;
  }

  .sidebar .nav-section {
    display: block;
    margin-bottom: 18px;
  }

  .sidebar .nav-label,
  .sidebar-collapsed .nav-label {
    height: auto;
    padding: 8px 10px;
    display: block;
    opacity: 1;
    font-size: 10px;
  }

  .sidebar .nav-item,
  .sidebar-collapsed .nav-item {
    width: 100%;
    min-width: 0;
    height: 50px;
    margin: 3px 0;
    padding: 0 13px;
    border-radius: 13px;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: 13px;
  }

  .sidebar .nav-item.active::before {
    top: 13px;
    left: -12px;
    width: 4px;
    height: 24px;
    transform: none;
  }

  .sidebar .nav-icon,
  .sidebar .nav-icon svg {
    width: 22px;
    height: 22px;
  }

  .sidebar .nav-text,
  .sidebar-collapsed .nav-text {
    display: block;
    width: auto;
    max-width: none;
    opacity: 1;
    font-size: 14px;
  }

  .sidebar .nav-badge,
  .sidebar-collapsed .nav-badge {
    width: auto;
    min-width: 22px;
    margin-left: auto;
    padding: 0 7px;
    opacity: 1;
  }

  .sidebar .sidebar-footer {
    display: none;
  }

  .topbar {
    height: calc(var(--topbar-height) + env(safe-area-inset-top));
    flex: 0 0 calc(var(--topbar-height) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 10px 0;
    gap: 7px;
  }

  .mobile-menu-btn {
    display: inline-flex;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }

  .mobile-wordmark {
    display: none;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 850;
  }

  .mobile-wordmark img {
    width: 28px;
    height: 28px;
    border-radius: 9px;
  }

  .workspace-switcher {
    min-width: 0;
    max-width: none;
    height: 44px;
    padding: 0 10px;
    display: flex;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .workspace-switcher > span:not(.workspace-dot):not(.chev) {
    min-width: 0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace-switcher .chev {
    width: 16px;
    min-width: 16px;
    display: block;
  }

  .workspace-switcher.is-switching {
    opacity: .72;
    pointer-events: none;
  }

  .global-search {
    flex: 0 0 44px;
    min-width: 44px;
    width: 44px;
  }

  .global-search input {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 13px;
    font-size: 16px;
  }

  .global-search .search-icon {
    left: 12px;
    top: 12px;
    pointer-events: none;
  }

  .global-search input::placeholder { color: transparent; }

  .global-search kbd {
    display: none;
  }

  .top-actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  .top-actions > a,
  .top-actions > .top-btn:not(.create-btn),
  .top-actions > .avatar {
    display: none !important;
  }

  .top-actions .create-btn,
  .top-actions .icon-btn {
    display: inline-flex !important;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 13px;
  }

  .top-actions .create-btn span {
    display: none;
  }

  .content-shell {
    height: calc(100dvh - var(--topbar-height) - env(safe-area-inset-top));
  }

  .contextbar {
    min-height: 96px;
    max-height: none;
    padding: 8px 12px;
    gap: 6px;
    display: grid;
    grid-template-columns: minmax(0,1fr);
    align-content: center;
    overflow: hidden;
  }

  .context-title {
    width: 100%;
    margin-right: 2px;
  }

  .context-title h1 {
    font-size: 17px;
    line-height: 1.2;
  }

  .context-title p {
    display: none;
  }

  .context-spacer {
    display: none;
  }

  .context-actions {
    width: calc(100% + 24px);
    min-width: 0;
    margin-inline: -12px;
    padding: 0 12px 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .context-actions::-webkit-scrollbar {
    display: none;
  }

  .context-actions > * {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .segmented {
    max-width: none;
    overflow: visible;
    scroll-snap-type: x proximity;
  }

  .segmented button {
    min-height: 44px;
    padding: 0 13px;
    font-size: 11px;
    scroll-snap-align: start;
  }

  .filter-select,
  .toolbar-input {
    width: auto;
    min-width: 130px;
    height: 44px;
    font-size: 16px;
  }

  .action-btn,
  .mini-btn,
  .chip,
  .add-card {
    min-height: 44px;
  }

  .icon-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .action-btn {
    padding-inline: 14px;
    border-radius: 12px;
    font-size: 12px;
  }

  .mini-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .content {
    padding: 12px 12px calc(var(--mobile-tabbar-height) + 20px + env(safe-area-inset-bottom));
    scroll-padding-bottom: calc(var(--mobile-tabbar-height) + 28px);
  }

  .view {
    gap: 12px;
    padding-bottom: 10px;
  }

  .page-grid,
  .grid-3,
  .grid-2,
  .grid-main,
  .cards-grid {
    grid-template-columns: minmax(0,1fr) !important;
    gap: 12px;
  }

  .grid-4 {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 10px;
  }

  .panel,
  .entity-card,
  .task-column,
  .kanban-column {
    border-radius: 15px;
    box-shadow: 0 7px 22px rgba(0,0,0,.12);
    backdrop-filter: none;
  }

  .panel-header {
    min-height: 58px;
    padding: 12px 14px;
    flex-wrap: wrap;
  }

  .panel-header h2 {
    font-size: 15px;
  }

  .panel-header p {
    font-size: 11px;
    line-height: 1.4;
  }

  .panel-header .panel-actions {
    gap: 8px;
  }

  .panel-body {
    padding: 14px;
  }

  .metric-card {
    min-height: 126px;
    padding: 14px;
  }

  .metric-value {
    margin-top: 16px;
    font-size: clamp(24px,8vw,31px);
  }

  .metric-label,
  .activity-copy,
  .card-title,
  .task-title,
  .entity-card-copy h3 {
    font-size: 12px;
  }

  .activity-item {
    grid-template-columns: 38px minmax(0,1fr);
    padding: 13px 0;
  }

  .activity-icon {
    width: 36px;
    height: 36px;
  }

  .activity-time {
    grid-column: 2;
    margin-top: -4px;
    font-size: 9px;
  }

  .kanban-wrap,
  .table-scroll {
    margin-inline: -2px;
    padding-bottom: 12px;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
  }

  .kanban {
    height: calc(100dvh - 215px);
    min-height: 470px;
    gap: 10px;
  }

  .kanban-column {
    width: calc(100vw - 36px);
    min-width: calc(100vw - 36px);
    scroll-snap-align: center;
  }

  .kanban-card,
  .task-card,
  .entity-card {
    padding: 14px;
  }

  .kanban-card:hover {
    transform: none;
  }

  .table-panel {
    margin-inline: -12px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .table-scroll {
    max-height: none;
  }

  .data-table {
    min-width: 720px;
  }

  .data-table th,
  .data-table td {
    padding-inline: 14px;
  }

  .data-table th:first-child,
  .data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: color-mix(in srgb,var(--surface) 97%,transparent);
  }

  .data-table th:first-child {
    z-index: 3;
    background: color-mix(in srgb,var(--surface-2) 98%,transparent);
  }

  .task-board {
    width: max-content;
    min-width: 0;
    min-height: calc(100dvh - 220px);
    display: flex;
    gap: 10px;
    scroll-snap-type: x mandatory;
  }

  .task-column {
    width: calc(100vw - 36px);
    min-width: calc(100vw - 36px);
    scroll-snap-align: center;
  }

  .calendar-shell {
    grid-template-columns: minmax(0,1fr);
  }

  .calendar-day {
    min-height: 66px;
    padding: 4px;
  }

  .day-number {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .inbox-layout {
    height: calc(100dvh - 205px - var(--mobile-tabbar-height));
    min-height: 440px;
    border-radius: 0;
  }

  .inbox-route-note {
    align-items: stretch !important;
    flex-direction: column;
    padding: 12px !important;
  }

  .inbox-route-note .action-btn {
    width: 100%;
    height: 44px !important;
  }

  .inbox-layout.chat-open .chat-head .hidden {
    display: grid !important;
  }

  .conversation-item {
    min-height: 86px;
    padding: 14px 12px;
    grid-template-columns: 44px minmax(0,1fr) auto;
  }

  .conversation-search input {
    height: 44px;
    font-size: 16px;
  }

  .conv-avatar {
    width: 44px;
    height: 44px;
  }

  .conv-name,
  .chat-head-copy strong {
    font-size: 13px;
  }

  .conv-preview,
  .chat-head-copy span {
    font-size: 10px;
  }

  .message,
  .ai-message {
    max-width: 90%;
    padding: 11px 13px;
    font-size: 13px;
    line-height: 1.5;
  }

  .composer {
    padding: 10px;
  }

  .composer textarea {
    min-height: 46px;
    font-size: 16px;
  }

  .mailbox-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .mailbox-toolbar .panel-actions {
    width: 100%;
  }

  .mailbox-toolbar .panel-actions .action-btn {
    flex: 1;
  }

  .mail-composer {
    grid-template-columns: minmax(0,1fr) auto;
  }

  .mail-from-select {
    grid-column: 1 / -1;
    width: 100%;
  }

  .integration-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .integration-toolbar .toolbar-input,
  .integration-toolbar .filter-select {
    width: 100%;
  }

  .integration-categories {
    flex-wrap: nowrap;
    margin-inline: -12px;
    padding: 0 12px 6px;
    overflow-x: auto;
  }

  .chip {
    flex: 0 0 auto;
    padding-inline: 14px;
  }

  .knowledge-layout {
    height: auto;
    min-height: calc(100dvh - 210px);
  }

  .knowledge-nav {
    display: flex;
    gap: 6px;
    padding: 8px;
    border: 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }

  .knowledge-item {
    min-width: 150px;
    min-height: 44px;
    margin: 0;
  }

  .knowledge-article {
    padding: 22px 16px;
  }

  .article-wrap h1 {
    font-size: 28px;
  }

  .settings-layout {
    display: block;
  }

  .settings-nav {
    position: static;
    margin: 0 -12px 12px;
    padding: 7px 12px;
    border-radius: 0;
    display: flex;
    gap: 6px;
    overflow-x: auto;
  }

  .settings-nav button {
    width: auto;
    min-width: max-content;
    height: 44px;
    padding-inline: 14px;
  }

  .settings-section {
    padding: 15px;
  }

  .setting-row {
    min-height: 68px;
    grid-template-columns: minmax(0,1fr);
    align-items: start;
    gap: 12px;
    padding-block: 14px;
  }

  .setting-row > :last-child {
    justify-self: start;
  }

  .switch {
    width: 64px;
    height: 44px;
    padding: 7px;
  }

  .switch::after {
    width: 30px;
    height: 30px;
  }

  .switch.on::after {
    transform: translateX(20px);
  }

  .theme-options {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    width: 100%;
  }

  .theme-option {
    width: 100%;
  }

  .drawer {
    inset: 0;
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    animation: slide-up-mobile .2s ease;
  }

  .drawer-head {
    min-height: calc(68px + env(safe-area-inset-top));
    padding: max(12px,env(safe-area-inset-top)) 14px 12px;
  }

  .drawer-body {
    padding: 14px;
  }

  .drawer-foot {
    min-height: calc(66px + env(safe-area-inset-bottom));
    padding: 10px 12px max(10px,env(safe-area-inset-bottom));
    justify-content: stretch;
    overflow-x: auto;
  }

  .drawer-foot .action-btn {
    flex: 1 0 auto;
  }

  .detail-grid {
    grid-template-columns: minmax(0,1fr);
  }

  .detail-block.full {
    grid-column: auto;
  }

  .detail-label {
    font-size: 9px;
  }

  .detail-value {
    font-size: 13px;
  }

  .modal,
  .modal.wide {
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
    transform: none;
    animation: slide-up-mobile .2s ease;
  }

  .modal-head {
    min-height: calc(68px + env(safe-area-inset-top));
    padding: max(12px,env(safe-area-inset-top)) 14px 12px;
  }

  .modal-head h2 {
    font-size: 17px;
  }

  .modal-head p {
    font-size: 11px;
  }

  .modal-body {
    padding: 16px 14px;
  }

  .modal-foot {
    min-height: calc(68px + env(safe-area-inset-bottom));
    padding: 10px 12px max(10px,env(safe-area-inset-bottom));
    flex-wrap: wrap;
  }

  .modal-foot .action-btn {
    flex: 1 1 120px;
  }

  .form-grid {
    grid-template-columns: minmax(0,1fr);
    gap: 14px;
  }

  .form-field.full {
    grid-column: auto;
  }

  .form-field label,
  .form-help {
    font-size: 12px;
  }

  .form-field input,
  .form-field select {
    height: 50px;
    font-size: 16px;
  }

  .form-field textarea {
    min-height: 120px;
    font-size: 16px;
  }

  .quick-create-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .quick-create-card {
    min-height: 118px;
    padding: 14px;
  }

  .quick-create-card strong {
    font-size: 13px;
  }

  .quick-create-card span {
    font-size: 10px;
  }

  .dropdown,
  .search-results {
    position: fixed;
    top: calc(var(--topbar-height) + env(safe-area-inset-top) + 4px) !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-height: calc(100dvh - var(--topbar-height) - var(--mobile-tabbar-height) - 28px);
    border-radius: 16px;
  }

  .command-palette {
    top: max(12px,env(safe-area-inset-top));
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .command-input {
    height: 62px;
    font-size: 16px;
  }

  .command-item {
    min-height: 50px;
  }

  .toast-stack {
    right: 10px;
    bottom: calc(var(--mobile-tabbar-height) + 10px + env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
  }

  [data-telegram-search] {
    width: 100% !important;
    max-width: none !important;
    height: 46px !important;
  }

  .ai-team-summary {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .ai-team-summary > div {
    min-height: 100px;
  }

  .ai-team-summary strong {
    font-size: 25px;
  }

  .ai-team-nav {
    margin-inline: -12px;
    padding: 6px 12px;
    border-inline: 0;
    border-radius: 0;
  }

  .ai-team-nav button {
    min-height: 44px;
    padding-inline: 15px;
    font-size: 10px;
  }

  .ai-team-layout,
  .ai-split {
    grid-template-columns: minmax(0,1fr);
    min-height: 0;
  }

  .ai-agent-list .panel-body {
    display: flex;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .ai-agent-card {
    min-width: min(76vw,270px);
    min-height: 64px;
    padding: 11px;
    scroll-snap-align: start;
  }

  .ai-agent-card strong {
    font-size: 12px;
  }

  .ai-agent-card small {
    font-size: 9px;
  }

  .ai-chat-panel {
    min-height: 66dvh;
    grid-template-rows: auto auto auto minmax(300px,1fr) auto;
  }

  .ai-chat-messages {
    max-height: none;
    min-height: 300px;
    padding: 12px;
  }

  .ai-message p {
    font-size: 12px;
  }

  .ai-chat-form textarea,
  .ai-inline-form input,
  .ai-inline-form textarea,
  .ai-inline-form select {
    min-height: 48px;
    font-size: 16px;
  }

  .ai-chat-form .action-btn {
    width: 100%;
  }

  .team-chat-suite {
    height: calc(100dvh - var(--topbar-height) - var(--mobile-tabbar-height) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 480px;
    margin: -12px;
  }
}

@media (max-width: 390px) {
  .mobile-wordmark span {
    display: none;
  }

  .global-search input::placeholder {
    color: transparent;
  }

  .grid-4 {
    grid-template-columns: minmax(0,1fr) !important;
  }

  .quick-create-grid {
    grid-template-columns: minmax(0,1fr);
  }
}

@keyframes slide-up-mobile {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Live personalisation analytics */
.analytics-dashboard { display: grid; gap: 14px; padding-bottom: 28px; }
.analytics-hero { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(250px,.6fr); gap: 24px; align-items: center; padding: 22px; overflow: hidden; position: relative; }
.analytics-hero::after { content: ""; position: absolute; width: 360px; height: 250px; right: -80px; top: -125px; background: radial-gradient(circle,rgba(82,217,233,.16),transparent 68%); pointer-events: none; }
.analytics-eyebrow { color: var(--accent-2); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.analytics-hero h2 { margin: 7px 0 6px; font-size: 19px; letter-spacing: -.025em; }
.analytics-hero p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; max-width: 720px; }
.analytics-freshness { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border: 1px solid rgba(73,215,160,.28); border-radius: 13px; background: rgba(73,215,160,.08); position: relative; z-index: 1; }
.analytics-freshness strong,.analytics-freshness small { display: block; font-size: 9px; }.analytics-freshness small { color: var(--muted); margin-top: 3px; }
.live-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(73,215,160,.12); }
.status-pill svg { width: 12px; height: 12px; }
.analytics-metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.analytics-main-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(300px,.75fr); gap: 10px; }
.analytics-detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.analytics-lower-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.analytics-chart { height: 238px; display: flex; align-items: stretch; gap: 3px; padding: 20px 18px 8px; overflow-x: auto; }
.analytics-day { min-width: 18px; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.analytics-day-bars { width: 100%; height: 190px; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--border); }
.analytics-day-bars i { width: 28%; max-width: 8px; min-height: 0; border-radius: 4px 4px 1px 1px; transition: height .25s ease; }
.analytics-day span { color: var(--subtle); font-size: 7px; transform: rotate(-42deg); transform-origin: center; white-space: nowrap; }
.tracker { background: #7c8cff; }.legacy { background: #52d9e9; }.recommendation { background: #e77eac; }
.analytics-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; padding: 4px 14px 15px; color: var(--muted); font-size: 8px; }
.analytics-legend span { display: inline-flex; align-items: center; gap: 6px; }.analytics-legend i { width: 7px; height: 7px; border-radius: 2px; }
.analytics-health-panel { min-height: 330px; }
.analytics-health-score { display: grid; place-items: center; padding: 24px 12px 17px; }.analytics-health-score strong { font-size: 34px; letter-spacing: -.04em; }.analytics-health-score strong small { font-size: 13px; }.analytics-health-score span { color: var(--muted); font-size: 9px; }
.analytics-health-stats { display: grid; grid-template-columns: repeat(3,1fr); margin: 0 14px 15px; border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
.analytics-health-stats div { padding: 10px 8px; text-align: center; border-right: 1px solid var(--border); }.analytics-health-stats div:last-child { border-right: 0; }.analytics-health-stats strong,.analytics-health-stats span { display: block; font-size: 11px; }.analytics-health-stats span { margin-top: 3px; color: var(--subtle); font-size: 7px; }
.analytics-weight-list { display: grid; gap: 7px; padding: 0 15px 16px; }.analytics-weight-list > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 8px; align-items: center; }.analytics-weight-list span,.analytics-weight-list strong { font-size: 8px; }.analytics-weight-list span { color: var(--muted); }.analytics-weight-list i { grid-column: 1/-1; height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }.analytics-weight-list i b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--accent),var(--accent-2)); }
.analytics-funnel { display: grid; gap: 13px; }.analytics-funnel > div > div { display: flex; justify-content: space-between; gap: 10px; font-size: 9px; }.analytics-funnel span { color: var(--muted); }.analytics-funnel > div > i { display: block; height: 9px; margin-top: 6px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }.analytics-funnel > div > i b { display: block; height: 100%; border-radius: inherit; }
.analytics-ranked-list { display: grid; align-content: start; }.analytics-ranked-list > div:not(.analytics-inline-empty) { display: grid; grid-template-columns: 24px minmax(0,1fr) auto auto; gap: 8px; align-items: center; min-height: 38px; border-bottom: 1px solid var(--border); }.analytics-ranked-list > div:last-child { border-bottom: 0; }.analytics-ranked-list > div > span { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 7px; background: var(--surface-3); color: var(--subtle); font-size: 7px; font-weight: 800; }.analytics-ranked-list strong,.analytics-ranked-list b { font-size: 9px; }.analytics-ranked-list small { color: var(--subtle); font-size: 7px; }.analytics-ranked-list b { color: var(--accent-2); }
.analytics-inline-empty { min-height: 105px; display: grid; place-items: center; padding: 20px; color: var(--subtle); font-size: 9px; line-height: 1.55; text-align: center; }
.analytics-business-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }.analytics-business-grid > div { padding: 17px; border-right: 1px solid var(--border); }.analytics-business-grid > div:last-child { border-right: 0; }.analytics-business-grid span,.analytics-business-grid strong,.analytics-business-grid small { display: block; }.analytics-business-grid span { color: var(--muted); font-size: 8px; font-weight: 700; }.analytics-business-grid strong { margin: 8px 0 4px; font-size: 18px; }.analytics-business-grid small { color: var(--subtle); font-size: 8px; }
.analytics-loading .empty-state-icon svg { animation: analytics-spin 1s linear infinite; }
@keyframes analytics-spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .analytics-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .analytics-main-grid { grid-template-columns: 1fr; }
  .analytics-lower-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .analytics-hero,.analytics-detail-grid,.analytics-lower-grid { grid-template-columns: 1fr; }
  .analytics-hero { padding: 16px; }
  .analytics-metric-grid,.analytics-business-grid { grid-template-columns: 1fr 1fr; }
  .analytics-business-grid > div { border-right: 0; border-bottom: 1px solid var(--border); }
  .analytics-chart { height: 210px; }.analytics-day-bars { height: 165px; }
}
@media (max-width: 430px) {
  .analytics-metric-grid,.analytics-business-grid { grid-template-columns: 1fr; }
  .analytics-health-stats { grid-template-columns: 1fr; }.analytics-health-stats div { border-right: 0; border-bottom: 1px solid var(--border); }.analytics-health-stats div:last-child { border-bottom: 0; }
}

/* Mobile calendar day agenda */
.calendar-agenda-item {
  width: 100%;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 3px 10px;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.calendar-agenda-item .upcoming-time { grid-row: 1 / span 2; align-self: center; }
.calendar-agenda-item .upcoming-title,
.calendar-agenda-item .upcoming-sub { margin-top: 0; }
@media (max-width: 767px) {
  .calendar-day[data-event-count]:not([data-event-count="0"]) { cursor: pointer; }
  .calendar-day-modal { width: min(94vw, 520px); }
  .calendar-day-modal .modal-body { max-height: 58vh; overflow-y: auto; }
}

/* Shared marketing media library */
.media-library { padding-bottom: 28px; }
.media-hero {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  background:
    radial-gradient(circle at 82% 20%, rgba(82,217,233,.18), transparent 34%),
    radial-gradient(circle at 68% 110%, rgba(124,140,255,.24), transparent 45%),
    var(--surface);
}
.media-hero::after { content: ""; position: absolute; width: 220px; height: 220px; right: -72px; bottom: -115px; border: 1px solid rgba(82,217,233,.28); border-radius: 50%; pointer-events: none; }
.media-kicker { color: var(--accent-2); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.media-hero h2 { margin: 8px 0 7px; font-size: 24px; letter-spacing: -.035em; }
.media-hero p { max-width: 690px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.media-hero-stats { position: relative; z-index: 1; min-width: 132px; padding: 18px; border: 1px solid var(--border-strong); border-radius: 15px; background: rgba(10,14,30,.36); text-align: center; backdrop-filter: blur(12px); }
.media-hero-stats strong,.media-hero-stats span { display: block; }
.media-hero-stats strong { font-size: 28px; line-height: 1; }
.media-hero-stats span { margin-top: 7px; color: var(--muted); font-size: 9px; }
.media-breadcrumb { min-height: 38px; display: flex; align-items: center; gap: 5px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.media-breadcrumb::-webkit-scrollbar { display: none; }
.media-breadcrumb button { flex: 0 0 auto; border: 0; border-radius: 8px; padding: 7px 10px; background: transparent; color: var(--muted); font-size: 10px; }
.media-breadcrumb button:hover { background: var(--surface-3); color: var(--text); }
.media-breadcrumb span { display: grid; place-items: center; color: var(--subtle); }
.media-breadcrumb svg { width: 11px; height: 11px; }
.media-section { display: grid; gap: 11px; }
.media-section-head { display: flex; align-items: flex-end; gap: 12px; min-height: 40px; }
.media-section-head h3 { margin: 0; font-size: 14px; }
.media-section-head p { margin: 3px 0 0; color: var(--subtle); font-size: 9px; }
.media-section-head > .action-btn { margin-left: auto; }
.media-folder-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.media-folder-card { min-width: 0; min-height: 72px; display: grid; grid-template-columns: 38px minmax(0,1fr) 16px; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); text-align: left; box-shadow: var(--shadow-soft); transition: border-color .16s, transform .16s, background .16s; }
.media-folder-card:hover { transform: translateY(-2px); border-color: rgba(124,140,255,.45); background: var(--surface-2); }
.media-folder-card > span:nth-child(2) { min-width: 0; }
.media-folder-card strong,.media-folder-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-folder-card strong { font-size: 11px; }
.media-folder-card small { margin-top: 5px; color: var(--subtle); font-size: 8px; }
.media-folder-card > svg { width: 13px; color: var(--subtle); }
.media-folder-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--accent-2); background: linear-gradient(145deg,rgba(82,217,233,.17),rgba(124,140,255,.15)); border: 1px solid rgba(82,217,233,.18); }
.media-folder-icon svg { width: 18px; height: 18px; }
.media-asset-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; }
.media-asset-card { min-width: 0; overflow: hidden; display: grid; grid-template-columns: minmax(0,1fr) 34px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-soft); }
.media-preview { grid-column: 1/-1; width: 100%; aspect-ratio: 4/3; border: 0; padding: 0; display: grid; place-items: center; overflow: hidden; color: var(--accent-2); background: linear-gradient(145deg,var(--surface-3),rgba(82,217,233,.09)); }
.media-preview img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.media-preview:hover img { transform: scale(1.035); }
.media-preview span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: rgba(10,14,30,.34); }
.media-preview svg { width: 22px; height: 22px; }
.media-asset-copy { min-width: 0; padding: 11px 4px 11px 12px; }
.media-asset-copy strong,.media-asset-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-asset-copy strong { font-size: 10px; }
.media-asset-copy span { margin-top: 5px; color: var(--subtle); font-size: 7px; text-transform: uppercase; }
.media-asset-card > .mini-btn { align-self: center; margin-right: 7px; }
.media-empty,.media-loading { min-height: 220px; display: grid; place-items: center; align-content: center; gap: 9px; padding: 30px; text-align: center; }
.media-empty { border: 1px dashed var(--border-strong); border-radius: 15px; background: rgba(124,140,255,.035); }
.media-empty > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: var(--accent-2); background: var(--surface-3); }
.media-empty svg { width: 22px; height: 22px; }
.media-empty h3 { margin: 5px 0 0; font-size: 14px; }
.media-empty p { max-width: 460px; margin: 0 0 5px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.media-loading { grid-template-columns: auto auto; min-height: 150px; }
.media-loading .loading-spinner { width: 24px; height: 24px; }
.media-modal-preview { min-height: 290px; max-height: 54vh; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: rgba(6,9,22,.42); }
.media-modal-preview img,.media-modal-preview video { width: 100%; max-height: 54vh; object-fit: contain; }
.media-modal-preview audio { width: min(560px,90%); }
.media-document-preview { display: grid; justify-items: center; gap: 12px; color: var(--muted); }
.media-document-preview svg { width: 42px; height: 42px; color: var(--accent-2); }
.media-link-field { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 11px 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.media-link-field span { min-width: 0; flex: 1; color: var(--muted); font-size: 9px; }
.media-link-field .action-btn { flex: 0 0 auto; }

@media (max-width: 1180px) {
  .media-folder-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .media-asset-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .media-folder-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .media-asset-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .media-hero { grid-template-columns: 1fr; padding: 18px; gap: 16px; }
  .media-hero-stats { width: 100%; display: flex; align-items: baseline; justify-content: center; gap: 7px; padding: 13px; }
  .media-hero-stats span { margin: 0; }
  .media-folder-grid { grid-template-columns: 1fr; }
  .media-asset-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .media-section-head { align-items: center; }
  .media-modal-preview { min-height: 210px; }
  .media-link-field { align-items: stretch; flex-direction: column; }
  .media-link-field .action-btn { width: 100%; }
}
@media (max-width: 380px) {
  .media-asset-grid { grid-template-columns: 1fr; }
}
.analytics-tuning-panel { padding-bottom: 18px; }
.analytics-tuning-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0 15px; }
.analytics-tuning-control { display: grid; gap: 7px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--surface-2) 72%, transparent); }
.analytics-tuning-control > span { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.analytics-tuning-control strong { font-size: 10px; }
.analytics-tuning-control b { color: var(--accent-2); font-size: 11px; white-space: nowrap; }
.analytics-tuning-control small { min-height: 28px; color: var(--subtle); font-size: 8px; line-height: 1.45; }
.analytics-tuning-control input[type="range"] { width: 100%; accent-color: var(--accent); cursor: pointer; }
.analytics-tuning-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 15px 0; }
.analytics-tuning-warning { margin: 12px 15px 0; color: var(--subtle); font-size: 8px; line-height: 1.5; }
@media (max-width: 1100px) { .analytics-tuning-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .analytics-tuning-grid { grid-template-columns: 1fr; } .analytics-tuning-actions { justify-content: stretch; } .analytics-tuning-actions button { flex: 1; } }

/* Mobile workspace polish */
@media (max-width: 767px) {
  .knowledge-layout { display:flex; flex-direction:column; min-height:calc(100dvh - 210px); }
  .knowledge-nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; max-height:38dvh; overflow-y:auto; overflow-x:hidden; padding:10px; }
  .knowledge-nav .nav-label { grid-column:1 / -1; margin-top:4px; }
  .knowledge-item { min-width:0; width:100%; min-height:46px; margin:0; padding:8px 10px; text-align:left; white-space:normal; line-height:1.25; }
  .knowledge-article { min-height:0; flex:1; overflow-y:auto; }

  .telegram-chat-composer { box-shadow:0 8px 24px rgba(25,35,75,.08); }
  .telegram-chat-composer textarea { min-height:92px; font-size:15px; }
  .telegram-chat-composer > div { gap:10px; }
  .telegram-chat-composer > div span { line-height:1.4; }
  .telegram-chat-composer .action-btn { min-height:44px; border-radius:12px; }
  .telegram-chat-composer + .data-table { display:block; }
  .telegram-chat-composer + .data-table thead { display:none; }
  .telegram-chat-composer + .data-table tbody,
  .telegram-chat-composer + .data-table tr,
  .telegram-chat-composer + .data-table td { display:block; }
  .telegram-chat-composer + .data-table tr { margin:0 12px 10px; padding:12px; border:1px solid var(--border); border-radius:14px; background:var(--surface); }
  .telegram-chat-composer + .data-table td { padding:5px 0; border:0; }
  .telegram-chat-composer + .data-table td::before { display:block; margin-bottom:3px; color:var(--subtle); font-size:8px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
  .telegram-chat-composer + .data-table td:nth-child(2)::before { content:"Message / command"; }
  .telegram-chat-composer + .data-table td:nth-child(3)::before { content:"Bot response"; }
  .telegram-chat-composer + .data-table td:nth-child(4)::before { content:"Time"; }
  .telegram-chat-composer + .data-table td:nth-child(5)::before { content:"Status"; }

  .team-chat-suite { height:calc(100dvh - var(--topbar-height) - var(--mobile-tabbar-height) - 12px); min-height:520px; }
  .team-chat-main-pane { min-height:0; grid-template-rows:68px minmax(0,1fr) auto; }
  .team-chat-main-pane > div:first-child { position:sticky; top:0; z-index:3; padding:10px 12px !important; background:color-mix(in srgb,var(--surface) 94%,transparent) !important; backdrop-filter:blur(12px); }
  .team-chat-main-pane > #team-chat-messages { min-height:0; height:auto; padding:12px !important; gap:12px !important; }
  .team-chat-main-pane > #team-chat-messages > div { gap:8px !important; }
  .team-chat-main-pane > form { padding:10px !important; gap:8px; }
  .team-chat-main-pane > form textarea { font-size:15px !important; }
  .team-chat-main-pane > form .action-btn { min-height:42px; justify-content:center; }
  .team-chat-sidebar-left { background:var(--surface); }
  .team-chat-sidebar-left > div:first-child { padding:12px !important; background:var(--surface-2); }
  .team-chat-sidebar-left > div:nth-child(2) { padding:12px !important; }

  .ai-team-layout { grid-template-columns:148px minmax(0,1fr); gap:8px; height:calc(100dvh - 310px); min-height:520px; }
  .ai-agent-list { min-height:0; overflow:hidden; }
  .ai-agent-list .panel-header { padding:12px; }
  .ai-agent-list .panel-header h2 { font-size:13px; }
  .ai-agent-list .panel-header p { font-size:8px; }
  .ai-agent-list .panel-body { min-height:0; overflow-y:auto; grid-template-columns:1fr; padding:6px; }
  .ai-agent-card { grid-template-columns:30px minmax(0,1fr) 7px; gap:6px; padding:8px; }
  .ai-agent-avatar { width:30px; height:30px; border-radius:9px; }
  .ai-agent-card strong { font-size:9px; }
  .ai-agent-card small { font-size:7px; }
  .ai-chat-panel { min-height:0; height:100%; grid-template-rows:auto auto auto minmax(0,1fr) auto; }
  .ai-chat-messages { min-height:0; max-height:none; height:auto; padding:10px; }
  .ai-chat-form { padding:10px; }
}

@media (max-width: 420px) {
  .ai-team-layout { grid-template-columns:124px minmax(0,1fr); }
  .ai-agent-card { grid-template-columns:1fr 7px; }
  .ai-agent-avatar { display:none; }
}
/* AI Team mobile pane corrections */
@media (max-width: 767px) {
  .ai-agent-list .panel-body { display:flex !important; flex-direction:column !important; grid-template-columns:none !important; overflow-y:auto !important; overflow-x:hidden !important; }
  .ai-agent-card { flex:0 0 auto; width:100% !important; min-width:0; }
  .ai-chat-panel { display:grid !important; min-height:0 !important; height:100% !important; grid-template-rows:auto auto auto minmax(0,1fr) auto !important; overflow:hidden !important; }
  .ai-chat-messages { min-height:0 !important; height:100% !important; overflow-y:auto !important; }
  .ai-chat-form { display:grid !important; min-height:96px; }
  .ai-chat-form textarea { min-height:48px; max-height:90px; }
}
/* Team Chat mobile channel drawer */
@media (max-width: 767px) {
  .team-chat-sidebar-left > div:nth-child(2) { overflow-y:auto; overflow-x:hidden; }
  .team-chat-sidebar-left > div:nth-child(2) > button[data-action="select-team-channel"],
  .team-chat-sidebar-left > div:nth-child(2) > button[data-action="select-team-dm"] {
    display:inline-flex !important;
    vertical-align:top;
    width:calc(50% - 5px) !important;
    height:78px !important;
    margin:3px 2px !important;
    padding:10px 8px !important;
    flex-direction:column;
    justify-content:center !important;
    align-items:center !important;
    gap:5px;
    border:1px solid var(--border);
    border-radius:14px;
    background:var(--surface-2);
    text-align:center;
  }
  .team-chat-sidebar-left > div:nth-child(2) > button[data-action="select-team-channel"].active,
  .team-chat-sidebar-left > div:nth-child(2) > button[data-action="select-team-dm"].active {
    border-color:rgba(124,140,255,.55);
    background:linear-gradient(145deg,rgba(124,140,255,.2),rgba(82,217,233,.08));
    box-shadow:0 8px 18px rgba(35,45,100,.12);
  }
  .team-chat-sidebar-left > div:nth-child(2) > button[data-action="select-team-channel"] > span:first-child {
    margin:0 !important;
    color:var(--accent-2) !important;
    font-size:25px;
    line-height:1;
  }
  .team-chat-sidebar-left > div:nth-child(2) > button[data-action="select-team-dm"] > span:first-child {
    width:13px !important;
    height:13px !important;
    margin:0 !important;
    box-shadow:0 0 0 4px color-mix(in srgb,var(--success) 14%,transparent);
  }
  .team-chat-sidebar-left > div:nth-child(2) .nav-text {
    width:100%;
    overflow:hidden;
    color:var(--text);
    font-size:10px !important;
    font-weight:750;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .team-chat-sidebar-left > div:nth-child(2) .nav-badge { position:absolute; top:7px; right:7px; }
}
.business-workspace-admin-card .panel-body {
  display: grid;
  gap: 8px;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--border);
}

.business-admin-overview { overflow: visible; }

.business-admin-summary {
  min-height: 58px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.business-admin-summary > div {
  min-width: 116px;
  padding-right: 14px;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.business-admin-summary strong { font-size: 20px; }
.business-admin-summary span { color: var(--muted); font-size: 10px; font-weight: 750; }
.business-admin-summary .action-btn { margin-left: auto; }

.business-admin-toolbar {
  padding: 0 12px 10px;
  display: grid;
  grid-template-columns: minmax(220px,1fr) 180px auto;
  align-items: center;
  gap: 8px;
}

.business-admin-search {
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.business-admin-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,140,255,.11); }
.business-admin-search svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--subtle); }
.business-admin-search input { min-width: 0; width: 100%; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.business-admin-toolbar select { height: 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); padding: 0 10px; }
.business-result-count { color: var(--muted); font-size: 10px; font-weight: 750; white-space: nowrap; }

.business-admin-list { display: grid; gap: 7px; }
.business-workspace-admin-card { overflow: hidden; }

.business-account-row {
  width: 100%;
  min-height: 58px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: minmax(220px,1fr) 110px 120px 24px;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.business-account-row:hover { background: rgba(124,140,255,.055); }
.business-account-primary { min-width: 0; display: grid; gap: 3px; }
.business-account-primary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.business-account-primary small, .business-tool-count { color: var(--muted); font-size: 9px; }
.business-tool-count { text-align: right; font-weight: 750; }
.business-account-chevron { width: 20px; height: 20px; color: var(--subtle); transition: transform .18s ease; }
.business-workspace-admin-card.expanded .business-account-chevron { transform: rotate(90deg); }
.business-pagination { display: flex; justify-content: center; align-items: center; gap: 10px; }
.business-pagination span { color: var(--muted); font-size: 10px; }

.business-workspace-control {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.business-workspace-control > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.business-workspace-control > header div {
  display: grid;
  gap: 3px;
}

.business-workspace-control > header span,
.business-workspace-control > header code {
  color: var(--muted);
  font-size: 10px;
}

.business-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.business-tool-toggle {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-1);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.business-tool-toggle i {
  min-width: 30px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-align: right;
}

.business-tool-toggle.enabled {
  border-color: color-mix(in srgb, var(--success) 48%, var(--border));
  background: color-mix(in srgb, var(--success) 10%, var(--surface-1));
}

.business-tool-toggle.enabled i {
  color: var(--success);
}

@media (max-width: 760px) {
  .business-admin-summary { min-height: 0; padding: 8px; gap: 6px; }
  .business-admin-summary > div { min-width: 0; flex: 1; padding-right: 6px; display: grid; gap: 1px; }
  .business-admin-summary strong { font-size: 16px; }
  .business-admin-summary span { font-size: 8px; }
  .business-admin-summary .action-btn { width: 40px; min-width: 40px; padding: 0; font-size: 0; }
  .business-admin-summary .action-btn svg { margin: 0; }
  .business-admin-toolbar { padding: 0 8px 8px; grid-template-columns: minmax(0,1fr) 116px; }
  .business-result-count { display: none; }
  .business-account-row { min-height: 62px; padding: 8px 10px; grid-template-columns: minmax(0,1fr) auto 20px; gap: 7px; }
  .business-tool-count { grid-column: 1 / 3; grid-row: 2; text-align: left; }
  .business-account-primary { grid-column: 1; grid-row: 1; }
  .business-account-row > .status-pill { grid-column: 2; grid-row: 1; }
  .business-account-chevron { grid-column: 3; grid-row: 1 / 3; }
  .business-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .business-workspace-control > header {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .business-admin-toolbar { grid-template-columns: 1fr; }
  .business-admin-toolbar select { width: 100%; }
  .business-tool-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .business-tool-toggle { min-height: 42px; font-size: 10px; }
}
.inventory-recommendation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.inventory-recommendation {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
}

.inventory-recommendation span {
  color: var(--text);
  font-weight: 700;
}

.inventory-recommendation small {
  color: var(--muted);
}

/* Smart Inventory and workspace-scoped Point of Sale */
.inventory-command-panel { overflow:hidden; }
.inventory-toolbar { gap:16px; align-items:center; }
.inventory-toolbar .toolbar-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.compact-search { width:min(340px,32vw); }
.inventory-toolbar .search-box,.pos-tools .search-box { display:flex; align-items:center; gap:8px; min-height:40px; padding:0 11px; border:1px solid var(--border); border-radius:10px; background:var(--surface-2); color:var(--muted); overflow:hidden; }
.inventory-toolbar .search-box svg,.pos-tools .search-box svg { width:16px; height:16px; min-width:16px; flex:0 0 16px; }
.inventory-toolbar .search-box input,.pos-tools .search-box input { width:100%; min-width:0; border:0; outline:0; padding:0; background:transparent; color:var(--text); font:inherit; }
.inventory-recommendation { display:flex; flex-direction:column; align-items:flex-start; gap:7px; }
.inventory-recommendation .action-btn { margin-top:auto; width:100%; justify-content:center; }

.pos-shell { display:grid; grid-template-columns:minmax(0,1fr) minmax(310px,380px); grid-template-areas:"catalogue cart" "history cart"; gap:14px; align-items:start; }
.pos-catalogue { min-width:0; display:flex; flex-direction:column; gap:14px; }
.pos-catalogue { grid-area:catalogue; }
.pos-head { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; padding:18px 20px; border:1px solid var(--border); border-radius:16px; background:var(--surface); }
.pos-head h2 { margin:8px 0 4px; font-size:24px; }
.pos-head p { margin:0; color:var(--muted); }
.pos-shift { text-align:right; display:flex; flex-direction:column; gap:3px; }
.pos-shift span { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.08em; }
.pos-tools { display:grid; gap:9px; }
.pos-tools .search-box { width:100%; }
.pos-categories { display:flex; gap:7px; overflow-x:auto; scrollbar-width:none; }
.pos-categories button,.pos-tenders button { border:1px solid var(--border); border-radius:999px; background:var(--surface); color:var(--muted); padding:9px 14px; white-space:nowrap; font-weight:700; }
.pos-categories button.active,.pos-tenders button.active { color:var(--text); border-color:var(--accent); background:color-mix(in srgb,var(--accent) 16%,var(--surface)); }
.pos-product-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:9px; }
.pos-product { min-height:92px; display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; text-align:left; gap:10px; padding:12px; border:1px solid var(--border); border-radius:14px; color:var(--text); background:var(--surface); transition:transform .12s ease,border-color .12s ease; }
.pos-product:hover { transform:translateY(-1px); border-color:var(--accent); }
.pos-product:active { transform:scale(.98); }
.pos-product.sold-out { opacity:.45; }
.pos-product-mark { width:42px; height:42px; border-radius:11px; display:grid; place-items:center; background:color-mix(in srgb,var(--accent) 15%,var(--surface-2)); color:var(--accent-2); font-weight:800; }
.pos-product > span:nth-child(2) { min-width:0; display:flex; flex-direction:column; gap:4px; }
.pos-product strong,.pos-product small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pos-product small { color:var(--muted); }
.pos-product b { color:var(--accent-2); }
.pos-cart { grid-area:cart; position:sticky; top:14px; overflow:hidden; }
.pos-cart-lines { max-height:calc(100vh - 390px); overflow:auto; }
.pos-cart-line { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:9px; align-items:center; padding:11px 14px; border-bottom:1px solid var(--border); }
.pos-cart-line > div:first-child { min-width:0; display:flex; flex-direction:column; }
.pos-cart-line span { color:var(--muted); font-size:10px; }
.pos-quantity { display:flex; align-items:center; gap:8px; }
.pos-quantity button { width:30px; height:30px; border:1px solid var(--border); border-radius:9px; background:var(--surface-2); color:var(--text); font-size:18px; }
.pos-cart-total { display:flex; justify-content:space-between; align-items:center; padding:16px 14px 8px; font-size:14px; }
.pos-cart-total strong { font-size:24px; }
.pos-tenders { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; padding:8px 14px; }
.pos-tenders button { padding-inline:8px; }
.pos-checkout { width:calc(100% - 28px); justify-content:center; margin:5px 14px 14px; min-height:48px; }
.pos-history { grid-area:history; overflow:hidden; }
.pos-sale-row { width:100%; border:0; border-top:1px solid var(--border); background:transparent; color:var(--text); text-align:left; cursor:pointer; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:3px 12px; padding:10px 14px; }
.pos-sale-row:hover { background:var(--surface-2); }
.pos-sale-row small { grid-column:1/-1; color:var(--muted); }
.pos-sale-line-detail { display:flex; justify-content:space-between; gap:16px; align-items:center; padding:10px 0; border-bottom:1px solid var(--border); }
.pos-sale-line-detail span { display:flex; flex-direction:column; gap:3px; }
.pos-sale-line-detail small { color:var(--muted); }
.pos-mobile-cart { display:none; }

@media (max-width:767px) and (orientation:portrait) {
  .inventory-toolbar { align-items:stretch; }
  .inventory-toolbar,.inventory-toolbar .toolbar-actions { flex-direction:column; }
  .inventory-toolbar .toolbar-actions > *,.compact-search { width:100%; }
  .inventory-command-panel .panel-header { align-items:flex-start; }
  .pos-shell { display:flex; flex-direction:column; padding-bottom:66px; }
  .pos-catalogue { order:1; }
  .pos-head { padding:13px; }
  .pos-head h2 { font-size:20px; }
  .pos-head p { font-size:11px; }
  .pos-shift { display:none; }
  .pos-product-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .pos-product { min-height:112px; grid-template-columns:36px minmax(0,1fr); align-content:center; padding:10px; }
  .pos-product-mark { width:36px; height:36px; }
  .pos-product b { grid-column:2; }
  .pos-cart { order:2; position:relative; top:0; width:100%; }
  .pos-history { order:3; width:100%; }
  .pos-cart-lines { max-height:none; }
  .pos-mobile-cart { display:none; }
}

@media (max-width: 640px) {
  .inventory-recommendation-grid {
    grid-template-columns: 1fr;
    padding: 0 12px 12px;
  }

  .inventory-forecast-panel .panel-header {
    align-items: flex-start;
  }
}
.notice-card {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
}

.notice-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}


/* Unified product-family login. AkiHQ uses the same layout language as AkiPasa
   and AkiBusiness, with its own blue/purple identity. */
.suite-login-screen {
  --suite-accent: #8b68ff;
  --suite-accent-soft: rgba(139,104,255,.14);
  --suite-bg: #14213d;
  min-height: 100dvh;
  width: 100vw;
  overflow-y: auto;
  background:
    radial-gradient(circle at 12% 12%, rgba(80,118,255,.18), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(139,104,255,.18), transparent 30rem),
    linear-gradient(145deg, #101a35, #14213d 54%, #12172f);
  color: #f7f7f5;
}

.suite-login-shell {
  width: min(1180px, calc(100% - 2rem));
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .8fr);
  align-items: center;
  gap: clamp(3rem, 7vw, 7rem);
  padding: 4rem 0;
}

.suite-login-intro {
  display: grid;
  align-content: center;
  max-width: 35rem;
}

.suite-login-kicker,
.suite-product-label,
.suite-login-form-head > span {
  color: var(--suite-accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.suite-login-intro h1 {
  margin: .55rem 0 .6rem;
  max-width: 8ch;
  font-size: clamp(3.3rem, 7vw, 6.4rem);
  line-height: .92;
  letter-spacing: -.065em;
}

.suite-login-intro > p {
  max-width: 32rem;
  margin: 0 0 2.2rem;
  color: #b6c0d7;
  font-size: 1rem;
  line-height: 1.55;
}

.suite-product-switcher {
  display: grid;
  gap: .55rem;
  margin-top: .65rem;
}

.suite-product-card {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-items: center;
  gap: .8rem;
  min-height: 64px;
  padding: .78rem .95rem;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 14px;
  background: rgba(23,35,68,.78);
  color: #f7f7f5;
  text-decoration: none;
  transition: .16s ease;
}

.suite-product-card:hover {
  transform: translateY(-1px);
  border-color: rgba(139,104,255,.55);
  background: rgba(36,46,86,.9);
}

.suite-product-card.active {
  border-color: rgba(139,104,255,.74);
  background: rgba(139,104,255,.12);
  box-shadow:
    inset 3px 0 0 var(--suite-accent),
    0 10px 30px rgba(92,64,205,.12);
}

.suite-product-card > span {
  display: grid;
  gap: .16rem;
  min-width: 0;
}

.suite-product-card strong {
  font-size: .88rem;
}

.suite-product-card small {
  color: #9fa9c2;
  font-size: .72rem;
  line-height: 1.35;
}

.suite-product-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255,255,255,.035);
}
.suite-product-dot-akipasa { background: #ff6b1d; }
.suite-product-dot-business { background: #ffd447; }
.suite-product-dot-hq { background: #8b68ff; }

.suite-login-panel {
  width: 100%;
  padding: clamp(1.55rem, 3vw, 2.25rem);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  background: rgba(17,25,54,.82);
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
  backdrop-filter: blur(24px) saturate(135%);
}

.suite-login-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.8rem;
}

.suite-login-brand img {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.suite-login-brand > div {
  display: grid;
  line-height: 1.05;
}

.suite-login-brand strong {
  font-size: 1rem;
}

.suite-login-brand small {
  margin-top: .18rem;
  color: #8f99b3;
  font-size: .65rem;
}

.suite-login-form-head h2 {
  margin: .35rem 0 .3rem;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  letter-spacing: -.035em;
}

.suite-login-form-head p {
  margin: 0 0 1.25rem;
  color: #9fa9c2;
  font-size: .78rem;
  line-height: 1.45;
}

.suite-google-btn {
  min-height: 48px;
  border-radius: 13px;
}

.suite-login-form {
  display: grid;
  gap: .85rem;
}

.suite-login-form label {
  display: grid;
  gap: .4rem;
  color: #f2f4fa;
  font-size: .78rem;
  font-weight: 760;
}

.suite-login-form input {
  width: 100%;
  min-height: 48px;
  padding: .8rem .9rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  outline: none;
  background: rgba(37,47,88,.72);
  color: #f7f7f5;
}

.suite-login-form input:focus {
  border-color: rgba(139,104,255,.72);
  box-shadow: 0 0 0 3px rgba(139,104,255,.15);
}

.suite-login-submit {
  min-height: 48px;
  margin-top: .15rem;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #6079f4, #8b68ff);
}

.suite-login-submit:hover {
  filter: brightness(1.05);
}

.suite-login-foot {
  margin: 1rem 0 0;
  color: #8f99b3;
  font-size: .7rem;
  line-height: 1.45;
  text-align: center;
}

.suite-login-error {
  margin-bottom: 1rem;
}

.login-mode {
  min-height: 100dvh;
  overflow: auto;
}

@media (max-width: 850px) {
  .suite-login-shell {
    display: flex;
    flex-direction: column;
    width: min(100% - 1.25rem, 38rem);
    min-height: 100dvh;
    align-items: stretch;
    gap: 1.15rem;
    padding: calc(1rem + env(safe-area-inset-top, 0px)) 0 2.5rem;
  }

  .suite-login-intro {
    display: contents;
  }

  .suite-login-kicker {
    order: 1;
    padding-top: 0.25rem;
  }

  .suite-login-intro h1 {
    order: 2;
    max-width: 9ch;
    margin: 0.25rem 0 0.45rem;
    font-size: clamp(2.8rem, 12.5vw, 4.35rem);
  }

  .suite-login-panel {
    order: 3;
    padding: 1.25rem;
    border-radius: 18px;
  }

  .suite-product-label {
    display: none;
  }

  .suite-product-switcher {
    order: 4;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    width: 100%;
    margin-top: 0.25rem;
  }

  .suite-product-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.4rem;
    min-height: 48px;
    padding: 0.58rem 0.52rem;
    border-radius: 12px;
  }

  .suite-product-card strong {
    overflow: hidden;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .suite-product-card small {
    display: none;
  }

  .suite-product-card.active {
    box-shadow:
      inset 0 -3px 0 var(--suite-accent),
      0 8px 20px rgba(92,64,205,.1);
  }

  .suite-login-brand {
    margin-bottom: 1.1rem;
  }

  .suite-login-form-head h2 {
    margin-bottom: 0.85rem;
  }
}
