:root {
  --brand: #0b4552;
  --brand-2: #0f6b70;
  --brand-3: #eaf5f2;
  --accent: #f2c66d;
  --soft: #f7fbfa;
  --line: #cfe2df;
  --ink: #152629;
  --muted: #5b6f74;
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --surface-soft: rgba(255, 255, 255, 0.92);
  --shadow: rgba(15, 35, 39, 0.06);
  --field-bg: #ffffff;
  --field-bg-disabled: #edf5f2;
  --field-border: #cfe2df;
  --field-placeholder: #728487;
  --focus-ring: rgba(15, 107, 112, 0.14);
  --success-bg: #eef9f0;
  --success-border: #b9d7c2;
  --success-ink: #166534;
  --warning-bg: #fff8db;
  --warning-border: #f1d47b;
  --warning-ink: #76550a;
  --danger-bg: #fff5eb;
  --danger-border: #f2c7a6;
  --danger-ink: #9a3412;
  --app-bg-start: #eef4f7;
  --hero-panel-start: rgba(255, 255, 255, 0.96);
  --hero-panel-end: rgba(247, 252, 248, 0.96);
  --preview-strong-bg: #123f46;
  --preview-strong-ink: #ffffff;
  --offer-bg: #fff8e8;
  --offer-border: #e0cf9f;
  --offer-accent: #e3ad3f;
  --distance-bg: #e9f7ef;
  --distance-ink: #17613a;
  --bs-body-bg: var(--soft);
  --bs-body-color: var(--ink);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--surface-2);
  --bs-light-bg-subtle: var(--surface-2);
  --bs-link-color-rgb: 15, 107, 112;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --brand: #9ad8d5;
  --brand-2: #7bc4c4;
  --brand-3: #24383d;
  --accent: #ffd77d;
  --soft: #1b2428;
  --line: #405158;
  --ink: #f4f8f8;
  --muted: #d0dcdf;
  --surface: #263238;
  --surface-2: #303f46;
  --surface-soft: rgba(38, 50, 56, 0.96);
  --shadow: rgba(0, 0, 0, 0.2);
  --field-bg: #1f2b31;
  --field-bg-disabled: #2a3840;
  --field-border: #53676f;
  --field-placeholder: #aebdc1;
  --focus-ring: rgba(123, 196, 196, 0.22);
  --success-bg: #20352f;
  --success-border: #4d6f60;
  --success-ink: #9ee5ad;
  --warning-bg: #383019;
  --warning-border: #8f7530;
  --warning-ink: #f8e4a3;
  --danger-bg: #3b2b24;
  --danger-border: #7c4a31;
  --danger-ink: #ffc8a8;
  --app-bg-start: #233137;
  --hero-panel-start: rgba(38, 50, 56, 0.98);
  --hero-panel-end: rgba(32, 43, 48, 0.96);
  --preview-strong-bg: #10272c;
  --preview-strong-ink: #f4f8f8;
  --offer-bg: #2a2519;
  --offer-border: #5f4f29;
  --offer-accent: #d8a43b;
  --distance-bg: #1c343a;
  --distance-ink: #bff3ea;
  --bs-body-bg: var(--soft);
  --bs-body-color: var(--ink);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--surface-2);
  --bs-light-bg-subtle: var(--surface-2);
  --bs-link-color-rgb: 154, 216, 213;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  overflow-x: hidden;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(220, 237, 223, 0.82), transparent 25rem),
    linear-gradient(180deg, #fbfcf9 0%, var(--soft) 100%);
  color: var(--ink);
  font-size: 0.96rem;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(123, 196, 196, 0.16), transparent 25rem),
    linear-gradient(180deg, #202b30 0%, var(--soft) 100%);
}

.navbar {
  backdrop-filter: blur(18px);
}

.navbar-brand {
  color: var(--ink);
}

.navbar,
.bg-white,
.bg-body,
.bg-light {
  background-color: var(--surface) !important;
  color: var(--ink);
}

.border,
.border-top,
.border-end,
.border-bottom,
.border-start {
  border-color: var(--line) !important;
}

.text-muted,
.small.text-muted {
  color: var(--muted) !important;
}

.text-bg-light,
.badge.text-bg-light {
  border: 1px solid var(--line);
  background-color: var(--surface-2) !important;
  color: var(--ink) !important;
}

.card,
.modal-content,
.dropdown-menu,
.list-group,
.list-group-item,
.table,
.toast,
.popover {
  --bs-card-bg: var(--surface);
  --bs-card-color: var(--ink);
  --bs-card-border-color: var(--line);
  --bs-modal-bg: var(--surface);
  --bs-modal-color: var(--ink);
  --bs-modal-border-color: var(--line);
  --bs-dropdown-bg: var(--surface);
  --bs-dropdown-color: var(--ink);
  --bs-dropdown-border-color: var(--line);
  --bs-list-group-bg: var(--surface);
  --bs-list-group-color: var(--ink);
  --bs-list-group-border-color: var(--line);
  --bs-table-bg: var(--surface);
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--line);
  background-color: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.dropdown-item {
  color: var(--ink);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--surface-2);
  color: var(--ink);
}

.table > :not(caption) > * > * {
  background-color: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.fw-black {
  font-weight: 900;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}

.brand-logo {
  width: 7.7rem;
  height: 2.35rem;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: block;
  border-radius: 9px;
}

.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: #08353f;
  --bs-btn-hover-border-color: #08353f;
  background-color: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
}

:root[data-theme="dark"] .btn-primary {
  background-color: #0f6b70 !important;
  border-color: #9ad8d5 !important;
  color: #fff !important;
}

:root[data-theme="dark"] .btn-outline-primary,
:root[data-theme="dark"] .btn-outline-secondary {
  border-color: var(--line) !important;
  color: var(--ink) !important;
}

:root[data-theme="dark"] .btn-outline-primary:hover,
:root[data-theme="dark"] .btn-outline-secondary:hover {
  background-color: var(--surface-2) !important;
  color: var(--ink) !important;
}

.btn-outline-primary {
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

body.app-mode > .navbar {
  display: none;
}

.app-view.active {
  min-height: 100svh;
  background:
    linear-gradient(180deg, var(--app-bg-start) 0, var(--soft) 18rem),
    var(--soft);
}

.adminlte-app {
  --app-header-height: 4.25rem;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding-top: var(--app-header-height);
  overflow-x: hidden;
}

.app-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1040;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  min-height: var(--app-header-height);
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(207, 226, 223, 0.92);
  background: var(--surface-soft);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 26px var(--shadow);
}

:root[data-theme="dark"] .app-header,
:root[data-theme="dark"] .adminlte-panel,
:root[data-theme="dark"] .app-tabs,
:root[data-theme="dark"] .live-panel,
:root[data-theme="dark"] .kaila-popup,
:root[data-theme="dark"] .swal2-popup {
  border-color: var(--line) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
}

.app-title {
  min-width: 0;
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.app-title > div {
  min-width: 0;
  max-width: 100%;
}

.app-title img {
  width: 2.2rem;
  height: 2.2rem;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  object-fit: cover;
}

.app-title strong,
.app-title span {
  display: block;
}

.app-title strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-title span {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header-actions {
  min-width: 0;
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.role-badge {
  max-width: 5.8rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--brand);
  text-overflow: ellipsis;
  text-transform: capitalize;
  white-space: nowrap;
}

.queue-badge {
  max-width: 9.4rem;
  border: 1px solid var(--success-border);
  border-radius: 999px;
  padding: 0.24rem 0.48rem;
  overflow: hidden;
  background: var(--success-bg);
  color: var(--success-ink);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-badge.offline {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-ink);
}

.queue-badge.has-queue {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning-ink);
}

.icon-btn {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.bell-btn {
  position: relative;
  color: var(--brand);
}

.bell-btn.has-unread {
  border-color: var(--warning-border) !important;
  background: var(--warning-bg) !important;
  color: var(--warning-ink) !important;
}

.bell-btn:active,
.bell-btn:focus-visible {
  background: var(--surface-2) !important;
  box-shadow: 0 0 0 0.16rem rgba(123, 196, 196, 0.2);
  transform: translateY(1px);
}

.bell-count {
  position: absolute;
  top: -0.32rem;
  right: -0.32rem;
  min-width: 1.08rem;
  height: 1.08rem;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--surface-soft);
  border-radius: 999px;
  background: #d13f31;
  color: #fff;
  font-size: 0.61rem;
  font-weight: 900;
  line-height: 1;
}

.bell-message-list {
  display: grid;
  gap: 0.45rem;
  text-align: left;
}

.bell-message-item {
  width: 100%;
  display: grid;
  gap: 0.16rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
}

.bell-message-item strong,
.bell-message-item span,
.bell-message-item p {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.bell-message-item strong {
  color: var(--brand);
  font-size: 0.88rem;
}

.bell-message-item span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.bell-message-item p {
  font-size: 0.82rem;
}

.bell-message-empty {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  padding: 0.85rem 0.6rem;
  color: var(--muted);
  text-align: center;
}

.bell-message-empty i {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--brand);
}

.bell-message-empty strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.bell-message-empty p {
  max-width: 15rem;
  margin: 0;
  font-size: 0.82rem;
}

.app-content {
  width: min(100%, 1120px);
  display: grid;
  align-content: start;
  gap: 0.55rem;
  margin: 0 auto;
  padding: 0.55rem 0.5rem calc(4.55rem + env(safe-area-inset-bottom));
}

.adminlte-panel {
  grid-template-rows: auto auto;
  display: grid;
  gap: 0.5rem;
  height: auto;
  padding: 0.58rem;
  border: 1px solid rgba(207, 226, 223, 0.9);
  border-radius: 12px;
  background: var(--surface-soft);
  box-shadow: 0 10px 24px var(--shadow);
}

.panel-title {
  min-width: 0;
  min-height: 1.8rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  color: var(--ink);
  font-size: 0.83rem;
  font-weight: 900;
}

.panel-title span,
.panel-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-title small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.app-tab-content {
  min-height: 0;
  padding-bottom: 0;
}

.pull-refresh-indicator {
  position: fixed;
  top: max(0.55rem, env(safe-area-inset-top));
  left: 50%;
  z-index: 2500;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 2.35rem;
  padding: 0.42rem 0.72rem;
  border: 1px solid rgba(207, 226, 223, 0.9);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 12px 26px var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -74px);
  transition: opacity 0.16s ease, transform 0.16s ease, color 0.16s ease;
  backdrop-filter: blur(18px);
}

.pull-refresh-indicator.active {
  opacity: 1;
}

.pull-refresh-indicator.ready {
  color: var(--brand);
}

.landing-shell {
  width: min(100%, 1120px);
  max-width: 100vw;
  margin: 0 auto;
  overflow: hidden;
}

.hero-compact,
.auth-card,
.k-card,
.toolbar,
.stats-row,
.compact-tabs,
.live-panel,
.settings-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  box-shadow: 0 10px 24px var(--shadow);
}

.hero-compact {
  width: 100%;
  min-height: auto;
  display: grid;
  gap: 1.25rem;
  padding: 1rem;
  overflow: hidden;
  background:
    linear-gradient(135deg, var(--hero-panel-start), var(--hero-panel-end)),
    var(--brand-3);
}

.hero-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  padding: 0.35rem;
}

.hero-brand {
  width: min(11rem, 72vw);
  height: auto;
  display: block;
  margin-bottom: 0.65rem;
  padding: 0.25rem 0.35rem;
  border: 1px solid #dce9e5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 35, 39, 0.06);
}

.hero-compact h1 {
  max-width: 12ch;
  color: var(--brand);
  font-size: clamp(2.15rem, 9vw, 3.85rem);
  line-height: 1;
}

:root[data-theme="dark"] .hero-compact h1,
:root[data-theme="dark"] .app-title strong,
:root[data-theme="dark"] .panel-title,
:root[data-theme="dark"] .settings-head h3,
:root[data-theme="dark"] .k-card h3 {
  color: var(--ink);
}

.hero-lead {
  width: 100%;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

:root[data-theme="dark"] .hero-lead,
:root[data-theme="dark"] .settings-head p,
:root[data-theme="dark"] .app-title span,
:root[data-theme="dark"] .k-card p {
  color: var(--muted);
}

.hero-actions {
  width: 100%;
  display: grid;
  gap: 0.55rem;
  max-width: 25rem;
}

.btn-login {
  min-height: 2.8rem;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(15, 62, 70, 0.22);
}

.connection-banner {
  display: grid;
  gap: 0.12rem;
  border: 1px solid var(--success-border);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: var(--success-bg);
  color: var(--success-ink);
  font-size: 0.78rem;
  line-height: 1.25;
}

.connection-banner strong {
  color: var(--success-ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.connection-banner span,
.connection-banner small {
  overflow-wrap: anywhere;
}

.connection-banner small {
  color: var(--muted);
  font-weight: 700;
}

.connection-banner.offline {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-ink);
}

.connection-banner.offline strong {
  color: var(--danger-ink);
}

.connection-banner.has-queue {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.btn-register {
  --bs-btn-color: var(--ink);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-color: var(--brand);
  --bs-btn-hover-bg: var(--surface-2);
  --bs-btn-hover-border-color: var(--brand-2);
  font-weight: 800;
  background-color: var(--surface) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}

:root[data-theme="dark"] .btn-register {
  background-color: var(--surface-2) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .btn-register:hover,
:root[data-theme="dark"] .btn-register:focus-visible {
  background-color: var(--surface) !important;
  border-color: var(--brand-2) !important;
  color: var(--ink) !important;
}

:root[data-theme="dark"] .bell-btn.has-unread {
  border-color: var(--warning-border) !important;
  background: var(--warning-bg) !important;
  color: var(--warning-ink) !important;
}

:root[data-theme="dark"] .bell-btn:active,
:root[data-theme="dark"] .bell-btn:focus-visible {
  background: #263a40 !important;
}

:root[data-theme="dark"] .bell-count {
  border-color: var(--surface);
  background: #d86a5d;
}

.hero-points {
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.legal-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.75rem;
}

.legal-link-row button,
.inline-link {
  border: 0;
  background: transparent;
  color: var(--bs-primary);
  font: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.legal-page {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.legal-page h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  margin: 0;
}

.legal-page h2 {
  font-size: 1rem;
  font-weight: 800;
  margin: 1.25rem 0 0.35rem;
}

.legal-page p {
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.safety-icon {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--brand);
  border: 1px solid var(--line);
}

.hero-points span {
  flex: 0 1 auto;
  padding: 0.38rem 0.58rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
}

.hero-preview {
  min-width: 0;
  display: grid;
  place-items: center;
  min-height: 18rem;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(15, 62, 70, 0.08), transparent 42%),
    var(--surface-2);
}

.preview-phone {
  min-width: 0;
  width: min(100%, 19.5rem);
  display: grid;
  gap: 0.65rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 18px 34px rgba(26, 54, 58, 0.14);
}

.preview-topbar,
.preview-offer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.preview-topbar {
  color: var(--muted);
  font-size: 0.74rem;
}

.preview-topbar span {
  width: 0.58rem;
  height: 0.58rem;
  border-radius: 50%;
  background: #26a269;
}

.preview-icon {
  width: 1.55rem;
  height: 1.55rem;
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: contain;
}

.preview-topbar em {
  color: var(--muted);
  font-style: normal;
}

.preview-request,
.preview-offer,
.preview-confirm {
  border-radius: 10px;
}

.preview-request {
  padding: 0.75rem;
  background: var(--preview-strong-bg);
  color: var(--preview-strong-ink);
}

.preview-tag {
  display: inline-block;
  margin-bottom: 0.45rem;
  padding: 0.2rem 0.42rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fde3a0;
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.preview-request h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
}

.preview-request p,
.preview-offer span {
  margin: 0.22rem 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.74rem;
}

.preview-offer {
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid var(--line);
  background: var(--surface);
}

.preview-offer strong,
.preview-offer span {
  display: block;
  overflow-wrap: anywhere;
}

.preview-offer strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.preview-offer span {
  color: var(--muted);
}

.preview-offer b {
  flex: 0 0 auto;
  color: var(--brand);
}

.preview-offer.soft {
  background: var(--surface-2);
}

.preview-confirm {
  padding: 0.7rem;
  background: var(--accent);
  color: #283331;
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
}

@media (max-width: 520px) {
  .app-header {
    gap: 0.45rem;
    padding: 0.52rem 0.55rem;
  }

  .app-title {
    gap: 0.42rem;
  }

  .app-title img {
    width: 2rem;
    height: 2rem;
  }

  .app-title strong {
    font-size: 0.88rem;
  }

  .app-title span {
    font-size: 0.72rem;
  }

  .app-header-actions {
    gap: 0.32rem;
  }

  .queue-badge {
    max-width: 7.4rem;
    padding-inline: 0.38rem;
  }

  .role-badge {
    max-width: 4.9rem;
  }

  .icon-btn {
    width: 2.1rem;
    height: 2.1rem;
  }

  .adminlte-panel {
    padding: 0.55rem;
  }

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

  .action-row .btn {
    gap: 0.35rem;
    padding-inline: 0.45rem;
    font-size: 0.8rem;
  }

  .landing-shell {
    padding-inline: 0.8rem !important;
  }

  .hero-compact {
    padding: 0.85rem;
  }

  .hero-copy {
    padding: 0.25rem;
  }

  .hero-compact h1 {
    font-size: clamp(2rem, 11vw, 2.75rem);
  }

  .hero-actions {
    max-width: 100%;
  }

  .hero-preview {
    min-height: 0;
    padding: 0.75rem;
  }

  .hero-points span {
    padding-inline: 0.5rem;
    font-size: 0.72rem;
  }
}

.eyebrow {
  color: #906304;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-card {
  max-width: 460px;
  margin: 0 auto;
  padding: 1rem;
}

.compact-form {
  display: grid;
  gap: 0.55rem;
}

.password-field {
  position: relative;
  display: block;
}

.password-field .form-control {
  min-height: 2.38rem;
  padding-right: 2.85rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.password-field:focus-within .password-toggle {
  opacity: 1;
  pointer-events: auto;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: var(--surface-2);
  color: var(--ink);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 1px;
}

.saved-login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 1.75rem;
}

.saved-login-row .consent-line {
  flex: 1;
}

.form-control,
.form-select,
.form-check-input,
.btn {
  border-radius: 10px;
}

.form-control,
.form-select,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
textarea,
select {
  border-color: var(--field-border) !important;
  background-color: var(--field-bg) !important;
  color: var(--ink) !important;
}

.form-control,
.form-select {
  border-color: var(--field-border);
  background-color: var(--field-bg);
  color: var(--ink);
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly],
input:disabled,
textarea:disabled,
select:disabled {
  border-color: var(--line) !important;
  background-color: var(--field-bg-disabled) !important;
  color: var(--muted) !important;
  opacity: 1;
}

.form-check-input,
input[type="checkbox"],
input[type="radio"] {
  border-color: var(--field-border);
  background-color: var(--field-bg);
}

.form-check-input:checked,
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  border-color: var(--brand-2);
  background-color: var(--brand);
}

.form-control[type="file"]::file-selector-button {
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
}

.auth-field-label,
.category-chip-box {
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 900;
}

.category-chip-box {
  display: grid;
  gap: 0.5rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.category-chip-selected,
.category-chip-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.category-chip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.category-chip-actions button {
  min-height: 1.8rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 900;
}

.category-chip-actions button:hover,
.category-chip-actions button:focus {
  border-color: var(--brand-2);
  background: var(--brand-3);
}

.category-chip-selected {
  min-height: 2.1rem;
  align-items: center;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}

.category-chip-options {
  max-height: 8.25rem;
  overflow: auto;
}

.category-chip,
.category-chip-empty {
  min-height: 1.85rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.category-chip.selected {
  border-color: var(--brand-2);
  background: var(--brand);
  color: #fff;
}

.category-chip-empty {
  border-style: dashed;
  background: transparent;
}

.address-grid {
  display: grid;
  gap: 0.55rem;
}

.range-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.address-grid label {
  display: grid;
  gap: 0.25rem;
}

.address-grid span {
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 900;
}

.address-grid small {
  color: var(--muted);
  font-weight: 800;
}

.consent-line {
  display: flex !important;
  gap: 0.45rem !important;
  align-items: flex-start !important;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.25;
}

.consent-line input {
  flex: 0 0 auto;
  margin-top: 0.12rem;
}

:root[data-theme="dark"] input:-webkit-autofill,
:root[data-theme="dark"] input:-webkit-autofill:hover,
:root[data-theme="dark"] input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--field-bg) inset;
}

.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 0.15rem var(--focus-ring);
  outline: 0;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--field-placeholder) !important;
  opacity: 1;
}

select[multiple].form-select {
  min-height: 7.75rem;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.6rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.2rem;
  padding: 0.32rem;
  margin-bottom: 0.35rem;
}

.admin-stats {
  grid-template-columns: repeat(8, minmax(5.25rem, 1fr));
  min-height: 4.75rem;
  height: auto;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(12, 39, 48, 0.05);
}

.stats-row div,
.stats-row button {
  padding: 0.38rem 0.2rem;
  border: 0;
  border-radius: 10px;
  background: var(--surface-2);
  color: inherit;
}

.admin-stats div,
.admin-stats button {
  display: grid;
  min-width: 0;
  min-height: 4rem;
  gap: 0.18rem;
  align-content: center;
  padding: 0.5rem 0.22rem;
  text-align: center;
}

.admin-stats button {
  cursor: pointer;
}

.admin-stats button:hover,
.admin-stats button:focus-visible,
.admin-stats button.active {
  background: var(--brand-3);
  outline: 2px solid transparent;
  box-shadow: inset 0 0 0 1px var(--brand-2);
}

:root[data-theme="dark"] .admin-stats button:hover,
:root[data-theme="dark"] .admin-stats button:focus-visible,
:root[data-theme="dark"] .admin-stats button.active {
  background: var(--surface-2);
}

.admin-metric-panel {
  border-color: var(--brand-2);
  background: var(--surface-soft);
}

.admin-stats i {
  color: var(--muted);
  font-size: 0.82rem;
}

.stats-row strong,
.stats-row span {
  display: block;
}

.stats-row strong {
  color: var(--brand);
  font-size: clamp(0.9rem, 4vw, 1.2rem);
  line-height: 1;
}

.stats-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: clamp(0.54rem, 2vw, 0.68rem);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr));
  gap: 0.35rem;
  align-items: stretch;
  min-height: 2.35rem;
  height: auto;
  margin-bottom: 0.35rem;
}

.adminlte-panel .action-row {
  margin-bottom: 0;
}

.action-row .btn {
  display: inline-flex;
  justify-content: center;
  gap: 0.45rem;
  align-items: center;
  min-height: 2.35rem;
  min-width: 0;
  font-weight: 850;
}

.action-row .btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-row .btn-provider-setup {
  border: 1px solid #156f68;
  background: #156f68;
  color: #fff;
  box-shadow: 0 0.35rem 0.9rem rgba(21, 111, 104, 0.22);
}

.action-row .btn-provider-setup:hover,
.action-row .btn-provider-setup:focus-visible {
  border-color: #0f5c56;
  background: #0f5c56;
  color: #fff;
  box-shadow: 0 0 0 0.16rem rgba(21, 111, 104, 0.2);
}

.action-row[data-action-layout="single-row"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-row[data-action-layout="single-row"] .btn {
  gap: 0.32rem;
  padding-inline: 0.35rem;
  font-size: 0.78rem;
}

.action-row[data-action-layout="single-row"] .btn i {
  flex: 0 0 auto;
  font-size: 0.86rem;
}

@media (max-width: 520px) {
  .action-row[data-action-layout="single-row"] {
    gap: 0.25rem;
  }

  .action-row[data-action-layout="single-row"] .btn {
    gap: 0.2rem;
    padding-inline: 0.2rem;
    font-size: 0.7rem;
  }

  .action-row[data-action-layout="single-row"] .btn-provider-setup {
    grid-column: span 2;
  }
}

.compact-tabs {
  height: 3rem;
  padding: 0.24rem;
}

.compact-tabs .nav-link {
  height: 2.5rem;
  border-radius: 10px;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 900;
}

:root[data-theme="dark"] .compact-tabs .nav-link {
  color: var(--ink);
}

.compact-tabs .nav-link.active {
  background: var(--brand);
}

.app-tabs {
  position: fixed;
  right: 0.5rem;
  bottom: max(0.45rem, env(safe-area-inset-bottom));
  left: 0.5rem;
  z-index: 1030;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0.15rem;
  align-items: stretch;
  max-width: calc(100vw - 1rem);
  height: 3.15rem;
  padding: 0.25rem;
  border: 1px solid rgba(207, 226, 223, 0.95);
  border-radius: 14px;
  background: var(--surface-soft);
  box-shadow: 0 16px 34px var(--shadow);
  backdrop-filter: blur(18px);
}

.app-tabs .nav-link {
  overflow: hidden;
  position: relative;
  min-width: 0;
  width: 100%;
  height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.12rem;
  padding: 0.42rem 0.12rem;
  border-radius: 10px;
  color: var(--muted);
  font-size: clamp(0.56rem, 2.4vw, 0.68rem);
  line-height: 1;
}

.app-tabs .nav-link span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-tabs .nav-link i {
  font-size: 0.95rem;
}

.app-tabs .nav-link.active {
  background: var(--surface-2);
  color: var(--brand);
}

.tab-count {
  position: absolute;
  top: 0.2rem;
  right: 0.3rem;
  min-width: 1.05rem;
  height: 1.05rem;
  display: inline-grid;
  place-items: center;
  padding: 0 0.24rem;
  border-radius: 999px;
  background: #d64045;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--surface);
}

.tab-count[hidden] {
  display: none;
}

.inbox-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.inbox-summary h3,
.inbox-summary p {
  margin: 0;
}

.inbox-summary p {
  color: var(--muted);
  font-size: 0.84rem;
}

.inbox-item {
  padding: 0;
  overflow: hidden;
}

.inbox-item > button {
  width: 100%;
  min-height: 4.6rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.72rem;
  align-items: center;
  padding: 0.8rem;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.inbox-item.unread {
  border-color: rgba(15, 107, 112, 0.38);
  box-shadow: 0 0 0 1px rgba(15, 107, 112, 0.12), 0 12px 24px var(--shadow);
}

.inbox-icon {
  width: 2.55rem;
  height: 2.55rem;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-3);
  color: var(--brand);
}

.inbox-copy {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.inbox-copy strong,
.inbox-copy small,
.inbox-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-copy strong {
  font-size: 0.95rem;
}

.inbox-copy small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.inbox-copy span {
  color: var(--muted);
  font-size: 0.84rem;
}

.inbox-unread-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--brand-2);
}

.navigation-card {
  border-color: rgba(15, 107, 112, 0.28);
  background: var(--brand-3);
}

.navigation-card strong {
  display: block;
  margin-bottom: 0.18rem;
}

@media (max-width: 380px) {
  .app-tabs {
    right: 0.35rem;
    left: 0.35rem;
    max-width: calc(100vw - 0.7rem);
  }

  .app-tabs .nav-link {
    font-size: 0.52rem;
  }

  .app-tabs .nav-link i {
    font-size: 0.88rem;
  }

  .app-header {
    padding-inline: 0.55rem;
  }

  .role-badge {
    max-width: 4.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .queue-badge {
    max-width: 6.4rem;
    padding-inline: 0.38rem;
  }

  .app-header-actions {
    gap: 0.32rem;
  }

  .icon-btn {
    width: 2.1rem;
    height: 2.1rem;
  }

  .decision-signal-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .queue-badge,
  .role-badge {
    display: none;
  }
}

.stack {
  display: grid;
  gap: 0.55rem;
}

.k-card {
  padding: 0.75rem;
}

.app-view .k-card {
  border-color: var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  box-shadow: 0 8px 22px var(--shadow);
}

.app-view .k-card h3 {
  color: var(--ink);
}

.k-card,
.offer-card,
.toolbar,
.compact-tabs,
.stats-row,
.settings-card {
  border-radius: 10px;
}

.k-card h3 {
  margin: 0;
  color: var(--brand);
  font-size: 1.05rem;
  font-weight: 900;
}

.k-card p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.55rem;
}

.meta span {
  padding: 0.25rem 0.48rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
}

.offer {
  border-left: 3px solid var(--offer-accent);
  margin-top: 0.45rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: var(--offer-bg);
  color: var(--ink);
  font-size: 0.82rem;
}

.missed-call-card {
  border-left: 3px solid #d13f31 !important;
}

.missed-call-card small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.offers-section {
  margin-top: 0.65rem;
}

.offers-heading,
.offer-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.45rem;
  align-items: center;
}

.offers-heading span,
.offer-card-head span,
.offer-schedule {
  color: var(--muted);
  font-size: 0.74rem;
}

.offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.offer-card {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  min-width: 0;
  padding: 0.6rem;
  border: 1px solid var(--offer-border);
  border-left: 3px solid var(--offer-accent);
  border-radius: 8px;
  background: var(--offer-bg);
}

.offer-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.offer-amount {
  color: var(--brand);
  font-size: 1rem;
  font-weight: 900;
}

.offer-distance {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  max-width: 100%;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--distance-bg);
  color: var(--distance-ink);
  font-size: 0.76rem;
  font-weight: 900;
}

.location-picker {
  display: grid;
  gap: 0.55rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  text-align: left;
}

.schedule-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 0.7rem;
}

.location-picker strong,
.location-picker small {
  display: block;
}

.location-picker small {
  color: var(--muted);
  font-size: 0.78rem;
}

.location-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.map-mode-toggle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.map-mode-toggle button {
  min-height: 2.25rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.map-mode-toggle button.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 14px rgba(15, 62, 70, 0.18);
}

.job-map-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.job-map {
  min-height: 18rem;
  height: min(44vh, 24rem);
  overflow: hidden;
  background: var(--surface-2);
}

.map-hint {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  left: 0.55rem;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: rgba(8, 32, 38, 0.82);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 900;
  pointer-events: none;
}

.k-map-zoom {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 650;
  display: grid;
  gap: 0.38rem;
}

.k-map-zoom button {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 2px solid #fff;
  border-radius: 12px;
  background: #0f3e46;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
}

.k-map-zoom button:hover,
.k-map-zoom button:focus {
  background: #17616d;
  color: #fff;
  outline: 3px solid rgba(143, 231, 239, 0.55);
  outline-offset: 2px;
}

.location-picker .leaflet-control-attribution {
  max-width: calc(100% - 1rem);
  border-radius: 6px 0 0 0;
  font-size: 0.66rem;
}

.job-map .leaflet-tile {
  image-rendering: auto;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.location-note {
  font-weight: 800;
}

:root[data-theme="dark"] .location-picker {
  border-color: #2c4a52;
  background: #10272c;
}

:root[data-theme="dark"] .job-map-wrap {
  border-color: #2c4a52;
}

:root[data-theme="dark"] .map-mode-toggle {
  border-color: #2c4a52;
  background: rgba(9, 30, 35, 0.78);
}

:root[data-theme="dark"] .k-map-zoom button {
  border-color: #0f2e35;
  background: #f4fbfa;
  color: #0f2e35;
}

:root[data-theme="dark"] .k-map-zoom button:hover,
:root[data-theme="dark"] .k-map-zoom button:focus {
  background: #cce7e3;
  color: #0f2e35;
}

.swal2-popup.navigation-popup {
  padding: 0;
  overflow: hidden;
}

.navigation-shell {
  display: grid;
  text-align: left;
}

.navigation-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.75rem;
  padding: 0.9rem;
}

.navigation-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 0.4rem;
}

.navigation-head h3,
.navigation-head p {
  margin: 0;
}

.navigation-head h3 {
  color: var(--brand);
  font-size: 1rem;
  font-weight: 900;
}

.navigation-head p {
  color: var(--muted);
  font-size: 0.84rem;
}

.navigation-map-wrap {
  position: relative;
  min-height: min(58vh, 28rem);
  background: var(--surface-2);
}

.navigation-map {
  width: 100%;
  min-height: min(58vh, 28rem);
}

.navigation-zoom {
  top: 0.75rem;
  right: 0.75rem;
  left: auto;
}

.navigation-panel {
  display: grid;
  gap: 0.7rem;
  padding: 0.85rem;
}

.navigation-stats,
.navigation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.navigation-stats span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
}

.navigation-steps {
  display: grid;
  gap: 0.38rem;
  max-height: 9.5rem;
  overflow: auto;
}

.navigation-steps p,
.navigation-steps div {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.navigation-steps div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.45rem;
  align-items: start;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
}

.navigation-pip {
  position: fixed;
  z-index: 1900;
  right: 0.75rem;
  bottom: calc(4.85rem + env(safe-area-inset-bottom));
  display: grid;
  width: min(21rem, calc(100vw - 1.5rem));
  grid-template-columns: 7.5rem minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(11, 69, 82, 0.28);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 0.8rem 2rem rgba(10, 43, 49, 0.28);
  color: var(--ink);
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.navigation-pip.dragging {
  cursor: grabbing;
}

.navigation-pip-map-button {
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: var(--surface-2);
}

.navigation-pip-map {
  display: block;
  width: 100%;
  height: 6.35rem;
  background: var(--surface-2);
}

.navigation-pip-body {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem;
}

.navigation-pip-body strong,
.navigation-pip-body span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navigation-pip-body strong {
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 900;
}

.navigation-pip-body span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.navigation-pip-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.35rem;
}

.navigation-pip-actions button {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--brand);
}

.navigation-pip-actions [data-navigation-pip-stop] {
  color: #dc3545;
}

@media (max-width: 420px) {
  .navigation-head {
    align-items: stretch;
    flex-direction: column;
  }

  .navigation-head-actions {
    justify-content: stretch;
  }

  .navigation-head-actions .btn {
    flex: 1 1 8rem;
  }

  .navigation-pip {
    grid-template-columns: 6.5rem minmax(0, 1fr);
  }

  .navigation-pip-map {
    height: 5.7rem;
  }
}

:root[data-theme="dark"] .offer-amount {
  color: var(--brand);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.media-block {
  margin-top: 0.55rem;
}

.media-heading,
.media-viewer-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.45rem;
  align-items: center;
}

.media-heading span,
.media-viewer-meta span {
  color: var(--muted);
  font-size: 0.74rem;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.75rem, 5.75rem));
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.media-tile {
  position: relative;
  display: grid;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.swal2-title,
.swal2-html-container,
.swal2-input,
.swal2-textarea,
.swal2-select,
.swal2-label,
.swal2-validation-message,
.swal2-content {
  color: var(--ink) !important;
}

.swal2-popup,
.swal2-popup.kaila-popup {
  border-color: var(--line) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
}

.swal2-input,
.swal2-textarea,
.swal2-select {
  border-color: var(--field-border) !important;
  background: var(--field-bg) !important;
}

.swal2-validation-message,
.swal2-footer,
.swal2-actions {
  background: var(--surface) !important;
}

.swal2-close {
  color: var(--muted) !important;
}

.swal2-close:hover {
  color: var(--ink) !important;
}

.swal2-styled.swal2-cancel {
  border: 1px solid var(--line) !important;
  background: var(--surface-2) !important;
  color: var(--ink) !important;
}

.swal2-styled.swal2-confirm {
  border: 1px solid var(--brand-2) !important;
  background: var(--brand) !important;
  color: #fff !important;
}

.swal2-styled.swal2-deny {
  border: 1px solid var(--warning-border) !important;
  background: var(--warning-bg) !important;
  color: var(--warning-ink) !important;
}

.swal2-timer-progress-bar {
  background: var(--brand) !important;
}

.media-tile img,
.media-tile video {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  background: var(--surface-2);
  object-fit: cover;
}

.media-type {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  padding: 0.12rem 0.3rem;
  border-radius: 999px;
  background: rgb(15 62 70 / 88%);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 900;
}

.media-popup {
  width: min(48rem, calc(100vw - 1.5rem));
}

.media-viewer {
  display: grid;
  gap: 0.5rem;
}

.media-viewer img,
.media-viewer video {
  width: 100%;
  max-height: 68svh;
  border-radius: 6px;
  background: #101617;
  object-fit: contain;
}

:root[data-theme="dark"] .media-viewer img,
:root[data-theme="dark"] .media-viewer video {
  background: #0f171b;
}

:root[data-theme="dark"] .media-viewer-meta strong,
:root[data-theme="dark"] .media-heading strong,
:root[data-theme="dark"] .media-heading span,
:root[data-theme="dark"] .media-viewer-meta span {
  color: var(--ink);
}

.card-actions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.card-actions .btn {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-card-focus {
  animation: request-focus-pulse 2.2s ease;
}

@keyframes request-focus-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgb(19 136 142 / 0%);
  }

  18%,
  70% {
    box-shadow: 0 0 0 4px rgb(19 136 142 / 30%);
  }
}

.collapsed-section {
  background: var(--surface-soft);
}

.collapsed-section summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  cursor: pointer;
  color: var(--brand);
  font-weight: 900;
  list-style: none;
}

.collapsed-section summary::-webkit-details-marker {
  display: none;
}

.collapsed-section small {
  min-width: 1.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  text-align: center;
}

.settings-card {
  display: grid;
  gap: 0.85rem;
  padding: 0.9rem;
}

.settings-head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.settings-head h3,
.settings-head p {
  margin: 0;
}

.settings-head h3 {
  color: var(--brand);
  font-size: 1.05rem;
  font-weight: 900;
}

.settings-head p {
  color: var(--muted);
}

.profile-photo {
  width: 3.5rem;
  height: 3.5rem;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  object-fit: cover;
}

.settings-grid {
  display: grid;
  gap: 0.65rem;
}

.settings-grid label {
  display: grid;
  gap: 0.28rem;
}

.upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr));
  gap: 0.45rem;
}

.upload-thumb {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.upload-thumb img,
.upload-thumb video {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
  background: var(--surface-2);
}

.upload-thumb span {
  display: block;
  padding: 0.25rem 0.35rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 0.62rem;
  height: 0.62rem;
  display: inline-block;
  border-radius: 50%;
  background: #c95f46;
}

.status-dot.connected {
  background: #26a269;
}

.live-panel {
  position: fixed;
  inset: auto 0.75rem 0.75rem 0.75rem;
  z-index: 1080;
  max-height: 70svh;
  display: grid;
  grid-template-rows: auto auto 1fr;
  padding: 0.75rem;
}

.live-panel[hidden] {
  display: none;
}

.live-panel .stack {
  overflow: auto;
}

.workspace-panel {
  position: fixed;
  z-index: 1800;
  top: calc(4.75rem + env(safe-area-inset-top));
  right: 1rem;
  bottom: 1rem;
  width: min(34rem, calc(100vw - 2rem));
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.24);
}

.workspace-panel.workspace-panel-form {
  width: min(64rem, calc(100vw - 2rem));
}

.workspace-panel[hidden] {
  display: none;
}

.workspace-panel > div {
  min-height: 0;
  display: grid;
}

body.workspace-open {
  overflow-x: hidden;
}

.workspace-form {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.workspace-form-header,
.workspace-form-actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.workspace-form-header h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-form-body {
  min-height: 0;
  overflow: auto;
  padding: 0.85rem;
}

.workspace-validation {
  margin: 0 0.85rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--danger-border);
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger-ink);
  font-size: 0.84rem;
  font-weight: 800;
}

.workspace-form-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.workspace-form-actions .btn {
  min-width: 7rem;
}

.swal2-popup.kaila-popup {
  width: min(96vw, 1040px);
  max-width: 96vw;
  border-radius: 14px;
}

.swal2-popup.kaila-popup.profile-popup {
  width: min(96vw, 1040px);
  max-width: 96vw;
}

.swal2-popup.kaila-popup.attention-request-popup,
.swal2-popup.kaila-popup.compact-offers-popup,
.swal2-popup.kaila-popup.media-popup {
  width: min(96vw, 1040px);
  max-width: 96vw;
}

.swal2-popup.kaila-popup .swal2-html-container {
  max-width: 100%;
  overflow-x: hidden;
}

.swal2-popup.kaila-popup .swal2-title {
  color: var(--brand);
  font-size: 1.25rem;
  font-weight: 900;
}

.attention-request-popup .swal2-title {
  margin-top: 0;
  padding-top: 0.25rem;
}

.attention-request {
  display: grid;
  gap: 0.85rem;
  justify-items: center;
  text-align: center;
  color: var(--ink);
}

.attention-profile {
  display: grid;
  gap: 0.32rem;
  justify-items: center;
}

.attention-profile-photo {
  width: 4.25rem;
  height: 4.25rem;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  object-fit: cover;
}

.attention-profile > strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.15;
}

.attention-profile .reputation-badge {
  justify-content: center;
}

.attention-request-details {
  display: grid;
  gap: 0.25rem;
  justify-items: center;
}

.attention-request-details strong {
  color: var(--ink);
  font-size: 1rem;
}

.attention-request-details p,
.attention-request-details span {
  margin: 0;
  color: var(--muted);
}

.attention-request-details span {
  font-size: 0.82rem;
}

.compact-offers {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
  text-align: center;
  color: var(--ink);
}

.compact-offers-summary {
  display: grid;
  gap: 0.18rem;
}

.compact-offers-summary strong {
  color: var(--ink);
  font-size: 1rem;
}

.compact-offers-summary span,
.compact-offers small {
  color: var(--muted);
}

.compact-offer-photos {
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.compact-offer-photo {
  width: 4.75rem;
  display: grid;
  gap: 0.22rem;
  justify-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.compact-offer-photo img {
  width: 3.35rem;
  height: 3.35rem;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  object-fit: cover;
}

.compact-offer-photo span {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-offer-photo:hover img,
.compact-offer-photo:focus-visible img {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(19 136 142 / 18%);
}

.compact-offer-photo:focus-visible {
  outline: 0;
}

.swal-form {
  display: grid;
  gap: 0.55rem;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  color: var(--ink);
}

.swal-form label {
  display: grid;
  align-content: start;
  align-self: start;
  gap: 0.25rem;
  min-width: 0;
}

.swal-form .form-control,
.swal-form .form-select,
.address-grid .form-control,
.address-grid .form-select {
  width: 100%;
  min-width: 0;
}

.validation-briefer {
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.validation-briefer summary {
  cursor: pointer;
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 900;
}

.briefer-body {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.briefer-body p {
  margin: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
}

.briefer-body strong {
  color: var(--brand);
}

.validation-draft-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.validation-draft-tools .btn {
  flex: 0 0 auto;
}

.decision-signal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem;
  align-items: center;
}

.decision-signal-row .btn,
.ai-insight-button {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.decision-signal-note {
  min-height: 1rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.ai-insight-button {
  margin-top: 0.55rem;
}

.ai-insight-panel {
  display: grid;
  gap: 0.75rem;
  text-align: left;
}

.ai-insight-panel p,
.ai-insight-panel ul {
  margin: 0;
}

.ai-insight-panel ul {
  padding-left: 1.1rem;
}

.ai-insight-panel strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--brand);
}

.question-label {
  position: relative;
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  gap: 0.24rem;
  align-items: flex-start;
}

.swal-form .question-label > span:first-child {
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 900;
}

.question-help {
  position: relative;
  top: -0.15rem;
  display: inline-grid;
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--brand-2) !important;
  cursor: help;
  font-size: 0.68rem !important;
  font-weight: 900;
  line-height: 1;
}

.question-help::after {
  position: fixed;
  display: none;
  left: var(--guide-left, 50vw);
  top: var(--guide-top, 50vh);
  z-index: 10000;
  width: var(--guide-width, min(19rem, calc(100vw - 2rem)));
  max-height: min(42vh, 16rem);
  overflow-y: auto;
  padding: 0.48rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 12px 28px var(--shadow);
  color: var(--ink);
  content: attr(data-guide);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translate(-50%, calc(-100% - 0.2rem));
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.question-help[data-vertical="below"]::after {
  transform: translate(-50%, 0.2rem);
}

.question-help[data-placement="left"]::after {
  transform: translate(0, calc(-100% - 0.2rem));
}

.question-help[data-placement="right"]::after {
  transform: translate(-100%, calc(-100% - 0.2rem));
}

.question-help[data-placement="left"][data-vertical="below"]::after {
  transform: translate(0, 0.2rem);
}

.question-help[data-placement="right"][data-vertical="below"]::after {
  transform: translate(-100%, 0.2rem);
}

.question-help:hover::after,
.question-help:focus-visible::after {
  display: block;
  opacity: 1;
  transform: translate(-50%, -100%);
}

.question-help[data-placement="left"]:hover::after,
.question-help[data-placement="left"]:focus-visible::after {
  transform: translate(0, -100%);
}

.question-help[data-placement="right"]:hover::after,
.question-help[data-placement="right"]:focus-visible::after {
  transform: translate(-100%, -100%);
}

.question-help[data-vertical="below"]:hover::after,
.question-help[data-vertical="below"]:focus-visible::after {
  transform: translate(-50%, 0);
}

.question-help[data-placement="left"][data-vertical="below"]:hover::after,
.question-help[data-placement="left"][data-vertical="below"]:focus-visible::after {
  transform: translate(0, 0);
}

.question-help[data-placement="right"][data-vertical="below"]:hover::after,
.question-help[data-placement="right"][data-vertical="below"]:focus-visible::after {
  transform: translate(-100%, 0);
}

.question-help:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent);
  outline-offset: 2px;
}

.rating-field {
  display: grid;
  gap: 0.25rem;
}

.star-rating {
  display: flex;
  gap: 0.18rem;
}

.star-button {
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 1.55rem;
  line-height: 1;
}

.star-button.selected,
.star-button:hover,
.star-button:focus-visible {
  background: var(--warning-bg);
  color: var(--accent);
}

.star-button:focus-visible {
  outline: 0;
}

.rating-label {
  color: #677779;
  font-size: 0.78rem;
}

.rating-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.35rem;
}

.rating-stars {
  color: #d99a16;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.rating-note-text {
  color: var(--muted);
}

:root[data-theme="dark"] .rating-stars {
  color: var(--accent);
}

.user-identity {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-width: 0;
  margin-top: 0.6rem;
}

.user-identity.compact {
  margin-top: 0;
}

.user-avatar {
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  object-fit: cover;
}

.user-identity.compact .user-avatar {
  width: 2.35rem;
  height: 2.35rem;
}

.user-identity-copy {
  min-width: 0;
}

.user-identity-copy > strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reputation-badge {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
}

.reputation-stars {
  color: #d99a16;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

:root[data-theme="dark"] .reputation-stars {
  color: var(--accent);
}

.reputation-line {
  display: flex;
  margin-top: 0.25rem;
}

.chat-popup {
  width: min(34rem, calc(100vw - 1.5rem));
  padding: 0 !important;
  overflow: visible;
}

.chat-popup .swal2-html-container {
  margin: 0;
  overflow: visible;
}

.chat-popup .swal2-title:empty {
  display: none;
}

.chat-shell {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto auto;
  gap: 0.7rem;
  padding: 0.85rem;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.workspace-panel .chat-shell {
  height: 100%;
  border-radius: 0;
}

.chat-header {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  min-height: 2.8rem;
}

.chat-header h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-icon-button {
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 1.1rem;
}

.chat-icon-button:active,
.chat-icon-button[aria-expanded="true"] {
  background: var(--surface-2);
}

.chat-reputation {
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
}

.chat-reputation .user-identity {
  margin-top: 0;
}

.chat-reputation .user-identity strong,
.chat-reputation .user-identity span {
  color: var(--ink);
}

.chat-topic-card {
  display: grid;
  gap: 0.3rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.chat-topic-card strong,
.chat-topic-card span {
  display: block;
}

.chat-topic-card span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.chat-topic-card p {
  margin: 0;
  color: var(--ink);
  font-size: 0.82rem;
}

.chat-call-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.chat-top-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.chat-menu-wrap {
  position: relative;
  display: inline-flex;
}

.chat-popover {
  position: absolute;
  z-index: 10;
  top: calc(100% + 0.35rem);
  right: 0;
  display: grid;
  min-width: 12rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 0.7rem 1.6rem rgba(0, 0, 0, 0.38);
}

.chat-popover[hidden] {
  display: none;
}

.chat-popover button,
.chat-popover label {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.65rem;
  padding: 0.55rem 0.75rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.88rem;
  text-align: left;
}

.chat-popover button:active,
.chat-popover label:active {
  background: var(--surface-2);
}

.chat-menu-empty {
  display: block;
  padding: 0.7rem 0.8rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.audio-call-panel {
  position: fixed;
  z-index: 2000;
  right: 0.75rem;
  bottom: 0.75rem;
  left: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 32rem;
  margin-left: auto;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 0.75rem 2rem rgba(10, 43, 49, 0.22);
  color: var(--ink);
  text-align: left;
}

.audio-call-panel span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.audio-call-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.35rem;
}

body.call-overlay-open {
  overflow: hidden;
}

.audio-call-panel.audio-call-overlay {
  inset: 0;
  display: grid;
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  align-items: stretch;
  justify-content: stretch;
  gap: 1rem;
  max-width: none;
  margin: 0;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1.5rem, env(safe-area-inset-bottom));
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(242, 198, 109, 0.2), transparent 15rem),
    linear-gradient(155deg, #0b4552 0%, #082f39 62%, #061f27 100%);
  box-shadow: none;
  color: #fff;
  text-align: center;
}

.audio-call-overlay-head {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
}

.audio-call-secure,
.audio-call-state {
  color: rgba(255, 255, 255, 0.78) !important;
  font-size: 0.7rem !important;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.audio-call-secure i {
  margin-right: 0.25rem;
}

.audio-call-minimize,
.audio-call-mini-action {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.audio-call-stage {
  position: relative;
  z-index: 2;
  display: grid;
  width: 100%;
  align-content: center;
  justify-items: center;
  justify-self: stretch;
  gap: 0.65rem;
}

.audio-call-remote-video {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #031a20;
  object-fit: cover;
}

.audio-call-video-waiting {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.75rem;
  background: rgba(0, 12, 15, 0.52);
  color: rgba(255, 255, 255, 0.84);
  pointer-events: none;
}

.audio-call-video-waiting[hidden] {
  display: none;
}

.audio-call-video-waiting i {
  font-size: clamp(2.6rem, 12vw, 4.5rem);
}

.audio-call-video-waiting span {
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audio-call-local-video {
  position: absolute;
  z-index: 3;
  top: max(4.4rem, calc(env(safe-area-inset-top) + 3.4rem));
  right: 1rem;
  width: clamp(5.5rem, 20vw, 8rem);
  aspect-ratio: 3 / 4;
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-radius: 12px;
  background: #082f39;
  box-shadow: 0 0.6rem 1.5rem rgba(0, 0, 0, 0.28);
  object-fit: cover;
}

.audio-call-panel.video-active::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 18, 22, 0.48) 0%, rgba(0, 18, 22, 0.04) 36%, rgba(0, 18, 22, 0.72) 100%);
  content: "";
  pointer-events: none;
}

.audio-call-panel.video-active .audio-call-stage {
  align-content: end;
  padding-bottom: 0.35rem;
  text-shadow: 0 0.15rem 0.65rem rgba(0, 0, 0, 0.72);
}

.audio-call-avatar {
  width: clamp(7.5rem, 32vw, 10rem);
  aspect-ratio: 1;
  margin-bottom: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 0.65rem rgba(255, 255, 255, 0.05);
  object-fit: cover;
}

.audio-call-state {
  display: flex !important;
  align-items: center;
  gap: 0.4rem;
}

.audio-call-live-dot {
  display: inline-block !important;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #71e2a1;
  box-shadow: 0 0 0 0.24rem rgba(113, 226, 161, 0.18);
}

.audio-call-stage h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.65rem, 7vw, 2.4rem);
  font-weight: 900;
}

.audio-call-stage p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.86rem;
}

.audio-call-duration {
  color: #fff;
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.audio-call-overlay-actions {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  justify-self: stretch;
  gap: clamp(0.65rem, 6vw, 2.4rem);
}

.audio-call-control {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  min-width: 4.5rem;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 0.78rem;
}

.audio-call-control span {
  display: grid;
  width: 4.25rem;
  height: 4.25rem;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.25rem;
}

.audio-call-control.end span,
.audio-call-mini-action.end {
  border-color: transparent;
  background: #dc3545;
}

.audio-call-control.answer span {
  background: #20a66a;
}

.audio-call-panel.minimized {
  max-width: 34rem;
  padding: 0.5rem;
  border-color: rgba(11, 69, 82, 0.25);
  background: var(--surface-soft);
}

.audio-call-panel.video-minimized {
  overflow: visible;
}

.audio-call-mini-video {
  position: fixed;
  z-index: 2001;
  right: 0.75rem;
  bottom: 4.75rem;
  display: block;
  width: clamp(8rem, 22vw, 11rem);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 14px;
  background: #031a20;
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.3);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.audio-call-mini-video:active {
  cursor: grabbing;
}

.audio-call-mini-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.audio-call-mini-video-waiting {
  position: absolute;
  inset: 0;
  display: grid !important;
  place-items: center;
  background: rgba(0, 12, 15, 0.6);
  color: rgba(255, 255, 255, 0.82) !important;
  font-size: 1.8rem !important;
}

.audio-call-mini-video-waiting[hidden] {
  display: none !important;
}

.audio-call-minimized-main {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 0.65rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.audio-call-minimized-main span:last-child {
  min-width: 0;
}

.audio-call-mini-photo {
  width: 2.6rem;
  height: 2.6rem;
  flex: 0 0 auto;
  border: 2px solid rgba(32, 166, 106, 0.48);
  border-radius: 50%;
  object-fit: cover;
}

.audio-call-minimized-main strong,
.audio-call-minimized-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-call-minimized-main small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.audio-call-mini-action {
  flex: 0 0 auto;
  width: 2.45rem;
  height: 2.45rem;
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
}

@media (max-width: 560px) {
  .workspace-panel {
    inset: 0;
    width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .workspace-panel.workspace-panel-form {
    width: 100vw;
  }

  .workspace-form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .audio-call-panel.audio-call-overlay {
    gap: 0.65rem;
    padding: max(0.75rem, env(safe-area-inset-top)) 0.55rem max(0.8rem, env(safe-area-inset-bottom));
  }

  .audio-call-local-video {
    top: max(4.1rem, calc(env(safe-area-inset-top) + 3.1rem));
    right: 0.65rem;
    width: 5.7rem;
  }

  .audio-call-panel.video-active .audio-call-stage {
    padding-bottom: 0;
  }

  .audio-call-stage {
    gap: 0.45rem;
  }

  .audio-call-stage h2 {
    font-size: clamp(1.55rem, 8vw, 2.05rem);
  }

  .audio-call-duration {
    font-size: 1.25rem;
  }

  .audio-call-overlay-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.1rem;
  }

  .audio-call-control {
    flex: 0 1 4.85rem;
    min-width: 0;
    gap: 0.35rem;
    font-size: 0.68rem;
  }

  .audio-call-control span {
    width: 3.55rem;
    height: 3.55rem;
    font-size: 1.05rem;
  }

  .audio-call-control b {
    max-width: 4.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .audio-call-mini-video {
    width: 7.2rem;
  }
}

.chat-transcript {
  display: grid;
  align-content: start;
  align-items: start;
  gap: 0.78rem;
  grid-auto-rows: max-content;
  max-height: 52svh;
  overflow-y: auto;
  padding: 0.2rem 0.05rem 0.35rem;
}

.workspace-panel .chat-transcript {
  max-height: none;
}

.chat-message {
  max-width: min(88%, 24rem);
  min-height: 0;
  padding: 0.72rem 0.85rem;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  line-height: 1.32;
}

.chat-message.mine {
  justify-self: end;
  background: var(--brand-3);
}

.chat-call-log {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(25, 135, 84, 0.18);
}

.chat-call-log i {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  background: rgba(25, 135, 84, 0.12);
  color: #198754;
}

.chat-call-log.missed {
  border-color: rgba(220, 53, 69, 0.18);
}

.chat-call-log.missed i {
  background: rgba(220, 53, 69, 0.12);
  color: #dc3545;
}

.chat-message strong,
.chat-message span {
  display: block;
}

.chat-message span,
.chat-typing,
.chat-empty,
.chat-archived {
  color: var(--muted);
  font-size: 0.74rem;
}

.chat-message p {
  margin: 0.2rem 0 0;
  white-space: pre-wrap;
}

.chat-presence,
.chat-typing {
  min-height: 1.1rem;
  color: var(--muted);
  font-size: 0.74rem;
}

.chat-reaction {
  margin-top: 0.35rem;
  padding: 0.16rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 800;
}

.chat-reaction-count {
  display: block;
  margin-top: 0.35rem;
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 800;
}

.chat-compose {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
}

.direct-chat-compose {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.chat-compose textarea.form-control {
  min-height: 3.05rem;
  max-height: 7.5rem;
  padding: 0.78rem 0.9rem;
  resize: none;
  border: 0;
  border-radius: 8px;
  background: var(--field-bg) !important;
  color: var(--ink) !important;
  box-shadow: none;
}

.chat-compose textarea.form-control::placeholder {
  color: var(--field-placeholder) !important;
}

.chat-plus-button {
  background: var(--surface-2);
  color: var(--ink);
  font-size: 1.15rem;
}

.chat-compose-menu-wrap .chat-popover {
  right: auto;
  bottom: calc(100% + 0.35rem);
  left: 0;
  top: auto;
}

.chat-send-button {
  min-width: 4.2rem;
  min-height: 3.05rem;
  border-radius: 8px;
}

.chat-emoji-panel {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.2rem;
  padding: 0.45rem;
  border-radius: 8px;
  background: var(--surface-2);
}

.chat-emoji-panel[hidden] {
  display: none;
}

.chat-emoji-panel button {
  display: grid;
  min-height: 2.2rem;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 1.15rem;
}

.chat-emoji-panel button:active {
  background: var(--surface);
}

.direct-media-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.45rem;
  min-height: 2.45rem;
  margin: 0;
}

.direct-upload-preview {
  margin-top: -0.15rem;
}

.direct-message-media {
  grid-template-columns: repeat(auto-fill, minmax(4.25rem, 5.25rem));
  margin-top: 0.4rem;
}

.chat-archived {
  padding: 0.55rem;
  border-radius: 8px;
  background: var(--surface-2);
  font-weight: 700;
}

.inline-toast-stack {
  position: fixed;
  z-index: 2400;
  top: max(0.75rem, env(safe-area-inset-top));
  right: 0.75rem;
  left: 0.75rem;
  display: grid;
  justify-items: end;
  gap: 0.45rem;
  pointer-events: none;
}

.inline-toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.55rem;
  width: min(25rem, 100%);
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  background: #1e2528;
  color: #f4f7f7;
  box-shadow: 0 0.75rem 1.8rem rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.inline-toast.leaving {
  opacity: 0;
  transform: translateY(-0.25rem);
}

.inline-toast i {
  margin-top: 0.1rem;
}

.inline-toast strong,
.inline-toast span {
  display: block;
}

.inline-toast span {
  color: #c4cccc;
  font-size: 0.8rem;
}

.inline-toast.error i {
  color: #ff6b72;
}

.inline-toast.warning i {
  color: #f2c66d;
}

.inline-toast.success i {
  color: #71e2a1;
}

.inline-toast.info i {
  color: #7cb7ff;
}

.swal-form span {
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 900;
}

:root[data-theme="dark"] .swal-form span {
  color: var(--ink);
}

@media (min-width: 640px) {
  .hero-compact {
    grid-template-columns: minmax(0, 1.05fr) minmax(18rem, 0.75fr);
    align-items: center;
    min-height: 420px;
    padding: clamp(1.25rem, 4vw, 2rem);
  }

  .hero-copy {
    padding: 0;
  }

  .hero-actions {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .app-content {
    grid-template-rows: 4.9rem auto 3.35rem minmax(0, 1fr);
    gap: 0.9rem;
    padding: 1rem;
  }

  .adminlte-panel {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-height: 4.9rem;
    height: auto;
    padding: 0.78rem;
  }

  .panel-title {
    height: 2.8rem;
  }

  .admin-stats {
    min-height: 5rem;
    height: auto;
  }

  .stats-row {
    gap: 0.25rem;
    padding: 0.45rem;
    margin-bottom: 0.6rem;
  }

  .stats-row div,
  .stats-row button {
    padding: 0.55rem;
  }

  .admin-stats div,
  .admin-stats button {
    padding: 0.45rem 0.28rem;
  }

  .admin-stats i {
    font-size: 0.78rem;
  }

  .stats-row strong {
    font-size: 1.35rem;
  }

  .stats-row span {
    font-size: 0.72rem;
  }

  .action-row {
    gap: 0.5rem;
    height: 2.8rem;
    margin-bottom: 0.6rem;
  }

  .action-row .btn {
    min-height: 2.8rem;
  }

  .app-tabs {
    position: sticky;
    top: 4.75rem;
    right: auto;
    bottom: auto;
    left: auto;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(12, 39, 48, 0.06);
    height: 3.35rem;
    padding: 0.35rem;
  }

  .app-tabs .nav-link {
    display: flex;
    justify-content: center;
    gap: 0.42rem;
    align-items: center;
    justify-self: stretch;
    min-height: 2.65rem;
    padding: 0.65rem 0.5rem;
    font-size: 0.78rem;
  }

  .app-tab-content {
    padding-bottom: 0;
  }

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

  .settings-grid .wide {
    grid-column: 1 / -1;
  }

  .live-panel {
    inset: 4.75rem 1rem 1rem auto;
    width: 420px;
  }

  .swal-form.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .swal-form .wide {
    grid-column: 1 / -1;
  }

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

@media (min-width: 900px) {
  .swal-form.two {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .swal-form.two > label {
    grid-column: span 2;
  }

  .swal-form.two > .field-sm {
    grid-column: span 1;
  }

  .swal-form.two > .field-md {
    grid-column: span 2;
  }

  .swal-form.two > .field-lg {
    grid-column: span 3;
  }

  .swal-form.two > .wide {
    grid-column: 1 / -1;
  }

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

  .address-grid label {
    grid-column: span 1;
  }

  .address-grid .field-sm {
    grid-column: span 1;
  }

  .address-grid .field-md {
    grid-column: span 2;
  }

  .address-grid .field-lg {
    grid-column: span 3;
  }

  .address-grid label:nth-child(-n + 3) {
    grid-column: span 2;
  }

  .address-grid label:nth-child(-n + 3).field-sm {
    grid-column: span 1;
  }

  .address-grid label:nth-child(-n + 3).field-lg {
    grid-column: span 3;
  }

  .profile-popup .swal-form.two {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem 0.85rem;
  }

  .profile-popup [data-admin-provider-fields] {
    display: grid;
    grid-template-columns: repeat(2, minmax(20rem, 1fr));
    gap: 0.7rem 0.85rem;
  }

  .profile-popup [data-admin-provider-fields][hidden] {
    display: none;
  }
}
