:root {
  --primary: #0f4c3a;
  --primary-hover: #0a3629;
  --primary-light: #e6f3ee;
  --accent: #d97706;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --border: #dde3ea;
  --text: #111827;
  --text-muted: #5b6577;
  --pos: #057a55;
  --pos-bg: #def7ec;
  --neg: #c81e1e;
  --neg-bg: #fde8e8;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

code, .font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1rem;
}

.hidden {
  display: none !important;
}

/* Slim Mobile-Friendly Top Navigation */
.topbar {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  gap: 0.5rem;
}

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

.brand-badge {
  background: #fbbf24;
  color: #111827;
  font-weight: 800;
  font-size: 0.7rem;
  padding: 0.16rem 0.42rem;
  border-radius: 5px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.brand-user {
  font-weight: 600;
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.topbar-logout {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.22rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
}

.subnav {
  background: #0b3b2d;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.subnav-inner {
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tab {
  color: rgba(255, 255, 255, 0.78);
  padding: 0.48rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.nav-tab:hover, .nav-tab.active {
  color: #fff;
  border-bottom-color: #fbbf24;
}

.pwa-banner {
  background: var(--warn-bg);
  color: #78350f;
  padding: 0.55rem 0;
  font-size: 0.84rem;
  border-bottom: 1px solid #fcd34d;
}

.pwa-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.main-content {
  padding-top: 0.85rem;
  padding-bottom: 2.5rem;
}

/* Page Header */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.page-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

@media (max-width: 640px) {
  .page-head p.text-muted {
    display: none;
  }
  .card {
    padding: 0.9rem;
  }
}

.page-head-actions, .filter-pills, .action-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Cards & Grids */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow);
}

.subcard {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem;
  margin-bottom: 0.85rem;
  background: #fafbfc;
}

.card-header {
  margin-bottom: 1rem;
}

.card-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.card-subtitle {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

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

@media (max-width: 860px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

/* KPI Cards - Compact Mobile 2-Column Layout */
.kpi-grid {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

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

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

@media (max-width: 860px) {
  .kpi-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .kpi-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi-grid-3 .kpi-card:first-child {
    grid-column: span 2;
  }
  .kpi-card {
    padding: 0.65rem 0.75rem !important;
  }
  .kpi-value {
    font-size: 1.15rem !important;
  }
  .kpi-sub {
    display: none;
  }
}

/* Public sign-in */
.signin-shell {
  display: grid;
  justify-items: center;
  align-items: start;
  padding: clamp(1rem, 9vh, 5rem) 0 2rem;
}

.signin-card {
  width: min(100%, 26rem);
  padding: clamp(1.1rem, 4vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.signin-header { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.5rem; }
.signin-header img { border-radius: 10px; }
.signin-header p { margin: 0 0 .15rem; color: var(--primary); font-weight: 650; font-size: .85rem; }
.signin-header h1 { margin: 0; font-size: 1.65rem; line-height: 1.15; }
.signin-films { display: grid; gap: .4rem; margin: -.25rem 0 1.15rem; }
.signin-film {
  display: flex; align-items: center; gap: .75rem; padding: .4rem;
  border: 1px solid #d1e4dc; border-radius: 10px; background: #f1f7f4;
}
.signin-film:hover { background: var(--primary-light); }
.signin-film strong, .signin-film small { display: block; }
.signin-film strong { line-height: 1.35; }
.signin-film small { margin-top: .15rem; color: var(--text-muted); }
.signin-film-thumb { position: relative; flex: none; width: 4.75rem; }
.signin-film-thumb img { width: 100%; height: auto; display: block; border-radius: 6px; }
.signin-film-thumb span {
  position: absolute; left: .2rem; bottom: .2rem; display: grid; place-items: center;
  width: 1.35rem; height: 1.35rem; border: 1px solid white; border-radius: 50%;
  background: rgb(8 46 36 / 85%); color: white; font-size: .65rem;
}
.scene-film { display: flex; align-items: center; gap: .65rem; width: fit-content; max-width: 100%; min-height: 44px; padding: .25rem .65rem .25rem .25rem; margin: .4rem 0 .8rem; border: 1px solid var(--border); border-radius: .65rem; background: var(--surface); color: var(--primary); text-decoration: none; }
.scene-film:focus-visible, .scene-film:hover { background: var(--primary-light); }
.scene-film strong { font-size: .91rem; overflow-wrap: anywhere; }
.scene-film-thumb { display: block; position: relative; flex: none; }
.scene-film-thumb img { display: block; width: 3.5rem; height: 2.25rem; object-fit: cover; border-radius: .4rem; }
.scene-film-thumb b { position: absolute; left: .18rem; bottom: .13rem; display: grid; place-items: center; width: 1.1rem; height: 1.1rem; color: white; background: #123f35; border-radius: 50%; font-size: .55rem; }
.signin-films .scene-film { margin: 0; width: 100%; }
.signin-languages { display: flex; gap: .1rem; margin-inline-start: auto; flex-wrap: wrap; }
.signin-languages a { display: grid; align-items: center; min-height: 44px; padding: 0 .32rem; font-size: .8rem; color: var(--text-muted); }
.signin-languages a[aria-current], .shell-popover a[aria-current] { color: var(--primary); text-decoration: underline; text-underline-offset: .2em; }
.film-dialog {
  width: min(25rem, calc(100% - 1rem)); max-height: calc(100vh - 1rem); max-height: calc(100dvh - 1rem);
  margin: auto; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: #101b17; color: white;
}
.film-dialog::backdrop { background: rgb(7 22 17 / 82%); }
.film-frame, .film-page { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.film-toolbar { display: flex; align-items: center; gap: .5rem; flex: none; min-height: 48px; padding: 0 .35rem; background: #101b17; color: white; }
.film-toolbar h1, .film-toolbar h2 { min-width: 0; flex: 1; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; color: inherit; }
.film-toolbar button, .film-toolbar a { display: inline-flex; align-items: center; justify-content: center; gap: .28rem; flex: none; min-height: 44px; min-width: 44px; padding: .3rem .55rem; border: 0; border-radius: .45rem; background: transparent; color: white; font: inherit; cursor: pointer; }
.film-toolbar .film-close { background: #24483b; font-weight: 600; }
.film-close span { font-size: 1.35rem; line-height: 1; }
.film-dialog video, .film-page video { display: block; min-height: 0; flex: 0 1 auto; width: 100%; aspect-ratio: 9 / 16; object-fit: contain; background: #070c0a; }
.film-dialog.film-expanded, .film-frame:fullscreen { width: 100%; height: 100vh; height: 100dvh; max-width: none; max-height: none; border-radius: 0; }
.film-expanded .film-frame, .film-frame:fullscreen { height: 100%; background: #070c0a; }
.film-expanded video, .film-frame:fullscreen video { flex: 1; }
.film-expanded .film-toolbar, .film-frame:fullscreen .film-toolbar { padding: env(safe-area-inset-top) max(.35rem, env(safe-area-inset-right)) 0 max(.35rem, env(safe-area-inset-left)); }
.film-retry:not([hidden]) { flex: none; padding: .6rem 1rem; color: white; text-decoration: underline; }
.film-page { width: min(100%, 25rem); margin: auto; max-height: calc(100vh - 3rem); max-height: calc(100dvh - 3rem); background: #070c0a; color: white; border-radius: 12px; overflow: hidden; }
@media (max-width: 560px) {
  .signin-shell { padding-top: .75rem; }
}
.signin-methods { display: flex; gap: .25rem; background: #edf2f0; border-radius: 10px; padding: .25rem; margin-bottom: 1.5rem; }
.signin-methods a { flex: 1; min-height: 44px; display: grid; place-items: center; border-radius: 7px; color: var(--text-muted); font-weight: 600; }
.signin-methods a[aria-current] { color: var(--primary); background: white; box-shadow: var(--shadow); }
.signin-roles { border: 0; margin: 0 0 1.25rem; padding: 0; min-width: 0; }
.signin-roles legend { margin-bottom: .5rem; padding: 0; font-weight: 650; font-size: .9rem; }
.signin-role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.signin-role-grid label { display: flex; align-items: center; gap: .45rem; min-height: 46px; padding: .5rem; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: .88rem; }
.signin-role-grid input { flex: none; margin: 0; accent-color: var(--primary); }
.signin-role-grid label:has(:checked) { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.signin-card .form-control { min-height: 46px; min-width: 0; font-size: 1rem; }
.signin-card .btn { min-height: 44px; }
.signin-install { margin-top: .75rem; }
.install-guide h2 { margin: 0; font-size: 1.2rem; }
.install-guide p { margin: .75rem 0 1rem; }
.install-guide form { margin-top: .5rem; }
[data-install-app][hidden], [data-install-native][hidden] { display: none; }
@media (display-mode: standalone) { [data-install-app] { display: none !important; } }

.sandbox-otp-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.12);
}

.autocomplete-wrap {
  position: relative;
}

.autocomplete-dropdown {
  position: relative;
}

.autocomplete-menu {
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  z-index: 40;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.14);
  max-height: 260px;
  overflow-y: auto;
}

.autocomplete-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.6rem 0.8rem;
  background: #fff;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  text-align: start;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover, .autocomplete-item:focus {
  background: var(--primary-light);
}

.ac-main {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
}

.ac-sub {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--text-muted);
  width: 100%;
}

.ac-bal {
  margin-inline-start: auto;
  color: var(--primary);
  font-weight: 700;
}

.autocomplete-empty {
  padding: 0.75rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.selected-store-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: 8px;
}

.selected-store-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
  box-shadow: var(--shadow);
}

.kpi-highlight {
  border-left: 4px solid var(--primary);
  background: linear-gradient(180deg, #ffffff 0%, #f4fbf8 100%);
}

.kpi-profit {
  border-left: 4px solid var(--pos);
}

.kpi-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  margin-top: 0.25rem;
  font-variant-numeric: tabular-nums;
}

.kpi-value small {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.kpi-bar-compact {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.65rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.85rem;
  font-size: 0.88rem;
}

/* Auth & Sandbox */
.auth-wrapper {
  max-width: 460px;
  margin: 1.25rem auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.corridor-tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  margin-bottom: 0.5rem;
}

.sandbox-card {
  border: 1px dashed #d97706;
  background: #fffbeb;
}

.sandbox-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

@media (max-width: 480px) {
  .demo-grid {
    grid-template-columns: 1fr;
  }
}

.demo-account-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: start;
}

.demo-account-btn:hover {
  background: #fef3c7;
}

.demo-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.demo-phone {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sandbox-otp-reveal {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sandbox-otp-reveal code {
  font-size: 1.1rem;
  font-weight: 800;
  background: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
}

/* Forms */
.form-group {
  margin-bottom: 0.85rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.32rem;
  color: #374151;
}

.label-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 0.94rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 76, 58, 0.14);
}

.form-control-sm {
  padding: 0.38rem 0.6rem;
  font-size: 0.84rem;
}

.phone-input-group {
  display: flex;
  align-items: stretch;
}

.phone-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 0.75rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-inline-end: none;
  border-start-start-radius: 8px;
  border-end-start-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.phone-input-group .form-control {
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

.otp-row, .rate-adjust-row {
  display: flex;
  gap: 0.5rem;
}

.otp-send-btn {
  white-space: nowrap;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-row-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (max-width: 860px) {
  .form-row-4 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .form-row-2, .form-row-4 {
    grid-template-columns: 1fr;
  }
}

.segmented-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.segmented-item {
  cursor: pointer;
}

.segmented-item input {
  display: none;
}

.segmented-item span {
  display: block;
  text-align: center;
  padding: 0.55rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  background: #f8fafc;
}

.segmented-item input:checked + span {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.58rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.btn-secondary:hover:not(:disabled) {
  background: #e2e8f0;
}

.btn-danger {
  background: var(--neg);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.btn-ghost-light {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 0.76rem 1.2rem;
  font-size: 0.98rem;
}

.btn-sm {
  padding: 0.42rem 0.75rem;
  font-size: 0.82rem;
}

.btn-xs {
  padding: 0.26rem 0.55rem;
  font-size: 0.76rem;
  border-radius: 6px;
}

.btn-icon {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  color: var(--primary);
}

/* Quote Preview & Chips */
.quick-recipients {
  margin-bottom: 0.9rem;
}

.chip-list {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}

.chip-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.wallet-dot {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: #fff;
}

.wallet-bkash {
  background: #e2136e;
}

.wallet-nagad {
  background: #f7941d;
}

.quote-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.85rem;
}

.quote-box-error {
  background: var(--neg-bg);
  border-color: #f8b4b4;
}

.quote-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.quote-item {
  display: flex;
  flex-direction: column;
}

.quote-label {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.quote-val {
  font-size: 1.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.quote-primary .quote-val {
  color: var(--primary);
  font-size: 1.25rem;
}

/* Electronic Receipt Card */
.receipt-card {
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 6px 20px rgba(15, 76, 58, 0.1);
}

.receipt-header {
  text-align: center;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.75rem;
}

.receipt-brand {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.receipt-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

.receipt-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.receipt-amount-hero {
  text-align: center;
  padding: 0.95rem 0;
  background: var(--primary-light);
  border-radius: 10px;
  margin: 0.85rem 0;
}

.receipt-bdt {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
}

.receipt-bdt span {
  font-size: 0.95rem;
}

.receipt-rows {
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
  font-size: 0.88rem;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dotted #e5e7eb;
  padding-bottom: 0.32rem;
}

.receipt-footer-actions {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

/* QR & Deposit */
.qr-deposit-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.qr-svg-wrap svg {
  width: 180px;
  height: 180px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  background: #fff;
}

.address-copy-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #f8fafc;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  width: 100%;
}

.bsc-address {
  font-size: 0.8rem;
  word-break: break-all;
}

.rate-callout {
  font-size: 0.86rem;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.4rem 0.85rem;
  border-radius: 99px;
}

.conf-progress {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.76rem;
  min-width: 90px;
}

.progress-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #f59e0b;
}

.progress-fill.fill-done {
  background: var(--pos);
}

/* Tables & Badges */
.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.table th, .table td {
  padding: 0.62rem 0.65rem;
  border-bottom: 1px solid #edf2f7;
  text-align: start;
  vertical-align: middle;
}

.table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: #f8fafc;
}

.text-right {
  text-align: right !important;
}

.text-center {
  text-align: center !important;
}

.text-xs {
  font-size: 0.76rem;
}

.text-sm {
  font-size: 0.85rem;
}

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

.text-pos {
  color: var(--pos);
}

.text-neg {
  color: var(--neg);
}

.badge, .role-pill {
  display: inline-block;
  padding: 0.16rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 99px;
  background: #e2e8f0;
  color: #334155;
}

.badge-active, .badge-credited, .badge-success, .badge-settled, .badge-pos {
  background: var(--pos-bg);
  color: var(--pos);
}

.badge-confirming, .badge-pending_payout, .badge-paying, .badge-pending_audit, .badge-unsettled, .badge-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge-failed_refunded, .badge-rejected, .badge-disabled {
  background: var(--neg-bg);
  color: var(--neg);
}

.role-pill {
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
}

/* Alerts & Admin Helpers */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.9rem;
  font-size: 0.88rem;
}

.alert-success {
  background: var(--pos-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-danger {
  background: var(--neg-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.store-admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.audit-banner {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  padding: 0.75rem;
  border-radius: 8px;
  margin-top: 0.65rem;
}

.inline-adjust-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border);
}

.empty-state {
  text-align: center;
  padding: 1.75rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media print {
  .topbar, .no-print, .pwa-banner {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .receipt-card {
    box-shadow: none;
    border: 1px solid #000;
    max-width: 420px;
    margin: 0 auto;
  }
}

/* Wallet, reviews and list navigation */
.wallet-balance {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: .8rem 0 1rem;
}
.wallet-balance > strong { display: block; font-size: clamp(1.7rem, 5vw, 2.5rem); font-variant-numeric: tabular-nums; }
.wallet-balance small { font-size: .95rem; }
.wallet-balance p { margin: .4rem 0 0; color: #c5e7d9; }
.flow-card { max-width: 34rem; margin: 1rem auto; }
.flow-card .btn-block + .btn-block, .flow-card form + a { margin-top: .6rem; }
label.form-group { display: block; font-weight: 600; }
label.form-group .form-control { display: block; margin-top: .35rem; }
.entry-head, .pager { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; justify-content: space-between; }
.entry-head strong { font-variant-numeric: tabular-nums; }
.withdrawal-entry { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.withdrawal-entry:last-child { border: 0; }
.queue-list { margin-top: .8rem; max-width: 52rem; }
.facts { display: grid; grid-template-columns: minmax(5rem, .8fr) minmax(0, 1.2fr); gap: .45rem .8rem; font-size: .91rem; }
.facts dt { color: var(--text-muted); }
.facts dd { text-align: end; margin: 0; overflow-wrap: anywhere; }
.pager { justify-content: center; margin: .9rem 0 .25rem; font-size: .83rem; color: var(--text-muted); }
.badge-pending, .badge-reserved, .badge-partial { background: var(--warn-bg); color: #74420a; }
.badge-paid { background: var(--pos-bg); color: var(--pos); }
.badge-cancelled { background: #eef1f4; }
.alert, .cell-value, .receipt-row, .kpi-value { overflow-wrap: anywhere; }
.form-control, .card, .grid-2col > *, .form-group, .rate-adjust-row > input { min-width: 0; }
.row-toggle, .nav-menu-button { display: none; }
details.settings { margin-top: .7rem; border-top: 1px solid var(--border); }
details.settings > summary { cursor: pointer; color: var(--primary); padding: .7rem 0; font-weight: 600; }
@media screen and (max-width: 960px) {
  .container { padding-inline: .75rem; }
  .main-content { padding-bottom: max(1.5rem, env(safe-area-inset-bottom)); }
  .grid-2col { grid-template-columns: minmax(0, 1fr); }
  .card { padding: .9rem; }
  .table-responsive { overflow: visible; }
  .table, .table tbody { display: block; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table tbody tr { display: block; border: 1px solid var(--border); border-radius: 10px; padding: .55rem .65rem; margin: .5rem 0; }
  .table td[data-label] {
    display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.35fr);
    align-items: baseline; gap: .65rem; padding: .28rem 0; border: 0;
    font-size: .87rem; text-align: end !important;
  }
  .table td[data-label]::before {
    content: attr(data-label); font: 500 .78rem/1.45 -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-muted); text-align: start;
  }
  .table .row-enhanced:not(.expanded) td[data-label]:not([data-summary]) { display: none; }
  .table .row-toggle { display: block; border: 0; padding: 0; text-align: end; }
  .row-toggle button { background: transparent; color: var(--primary); font: inherit; font-weight: 600; border: 0; cursor: pointer; min-height: 44px; }
  .table td[colspan] { display: block; padding: .35rem; border: 0; }
  .cell-value { min-width: 0; }
  .cell-value form, .cell-value .action-btn-group { flex-wrap: wrap; justify-content: end; }
  .cell-value .badge, .chip-btn, .badge { white-space: normal; }
  .form-control, .form-control-sm { font-size: 16px; min-height: 44px; }
  .btn, .btn-xs, .btn-sm, .demo-pill-btn, .autocomplete-item { min-height: 44px; }
  .topbar-logout { display: inline-flex; align-items:center; min-height: 44px; }
  .nav-tab { flex: 1 1 auto; text-align: center; min-height: 44px; display: grid; place-items: center; white-space: normal; }
  .subnav-inner { flex-wrap: wrap; }
  .topbar.has-menu .nav-menu-button { display: inline-flex; align-items: center; min-height:44px; color:white; border:0; background:transparent; font-weight:600; }
  .topbar.has-menu .subnav { display: none; }
  .topbar.has-menu.menu-open .subnav { display:block; }
  .topbar.has-menu .subnav-inner { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .brand-user { max-width: 37vw; }
  .pager { justify-content: space-between; }
  .pager span { flex:1; text-align:center; }
  .kpi-sub:has(a) { display:block; }
  .receipt-row > *, .quote-grid > *, .kpi-grid > * { min-width:0; }
  .receipt-row { flex-wrap:wrap; }
  .rate-adjust-row { flex-wrap:wrap; }
  .rate-adjust-row input { flex:1 1 6rem; width: 6rem; }
  .entry-head { align-items: baseline; }
  .bsc-address, .alert code { word-break: break-word; }
  [id] { scroll-margin-top: 7rem; }
}
.review-dialog { border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem; color: var(--text); width: min(32rem, calc(100% - 1.5rem)); }
.review-dialog::backdrop { background: rgb(12 30 25 / 52%); }
.review-dialog form + form { margin-top: .5rem; }
@media screen and (max-width: 960px) {
  .review-dialog { margin: auto auto max(.75rem, env(safe-area-inset-bottom)); max-height: 90dvh; }
}
.flow-card form + form { margin-top: .6rem; }
.receipt-tracking { margin: .85rem 0; overflow-wrap: anywhere; }
.receipt-tracking p { margin: .35rem 0; font-size: .82rem; color: var(--text-muted); }
.progress-steps { list-style: none; padding: 0; margin: .5rem 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .35rem; }
.progress-steps li { border-top: 3px solid var(--border); padding-top: .35rem; font-size: .8rem; color: var(--text-muted); }
.progress-steps .done { border-color: var(--pos); color: var(--primary); }
.progress-steps .refunded { border-color: var(--accent); color: var(--warn); }

/* Store remittance entry */
.remit-workspace { max-width: 580px; margin: clamp(.45rem, 3vw, 2rem) auto; }
.remit-page-head, .amount-heading, .recipient-heading, .payout-preview, .rate-settings summary {
  display: flex; justify-content: space-between; align-items: center; gap: .6rem;
}
.remit-page-head { margin-bottom: 1rem; }
.remit-page-head h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 2rem); letter-spacing: -.045em; }
.available-quota { text-align: end; line-height: 1.3; }
.available-quota span, .rate-settings small, .pin-hint { font-size: .77rem; color: var(--text-muted); }
.available-quota strong { display: block; font-variant-numeric: tabular-nums; }
.remit-sheet { border: 1px solid var(--border); border-radius: 16px; background: white; padding: clamp(1rem, 4vw, 1.65rem); box-shadow: var(--shadow); }
.amount-heading > label, .recipient-phone, .rate-settings > label, .pin-label { font-size: .86rem; font-weight: 600; }
.compact-switch, .wallet-picker { display: flex; gap: .2rem; }
.compact-switch { background: #f1f5f3; padding: 3px; border-radius: 9px; }
.compact-switch label, .wallet-picker label { position: relative; cursor: pointer; }
.compact-switch input, .wallet-picker input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.compact-switch span, .wallet-picker span { display: grid; place-items:center; min-height: 38px; border-radius: 7px; padding: .35rem .85rem; color: var(--text-muted); font-weight: 600; font-size: .86rem; }
.compact-switch :checked + span { background:white; color: var(--primary); box-shadow: 0 1px 4px #132d1925; }
.compact-switch :focus-visible + span, .wallet-picker :focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px; }
.transfer-amount { width: 100%; min-width: 0; border: 0; margin: .15rem 0 .65rem; padding: .12rem 0; background:transparent; color:var(--text); font: 650 clamp(2.4rem, 8vw, 3.4rem)/1.18 -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: -.055em; }
.transfer-amount::placeholder { color: #89968e; }
.transfer-amount:focus { outline: 0; box-shadow: 0 2px var(--primary); }
.payout-preview { padding: .7rem .85rem; background: #eaf5ef; color: var(--primary); border-radius: 9px; font-size: .9rem; }
.payout-preview strong { font-size: 1.2rem; overflow-wrap:anywhere; }
.payout-preview small { font-size: .78rem; }
.quote-notice, .pin-feedback { font-size: .87rem; color:var(--neg); }
.rate-settings { margin-bottom:.85rem; border-bottom:1px solid var(--border); padding-bottom:.4rem; }
.rate-settings summary, .recent-picker summary, .shift-summary summary { cursor:pointer; font-size:.83rem; color:var(--primary); }
.rate-settings summary { min-height:44px; color:var(--text-muted); }
.rate-settings summary > :last-child::after, .recent-picker summary::after { content:"⌄"; margin-inline-start:.4rem; }
.rate-edit { display:flex; gap:.5rem; margin:.35rem 0; }
.recipient-heading h2 { margin:0; font-size:1.06rem; }
.recent-picker { position:relative; }
.recent-picker summary { list-style:none; min-height:44px; align-content:center; }
.recent-menu { position:absolute; inset-inline-end:0; z-index:3; min-width:14rem; padding:.3rem; border:1px solid var(--border); border-radius:10px; background:white; box-shadow:var(--shadow); }
.recent-menu button { display:block; width:100%; padding:.5rem; background:none; color:var(--text); border:0; text-align:start; cursor:pointer; }
.recent-menu small { display:block; color:var(--text-muted); }
.wallet-picker { gap:.45rem; margin:.55rem 0 .85rem; }
.wallet-picker label { flex:1; }
.wallet-picker span { border:1px solid var(--border); min-height:44px; }
.wallet-picker :checked + span { border-color:var(--primary); background:#f0f8f4; color:var(--primary); }
.recipient-phone { display:block; }
.recipient-phone input, .pin-input { margin-top:.25rem; }
.transfer-review-btn { margin-top:1rem; min-height:46px; }
.shift-summary { margin:.75rem .2rem; }
.shift-summary summary { padding:.45rem 0; color:var(--text-muted); }
.review-dialog { max-height: calc(100dvh - 1.5rem); overflow-y:auto; }
.review-dialog [hidden] { display:none !important; }
.pin-input { font-size:1.1rem; letter-spacing:.2em; }
.pin-label, .pin-hint { display:block; }
.pin-hint { margin-top:.35rem; }
#pin-repeat-label { margin-top:.55rem; }
#transaction-confirm button, .dialog-cancel { margin-top:.7rem; min-height:44px; }
@media(max-width:560px) {
  .remit-page-head { margin:.45rem 0 .7rem; }
}
.transaction-context { overflow-wrap:anywhere; color:var(--text-muted); }

/* Field guide for store visits */
/* Field training */
.training { max-width: 54rem; margin: .25rem auto 1.5rem; }
.training-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .8rem; }
.training-head h1 { font-size: clamp(1.5rem,4vw,2.1rem); letter-spacing: -.04em; margin: 0; }
.training-head > span { font-size: .78rem; color: var(--text-muted); white-space: nowrap; }
.training-chapters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding: 3px; gap: 2px; margin-bottom: .85rem; border-radius: 13px; background: #e5ede7; }
.training-chapters a { display: grid; place-items: center; min-height: 46px; padding: .3rem; text-align: center; line-height: 1.12; font-size: .85rem; font-weight: 620; color: #41594c; border-radius: 10px; }
.training-chapters a[aria-current] { background: #10513d; color: white; }
.lesson { overflow: hidden; background: white; border: 1px solid #dbe5df; border-radius: 17px; }
.lesson-photo { display: block; width: 100%; height: auto; max-height: 19rem; aspect-ratio: 2.05; object-fit: cover; object-position: center 50%; }
.lesson-body { padding: clamp(1rem,3vw,1.75rem); }
.lesson-body h2 { margin: 0 0 .55rem; font-size: clamp(1.22rem,3.4vw,1.65rem); letter-spacing: -.035em; line-height: 1.15; }
.lesson-body h3 { margin: 0 0 .25rem; font-size: 1rem; }
.lesson-body p { margin: .35rem 0 .65rem; line-height: 1.5; color: #42574c; }
.funds-flow { margin: 1rem 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .55rem; }
.funds-flow li { display: grid; align-content: center; align-items: center; text-align: center; min-height: 66px; padding: .45rem .2rem; position: relative; border-radius: 10px; color: #164a39; background: #e9f4ed; }
.funds-flow li:nth-child(2) { background: #f5eddc; color: #604922; }
.funds-flow li:last-child { color: #24476a; background: #e9f1f8; }
.funds-flow li+li::before { content: '›'; position: absolute; left: -.48rem; color: #66766f; }
.funds-flow strong { font-size: .9rem; }.funds-flow span { font-size: .72rem; }
.lesson-roles { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,17rem),1fr)); gap: .7rem; }
.lesson-roles > div { border-top: 1px solid #dce6df; padding-top: .7rem; }
.lesson-roles p,.visit-steps p { font-size: .9rem; }
.lesson-next { margin-top: .85rem; display: flex; justify-content: space-between; min-height: 46px; }
.visit-steps { counter-reset: visit; list-style: none; margin: 1.2rem 0 .3rem; padding: 0; }
.visit-steps > li { position: relative; counter-increment: visit; padding: 0 0 1rem 2.65rem; }
.visit-steps > li:not(:last-child)::after { content: ''; position: absolute; top: 2rem; left: .92rem; bottom: .15rem; width: 1px; background: #c9ddcf; }
.visit-steps > li::before { content: counter(visit); position: absolute; left: 0; top: -.15rem; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: #d9eee1; color: #104b35; font-weight: 700; }
.visit-steps > li:last-child { padding-bottom: 0; }
.approval-flow,.lesson-footer { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.approval-flow { margin: .45rem 0; font-size: .73rem; }.approval-flow span { background: #eff5ef; border-radius: .35rem; padding: .3rem .4rem; }.approval-flow b { color: #73877a; }
.lesson-link,.lesson-footer a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; }
.lesson-practice,.lesson-terms { background: #f4f7f4; border-radius: .65rem; padding: 0 .8rem; }
.lesson-practice summary,.lesson-terms summary { padding: .8rem 0; cursor: pointer; color: var(--primary); font-weight: 650; }
.lesson-practice [data-transfer-practice],.lesson-terms dl { padding-bottom: .8rem; }
.lesson-terms .facts dd { overflow-wrap: anywhere; }
.estimate-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; margin-block: 1rem; }
.estimate-form label { display: grid; align-content: end; gap: .25rem; font-size: .82rem; font-weight: 600; }
.estimate-form button { grid-column: 1/-1; min-height: 46px; }
.estimate-card { padding: 1.1rem; background: #104c39; color: white; border-radius: 13px; margin: .75rem 0; }
.estimate-card > span { color: #d5eadc; font-size: .84rem; }.estimate-card > strong { display: block; margin: .28rem 0 .75rem; font-size: clamp(1.65rem,5vw,2.25rem); line-height: 1.15; overflow-wrap: anywhere; }
.estimate-card small { font-size: .9rem; font-weight: 550; }.estimate-card dl { margin: .75rem 0 .35rem; }
.estimate-card dl > div { display: flex; justify-content: space-between; gap: .4rem; margin-top: .25rem; font-size: .86rem; }
.estimate-card dd { margin: 0; text-align: end; font-variant-numeric: tabular-nums; }
.estimate-card p { color: #d6e8db; margin: .55rem 0 0; font-size: .76rem; }
.earning-split { display: flex; width: 100%; height: .45rem; border-radius: .5rem; overflow: hidden; background: #a1d8b4; }
.earning-split i { background: #ffce70; }.estimate-card dt::before { content: ''; display: inline-block; width: .5rem; height: .5rem; margin-inline-end: .4rem; border-radius: 50%; background: #ffce70; }.estimate-card dl div+div dt::before { background: #a1d8b4; }
.lesson-footer { justify-content: space-between; margin-top: .55rem; font-size: .84rem; }


/* Store and field-agent performance */
.dashboard-head, .dashboard-balance, .activity-heading, .trend-readout {
  display: flex; align-items: center; justify-content: space-between; gap: .65rem; flex-wrap: wrap;
}
.dashboard-head { margin: .3rem 0 1rem; }
.dashboard-head h1 { margin: 0; font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.2; letter-spacing: -.035em; }
.dashboard-head p { margin: .2rem 0 0; color: var(--text-muted); font-size: .9rem; }
.activity-dashboard { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.activity-card, .dashboard-balance { padding: clamp(.9rem, 2.5vw, 1.4rem); border: 1px solid var(--border); border-radius: 14px; background: white; }
.activity-card { min-width: 0; }
.activity-heading { margin-bottom: .85rem; }
.activity-heading h2 { margin: 0; font-size: 1.1rem; }
.activity-heading > span, .activity-note, .trend-scale { color: var(--text-muted); font-size: .79rem; }
.period-switch { display: flex; border: 0; gap: .12rem; margin: 0; padding: .16rem; background: #edf2ef; border-radius: 10px; }
.period-switch label { position: relative; cursor: pointer; }
.period-switch input { position: absolute; opacity: 0; }
.period-switch span { min-height: 40px; padding: .35rem .72rem; display: grid; place-items: center; color: #486156; font-size: .8rem; font-weight: 650; border-radius: 8px; }
.period-switch :checked + span { background: white; color: var(--primary); box-shadow: 0 1px 4px #0f4c3a22; }
.period-switch :focus-visible + span { outline: 2px solid var(--primary); }
.activity-card:has(.period-switch [value="today"]:checked) [data-period="total"],
.activity-card:has(.period-switch [value="total"]:checked) [data-period="today"] { display: none; }
.metric-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; }
.metric-card { min-width: 0; padding: .85rem; border: 1px solid #dfebe5; border-radius: 12px; background: #f5f9f7; }
.metric-card:first-child { background: var(--primary); color: white; border-color: var(--primary); }
.metric-card:first-child:nth-last-child(3) { grid-column: 1 / -1; }
.metric-card h3 { margin: 0 0 .5rem; font-size: .83rem; font-weight: 550; }
.metric-card p { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem; }
.metric-card strong { min-width: 0; font-size: clamp(1.18rem,2.3vw,1.65rem); letter-spacing: -.035em; line-height: 1.1; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.metric-card small { font-size: .7rem; color: #53695e; }
.metric-card:first-child small { color: #cde8d7; }
.metric-info { margin-top: .6rem; color: var(--text-muted); font-size: .76rem; }
.metric-info summary { cursor: pointer; width: fit-content; padding: .36rem 0; }
.metric-info p { margin: .1rem 0 .3rem; }
.trend-select { margin-bottom: .65rem; }
.trend-scale { min-height: 1.3rem; font-variant-numeric: tabular-nums; }
.trend-plot { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.trend-day { display: grid; position: relative; min-width: 0; text-align: center; cursor: pointer; }
.trend-day input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.trend-track { height: 6rem; display: flex; justify-content: center; align-items: end; border-block: 1px solid #dce5e0;
  background: linear-gradient(to bottom, transparent 49%, #edf2ef 50%, transparent 51%); }
.trend-bar { display: block; width: 48%; max-width: 2rem; border-radius: 3px 3px 0 0; background: #86ac9c; }
.trend-tick { min-height: 1.65rem; font-size: .76rem; padding-top: .2rem; color: var(--text-muted); }
.trend-day :checked + .trend-track { background-color: #edf6f1; }
.trend-day :checked + .trend-track .trend-bar { background: var(--primary); }
.trend-day :checked ~ .trend-tick { color: var(--primary); font-weight: bold; }
.trend-day :focus-visible + .trend-track { outline: 2px solid var(--primary); outline-offset: -2px; }
.trend-readout { margin-top: .45rem; font-size: .9rem; font-variant-numeric: tabular-nums; }
.trend-readout span { color: var(--text-muted); }
.trend-readout strong { overflow-wrap: anywhere; }
.dashboard-balance { margin: .85rem 0 1.2rem; }
.dashboard-balance > div { min-width: 0; text-align: start; overflow-wrap: anywhere; }
.dashboard-balance > div > span { color: var(--text-muted); font-size: .82rem; }
.dashboard-balance > div > strong { display: block; font-size: 1.18rem; font-variant-numeric: tabular-nums; }
.earnings-breakdown { width: 100%; border-top: 1px solid var(--border); }
.earnings-breakdown summary { padding: .65rem 0 0; color: var(--primary); cursor: pointer; font-size: .87rem; }
@media(max-width: 740px) {
  .activity-dashboard { grid-template-columns: minmax(0,1fr); gap: .65rem; }
  .dashboard-head { margin-bottom: .75rem; }
}

.shell-menu { position: relative; }
.shell-menu > summary { cursor: pointer; list-style: none; }
.shell-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary { display: flex; align-items: center; min-height: 44px; font-size: .82rem; font-weight: 600; gap: .35rem; }
.account-menu > summary::after { content: "▾"; }
.shell-popover { position: absolute; z-index: 55; inset-inline-end: 0; top: 100%; display: grid; width: max-content; min-width: 10rem; max-width: min(20rem,90vw); padding: .35rem; border-radius: 10px; background: white; color: var(--text); border: 1px solid var(--border); box-shadow: 0 .35rem 1.5rem #142c2428; }
.shell-popover a, .shell-popover button, .shell-popover > strong { text-align: start; display: flex; align-items: center; overflow-wrap: anywhere; padding: .55rem .7rem; min-height: 44px; border: 0; font: inherit; font-size: .88rem; color: var(--text); background: transparent; }
.shell-popover > strong { font-weight: 650; border-bottom: 1px solid var(--border); }
.shell-popover a:hover, .shell-popover button:hover, .shell-popover a.active { background: var(--primary-light); color: var(--primary); }
.more-tab, .mobile-filter { display: none; }
@media screen and (max-width: 960px) {
  .topbar-inner { height: 46px; }
  .brand { flex: 1; }
  .brand-user { max-width: none; }
  .brand-badge { color: #e4f4ea; background: #ffffff17; border: 1px solid #ffffff3b; font-size: .66rem; }
  :root { --mobile-nav-height: calc(62px + env(safe-area-inset-bottom, 0px)); }
  .subnav { position: fixed; z-index: 45; inset: auto 0 0; background: white; padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); border-top: 1px solid #dbe5df; box-shadow: 0 -3px 16px #173d2c0c; }
  .subnav .subnav-inner { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .12rem; padding: 0 .3rem; overflow: visible; }
  .subnav .nav-tab { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; width: 100%; min-width: 0; height: 61px; margin: 0; padding: 0; border: 0; background: transparent; color: #506159; font-family: inherit; font-size: .76rem; font-weight: 600; line-height: 1.1; white-space: nowrap; touch-action: manipulation; }
  .subnav .wide-tab { display: none; }
  .subnav .tab-glyph { position: relative; display: grid; place-items: center; width: 48px; height: 29px; border-radius: 18px; }
  .subnav .workspace-icon { display: block; width: 22px; height: 22px; }
  .subnav .nav-tab.active { color: #0b513a; }
  .subnav .active .tab-glyph { background: #d6efdf; }
  .subnav .nav-tab:active .tab-glyph { background: #e4f0ea; }
  .subnav .nav-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: -3px; }
  body:has(#workspace-nav) .main-content { padding-bottom: calc(var(--mobile-nav-height) + 1rem); }
  html { scroll-padding-block: 52px calc(var(--mobile-nav-height) + .6rem); }
  html.keyboard-open #workspace-nav { display: none; }
  html.keyboard-open body .main-content { padding-bottom: .75rem; }
  [id] { scroll-margin-top: .4rem; }
  .mobile-filter { display: block; width: 100%; }
  .filter-has-select { display: none; }
  .dashboard-head { gap: .5rem; }
  .metric-card { padding: .62rem .68rem; }
}

.messaging-home { align-items: start; }
.inbox-entry, .desk-contact { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.inbox-entry { color: var(--text); display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: baseline; gap: .2rem .5rem; }
.inbox-entry strong, .desk-contact strong { overflow-wrap: anywhere; }
.inbox-entry small { color: var(--primary); }
.inbox-entry span, .inbox-entry time { grid-column: 1/-1; font-size: .85rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-entry time { font-size: .73rem; }
.desk-contact { display: grid; gap: .35rem; }
.desk-contact > span, .chat-back { font-size: .85rem; }
.chat-room { max-width: 42rem; margin: 0 auto; }
.chat-back { display: inline-flex; min-height: 44px; align-items: center; }
.chat-room h1 { overflow-wrap: anywhere; }
.chat-transcript { height: min(49dvh, 32rem); min-height: 8rem; overflow-y: auto; padding: .7rem; background: #f4f7f5; border-radius: .6rem; margin: .65rem 0; }
[data-chat-log] { display: flex; flex-direction: column; gap: .55rem; }
.chat-bubble { align-self: start; max-width: 88%; min-width: 0; padding: .45rem .65rem; background: white; border: 1px solid var(--border); border-radius: .7rem; overflow-wrap: anywhere; }
.chat-bubble.mine { align-self: end; background: #e6f2ec; }
.chat-bubble small { color: var(--text-muted); font-size: .71rem; }
.chat-bubble p { white-space: pre-wrap; margin: .18rem 0 0; }
.chat-composer { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .35rem .5rem; align-items: end; }
.chat-composer label { grid-column: 1/-1; font-size: .8rem; }
.chat-composer textarea { resize: vertical; }
.chat-status:empty { display: none; }
.chat-status { font-size: .83rem; }
[data-chat-older][hidden] { display: none; }
.review-queue a { display: flex; gap: .7rem; justify-content: space-between; align-items: center; min-height: 48px; border-top: 1px solid var(--border); }
.admin-tool { align-self: start; min-width: 0; }
.admin-tool > summary { cursor: pointer; font-weight: 650; padding: .3rem 0; }
.admin-tool[open] > summary { margin-bottom: .85rem; }
.unread-badge { display: inline-block; border-radius: 1rem; padding: .08rem .35rem; min-width: 1.15rem; text-align: center; background: #ac2828; color: white; font-size: .66rem; font-weight: 700; line-height: 1rem; }
.unread-badge[hidden] { display: none; }
.nav-tab:has([data-unread-badge]) { position: relative; }
.nav-tab [data-unread-badge] { margin-inline-start: .25rem; }
.inbox-entry strong .unread-badge { display: inline-block; color: white; font-size: .68rem; vertical-align: middle; }
.push-settings { margin: 1rem 0; }
.push-settings small { display: block; color: var(--text-muted); }
@media screen and (max-width: 960px) {
  .nav-tab [data-unread-badge] { position: absolute; inset: -2px -5px auto auto; }
}

.workspace-icon { display: none; }
.dashboard-history { margin-block: .65rem; }
.dashboard-history > summary { cursor: pointer; font-weight: 650; padding: .35rem 0; }
.dashboard-history > summary span { margin-inline-start: .45rem; color: var(--text-muted); font-size: .8rem; font-weight: 450; }
.dashboard-history[open] > summary { margin-bottom: .7rem; }
.queue-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }
.review-queue .queue-head a { display: inline; border: 0; padding: .45rem 0; font-size: .82rem; }
.queue-counts { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,5.5rem),1fr)); gap: .5rem; }
.review-queue .queue-counts a { display: flex; flex-direction: column-reverse; align-items: flex-start; justify-content: flex-end; gap: .25rem; padding: .8rem; border: 1px solid #dbe8e1; border-radius: 9px; background: #f4f9f6; }
.queue-counts a strong { color: var(--primary); font-size: 1.55rem; line-height: 1.1; }
.queue-counts a span { color: #485c52; font-size: .8rem; }


.workspace-sheet { position: fixed; inset: auto 0 0; width: min(100%, 32rem); max-width: none; max-height: 80dvh; margin: 0 auto; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom)); border: 0; border-radius: 20px 20px 0 0; color: var(--text); background: white; }
.workspace-sheet::backdrop { background: #122b225c; }
body:has(.workspace-sheet[open]) { overflow: hidden; }
.workspace-sheet header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.workspace-sheet h2 { margin: 0; font-size: 1.17rem; }
.workspace-sheet header button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: #f0f5f2; font-size: 1.4rem; color: var(--primary); }
.workspace-sheet .nav-tab { display: flex; align-items: center; min-height: 54px; padding: .55rem .7rem; gap: .75rem; color: var(--text); text-align: start; border: 0; border-radius: 10px; }
.workspace-sheet .nav-tab.active { background: #e8f5ec; color: var(--primary); }
.workspace-sheet .nav-tab::after { content: ""; width: .48rem; height: .48rem; border: solid #809087; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); margin-inline: auto .25rem; }
.workspace-sheet .workspace-icon { display: block; width: 21px; height: 21px; color: var(--primary); }
@media print { .workspace-sheet { display: none; } }

/* Chat and the official support library */
.chat-event { display: flex; flex-direction: column; gap: .35rem; }
.chat-photo { display: block; width: min(11rem, 100%); height: 8.5rem; object-fit: contain; border-radius: .5rem; background: #f2f4f3; margin-top: .3rem; }
.chat-bubble.automated { border-left: 3px solid var(--primary); }
.chat-faq { margin: .5rem 0; background: #edf5f0; border-radius: .65rem; padding: 0 .75rem; color: var(--primary); }
.chat-faq summary, .help-settings summary { padding: .65rem 0; cursor: pointer; font-weight: 650; }
.chat-faq button, .chat-faq a { display: block; width: 100%; padding: .55rem .25rem; min-height: 42px; background: transparent; border: 0; border-top: 1px solid #cfdfd6; text-align: start; font: inherit; color: var(--primary); cursor: pointer; }
.chat-help-link { display: inline-flex; align-items: center; min-height: 40px; }
.chat-composer { display: flex; flex-direction: column; align-items: stretch; gap: .45rem; }
.chat-toolbar, .chat-preview { display: flex; align-items: center; gap: .45rem; }
.chat-toolbar button, .emoji-picker button { min-width: 44px; min-height: 44px; }
.chat-toolbar [type=submit] { margin-inline-start: auto; }
.chat-toolbar [data-emoji-toggle] { font-size: 1.3rem; padding: 0 .6rem; }
.chat-preview span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .82rem; }
.chat-preview img { object-fit: cover; border-radius: 6px; }
.chat-room [hidden] { display: none !important; }
.emoji-picker { display: grid; grid-template-columns: repeat(auto-fit,minmax(44px,1fr)); padding: .25rem; border: 1px solid var(--border); border-radius: .6rem; }
.emoji-picker button { border: 0; background: transparent; cursor: pointer; border-radius: .4rem; font-size: 1.25rem; }
.emoji-picker button:hover { background: var(--primary-light); }
.help-page { max-width: 46rem; margin: 0 auto; }
.help-tabs { display: flex; gap: 1.25rem; border-bottom: 1px solid var(--border); }
.help-tabs a { padding: .5rem .1rem; color: var(--text-muted); min-height: 44px; }
.help-tabs a[aria-current] { color: var(--primary); font-weight: 700; border-bottom: 3px solid var(--primary); }
.help-search { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr) auto; gap: .45rem; margin: 1rem 0; }
.help-search select, .help-search button { min-height: 44px; }
.help-answer, .help-manage-row { border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.help-answer summary, .help-manage-row { cursor: pointer; padding: .8rem 1.25rem .8rem 0; position: relative; }
.help-answer summary { display: block; list-style: none; }
.help-answer summary::-webkit-details-marker { display: none; }
.help-answer summary::after { content: '+'; position: absolute; right: .1rem; top: 50%; transform: translateY(-50%); color: var(--primary); }
.help-answer[open] summary::after { content: '−'; }
.help-answer small, .help-manage-row small { display: block; color: var(--text-muted); }
.help-answer p { white-space: pre-wrap; margin: 0 0 1rem; }
.help-manage-row, .help-list-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.help-manage-row { padding-right: .1rem; }
.help-list-head .card-title { margin: 0; }
.help-list-head { margin-bottom: .75rem; flex-wrap: wrap; }
.help-form { display: grid; gap: .65rem; }
.help-form label { overflow-wrap: anywhere; }
.help-form .form-group { margin: 0; }
.help-form input[type=checkbox] { accent-color: var(--primary); }
.help-form > button { justify-self: start; }
.help-form label:has([type=checkbox]) { display: flex; align-items: center; gap: .4rem; min-height: 40px; }
.help-settings summary small { float: right; color: var(--primary); }
.help-settings .help-form { padding: .4rem 0; }
@media(max-width: 560px) {
  .help-search { grid-template-columns: minmax(0,1fr) auto; }
  .help-search input[type=search] { grid-column: 1/-1; }
}
.chat-record-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.record-card { min-width: 0; display: grid; gap: .16rem; overflow-wrap: anywhere; }
.record-card small, .record-state { color: var(--text-muted); font-size: .78rem; }
.record-card strong { font-size: 1.05rem; color: var(--primary); }
.record-card.pinned { background: var(--primary-light); padding: .65rem .8rem; border-radius: .65rem; margin: .4rem 0; }
.record-ref { font: .82rem ui-monospace,monospace; }
.record-result { display: flex; justify-content: space-between; align-items: center; gap: .65rem; padding: .7rem 0; border-top: 1px solid var(--border); }
.record-result button, .discuss-action button { min-height: 40px; }
.discuss-action { display: inline-block; margin: .2rem 0; }
.chat-composer textarea { font: inherit; }
.inbox-entry .inbox-topic { color: var(--primary); font-weight: 600; }
.field-contact-bar { display: flex; align-items: center; justify-content: space-between; gap: .65rem; background: var(--surface); border: 1px solid var(--border); border-radius: .7rem; margin-bottom: 1rem; padding: .7rem .9rem; }
.field-contact-bar span { min-width: 0; overflow-wrap: anywhere; }
.field-contact-bar small { display: block; color: var(--text-muted); }

.workspace-picker { flex: none; }
.workspace-picker summary { display: grid; align-items: center; min-width: 44px; min-height: 44px; }
.workspace-picker .shell-popover { inset-inline: 0 auto; }
.account-roles { margin: 0 0 1rem; border: 0; padding: 0; min-width: 0; }
.account-role-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: .4rem; }
.account-role-options label { display: flex; align-items: center; gap: .5rem; padding: .5rem; min-height: 44px; cursor: pointer; border: 1px solid var(--border); border-radius: 8px; }
.account-role-options label:has(:checked) { background: var(--primary-light); border-color: var(--primary); }
.account-role-options input { accent-color: var(--primary); }
.account-roles small { color: var(--text-muted); }

.messenger-home { max-width: 43rem; margin: 0 auto; padding: .9rem clamp(.7rem, 3vw, 1.4rem); background: white; border-radius: 1rem; }
.messenger-home [hidden] { display: none; }
.messenger-heading, .chat-sheet header { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.messenger-heading h1, .room-bar h1, .chat-sheet h2 { margin: 0; line-height: 1.2; }
.messenger-heading h1 { font-size: 1.55rem; }
.chat-action { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; color: var(--primary); background: transparent; cursor: pointer; }
.shell-menu > summary.chat-action { display: grid; place-items: center; }
.messenger-menu small:not(:empty) { max-width: 16rem; padding: .5rem; }
.messenger-tabs { display: flex; gap: 1.25rem; margin: .5rem 0 0; border-bottom: 1px solid var(--border); }
.messenger-tabs a { display: grid; align-items: center; min-height: 44px; font-weight: 600; color: var(--text-muted); }
.messenger-tabs a[aria-current] { border-bottom: 3px solid var(--primary); color: var(--primary); }
.conversation-row, .contact-row { display: flex; align-items: center; gap: .7rem; min-width: 0; width: 100%; padding: .85rem 0; text-align: start; background: transparent; color: var(--text); border: 0; border-bottom: 1px solid #e8edea; font: inherit; }
button.contact-row { cursor: pointer; }
.chat-avatar { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; font-size: .88rem; font-weight: 750; color: #174f41; background: #d9ece3; }
.chat-avatar.tone-1 { color: #644224; background: #f7e8d1; }
.chat-avatar.tone-2 { color: #364d76; background: #e1e9fa; }
.chat-avatar.tone-3 { color: #68405f; background: #f2e2f0; }
.chat-avatar.tone-4 { color: #465c24; background: #e8edcc; }
.conversation-copy, .contact-row > :nth-child(2) { flex: 1; min-width: 0; }
.conversation-copy > *, .contact-row small, .contact-row strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conversation-copy span, .contact-row small, .conversation-meta time { color: var(--text-muted); font-size: .83rem; }
.conversation-copy small { color: var(--primary); }
.conversation-meta { display: grid; justify-items: end; gap: .3rem; }
.contact-actions { display: flex; align-items: center; gap: .3rem; }
.contact-actions button, .contact-actions a { display: inline-grid; place-items: center; min-height: 44px; min-width: 44px; color: var(--primary); cursor: pointer; font-size: .8rem; border: 0; background: transparent; }
.chat-empty-state { display: grid; justify-items: center; gap: .65rem; text-align: center; color: var(--text-muted); padding: 3rem .6rem; }
.messenger-page { padding: 0; }
.messenger-page .main-content { width: 100%; max-width: 46rem; margin: 0 auto; padding: 0; }
.messenger-room { display: flex; flex-direction: column; position: relative; height: 100vh; height: 100dvh; max-width: none; background: white; box-shadow: 0 0 0 1px var(--border); overflow: hidden; }
.room-bar { display: flex; align-items: center; gap: .6rem; flex: none; padding: max(.5rem,env(safe-area-inset-top)) .65rem .5rem; }
.room-bar h1 { font-size: 1.05rem; overflow-wrap: anywhere; }
.room-bar .chat-avatar { width: 38px; height: 38px; }
.room-bar small { color: var(--text-muted); }
.messenger-room .chat-transcript { margin: 0; border-radius: 0; flex: 1; min-height: 0; padding: 1rem .7rem; overflow-y: auto; overscroll-behavior: contain; background: #f0f4ef; }
.message-line { display: flex; align-items: flex-end; gap: .35rem; }
.message-line .chat-avatar { width: 28px; height: 28px; font-size: .64rem; }
.message-line.outgoing { flex-direction: row-reverse; }
.message-line .chat-bubble { max-width: min(78%, 28rem); border-radius: .85rem .85rem .85rem .2rem; }
.message-line.outgoing .chat-bubble { background: #d8efdb; border-radius: .85rem .85rem .2rem .85rem; }
.messenger-room .pinned { margin: 0; max-height: 28dvh; overflow-y: auto; }
.messenger-room .pinned summary { cursor: pointer; min-height: 40px; padding: .5rem; font-size: .85rem; }
.messenger-room .chat-status:not(:empty) { padding: .35rem .8rem; margin: 0; }
.messenger-room .chat-composer { position: relative; padding: .4rem .45rem max(.4rem,env(safe-area-inset-bottom)); flex: none; }
.composer-line, .compose-field { display: flex; align-items: end; gap: .2rem; }
.compose-field { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 1.35rem; background: #f5f7f5; }
.compose-field textarea { min-width: 0; width: 100%; max-height: 7rem; min-height: 44px; line-height: 1.35; padding: .7rem 0 .55rem .8rem; border: 0; border-radius: 1rem; background: transparent; resize: none; field-sizing: content; }
.chat-action.chat-send { background: var(--primary); color: white; }
.chat-send:disabled { opacity: .6; }
.chat-sheet { width: min(26rem, calc(100% - 1rem)); max-height: 76dvh; border: 0; border-radius: 1rem; padding: 1rem; color: var(--text); margin: auto; overflow: auto; }
.chat-sheet::backdrop { background: #17342966; }
.chat-sheet h2 { font-size: 1.09rem; }
.tool-option { display: flex; gap: .65rem; align-items: center; width: 100%; min-height: 46px; border: 0; background: white; font: inherit; color: var(--primary); cursor: pointer; text-align: start; }
.photo-viewer img { display: block; max-width: 100%; max-height: 62dvh; margin: auto; }
.photo-viewer form { text-align: end; }
.new-chat-pill { position: absolute; inset-inline-end: 1rem; bottom: 5.2rem; background: white; color: var(--primary); padding: .5rem .8rem; border: 1px solid var(--border); border-radius: 2rem; cursor: pointer; }
@media (max-width: 600px) {
  .messenger-home { padding-inline: .65rem; }
  #chat-tools { margin: auto auto 0; width: 100%; max-width: none; padding-bottom: max(1rem,env(safe-area-inset-bottom)); border-radius: 1rem 1rem 0 0; }
}

.store-photo { border: 0; margin: .8rem 0; padding: 0; min-width: 0; }
.photo-controls { display: flex; flex-wrap: wrap; gap: .45rem; }
.store-photo .btn { position: relative; min-height: 44px; }
.photo-file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.store-photo label:focus-within { outline: 2px solid var(--primary); }
.store-thumbnail { display: block; width: 100%; max-height: 13rem; object-fit: contain; margin-bottom: .65rem; border-radius: .65rem; background: #f1f4f1; }
.store-photo [hidden] { display: none; }
.store-camera video { width: 100%; max-height: 52dvh; display: block; background: #172822; margin: .55rem 0; object-fit: contain; }
.native-capture { margin-top: .5rem; }
.store-photo small { display: block; color: var(--text-muted); }
