@media (max-width: 820px) {
  :root {
    --app-display-scale: 1;
    --app-viewport-height: 100vh;
    --app-viewport-width: 100vw;
    zoom: 1;
  }
  html, body { max-width: 100%; overflow-x: hidden; }
  input, select, textarea { min-width: 0; max-width: 100%; font-size: 16px; }
  .mobile-icon-button,
  .mobile-bottom-nav button,
  .mobile-action-button { min-width: 44px; min-height: 44px; }
  .mobile-page-header { padding-top: max(8px, env(safe-area-inset-top)); }
  .mobile-bottom-nav { padding-bottom: env(safe-area-inset-bottom); }

  body.mobile-drawer-open { overflow: hidden; }

  .mobile-app-shell {
    min-height: 100dvh;
    background: #f5f8fc;
  }

  .mobile-main {
    min-width: 0;
    padding: 16px 14px calc(112px + env(safe-area-inset-bottom));
  }

  .mobile-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid #dce6f2;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -8px 24px rgba(35, 59, 91, .1);
    backdrop-filter: blur(14px);
  }

  .mobile-bottom-nav button {
    display: grid;
    min-width: 0;
    padding: 8px 4px 7px;
    border: 0;
    background: transparent;
    color: #6b7d92;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    place-items: center;
    gap: 3px;
  }

  .mobile-bottom-nav button .ui-icon { width: 20px; height: 20px; }
  .mobile-bottom-nav button.active { color: #1668d8; }
  .mobile-bottom-nav button.active span { font-weight: 800; }

  .mobile-drawer-backdrop {
    position: fixed;
    z-index: 90;
    inset: 0;
    background: rgba(15, 30, 52, .42);
  }

  .mobile-more-drawer {
    position: fixed;
    z-index: 91;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: min(78dvh, 620px);
    overflow: auto;
    border-radius: 22px 22px 0 0;
    background: #fff;
    box-shadow: 0 -18px 50px rgba(16, 37, 67, .24);
  }

  .mobile-more-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 12px;
    border-bottom: 1px solid #e6edf6;
  }

  .mobile-more-drawer-head h2 { margin: 0; color: #14213d; font-size: 18px; }
  .mobile-more-drawer-list { display: grid; padding: 8px 12px 12px; }
  .mobile-more-drawer-list button {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 10px 8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #273b54;
    font: inherit;
    font-weight: 700;
    text-align: left;
  }

  .mobile-more-drawer-list button.active { color: #145fc1; background: #edf5ff; }
  .mobile-more-drawer-list button > .ui-icon:first-child { color: #3978c8; }
  .mobile-more-drawer-list button > .ui-icon:last-child { width: 16px; height: 16px; color: #91a1b4; }
  .mobile-drawer-empty { margin: 12px 8px; color: #718096; }

  .mobile-account-controls {
    display: grid;
    gap: 12px;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid #e6edf6;
    background: #f8fbff;
  }
  .mobile-account-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .mobile-account-identity > b { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #dbeafe; color: #145fc1; }
  .mobile-account-identity > span { display: grid; min-width: 0; gap: 2px; }
  .mobile-account-identity strong, .mobile-account-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-account-identity small { color: #6b7b8f; }
  .mobile-account-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .mobile-language-switch { display: inline-flex; padding: 3px; border: 1px solid #d8e3ef; border-radius: 10px; background: #fff; }
  .mobile-language-switch button { min-height: 36px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: #52677d; font: inherit; font-size: 14px; }
  .mobile-language-switch button.active { background: #e8f2ff; color: #145fc1; font-weight: 700; }
  .mobile-logout-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 1px solid #fecaca; border-radius: 10px; background: #fff; color: #b42318; font: inherit; font-weight: 700; }
  .mobile-logout-button .ui-icon { width: 17px; height: 17px; }

  .mobile-dashboard .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-dashboard .dashboard-todo-row .todo-card,
  .mobile-dashboard .dashboard-todo-row .todo-card-has-attention {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px;
    padding: 14px;
  }
  .mobile-dashboard .dashboard-todo-row .todo-compact-heading {
    min-width: 0;
    padding: 0 0 10px;
    border-right: 0;
    border-bottom: 1px solid #e8edf3;
  }
  .mobile-dashboard .dashboard-todo-row .todo-list { grid-template-columns: minmax(0, 1fr); }
  .mobile-dashboard .dashboard-todo-row .todo-item,
  .mobile-dashboard .dashboard-todo-row .todo-item-task-op_pending.todo-item-attention,
  .mobile-dashboard .dashboard-todo-row .todo-item-task-pending_customer.todo-item-attention,
  .mobile-dashboard .dashboard-todo-row .todo-item-task-upcoming_review.todo-item-attention,
  .mobile-dashboard .dashboard-todo-row .todo-item-task-incomplete_cost.todo-item-attention {
    grid-template-columns: 8px minmax(0, 1fr) auto;
    min-height: 48px;
    padding: 9px 4px !important;
  }
  .mobile-dashboard .dashboard-todo-row .todo-item + .todo-item {
    border-top: 1px solid #e9edf2 !important;
    border-left: 0 !important;
  }
  .mobile-dashboard .dashboard-todo-row .todo-item-copy b,
  html[lang="en-AU"] .mobile-dashboard .dashboard-todo-row .todo-item-copy b {
    overflow: visible;
    font-size: 13px;
    line-height: 1.3;
    white-space: normal;
    text-overflow: clip;
  }
  .mobile-dashboard .dashboard-todo-row .todo-all {
    justify-self: stretch;
    justify-content: flex-end;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 8px 2px 0;
    border-top: 1px solid #e8edf3;
    border-left: 0;
  }
  .mobile-dashboard .recent-item {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  .mobile-dashboard .recent-item .recent-actions { grid-column: 1 / -1; }
  .mobile-dashboard .recent-item .recent-actions .link-btn { min-height: 40px; }

  .mobile-quote-detail-shell .mobile-main {
    min-width: 0;
    padding: 0 0 calc(86px + env(safe-area-inset-bottom));
  }

  .mobile-quote-detail {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    color: #1c2b3f;
  }

  .mobile-quote-detail .mobile-page-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    min-height: 58px;
    padding-right: 12px;
    padding-bottom: 8px;
    padding-left: 12px;
    border-bottom: 1px solid #dce6f2;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(14px);
  }

  .mobile-quote-detail .mobile-page-header h1 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: #14213d;
    font-size: 17px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-quote-detail-content {
    display: grid;
    min-width: 0;
    gap: 12px;
    padding: 14px;
  }

  .mobile-quote-summary-card,
  .mobile-quote-section-card,
  .mobile-quote-coming-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dfe8f3;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(30, 62, 100, .07);
  }

  .mobile-quote-summary-card { padding: 16px; }
  .mobile-quote-summary-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
  .mobile-quote-summary-top > div { min-width: 0; }
  .mobile-quote-summary-top small { color: #6f8196; font-weight: 700; }
  .mobile-quote-summary-top h2 { margin: 4px 0 0; overflow-wrap: anywhere; color: #14213d; font-size: 22px; line-height: 1.25; }
  .mobile-quote-destination { display: flex; align-items: center; gap: 6px; margin: 13px 0; color: #45617f; overflow-wrap: anywhere; }
  .mobile-quote-destination .ui-icon { width: 18px; height: 18px; flex: 0 0 auto; color: #2671cf; }
  .mobile-quote-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; overflow: hidden; border: 1px solid #e5edf6; border-radius: 12px; background: #e5edf6; }
  .mobile-quote-summary-grid > div { min-width: 0; padding: 11px; background: #f8fbff; }
  .mobile-quote-summary-grid dt { color: #718196; font-size: 12px; }
  .mobile-quote-summary-grid dd { margin: 4px 0 0; overflow-wrap: anywhere; color: #203650; font-weight: 750; }
  .mobile-quote-summary-refresh { margin-top: 10px; color: #5d7590; font-size: 13px; }

  .mobile-quote-section-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 13px 14px;
    border: 0;
    background: #fff;
    color: #1f3854;
    font: inherit;
    text-align: left;
  }

  .mobile-quote-section-trigger > span { display: flex; align-items: center; gap: 9px; min-width: 0; }
  .mobile-quote-section-trigger .ui-icon { width: 18px; height: 18px; flex: 0 0 auto; color: #2671cf; }
  .mobile-quote-section-body { min-width: 0; padding: 0 14px 14px; border-top: 1px solid #edf2f7; }
  .mobile-quote-empty { margin: 14px 0 0; color: #728398; }
  .mobile-quote-skeleton { display: grid; gap: 8px; padding-top: 14px; }
  .mobile-quote-skeleton i { height: 12px; border-radius: 7px; background: linear-gradient(90deg, #edf2f7, #f8fafc, #edf2f7); background-size: 220% 100%; animation: mobile-quote-shimmer 1.2s linear infinite; }
  .mobile-quote-skeleton i:nth-child(2) { width: 82%; }
  .mobile-quote-skeleton i:nth-child(3) { width: 60%; }
  @keyframes mobile-quote-shimmer { to { background-position: -220% 0; } }
  .mobile-quote-section-error { display: grid; gap: 8px; padding-top: 12px; color: #a6382c; }
  .mobile-quote-section-error p { margin: 0; overflow-wrap: anywhere; }
  .mobile-quote-section-error button { min-height: 44px; border: 1px solid #f3b7b0; border-radius: 10px; background: #fff5f3; color: #a6382c; font: inherit; font-weight: 700; }

  .mobile-itinerary-list, .mobile-terms-list, .mobile-cost-list { display: grid; gap: 10px; padding-top: 12px; }
  .mobile-itinerary-day { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; min-width: 0; }
  .mobile-itinerary-day-index { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: #e8f2ff; color: #1762bd; font-size: 13px; font-weight: 800; }
  .mobile-itinerary-day > div:last-child { display: grid; min-width: 0; gap: 3px; }
  .mobile-itinerary-day small { color: #708299; }
  .mobile-itinerary-scope { display: inline-flex; margin-left: 6px; padding: 2px 6px; border-radius: 999px; background: #eee8ff; color: #6d3bd1; font-size: 10px; font-style: normal; font-weight: 800; }
  .mobile-itinerary-day strong, .mobile-itinerary-day p { overflow-wrap: anywhere; }
  .mobile-itinerary-day p { margin: 2px 0 0; color: #50677f; line-height: 1.55; }
  .mobile-terms-list section { min-width: 0; padding: 11px; border-radius: 10px; background: #f7faff; }
  .mobile-terms-list p { margin: 5px 0 0; overflow-wrap: anywhere; color: #4d647d; line-height: 1.6; white-space: pre-wrap; }
  .mobile-cost-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 12px; }
  .mobile-cost-summary span { display: grid; min-width: 0; gap: 4px; padding: 10px; border-radius: 10px; background: #edf5ff; }
  .mobile-cost-summary small { color: #657991; }
  .mobile-cost-summary strong { overflow-wrap: anywhere; color: #155dad; }
  .mobile-cost-list > div { display: flex; justify-content: space-between; gap: 10px; min-width: 0; padding-bottom: 9px; border-bottom: 1px solid #edf2f7; }
  .mobile-cost-list span, .mobile-cost-list strong { min-width: 0; overflow-wrap: anywhere; }
  .mobile-cost-item-copy { display: grid; gap: 3px; }
  .mobile-cost-scope { width: fit-content; padding: 2px 6px; border-radius: 999px; background: #eef3ff; color: #3865be; font-size: 10px; font-style: normal; font-weight: 800; line-height: 1.2; }

  .mobile-quote-coming-card { display: flex; align-items: center; gap: 10px; padding: 14px; color: #6b7d92; }
  .mobile-quote-coming-card > span { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: #eef3f8; }
  .mobile-quote-coming-card > div { display: grid; min-width: 0; gap: 2px; }
  .mobile-quote-coming-card small { overflow-wrap: anywhere; }

  .mobile-quote-detail-actions {
    position: fixed;
    z-index: 30;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid #dce6f2;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 -8px 24px rgba(35, 59, 91, .1);
  }
  .mobile-quote-detail-actions button { min-width: 0; min-height: 44px; }

  .mobile-quick-edit-backdrop {
    position: fixed;
    z-index: 120;
    inset: 0;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: rgba(15, 30, 52, .48);
  }

  .mobile-quick-edit-sheet {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: 100%;
    height: 100dvh;
    min-width: 0;
    overflow: hidden;
    border-radius: 22px 22px 0 0;
    background: #fff;
    box-shadow: 0 -18px 50px rgba(16, 37, 67, .24);
  }

  .mobile-quick-edit-sheet > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 62px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    border-bottom: 1px solid #e4ebf4;
  }
  .mobile-quick-edit-sheet > header > div { display: grid; min-width: 0; gap: 2px; }
  .mobile-quick-edit-sheet > header small { overflow: hidden; color: #718196; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-quick-edit-sheet > header h2 { margin: 0; color: #14213d; font-size: 20px; }
  .mobile-quick-edit-sheet > header button {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-radius: 12px;
    background: #eef4fb;
    color: #35506e;
  }

  .mobile-quick-edit-body {
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 14px 24px;
    scroll-padding-bottom: 96px;
  }
  .mobile-quick-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; min-width: 0; }
  .mobile-quick-edit-field { display: grid; min-width: 0; gap: 6px; color: #496078; font-size: 13px; font-weight: 700; }
  .mobile-quick-edit-field input,
  .mobile-quick-edit-field select,
  .mobile-quick-edit-field textarea {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 11px;
    border: 1px solid #cfdae7;
    border-radius: 10px;
    background: #fff;
    color: #162b43;
    font: inherit;
    font-size: 16px;
  }
  .mobile-quick-edit-field textarea { min-height: 108px; resize: vertical; line-height: 1.5; }
  .mobile-quick-edit-field input:focus,
  .mobile-quick-edit-field select:focus,
  .mobile-quick-edit-field textarea:focus { border-color: #2671cf; outline: 3px solid rgba(38, 113, 207, .16); }
  .mobile-quick-edit-wide { grid-column: 1 / -1; min-width: 0; }

  .mobile-quick-edit-feedback { display: grid; gap: 8px; margin-bottom: 12px; padding: 12px; border-radius: 12px; }
  .mobile-quick-edit-feedback p { margin: 0; overflow-wrap: anywhere; }
  .mobile-quick-edit-feedback button { min-height: 44px; border: 1px solid currentColor; border-radius: 10px; background: #fff; color: inherit; font: inherit; font-weight: 750; }
  .mobile-quick-edit-feedback.is-error { background: #fff2f0; color: #a6382c; }
  .mobile-quick-edit-feedback.is-conflict { background: #fff7df; color: #845509; }

  .mobile-quick-edit-savebar {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid #dce6f2;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 -8px 22px rgba(35, 59, 91, .08);
  }
  .mobile-quick-edit-savebar button { min-width: 0; min-height: 44px; }

  .mobile-quote-status-panel {
    display: grid;
    min-width: 0;
    gap: 10px;
    padding: 14px;
    border: 1px solid #dfe8f3;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(30, 62, 100, .07);
  }
  .mobile-quote-status-panel > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .mobile-quote-status-panel > div:first-child small { color: #62778f; }
  .mobile-quote-status-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mobile-quote-status-actions button { min-width: 0; min-height: 44px; justify-content: center; }
  .mobile-quote-status-readonly { margin: 0; color: #6d7f93; }
  .mobile-quote-status-error { margin: 0; color: #a6382c; overflow-wrap: anywhere; }

  .mobile-quote-history-hint { margin: 12px 0 0; color: #687d94; font-size: 13px; }
  .mobile-quote-history-list { display: grid; gap: 10px; padding-top: 12px; }
  .mobile-quote-history-card {
    display: grid;
    min-width: 0;
    gap: 7px;
    padding: 12px;
    border: 1px solid #e2eaf3;
    border-radius: 12px;
    background: #f9fbfe;
    overflow-wrap: anywhere;
  }
  .mobile-quote-history-card > div:first-child,
  .mobile-quote-history-card > div:last-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .mobile-quote-history-card p { margin: 0; color: #687d94; font-size: 13px; }
  .mobile-quote-history-card button { min-height: 44px; }

  .mobile-quote-revision-backdrop {
    position: fixed;
    z-index: 125;
    inset: 0;
    display: flex;
    align-items: flex-end;
    background: rgba(15, 30, 52, .5);
  }
  .mobile-quote-revision-dialog {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: 100%;
    max-height: 94dvh;
    min-width: 0;
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 22px 22px 0 0;
    background: #fff;
  }
  .mobile-quote-revision-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; border-bottom: 1px solid #e2eaf3; }
  .mobile-quote-revision-dialog > header > div { display: grid; min-width: 0; gap: 3px; }
  .mobile-quote-revision-dialog > header small { color: #647a92; }
  .mobile-quote-revision-dialog > header h2 { margin: 0; overflow-wrap: anywhere; font-size: 19px; }
  .mobile-quote-revision-dialog > header button { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 12px; background: #eef4fb; }
  .mobile-quote-revision-body { min-width: 0; overflow: auto; padding: 14px; }
  .mobile-quote-revision-body dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; }
  .mobile-quote-revision-body dl > div { min-width: 0; padding: 10px; border-radius: 10px; background: #f3f7fc; }
  .mobile-quote-revision-body dt { color: #687d94; font-size: 12px; }
  .mobile-quote-revision-body dd { margin: 4px 0 0; overflow-wrap: anywhere; font-weight: 750; }
  .mobile-quote-revision-body section { display: grid; gap: 8px; }
  .mobile-quote-revision-body section h3 { margin: 0; font-size: 16px; }
  .mobile-quote-revision-body section article { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-bottom: 1px solid #edf2f7; }
  .mobile-quote-revision-dialog > footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px 14px; border-top: 1px solid #dce6f2; background: #fff; }
  .mobile-quote-revision-dialog > footer button { min-width: 0; min-height: 44px; }
  .mobile-quote-history-risk { display: grid; gap: 8px; margin-top: 16px; padding: 12px; border: 1px solid #efc68c; border-radius: 12px; background: #fff7e8; color: #78490d; }
  .mobile-quote-history-risk p { margin: 0; overflow-wrap: anywhere; }
  .mobile-quote-history-risk button { min-height: 44px; border: 1px solid currentColor; border-radius: 10px; background: #fff; color: inherit; font: inherit; font-weight: 700; }
  .mobile-quote-revision-error { margin: 14px; padding: 12px; border-radius: 10px; background: #fff2f0; color: #a6382c; overflow-wrap: anywhere; }

  .mobile-quote-export-backdrop {
    position: fixed;
    z-index: 130;
    inset: 0;
    display: flex;
    align-items: flex-end;
    background: rgba(15, 30, 52, .5);
  }
  .mobile-quote-export-sheet {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    max-height: 94dvh;
    min-width: 0;
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 22px 22px 0 0;
    background: #fff;
    box-shadow: 0 -18px 50px rgba(16, 37, 67, .24);
  }
  .mobile-quote-export-sheet > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid #e4ebf4; }
  .mobile-quote-export-sheet > header > div { display: grid; min-width: 0; gap: 2px; }
  .mobile-quote-export-sheet > header small { overflow: hidden; color: #718196; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-quote-export-sheet > header h2 { margin: 0; color: #14213d; font-size: 20px; }
  .mobile-quote-export-sheet > header button { display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 12px; background: #eef4fb; color: #35506e; }
  .mobile-quote-export-body { min-width: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px 24px; }
  .mobile-quote-export-language { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border: 1px solid #d9e4f0; border-radius: 12px; background: #f5f8fc; }
  .mobile-quote-export-language button { min-width: 0; min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: #52677d; font: inherit; font-weight: 700; }
  .mobile-quote-export-language button.active { background: #fff; color: #145fc1; box-shadow: 0 2px 8px rgba(35, 59, 91, .1); }
  .mobile-quote-export-scope { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 10px; margin-top: 10px; padding: 9px 10px; border: 1px solid #d9e4f0; border-radius: 12px; background: #f8fbff; color: #3d5874; }
  .mobile-quote-export-scope > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; white-space: nowrap; }
  .mobile-quote-export-scope > span svg { width: 17px; height: 17px; color: #3568cf; }
  .mobile-quote-export-scope label { min-width: 0; }
  .mobile-quote-export-scope select { width: 100%; min-width: 0; min-height: 42px; padding: 0 32px 0 10px; border: 1px solid #cbd9e8; border-radius: 9px; background: #fff; color: #24415f; font: inherit; font-size: 13px; font-weight: 700; }
  .mobile-quote-export-scope small { grid-column: 1 / -1; color: #718196; font-size: 11px; }
  .mobile-quote-export-status { margin: 12px 0 0; padding: 11px; border-radius: 10px; background: #f3f7fc; color: #60758d; overflow-wrap: anywhere; }
  .mobile-quote-export-status p { margin: 0; }
  .mobile-quote-export-status.is-pending { color: #155dad; }
  .mobile-quote-export-status.is-error { display: grid; gap: 8px; background: #fff2f0; color: #a6382c; }
  .mobile-quote-export-status.is-success { display: grid; gap: 8px; background: #edf9f2; color: #246b45; }
  .mobile-quote-export-status button { min-height: 44px; border: 1px solid currentColor; border-radius: 9px; background: #fff; color: inherit; font: inherit; font-weight: 750; }
  .mobile-quote-export-status > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mobile-quote-export-group { display: grid; gap: 8px; padding-top: 16px; }
  .mobile-quote-export-group h3 { margin: 0; color: #314b67; font-size: 14px; }
  .mobile-quote-export-group article { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-width: 0; padding: 10px 0; border-bottom: 1px solid #edf2f7; }
  .mobile-quote-export-group article > span { min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
  .mobile-quote-export-group article > div { display: flex; gap: 6px; }
  .mobile-quote-export-action { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 58px; min-height: 44px; padding: 0 11px; border: 1px solid #cbd9e8; border-radius: 10px; background: #fff; color: #205f9f; font: inherit; font-weight: 750; }
  .mobile-quote-export-excel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mobile-quote-export-wide { grid-column: 1 / -1; }

  .mobile-document-list-page,
  .mobile-invoice-detail { display: grid; min-width: 0; gap: 14px; }
  .mobile-document-titlebar,
  .mobile-document-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
  }
  .mobile-document-titlebar > div,
  .mobile-document-detail-header > div { display: grid; min-width: 0; gap: 3px; }
  .mobile-document-titlebar h1 { margin: 0; color: #14213d; font-size: 24px; }
  .mobile-document-titlebar p { margin: 0; color: #6b7f95; font-size: 13px; }
  .mobile-document-titlebar .btn { flex: 0 0 auto; min-height: 44px; }
  .mobile-document-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px;
    border: 1px solid #dde7f2;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(28, 58, 96, .06);
  }
  .mobile-document-search { position: relative; grid-column: 1 / -1; }
  .mobile-document-search .ui-icon { position: absolute; top: 50%; left: 12px; width: 18px; height: 18px; color: #6f8297; transform: translateY(-50%); pointer-events: none; }
  .mobile-document-search input { width: 100%; height: 44px !important; min-height: 44px !important; padding-left: 40px; }
  .mobile-document-filters select,
  .mobile-document-filters .btn { min-height: 44px; }
  .mobile-document-reset { grid-column: 1 / -1; }
  .mobile-document-list { display: grid; min-width: 0; gap: 10px; }
  .mobile-document-list .invoice-card { min-height: 92px; padding: 14px; border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(31, 76, 132, .06); }
  .mobile-document-load-more { width: 100%; min-height: 46px; }
  .mobile-document-empty { display: grid; justify-items: center; gap: 8px; padding: 34px 20px; border: 1px dashed #cbd9e8; border-radius: 16px; background: #fff; color: #667b92; text-align: center; }
  .mobile-document-empty .ui-icon { width: 28px; height: 28px; color: #3977c5; }
  .mobile-document-empty p { margin: 0; }

  .mobile-document-detail-header {
    position: sticky;
    z-index: 12;
    top: calc(-16px - env(safe-area-inset-top));
    margin: -16px 0 0;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    border-bottom: 1px solid #dce6f2;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 6px 18px rgba(30, 55, 88, .08);
    backdrop-filter: blur(12px);
  }
  .mobile-document-detail-header small { color: #71849a; }
  .mobile-document-detail-header strong { overflow: hidden; color: #15243a; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-document-back { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 12px; background: #edf4fc; color: #285f9e; }
  .mobile-document-status { flex: 0 0 auto; padding: 7px 9px; border-radius: 999px; background: #eaf3ff; color: #1f63ad; font-size: 12px; font-weight: 750; }
  .mobile-document-editor-panel { min-width: 0; padding: 10px; overflow: visible; box-shadow: none; }
  .mobile-document-editor-panel .invoice-editor-head { position: static; display: grid; gap: 12px; padding: 4px 2px 12px; }
  .mobile-document-editor-panel .invoice-editor-head .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .mobile-document-editor-panel .invoice-editor-head .actions .btn { min-width: 0; min-height: 44px; white-space: normal; }
  .mobile-document-editor-panel .invoice-form-grid,
  .mobile-document-editor-panel .bill-to-grid,
  .mobile-document-editor-panel .invoice-item-fields,
  .mobile-document-editor-panel .invoice-payment-row,
  .mobile-document-editor-panel .invoice-bottom { grid-template-columns: minmax(0, 1fr); }
  .mobile-document-editor-panel .invoice-form-grid .wide,
  .mobile-document-editor-panel .invoice-form-grid .invoice-quote-link,
  .mobile-document-editor-panel .bill-to-grid .wide,
  .mobile-document-editor-panel .invoice-item-detail { grid-column: 1; }
  .mobile-document-editor-panel .invoice-block,
  .mobile-document-editor-panel .invoice-bottom { padding: 12px; }
  .mobile-document-editor-panel .invoice-item-row,
  .mobile-document-editor-panel .invoice-payment-row { padding: 10px; }
  .mobile-document-editor-panel .voucher-import-panel,
  .mobile-document-editor-panel .voucher-section-heading { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
  .mobile-document-editor-panel .voucher-upload-button { width: 100%; min-height: 44px; }
  .mobile-document-editor-panel .domestic-receipt-item-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .mobile-document-editor-panel .domestic-receipt-item-row > *,
  .mobile-document-editor-panel .domestic-receipt-item-row > label,
  .mobile-document-editor-panel .domestic-receipt-item-row label:nth-of-type(n),
  .mobile-document-editor-panel .domestic-receipt-item-remove { grid-column: 1; width: 44px; min-width: 44px; }
  .mobile-document-editor-panel .domestic-receipt-item-index { display: none; }
  .mobile-document-editor-panel .domestic-receipt-section-head { display: grid; grid-template-columns: minmax(0, 1fr); }
  .mobile-document-editor-panel .domestic-receipt-editor-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-document-editor-panel .domestic-receipt-section-head > div:first-child { min-width: 0; }
  .mobile-document-editor-panel .domestic-receipt-section-note { grid-column: 1 / -1; }
  .mobile-document-editor-panel .domestic-receipt-total-chip { justify-content: flex-start; width: 100%; max-width: none; }
  .mobile-document-editor-panel .domestic-receipt-total-chip small { text-align: left; }
  .mobile-document-editor-panel .domestic-receipt-paid-control { height: 44px; min-height: 44px; }
  .mobile-document-editor-panel .domestic-receipt-payment-menu { max-width: calc(100vw - 72px); }
  .mobile-document-editor-panel button,
  .mobile-document-editor-panel input,
  .mobile-document-editor-panel select { min-height: 44px !important; }
  .mobile-document-editor-panel input:not([type="checkbox"]):not([type="radio"]),
  .mobile-document-editor-panel select { height: 44px !important; }

  .mobile-resource-page { min-width: 0; }
  .mobile-resource-page.tickets-layout,
  .mobile-resource-page .terms-template-layout { grid-template-columns: minmax(0, 1fr); }
  .mobile-resource-page > .panel,
  .mobile-resource-page .tickets-main { min-width: 0; padding: 14px; border-radius: 18px; }
  .mobile-resource-page .ticket-side { display: none; }
  .mobile-resource-page .ticket-hero,
  .mobile-resource-page .customer-library-hero,
  .mobile-resource-page .template-hero,
  .mobile-resource-page .template-library-section-head,
  .mobile-resource-page .hotel-card-head { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 12px; }
  .mobile-resource-page .ticket-hero h2,
  .mobile-resource-page .customer-library-hero h2,
  .mobile-resource-page .template-hero h2 { font-size: 25px; }
  .mobile-resource-page .ticket-hero .actions,
  .mobile-resource-page .customer-library-hero-actions,
  .mobile-resource-page .template-hero .actions,
  .mobile-resource-page .template-card .actions,
  .mobile-resource-page .resource-card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .mobile-resource-page .ticket-hero .actions .btn,
  .mobile-resource-page .customer-library-hero-actions .btn,
  .mobile-resource-page .template-hero .actions .btn,
  .mobile-resource-page .template-card .actions .btn,
  .mobile-resource-page .resource-card-actions .btn { min-width: 0; min-height: 44px; white-space: normal; }
  .mobile-resource-page .customer-count-badge { justify-self: start; }
  .mobile-resource-page .ticket-search,
  .mobile-resource-page .customer-library-search { display: grid; grid-template-columns: minmax(0, 1fr) minmax(88px, auto); gap: 8px; }
  .mobile-resource-page .ticket-search input,
  .mobile-resource-page .customer-library-search input { grid-column: 1 / -1; height: 44px !important; min-height: 44px !important; }
  .mobile-resource-page .ticket-search .btn,
  .mobile-resource-page .customer-library-search .btn { min-height: 44px; }
  .mobile-resource-filter-strip,
  .mobile-resource-page .ticket-city-tabs,
  .mobile-resource-page .template-library-tabs { display: flex; width: 100%; max-width: 100%; gap: 8px; padding: 2px 0 8px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; }
  .mobile-resource-filter-strip::-webkit-scrollbar,
  .mobile-resource-page .ticket-city-tabs::-webkit-scrollbar,
  .mobile-resource-page .template-library-tabs::-webkit-scrollbar { display: none; }
  .mobile-resource-filter-strip button,
  .mobile-resource-page .ticket-city-tabs button,
  .mobile-resource-page .template-library-tabs button { min-width: max-content; min-height: 44px; flex: 0 0 auto; }
  .mobile-resource-filter-strip button { display: inline-flex; align-items: center; gap: 5px; padding: 9px 13px; border: 1px solid #d3e0ef; border-radius: 999px; background: #fff; color: #526b86; font: inherit; font-size: 13px; font-weight: 750; }
  .mobile-resource-filter-strip button.active { border-color: #2f6fe4; background: #eaf2ff; color: #165fc9; }
  .mobile-resource-subfilter { padding-top: 0; }
  .mobile-resource-page .ticket-grid,
  .mobile-resource-page .vehicle-grid,
  .mobile-resource-page .template-grid,
  .mobile-resource-page .customer-library-list,
  .mobile-resource-page .terms-template-grid { grid-template-columns: minmax(0, 1fr); }
  .mobile-resource-page .ticket-card,
  .mobile-resource-page .vehicle-card,
  .mobile-resource-page .hotel-card,
  .mobile-resource-page .template-card,
  .mobile-resource-page .customer-library-card,
  .mobile-resource-page .text-template-item { min-width: 0; border-radius: 15px; }
  .mobile-resource-page .hotel-room-row { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 8px; }
  .mobile-resource-page .hotel-room-row .actions,
  .mobile-resource-page .customer-card-actions,
  .mobile-resource-page .text-template-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .mobile-resource-page .hotel-room-row .btn,
  .mobile-resource-page .customer-card-actions .btn,
  .mobile-resource-page .text-template-actions .btn { min-height: 44px; }
  .mobile-resource-page .ticket-hero > .btn,
  .mobile-resource-page .hotel-card-head .btn,
  .mobile-resource-page .template-side .btn { min-height: 44px !important; }
  .mobile-resource-page .text-template-edit-fields,
  .mobile-resource-page .template-form-grid,
  .mobile-resource-page .ticket-form-grid,
  .mobile-resource-page .ticket-price-grid,
  .mobile-resource-page .vehicle-form { grid-template-columns: minmax(0, 1fr); }
  .mobile-resource-page .text-template-edit-fields .wide { grid-column: 1; }
  .mobile-resource-page input:not([type="checkbox"]):not([type="radio"]),
  .mobile-resource-page select { height: 44px !important; min-height: 44px !important; }
  .mobile-resource-page button { min-height: 44px; }

  .quotes {
    height: auto;
    overflow: visible;
  }
  .quotes > .quote-list-panel {
    max-height: none;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .quote-list-panel > .list { overflow: visible; }
  .quote-list-toolbar { padding: 2px 2px 4px; }
  .quote-list-toolbar .section-title { min-width: 0; }
  .quote-list-toolbar .section-title > div { min-width: 0; }
  .quote-list-toolbar .section-title h2 { font-size: 24px; }
  .quote-list-toolbar .section-title p { overflow-wrap: anywhere; }
  .quote-list-toolbar .quote-list-toggle { display: none; }
  .quote-list-toolbar .btn { min-height: 44px; }
  .quote-list-card { border-radius: 14px !important; box-shadow: 0 5px 18px rgba(31, 76, 132, .06); }
  .quote-list-card.active { box-shadow: inset 3px 0 0 var(--blue), 0 5px 18px rgba(31, 76, 132, .06); }
  .quote-card-owners { flex-wrap: wrap; }
  .quote-card-actions .quote-card-action { min-height: 44px; padding: 8px 2px; }
  .quote-mobile-load-more {
    position: sticky;
    z-index: 12;
    bottom: calc(64px + env(safe-area-inset-bottom));
    width: 100%;
    min-height: 48px;
    margin: 12px 0 18px;
    box-shadow: 0 8px 24px rgba(31, 76, 132, .14);
  }

  .finance-page { gap: 14px; }
  .finance-hero,
  .finance-currency-panel,
  .finance-panel { padding: 14px; border-radius: 16px; }
  .finance-hero { gap: 14px; }
  .finance-hero h1 { font-size: 25px; }
  .finance-hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .finance-hero-actions .btn { min-width: 0; min-height: 44px; }
  .finance-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; border-radius: 16px; }
  .finance-filter-bar label { min-width: 0; }
  .finance-filter-bar label:has(select) { grid-column: 1 / -1; }
  .finance-filter-bar .btn { min-width: 0; min-height: 44px; }
  .finance-filter-bar .btn:last-child { grid-column: 1 / -1; }
  .finance-currency-head,
  .finance-panel-title { gap: 10px; }
  .finance-receivables-total { overflow-wrap: anywhere; font-size: 17px; }
  .finance-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .finance-kpi-card { grid-template-columns: 34px minmax(0, 1fr); gap: 9px; min-height: 112px; padding: 13px 11px; border-radius: 14px; }
  .finance-kpi-icon { width: 34px; height: 34px; border-radius: 11px; }
  .finance-kpi-card strong { font-size: 17px; }
  .finance-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .finance-main,
  .finance-side { gap: 14px; }
  .finance-table-wrap { overflow: visible; border: 0; }
  .finance-table,
  .finance-currency-table,
  .finance-receivables-table,
  .finance-domestic-receipts-table { display: block; min-width: 0; }
  .finance-table thead { display: none; }
  .finance-table tbody { display: grid; gap: 10px; }
  .finance-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid #dce7f2; border-radius: 12px; background: #fff; }
  .finance-table td { display: grid; min-width: 0; gap: 3px; padding: 10px 11px; border-bottom: 1px solid #edf2f7; white-space: normal; overflow-wrap: anywhere; }
  .finance-table td::before { content: attr(data-label); color: #718096; font-size: 10px; font-weight: 800; line-height: 1.25; }
  .finance-table td[colspan] { grid-column: 1 / -1; }
  .finance-table td[colspan]::before { display: none; }
  .finance-table .link-btn { min-height: 36px; }
  .finance-month-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-month-detail strong { grid-column: 1 / -1; }
  .finance-product-row { min-height: 56px; }
  .cashflow-grid,
  .finance-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .mobile-quote-export-body { padding-bottom: calc(36px + env(safe-area-inset-bottom)); }
  .manual-ticket-modal-backdrop { align-items: end; padding: 0; }
  .manual-ticket-modal-backdrop .manual-ticket-modal { width: 100%; max-width: none; max-height: 92dvh; margin: 0; overflow-y: auto; border-radius: 22px 22px 0 0; }
  .manual-ticket-modal-backdrop .manual-ticket-modal-head { position: sticky; top: 0; z-index: 2; background: #fff; }
  .manual-ticket-modal-backdrop input:not([type="checkbox"]):not([type="radio"]),
  .manual-ticket-modal-backdrop select { height: 44px !important; min-height: 44px !important; }
  .manual-ticket-modal-backdrop button { min-width: 44px !important; min-height: 44px !important; }
  .manual-ticket-modal-backdrop .customer-contact-set,
  .manual-ticket-modal-backdrop .hotel-form-grid,
  .manual-ticket-modal-backdrop .hotel-room-form-row,
  .manual-ticket-modal-backdrop .ticket-price-grid,
  .manual-ticket-modal-backdrop .vehicle-form { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  .mobile-quick-edit-grid { grid-template-columns: minmax(0, 1fr); }
  .mobile-quick-edit-wide { grid-column: auto; }
}

@media (min-width: 821px) {
  .mobile-quote-revision-backdrop,
  .mobile-quote-revision-dialog,
  .mobile-quote-export-backdrop,
  .mobile-quote-export-sheet { display: none !important; }
}
