/* EMA Design System — shared demo application shell */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--ema-font-sans);
  font-size: var(--ema-text-md);
  color: var(--ema-text);
  background: var(--ema-bg);
  -webkit-font-smoothing: antialiased;
}

.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.app-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 224px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  background: var(--ema-surface);
  border-right: 1px solid var(--ema-border);
  transition: transform 250ms var(--ema-ease);
}
.app-logo {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--ema-border);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.app-logo__mark {
  width: 30px; height: 30px; flex: none;
  border-radius: var(--ema-radius-md);
  background: linear-gradient(135deg, var(--ema-primary), var(--ema-secondary));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: var(--ema-shadow-sm);
}
.app-logo__mark svg { width: 16px; height: 16px; }
.app-logo small { display: block; font-weight: 500; font-size: 0.65rem; color: var(--ema-text-3); letter-spacing: 0.04em; }

.app-nav { flex: 1; padding: 0.75rem 0.6rem; overflow-y: auto; }
.app-nav__item {
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.7rem;
  margin-bottom: 2px;
  border: none; background: none;
  border-radius: var(--ema-radius-md);
  font: inherit; font-size: var(--ema-text-sm); font-weight: 500;
  color: var(--ema-text-2);
  cursor: pointer;
  text-align: left;
  transition: all 130ms var(--ema-ease);
  text-decoration: none;
}
.app-nav__item svg { width: 16px; height: 16px; flex: none; }
.app-nav__item:hover { background: var(--ema-surface-3); color: var(--ema-text); }
.app-nav__item.active {
  background: var(--ema-primary-soft);
  color: var(--ema-primary);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--ema-primary);
}
.app-nav__badge { margin-left: auto; }

.app-sidebar__footer {
  padding: 0.75rem 0.9rem;
  border-top: 1px solid var(--ema-border);
  font-size: var(--ema-text-xs);
}
.app-sidebar__footer a {
  display: flex; align-items: center; gap: 0.4rem;
  color: var(--ema-text-3);
  text-decoration: none;
  transition: color 120ms;
}
.app-sidebar__footer a:hover { color: var(--ema-primary); }
.app-sidebar__footer svg { width: 12px; height: 12px; }

/* ---------- Main / topbar ---------- */
.app-main { flex: 1; margin-left: 224px; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  position: sticky; top: 0;
  z-index: 300;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 1.5rem;
  background: color-mix(in srgb, var(--ema-surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ema-border);
  min-height: 54px;
}
.app-topbar__burger { display: none; }
.app-topbar__title { font-size: var(--ema-text-lg); font-weight: 700; margin-right: auto; }
.app-topbar .doc-theme-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--ema-border-strong);
  cursor: pointer; padding: 0;
  transition: transform 150ms var(--ema-ease-spring);
}
.app-topbar .doc-theme-dot:hover { transform: scale(1.18); }
.app-topbar .doc-theme-dot.active { border-color: var(--ema-primary); box-shadow: var(--ema-focus-ring); }
.doc-theme-dot--light   { background: linear-gradient(135deg, #f7f9fc 50%, #1f5fa8 50%); }
.doc-theme-dot--dark    { background: linear-gradient(135deg, #151d2a 50%, #5495db 50%); }
.doc-theme-dot--navy    { background: linear-gradient(135deg, #0a1626 50%, #6db3f2 50%); }
.doc-theme-dot--emerald { background: linear-gradient(135deg, #f4faf6 50%, #178a53 50%); }
.app-settings-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border: 1px solid var(--ema-border-strong);
  border-radius: var(--ema-radius-md);
  background: var(--ema-surface);
  color: var(--ema-text-2);
  cursor: pointer;
  transition: all 150ms;
}
.app-settings-btn:hover { color: var(--ema-primary); border-color: var(--ema-primary); transform: rotate(30deg); }
.app-settings-btn svg { width: 15px; height: 15px; }
.doc-set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  margin-bottom: 0.45rem;
  font-size: var(--ema-text-sm);
  color: var(--ema-text-2);
}
.doc-set-row input[type="color"] {
  width: 56px; height: 26px;
  border: 1px solid var(--ema-border-strong);
  border-radius: var(--ema-radius-sm);
  background: var(--ema-surface);
  padding: 1px; cursor: pointer;
}
.doc-set-row select {
  height: 26px; min-width: 110px;
  border: 1px solid var(--ema-border-strong);
  border-radius: var(--ema-radius-sm);
  background: var(--ema-surface);
  color: var(--ema-text);
  font: inherit; font-size: var(--ema-text-sm);
  cursor: pointer; outline: none;
}

.app-content { flex: 1; padding: 1.4rem 1.5rem 3rem; animation: ema-fade-in 200ms var(--ema-ease); }
.app-content h2 { margin: 1.75rem 0 0.75rem; font-size: 1.1rem; }
.app-content h2:first-child { margin-top: 0; }

/* ---------- Widgets ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.9rem; margin-bottom: 1.1rem; }
@media (max-width: 1100px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }

.panel {
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-lg);
  box-shadow: var(--ema-shadow-sm);
}
.panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.8rem 1rem 0.4rem;
  background: var(--ema-header-bg, transparent);
  color: var(--ema-header-text, inherit);
  border-radius: var(--ema-radius-lg) var(--ema-radius-lg) 0 0;
}
.panel__head .panel__sub { color: var(--ema-header-text-2, var(--ema-text-3)); }
.panel__title { font-weight: 700; font-size: var(--ema-text-md); }
.panel__sub { font-size: var(--ema-text-xs); color: var(--ema-text-3); }
.panel__body { padding: 0.5rem 1rem 1rem; }

.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 0.9rem; margin-bottom: 0.9rem; }
.two-col--even { grid-template-columns: 1fr 1fr; }
@media (max-width: 1000px) { .two-col, .two-col--even { grid-template-columns: 1fr; } }

/* charts */
.chart svg { display: block; width: 100%; height: auto; }
.chart text { font-family: var(--ema-font-sans); font-size: 10px; fill: var(--ema-text-3); }
.chart .grid-line { stroke: var(--ema-border); stroke-dasharray: 2 3; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 0.9rem; padding: 0.3rem 0 0; font-size: var(--ema-text-xs); color: var(--ema-text-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.chart-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* simple list */
.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--ema-border);
  font-size: var(--ema-text-sm);
}
.simple-list li:last-child { border-bottom: none; }
.simple-list .when { margin-left: auto; color: var(--ema-text-3); font-size: var(--ema-text-xs); white-space: nowrap; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(225px, 1fr); gap: 0.8rem; overflow-x: auto; padding-bottom: 0.75rem; }
.kanban__col {
  background: var(--ema-surface-2);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-lg);
  display: flex; flex-direction: column;
  max-height: 70vh;
}
.kanban__head {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 0.8rem;
  font-weight: 700; font-size: var(--ema-text-sm);
  border-bottom: 1px solid var(--ema-border);
}
.kanban__head .ema-badge { margin-left: auto; }
.kanban__sum { padding: 0.3rem 0.8rem; font-size: var(--ema-text-xs); color: var(--ema-text-3); border-bottom: 1px solid var(--ema-border); }
.kanban__cards { padding: 0.6rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.55rem; }
.deal-card {
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-md);
  padding: 0.6rem 0.7rem;
  box-shadow: var(--ema-shadow-sm);
  transition: transform 150ms var(--ema-ease), box-shadow 150ms;
  animation: ema-pop-in 250ms var(--ema-ease-out);
}
.deal-card:hover { transform: translateY(-2px); box-shadow: var(--ema-shadow-md); }
.deal-card__name { font-weight: 600; font-size: var(--ema-text-sm); display: flex; justify-content: space-between; gap: 0.4rem; }
.deal-card__meta { display: flex; align-items: center; gap: 0.45rem; margin-top: 0.45rem; font-size: var(--ema-text-xs); color: var(--ema-text-3); }
.deal-card__value { font-weight: 700; color: var(--ema-primary); }

/* ---------- Recon detail (airline) ---------- */
.recon-compare { width: 100%; border-collapse: collapse; font-size: var(--ema-text-sm); }
.recon-compare th, .recon-compare td { text-align: right; padding: 0.4rem 0.7rem; border-bottom: 1px solid var(--ema-border); }
.recon-compare th:first-child, .recon-compare td:first-child { text-align: left; }
.recon-compare th { font-size: var(--ema-text-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ema-text-3); }
.recon-compare .diff-bad { color: var(--ema-danger); font-weight: 700; }
.recon-compare .diff-ok { color: var(--ema-success); }
.recon-compare tr:last-child td { border-bottom: none; }

/* progress-in-cell */
.cell-progress { display: flex; align-items: center; gap: 0.5rem; }
.cell-progress .ema-progress { flex: 1; min-width: 50px; }
.cell-progress span { font-size: var(--ema-text-xs); color: var(--ema-text-3); min-width: 34px; text-align: right; }

/* ---------- POS (point of sale) ---------- */
.pos-layout { display: grid; grid-template-columns: 1fr 340px; gap: 0.9rem; align-items: start; }
@media (max-width: 1000px) { .pos-layout { grid-template-columns: 1fr; } }
.pos-cats { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.pos-cat {
  border: 1px solid var(--ema-border-strong);
  background: var(--ema-surface);
  color: var(--ema-text-2);
  font: inherit; font-size: var(--ema-text-sm); font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: var(--ema-radius-full);
  cursor: pointer;
  transition: all 130ms var(--ema-ease);
}
.pos-cat:hover { border-color: var(--ema-primary); color: var(--ema-primary); }
.pos-cat.active { background: var(--ema-primary); border-color: var(--ema-primary); color: var(--ema-on-primary); }
.pos-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 0.6rem; }
.pos-product {
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-lg);
  padding: 0.7rem;
  cursor: pointer;
  text-align: center;
  user-select: none;
  transition: all 130ms var(--ema-ease);
  position: relative;
  overflow: hidden;
}
.pos-product:hover { border-color: var(--ema-primary); box-shadow: var(--ema-shadow-md); transform: translateY(-2px); }
.pos-product:active { transform: scale(0.96); }
.pos-product__emoji { font-size: 1.7rem; line-height: 1.3; }
.pos-product__name { font-size: var(--ema-text-sm); font-weight: 600; margin: 0.25rem 0 0.15rem; }
.pos-product__price { font-size: var(--ema-text-sm); color: var(--ema-primary); font-weight: 700; }
.pos-product__stock { font-size: 0.62rem; color: var(--ema-text-3); }
.pos-product--out { opacity: 0.45; pointer-events: none; }

.pos-cart { position: sticky; top: 70px; }
.pos-cart__items { max-height: 38vh; overflow-y: auto; }
.pos-line {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--ema-border);
  font-size: var(--ema-text-sm);
}
.pos-line__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-line__qty { display: inline-flex; align-items: center; gap: 0.35rem; }
.pos-line__qty button {
  width: 1.35rem; height: 1.35rem;
  border: 1px solid var(--ema-border-strong);
  background: var(--ema-surface);
  color: var(--ema-text-2);
  border-radius: var(--ema-radius-sm);
  cursor: pointer;
  font: inherit; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 110ms;
}
.pos-line__qty button:hover { border-color: var(--ema-primary); color: var(--ema-primary); }
.pos-line__total { font-weight: 700; min-width: 64px; text-align: right; }
.pos-totals { font-size: var(--ema-text-sm); color: var(--ema-text-2); display: flex; flex-direction: column; gap: 0.25rem; padding: 0.6rem 0; }
.pos-totals div { display: flex; justify-content: space-between; }
.pos-totals .grand { font-size: var(--ema-text-lg); font-weight: 800; color: var(--ema-text); border-top: 1px solid var(--ema-border); padding-top: 0.4rem; margin-top: 0.2rem; }

/* ---------- Trace timeline (airline) ---------- */
.trace-timeline { list-style: none; margin: 0.5rem 0 0; padding: 0; position: relative; }
.trace-timeline::before {
  content: "";
  position: absolute; left: 13px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--ema-border);
}
.trace-step { display: flex; gap: 0.8rem; padding: 0.45rem 0; position: relative; }
.trace-step__dot {
  width: 28px; height: 28px; flex: none;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ema-primary-soft);
  color: var(--ema-primary);
  border: 2px solid var(--ema-surface);
  z-index: 1;
}
.trace-step__dot svg { width: 13px; height: 13px; }
.trace-step--ok .trace-step__dot { background: var(--ema-success-soft); color: var(--ema-success); }
.trace-step--warn .trace-step__dot { background: var(--ema-warning-soft); color: var(--ema-warning); }
.trace-step--bad .trace-step__dot { background: var(--ema-danger-soft); color: var(--ema-danger); }
.trace-step__body { flex: 1; min-width: 0; padding-top: 0.15rem; }
.trace-step__title { font-weight: 600; font-size: var(--ema-text-sm); display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.trace-step__meta { font-size: var(--ema-text-xs); color: var(--ema-text-3); margin-top: 0.1rem; }
.trace-step__amount { margin-left: auto; font-weight: 700; font-size: var(--ema-text-sm); white-space: nowrap; padding-top: 0.2rem; }

/* ---------- SSO: login & portal ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  background:
    radial-gradient(900px 420px at 10% 0%, color-mix(in srgb, var(--ema-primary) 14%, transparent), transparent 60%),
    radial-gradient(700px 380px at 95% 100%, color-mix(in srgb, var(--ema-secondary) 12%, transparent), transparent 60%),
    var(--ema-bg);
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-xl);
  box-shadow: var(--ema-shadow-xl);
  padding: 2rem 1.8rem 1.6rem;
  animation: ema-pop-up 350ms var(--ema-ease-spring);
}
.login-logo { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.1rem; margin-bottom: 1.2rem; }
.login-divider {
  display: flex; align-items: center; gap: 0.7rem;
  margin: 1rem 0;
  color: var(--ema-text-3); font-size: var(--ema-text-xs);
}
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--ema-border); }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  width: 100%;
  height: var(--ema-control-h-md);
  border: 1px solid var(--ema-border-strong);
  border-radius: var(--ema-radius-md);
  background: var(--ema-surface);
  color: var(--ema-text);
  font: inherit; font-size: var(--ema-text-sm); font-weight: 600;
  cursor: pointer;
  transition: all 130ms var(--ema-ease);
  margin-bottom: 0.45rem;
}
.social-btn:hover { border-color: var(--ema-primary); background: var(--ema-primary-soft); }
.social-btn svg, .social-btn .g { width: 16px; height: 16px; flex: none; }
.login-demo-accounts {
  margin-top: 1.1rem;
  border-top: 1px dashed var(--ema-border);
  padding-top: 0.8rem;
  font-size: var(--ema-text-xs);
  color: var(--ema-text-3);
}
.login-demo-accounts code {
  cursor: pointer;
  color: var(--ema-primary);
  background: var(--ema-primary-soft);
  border-radius: var(--ema-radius-xs);
  padding: 0 0.3rem;
  font-family: var(--ema-font-mono);
}
.login-demo-accounts code:hover { background: var(--ema-primary-soft-2); }
.login-demo-accounts li { margin: 0.2rem 0; }

.portal-topbar {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.7rem 1.5rem;
  background: var(--ema-surface);
  border-bottom: 1px solid var(--ema-border);
}
.portal-main { max-width: 980px; margin: 0 auto; padding: 2rem 1.2rem 4rem; }
.portal-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.portal-app {
  display: flex; gap: 0.85rem; align-items: flex-start;
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-lg);
  padding: 1.1rem;
  text-decoration: none; color: var(--ema-text);
  transition: all 180ms var(--ema-ease);
  position: relative;
}
.portal-app:hover { transform: translateY(-3px); box-shadow: var(--ema-shadow-lg); border-color: var(--ema-primary-border); }
.portal-app--locked { opacity: 0.55; }
.portal-app--locked:hover { transform: none; box-shadow: none; border-color: var(--ema-border); }
.portal-app__icon {
  width: 42px; height: 42px; flex: none;
  border-radius: var(--ema-radius-md);
  background: linear-gradient(135deg, var(--ema-primary), var(--ema-secondary));
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.portal-app__icon svg { width: 20px; height: 20px; }
.portal-app--locked .portal-app__icon { background: var(--ema-surface-3); color: var(--ema-text-3); }
.portal-app h3 { margin: 0 0 0.15rem; font-size: var(--ema-text-md); }
.portal-app p { margin: 0; font-size: var(--ema-text-xs); color: var(--ema-text-3); }
.portal-app__lock { position: absolute; top: 0.7rem; right: 0.7rem; color: var(--ema-text-3); }
.portal-app__lock svg { width: 14px; height: 14px; }

/* ---------- App user chip (topbar) ---------- */
.app-user {
  display: inline-flex; align-items: center; gap: 0.5rem;
  border: 1px solid transparent;
  background: none;
  border-radius: var(--ema-radius-full);
  padding: 0.15rem 0.55rem 0.15rem 0.15rem;
  cursor: pointer;
  font: inherit; color: var(--ema-text-2); font-size: var(--ema-text-xs);
  transition: all 130ms;
}
.app-user:hover { background: var(--ema-surface-3); }
.app-user .ema-avatar { width: 28px; height: 28px; font-size: 0.6rem; }
.app-user__dot {
  position: absolute; top: -1px; right: -1px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ema-warning);
  border: 2px solid var(--ema-surface);
  animation: ema-pulse 1.8s infinite;
}

/* ---------- Menu layouts: rail & top ---------- */
.app--rail .app-sidebar { width: 64px; }
.app--rail .app-logo { justify-content: center; padding: 0.9rem 0.4rem; }
.app--rail .app-logo > span:last-child { display: none; }
.app--rail .app-nav__item { justify-content: center; padding: 0.55rem 0.4rem; }
.app--rail .app-nav__item > span { display: none; }
.app--rail .app-nav__item .app-nav__badge { display: none; }
.app--rail .app-sidebar__footer a span { display: none; }
.app--rail .app-sidebar__footer { text-align: center; }
.app--rail .app-main { margin-left: 64px; }

.app--top { flex-direction: column; }
.app--top .app-sidebar {
  position: sticky; top: 0; bottom: auto;
  width: 100%; height: auto;
  flex-direction: row; align-items: center;
  z-index: 450;
  transform: none !important;
}
.app--top .app-logo { border-bottom: none; padding: 0.45rem 1rem; white-space: nowrap; }
.app--top .app-logo small { display: none; }
.app--top .app-nav { display: flex; flex: 1; padding: 0.3rem 0.4rem; overflow-x: auto; scrollbar-width: none; }
.app--top .app-nav__item { width: auto; margin: 0 1px; white-space: nowrap; }
.app--top .app-nav__item.active { box-shadow: inset 0 -2px 0 var(--ema-primary); }
.app--top .app-sidebar__footer { border-top: none; padding: 0 0.9rem; white-space: nowrap; }
.app--top .app-main { margin-left: 0; }
@media (max-width: 900px) {
  .app--top .app-sidebar { position: sticky; }
  .app--top .app-topbar__burger { display: none; }
}

/* ============================================================
   COMMUNICATION PLATFORM (comms.html)
   ============================================================ */
/* two-pane chat layout: conversation list + thread */
.chat {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 0;
  height: calc(100vh - 54px - 2.8rem);
  min-height: 420px;
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-lg);
  overflow: hidden;
  box-shadow: var(--ema-shadow-sm);
}
.chat--docs { grid-template-columns: 300px 1fr; }
@media (max-width: 820px) {
  .chat { grid-template-columns: 1fr; }
  .chat__main { display: none; }
  .chat.chat--open .chat__list { display: none; }
  .chat.chat--open .chat__main { display: flex; }
}

.chat__list { border-right: 1px solid var(--ema-border); display: flex; flex-direction: column; min-height: 0; background: var(--ema-surface); }
.chat__list-head { padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--ema-border); display: flex; align-items: center; gap: 0.5rem; }
.chat__list-head b { font-size: var(--ema-text-md); }
.chat__list-head .ema-btn { margin-left: auto; }
.chat__search { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--ema-border); }
.chat__items { flex: 1; overflow-y: auto; padding: 0.3rem; }
.chat__group-label { font-size: var(--ema-text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ema-text-3); padding: 0.6rem 0.6rem 0.25rem; font-weight: 700; }
.conv {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--ema-radius-md);
  cursor: pointer;
  transition: background var(--ema-dur-fast);
  position: relative;
}
.conv:hover { background: var(--ema-surface-3); }
.conv--active { background: var(--ema-primary-soft); }
.conv--active .conv__name { color: var(--ema-primary); font-weight: 600; }
.conv__avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ema-primary-soft-2); color: var(--ema-primary);
  font-weight: 700; font-size: var(--ema-text-xs);
  position: relative;
}
.conv__avatar--ch { border-radius: var(--ema-radius-md); background: var(--ema-secondary-soft); color: var(--ema-secondary); }
.conv__avatar svg { width: 16px; height: 16px; }
.conv__body { flex: 1; min-width: 0; }
.conv__name { font-size: var(--ema-text-sm); font-weight: 500; display: flex; align-items: center; gap: 0.3rem; }
.conv__preview { font-size: var(--ema-text-xs); color: var(--ema-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem; }
.conv__time { font-size: 0.62rem; color: var(--ema-text-3); }
.conv__unread {
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--ema-primary); color: var(--ema-on-primary);
  font-size: 0.62rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.presence-dot {
  width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid var(--ema-surface);
  position: absolute; bottom: -1px; right: -1px;
}
.presence-dot--online { background: var(--ema-success); }
.presence-dot--away { background: var(--ema-warning); }
.presence-dot--offline { background: var(--ema-gray-400); }

/* thread */
.chat__main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat__head {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--ema-border);
  background: var(--ema-header-bg, var(--ema-surface));
  color: var(--ema-header-text, inherit);
}
.chat__head .chat__back { display: none; }
@media (max-width: 820px) { .chat__head .chat__back { display: inline-flex; } }
.chat__head-title { font-weight: 700; font-size: var(--ema-text-md); }
.chat__head-sub { font-size: var(--ema-text-xs); color: var(--ema-header-text-2, var(--ema-text-3)); }
.chat__head-actions { margin-left: auto; display: flex; gap: 0.2rem; }
.chat__msgs { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.chat__daysep { text-align: center; font-size: var(--ema-text-xs); color: var(--ema-text-3); margin: 0.3rem 0; position: relative; }
.chat__daysep span { background: var(--ema-surface); padding: 0 0.6rem; position: relative; z-index: 1; }
.chat__daysep::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--ema-border); }

.msg { display: flex; gap: 0.6rem; max-width: 78%; animation: ema-pop-in 200ms var(--ema-ease-out); }
.msg__avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--ema-primary-soft-2); color: var(--ema-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 0.62rem; font-weight: 700; }
.msg__body { min-width: 0; }
.msg__head { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.15rem; }
.msg__author { font-weight: 600; font-size: var(--ema-text-sm); }
.msg__time { font-size: 0.62rem; color: var(--ema-text-3); }
.msg__bubble {
  background: var(--ema-surface-3);
  padding: 0.5rem 0.7rem;
  border-radius: 0 var(--ema-radius-lg) var(--ema-radius-lg) var(--ema-radius-lg);
  font-size: var(--ema-text-sm);
  line-height: 1.5;
  color: var(--ema-text);
  word-wrap: break-word;
}
.msg--me { flex-direction: row-reverse; margin-left: auto; }
.msg--me .msg__head { flex-direction: row-reverse; }
.msg--me .msg__bubble { background: var(--ema-primary); color: var(--ema-on-primary); border-radius: var(--ema-radius-lg) 0 var(--ema-radius-lg) var(--ema-radius-lg); }
.msg__file {
  display: flex; align-items: center; gap: 0.6rem;
  margin-top: 0.35rem;
  background: var(--ema-surface); border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-md); padding: 0.5rem 0.7rem;
  text-decoration: none; color: var(--ema-text); max-width: 280px;
}
.msg--me .msg__file { background: color-mix(in srgb, var(--ema-on-primary) 14%, transparent); border-color: transparent; color: var(--ema-on-primary); }
.msg__file-ic { width: 30px; height: 30px; flex: none; border-radius: var(--ema-radius-sm); display: inline-flex; align-items: center; justify-content: center; background: var(--ema-primary-soft); color: var(--ema-primary); }
.msg--me .msg__file-ic { background: color-mix(in srgb, var(--ema-on-primary) 22%, transparent); color: var(--ema-on-primary); }
.msg__file-name { font-size: var(--ema-text-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg__file-meta { font-size: var(--ema-text-xs); opacity: 0.7; }

.chat__composer { border-top: 1px solid var(--ema-border); padding: 0.6rem 0.8rem; display: flex; align-items: flex-end; gap: 0.5rem; }
.chat__composer textarea {
  flex: 1; resize: none;
  border: 1px solid var(--ema-border-strong);
  border-radius: var(--ema-radius-lg);
  background: var(--ema-surface); color: var(--ema-text);
  font: inherit; font-size: var(--ema-text-sm);
  padding: 0.5rem 0.7rem; min-height: 2.2rem; max-height: 8rem;
  outline: none;
  transition: border-color var(--ema-dur-fast), box-shadow var(--ema-dur-fast);
}
.chat__composer textarea:focus { border-color: var(--ema-primary); box-shadow: var(--ema-focus-ring); }
.chat__typing { font-size: var(--ema-text-xs); color: var(--ema-text-3); padding: 0 1rem 0.3rem; height: 1rem; font-style: italic; }

/* doc collaboration */
.doc-collab { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.doc-collab__head {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--ema-border);
}
.doc-collab__title { font-weight: 700; flex: 1; min-width: 0; }
.doc-presence { display: inline-flex; }
.doc-presence .ema-avatar { width: 26px; height: 26px; font-size: 0.55rem; border: 2px solid var(--ema-surface); margin-left: -8px; }
.doc-presence .ema-avatar:first-child { margin-left: 0; }
.doc-collab__editor {
  flex: 1; overflow-y: auto; padding: 1.5rem 2rem; line-height: 1.7; color: var(--ema-text);
  outline: none; max-width: 820px; width: 100%; margin: 0 auto;
}
.doc-collab__editor:focus { box-shadow: none; }
.doc-collab__editor h1 { font-size: 1.6rem; margin: 0 0 0.6rem; }
.doc-collab__editor h2 { font-size: 1.2rem; margin: 1.4rem 0 0.5rem; }
.doc-collab__editor p { margin: 0 0 0.8rem; }
.doc-cursor { display: inline; border-left: 2px solid var(--ema-secondary); margin-left: -1px; position: relative; animation: ema-pulse 1.4s infinite; }
.doc-cursor::after {
  content: attr(data-who); position: absolute; top: -1.2rem; left: -2px;
  background: var(--ema-secondary); color: #fff; font-size: 0.6rem; font-weight: 700;
  padding: 0.05rem 0.3rem; border-radius: var(--ema-radius-xs); white-space: nowrap;
}

/* integrations */
.integ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.integ {
  background: var(--ema-surface); border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-lg); padding: 1.1rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  transition: box-shadow var(--ema-dur-med), transform var(--ema-dur-med) var(--ema-ease);
}
.integ:hover { box-shadow: var(--ema-shadow-md); transform: translateY(-2px); }
.integ__head { display: flex; align-items: center; gap: 0.6rem; }
.integ__logo {
  width: 40px; height: 40px; flex: none; border-radius: var(--ema-radius-md);
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800;
}
.integ__logo svg { width: 22px; height: 22px; }
.integ__name { font-weight: 700; }
.integ__status { font-size: var(--ema-text-xs); }
.integ__status--on { color: var(--ema-success); font-weight: 600; }
.integ__status--off { color: var(--ema-text-3); }
.integ__desc { font-size: var(--ema-text-sm); color: var(--ema-text-2); flex: 1; }
.integ__foot { display: flex; align-items: center; gap: 0.5rem; }

/* ============================================================
   MFA (multi-factor) — login second factor
   ============================================================ */
.mfa-methods { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.4rem 0 0.2rem; }
.mfa-method {
  display: flex; align-items: center; gap: 0.7rem;
  width: 100%; text-align: left;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--ema-border-strong);
  border-radius: var(--ema-radius-md);
  background: var(--ema-surface);
  cursor: pointer; font: inherit; color: var(--ema-text);
  transition: all var(--ema-dur-fast) var(--ema-ease);
}
.mfa-method:hover { border-color: var(--ema-primary); background: var(--ema-primary-soft); transform: translateY(-1px); }
.mfa-method__ic {
  width: 38px; height: 38px; flex: none; border-radius: var(--ema-radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ema-primary-soft); color: var(--ema-primary);
}
.mfa-method__ic svg { width: 18px; height: 18px; }
.mfa-method__name { font-weight: 600; font-size: var(--ema-text-sm); }
.mfa-method__desc { font-size: var(--ema-text-xs); color: var(--ema-text-3); }
.mfa-method__chev { margin-left: auto; color: var(--ema-text-3); }

.mfa-challenge { animation: ema-pop-in var(--ema-dur-med) var(--ema-ease-out); }
.mfa-challenge__head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.8rem; }
.mfa-challenge__ic {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ema-primary-soft); color: var(--ema-primary);
}
.mfa-challenge__ic svg { width: 22px; height: 22px; }
.mfa-challenge__title { font-weight: 700; }
.mfa-challenge__sub { font-size: var(--ema-text-xs); color: var(--ema-text-3); }
.mfa-back { background: none; border: none; color: var(--ema-primary); font: inherit; font-size: var(--ema-text-sm); cursor: pointer; padding: 0; }
.mfa-back:hover { text-decoration: underline; }
.mfa-demo-hint {
  font-size: var(--ema-text-xs); color: var(--ema-text-3);
  background: var(--ema-surface-2); border: 1px dashed var(--ema-border-strong);
  border-radius: var(--ema-radius-sm); padding: 0.4rem 0.6rem; margin-top: 0.6rem;
}
.mfa-demo-hint b { color: var(--ema-primary); font-family: var(--ema-font-mono); letter-spacing: 0.1em; }

/* OTP boxes */
.otp { display: flex; gap: 0.5rem; justify-content: center; margin: 0.4rem 0; }
.otp input {
  width: 2.6rem; height: 3rem; text-align: center;
  font-size: 1.4rem; font-weight: 700;
  border: 1px solid var(--ema-border-strong); border-radius: var(--ema-radius-md);
  background: var(--ema-surface); color: var(--ema-text);
  outline: none; transition: border-color var(--ema-dur-fast), box-shadow var(--ema-dur-fast);
}
.otp input:focus { border-color: var(--ema-primary); box-shadow: var(--ema-focus-ring); }
.otp input.filled { border-color: var(--ema-primary); }
@media (max-width: 420px) { .otp input { width: 2.1rem; height: 2.6rem; font-size: 1.1rem; } }

/* passkey / push waiting state */
.mfa-wait { text-align: center; padding: 1.2rem 0 0.4rem; }
.mfa-pulse {
  width: 76px; height: 76px; margin: 0 auto 0.8rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--ema-primary-soft); color: var(--ema-primary);
  position: relative;
}
.mfa-pulse svg { width: 34px; height: 34px; }
.mfa-pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--ema-primary); opacity: 0.6;
  animation: mfa-ring 1.6s var(--ema-ease-out) infinite;
}
@keyframes mfa-ring { 0% { transform: scale(1); opacity: 0.6; } 100% { transform: scale(1.5); opacity: 0; } }
.mfa-pulse--ok { background: var(--ema-success-soft); color: var(--ema-success); }
.mfa-pulse--ok::after { display: none; }

/* QR */
.mfa-qr { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; padding: 0.4rem 0; }
.mfa-qr svg { width: 168px; height: 168px; border-radius: var(--ema-radius-md); background: #fff; padding: 8px; border: 1px solid var(--ema-border); }

/* MFA policy summary chips (admin) */
.mfa-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }

/* ============================================================
   COMMERCE — storefront, fulfillment, warehouse
   ============================================================ */
.shop { display: grid; grid-template-columns: 1fr 320px; gap: 0.9rem; align-items: start; }
@media (max-width: 1000px) { .shop { grid-template-columns: 1fr; } }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.8rem; }
.shop-card {
  background: var(--ema-surface); border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow var(--ema-dur-med) var(--ema-ease), transform var(--ema-dur-med) var(--ema-ease);
}
.shop-card:hover { box-shadow: var(--ema-shadow-md); transform: translateY(-2px); }
.shop-card__img { height: 96px; display: flex; align-items: center; justify-content: center; font-size: 2.6rem; background: var(--ema-surface-2); position: relative; }
.shop-card__tag { position: absolute; top: 6px; left: 6px; }
.shop-card__body { padding: 0.6rem 0.7rem; display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.shop-card__name { font-weight: 600; font-size: var(--ema-text-sm); }
.shop-card__cat { font-size: var(--ema-text-xs); color: var(--ema-text-3); }
.shop-card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; padding-top: 0.4rem; }
.shop-card__price { font-weight: 700; color: var(--ema-primary); }
.shop-cart { position: sticky; top: 70px; }

/* picking */
.pick-list { display: flex; flex-direction: column; gap: 0.5rem; }
.pick-line {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.7rem; border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-md); transition: background var(--ema-dur-fast), border-color var(--ema-dur-fast);
}
.pick-line--done { background: var(--ema-success-soft); border-color: transparent; }
.pick-line--done .pick-line__name { text-decoration: line-through; color: var(--ema-text-3); }
.pick-line__bin { font-family: var(--ema-font-mono); font-size: var(--ema-text-xs); background: var(--ema-surface-3); color: var(--ema-text-2); padding: 0.15rem 0.45rem; border-radius: var(--ema-radius-xs); white-space: nowrap; }
.pick-line__emoji { font-size: 1.3rem; }
.pick-line__name { flex: 1; min-width: 0; font-size: var(--ema-text-sm); font-weight: 500; }
.pick-line__qty { font-weight: 700; min-width: 2.6rem; text-align: right; }

/* fulfillment status pill */
.fstep { display: inline-flex; align-items: center; gap: 0.3rem; }

/* warehouse bin chips */
.bin-chip { display: inline-flex; align-items: center; gap: 0.3rem; font-family: var(--ema-font-mono); font-size: var(--ema-text-xs);
  background: var(--ema-surface-3); color: var(--ema-text-2); padding: 0.12rem 0.45rem; border-radius: var(--ema-radius-xs); }

/* CRM link status dot */
.crm-dot { display: inline-flex; align-items: center; gap: 0.35rem; font-size: var(--ema-text-sm); }
.crm-dot i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ============================================================
   DATAOPS — database management, MCP server, AI copilot
   ============================================================ */
.seg { display: inline-flex; border: 1px solid var(--ema-border-strong); border-radius: var(--ema-radius-md); overflow: hidden; }
.seg button {
  border: none; background: var(--ema-surface); color: var(--ema-text-2);
  font: inherit; font-size: var(--ema-text-sm); font-weight: 600;
  padding: 0.35rem 0.9rem; cursor: pointer; transition: all 120ms;
}
.seg button + button { border-left: 1px solid var(--ema-border); }
.seg button.active { background: var(--ema-primary); color: var(--ema-on-primary); }

.db-conn { display: flex; align-items: center; gap: 0.6rem; font-size: var(--ema-text-sm); }
.db-conn code { font-family: var(--ema-font-mono); background: var(--ema-surface-3); padding: 0.1rem 0.4rem; border-radius: var(--ema-radius-xs); }

/* SQL console */
.sql-editor {
  width: 100%; box-sizing: border-box; min-height: 6rem; resize: vertical;
  font-family: var(--ema-font-mono); font-size: 0.82rem; line-height: 1.5;
  background: #0f1722; color: #d7e3f4; border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-md); padding: 0.7rem 0.9rem; outline: none; tab-size: 2;
}
.sql-editor:focus { border-color: var(--ema-primary); box-shadow: var(--ema-focus-ring); }
.sql-snippets { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0; }
.sql-snippets button {
  border: 1px solid var(--ema-border-strong); background: var(--ema-surface); color: var(--ema-text-2);
  font: inherit; font-size: var(--ema-text-xs); font-family: var(--ema-font-mono);
  padding: 0.2rem 0.5rem; border-radius: var(--ema-radius-sm); cursor: pointer;
}
.sql-snippets button:hover { border-color: var(--ema-primary); color: var(--ema-primary); }

/* MCP tools */
.mcp-tool { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.7rem; border: 1px solid var(--ema-border); border-radius: var(--ema-radius-md); margin-bottom: 0.5rem; }
.mcp-tool__ic { width: 34px; height: 34px; flex: none; border-radius: var(--ema-radius-md); display: inline-flex; align-items: center; justify-content: center; background: var(--ema-primary-soft); color: var(--ema-primary); }
.mcp-tool__ic svg { width: 16px; height: 16px; }
.mcp-tool__name { font-weight: 600; font-size: var(--ema-text-sm); font-family: var(--ema-font-mono); }
.mcp-tool__desc { font-size: var(--ema-text-xs); color: var(--ema-text-3); }
.mcp-status { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; font-size: var(--ema-text-sm); }
.mcp-status i { width: 9px; height: 9px; border-radius: 50%; }
.mcp-status--on i { background: var(--ema-success); animation: ema-pulse 1.8s infinite; }
.mcp-status--off i { background: var(--ema-text-3); }

/* AI models + console */
.ai-model { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.7rem; border: 1px solid var(--ema-border); border-radius: var(--ema-radius-md); margin-bottom: 0.5rem; }
.ai-model--loaded { border-color: var(--ema-primary-border); background: var(--ema-primary-soft); }
.ai-model__ic { width: 36px; height: 36px; flex: none; border-radius: var(--ema-radius-md); display: inline-flex; align-items: center; justify-content: center; background: var(--ema-secondary-soft); color: var(--ema-secondary); }
.ai-model__ic svg { width: 18px; height: 18px; }
.ai-model__name { font-weight: 700; font-size: var(--ema-text-sm); }
.ai-model__meta { font-size: var(--ema-text-xs); color: var(--ema-text-3); }
.ai-ram { height: 6px; border-radius: 3px; background: var(--ema-surface-3); overflow: hidden; margin-top: 0.5rem; }
.ai-ram__bar { height: 100%; background: linear-gradient(90deg, var(--ema-primary), var(--ema-secondary)); transition: width var(--ema-dur-slow) var(--ema-ease); }

.ai-console { display: flex; flex-direction: column; height: calc(100vh - 54px - 16rem); min-height: 300px; border: 1px solid var(--ema-border); border-radius: var(--ema-radius-lg); background: var(--ema-surface); overflow: hidden; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.ai-suggest { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0 1rem 0.6rem; }
.ai-suggest button { border: 1px solid var(--ema-border-strong); background: var(--ema-surface); color: var(--ema-text-2); font: inherit; font-size: var(--ema-text-xs); padding: 0.3rem 0.6rem; border-radius: var(--ema-radius-full); cursor: pointer; }
.ai-suggest button:hover { border-color: var(--ema-primary); color: var(--ema-primary); background: var(--ema-primary-soft); }
.ai-composer { border-top: 1px solid var(--ema-border); padding: 0.6rem 0.8rem; display: flex; gap: 0.5rem; align-items: flex-end; }
.ai-composer textarea { flex: 1; resize: none; border: 1px solid var(--ema-border-strong); border-radius: var(--ema-radius-lg); background: var(--ema-surface); color: var(--ema-text); font: inherit; font-size: var(--ema-text-sm); padding: 0.5rem 0.7rem; min-height: 2.2rem; max-height: 8rem; outline: none; }
.ai-composer textarea:focus { border-color: var(--ema-primary); box-shadow: var(--ema-focus-ring); }
.ai-composer textarea:disabled { background: var(--ema-surface-3); color: var(--ema-text-3); }
.ai-bubble { background: var(--ema-surface-3); padding: 0.6rem 0.8rem; border-radius: 0 var(--ema-radius-lg) var(--ema-radius-lg) var(--ema-radius-lg); font-size: var(--ema-text-sm); line-height: 1.55; max-width: 92%; }
.ai-bubble--me { background: var(--ema-primary); color: var(--ema-on-primary); border-radius: var(--ema-radius-lg) 0 var(--ema-radius-lg) var(--ema-radius-lg); align-self: flex-end; }
.ai-bubble pre { background: #0f1722; color: #d7e3f4; font-family: var(--ema-font-mono); font-size: 0.76rem; line-height: 1.5; border-radius: var(--ema-radius-sm); padding: 0.6rem 0.8rem; overflow-x: auto; margin: 0.5rem 0 0; }
.ai-row { display: flex; gap: 0.55rem; }
.ai-row__avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--ema-secondary-soft); color: var(--ema-secondary); }
.ai-row__avatar svg { width: 16px; height: 16px; }
.ai-tool-call { font-family: var(--ema-font-mono); font-size: var(--ema-text-xs); color: var(--ema-text-3); margin-top: 0.4rem; display: flex; align-items: center; gap: 0.35rem; }
.ai-tool-call svg { width: 12px; height: 12px; color: var(--ema-primary); }
.ai-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ema-text-3); gap: 0.5rem; text-align: center; padding: 1rem; }
.ai-empty svg { width: 2.4rem; height: 2.4rem; opacity: 0.5; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .app-sidebar { transform: translateX(-100%); box-shadow: var(--ema-shadow-xl); }
  .app-sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .app-topbar__burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border: 1px solid var(--ema-border-strong);
    border-radius: var(--ema-radius-md);
    background: var(--ema-surface);
    color: var(--ema-text-2);
    cursor: pointer;
  }
  .app-topbar__burger svg { width: 16px; height: 16px; }
  .app-content { padding: 1rem 0.9rem 3rem; }
  .kpi-row { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
}
