﻿:root {
  color-scheme: light;
  --sticky-command-offset: 0px;
  --sticky-command-panel-height: 0px;
  --command-dock-max-height: none;
  --people-panel-width: 290px;
  --ink: #19201d;
  --muted: #5c6760;
  --line: #d9ded8;
  --panel: #f7f8f4;
  --paper: #ffffff;
  --green: #d9f2de;
  --red: #ffe0df;
  --yellow: #fff1ad;
  --teal: #0f766e;
  --blue: #284f8f;
  --popup-layer: 50;
  --dialog-layer: 100;
}

/* Native Android information architecture: one ledger, contextual sheets, separate settings. */
@media (max-width: 720px) {
  .native-android body {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .native-android .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    gap: 8px;
    align-items: center;
  }

  .native-android .android-app-bar-action {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f4f2;
    color: var(--ink);
  }

  .native-android .android-app-bar-action svg {
    width: 22px;
    height: 22px;
  }

  .native-android .sheet-panel > .command-tools-panel {
    display: none;
  }

  .native-android .android-ledger-filter {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-color: #a9bfe3;
    background: #e8f0fb;
    color: var(--blue);
    font-weight: 700;
  }

  .native-android .android-ledger-filter svg {
    width: 20px;
    height: 20px;
  }

  .native-android .android-tool-sheet[open] {
    position: fixed;
    inset: auto 0 0;
    z-index: 140;
    width: 100%;
    max-width: none;
    max-height: min(88dvh, 900px);
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 16px 16px 0 0;
    background: white;
    overflow: hidden;
  }

  .native-android .android-tool-sheet::backdrop {
    background: rgba(25, 32, 29, 0.48);
  }

  .native-android .android-tool-sheet-frame {
    max-height: min(88dvh, 900px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    padding: 8px 12px calc(14px + env(safe-area-inset-bottom));
  }

  .native-android .android-tool-sheet-body {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
  }

  .native-android .android-tool-sheet .command-tool-content {
    margin: 0;
    padding: 4px 2px 12px;
    border: 0;
    box-shadow: none;
  }

  .native-android .android-tool-sheet .android-view-heading {
    display: none;
  }

  .native-android body[data-android-view="settings"] .command-dock {
    display: none;
  }

  .native-android body[data-android-view="settings"] .app-shell {
    min-height: 100dvh;
  }

  .native-android body[data-android-view="settings"] .android-settings-view {
    min-height: 100dvh;
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .native-android .android-settings-view #settingsForm {
    min-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .native-android .android-people-fab {
    bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .native-android .list-footer-right {
    margin-right: 68px;
  }
}

@media (max-width: 720px) {
  .native-android body {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .native-android .android-people-fab {
    bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .native-android .list-tools {
    width: 100%;
    display: block;
    overflow: visible;
  }

  .native-android .list-tools-right {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 8px;
    margin: 0;
  }

  .native-android .list-tools-right > button {
    width: 100%;
    min-width: 0;
    padding-inline: 12px;
  }

  .native-android .list-tools-right > label {
    grid-column: 1 / -1;
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
  }

  .native-android .list-tools-right select {
    width: 100%;
    min-width: 0;
  }

  .native-android .filter-save-bar:not([hidden]) {
    margin-bottom: 8px;
  }
}

/* Capacitor Android shell: preserve the desktop information density while making
   touch targets and modal layouts comfortable on narrow phone screens. */
.native-android body {
  overscroll-behavior-y: none;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.native-android label:has(#endpointInput),
.native-android #openSheetButton {
  display: none !important;
}

@media (max-width: 720px) {
  .native-android button,
  .native-android select,
  .native-android input:not([type="checkbox"]):not([type="radio"]) {
    min-height: 44px;
  }

  .native-android .app-shell,
  .native-android .layout,
  .native-android .main-layout {
    width: 100%;
    max-width: none;
  }

  .native-android .modal-card,
  .native-android .settings-modal-card {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .native-android .ledger-scroll,
  .native-android .table-wrap {
    -webkit-overflow-scrolling: touch;
  }
}

* { box-sizing: border-box; }

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, "Noto Sans Arabic", sans-serif;
  background: #eef2ee;
  color: var(--ink);
}

body.resizing-layout {
  cursor: col-resize;
  user-select: none;
}

body.resizing-layout:not(.resizing-column) {
  cursor: col-resize;
}

button, input, select, textarea {
  font: inherit;
}

.app-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  gap: 16px;
}

body.ledger-expanded .app-shell {
  width: 100%;
  max-width: none;
}

.command-panel, .command-tools-panel, .workspace, .sheet-panel, .people-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.command-dock {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  gap: 0;
  min-width: 0;
  max-height: var(--command-dock-max-height);
  overflow: auto;
  box-shadow: 0 2px 8px rgba(25, 32, 29, 0.1);
}

.resize-handle {
  position: relative;
  z-index: 8;
  background: transparent;
  touch-action: none;
}

.resize-handle::before {
  content: "";
  position: absolute;
  background: #c6d2ca;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.resize-handle:hover::before,
.resize-handle:focus-visible::before,
body.resizing-layout .resize-handle::before {
  background: var(--blue);
  box-shadow: 0 0 0 2px rgba(40, 79, 143, 0.14);
}

.resize-handle-horizontal {
  height: 10px;
  margin: -3px 0;
  cursor: row-resize;
}

.resize-handle-horizontal::before {
  left: 12px;
  right: 12px;
  top: 4px;
  height: 2px;
}

.resize-handle-vertical {
  width: 10px;
  min-width: 10px;
  margin: 0 -5px;
  cursor: col-resize;
}

.resize-handle-vertical::before {
  top: 14px;
  bottom: 14px;
  left: 4px;
  width: 2px;
}

.command-panel,
.command-tools-panel {
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

.command-panel {
  border-radius: 8px;
}

.command-tools-panel {
  position: relative;
  z-index: 6;
  padding: 0 0 12px;
  border: 0;
  border-radius: 0;
}

.topbar, .sheet-head, .panel-head, .command-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head {
  min-width: 0;
}

.panel-head h2 {
  flex: 1 1 auto;
  min-width: 0;
}

.people-actions {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 4px;
}

.people-actions button {
  min-width: 0;
  min-height: 36px;
  padding: 0 8px;
  font-size: 13px;
}

.menu-button {
  width: 36px;
  flex: 0 0 36px;
  padding: 0;
  font-size: 18px;
}

.menu-button svg {
  width: 18px;
  height: 18px;
  display: block;
  margin: auto;
}

.people-menu {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: var(--popup-layer);
  min-width: 160px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 14px 32px rgba(25, 32, 29, 0.16);
}

.people-menu[hidden] {
  display: none;
}

.confirm-dialog {
  z-index: var(--dialog-layer);
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.confirm-dialog::backdrop {
  background: rgba(25, 32, 29, 0.42);
}

.confirm-dialog h2 {
  margin-bottom: 8px;
}

.confirm-dialog p {
  color: var(--muted);
}

.dialog-field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.edit-conversion-switch {
  margin-top: 14px;
}

.confirm-dialog label.edit-conversion-switch {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  cursor: pointer;
}

.edit-conversion-options {
  margin-top: 10px;
  padding: 0 12px 12px;
  border: 1px solid #bdd3f3;
  border-radius: 6px;
  background: #f5f9ff;
}

.edit-conversion-options[hidden],
#editEquivalenceFields[hidden],
#editManualDayRateFields[hidden] {
  display: none;
}

.dialog-error {
  display: block;
  margin-top: 8px;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
}

.dialog-error[hidden] {
  display: none;
}

.person-choice-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  max-height: 260px;
  overflow: auto;
}

.person-choice {
  min-height: 42px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9faf8;
  cursor: pointer;
  text-align: left;
}

.person-choice input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal);
}

.person-choice.selected {
  background: #e3ece9;
  border-color: #0f766e;
}

.backup-import-dialog {
  width: min(520px, calc(100vw - 32px));
}

.backup-person-preview {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 52px;
  padding: 8px 12px;
  cursor: default;
}

.backup-person-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.backup-person-info span {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.backup-person-info small {
  color: var(--muted);
  font-size: 12px;
}

.backup-person-preview strong {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.selection-count {
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.merge-confirmation-names {
  margin-top: 14px;
  color: var(--ink) !important;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1, h2 {
  margin: 0;
  line-height: 1.1;
}

h1 { font-size: clamp(24px, 3vw, 34px); }
h2 { font-size: 22px; }

.icon-button {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--teal);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-button.listening {
  background: #b42318;
}

.voice-stop-icon {
  display: none;
  width: 15px;
  height: 15px;
  border-radius: 2px;
  background: currentColor;
}

.icon-button.openai-listening .mic-icon {
  display: none;
}

.icon-button.openai-listening .voice-stop-icon {
  display: block;
}

.mic-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.command-card label, .settings-dialog label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.command-row {
  margin-top: 4px;
}

.command-row[hidden],
.voice-listening-indicator[hidden] {
  display: none;
}

.voice-listening-indicator {
  min-height: 46px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.listening-dots {
  display: inline-flex;
  min-width: 20px;
}

.listening-dots span {
  display: inline-block;
  animation: listening-dot-bounce 900ms ease-in-out infinite;
}

.listening-dots span:nth-child(2) { animation-delay: 150ms; }
.listening-dots span:nth-child(3) { animation-delay: 300ms; }

@keyframes listening-dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.command-row input {
  min-width: 0;
  flex: 1 1 auto;
}

#runCommand {
  flex: 0 0 auto;
}

input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
}

input, select {
  padding: 0 12px;
}

textarea {
  min-height: 86px;
  padding: 10px 12px;
  line-height: 1.45;
  resize: vertical;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: #f9faf8;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

#runCommand, #syncButton, #saveEditModeButton, #saveTransactionEdit, #confirmBackupImport {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.status-line {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--muted);
}

.sync-line {
  min-height: 18px;
  margin: 4px 0 0;
  color: var(--teal);
  font-size: 13px;
}

.settings-sync-line {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #cfe0d9;
  border-radius: 6px;
  background: #f4faf7;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.quick {
  text-align: center;
}

.command-tool-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.command-tool-toggle {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  color: var(--blue);
  border-color: #a9bfe3;
  background: #eef4fc;
  font-weight: 700;
}

.command-tool-toggle:hover,
.command-tool-toggle.active {
  color: white;
  border-color: var(--blue);
  background: var(--blue);
}

.command-tool-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.command-tool-content {
  max-height: clamp(180px, calc(100dvh - var(--sticky-command-offset) - 220px), 420px);
  padding: 2px 2px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.command-tool-content[hidden] {
  display: none;
}

.manual-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.manual-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.manual-grid button {
  align-self: end;
}

.manual-more-options {
  grid-column: 1 / -1;
  width: min(100%, 540px);
  display: grid;
  justify-items: start;
  gap: 8px;
}

.manual-more-options-toggle {
  min-width: 166px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--blue);
  border-color: #a9bfe3;
  background: #eef4fc;
  font-weight: 700;
}

.manual-more-options-toggle:hover,
.manual-more-options-toggle.active {
  color: white;
  border-color: var(--blue);
  background: var(--blue);
}

.manual-more-options-indicator {
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  transition: transform 160ms ease;
}

.manual-more-options-toggle.active .manual-more-options-indicator {
  transform: rotate(45deg);
}

.manual-more-options-menu {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #bdd3f3;
  border-radius: 6px;
  background: #f5f9ff;
  box-shadow: 0 8px 20px rgba(40, 79, 143, 0.12);
}

.manual-more-options-menu[hidden] {
  display: none;
}

.manual-more-options-select {
  width: 100%;
}

.manual-option-fields {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.manual-day-rate-fields {
  grid-template-columns: minmax(0, 1fr);
}

.manual-day-rate-target {
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}

.manual-option-fields[hidden] {
  display: none;
}

.manual-add-button.ready {
  background: #16803c;
  border-color: #16803c;
  color: white;
  font-weight: 700;
}

.field-error {
  display: none !important;
  color: #b42318 !important;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.field-error.visible {
  display: block !important;
}

.field-error[hidden] {
  display: none !important;
}

.field-invalid {
  border-color: #d92d20;
  box-shadow: 0 0 0 2px rgba(217, 45, 32, 0.12);
}

#manualNewPersonWrap.hidden {
  display: none;
}

.settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ai-connection-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

#testAiButton {
  min-height: 36px;
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  font-weight: 700;
}

.ai-connection-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ai-connection-row small.connected {
  color: #126b35;
  font-weight: 700;
}

.ai-connection-row small.failed {
  color: #b42318;
}

.sync-diagnostics {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.danger {
  border-color: #d92d20;
  color: #b42318;
  background: #fff4f3;
}

.description-add,
.receipt-add,
.row-action {
  min-width: 34px;
  min-height: 34px;
  padding: 0 10px;
  border-style: dashed;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

body:not(.edit-mode) .actions-header,
body:not(.edit-mode) .actions-cell {
  display: none;
}

.edit-save-bar {
  display: flex;
  justify-content: flex-end;
  background: var(--paper);
}

.edit-save-bar[hidden] {
  display: none;
}

.filter-save-bar {
  display: flex;
  justify-content: flex-start;
  background: var(--paper);
}

.filter-save-bar[hidden] {
  display: none;
}

#applyFilters,
#clearListFilters {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  font-weight: 700;
}

#applyFilters {
  grid-column: -2 / -1;
}

#applyFilters:hover,
#applyFilters:focus-visible,
#clearListFilters:hover,
#clearListFilters:focus-visible {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.workspace {
  display: grid;
  grid-template-columns: var(--people-panel-width) 10px minmax(0, 1fr);
  min-height: 610px;
  overflow: clip;
}

.workspace.ledger-expanded {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
}

.people-panel {
  position: sticky;
  top: var(--sticky-command-offset);
  align-self: start;
  height: max(360px, calc(100dvh - var(--sticky-command-offset) - 24px));
  border-width: 0 1px 0 0;
  border-radius: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.people-tabs {
  display: grid;
  flex: 0 1 auto;
  grid-auto-rows: 44px;
  align-content: start;
  min-height: 0;
  gap: 8px;
  margin: 16px 0;
  overflow: auto;
}

.workspace > .resize-handle-vertical {
  grid-column: 2;
}

.workspace > .sheet-panel {
  grid-column: 3;
}

.workspace.ledger-expanded .people-panel {
  position: static;
  z-index: calc(var(--popup-layer) - 1);
  height: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(140px, 200px);
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-width: 0 0 1px 0;
  overflow: visible;
}

.workspace.ledger-expanded .resize-handle-vertical {
  display: none;
}

.workspace.ledger-expanded .people-panel .panel-head {
  grid-column: 1;
}

.workspace.ledger-expanded .people-tabs {
  grid-column: 2;
  display: flex;
  gap: 8px;
  min-width: 0;
  max-height: none;
  margin: 0;
  padding-bottom: 2px;
  overflow-x: auto;
  overflow-y: hidden;
}

.workspace.ledger-expanded .people-tabs .tab {
  width: auto;
  flex: 0 0 clamp(190px, 22vw, 280px);
}

.workspace.ledger-expanded .people-tabs .tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace.ledger-expanded .add-person-button {
  grid-column: 3;
  width: 48px;
  min-width: 48px;
  margin: 0;
}

.workspace.ledger-expanded .add-person-button.person-edit-done {
  width: auto;
  min-width: 90px;
}

.workspace.ledger-expanded .settings-button {
  grid-column: 4;
  width: 100%;
  margin: 0;
}

.workspace.ledger-expanded .sheet-panel {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
}

.add-person-button {
  width: 100%;
  min-height: 44px;
  margin: -4px 0 16px;
  border-style: dashed;
  border-color: #9bb4ad;
  background: #f8faf9;
  color: var(--teal);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.add-person-button.person-edit-done {
  border-style: solid;
  border-color: var(--blue);
  background: var(--blue);
  color: white;
  font-size: 14px;
  line-height: normal;
}

.add-person-button.person-edit-done:hover,
.add-person-button.person-edit-done:focus-visible {
  border-color: var(--blue);
  background: #174f9a;
  color: white;
}

.tab {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
}

.tab.active {
  background: #e3ece9;
  border-color: #9bb4ad;
}

.person-tab-edit-row {
  min-height: 42px;
  padding: 0;
  overflow: hidden;
  direction: ltr;
  background: #f9faf8;
}

.person-tab-name {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rename-person-button {
  width: 42px;
  min-width: 42px;
  min-height: 40px;
  padding: 0;
  border-width: 0 0 0 1px;
  border-radius: 0;
  background: #e8f0fb;
  border-color: #a9bfe3;
  color: var(--blue);
  font-size: 22px;
  line-height: 1;
}

.rename-person-button:hover,
.rename-person-button:focus-visible {
  background: #d9e6f8;
  color: var(--blue);
}

.person-tab-name:hover,
.person-tab-name:focus-visible {
  background: rgba(15, 118, 110, 0.06);
}

.rename-person-button svg {
  width: 20px;
  height: 20px;
  display: block;
  margin: auto;
}

.settings-button {
  width: 100%;
  min-height: 44px;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #e3ece9;
  border-color: #9bb4ad;
  color: var(--teal);
  font-weight: 700;
}

.settings-button:hover,
.settings-button:focus-visible {
  background: #d5e5e0;
  border-color: var(--teal);
}

.settings-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.settings-dialog form {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  max-height: calc(100vh - 72px);
}

.settings-dialog h2 {
  margin: 0 0 10px;
}

.settings-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f6f3;
}

.settings-tab {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.settings-tab.active,
.settings-tab[aria-selected="true"] {
  background: white;
  border-color: #b7c8c3;
  color: var(--teal);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.settings-tab:hover,
.settings-tab:focus-visible {
  color: var(--blue);
  border-color: #bdd3f3;
}

.settings-tab-panels {
  min-height: 300px;
  overflow: auto;
  padding-right: 2px;
}

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

.settings-group {
  display: grid;
  gap: 12px;
  padding: 12px 0 18px;
}

.settings-group h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0;
}

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

.settings-toggle {
  min-height: 42px;
  align-self: end;
}

.settings-dialog label.settings-switch {
  grid-column: 1 / -1;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.settings-dialog label.settings-switch:hover {
  border-color: #a9bfe3;
  background: #fbfcff;
}

.settings-dialog label.settings-switch:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(40, 79, 143, 0.14);
}

.settings-switch-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.settings-switch-copy > span {
  color: var(--ink);
  font-weight: 700;
}

.settings-switch-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.settings-switch-copy .settings-switch-description {
  max-width: 58ch;
  margin-top: 3px;
  font-weight: 400;
  line-height: 1.4;
}

.settings-switch-control {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  direction: ltr;
}

.settings-switch-control input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 48px;
  height: 28px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.settings-switch-track {
  width: 48px;
  height: 28px;
  display: block;
  padding: 3px;
  border: 1px solid #87948f;
  border-radius: 999px;
  background: #aeb8b4;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.settings-switch-thumb {
  width: 20px;
  height: 20px;
  display: block;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.3);
  transform: translateX(0);
  transition: transform 160ms ease;
}

.settings-switch-control input:checked + .settings-switch-track {
  border-color: var(--blue);
  background: var(--blue);
}

.settings-switch-control input:checked + .settings-switch-track .settings-switch-thumb {
  transform: translateX(20px);
}

.dual-balance-settings {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid #bdd3f3;
  border-radius: 6px;
  background: #f5f9ff;
}

.dual-balance-settings[hidden] {
  display: none;
}

.ai-key-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#saveAiKeyButton,
#testAiButton {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

#removeAiKeyButton {
  color: #b42318;
  border-color: #f1b8b1;
  background: white;
}

#aiStatus {
  color: var(--muted);
}

#aiStatus.connected {
  color: #08735f;
}

#aiStatus.failed {
  color: #b42318;
}

.settings-choice-button {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  text-align: start;
}

.settings-choice-button:hover { border-color: var(--blue); }

.settings-choice-button strong {
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.rate-readout {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f6f3;
  direction: ltr;
}

.rate-readout output {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rate-readout small {
  color: var(--muted);
  text-align: right;
}

.settings-dialog-actions {
  position: sticky;
  bottom: -20px;
  margin: 0 -20px -20px;
  padding: 12px 20px 20px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

#closeSettings {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  font-weight: 700;
}

#saveDayRateDisplay {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  font-weight: 700;
}

.command-history-dialog {
  width: min(620px, calc(100vw - 32px));
}

.recently-deleted-dialog {
  position: fixed;
  inset: 0;
  width: min(680px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  margin: auto;
  overflow: auto;
}

.recently-deleted-list {
  display: grid;
  gap: 8px;
  max-height: min(460px, 55vh);
  margin: 16px 0;
  overflow: auto;
}

.recently-deleted-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9faf8;
}

.recently-deleted-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.recently-deleted-info strong,
.recently-deleted-info span,
.recently-deleted-info small {
  overflow-wrap: anywhere;
}

.recently-deleted-info small {
  color: var(--muted);
}

.restore-deleted-button {
  color: white;
  border-color: var(--blue);
  background: var(--blue);
  font-weight: 700;
}

.command-history-list {
  display: grid;
  gap: 8px;
  max-height: min(440px, 55vh);
  margin: 16px 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.command-history-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9faf8;
}

.command-history-item p {
  margin: 6px 0 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.command-history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.command-history-meta strong { color: var(--blue); }

.empty-history {
  margin: 18px 0;
  text-align: center;
}

.empty-history[hidden] { display: none; }

.toggle-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--blue);
}

.settings-dialog label.settings-switch[hidden] {
  display: none !important;
}

.sheet-panel {
  position: sticky;
  top: var(--sticky-command-offset);
  align-self: start;
  height: max(360px, calc(100dvh - var(--sticky-command-offset) - 24px));
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  padding: 18px;
  min-width: 0;
}

.sheet-head {
  position: relative;
  top: auto;
  z-index: 5;
  padding-bottom: 10px;
  background: var(--paper);
}

.sheet-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.ledger-expand-button {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  border-color: #a9bfe3;
  background: #e8f0fb;
}

.ledger-expand-button:hover,
.ledger-expand-button:focus-visible {
  color: var(--blue);
  border-color: var(--blue);
  background: #d9e6f8;
}

.ledger-expand-button svg {
  width: 20px;
  height: 20px;
}

.ledger-collapse-icon { display: none; }
body.ledger-expanded .ledger-expand-icon { display: none; }
body.ledger-expanded .ledger-collapse-icon { display: block; }

.balance-box {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--yellow);
  white-space: nowrap;
}

.balance-box span {
  color: #6d5a00;
  font-size: 12px;
}

.balance-box strong {
  font-variant-numeric: tabular-nums;
}

.list-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  direction: ltr;
}

.list-tools label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.list-tools-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

#columnOrderButton {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

#columnOrderButton svg {
  width: 18px;
  height: 18px;
}

.column-order-dialog {
  width: min(460px, calc(100vw - 32px));
}

.column-order-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.column-order-row {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 6px 4px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9faf8;
}

.column-order-selection {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  cursor: pointer;
}

.column-order-selection input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
}

.column-order-selection strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column-order-row.column-hidden {
  background: #f1f3f1;
  color: var(--muted);
}

.column-order-row.column-hidden strong { color: var(--muted); }

.column-order-controls {
  display: flex;
  gap: 4px;
}

.column-order-controls button {
  width: 38px;
  min-width: 38px;
  min-height: 36px;
  padding: 0;
}

.column-order-controls svg {
  width: 18px;
  height: 18px;
  display: block;
  margin: auto;
}

#saveColumnOrder {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  font-weight: 700;
}

.list-tools select {
  width: auto;
  min-width: 170px;
}

.table-wrap {
  margin-top: 18px;
  overflow: auto;
  min-height: 0;
  height: auto;
  max-height: none;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  scrollbar-gutter: stable;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.transaction-list-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  padding-top: 12px;
  direction: ltr;
}

.list-footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.list-edit-controls {
  display: flex;
  gap: 8px;
}

.list-edit-controls button {
  min-height: 36px;
}

.list-footer-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

#downloadPdfButton {
  min-height: 36px;
  background: var(--teal);
  border-color: var(--teal);
  color: white;
  font-weight: 700;
}

#downloadPdfButton:hover,
#downloadPdfButton:focus-visible {
  background: #0b625c;
  border-color: #0b625c;
  color: white;
}

.pdf-export {
  position: fixed;
  left: -100000px;
  top: 0;
  pointer-events: none;
  width: 960px;
  padding: 24px 32px;
  overflow: visible;
  background: #ffffff;
  color: #19201d;
  font: 14px/1.4 Arial, "Noto Sans Arabic", sans-serif;
}

.pdf-export h1 {
  margin: 0 0 18px;
  font-size: 24px;
  letter-spacing: 0;
}

.pdf-export table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  direction: ltr;
}

.pdf-export th,
.pdf-export td {
  position: static;
  padding: 9px 8px;
  border: 1px solid #cfd6cf;
  text-align: right;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.pdf-export[dir="ltr"] th,
.pdf-export[dir="ltr"] td {
  direction: ltr;
}

.pdf-export.pdf-export-fa h1,
.pdf-export.pdf-export-fa th,
.pdf-export.pdf-export-fa td {
  direction: rtl;
  text-align: right;
}

.pdf-export th {
  background: #f4f6f3;
  font-size: 12px;
}

.pdf-export tr {
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-export tr.debtor { background: #d9f2de; }
.pdf-export tr.creditor { background: #ffe0df; }
.pdf-export tr.total { background: #fff1ad; font-weight: 700; }

.pdf-export [data-column="date"] {
  width: 11%;
  white-space: normal;
}
.pdf-export [data-column="name"] { width: 9%; }
.pdf-export [data-column="debtor"],
.pdf-export [data-column="creditor"] { width: 8%; }
.pdf-export [data-column="currency"] { width: 7%; }
.pdf-export [data-column="usdRate"] { width: 10%; }
.pdf-export [data-column="equivalence"] { width: 12%; }
.pdf-export [data-column="description"] { width: 23%; }
.pdf-export [data-column="receipt"] { width: 12%; }

.ledger-table {
  width: max(100%, var(--ledger-content-width, 1068px));
  min-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  direction: rtl;
}

.ledger-actions-column {
  transition: width 160ms ease;
}

th, td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
}

th + th,
td + td {
  border-inline-start: 1px solid rgba(217, 222, 216, 0.88);
}

th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f4f6f3;
  box-shadow: 0 1px 0 var(--line);
  font-size: 13px;
}

.ledger-table th[data-column] {
  position: sticky;
  padding-right: 18px;
}

.ledger-header-label {
  display: block;
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.column-resize-handle {
  position: absolute;
  top: 0;
  right: -5px;
  bottom: 0;
  z-index: 6;
  width: 10px;
  min-width: 10px;
  min-height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.column-resize-handle::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 4px;
  width: 2px;
  background: #c6d2ca;
}

.column-resize-handle:hover::before,
.column-resize-handle:focus-visible::before,
body.resizing-column .column-resize-handle::before {
  background: var(--blue);
}

.description-cell {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.ledger-table th[data-column],
.ledger-table td[data-column] {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.ledger-table td[data-column] > * {
  max-width: 100%;
}

.description-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
  text-align: start;
  unicode-bidi: plaintext;
}

tbody tr:not(.total) td {
  vertical-align: top;
}

tbody tr.transaction-revealed td {
  box-shadow: inset 0 2px 0 var(--blue), inset 0 -2px 0 var(--blue);
}

tbody tr.transaction-revealed td:first-child {
  box-shadow: inset 2px 0 0 var(--blue), inset 0 2px 0 var(--blue), inset 0 -2px 0 var(--blue);
}

tbody tr.transaction-revealed td:last-child {
  box-shadow: inset -2px 0 0 var(--blue), inset 0 2px 0 var(--blue), inset 0 -2px 0 var(--blue);
}

tr.debtor { background: var(--green); }
tr.creditor { background: var(--red); }
tr.total { background: var(--yellow); font-weight: 700; }

tfoot tr.total td {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: var(--yellow);
  box-shadow: 0 -1px 0 var(--line);
}

.total-summary-cell {
  text-align: left;
  direction: ltr;
}

.ledger-total-content {
  position: sticky;
  left: 12px;
  right: 12px;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.ledger-total-content strong {
  font-variant-numeric: tabular-nums;
}

.ledger-total-dual {
  align-items: center;
  gap: 16px;
}

.ledger-balance-item {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.ledger-balance-item + .ledger-balance-item {
  padding-left: 16px;
  border-left: 1px solid rgba(109, 90, 0, 0.35);
}

.ledger-balance-secondary {
  font-weight: 600;
}

.day-rate-equation {
  display: inline-block;
  max-width: 100%;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.manual-day-rate {
  color: var(--blue);
  font-weight: 700;
}

.manual-equivalence {
  color: var(--blue);
  font-weight: 700;
  white-space: normal;
  overflow-wrap: anywhere;
}

a { color: var(--blue); }

@media (max-width: 880px) {
  .app-shell { padding: 10px; }
  .workspace { grid-template-columns: 1fr; }
  .workspace > .sheet-panel { grid-column: 1; }
  .resize-handle { display: none; }
  .people-panel { border-width: 0 0 1px 0; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manual-grid { grid-template-columns: 1fr; }
  .manual-option-fields { grid-template-columns: 1fr; }
  #applyFilters { grid-column: 1; }
  .sheet-head { align-items: center; flex-direction: row; }
  .sheet-head > div:first-child { min-width: 0; }
  .sheet-head .eyebrow { display: none; }
  .balance-box { width: auto; min-width: 0; }
  .ai-connection-row { grid-template-columns: 1fr; }
  #testAiButton { width: 100%; }
  .settings-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
  .dual-balance-settings { grid-template-columns: 1fr; }
  .list-tools { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .list-tools-right { width: auto; margin-left: auto; justify-content: flex-end; flex-wrap: nowrap; }
  .transaction-list-footer { flex-wrap: nowrap; }
  .list-footer-right { width: auto; }
  .workspace.ledger-expanded .people-panel {
    grid-template-columns: minmax(0, 1fr) minmax(140px, 180px);
  }
  .workspace.ledger-expanded .people-panel .panel-head,
  .workspace.ledger-expanded .people-tabs {
    grid-column: 1 / -1;
  }
  .workspace.ledger-expanded .add-person-button {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
  }
  .workspace.ledger-expanded .settings-button {
    grid-column: 2;
    grid-row: 3;
  }
}

@media (max-width: 480px) {
  .recently-deleted-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .restore-deleted-button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .native-android .sheet-panel { grid-template-rows: none !important; grid-auto-rows: max-content; align-content: start; padding-bottom: 90px !important; }
  .native-android .transaction-list-footer { display: none; }
  .native-android .android-ledger-actions { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 0; position: relative; }
  .native-android .android-ledger-actions .list-edit-controls { display: flex; gap: 8px; }
  .native-android .android-ledger-actions button { min-height: 44px; border-radius: 6px; padding: 8px 16px; font-weight: 600; }
  .native-android .android-ledger-actions #editModeButton { background: #e8f0fb; color: var(--blue); border-color: transparent; }
  .native-android .android-ledger-actions #saveEditModeButton { background: var(--blue); color: white; }
  .native-android .android-export-menu { margin-inline-start: auto; position: relative; }
  .native-android .android-export-menu summary { width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; list-style: none; border-radius: 50%; }
  .native-android .android-export-menu summary::-webkit-details-marker { display: none; }
  .native-android .android-export-menu svg { width: 24px; height: 24px; }
  .native-android .android-export-menu #downloadPdfButton { position: absolute; inset-inline-end: 0; top: 48px; z-index: 25; width: max-content; background: white; color: var(--ink); border: 1px solid var(--line); box-shadow: 0 4px 14px #19201d26; }
  .native-android .android-export-menu:not([open]) #downloadPdfButton { display: none; }
}

/* Android section hierarchy keeps controls grouped without nested cards. */
@media (max-width: 720px) {
  .native-android .people-panel { padding-block: 8px !important; }
  .native-android .sheet-head { box-shadow: none !important; padding-block: 14px !important; }
  .native-android .sheet-head h2 { font-size: 18px !important; }
  .native-android .list-tools { padding-block: 12px !important; border-bottom: 1px solid var(--line); }
  .native-android .android-ledger-actions { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
  .native-android .table-wrap { margin-top: 8px !important; box-shadow: none !important; border-radius: 4px !important; }
  .native-android .sheet-panel { gap: 0 !important; }
}

.android-transaction-summary { display: none; }
@media (max-width: 720px) {
  .native-android .table-wrap .ledger-table { display: block; width: 100% !important; min-width: 0 !important; }
  .native-android .ledger-table colgroup, .native-android .ledger-table thead { display: none; }
  .native-android .ledger-table tbody, .native-android .ledger-table tfoot { display: block; width: 100%; }
  .native-android .ledger-table tbody tr { display: block; width: 100%; border-bottom: 4px solid white; }
  .native-android .ledger-table tbody td { display: none; }
  .native-android .ledger-table tbody td.android-transaction-summary { display: block; padding: 0; border: 0; }
  .native-android .android-transaction-toggle { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; width: 100%; padding: 16px 12px; border: 0; border-radius: 0; background: transparent; color: var(--ink); text-align: start; }
  .native-android .android-transaction-title { overflow-wrap: anywhere; font-weight: 600; line-height: 1.4; }
  .native-android .android-transaction-date { font-size: 12px; color: var(--muted); }
  .native-android .android-transaction-chevron { text-align: end; }
  .native-android .ledger-table tbody tr.android-transaction-expanded td[data-column] { display: grid; grid-template-columns: minmax(80px, 30%) minmax(0, 1fr); gap: 12px; padding: 10px 12px; border: 0; border-top: 1px solid #19201d14; overflow-wrap: anywhere; }
  .native-android .android-transaction-expanded td[data-column]::before { content: attr(data-detail-label); font-size: 12px; color: var(--muted); }
  .native-android .ledger-table tfoot tr, .native-android .ledger-table tfoot .total-summary-cell { display: block; width: 100%; }
  .native-android .ledger-table tbody .actions-cell { border: 0; }
  .native-android .table-wrap { overflow-x: hidden !important; }
}

@media (max-width: 720px) {
  .native-android #columnOrderButton { display: none !important; }
  .native-android .ledger-table tbody tr.android-transaction-expanded td.android-empty-detail { display: none !important; }
  .native-android body.edit-mode .ledger-table tbody td.actions-cell { display: block; padding: 8px 12px 12px; }
  .native-android body.edit-mode .ledger-table .row-actions { display: flex; gap: 12px; justify-content: flex-end; }
  .native-android body.edit-mode .ledger-table .row-action { min-height: 44px; padding: 8px 16px; }
  .native-android #ledgerFooter { position: fixed !important; inset-inline: 0; bottom: 0; z-index: 40; width: 100% !important; background: var(--yellow); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px #19201d20; }
  .native-android #ledgerFooter .total-summary-cell { padding: 14px 12px; white-space: normal; }
  .native-android #ledgerFooter .total-actions-cell { display: none !important; }
  .native-android body[data-android-view="ledger"] #androidPeopleFab { bottom: calc(90px + env(safe-area-inset-bottom)); }
  .native-android .sheet-panel { padding-bottom: 170px !important; }
}

@media (max-width: 720px) {
  .native-android #ledgerFooter { display: none !important; }
  .native-android #androidBalanceBar { position: fixed; inset-inline: 0; bottom: 0; z-index: 80; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--yellow); box-shadow: 0 -2px 10px #19201d20; font-weight: 700; overflow-wrap: anywhere; }
  .native-android body[data-android-view="settings"] #androidBalanceBar { display: none; }
  .native-android body[data-android-view="ledger"] #androidPeopleFab { bottom: calc(var(--android-balance-height, 64px) + 16px); }
}

@media (max-width: 720px) {
  .native-android .ledger-table tbody tr.android-transaction-expanded td[data-column] {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
    text-align: right;
    gap: 6px 16px;
    direction: ltr;
  }
  .native-android .ledger-table tbody tr.android-transaction-expanded td[data-column]::before {
    flex: 1 1 90px;
    text-align: left;
    order: -1;
  }
  .native-android .ledger-table tbody tr.android-transaction-expanded td[data-column] > * {
    text-align: right;
    margin-inline-start: auto;
    max-width: 70%;
  }
  .native-android .ledger-table tbody tr.android-transaction-expanded td[data-column="usdRate"] > * {
    direction: ltr;
    unicode-bidi: isolate;
  }
}

@media (max-width: 720px) {
  .native-android body .app-shell,
  .native-android body .command-dock,
  .native-android body .command-panel,
  .native-android body .workspace,
  .native-android body .people-panel,
  .native-android body .sheet-panel {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }
  .native-android body .app-shell { display: flex !important; flex-direction: column; }
  .native-android body .command-dock { height: auto !important; min-height: 0 !important; }
  .native-android body .command-panel { height: auto !important; min-height: 0 !important; }
  .native-android body .topbar { width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr) 44px 44px !important; }
  .native-android body .command-card,
  .native-android body .command-row { width: 100%; min-width: 0; }
  .native-android body .command-row { display: grid; grid-template-columns: minmax(0, 1fr) 68px; }
  .native-android body .people-tabs { max-width: 100%; min-width: 0; }
  .native-android body .sheet-head { min-width: 0; flex-wrap: wrap; gap: 8px; }
  .native-android body .sheet-head-actions { max-width: 100%; }
  .native-android body .list-tools-right { grid-template-columns: minmax(0, 1fr) !important; }
  .native-android body .list-tools-right > label { grid-column: 1; }
  .native-android body .table-wrap { min-width: 0 !important; max-width: 100% !important; }
  .native-android body .android-transaction-toggle { min-width: 0; grid-template-columns: minmax(0, 1fr) auto; }
  .native-android body .android-transaction-toggle > * { min-width: 0; overflow-wrap: anywhere; }
}

@media (max-width: 720px) {
  .native-android body .people-tabs .tab,
  .native-android body .workspace.ledger-expanded .people-tabs .tab,
  .native-android body .people-tabs .person-tab-edit-row {
    min-width: 0;
    width: auto;
    max-width: 180px;
    min-height: 40px;
    padding: 0 12px;
    flex: 0 0 auto;
  }
}

@media (max-width: 720px) {
  .native-android body .list-tools .list-tools-right {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: 10px;
    align-items: center;
  }
  .native-android body .list-tools .list-tools-right > #androidFilterShortcut {
    width: auto;
    padding-inline: 12px;
    min-height: 40px;
  }
  .native-android body .list-tools .list-tools-right > label {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    font-size: 12px;
  }
  .native-android body .list-tools .list-tools-right > label select {
    min-width: 0;
    width: 100%;
    min-height: 40px;
    padding-inline: 8px;
    font-size: 13px;
  }
}

@media (max-width: 720px) {
  .native-android #androidBalanceBar .ledger-total-dual { display: flex; flex-wrap: wrap; gap: 8px 14px; width: 100%; white-space: normal; }
  .native-android #androidBalanceBar .ledger-balance-item { min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; white-space: normal; flex: 1 1 145px; }
  .native-android #androidBalanceBar .ledger-balance-item strong { white-space: normal; overflow-wrap: anywhere; }
}

.native-android .android-receipt-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.native-android .android-receipt-picker { display: grid; gap: 8px; min-width: 0; }
.native-android .android-receipt-picker-button { min-height: 48px; width: 100%; border: 1px solid #a9bfe3; border-radius: 8px; background: #e8f0fb; color: var(--blue); font-weight: 700; padding: 12px 16px; }
.native-android .android-receipt-filename { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }

.native-android .android-receipt-picker-button.has-selection { background: #d9f2de; border-color: #4e8a60; color: #205431; }
.native-android #androidManualSheet .android-tool-sheet-frame { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.native-android .android-manual-submit-bar { padding: 12px 2px 0; border-top: 1px solid var(--line); background: white; box-shadow: 0 -4px 10px #19201d0d; }
.native-android .android-manual-submit-bar #manualAdd { width: 100%; min-height: 48px; margin: 0; }

@media (max-width: 720px) {
  .native-android body #addPersonDialog,
  .native-android body #renamePersonDialog,
  .native-android body #mergePeopleDialog,
  .native-android body #confirmMergePeopleDialog,
  .native-android body #renameMergeDialog,
  .native-android body #androidPeopleEditor {
    position: fixed;
    inset: 0;
    margin: auto !important;
    width: calc(100% - 40px);
    max-width: 400px;
    max-height: 80dvh;
    height: fit-content;
    padding: 20px;
    overflow: auto;
  }
  .native-android #androidPeopleEditor .people-tabs { display: grid !important; overflow: auto; max-height: 50dvh; gap: 8px; }
  .native-android #androidPeopleEditor .person-tab-edit-row { width: 100% !important; max-width: none !important; min-height: 48px !important; display: flex; justify-content: space-between; }
  .native-android #androidPeopleEditor .person-tab-name { flex: 1; text-align: start; }
  .native-android #androidPeopleEditor > button { width: 100%; margin-top: 16px; background: var(--blue); color: white; }
}

@media (max-width: 720px) {
  .native-android body .android-transaction-toggle { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: hidden; }
  .native-android body .android-transaction-toggle .android-transaction-title {
    display: block;
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .native-android body .android-transaction-toggle > strong { min-width: 0; max-width: 100%; overflow-wrap: anywhere; text-align: end; }
}

#syncButton[data-sync-state="synced"] { background: #e1ebe3; border-color: #bccdbf; color: #55715d; }
#syncButton[data-sync-state="failed"] { background: #ffe0df; border-color: #cb6862; color: #a32820; }
#syncButton[data-sync-state="syncing"] { background: #e8f0fb; border-color: #a9bfe3; color: var(--blue); }

.shared-sync-dialog { max-height: 80dvh; overflow: auto; }
.shared-sync-review { max-height: 45dvh; overflow: auto; overflow-wrap: anywhere; }
.shared-sync-dialog > button { margin: 8px 8px 0 0; min-height: 44px; }
.google-web-connection { display: grid; gap: 10px; margin-bottom: 16px; }

.native-android #androidSettingsView label.settings-switch {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  min-height: 64px;
  padding-block: 12px;
  text-align: start;
}
.native-android #androidSettingsView label.settings-switch > .settings-switch-copy,
.native-android #androidSettingsView label.settings-switch > span:first-child {
  flex: 1 1 auto;
  min-width: 0;
}
.native-android #androidSettingsView label.settings-switch > .settings-switch-control {
  display: inline-flex;
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  margin-inline-start: auto;
  align-self: center;
}
.native-android #androidSettingsView label.settings-switch[hidden] { display: none !important; }
.native-android #androidSettingsView .settings-switch-copy { display: grid; gap: 4px; }
.native-android #androidSettingsView .settings-switch-description { line-height: 1.45; }

.hosted-voxledger #settingsTabAi,
.hosted-voxledger #settingsPanelAi { display: none !important; }

.sheet-column-choice { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.sheet-column-choice input { width: 20px; height: 20px; min-height: 20px; accent-color: var(--blue); }

/* Android phone presentation. The web/desktop layout above remains unchanged. */
.android-bottom-nav,
.android-people-fab,
.android-people-actions {
  display: none;
}

@media (max-width: 720px) {
  .native-android body {
    background: #f4f7f5;
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .native-android .app-shell {
    min-height: 100dvh;
    padding: 0;
    gap: 0;
  }

  .native-android .command-dock {
    top: env(safe-area-inset-top);
    z-index: 30;
    border-radius: 0;
    box-shadow: 0 2px 12px rgba(25, 32, 29, 0.12);
  }

  .native-android .command-panel {
    gap: 7px;
    padding: 9px 12px 10px;
    border-width: 0 0 1px;
    border-radius: 0;
  }

  .native-android .topbar h1 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: 0;
  }

  .native-android .topbar {
    min-height: 42px;
  }

  .native-android #micButton {
    width: 44px;
    min-width: 44px;
    height: 44px;
    border-radius: 50%;
    border-color: #a9bfe3;
    background: #e8f0fb;
    color: var(--blue);
  }

  .native-android .command-card {
    gap: 5px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .native-android .command-card > label {
    font-size: 12px;
  }

  .native-android .command-row {
    gap: 8px;
  }

  .native-android #commandInput {
    min-width: 0;
    border-radius: 8px;
    background: #f8faf9;
  }

  .native-android #runCommand {
    min-width: 68px;
    border-color: var(--blue);
    background: var(--blue);
    color: white;
    font-weight: 700;
  }

  .native-android #statusLine {
    min-height: 18px;
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
  }

  .native-android #commandResizeHandle,
  .native-android #workspaceResizeHandle {
    display: none;
  }

  .native-android .workspace {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .native-android .people-panel,
  .native-android .workspace.ledger-expanded .people-panel {
    position: relative;
    top: auto;
    z-index: 5;
    width: 100%;
    height: auto;
    min-height: 0;
    display: block;
    padding: 11px 12px 8px;
    border-width: 0 0 1px;
    border-radius: 0;
    background: white;
    overflow: visible;
  }

  .native-android .people-panel .panel-head {
    min-height: 40px;
  }

  .native-android .people-panel .panel-head h2 {
    margin: 0;
    font-size: 16px;
  }

  .native-android .people-actions {
    gap: 6px;
  }

  .native-android #peopleMenuButton,
  .native-android #addPersonButton,
  .native-android #settingsButton {
    display: none !important;
  }

  .native-android .people-tabs,
  .native-android .workspace.ledger-expanded .people-tabs {
    width: 100%;
    min-height: 0;
    display: flex;
    gap: 8px;
    margin: 8px 0 0;
    padding: 0 0 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .native-android .people-tabs::-webkit-scrollbar {
    display: none;
  }

  .native-android .people-tabs .tab,
  .native-android .workspace.ledger-expanded .people-tabs .tab,
  .native-android .people-tabs .person-tab-edit-row {
    width: auto;
    min-width: 138px;
    max-width: 210px;
    min-height: 42px;
    flex: 0 0 auto;
    padding: 0 12px;
    border-radius: 8px;
    scroll-snap-align: start;
  }

  .native-android .people-tabs .tab span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .native-android .sheet-panel,
  .native-android .workspace.ledger-expanded .sheet-panel {
    position: relative;
    top: auto;
    width: 100%;
    height: auto;
    min-height: calc(100dvh - 230px);
    display: grid;
    padding: 0 12px calc(104px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background: #f4f7f5;
    overflow: visible;
  }

  .native-android .command-tools-panel {
    margin: 0 -12px;
    padding: 12px;
    border: 0;
    background: transparent;
  }

  .native-android .command-tool-tabs {
    display: none;
  }

  .native-android .command-tool-toggle {
    width: 100%;
    min-height: 42px;
    border-radius: 8px;
  }

  .native-android .command-tool-content {
    margin: 0;
    padding: 16px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    box-shadow: 0 1px 4px rgba(25, 32, 29, 0.08);
  }

  .native-android .android-view-heading {
    margin: 0 0 16px;
    font-size: 21px;
    line-height: 1.25;
  }

  .native-android body[data-android-view="ledger"] .command-tools-panel,
  .native-android body[data-android-view="settings"] .workspace,
  .native-android body[data-android-view="manual"] .people-panel,
  .native-android body[data-android-view="filters"] .people-panel,
  .native-android body[data-android-view="manual"] .sheet-head,
  .native-android body[data-android-view="manual"] .list-tools,
  .native-android body[data-android-view="manual"] .table-wrap,
  .native-android body[data-android-view="manual"] .transaction-list-footer,
  .native-android body[data-android-view="filters"] .sheet-head,
  .native-android body[data-android-view="filters"] .list-tools,
  .native-android body[data-android-view="filters"] .table-wrap,
  .native-android body[data-android-view="filters"] .transaction-list-footer {
    display: none;
  }

  .native-android body[data-android-view="manual"] .sheet-panel,
  .native-android body[data-android-view="filters"] .sheet-panel {
    min-height: calc(100dvh - var(--sticky-command-offset, 150px) - 68px);
    display: block;
    padding-top: 10px;
  }

  .native-android body[data-android-view="manual"] #manualAddPanel,
  .native-android body[data-android-view="filters"] #filtersPanel,
  .native-android body[data-android-view="settings"] .android-settings-view {
    animation: android-view-enter 180ms ease-out both;
  }

  .native-android .android-settings-view {
    min-height: calc(100dvh - var(--sticky-command-offset, 150px) - 68px);
    padding: 12px 12px calc(90px + env(safe-area-inset-bottom));
    background: #f4f7f5;
  }

  .native-android .android-settings-view[hidden] {
    display: none;
  }

  .native-android .android-settings-view #settingsForm {
    width: 100%;
    max-width: none;
    padding: 16px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    box-shadow: 0 1px 4px rgba(25, 32, 29, 0.08);
  }

  .native-android .android-settings-view #settingsForm > h2 {
    margin-top: 0;
    font-size: 21px;
  }

  @keyframes android-view-enter {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .native-android .manual-grid,
  .native-android .filter-grid {
    gap: 12px;
  }

  .native-android .sheet-head {
    position: sticky;
    top: var(--sticky-command-offset);
    z-index: 12;
    margin: 0 -12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: white;
    box-shadow: 0 2px 8px rgba(25, 32, 29, 0.07);
  }

  .native-android .sheet-head h2 {
    max-width: 210px;
    margin: 0;
    overflow: hidden;
    font-size: 18px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: normal;
  }

  .native-android .sheet-head > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
  }

  .native-android .sheet-head-actions {
    flex: 0 0 auto;
  }

  .native-android .balance-box {
    min-height: 42px;
    max-width: 180px;
    padding: 7px 9px;
    gap: 5px;
    overflow: hidden;
  }

  .native-android .balance-box strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
  }

  .native-android .ledger-expand-button {
    display: none;
  }

  .native-android .list-tools {
    margin: 10px 0 0;
    padding: 0 0 4px;
    gap: 8px;
    scrollbar-width: none;
  }

  .native-android .list-tools::-webkit-scrollbar {
    display: none;
  }

  .native-android .list-tools select {
    min-width: 150px;
  }

  .native-android .table-wrap {
    width: 100%;
    max-height: 58dvh;
    margin-top: 10px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 1px 3px rgba(25, 32, 29, 0.08);
    overscroll-behavior-y: auto;
  }

  .native-android .ledger-table {
    width: max(100%, var(--ledger-content-width, 860px));
  }

  .native-android .ledger-table th,
  .native-android .ledger-table td {
    padding: 10px 9px;
  }

  .native-android .transaction-list-footer {
    align-items: center;
    margin-top: 8px;
    padding: 10px 0 0;
    gap: 8px;
  }

  .native-android .list-footer-left,
  .native-android .list-footer-right {
    gap: 6px;
  }

  .native-android .list-footer-right {
    margin-right: 68px;
  }

  .native-android #editModeButton,
  .native-android #downloadPdfButton,
  .native-android #clearListFilters {
    min-height: 42px;
  }

  .native-android .android-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    min-height: calc(68px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 6px 8px env(safe-area-inset-bottom);
    border-top: 1px solid #cfd8d2;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -4px 18px rgba(25, 32, 29, 0.12);
  }

  .native-android .android-bottom-nav button {
    min-width: 0;
    min-height: 56px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    padding: 4px 2px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #5c6760;
    font-size: 11px;
    font-weight: 700;
  }

  .native-android .android-bottom-nav button.active {
    background: #e8f0fb;
    color: var(--blue);
  }

  .native-android .android-bottom-nav svg {
    width: 22px;
    height: 22px;
  }

  .native-android .android-people-fab {
    position: fixed;
    right: 18px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    z-index: 65;
    width: 58px;
    min-width: 58px;
    height: 58px;
    min-height: 58px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--blue);
    color: white;
    box-shadow: 0 6px 18px rgba(40, 79, 143, 0.34);
  }

  .native-android body:not([data-android-view="ledger"]) .android-people-fab {
    display: none;
  }

  .native-android .android-people-fab:active {
    transform: scale(0.96);
  }

  .native-android .android-people-fab svg {
    width: 27px;
    height: 27px;
  }

  .native-android .android-people-actions[open] {
    position: fixed;
    inset: auto 0 0;
    z-index: 130;
    width: 100%;
    max-width: none;
    max-height: 78dvh;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 14px 14px 0 0;
    background: white;
    overflow: auto;
  }

  .native-android .android-people-actions::backdrop {
    background: rgba(25, 32, 29, 0.48);
  }

  .native-android .android-bottom-sheet {
    padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
  }

  .native-android .android-sheet-handle {
    width: 40px;
    height: 4px;
    margin: 0 auto 12px;
    border-radius: 4px;
    background: #c8d0cb;
  }

  .native-android .android-sheet-title-row {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .native-android .android-sheet-title-row h2 {
    margin: 0;
    font-size: 20px;
  }

  .native-android .android-sheet-close {
    width: 44px;
    min-width: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f4f2;
  }

  .native-android .android-sheet-close svg {
    width: 20px;
    height: 20px;
  }

  .native-android .android-people-action-list {
    display: grid;
    gap: 6px;
    margin-top: 8px;
  }

  .native-android .android-people-action-list button {
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    text-align: start;
    font-weight: 700;
  }

  .native-android .android-people-action-list button:active {
    background: #edf2ef;
  }

  .native-android .android-people-action-list button.danger {
    color: #a32820;
  }

  .native-android .android-people-action-list svg {
    width: 23px;
    min-width: 23px;
    height: 23px;
    color: var(--blue);
  }

  .native-android .android-people-action-list .danger svg {
    color: #a32820;
  }

  .native-android dialog.confirm-dialog:not(.android-people-actions),
  .native-android dialog.column-order-dialog,
  .native-android dialog.command-history-dialog,
  .native-android dialog.recently-deleted-dialog {
    width: calc(100% - 16px);
    max-height: 86dvh;
    margin-bottom: calc(8px + env(safe-area-inset-bottom));
    border-radius: 12px;
  }

  .native-android .settings-dialog {
    width: calc(100% - 12px);
    max-height: calc(100dvh - 12px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 16px;
    border-radius: 12px;
  }

  .native-android .settings-tabs {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 4px 0 8px;
    background: white;
  }

  @media (prefers-reduced-motion: reduce) {
    .native-android body[data-android-view="manual"] #manualAddPanel,
    .native-android body[data-android-view="filters"] #filtersPanel,
    .native-android body[data-android-view="settings"] .android-settings-view {
      animation: none;
    }
  }
}

@media (max-width: 720px) {
  .native-android body {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .native-android .android-people-fab {
    bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .native-android .list-tools {
    width: 100%;
    display: block;
    overflow: visible;
  }

  .native-android .list-tools-right {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 8px;
    margin: 0;
  }

  .native-android .list-tools-right > button {
    width: 100%;
    min-width: 0;
    padding-inline: 12px;
  }

  .native-android .list-tools-right > label {
    min-width: 0;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }

  .native-android .list-tools-right select {
    width: 100%;
    min-width: 0;
  }
}



