:root {
  --bg: #0f172a;
  --bg-accent: #1e293b;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --danger: #dc2626;
  --border: #e2e8f0;
  --ring: rgba(79, 70, 229, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, var(--bg-accent), var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  padding: 40px 36px;
}

.brand {
  text-align: center;
  margin-bottom: 28px;
}

.brand .logo {
  display: block;
  width: 87px;
  height: auto;
  margin: 0 auto 12px;
  border-radius: 0;
  object-fit: contain;
  background: none;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
}

.brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.field {
  margin-bottom: 18px;
}

.create-form-compact .field {
  margin-bottom: 8px;
}

.create-form-compact .field > label {
  margin-bottom: 3px;
}

.create-form-compact .field input,
.create-form-compact .field select {
  padding: 7px 12px;
}

.create-form-compact .field .hint {
  margin-top: 3px;
}

.field > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
}

.field textarea {
  width: 100%;
  min-height: 180px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.45;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#kb-topics {
  min-height: 110px;
}

.kb-biblio {
  margin: 0 0 18px;
  padding: 12px 16px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.kb-biblio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

.kb-biblio-grid .field {
  margin: 0;
}

.kb-biblio-grid .field-wide {
  grid-column: 1 / -1;
}

.access-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px 16px;
  margin: 12px 0 0;
}

.access-meta-grid .field {
  margin: 0;
}

.table-access-meta {
  margin: 8px 0 12px;
}

.table-access-meta .access-meta-grid {
  margin: 0;
}

.expense-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

.expense-grid .field {
  margin: 0;
}

.expense-grid .field-wide {
  grid-column: 1 / -1;
}

.expense-grid textarea {
  min-height: 88px;
}

.expense-view {
  width: 100%;
}

.expense-entry {
  padding: 0 0 16px;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.expense-form-line {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.expense-shared {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  max-width: 520px;
}

.expense-shared .field {
  margin: 0;
}

.expense-shared .field-date {
  flex: 0 1 138px;
}

.expense-shared .field-grow {
  flex: 1 1 220px;
}

.expense-shared input {
  padding: 8px 10px;
  border-radius: 4px;
  box-shadow: none;
}

.expense-item-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.expense-saved-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.expense-entry .expense-grid,
.expense-saved-rows .expense-grid {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  gap: 8px;
}

.expense-entry .expense-grid .field,
.expense-saved-rows .expense-grid .field {
  flex: 1 1 110px;
  min-width: 0;
}

.expense-entry .expense-grid .field-grow,
.expense-saved-rows .expense-grid .field-grow {
  flex: 1.4 1 140px;
}

.expense-entry .expense-grid .field-date,
.expense-saved-rows .expense-grid .field-date {
  flex: 0 1 138px;
}

.expense-entry .expense-grid .field-qty,
.expense-entry .expense-grid .field-amount,
.expense-saved-rows .expense-grid .field-qty,
.expense-saved-rows .expense-grid .field-amount {
  flex: 0 1 88px;
}

.expense-entry .expense-grid .field-currency,
.expense-saved-rows .expense-grid .field-currency {
  flex: 0 1 92px;
}

.expense-entry .expense-grid .field-inventory,
.expense-saved-rows .expense-grid .field-inventory {
  flex: 0 1 132px;
}

.expense-entry .expense-grid .field-row-action {
  display: block;
  flex: 0 0 auto;
}

.expense-saved-rows .field-row-action,
.expense-list-summary .field-row-action {
  display: flex;
  flex: 0 0 var(--expense-action-width);
  align-items: center;
  justify-content: stretch;
  width: var(--expense-action-width);
  max-width: var(--expense-action-width);
}

.expense-row-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
  width: 100%;
}

.expense-item-rows .expense-grid + .expense-grid label {
  visibility: hidden;
}

.expense-saved-rows .expense-grid:not(.expense-field-head) label {
  display: none;
}

.expense-view-value {
  display: block;
  min-height: 34px;
  padding: 8px 2px;
  font-size: 14px;
  line-height: 1.3;
  word-break: break-word;
}

.expense-field-head {
  align-items: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding-bottom: 2px;
}

.expense-field-head .field-row-action {
  justify-content: center;
  text-align: center;
}

.expense-saved-rows .expense-remove-row.btn {
  padding-left: 8px;
  padding-right: 8px;
}

.expense-entry .expense-grid input,
.expense-entry .expense-grid select,
.expense-saved-rows .expense-grid input,
.expense-saved-rows .expense-grid select {
  padding: 8px 10px;
  border-radius: 4px;
  box-shadow: none;
}

.expense-entry .form-actions {
  margin-top: 0;
}

.expense-upload {
  padding-top: 16px;
}

.expense-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 120px;
  padding: 18px 16px;
  border: 1px dashed var(--border);
  border-radius: 4px;
  background: #f8fafc;
  cursor: pointer;
  text-align: center;
}

.expense-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.expense-drop:hover,
.expense-drop.over {
  border-color: var(--primary);
  background: #eef2ff;
}

.expense-drop .hint {
  max-width: 640px;
}

.expense-review {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f8fafc;
}

.expense-review-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
}

.expense-review .hint {
  margin: 0;
}

.expense-upload-actions {
  margin-top: 14px;
}

.expense-list-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0 0 8px;
}

.expense-list-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  width: 100%;
}

.expense-list-summary .expense-month-total {
  flex: 1 1 auto;
  min-width: 0;
}

.expense-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.expense-list-actions .btn,
.expense-list-summary .field-row-action .btn {
  width: auto;
  box-sizing: border-box;
  text-align: center;
}

.inventory-list .expense-list-actions .expense-list-period select {
  min-width: 140px;
}

.expense-list-summary .field-row-action .btn {
  width: 100%;
}

.expense-saved-rows .expense-remove-row {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.expense-list .btn.danger,
.expense-entry .btn.danger {
  background: #fff;
  color: var(--danger);
  border-color: var(--danger);
}

.expense-list .btn.danger:hover,
.expense-entry .btn.danger:hover {
  background: #fff;
  color: #b91c1c;
  border-color: #b91c1c;
}

.expense-list-title {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.expense-list-period {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.expense-list-period select {
  min-width: 180px;
  padding: 8px 10px;
  border-radius: 4px;
  box-shadow: none;
}

.expense-month-total {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.expense-month {
  margin-bottom: 22px;
}

.expense-month:last-child {
  margin-bottom: 0;
}

.expense-month-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.expense-month-head h3 {
  margin: 0;
  font-size: 16px;
}

.expense-month-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 900px) {
  .expense-entry .expense-grid,
  .expense-shared {
    flex-wrap: wrap;
    max-width: none;
  }
}

.expense-list {
  --expense-action-width: 88px;
  margin-top: 20px;
}

.expense-saved-rows .expense-grid {
  width: 100%;
}

.inventory-list {
  margin-top: 0;
}

.inventory-table .inventory-qty,
.inventory-table .inventory-used {
  font-variant-numeric: tabular-nums;
}

.inventory-used-input,
.inventory-minimum-input {
  width: 88px;
  padding: 8px 10px;
  border-radius: 4px;
  box-shadow: none;
}

#inventory-low-stock.active,
#inventory-out-of-stock.active {
  border-color: var(--primary);
  color: var(--primary);
  background: #eef2ff;
}

@media (max-width: 720px) {
  .expense-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .kb-biblio-grid {
    grid-template-columns: 1fr;
  }
}

.query-stats {
  margin-bottom: 20px;
}

.query-stats > p,
.panel-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.query-stats-total {
  font-weight: 600;
  color: var(--text);
}

.query-stats-empty {
  margin: 0;
}

.query-stats-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.query-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
}

.query-stats-kind {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.query-stats-pct {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.query-stats-bar {
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.query-stats-bar i {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
}

.query-stats-examples {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.enrich-box {
  margin-top: 20px;
}

.enrich-box textarea {
  min-height: 88px;
}

.enrich-status {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.enrich-result {
  margin-top: 18px;
}

.enrich-result h4 {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 700;
}

.enrich-document,
.enrich-response {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  font-size: 14px;
  line-height: 1.5;
}

.enrich-actions {
  margin-top: 16px;
}

.guide-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.guide-row .field {
  margin-bottom: 0;
}

.guide-row textarea {
  min-height: 96px;
}

.guide-row .guide-remove {
  margin-top: 26px;
}

@media (max-width: 900px) {
  .guide-row {
    grid-template-columns: 1fr;
  }

  .guide-row .guide-remove {
    margin-top: 0;
    justify-self: start;
  }
}

.chunk-result {
  margin-top: 18px;
}

.chunk-result h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
}

.clean-file-errors {
  color: var(--danger);
  margin: 16px 0 8px;
}

.clean-pane h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
}

.clean-output {
  margin: 0;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.5;
  min-height: 80px;
}

.clean-result-list {
  margin: 0;
  padding-left: 18px;
}

.clean-result-list li {
  margin: 10px 0;
}

.clean-result-list .clean-output {
  margin-top: 8px;
  min-height: 0;
}

@media (max-width: 900px) {
  .clean-compare {
    grid-template-columns: 1fr;
  }
}

.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.4;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

button.primary {
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

button.primary:hover {
  background: var(--primary-hover);
}

button.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#cognito-login {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

#cognito-login.primary {
  margin-top: 0;
  border: none;
  background: var(--primary);
  color: #fff;
}

#cognito-login.primary:hover {
  background: var(--primary-hover);
}

#password-login-toggle {
  width: 100%;
  margin-top: 12px;
}

#cognito-login[hidden] {
  display: none;
}

.error {
  display: none;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  color: var(--danger);
  font-size: 14px;
  border: 1px solid #fecaca;
}

.error.show {
  display: block;
}

.warning {
  display: none;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
  font-size: 14px;
  border: 1px solid #fcd34d;
}

.warning.show {
  display: block;
}

.muted-note {
  margin-top: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.verify-code {
  display: block;
  margin: 0 0 16px;
  padding: 14px 12px;
  text-align: center;
  letter-spacing: 0.35em;
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: #f1f5f9;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text);
}

.verify-actions {
  display: flex;
  gap: 8px;
}

.verify-actions button.primary {
  flex: 1;
}

.verify-dialog .confirm-title {
  color: var(--text);
}

.verify-dialog .field {
  margin-bottom: 12px;
}

/* Dashboard-specific */
.dashboard {
  max-width: 640px;
  text-align: left;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.row:last-child {
  border-bottom: none;
}

.row .key {
  color: var(--muted);
  font-size: 14px;
}

.row .value {
  font-weight: 600;
  font-size: 14px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eef2ff;
  color: var(--primary);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

button.ghost {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}

button.ghost:hover {
  background: #f8fafc;
}

/* ===================================================================== */
/* Admin console: title bar + left panel + right content                 */
/* ===================================================================== */
html {
  height: 100%;
}

body.app {
  display: block;
  padding: 0;
  margin: 0;
  width: 100%;
  min-height: 100vh;
  background: #f1f5f9;
  /* Neutralize the login page's centered-flex layout for the app shell. */
  align-items: initial;
  justify-content: initial;
}

.app-shell {
  display: grid;
  grid-template-rows: 60px 1fr;
  grid-template-columns: 248px 1fr;
  grid-template-areas:
    "header header"
    "sidebar main";
  width: 100%;
  height: 100vh;
  min-height: 100vh;
}

/* Title bar */
.app-header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  z-index: 2;
}

.app-header .title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.app-header .logo {
  display: block;
  height: 36px;
  width: auto;
  border-radius: 0;
  object-fit: contain;
  background: none;
  margin: 0;
}

.app-header .user-box {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}

.app-header .user-box .who {
  color: #cbd5e1;
}

.app-header .user-box .who strong {
  color: #fff;
}

#header-role[hidden] {
  display: none !important;
}

/* Left panel */
.app-sidebar {
  grid-area: sidebar;
  background: var(--bg-accent);
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 0;
}

.app-sidebar .sidebar-topics,
.app-sidebar .sidebar-history {
  margin-top: 18px;
  margin-bottom: 18px;
}

.app-sidebar .sidebar-topics,
.chat-sidebar #sidebar-topics {
  margin-top: 22px;
  margin-bottom: 22px;
}

.nav-section .label {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 4px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #fff;
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
}

.nav-item .icon {
  width: 18px;
  text-align: center;
}

.app-sidebar .sidebar-topics .label,
.app-sidebar .sidebar-history .label {
  text-transform: none;
  font-size: 15px;
  letter-spacing: 0.4px;
  color: #cbd5e1;
  font-weight: 700;
}

.app-sidebar .topic-list .history-item,
.app-sidebar .history-list .history-item {
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 15px;
  color: #cbd5e1;
}

.app-sidebar .history-list .history-item {
  padding-top: 5px;
  padding-bottom: 5px;
}

.app-sidebar .topic-list .history-empty,
.app-sidebar .history-list .history-empty {
  font-size: 15px;
  color: #cbd5e1;
}

/* Right content */
.app-main {
  grid-area: main;
  padding: 28px 32px;
  overflow-y: auto;
}

.app-main.chatbot-main {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #f1f5f9;
}

.app-main.chatbot-main #view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#chatbot-test-hold {
  display: none !important;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.view-header h2 {
  margin: 0;
  font-size: 22px;
}

.view-header .header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  max-width: 720px;
}

.meeting-room {
  min-height: 220px;
}

.meeting-room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 240px);
  justify-content: start;
  gap: 16px;
}

.meeting-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  min-height: 180px;
  padding: 18px 18px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
}

.meeting-tile h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.meeting-tile-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

.meeting-tile-new {
  align-items: center;
  justify-content: center;
  text-align: center;
  border-style: dashed;
}

.meeting-tile:hover,
.meeting-tile:focus-visible {
  border-color: var(--primary);
  outline: none;
}

.meeting-cap {
  margin-bottom: 16px;
  max-width: 520px;
}

.meeting-cap-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.meeting-cap-row label {
  margin: 0;
  font-size: 14px;
}

.meeting-cap-row input {
  width: 88px;
}

.meeting-waiting {
  max-width: 520px;
}

.meeting-pending {
  margin: 0 24px 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.meeting-pending-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.meeting-pending-row + .meeting-pending-row {
  margin-top: 8px;
}

.meeting-pending-actions {
  display: flex;
  gap: 8px;
}

.meeting-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px 8px;
}

.meeting-chat-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.meeting-room-chat {
  min-height: 0;
}

.meeting-room-chat .chat-composer form {
  max-width: none;
  flex-wrap: wrap;
}

.meeting-send-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.meeting-msg .msg-meta {
  font-size: 11px;
  color: var(--muted);
  margin: 0 4px 4px;
}

.msg.peer {
  align-self: flex-start;
}

.msg.peer .avatar {
  background: #475569;
}

.msg.peer .bubble {
  background: #fff;
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}

.panel.wide {
  max-width: 960px;
}

.panel.expense-entry,
.panel.expense-list,
.loader-view .panel,
.loader-view .panel.wide,
.optimize-view .panel,
.optimize-view .panel.wide {
  max-width: none;
  width: 100%;
}

.panel-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 240px);
  justify-content: start;
  gap: 16px;
}

.kb-tile-break {
  grid-column-start: 1;
}

.loader-doc-tiles {
  grid-column: 1 / -1;
}

.loader-doc-tiles[hidden] {
  display: none;
}

.kb-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  min-height: 288px;
  padding: 18px 18px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
}

.kb-tile h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.kb-tile-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.kb-tile-setting {
  margin-top: auto;
  padding-top: 16px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.kb-tile:hover,
.kb-tile:focus-visible {
  border-color: var(--primary);
  outline: none;
}

.kb-overlay-stack {
  z-index: 75;
}

.kb-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
}

.kb-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 760px;
  min-height: min(480px, 72vh);
  max-height: 88vh;
  overflow: auto;
  padding: 28px 32px 24px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
}

.kb-dialog-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.kb-dialog-close:hover {
  color: var(--text);
}

.kb-dialog .kb-block {
  min-height: 0;
  border: none;
  box-shadow: none;
  padding: 0;
}

.kb-dialog-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.kb-dialog .kb-docs-wrap {
  max-height: min(50vh, 420px);
}

.kb-dialog-list {
  width: min(1200px, 96vw);
  max-width: min(1200px, 96vw);
  min-height: min(560px, 78vh);
  max-height: 90vh;
}

.kb-dialog-email {
  width: min(920px, 94vw);
  max-width: min(920px, 94vw);
  min-height: min(620px, 82vh);
}

.kb-dialog-access {
  max-width: 640px;
  min-height: 0;
}

.kb-dialog-feature-control {
  max-width: 480px;
  min-height: 0;
}

.kb-dialog-setup {
  max-width: 560px;
  min-height: 0;
}

.kb-setup-overlay {
  z-index: 85;
}

body.kb-setup-open {
  overflow: hidden;
}

.kb-dialog-feature-control h2 {
  margin: 0 0 4px;
}

.kb-dialog-feature-control .kb-dialog-body > .hint {
  margin-top: 0;
}

.kb-dialog-list .kb-docs-wrap {
  max-height: min(72vh, 680px);
}

.kb-dialog .photo-uploader,
.kb-dialog .photo-uploader > form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.kb-dialog .photo-row {
  flex: 1;
  align-items: stretch;
}

.kb-dialog .photo-drop-col,
.kb-dialog .photo-meta {
  min-height: min(42vh, 360px);
}

.kb-dialog .photo-drop-col {
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  flex: 1;
}

.kb-dialog .photo-meta {
  max-height: none;
}

.kb-dialog-list .kb-docs {
  table-layout: auto;
}

.kb-dialog-list .kb-docs th:first-child,
.kb-dialog-list .kb-docs td.kb-doc-name {
  width: 58%;
  max-width: none;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  word-break: break-word;
}

body.kb-box-open {
  overflow: hidden;
}

.kb-block {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  min-height: 260px;
}

.kb-block-wide {
  grid-column: 1 / -1;
  min-height: 0;
}

.photo-uploader > p:not(.error) {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.web-search-controls {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.web-search-controls input {
  flex: 1;
  min-width: 0;
}

.web-search-controls .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.web-search-result {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.web-search-result .label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.web-search-result h4 {
  margin: 0 0 4px;
  font-size: 16px;
}

.web-search-url {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.web-search-result .clean-output {
  max-height: 320px;
  overflow: auto;
}

.web-search-result .form-actions {
  margin-top: 12px;
}

.photo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.photo-drop-col,
.photo-meta {
  min-width: 0;
}

.photo-meta {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  max-height: 520px;
  overflow: auto;
}

.photo-meta .panel-title {
  margin-bottom: 8px;
}

.photo-meta-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.photo-meta .field:last-child {
  margin-bottom: 0;
}

.photo-meta textarea {
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  resize: vertical;
}

.photo-meta textarea.file-meta-title {
  min-height: 4.5em;
  overflow: auto;
  white-space: pre-wrap;
}

.photo-meta textarea.ocr-meta-text {
  min-height: 12em;
  overflow: auto;
  white-space: pre-wrap;
}

.media-meta-apply {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.media-meta-apply .hint {
  margin: 0;
}

.media-meta-apply .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 800px) {
  .photo-row {
    grid-template-columns: 1fr;
  }

  .inbox-fields-grid {
    grid-template-columns: 1fr;
  }
}

.photo-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 14px 16px 12px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  text-align: center;
  min-height: 120px;
  justify-content: center;
}

.kb-dialog .photo-drop {
  flex: 1 1 auto;
  min-height: 0;
  padding: 32px 24px 28px;
  gap: 10px;
}

.kb-dialog .photo-drop-icon {
  width: 44px;
  height: 44px;
  font-size: 26px;
}

.photo-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-drop:hover,
.photo-drop.over {
  border-color: var(--primary);
  background: #eef2ff;
}

.photo-drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.photo-drop-title {
  font-size: 15px;
  font-weight: 700;
}

.photo-drop .hint {
  max-width: 520px;
}

.photo-single,
.photo-batch {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.photo-batch {
  margin-top: 12px;
}

.photo-single-title,
.photo-batch-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
}

.photo-single > .hint,
.photo-batch > .hint {
  margin: 0 0 12px;
}

.photo-single .photo-drop {
  min-height: 96px;
  padding: 12px 14px 10px;
}

.kb-dialog .photo-single .photo-drop {
  min-height: min(32vh, 260px);
  padding: 26px 18px 22px;
}

.photo-batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.photo-batch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.photo-previews:empty {
  display: none;
  margin: 0;
}

.photo-thumb {
  position: relative;
  width: 96px;
  margin: 0;
  cursor: pointer;
}

.photo-thumb.selected img {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--ring);
}

.photo-thumb img {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.photo-thumb figcaption {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-thumb-remove {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--danger);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.kb-topics-docs {
  grid-column: 1 / -1;
  display: flex;
  gap: 20px;
  align-items: stretch;
}

.kb-topics-docs > .kb-block {
  flex: 1;
  min-width: 0;
}

.kb-block-topics {
  min-height: 260px;
}

.kb-block-docs,
.kb-block-images,
.kb-block-photos,
.kb-block-media {
  min-height: 260px;
  overflow: hidden;
}

.kb-docs-wrap {
  flex: 1;
  min-height: 0;
  max-height: 220px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.kb-docs {
  table-layout: fixed;
}

.kb-docs thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.kb-docs th:first-child,
.kb-docs td.kb-doc-name {
  width: 42%;
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-docs td.doc-id {
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 12px;
  white-space: normal;
  word-break: break-all;
  color: var(--muted);
}

.kb-docs-empty {
  color: var(--muted);
  font-style: italic;
}

.kb-docs th:last-child,
.kb-docs td.kb-doc-actions {
  width: 168px;
  text-align: right;
  white-space: nowrap;
}

.kb-docs .kb-doc-actions .btn + .btn {
  margin-left: 6px;
}

.kb-docs .kb-doc-edit,
.kb-docs .kb-doc-delete,
.kb-docs .kb-photo-edit,
.kb-docs .kb-photo-delete {
  padding: 5px 10px;
}

.photo-edit-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.photo-edit-preview figure {
  margin: 0;
  width: 100%;
  text-align: center;
}

.photo-edit-preview img {
  display: block;
  width: 100%;
  max-height: 480px;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.photo-edit-preview figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  word-break: break-all;
}

#kb-workdir {
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 13px;
  cursor: pointer;
}

#kb-workdir-access,
#kb-drive-connect {
  margin-top: 8px;
}

.storage-sector {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin: 0;
}

.storage-sector-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}

.storage-sector-option input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.workdir-path {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 13px;
  word-break: break-all;
}

.workdir-path code {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 8px;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 12px;
}

.kb-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 6px;
}

.kb-block-head h3 {
  margin: 0;
}

.kb-block-head .btn[disabled],
.kb-docs-actions .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.kb-docs-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.kb-block h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.kb-block > p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.kb-block form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.kb-block .form-actions {
  margin-top: auto;
  margin-bottom: 0;
}

.kb-block .block-launch {
  margin-top: auto;
  align-self: flex-start;
  min-width: 200px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  padding: 12px 22px;
  text-align: center;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .kb-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .kb-topics-docs {
    flex-direction: column;
  }

  .kb-block-docs {
    min-height: 260px;
  }
}

/* Tables */
.table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.data th,
table.data td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

table.data tr:last-child td {
  border-bottom: none;
}

table.data td.user-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  width: 1%;
}

table.data td.user-nested {
  padding-left: 1.75rem;
}

.feature-control-action {
  margin: 0;
}

.edit-user-actions {
  justify-content: space-between;
  align-items: center;
}

#e-active-row {
  margin-bottom: 40px;
}

.edit-user-actions-end {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

.feature-control-fields {
  margin: 8px 0 18px;
}

.feature-control-dual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3rem 3rem;
  align-items: center;
  column-gap: 8px;
  padding: 6px 0;
}

.feature-control-head {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding-bottom: 8px;
}

.feature-control-head span,
.feature-control-dual > input[type="checkbox"] {
  justify-self: center;
}

.feature-control-name {
  margin: 0;
  font-weight: 600;
}

.feature-control-fields > label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.feature-control-fields .hint {
  margin: 0 0 10px;
}

table.data td.disk-usage {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table.data td.max-disk {
  white-space: nowrap;
}

.max-disk-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.max-disk-edit input {
  width: 5.5rem;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.max-disk-edit input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

.kb-preview {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-weight: 400;
}

.badge.role-ADMIN {
  background: #fef3c7;
  color: #b45309;
}

.badge.role-MASTER {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge.role-EDITOR {
  background: #d1fae5;
  color: #047857;
}

.badge.role-INDIVIDUAL {
  background: #ede9fe;
  color: #6d28d9;
}

.badge.role-ACCOUNT_ADMIN {
  background: #ffedd5;
  color: #c2410c;
}

.badge.role-GENERAL {
  background: #e2e8f0;
  color: #475569;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.status-dot.active::before {
  background: #16a34a;
}

/* Buttons */
.btn {
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: background 0.15s, opacity 0.15s;
}

.btn:hover {
  background: var(--primary-hover);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn.sm {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 8px;
}

.btn.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn.secondary:hover {
  background: #f8fafc;
}

.btn.danger {
  background: var(--danger);
}

.btn.danger:hover {
  background: #b91c1c;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
}

.confirm-dialog {
  width: 100%;
  max-width: 420px;
  padding: 22px 22px 18px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
}

.confirm-title {
  margin: 0 0 8px;
  color: var(--danger);
  font-size: 16px;
  font-weight: 700;
}

.confirm-message {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
}

.file-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.field .file-pick-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  opacity: 0;
}

.file-pick-btn {
  flex: 0 0 auto;
}

.file-pick-name {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field .hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.form-actions.edit-user-actions {
  margin-top: 8px;
}

.inbox-panel {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.inbox-status {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  margin-bottom: 28px;
}

.inbox-current-row {
  display: flex;
  gap: 12px;
  font-size: 14px;
}

.inbox-current-label {
  min-width: 8.5rem;
  color: var(--muted);
}

.inbox-current-value {
  color: var(--text);
}

.inbox-review {
  margin-top: 16px;
}

.inbox-review table {
  width: 100%;
}

.inbox-review td.inbox-review-subject {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 28ch;
}

.inbox-review tr.is-discarded td {
  text-decoration: line-through;
  opacity: 0.55;
}

.inbox-review .inbox-review-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.inbox-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
  align-items: start;
}

.inbox-fields-grid .field {
  margin-bottom: 14px;
}

.inbox-fields-grid .inbox-imap-fields,
.inbox-fields-grid .inbox-oauth {
  grid-column: 1 / -1;
}

.kb-dialog-email .inbox-status {
  margin-bottom: 16px;
}

.kb-dialog-email .form-actions {
  margin-top: 18px;
}

.inbox-imap-fields {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
}

.inbox-imap-fields[hidden] {
  display: none;
}

.inbox-oauth {
  margin: 8px 0 16px;
}

.inbox-oauth[hidden] {
  display: none;
}

.inbox-oauth .hint {
  display: block;
  margin-top: 8px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

/* Toast / feedback */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  min-width: 240px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: #16a34a;
}

.toast.error {
  background: var(--danger);
}

.upload-finished-slot {
  flex: 0 0 auto;
  max-height: 22vh;
  overflow: auto;
  margin-top: 12px;
}

.upload-finished {
  margin: 0;
  padding: 0;
}

.upload-finished-sign {
  margin: 0 0 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #dcfce7;
  color: #14532d;
  font-weight: 700;
}

.upload-finished-summary {
  margin: 0 0 6px;
  color: var(--muted);
}

.upload-finished-list {
  margin: 0;
  padding-left: 18px;
}

.upload-finished-errors {
  margin: 8px 0 4px;
  color: var(--danger);
}

.kb-dialog .upload-finished-slot {
  flex: 0 0 auto;
  max-height: 5.5rem;
  overflow: hidden;
}

.kb-dialog #loader-clean-slot,
.kb-dialog #loader-chunk-slot,
.kb-dialog .clean-compare,
.kb-dialog .chunk-result,
.kb-dialog .web-search-result {
  display: none;
}

.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

.loading {
  padding: 30px;
  color: var(--muted);
  font-size: 14px;
}

.btn.busy,
.btn.busy:disabled {
  opacity: 1;
  cursor: wait;
  pointer-events: none;
}

.btn.busy::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: loader-spin 0.7s linear infinite;
  vertical-align: -1px;
}

.btn.secondary.busy::before {
  border-color: var(--border);
  border-top-color: var(--primary);
}

@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===================================================================== */
/* Chatbot screen (members)                                              */
/* ===================================================================== */

/* Profile-save feedback (shown on the right-pane profile screen) */
.pf-msg {
  font-size: 13px;
  margin: 0 0 12px;
}

.pf-msg.ok {
  color: #059669;
}

.pf-msg.err {
  color: var(--danger);
}

/* Left panel: question history */
.history-list,
.topic-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topic-list {
  gap: 2px;
}

.history-item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s;
}

.history-item:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #fff;
}

.history-empty {
  color: #64748b;
  font-size: 13px;
  padding: 0 12px;
  margin: 0;
}

.chat-sidebar .nav-section .label {
  font-size: 15px;
  letter-spacing: 0.4px;
  color: #cbd5e1;
}

.chat-sidebar .history-item,
.chat-sidebar .history-empty {
  font-size: 15px;
  color: #cbd5e1;
}

.chat-sidebar .topic-list .history-item {
  padding-top: 4px;
  padding-bottom: 4px;
}

.chat-sidebar .history-list .history-item {
  padding-top: 5px;
  padding-bottom: 5px;
}

/* Right screen: swaps between the chat dialogue and the profile screen */
.chat-main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  background: #f1f5f9;
}

.chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-view[hidden],
.profile-view[hidden] {
  display: none;
}

.profile-view {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
}

.profile-view .panel {
  max-width: 560px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-inner {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  container-type: inline-size;
}

.msg {
  display: flex;
  gap: 10px;
  max-width: 80%;
}

.msg .avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.msg .msg-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.msg .bubble {
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.msg .bubble.rich {
  white-space: normal;
  counter-reset: chat-md-n;
}

.msg .bubble.rich p {
  margin: 0 0 0.7em;
}

.msg .bubble.rich p:last-child {
  margin-bottom: 0;
}

.msg .bubble.rich strong,
.msg .bubble.rich b {
  font-weight: 600;
}

.msg .bubble.rich .chat-md-h {
  margin: 0 0 0.45em;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.msg .bubble.rich ol.chat-md-list,
.msg .bubble.rich ul.chat-md-list {
  margin: 0.55em 0 0;
  padding-left: 1.45em;
}

.msg .bubble.rich ol.chat-md-list {
  list-style: none;
}

.msg .bubble.rich ol.chat-md-list > li {
  position: relative;
}

.msg .bubble.rich ol.chat-md-list > li::before {
  counter-increment: chat-md-n;
  content: counter(chat-md-n) ".";
  position: absolute;
  left: -1.45em;
  width: 1.3em;
  font-weight: 600;
}

.msg .bubble.rich ol.chat-md-list > li + li,
.msg .bubble.rich ul.chat-md-list > li + li {
  margin-top: 0.75em;
}

.msg .bubble.rich .chat-md-item {
  font-weight: 600;
}

.msg .bubble.rich ul.chat-md-meta {
  margin: 0.4em 0 0 0.15em;
  padding-left: 0.9em;
  list-style: none;
  border-left: 2px solid #e2e8f0;
}

.msg .bubble.rich ul.chat-md-meta li {
  padding: 0.18em 0 0.18em 0.75em;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.msg .bubble.rich ul.chat-md-meta li:has(.chat-md-k),
.msg .bubble.rich ul.chat-md-list li:has(.chat-md-k) {
  display: grid;
  grid-template-columns: minmax(5.5rem, max-content) minmax(0, 1fr);
  gap: 0.45em 0.85em;
}

.msg .bubble.rich .chat-md-k {
  color: var(--text);
  font-weight: 600;
}

.msg .bubble.rich .chat-md-v {
  color: var(--muted);
}

.msg .bubble.rich table.chat-md-table {
  width: 100%;
  margin: 0.45em 0 0;
  border-collapse: collapse;
  border-left: 2px solid #e2e8f0;
  font-size: 13px;
  line-height: 1.45;
}

.msg .bubble.rich table.chat-md-table th,
.msg .bubble.rich table.chat-md-table td {
  padding: 0.22em 0.75em;
  vertical-align: top;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.msg .bubble.rich table.chat-md-table tr:last-child th,
.msg .bubble.rich table.chat-md-table tr:last-child td {
  border-bottom: 0;
}

.msg .bubble.rich table.chat-md-table th {
  color: var(--text);
  font-weight: 600;
  white-space: normal;
}

.msg .bubble.rich table.chat-md-table td {
  color: var(--muted);
}

.msg .bubble.rich code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: #f1f5f9;
  font-size: 12.5px;
}

.msg .bubble.rich a {
  color: var(--primary);
  text-underline-offset: 2px;
}

.msg .bubble.rich .chat-md-math {
  font-family: "Cambria Math", "Latin Modern Math", "STIX Two Math", Cambria,
    "Times New Roman", serif;
}

.msg .bubble.rich .chat-md-math-block {
  display: block;
  margin: 0.85em 0;
  overflow-x: auto;
  text-align: center;
  font-size: 1.12em;
  line-height: 1.6;
}

.msg .bubble.rich .chat-md-math-inline {
  padding: 0 0.12em;
  white-space: nowrap;
}

.msg .bubble.rich .chat-md-math var {
  font-style: italic;
  font-weight: 400;
}

.msg .bubble.rich .chat-md-math-op {
  font-style: normal;
}

.msg .bubble.rich .chat-md-frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  padding: 0 0.2em;
  text-align: center;
}

.msg .bubble.rich .chat-md-frac .chat-md-num {
  border-bottom: 1px solid currentColor;
  padding: 0 0.28em 0.08em;
  line-height: 1.2;
}

.msg .bubble.rich .chat-md-frac .chat-md-den {
  padding: 0.08em 0.28em 0;
  line-height: 1.2;
}

.msg .bubble.rich .chat-md-sqrt {
  border-top: 1px solid currentColor;
  padding: 0 0.15em;
}

.msg.assistant:has(.chat-photos) {
  max-width: 100%;
}

.chat-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.msg.assistant:has(.chat-slides) {
  max-width: 100%;
}

.chat-slides {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
  width: min(100%, 640px);
}

.chat-slide {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f4f6fb;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
}

.chat-slide-chrome {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: #1e2a4a;
  color: #e8eefc;
  font-size: 0.78rem;
}

.chat-slide-deck {
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-slide-num {
  flex-shrink: 0;
  opacity: 0.85;
}

.chat-slide-stage {
  padding: 0;
  background: #111827;
}

.chat-slide-stage:has(h3) {
  padding: 28px 32px 24px;
  background: linear-gradient(180deg, #fff 0%, #f7f9ff 100%);
}

.chat-slide-image {
  display: block;
  width: 100%;
  height: auto;
}

.chat-slide-stage h3 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  line-height: 1.25;
  color: #15203a;
}

.chat-slide-body {
  margin: 0;
  color: #243047;
  white-space: pre-wrap;
}

.chat-slide-foot {
  padding: 8px 14px 10px;
  border-top: 1px solid var(--border);
  background: #eef2f8;
}

.chat-slide-notes,
.chat-slide-meta {
  margin: 0;
  font-size: 0.78rem;
  color: #4b5568;
}

.chat-slide-notes + .chat-slide-meta {
  margin-top: 4px;
}

.chat-photo {
  margin: 0;
  width: 50cqw;
  max-width: 100%;
}

.chat-photo img,
.msg .bubble img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: zoom-in;
}

.chat-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 56px 28px;
  background: rgba(12, 16, 22, 0.86);
}

.chat-lightbox figure {
  margin: 0;
  max-width: min(96vw, 1400px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chat-lightbox img {
  display: block;
  max-width: 96vw;
  max-height: 84vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.chat-lightbox figcaption {
  margin-top: 10px;
  color: #fff;
  font-size: 14px;
  text-align: center;
}

.chat-lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.chat-lightbox-close:hover,
.chat-lightbox-close:focus {
  background: #f3f4f6;
}

body.chat-lightbox-open {
  overflow: hidden;
}

.chat-photo figcaption {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.msg.assistant:has(.chat-media) {
  max-width: 100%;
}

.chat-media {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.chat-media-item {
  margin: 0;
  width: 100%;
  max-width: 50cqw;
}

.chat-media-item audio,
.chat-media-item video,
.photo-edit-preview audio,
.photo-edit-preview video {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #111;
}

.chat-media-item figcaption {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.msg.assistant {
  align-self: flex-start;
}

.msg.assistant .avatar {
  background: var(--primary);
}

.msg.assistant .bubble {
  background: #fff;
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}

.msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg.user .avatar {
  background: #0f766e;
}

.msg.user .bubble {
  background: var(--primary);
  color: #fff;
  border-top-right-radius: 4px;
}

.msg.typing .bubble {
  color: var(--muted);
  font-style: italic;
}

.chat-composer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 14px 24px;
}

.chatbot-test-view {
  position: relative;
}

.chatbot-test-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
}

.chatbot-test-chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.chatbot-test-chat .chat-composer form {
  max-width: none;
}

.chatbot-test-docs {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 20px;
  background: #fff;
  border-left: 1px solid var(--border);
}

.chatbot-test-docs .label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.chatbot-test-docs p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.chatbot-test-docs ol {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: #334155;
}

.chatbot-test-docs li {
  margin: 0 0 14px;
}

.chatbot-test-docs .rag-chunk {
  display: block;
  margin: 4px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
}

.chat-view > .chatbot-test-layout {
  flex: 1;
  min-height: 0;
}

.rag-group {
  margin: 0 0 16px;
}

.rag-group h4 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.rag-empty {
  margin: 0 0 8px !important;
  font-size: 12px !important;
}

.rag-keywords {
  margin: 0 0 8px;
  font-size: 12px;
  color: #334155;
  line-height: 1.6;
}

.rag-keywords-label {
  margin-right: 6px;
  font-weight: 600;
  color: #0f172a;
}

.rag-keyword {
  display: inline-block;
  margin: 0 4px 4px 0;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
  font-size: 11px;
}

.chatbot-test-docs .rag-score {
  display: inline;
  margin-left: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

.chatbot-test-docs .rag-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.related-sources {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  color: #334155;
}

.related-sources li {
  margin: 0 0 10px;
  line-height: 1.4;
  word-break: break-word;
}

@media (max-width: 768px) {
  .chatbot-test-layout {
    grid-template-columns: 1fr;
  }
}

.rag-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rag-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.rag-actions button.ghost {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 8px;
}

.rag-actions .rag-delete {
  color: var(--danger);
}

.rag-editor {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
}

.rag-editor[hidden] {
  display: none !important;
}

.rag-editor-card {
  width: min(800px, 100%);
  max-height: 90%;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  padding: 20px 24px 16px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
}

.rag-chunk-panel {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #f8fafc;
}

.rag-chunk-panel[hidden] {
  display: none !important;
}

.rag-chunk-panel h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.rag-chunk-meta {
  display: grid;
  grid-template-columns: minmax(8rem, 28%) 1fr;
  gap: 4px 12px;
  margin: 0 0 12px;
  font-size: 13px;
}

.rag-chunk-meta dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.rag-chunk-meta dd {
  margin: 0;
  word-break: break-word;
}

.rag-chunk-body {
  margin: 0;
  width: 100%;
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  white-space: pre-wrap;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}

.rag-editor-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.rag-editor-card .hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.rag-photo-picker {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
}

.rag-photo-picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.rag-photo-pick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.rag-photo-pick img {
  width: 100%;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  background: #e2e8f0;
}

.rag-photo-pick-name {
  font-size: 12px;
  line-height: 1.3;
  word-break: break-word;
}

.rag-editor-card textarea {
  min-height: 220px;
}

.finder-result h3 {
  margin: 16px 0 8px;
}

.finder-rag-status {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}

.finder-rag-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: #334155;
}

.finder-rag-list .rag-chunk {
  display: inline-block;
  margin-left: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
}

.chat-composer form {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-composer .btn {
  flex-shrink: 0;
}

.chat-composer textarea {
  flex: 1;
  resize: none;
  max-height: 160px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
}

.chat-composer textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

.chat-intro {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 8px 0 4px;
}

/* Phone width: center only; side panels slide in from the edges. */
.drawer-backdrop,
.edge-hit {
  display: none;
}

@media (max-width: 768px) {
  body.app {
    overflow-x: hidden;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "main";
  }

  .app-header {
    padding: 0 12px;
  }

  .app-header .user-box .who {
    display: none;
  }

  .app-main {
    padding: 16px;
  }

  .app-main.chatbot-main,
  .chat-main {
    padding: 0;
  }

  .profile-view {
    padding: 16px;
  }

  .chat-messages {
    padding: 16px;
  }

  .app-sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    z-index: 40;
    width: min(86vw, 280px);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: none;
  }

  body.app.drawer-left-open .app-sidebar {
    transform: translateX(0);
    box-shadow: 12px 0 32px rgba(15, 23, 42, 0.28);
  }

  .chatbot-test-docs {
    position: fixed;
    top: 60px;
    right: 0;
    bottom: 0;
    z-index: 40;
    width: min(86vw, 320px);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.22s ease;
    box-shadow: none;
  }

  body.app.drawer-right-open .chatbot-test-docs {
    transform: translateX(0);
    box-shadow: -12px 0 32px rgba(15, 23, 42, 0.28);
  }

  .drawer-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 60px 0 0;
    z-index: 30;
    border: 0;
    padding: 0;
    background: rgba(15, 23, 42, 0.38);
  }

  .edge-hit:not([hidden]) {
    display: block;
    position: fixed;
    top: 60px;
    bottom: 0;
    width: 20px;
    z-index: 25;
    border: 0;
    padding: 0;
    background: transparent;
  }

  .edge-hit-left {
    left: 0;
  }

  .edge-hit-right {
    right: 0;
  }

  .edge-hit-left::after,
  .edge-hit-right::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 4px;
    height: 48px;
    margin-top: -24px;
    background: rgba(79, 70, 229, 0.45);
  }

  .edge-hit-left::after {
    left: 0;
    border-radius: 0 4px 4px 0;
  }

  .edge-hit-right::after {
    right: 0;
    border-radius: 4px 0 0 4px;
  }

  body.app.drawer-left-open .edge-hit-left,
  body.app.drawer-right-open .edge-hit-right {
    display: none;
  }
}
