/* Native checkbox semantics, circular selection feedback matching the reference. */
@media screen {
  input[type="checkbox"]:not([role="switch"]):not(.sr-only):not(.visually-hidden) {
    appearance: none; -webkit-appearance: none; position: relative;
    width: 22px !important; height: 22px !important; min-height: 22px !important;
    flex: 0 0 22px; padding: 0 !important; border: 2px solid var(--primary, #237e78) !important;
    border-radius: 50% !important; background: var(--surface, #fff) !important;
    vertical-align: middle; cursor: pointer; box-shadow: none;
  }
  input[type="checkbox"]:not([role="switch"])::before { content:""; position:absolute; inset:-11px; width:auto; height:auto; border:0!important; margin:0; transform:none!important; background:transparent; box-shadow:none; }
  input[type="checkbox"]:not([role="switch"])::after {
    content: ''; position: absolute; inset: 3px; background: var(--primary, #237e78);
    clip-path: polygon(12% 48%, 26% 34%, 43% 52%, 76% 18%, 91% 32%, 43% 81%);
    opacity: 0; transform: scale(.95); transition: opacity 120ms ease-out, transform 120ms cubic-bezier(.23,1,.32,1);
  }
  input[type="checkbox"]:not([role="switch"]):checked { background: var(--primary-soft, #def1eb) !important; }
  input[type="checkbox"]:not([role="switch"]):checked::after, input[type="checkbox"]:not([role="switch"]):indeterminate::after { opacity: 1; transform: scale(1); }
  input[type="checkbox"]:not([role="switch"]):indeterminate::after { clip-path: polygon(10% 40%,90% 40%,90% 60%,10% 60%); }
  input[type="checkbox"]:not([role="switch"]):focus-visible { outline: 3px solid var(--primary, #237e78); outline-offset: 4px; }
  input[type="checkbox"]:not([role="switch"]):disabled { opacity: .45; cursor: not-allowed; }
  @media (prefers-reduced-motion: reduce) { input[type="checkbox"]:not([role="switch"])::after { transition: none !important; } }
  @media (forced-colors: active) { input[type="checkbox"]:not([role="switch"]) { appearance: auto !important; } input[type="checkbox"]:not([role="switch"])::after { display: none; } }
  .mf-save-toolbar { display:flex; flex-wrap:nowrap; justify-content:flex-end; margin-block:10px; }
  .mf-save-feedback { color:var(--text-muted); overflow-wrap:anywhere; }
  :is(.mf-inline-row,.mf-inline-heading) { display:flex; flex-wrap:nowrap; align-items:center; gap:8px; min-width:0; padding-block:8px; border-bottom:1px solid var(--border); }
  .mf-inline-id { display:none; flex:0 0 44px; }
  .mf-inline-reg { display:none; flex:0 0 90px; white-space:nowrap; direction:ltr; }
  @media(min-width:601px) { .mf-inline-id,.mf-inline-reg { display:block; } }
  .mf-inline-name { flex:1 1 0; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  .mf-inline-row .mf-inline-input { flex:1 1 0; width:0; min-width:0; min-height:44px; padding:6px; font-size:16px; border:1px solid var(--border); border-radius:10px; background:var(--surface,#fff); color:var(--text,#17343b); }
  .mf-inline-row button { min-width:44px; min-height:44px; flex-shrink:0; padding:6px; white-space:nowrap; }
  .mf-inline-heading { font-weight:700; color:var(--text-muted); }
  .mf-inline-heading .mf-heading-actions { flex:0 0 100px; font-size:.8rem; }
  .mf-inline-details { padding:12px; overflow-wrap:anywhere; background:var(--primary-soft); }
  #mfListDialog form { min-width:0; }
  #mfListBody { overflow-x:hidden; }
  @media (max-width:480px) { #mfListDialog form { padding:12px!important; } .mf-inline-row { gap:4px; } }
}
/* Shared screen-only presentation. Loaded after each page's legacy head styles.
 * Keep action hooks, field names, hidden states, table columns and print geometry intact.
 * !important is limited to presentation properties overridden by historical inline CSS.
 */
@media screen {
  .icon-mask[data-icon-name="mail"] { mask-image: url('../icons/line/mail.svg') !important; }
  .icon-mask[data-icon-name="settings"] { mask-image: url('../icons/line/settings.svg') !important; }
  .icon-mask[data-icon-name="print"] { mask-image: url('../icons/line/print.svg') !important; }
  .icon-mask[data-icon-name="search"] { mask-image: url('../icons/line/search.svg') !important; }
  .icon-mask[data-icon-name="filter"] { mask-image: url('../icons/line/filter.svg') !important; }
  body.index-page :is(.fisher-roster-table, #mobileList) button[title="ارسال پیام به این صیاد"] { font-size: 0 !important; }
  body.index-page button[title="ارسال پیام به این صیاد"]::before { content: ''; flex: 0 0 19px; width: 19px; height: 19px; background: currentColor; mask: url('../icons/line/mail.svg') center / contain no-repeat; }
  body.index-page #fisherToolbar .filter-inline-control button { font-size: 0 !important; }
  body.index-page #fisherToolbar .filter-inline-control button::before { content: ''; display: block; flex: 0 0 18px; width: 18px; height: 18px; background: currentColor; mask: url('../icons/line/settings.svg') center / contain no-repeat; }
  body.index-page .fisher-roster-table :is(th, td) { white-space: nowrap !important; }
  body.index-page .fisher-roster-table td { padding-block: 6px !important; height: 52px; }
  body.index-page .fisher-roster-table .name-reg { display: flex; align-items: center; flex-wrap: nowrap !important; gap: 8px; }
  body.index-page .fisher-roster-table .name-reg strong { white-space: nowrap !important; }
  body.index-page .fisher-list-total-summary { gap: 5px; }
}
@media screen and (max-width: 780px) {
  body.index-page #mobileList { overflow-x: clip; max-width: 100%; }
  body.index-page #mobileList .fisher-card { min-width: 0; min-height: 52px; padding: 4px 8px !important; }
  body.index-page #mobileList .fisher-card-row { flex-wrap: nowrap; align-items: center; gap: 10px; }
  body.index-page #mobileList .name-reg { display: flex; flex-wrap: nowrap !important; align-items: center; gap: 8px; }
  body.index-page #mobileList .name-reg strong { white-space: nowrap !important; word-break: normal; }
  body.index-page #mobileList .person-cell.compact-person { flex: 1 1 0; min-width: 0; }
  body.index-page #mobileList .mobile-days-boxes { flex: 0 0 auto; }
  body.index-page #mobileList .mobile-sea-days-big { display: flex; flex-direction: row; align-items: center; gap: 6px; padding: 0 4px; }
  body.index-page #mobileList .mobile-sea-days-big small { margin: 0; white-space: nowrap; }
}
@media screen {
  :root {
    --muted: #536e77;
    --border: #d7e5e8;
    --shadow-soft: 0 4px 16px rgba(16, 45, 53, .045);
    --ui-focus: #087a76;
  }
  body { line-height: 1.65; }
  main, .settings-card, .settings-form, .form-group, .xl-grid { min-width: 0; }
  main :is(input, select, textarea) { max-width: 100%; min-width: 0; }
  :is(button, a, input, select, textarea, summary):focus-visible {
    outline: 3px solid var(--ui-focus) !important;
    outline-offset: 3px;
  }
  :is(.side-nav, .bottom-nav) :is(button, a):focus-visible { outline-color: #8ee8dc !important; }
  .button { min-height: 40px; font-size: 13px; line-height: 1.5; border-radius: 11px; }
  .button.compact { min-height: 36px; font-size: 12px; }
  .button, .icon-button, .side-nav-link, .bottom-nav-item {
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
  }
  .icon-button { min-width: 36px; min-height: 36px; }
  .eyebrow, .result-count, .section-heading p, .dialog-head p, .quick-action small {
    font-size: 12px; line-height: 1.8;
  }
  .section-heading h2, .section-head h2 { line-height: 1.55; }
  .section-heading > div { min-width: 0; }
  .settings-form label > span, .form-group > label { font-size: 13px; line-height: 1.7; }
  .settings-form :is(input, select, textarea):not([type=checkbox]):not([type=radio]),
  .form-group :is(input, select, textarea):not([type=checkbox]):not([type=radio]) {
    min-height: 44px; font-size: 14px; border-radius: 11px;
  }
  :is(.settings-form, .app-dialog) input:is([type=checkbox], [type=radio]) {
    width: 20px !important; height: 20px !important; min-height: 20px !important; flex: 0 0 20px; accent-color: var(--primary);
  }
  .settings-form .xl-check {
    display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 10px;
    padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: #f5faf9;
  }
  .settings-form .xl-check input { margin: 3px 0 0; }
  .xl-grid, .xl-grid .settings-card { width: 100%; }
  .xl-note, .xl-warn { overflow-wrap: anywhere; }
  .xl-scroll { max-width: 100%; }
  .alert, .flash, .empty-state { line-height: 1.9; overflow-wrap: anywhere; }
  .empty-state { padding: 24px 16px; font-size: 13px; }
  .table-wrap, .xl-scroll { overscroll-behavior-inline: contain; scrollbar-width: thin; }
  main table th { font-size: 12px; line-height: 1.6; }
  main table td { font-size: 13px; line-height: 1.65; }
  main table :is(.status-badge, .list-column-badge, .list-column-muted) { font-size: 11px; }

  /* Stable size instead of square cards whose type grows with container units. */
  body.index-page .summary-grid {
    display: grid !important; grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 10px !important; margin: 0 0 16px !important; overflow: visible !important;
  }
  body.index-page .summary-grid .summary-card {
    aspect-ratio: auto !important; container-type: normal !important;
    width: 100% !important; flex: none !important;
    height: 96px !important; min-height: 96px !important; min-width: 0 !important;
    padding: 12px 8px !important; border-radius: 16px !important; grid-column: auto !important;
    border: 1px solid var(--border); box-shadow: var(--shadow-soft) !important;
  }
  body.index-page .summary-grid .summary-card > div { gap: 7px !important; width: 100%; }
  body.index-page .summary-grid .summary-card small {
    font-size: 12px !important; line-height: 1.5 !important; white-space: normal !important;
    overflow-wrap: normal !important; color: #4b6570;
  }
  body.index-page .summary-grid .summary-card strong { font-size: 30px !important; line-height: 1.15 !important; }
  body.index-page .summary-grid .summary-card .summary-icon {
    width: 44px !important; height: 44px !important; left: -8px !important; bottom: -8px !important;
  }
  body.index-page .summary-grid .summary-card.total small { color: #fff !important; }
  body.index-page #fisherToolbar { padding: 14px !important; gap: 12px !important; }
  body.index-page #fisherToolbar :is(.button, .result-count, .toolbar-sort-label) { font-size: 12px !important; }
  body.index-page #fisherToolbar .button { min-height: 40px !important; }
  body.index-page #fisherToolbar select { font-size: 13px !important; min-height: 40px !important; }
  body.index-page .fisher-roster-table th { font-size: 12px !important; }
  body.index-page .fisher-roster-table td { font-size: 13px !important; }
  body.index-page .fisher-roster-table .person-cell :is(strong, span) { font-size: 13px !important; }

  /* Management tools remain visible; cards group them without long one-column stacks. */
  body.admin-page .admin-hero { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(0, 1.8fr); align-items: start; }
  body.admin-page .admin-hero-actions { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px; width: 100%; }
  body.admin-page .admin-hero-actions .button { width: 100%; min-height: 44px; padding: 8px 10px; white-space: normal; font-size: 12px; }
  body.admin-page .admin-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; overflow: visible; }
  body.admin-page .admin-stat { min-width: 0; padding: 14px; border: 1px solid var(--border); }
  body.admin-page .admin-stat small { font-size: 12px; line-height: 1.65; }
  body.admin-page .admin-user-card { grid-template-columns: minmax(200px, 1fr) auto; gap: 12px; }
  body.admin-page .admin-user-main h3 { font-size: 14px; line-height: 1.7; }
  body.admin-page .admin-user-main p { font-size: 13px; }
  body.admin-page .admin-user-metrics { flex-wrap: wrap; overflow: visible; }
  body.admin-page .admin-user-metrics span { font-size: 12px; }
  body.admin-page .admin-user-actions { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 10px; }
  body.admin-page .admin-user-actions .button { min-height: 38px; font-size: 12px; }
  body.admin-page .admin-user-actions .danger { margin-inline-start: auto; }
  .side-nav .side-nav-label { font-size: 13px; }
  .side-nav .side-nav-wallet :is(small, strong) { font-size: 12px; }

  /* Native and overlay dialogs share type, spacing and scroll treatment. */
  .app-dialog { overscroll-behavior: contain; scrollbar-width: thin; }
  .app-dialog .dialog-head h2 { font-size: 20px; line-height: 1.5; }
  .app-dialog .dialog-head p { font-size: 13px; }
  .app-dialog :is(.form-group > label, .form-group small, .form-hint, .muted) { font-size: 12px; line-height: 1.8; }
  .app-dialog .dialog-actions { gap: 10px; flex-wrap: wrap; }
  .app-dialog .dialog-actions .button { min-height: 42px; font-size: 13px; }
  .app-dialog .dialog-head .icon-button { width: 40px; height: 40px; flex: 0 0 40px; }
  .fisher-profile-dialog[open] { overflow: hidden !important; }
  .fisher-profile-dialog > form { max-height: calc(100dvh - 24px) !important; }
  .fisher-profile-dialog .fisher-profile-scroll { min-height: 0; overscroll-behavior: contain; }
  .app-dialog[open] { animation: ui-dialog-enter .18s ease-out; }
  .app-dialog-overlay .app-dialog { animation: ui-dialog-enter .18s ease-out; }
  .fisher-columns-dialog .column-picker-option { font-size: 12px !important; min-height: 40px !important; }
  .fisher-columns-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
  .fisher-columns-dialog :is(.fisher-columns-dialog-head, .fisher-columns-dialog-actions) { flex: 0 0 auto; }
  .fisher-columns-dialog .fisher-columns-dialog-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
  .fisher-columns-dialog .fisher-columns-toolbar { flex: 0 0 auto; }
  .fisher-columns-dialog .fisher-columns-groups { flex: 1 1 auto; min-height: 0; overflow: auto; grid-auto-rows: max-content; align-content: start; }
  .fisher-columns-dialog .column-picker-group { overflow: visible !important; }
  .fisher-columns-dialog .fisher-columns-dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; }
  .fisher-columns-dialog .fisher-columns-live-note { grid-column: 1 / -1; font-size: 11px; }
  .fisher-columns-dialog .fisher-columns-dialog-spacer { display: none; }
  .fisher-columns-dialog .fisher-columns-dialog-actions .button { height: 44px; min-height: 44px; }
  .fisher-columns-dialog .column-picker-group-head strong { font-size: 13px !important; }
  .fisher-columns-dialog .column-picker-group-head small { font-size: 11px !important; }
  .fisher-columns-dialog .column-picker-group-head .button { font-size: 11px !important; }
  .fisher-columns-dialog .fisher-columns-groups { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .fisher-columns-dialog .column-picker-options { grid-template-columns: 1fr !important; }
  .auth-card :is(p, .auth-hint) { font-size: 13px; line-height: 1.9; }
  .auth-card .button { min-height: 46px; font-size: 14px; }
  body.traffic-page :is(.fuel-stat-chip, .fuel-tool-menu-btn, .fuel-filter-btn) { font-size: 12px; min-height: 38px; }
  body.traffic-page .fuel-stage-tabs button { min-height: 44px; }
  body.traffic-page :is(.fuel-col-search, .fuel-sort-select) { min-height: 42px; font-size: 14px; }
  body.traffic-page .fuel-col-search { border: 1px solid var(--border) !important; border-radius: 11px; background: #fff; }
  body.traffic-page :is(.fuel-stage-caption, .fuel-stage-time, .fuel-card-reg, .fuel-card-stage-chip) { font-size: 12px; }
  body.traffic-page .fuel-stage-card:focus-within .fuel-row-tool { opacity: 1; pointer-events: auto; }
  body.traffic-page :is(.fuel-stage-more-btn, .fuel-stage-tools-toggle) { width: 40px; height: 40px; }
  body.traffic-page .fuel-toolbar :is(.search-form, .search-box) { min-width: 0; }
  body.traffic-page .fuel-toolbar input { border: 1px solid var(--border); }
  .guest-modal-header { min-height: 84px; padding: 14px 18px; }
  .guest-modal-form { gap: 12px; }
  .guest-modal-fisher-card { padding: 12px; border-radius: 18px; }
  .guest-national-grid-large { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .guest-national-grid-large > div { min-height: 72px; padding: 12px; }
  .guest-national-grid-large .guest-national-id { font-size: 18px !important; overflow-wrap: anywhere; }
  .guest-history-head small, .guest-history-empty { font-size: 12px; }
  .guest-history-empty { padding: 14px; }
  .guest-type-options input:focus-visible + span,
  .guest-days-grid input:focus-visible + span,
  .guest-unknown-reasons input:focus-visible + span { outline: 3px solid #0f766e; outline-offset: 3px; }
  @keyframes ui-dialog-enter { from { opacity: .65; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
}
@media screen and (min-width: 781px) {
  body.index-page #fisherToolbar { display: grid !important; grid-template-columns: minmax(0, 1fr); overflow: visible; white-space: normal; }
  body.index-page #fisherToolbar > .search-form {
    display: grid !important; grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(185px, 1fr)) !important;
    width: 100%; min-width: 0; gap: 10px;
  }
  body.index-page #fisherToolbar > .toolbar-meta { display: flex !important; flex-wrap: wrap; gap: 10px; border-top: 1px solid var(--border); padding-top: 12px; }
  body.index-page #fisherToolbar .filter-inline-control { display: grid !important; grid-template-columns: 20px minmax(0, 1fr) 36px; width: auto !important; min-width: 0; gap: 6px; }
  body.index-page #fisherToolbar .filter-leading-icon { width: 20px; flex-basis: 20px; }
  body.index-page #fisherToolbar .filter-inline-control select { width: 100%; min-width: 0; }
  body.index-page #fisherToolbar .icon-only-button { width: 36px; height: 40px; }
  body.index-page #fisherToolbar .search-box { width: 100%; min-width: 0 !important; max-width: none !important; height: 44px !important; }
  body.index-page #fisherToolbar .search-box input { font-size: 14px !important; }
}
@media screen and (max-width: 1100px) and (min-width: 781px) {
  body.index-page #fisherToolbar > .search-form { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  body.index-page .summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  body.admin-page .admin-hero { grid-template-columns: 1fr; }
  body.admin-page .admin-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.admin-page .admin-user-card { grid-template-columns: 1fr; }
}
@media screen and (max-width: 780px) {
  body { font-size: 14px; }
  main.container { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  main :is(input, select, textarea):not([type=checkbox]):not([type=radio]) { font-size: 16px !important; }
  main :is(.button, .icon-button) { min-height: 44px; }
  .settings-card { padding: 18px 14px; background: #fff; border: 1px solid var(--border); border-radius: 16px; }
  .section-heading p, .section-head p { font-size: 13px; line-height: 1.8; }
  body.index-page .summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 7px !important; margin-bottom: 12px !important; }
  body.index-page .summary-grid .summary-card { height: 82px !important; min-height: 82px !important; padding: 7px 4px !important; border-radius: 13px !important; }
  body.index-page .summary-grid .summary-card.total { grid-column: span 2 !important; }
  body.index-page .summary-grid .summary-card small { font-size: 12px !important; line-height: 1.4 !important; }
  body.index-page .summary-grid .summary-card strong { font-size: 25px !important; }
  body.index-page #fisherToolbar { padding: 10px !important; }
  body.index-page #fisherToolbar.mobile-filters-open { position: relative !important; top: auto !important; }
  body.index-page .mobile-toolbar-icon-btn { width: 44px !important; height: 44px !important; flex-basis: 44px !important; }
  body.index-page .toolbar-meta .button { min-height: 44px !important; white-space: normal; }
  body.index-page .fisher-card :is(.person-cell strong, .mobile-days strong) { font-size: 13px !important; }
  body.index-page .fisher-card :is(.person-cell span, .mobile-sea-days span, .mobile-ranking-line small) { font-size: 11px !important; }
  body.index-page .fisher-card .icon-button { min-width: 40px; min-height: 44px; }
  body.admin-page .admin-hero { grid-template-columns: 1fr; gap: 16px; }
  body.admin-page .admin-hero-actions { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  body.admin-page .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.admin-page .admin-user-card { grid-template-columns: 1fr; }
  body.admin-page .admin-user-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.admin-page .admin-user-actions :is(.button, form) { width: 100%; min-height: 44px; }
  body.admin-page .admin-user-actions .danger { margin-inline-start: 0; }
  .bottom-nav .bottom-nav-label { font-size: 11px; }
  .bottom-nav .bottom-nav-item { color: #d5e8eb; }
  .bottom-nav .bottom-nav-item { min-height: 52px; }
  .bottom-nav .bottom-nav-item.active { color: #a2f3e8; }
  .app-dialog { max-height: calc(100dvh - 24px) !important; }
  .fisher-profile-dialog > form { height: calc(100dvh - 24px) !important; }
  .app-dialog :is(input, select, textarea):not([type=checkbox]):not([type=radio]) { font-size: 16px !important; }
  .app-dialog .dialog-head h2 { font-size: 18px !important; }
  .app-dialog .dialog-head p { font-size: 12px !important; }
  .app-dialog .dialog-actions .button { min-height: 44px; }
  .fisher-columns-dialog .fisher-columns-groups { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  body.traffic-page .fuel-toolbar-actions .fuel-toolbar-btn { font-size: 12px !important; }
  body.traffic-page .fuel-toolbar-actions .fuel-toolbar-btn span { display: inline !important; }
  body.traffic-page .fuel-stage-tools-menu { gap: 8px; }
}
@media screen and (max-width: 420px) {
  .fisher-columns-dialog .fisher-columns-groups { grid-template-columns: 1fr !important; }
  .app-dialog .dialog-actions.end { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Minimal presentation: flat surfaces, one accent, and a consistent spacing scale.
 * Semantic status colors and all action/visibility hooks stay owned by the page.
 */
@media screen {
  :root {
    --bg: #f5f7f8; --surface: #fff; --surface-solid: #fff;
    --surface-soft: #f8fafb; --text: #24383e; --text-muted: #60747b;
    --border: #e0e7ea; --border-strong: #cbd7dc;
    --primary: #0f766e; --primary-soft: #edf7f5;
    --radius: 14px; --radius-sm: 10px;
    --shadow: 0 2px 8px rgba(24, 48, 56, .035);
    --shadow-soft: 0 1px 4px rgba(24, 48, 56, .025);
  }
  body { background: var(--bg) !important; }
  .ambient { display: none; }
  .glass-card { background: #fff; border: 1px solid var(--border); backdrop-filter: none; box-shadow: none !important; }
  :is(.hero-panel, .panel, .settings-card, .admin-hero, .admin-users-panel) { border-radius: 14px !important; }
  :is(.hero-panel, .admin-hero) { background: #fff !important; }
  :is(.hero-panel, .admin-hero)::before, :is(.hero-panel, .admin-hero)::after { display: none; }
  .section-head h2, .section-heading h2, .hero-copy h2, .admin-hero h2 { font-size: 22px; letter-spacing: 0; }
  .eyebrow { letter-spacing: 0; }
  .button, .quick-action { box-shadow: none !important; border-radius: 9px !important; }
  .button.primary, .quick-action.primary-action { background: var(--primary) !important; }
  .button.ghost, .button.outline { background: #fff; border-color: var(--border); }
  .button:hover, .quick-action:hover { transform: none; }
  :is(.avatar, .admin-avatar) { background: #edf7f5 !important; color: #0b625a !important; border-radius: 9px !important; box-shadow: none !important; }
  .quick-action { background: #fff; border-color: var(--border); }
  .side-nav { background: #173b40 !important; box-shadow: none !important; border-inline-start: 1px solid #284a4e; }
  .side-nav-brand-mark { background: #0f766e; box-shadow: none; border-radius: 10px; }
  .side-nav-link { border-radius: 8px; font-weight: 600; }
  .side-nav-link.active { background: #285055; border-left-color: #7bd7c9; }
  .side-nav-wallet, .side-nav-wallet:hover, .side-nav-wallet.active { background: #21464b; box-shadow: none; border-radius: 10px; transform: none; }
  .topbar { background: #173b40; box-shadow: none; border-radius: 14px; }
  .topbar::before { display: none; }
  .brand-mark { background: #0f766e; box-shadow: none; border-radius: 10px; }
  .bottom-nav { background: #173b40 !important; backdrop-filter: none; box-shadow: none !important; }
  body.index-page .summary-grid .summary-card { height: 80px !important; min-height: 80px !important; background: #fff !important; border-radius: 12px !important; }
  body.index-page .summary-grid .summary-card.total { background: #edf7f5 !important; border-color: #bbdcd4; }
  body.index-page .summary-grid .summary-card.total :is(small, strong) { color: #0b625a !important; }
  body.index-page .summary-grid .summary-card .summary-icon { opacity: .08 !important; }
  body.index-page .summary-grid .summary-card strong { font-size: 26px !important; }
  body.index-page .summary-grid .summary-card:hover { transform: none !important; }
  body.index-page #fisherToolbar { border: 1px solid var(--border); border-radius: 12px !important; background: #fff !important; box-shadow: none !important; }
  body.index-page .fisher-roster-table th { background: #f8fafb !important; font-weight: 600; }
  body.index-page .fisher-roster-table td { border-bottom-color: #eaf0f2; }
  body.index-page .fisher-card { border-radius: 12px !important; box-shadow: none !important; }
  body.index-page .fisher-card :is(.mobile-ranking-line > div, .mobile-sea-days) { border-radius: 8px; background: #f8fafb; }
  body.admin-page .admin-hero { grid-template-columns: 1fr; gap: 20px; padding: 24px; }
  body.admin-page .admin-hero > div:first-child { border-bottom: 1px solid var(--border); padding-bottom: 16px; }
  body.admin-page .admin-hero h2 { margin: 0 0 6px; }
  body.admin-page .admin-hero p { max-width: none; margin: 0; }
  body.admin-page .admin-hero .eyebrow { margin-bottom: 6px; }
  body.admin-page .admin-hero-actions .button { font-weight: 600; }
  body.admin-page .admin-hero-actions { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 10px; }
  body.admin-page :is(.admin-stat, .admin-user-card) { background: #fff !important; border-radius: 12px !important; box-shadow: none !important; }
  body.admin-page .admin-user-card:hover { transform: none; }
  body.admin-page .admin-user-actions { gap: 8px; }
  .app-dialog { border: 1px solid var(--border); border-radius: 14px !important; box-shadow: 0 16px 48px rgba(15, 40, 48, .15) !important; }
  .app-dialog .dialog-head { margin-bottom: 16px; padding-bottom: 16px; }
  .app-dialog :is(.dialog-head h2, .fisher-profile-name) { letter-spacing: 0; }
  .app-dialog .icon-button { background: #f8fafb; border-radius: 9px; }
  .app-dialog .icon-only-button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid var(--border); border-radius: 9px; background: #f8fafb; font: inherit; cursor: pointer; }
  .fisher-columns-dialog .column-picker-group { border-radius: 10px !important; }
  body.traffic-page .fuel-stage-card { border-radius: 10px !important; box-shadow: none !important; }
  body.traffic-page .fuel-stage-card:hover { transform: none !important; }
  body.traffic-page .fuel-stage-card.fuel-focus-active { outline: 2px solid var(--stage); outline-offset: -2px; }
  .guest-modal-panel { background: #f5f7f8; }
  .guest-modal-header { background: #173b40; box-shadow: none; }
  .guest-modal-form :is(.guest-modal-fisher-card, .guest-national-grid-large > div, .guest-type-fieldset, .guest-date-section, .guest-unknown-reasons) { border-radius: 12px; box-shadow: none; border: 1px solid var(--border); }
}
@media screen and (min-width: 781px) {
  .page-content { margin-top: 24px; }
  body.index-page #fisherToolbar > .toolbar-meta { justify-content: flex-start; }
}
@media screen and (min-width: 781px) and (max-width: 1100px) {
  body.admin-page .admin-hero-actions { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media screen and (max-width: 780px) {
  .container { width: calc(100% - 24px); }
  .page-content { margin-top: 12px; }
  :is(.section-head h2, .section-heading h2, .hero-copy h2, .admin-hero h2) { font-size: 19px; }
  .settings-card { padding: 16px; }
  .app-dialog :is(.icon-only-button, .dialog-head .icon-button) { width: 44px; height: 44px; flex-basis: 44px; }
  body.index-page .summary-grid { gap: 6px !important; }
  body.index-page .summary-grid .summary-card { height: 72px !important; min-height: 72px !important; padding: 6px 4px !important; border-radius: 10px !important; }
  body.index-page .summary-grid .summary-card strong { font-size: 23px !important; }
  body.index-page #fisherToolbar { padding: 10px !important; }
  body.admin-page .admin-hero { padding: 16px; gap: 16px; }
  body.admin-page .admin-hero-actions { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  body.admin-page .admin-hero-actions .button { white-space: normal; min-height: 48px; }
  body.admin-page .admin-stat { padding: 12px; }
  .guest-modal-header { padding: 12px 16px; }
  body.traffic-page .fuel-row-tools :is(.fuel-row-tool, .fuel-approve-btn, .fuel-confirm-btn, .fuel-minimal-action) { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
}

/* Reference: desktop top navigation (plan 2), mobile bottom tabs (plan 3). */
@media screen {
  :root { --bg: #f4f6f8; --text: #14202b; --muted: #5b6b7a; --text-muted: #5b6b7a; --primary: #0f6e75; --primary-dark: #0b5359; --primary-soft: #e1f1f2; --border: #dde3e8; --border-strong: #cbd4db; }
  .desktop-account-trigger { display: none; }
  .side-nav-brand-mark, .brand-mark, .side-nav-link.active .sidenav-mask-icon { animation: none !important; }
  .side-nav-brand-mark::after, .brand-mark::after { display: none; }
  .side-nav { background: #fff !important; color: #3a4a59; border-color: var(--border); }
  .side-nav-brand-text { color: #14202b; }
  .side-nav-link { color: #3a4a59; min-height: 44px; }
  .side-nav-link:hover { background: #eaf0f3; color: #14202b; }
  .side-nav-link.active { background: #e1f1f2; color: #0b5359; border-left-color: transparent; }
  .side-nav-link.danger { color: #b3261e; }
  .side-nav-wallet, .side-nav-wallet:hover, .side-nav-wallet.active { background: #f8fafb; color: #14202b; border-color: var(--border); }
  .side-nav-wallet-main :is(small, b), .side-nav-today small { color: #5b6b7a; }
  .side-nav-today strong { color: #14202b; }
  .side-nav-wallet-icon, .side-nav-wallet-plus { background: #e1f1f2; color: #0b5359; }
  .side-nav-footer, .side-nav-divider { border-color: var(--border); }
  .side-nav-close-btn, .side-nav-privacy-mini { color: #3a4a59; }
  .bottom-nav { background: #fff !important; border-top: 1px solid var(--border); }
  .bottom-nav .bottom-nav-item { color: #5b6b7a; }
  .bottom-nav .bottom-nav-item.active { color: #0b5359; background: #e1f1f2; }
  :is(.side-nav, .bottom-nav) :is(button, a):focus-visible { outline-color: #0f6e75 !important; }
}
@media screen and (min-width: 901px) {
  :root { --sidenav-w: 0px !important; --sidenav-w-collapsed: 0px !important; }
  body, html.sidenav-collapsed body { padding-right: 0 !important; }
  .side-nav, html.sidenav-collapsed .side-nav {
    position: sticky; top: 0; right: auto; bottom: auto; width: 100% !important; height: auto;
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center;
    gap: 16px; padding: 12px 24px; overflow: visible; border-inline-start: 0; border-bottom: 1px solid var(--border);
    transform: none !important; transition: none;
  }
  .side-nav-top { grid-column: 1; grid-row: 1; margin: 0; padding: 0; }
  .side-nav-brand { min-width: 138px; }
  .side-nav-brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
  .side-nav-wallet { grid-column: 3; grid-row: 1; min-height: 44px; margin: 0; padding: 6px 10px; }
  .side-nav-wallet-main { gap: 0; }
  .side-nav-wallet-main small { font-size: 10px; }
  .side-nav-links { grid-column: 2; grid-row: 1; display: flex; flex-direction: row; gap: 3px; min-width: 0; overflow-x: auto; }
  .side-nav-links .side-nav-link { flex: 0 0 auto; gap: 6px; padding: 8px; font-size: 12px; }
  html.sidenav-collapsed .side-nav-label, html.sidenav-collapsed .side-nav-brand-text { display: inline !important; }
  html.sidenav-collapsed .side-nav-link { justify-content: flex-start; }
  .side-nav :is(.side-nav-collapse-btn, .side-nav-resizer, .side-nav-close-btn) { display: none !important; }
  .desktop-account-trigger { grid-column: 4; grid-row: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: #3a4a59; cursor: pointer; font: inherit; font-size: 13px; white-space: nowrap; }
  .desktop-account-trigger .icon-mask:last-child { transform: rotate(-90deg); }
  #desktopAccountMenu:not(:is(:popover-open,.is-popover-open)) { display: none !important; }
  #desktopAccountMenu:is(:popover-open,.is-popover-open) { display: flex; position: fixed; inset: 72px  auto auto 24px; width: 270px; max-height: calc(100dvh - 96px); overflow: auto; margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: #3a4a59; box-shadow: 0 12px 32px rgba(20, 32, 43, .12); }
  #desktopAccountMenu::backdrop { background: transparent; }
  body:has(.side-nav) .page-content { width: min(1480px, calc(100% - 40px)) !important; margin-inline: auto; }
  .page-ops-dock, html.sidenav-collapsed .page-ops-dock { left: 50%; max-width: calc(100vw - 48px); }
}
@media screen and (min-width: 901px) and (max-width: 1200px) {
  .side-nav, html.sidenav-collapsed .side-nav { grid-template-columns: 1fr auto auto; gap: 8px 16px; padding: 10px 20px; }
  .side-nav-wallet { grid-column: 2; }
  .desktop-account-trigger { grid-column: 3; }
  .side-nav-links { grid-column: 1 / -1; grid-row: 2; }
  #desktopAccountMenu:is(:popover-open,.is-popover-open) { top: 64px; }
}
@media screen and (max-width: 900px) {
  #desktopAccountMenu { display: flex; position: static; inset: auto; width: auto; max-height: none; margin: 8px 0 0; padding: 10px 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; color: inherit; overflow: visible; }
  .side-nav { border-inline-start: 1px solid var(--border); }
  .side-nav-today { background: #f8fafb; }
  .bottom-nav .bottom-nav-item { min-height: 56px; }
  .bottom-nav .bottom-nav-item.active { border-radius: 10px; margin: 4px 2px; }
}

/* Quiet card motion: finite, local feedback; no timers or permanent layers.
 * Animate only small content, never form containers or long list rows.
 */
@media screen and (prefers-reduced-motion: no-preference) {
  .summary-card, .admin-stat { --card-tint: #eff8f8; --card-edge: #b9dcdc; }
  .summary-card.danger { --card-tint: #fff3f4; --card-edge: #edd2d7; }
  .summary-card.warning { --card-tint: #fff9ed; --card-edge: #eddfbc; }
  .summary-card.soon { --card-tint: #f1f5ff; --card-edge: #d4dff0; }
  .summary-card.success { --card-tint: #eff9f3; --card-edge: #c6e5d1; }
  .summary-card.neutral, .summary-card.trash { --card-tint: #f3f5f7; --card-edge: #d6dfe6; }
  :is(.summary-card, .admin-stat) strong {
    display: inline-block;
    animation: ui-count-arrive 360ms cubic-bezier(.2,.7,.3,1) backwards;
    transition: transform 180ms ease;
  }
  :is(.summary-card, .admin-stat):nth-child(2) strong { animation-delay: 30ms; }
  :is(.summary-card, .admin-stat):nth-child(3) strong { animation-delay: 60ms; }
  :is(.summary-card, .admin-stat):nth-child(4) strong { animation-delay: 90ms; }
  :is(.summary-card, .admin-stat):nth-child(5) strong { animation-delay: 120ms; }
  :is(.summary-card, .admin-stat):nth-child(6) strong { animation-delay: 150ms; }
  :is(.summary-card, .admin-stat):nth-child(7) strong { animation-delay: 180ms; }
  .summary-card .summary-icon { transition: transform 220ms ease, opacity 220ms ease; }
  :is(.settings-card, .wallet-topup-card, .wallet-history-card, .profile-wallet-card, .fuel-stage-panel, #fisherToolbar) {
    transition: border-color 180ms ease, background-color 180ms ease;
  }
  :is(.settings-card, .wallet-topup-card, #fisherToolbar):focus-within { border-color: #a8cece !important; }
  :is(.profile-wallet-icon, .wallet-balance-large strong, .days-total strong, .mobile-traffic-score strong) {
    transition: transform 220ms cubic-bezier(.2,.7,.3,1);
  }
  .fuel-stage-dot { transition: transform 200ms ease; }
  .fuel-stage-tab:focus-visible .fuel-stage-dot { animation: ui-stage-confirm 400ms ease-out; }
  body.index-page button[title="ارسال پیام به این صیاد"]::before { transition: transform 180ms ease; }
  body.index-page button[title="ارسال پیام به این صیاد"]:focus-visible::before { transform: translateY(-2px) rotate(-6deg); }
  @keyframes ui-count-arrive { from { opacity: .35; transform: translateY(5px); } to { opacity: 1; transform: none; } }
  @keyframes ui-stage-confirm { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.35); } }
}
@media screen and (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  :is(.summary-card, .admin-stat) { transition: background-color 220ms ease, border-color 220ms ease; }
  body.index-page .summary-grid .summary-card:hover, .traffic-summary .summary-card:hover, .admin-stat:hover {
    background: var(--card-tint) !important; border-color: var(--card-edge) !important;
  }
  body.index-page .summary-card:hover .summary-icon { opacity: .2 !important; transform: translateY(-2px); }
  body.index-page .summary-card.danger:hover .summary-icon { transform: rotate(-8deg); }
  body.index-page .summary-card.soon:hover .summary-icon { transform: translateX(-3px); }
  body.index-page .summary-card.success:hover .summary-icon { transform: scale(1.08); }
  body.index-page .summary-card.trash:hover .summary-icon { transform: rotate(6deg); }
  .admin-stat:hover strong { transform: translateY(-2px); }
  .profile-wallet-card:hover .profile-wallet-icon { transform: translateY(-3px) rotate(-4deg); }
  .wallet-balance-large:hover strong { transform: translateY(-2px); }
  :is(.traffic-table tbody tr:hover .days-total, .traffic-card:hover .mobile-traffic-score) strong { transform: translateY(-2px); }
  .fuel-stage-tab:hover .fuel-stage-dot, .fuel-stage-panel:hover .fuel-stage-title-wrap > .fuel-stage-dot { animation: ui-stage-confirm 400ms ease-out; }
  body.index-page button[title="ارسال پیام به این صیاد"]:hover::before { transform: translateY(-2px) rotate(-6deg); }
}

/* Soft color surfaces: static CSS gradients, with clear space for content. */
@media screen {
  body {
    background: radial-gradient(ellipse at 100% 0, #e5f2f1 0, transparent 52%),
      radial-gradient(ellipse at 0 30%, #ecf0fa 0, transparent 48%), #f5f7fa !important;
  }
  :is(.settings-card, .wallet-topup-card, .wallet-history-card, .admin-users-panel) {
    background: linear-gradient(135deg, #fff 65%, #f1f8f8) !important;
  }
  :is(.hero-panel, .admin-hero, .wallet-hero, .profile-wallet-card) {
    background: linear-gradient(115deg, #f9fbff, #fff 48%, #eaf6f3) !important;
    border-color: #d5e5e4;
  }
  body.index-page #fisherToolbar { background: linear-gradient(125deg, #fff 48%, #f0f8f7) !important; }
  :is(.summary-card, .admin-stat) { --surface-tint: #edf7f7; --surface-edge: #cbe3e3; }
  .summary-card.total { --surface-tint: #def1ec; --surface-edge: #b6dad0; }
  .summary-card.danger { --surface-tint: #fae9ed; --surface-edge: #ebd2d9; }
  .summary-card.warning { --surface-tint: #fff1d8; --surface-edge: #ecdfc2; }
  .summary-card.soon { --surface-tint: #e9effc; --surface-edge: #d4ddf0; }
  .summary-card.success { --surface-tint: #e5f5e9; --surface-edge: #c8e3d0; }
  .summary-card.neutral, .summary-card.trash { --surface-tint: #edf0f5; --surface-edge: #d8dfe8; }
  body.index-page .summary-grid .summary-card, .traffic-summary .summary-card, .admin-stat {
    background: linear-gradient(135deg, #fff 8%, var(--surface-tint)) !important;
    border-color: var(--surface-edge);
  }
  .button.primary, .quick-action.primary-action {
    background: linear-gradient(120deg, #0b6268, #218880) !important;
  }
  .button.ghost, .button.outline, .quick-action:not(.primary-action):not(.danger) {
    background: linear-gradient(135deg, #fff, #edf6f6);
    border-color: #d0e2e3;
  }
  .desktop-account-trigger { background: linear-gradient(135deg, #fff, #f0f6fa); }
  .side-nav-wallet, .side-nav-wallet:hover, .side-nav-wallet.active {
    background: linear-gradient(120deg, #f5f9fc, #e8f4f1);
  }
  body.index-page .fisher-roster-table th { background: #eef4f6 !important; }
  body.index-page .fisher-card { background: linear-gradient(115deg, #fff 72%, #f2f8f7) !important; }
}

/* Traffic summary fills its row; pastel totals need dark text. */
@media screen {
  .traffic-summary { display: grid !important; grid-template-columns: repeat(7, minmax(0, 1fr)) !important; width: 100%; gap: 8px; }
  .traffic-summary .summary-card { width: auto !important; max-width: none !important; min-width: 0 !important; grid-column: auto; justify-content: center; text-align: center; }
  .traffic-summary .summary-card.total :is(small, strong) { color: #0b5359 !important; }
  .traffic-summary .summary-card.total .summary-icon { color: #0f6e75; }
  .side-nav-wallet-main strong { font-size: 15px; line-height: 1.4; }
}
@media screen and (max-width: 900px) {
  .traffic-summary { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .traffic-summary .summary-card.total { grid-column: span 2; }
  .traffic-summary .summary-card { min-height: 72px; }
  .traffic-summary .summary-card small { font-size: 11px; line-height: 1.5; }
}
@media screen and (max-width: 600px) {
  .traffic-summary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media screen and (prefers-reduced-motion: no-preference) {
  .side-nav-wallet-main strong { animation: ui-wallet-amount 420ms ease-out; }
  @keyframes ui-wallet-amount { from { opacity: .45; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}

/* Light wallet surfaces replace the legacy dark hero: pair text with that surface. */
@media screen {
  .wallet-hero, .profile-wallet-card { color: #14202b; }
  .wallet-hero .eyebrow { color: #0b6268; }
  .wallet-hero p, .wallet-balance-large :is(small, span),
  .profile-wallet-copy > span, .profile-wallet-copy strong small, .profile-wallet-copy p { color: #536577; }
  .wallet-balance-large { background: #edf7f5; border-color: #c6dfda; color: #0b5359; }
  .profile-wallet-icon { background: #dfeeed; color: #0b6268; }
  .profile-wallet-card .button { background: #fff; border-color: #c6dfda; color: #0b5359; }
  .profile-wallet-card .button:hover { background: #e1f1ed; }
  .profile-api-code code { background: transparent; color: inherit; }
  /* Mobile dock originally assumed dark outlined buttons; these now have light fills. */
  .button:is(.ghost, .outline):not(.primary):not(.danger):not(.danger-ghost) { color: #0b5359 !important; }
}

/* Compact table toolbar: filters/reset together, then a short action row. */
@media screen and (min-width: 781px) {
  body.index-page #fisherToolbar { padding: 8px 10px !important; gap: 8px !important; }
  body.index-page #fisherToolbar > .search-form {
    grid-template-columns: minmax(200px, 1.25fr) repeat(3, minmax(145px, 1fr)) !important;
    gap: 6px !important; align-items: center;
  }
  body.index-page #fisherToolbar > .search-form:has(.fisher-filter-reset) {
    grid-template-columns: minmax(200px, 1.25fr) repeat(3, minmax(145px, 1fr)) auto !important;
  }
  body.index-page #fisherToolbar .filter-inline-control { grid-template-columns: minmax(0, 1fr) 32px; gap: 4px; }
  body.index-page #fisherToolbar .filter-leading-icon { display: none; }
  body.index-page #fisherToolbar :is(.search-box, .search-select, .icon-only-button, .button) {
    height: 36px !important; min-height: 36px !important; border-radius: 8px !important;
  }
  body.index-page #fisherToolbar .icon-only-button { width: 32px; padding: 0; }
  body.index-page #fisherToolbar .search-box { padding-inline: 10px; }
  body.index-page #fisherToolbar .search-box input { font-size: 13px !important; }
  body.index-page #fisherToolbar select { font-size: 12px !important; padding-inline: 9px; }
  body.index-page #fisherToolbar > .toolbar-meta { gap: 6px; padding: 0 !important; margin: 0 !important; border-top: 0; justify-content: flex-start; align-items: center; }
  body.index-page #fisherToolbar .toolbar-meta .button { padding-inline: 10px; white-space: nowrap; }
  body.index-page #fisherToolbar .result-count { margin: 0 !important; }
  body.index-page #fisherToolbar .toolbar-meta > label { margin-inline-end: auto; }
  body.index-page #fisherToolbar .list-sort-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  body.index-page #fisherToolbar .toolbar-meta > label select { width: 122px; }
  body.index-page #fisherToolbar .fisher-filter-reset { width: auto !important; min-width: 62px; padding-inline: 9px; }
}
@media screen and (min-width: 781px) and (max-width: 1100px) {
  body.index-page #fisherToolbar > .search-form,
  body.index-page #fisherToolbar > .search-form:has(.fisher-filter-reset) { display: flex !important; flex-wrap: wrap; }
  body.index-page #fisherToolbar .search-box { order: -2; flex: 1 1 calc(100% - 80px); }
  body.index-page #fisherToolbar .fisher-filter-reset { order: -1; flex: 0 0 auto; }
  body.index-page #fisherToolbar .filter-inline-control { flex: 1 1 calc((100% - 12px) / 3); }
}

/* Admin tools belong to a local sidebar; existing dialog/action hooks stay intact. */
@media screen {
  body.admin-page .admin-panel-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); align-items: start; gap: 14px 18px; }
  .admin-panel-layout > :not(.admin-panel-sidebar) { grid-column: 2; min-width: 0; }
  .admin-panel-sidebar { grid-column: 1; grid-row: 1 / span 3; position: sticky; top: 110px; padding: 12px; max-height: calc(100dvh - 126px); overflow-y: auto; }
  .admin-panel-menu-title { margin: 0 0 10px; padding: 0 8px 10px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 15px; }
  body.admin-page .admin-panel-menu { display: flex !important; flex-direction: column; gap: 4px !important; position: static; inset: auto; margin: 0; padding: 0; width: 100%; border: 0; background: transparent; color: var(--text); overflow: visible; }
  body.admin-page .admin-panel-menu .button { justify-content: flex-start; width: 100%; min-height: 40px; padding: 8px 10px; font-size: 12px; text-align: start; white-space: normal; }
  body.admin-page .admin-panel-menu .button:not(.primary) { background: transparent; border-color: transparent; }
  body.admin-page .admin-panel-menu .button:not(.primary):hover { background: #eaf4f3; border-color: #d7e8e5; }
  body.admin-page .admin-panel-menu .button :is(svg, .icon-mask) { flex-shrink: 0; }
  .admin-panel-menu-toggle { display: none; }
  body.admin-page .admin-panel-layout .admin-hero { padding: 18px 20px; }
  body.admin-page .admin-panel-layout .admin-hero > div:first-child { border: 0; padding: 0; }
  body.admin-page .admin-panel-layout .admin-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media screen and (max-width: 900px) {
  body.admin-page .admin-panel-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .admin-panel-layout > :not(.admin-panel-sidebar) { grid-column: 1; }
  .admin-panel-sidebar { grid-row: auto; position: static; padding: 0; background: transparent; border: 0; max-height: none; overflow: visible; }
  .admin-panel-menu-title { display: none; }
  .admin-panel-menu-toggle { display: flex; width: 100%; min-height: 44px; }
  body.admin-page #adminPanelMenu:not(:is(:popover-open,.is-popover-open)) { display: none !important; }
  body.admin-page #adminPanelMenu:is(:popover-open,.is-popover-open) { display: flex !important; position: fixed; inset: 20px 12px auto; width: min(420px, calc(100% - 24px)); max-height: calc(100dvh - 40px); margin: 0 auto; padding: 14px; overflow-y: auto; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: 0 12px 32px rgba(20, 32, 43, .12); }
  #adminPanelMenu::backdrop { background: rgba(20, 32, 43, .18); }
  body.admin-page .admin-panel-menu .button { min-height: 44px; }
  body.admin-page .admin-panel-layout .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Data rows: one visual line; narrow screens use a summary and native details.
 * Never shrink whole rows with transform or hide an overflowed action.
 * Keep wrapping available inside the details panel and in editable forms. */
@media screen {
  body.admin-page .admin-user-card { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; padding: 9px 10px; min-width: 0; }
  body.admin-page .admin-user-main { flex: 1 1 0; min-width: 0; gap: 7px; }
  body.admin-page .admin-avatar { width: 30px; height: 30px; flex-basis: 30px; border-radius: 8px; }
  body.admin-page .admin-user-identity { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
  body.admin-page .admin-user-main h3 { display: flex; align-items: center; gap: 5px; min-width: 0; margin: 0; font-size: clamp(12px, .8vw, 14px); white-space: nowrap; }
  body.admin-page .admin-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  body.admin-page .admin-user-main p { flex: 0 0 auto; margin: 0; font-size: 12px; white-space: nowrap; }
  body.admin-page .role-badge { flex-shrink: 0; white-space: nowrap; }
  body.admin-page .admin-row-details { display: flex !important; align-items: center; gap: 10px; position: static; inset: auto; margin: 0; padding: 0; border: 0; width: auto; background: transparent; color: var(--text); overflow: visible; }
  body.admin-page .admin-user-metrics { flex-wrap: nowrap; gap: 4px; overflow: visible; }
  body.admin-page .admin-user-metrics span { font-size: 11px; padding: 5px; white-space: nowrap; }
  body.admin-page .admin-user-actions { display: flex; flex-wrap: nowrap; gap: 4px; border: 0; padding: 0; }
  body.admin-page .admin-user-actions .button { padding: 6px; min-height: 36px; font-size: 11px; gap: 4px; white-space: nowrap; width: auto; }
  body.admin-page .admin-user-actions :is(form, form .button) { width: auto; }
  body.admin-page .admin-user-actions .icon-mask { width: 15px; height: 15px; flex-basis: 15px; }
  .admin-row-details-toggle, .admin-row-details-heading { display: none; }
  .row-details-toggle { flex-shrink: 0; white-space: nowrap; font-size: 12px; }
  .row-details-popover:is(:popover-open,.is-popover-open) { position: fixed; inset: 20% 12px auto; width: min(440px, calc(100% - 24px)); max-height: 70dvh; margin: 0 auto; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: var(--text); overflow: auto; box-shadow: 0 12px 32px rgba(20, 32, 43, .14); }
  .row-details-popover::backdrop, .admin-row-details::backdrop { background: rgba(20, 32, 43, .18); }
  .row-details-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
  .row-details-heading strong { overflow-wrap: anywhere; }
  .row-details-heading .icon-button { flex: 0 0 44px; }
}
@media screen and (max-width: 1500px) and (min-width: 1201px) {
  body.admin-page .admin-user-identity { gap: 5px; }
  body.admin-page .admin-action-label { display: none; }
}
@media screen and (max-width: 1200px) {
  body.admin-page .admin-row-details-toggle { display: inline-flex; flex-shrink: 0; min-height: 44px; gap: 5px; padding: 6px 10px; }
  body.admin-page .admin-row-details:not(:is(:popover-open,.is-popover-open)) { display: none !important; }
  body.admin-page .admin-row-details:is(:popover-open,.is-popover-open) { display: flex !important; flex-direction: column; align-items: stretch; position: fixed; inset: 15% 12px auto; width: min(480px, calc(100% - 24px)); max-height: 75dvh; padding: 16px; margin: 0 auto; overflow: auto; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: 0 12px 32px rgba(20,32,43,.14); }
  body.admin-page .admin-row-details-heading { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; }
  .admin-row-details-heading strong { overflow-wrap: anywhere; }
  .admin-row-details-heading > span { grid-column: 1; justify-self: start; }
  .admin-row-details-heading .icon-button { grid-column: 2; grid-row: 1 / span 2; }
  body.admin-page .admin-row-details:is(:popover-open,.is-popover-open) .admin-user-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.admin-page .admin-row-details:is(:popover-open,.is-popover-open) .admin-user-metrics span { white-space: normal; overflow-wrap: anywhere; font-size: 13px; padding: 8px; }
  body.admin-page .admin-row-details:is(:popover-open,.is-popover-open) .admin-user-actions { flex-wrap: wrap; }
  body.admin-page .admin-row-details:is(:popover-open,.is-popover-open) .admin-user-actions .button { min-height: 44px; padding: 8px; font-size: 12px; }
}
@media screen and (max-width: 780px) {
  body.admin-page .admin-user-list { padding: 0; }
  body.admin-page .admin-user-identity { min-width: 0; gap: 5px; }
  body.admin-page .admin-user-main p { display: none; }
  body.index-page #mobileList .fisher-card-row { gap: 6px; min-width: 0; }
  body.index-page #mobileList :is(.person-info, .name-reg) { min-width: 0; }
  body.index-page #mobileList .name-reg { gap: 4px; }
  body.index-page #mobileList .name-reg > strong:first-child { overflow: hidden; text-overflow: ellipsis; }
  body.index-page #mobileList .mono-reg { flex: 0 0 auto; }
  body.index-page #mobileList .avatar { width: 24px; height: 28px; flex: 0 0 24px; }
  body.index-page #mobileList .mobile-select { flex: 0 0 22px; }
  body.index-page #mobileList .row-details-popover .mobile-days-boxes { display: flex; gap: 10px; flex-wrap: wrap; }
  body.index-page #mobileList .row-details-popover .mobile-sea-days-big { cursor: pointer; min-height: 44px; padding: 8px; background: #f0f6f5; }
  :is(.traffic-mobile-name, .invoice-mobile-ids, .invoice-mobile-name) { min-width: 0; }
  .invoice-mobile-name { white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; }
  .traffic-mobile-row { flex-wrap: nowrap; min-height: 54px; gap: 6px; padding: 4px 8px; }
  .traffic-mobile-row .row-details-toggle { order: 4; }
  .traffic-mobile-row .traffic-mobile-id { flex-basis: 26px; width: 26px; height: 30px; font-size: 12px; }
  .traffic-mobile-row .traffic-mobile-check { flex-basis: 26px; }
  .traffic-mobile-row .traffic-mobile-person { flex: 1 1 0; justify-content: flex-start; }
  .traffic-mobile-row .row-details-popover .traffic-mobile-events { justify-content: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
  .traffic-mobile-row .row-details-popover .traffic-mobile-total { flex-direction: row; justify-content: flex-start; gap: 8px; width: auto; }
}
/* Compact record forms: one scroll owner, no artificial section height. */
@media screen {
  .fisher-profile-dialog[open] { max-height:calc(100dvh - 24px)!important; padding:0; }
  .fisher-profile-dialog > form { height:auto!important; min-height:0; overflow:hidden; }
  .fisher-profile-dialog .profile-dialog-head { padding:12px 16px; gap:8px; flex-wrap:nowrap; }
  .fisher-profile-dialog .profile-dialog-head > div { min-width:0; }
  .fisher-profile-dialog .profile-identity { gap:10px; }
  .fisher-profile-dialog .profile-avatar { width:44px; height:44px; flex:0 0 44px; }
  .fisher-profile-dialog .profile-dialog-head h2 { font-size:18px; margin:0; }
  .fisher-profile-dialog .profile-dialog-head p { margin:2px 0 0; }
  .fisher-profile-dialog .profile-debt-total-btn { min-height:44px; }
  .fisher-profile-dialog .fisher-profile-scroll { flex:1 1 auto; padding:12px; min-height:0; overflow:auto; }
  .fisher-profile-dialog .profile-status-strip { margin-bottom:10px; gap:8px; }
  .fisher-profile-dialog .profile-status-strip > div { min-width:0; min-height:0; padding:8px; }
  .fisher-profile-dialog .profile-tab-layout { gap:10px; grid-template-columns:174px minmax(0,1fr); }
  .fisher-profile-dialog .profile-tab-sidebar { padding:6px; gap:2px; }
  .fisher-profile-dialog .profile-tab-button { font-size:12px; min-height:44px; gap:7px; padding:6px 8px; }
  .fisher-profile-dialog .profile-tab-content > .profile-section { min-height:0; padding:12px; }
  .fisher-profile-dialog .profile-section-title { margin-bottom:10px; padding-bottom:8px; }
  .fisher-profile-dialog .profile-section-title p { font-size:11px; }
  .fisher-profile-dialog .profile-form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 12px; align-items:start; }
  .fisher-profile-dialog .profile-form-grid .form-group { margin:0; gap:4px; }
  .fisher-profile-dialog .profile-form-grid .reg-no-feedback:empty { display:none; }
  .fisher-profile-dialog .profile-form-grid .reg-no-feedback:has(#profileFisherIdFeedbackText:empty):has(#profileFisherIdSwapBtn[style*="display:none"]) { display:none; }
  .fisher-profile-dialog .profile-dialog-actions { display:flex; justify-content:flex-end; padding:8px 12px calc(8px + env(safe-area-inset-bottom)); gap:8px; box-shadow:none; }
  .fisher-profile-dialog .profile-dialog-actions .button { width:auto; min-width:110px; min-height:44px; }
  .wallet-hero-copy, .wallet-balance-large { min-width:0; }
  .wallet-hero-copy { flex:1 1 0; }
  .wallet-balance-large { flex:0 1 260px; max-width:100%; box-sizing:border-box; }
  .wallet-hero::after { display:none; }
}
@media screen and (max-width:1440px) {
  /* The existing compact renderer retains totals, report and every action. */
  .invoice-page .invoice-table-wrap { display:none!important; }
  .invoice-page .invoice-mobile-list { display:grid!important; gap:8px; }
  .invoice-page .invoice-mobile-list { grid-template-columns:minmax(0,1fr); }
  .invoice-page .invoice-mobile-card { min-width:0; width:100%; box-sizing:border-box; }
  .invoice-page .invoice-mobile-compact-row { min-width:0; flex-wrap:nowrap; }
  .invoice-page .invoice-mobile-ids { flex:1 1 0; min-width:0; }
  .invoice-page .invoice-mobile-compact-row .invoice-total-button { flex:0 1 180px; }
  .invoice-page .invoice-mobile-send-btn { min-width:44px; min-height:44px; }
  .invoice-page .invoice-kebab-btn { width:44px; min-width:44px; min-height:44px; }
}
@media screen and (max-width:780px) {
  .fisher-profile-dialog .profile-tab-layout { display:block; }
  .fisher-profile-dialog .profile-tab-sidebar { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); position:static; overflow:visible; margin-bottom:8px; }
  .fisher-profile-dialog .profile-tab-button { min-width:0; width:100%; white-space:nowrap; }
  .fisher-profile-dialog .profile-tab-button > span:last-child { min-width:0; overflow:hidden; text-overflow:ellipsis; }
  .fisher-profile-dialog .profile-form-grid { grid-template-columns:minmax(0,1fr); }
  .fisher-profile-dialog .profile-form-grid .span-2 { grid-column:auto; }
  .fisher-profile-dialog .profile-dialog-actions .button { min-width:0; flex:1; }
  .wallet-balance-large { flex:auto; }
  .invoice-page .invoice-mobile-compact-row .invoice-total-button { flex:0 1 90px; padding:6px; }
  .invoice-page .invoice-mobile-compact-row { gap:6px; }
  .invoice-page .invoice-mobile-name { display:block; }
  .fuel-toolbar-actions { width:100%; min-width:0; display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
  .fuel-toolbar-actions .button { width:100%; min-width:0; padding-inline:6px; white-space:normal; min-height:44px; }
  .fuel-stage-tabs { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr)); overflow:visible!important; gap:6px; }
  .fuel-stage-tabs .fuel-stage-tab { width:100%; min-width:0!important; min-height:44px; padding-inline:6px; }
  .fuel-stage-panel :is(label,input,.fuel-col-search) { min-width:0!important; max-width:100%; box-sizing:border-box; }
  .fuel-stage-panel label { width:100%; }
}

/* Shared quiet-workbench design. Screen only: print geometry stays authoritative. */
@media screen {
 :root {--bg:#f3f6f6;--surface:#fff;--surface-solid:#fff;--surface-soft:#f7f9f9;--text:#17343b;--muted:#526a72;--text-muted:#526a72;--border:#d4e0e3;--primary:#0f766e;--primary-soft:#e6f3f0;--shadow:0 4px 18px #1637400b;--shadow-soft:0 2px 10px #16374009;--radius:14px;--radius-sm:9px;}
 body {background:#f3f6f6!important;color:var(--text);}
 .ambient {opacity:0;}
 .glass-card,.panel,.settings-card {background:#fff;border-color:#d4e0e3;box-shadow:var(--shadow);backdrop-filter:none;border-radius:14px;}
 .page-content {margin-top:18px;}
 :is(.button,.icon-button) {box-shadow:none;border-radius:9px;}
 .button.primary {background:#0f766e;color:#fff;}
 :is(.section-heading,.section-head) h2 {font-size:18px;letter-spacing:-.3px;}
 :is(.wallet-hero,.admin-hero) {background:#fff!important;color:#17343b!important;border:1px solid #d4e0e3;box-shadow:var(--shadow);}
 :is(.wallet-hero,.admin-hero) :is(h1,h2,strong,p,small,.eyebrow,.wallet-balance-large) {color:#17343b!important;}
 :is(.wallet-hero,.admin-hero) p {color:#526a72!important;}
 :is(.toolbar,.filter-panel,.stat-card,.summary-card) {box-shadow:none;border:1px solid #d4e0e3;border-radius:12px;}
 :is(.input,.select,.form-control) {border-color:#bed0d5;background:#fff;color:#17343b;border-radius:8px;}
 :is(.app-dialog,.dialog-box) {border:1px solid #d4e0e3;border-radius:14px;}
}
@media screen and (max-width:600px) { .page-content {margin-top:10px;} :is(.section-heading,.section-head) h2 {font-size:16px;} }

@media print{.websiteOfflineNotice{display:none!important}}

/* Desktop fisherman statistics: seven prominent cards in the existing row. */
@media screen and (min-width:1024px){
 body.index-page .summary-grid .summary-card{height:128px!important;min-height:128px!important;padding:18px 12px!important;border-radius:16px!important;box-shadow:0 5px 16px #173e4910!important}
 body.index-page .summary-grid .summary-card>div{gap:10px!important}
 body.index-page .summary-grid .summary-card small{font-size:16px!important;font-weight:800!important;line-height:1.5!important;color:#42606b!important}
 body.index-page .summary-grid .summary-card strong{font-size:40px!important;line-height:1.15!important}
 body.index-page .summary-grid .summary-card.total small{color:#17675d!important}
}


/* Account menu: readable hover for the logout row (the generic dark-nav hover turned the text white on light pink). */
@media screen {
  .side-nav-link.danger:hover, .side-nav-link.danger:focus-visible { background: #fdecee; color: #a4261d; }
  .side-nav-link.danger:hover .sidenav-mask-icon, .side-nav-link.danger:focus-visible .sidenav-mask-icon { background-color: currentColor; }
  #desktopAccountMenu .side-nav-logout-form { display: block; width: 100%; }
  #desktopAccountMenu .side-nav-logout-form .side-nav-link { width: 100%; }
}
/* Browsers without the Popover API: the menu stays hidden until the fallback script adds .is-popover-open. */
@media screen and (min-width: 901px) {
  html.no-popover #desktopAccountMenu:not(.is-popover-open) { display: none !important; }
}
/* Desktop: the full fisher profile dialog keeps one fixed, screen-sized frame for every tab.
   Only the content area scrolls; switching tabs never resizes the window. */
@media screen and (min-width: 901px) {
  .fisher-profile-dialog[open] {
    width: min(1480px, calc(100vw - 32px)) !important;
    height: calc(100dvh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    margin: auto !important;
    overflow: hidden !important;
  }
  .fisher-profile-dialog[open] > form {
    height: 100% !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  .fisher-profile-dialog[open] .fisher-profile-scroll {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }
  .fisher-profile-dialog[open] .profile-dialog-head,
  .fisher-profile-dialog[open] .profile-dialog-actions { flex: 0 0 auto !important; }
}
/* Missing-fields cards: the field name always fits inside its card. The text shrinks with the
   card width (container query) and wraps instead of being cut with an ellipsis. */
.mf-card { container-type: inline-size; }
.mf-card > div { min-width: 0; flex: 1 1 0; }
.mf-card > div > strong {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.35;
  font-size: clamp(9px, 5.4cqw, 16px) !important;
  max-width: 100%;
}
.mf-card > div > small { white-space: normal; overflow-wrap: anywhere; font-size: clamp(8px, 4cqw, 11px); }
@container (max-width: 190px) {
  .mf-card > div > strong { font-size: clamp(9px, 6.2cqw, 13px) !important; }
}

/* Mobile fisher row: info boxes + every row action shown directly under the name (swipe sideways) */
@media screen and (max-width: 900px) {
  body.index-page #mobileList .mobile-compact-card { display: block; }
  body.index-page #mobileList .row-inline-strip { display: flex; align-items: center; gap: 6px; padding: 4px 10px 10px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  body.index-page #mobileList .row-inline-strip::-webkit-scrollbar { display: none; }
  body.index-page #mobileList .row-inline-strip .mobile-days-boxes, body.index-page #mobileList .row-inline-strip .row-actions-list { display: contents; }
  body.index-page #mobileList .row-inline-strip .mobile-sea-days-big { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 11px; border-radius: 12px; background: #eaf4f2; cursor: pointer; scroll-snap-align: start; }
  body.index-page #mobileList .row-inline-strip .mobile-sea-days-big small { font-size: 11px; opacity: .8; }
  body.index-page #mobileList .row-inline-strip .mobile-sea-days-big strong { font-size: 13px; }
  body.index-page #mobileList .row-inline-strip .icon-menu-item { flex: 0 0 auto; width: auto; min-height: 36px; padding: 6px 11px; gap: 6px; font-size: 12px; border: 1px solid var(--border); border-radius: 999px; background: #f4f9f8; white-space: nowrap; scroll-snap-align: start; }
  body.index-page #mobileList .row-inline-strip .icon-menu-item:active { background: #e3f1ef; }
  body.index-page #mobileList .row-inline-strip [role="separator"] { display: none; }
}

/* Mobile traffic row: day boxes and total shown directly in the row (no «جزئیات» button) */
@media screen and (max-width: 900px) {
  .traffic-mobile-row { flex-wrap: nowrap; align-items: center; }
  .traffic-mobile-row .traffic-mobile-total { order: 6; flex: 0 0 auto; width: auto; flex-direction: row; align-items: center; justify-content: center; gap: 5px; height: 34px; min-height: 0; padding: 0 10px; align-self: center; border-radius: 12px; }
  .traffic-mobile-row .traffic-mobile-events-inline { order: 5; flex: 1 1 0; min-width: 0; display: flex; flex-wrap: nowrap; justify-content: center; gap: 2px; margin: 0; padding: 0; overflow: hidden; }
  .traffic-mobile-row .traffic-mobile-events-inline > * { flex: 0 1 23px; min-width: 10px; width: auto; }
  .traffic-mobile-row .traffic-mobile-person { min-width: 0; }
  .traffic-mobile-row .traffic-mobile-person strong { white-space: nowrap; overflow: visible; text-overflow: clip; min-width: 0; flex: 0 0 auto; }
  .traffic-mobile-row .traffic-mobile-events-inline { display: none; }
  .traffic-mobile-row .traffic-mobile-total span { display: none; }
  .traffic-mobile-row .traffic-mobile-total { padding: 0 12px; min-width: 44px; }
}
@media screen and (max-width: 900px) { .traffic-mobile-row .traffic-mobile-total strong { font-size: 19px; line-height: 1; } .traffic-mobile-row .traffic-mobile-total span { font-size: 9px !important; } }
/* Invoice filters: category — search — payment, on one line at every width. */
@media screen {
.invoice-page .invoice-toolbar{flex-flow:row nowrap!important;min-width:0;gap:10px!important;overflow:visible}
.invoice-page .invoice-toolbar .invoice-category-tabs{order:0;width:auto;flex:0 1 auto;min-width:0;margin:0;padding:0;border:0}
.invoice-page .invoice-toolbar .invoice-search-form{order:1;flex:1 1 220px;min-width:0;width:auto}
.invoice-page .invoice-toolbar .invoice-search-form .search-box{min-width:0}
.invoice-page .invoice-toolbar .invoice-status-tabs{order:2;flex:0 1 auto;min-width:0}
.invoice-page .invoice-toolbar .invoice-filter-tabs{flex-wrap:nowrap;white-space:nowrap}
@media(max-width:1180px){
  .invoice-page .invoice-toolbar .invoice-filter-tabs{display:none!important}
  .invoice-page .invoice-toolbar .invoice-mobile-filters{display:contents!important}
  .invoice-page .invoice-mobile-filters>.invoice-mobile-filter{min-width:0;flex:0 1 110px}
  .invoice-page .invoice-mobile-filters>.invoice-mobile-filter:first-child{order:2}
  .invoice-page .invoice-mobile-filters>.invoice-mobile-filter:last-child{order:0}
  .invoice-page .invoice-mobile-filter-btn{width:100%;min-width:0;min-height:44px;white-space:nowrap}
  .invoice-page .invoice-mobile-filter-btn span{min-width:0;overflow:hidden;text-overflow:ellipsis}
  .invoice-page .invoice-mobile-filter-btn svg{flex-shrink:0}
  .invoice-page .invoice-toolbar .invoice-search-form{flex:1 1 120px}
}
}
@media screen {
  .invoice-page .invoice-period-amount{display:inline-flex;align-items:center;justify-content:center;max-width:100%;min-width:0;min-height:44px;border:0;background:transparent;color:var(--primary-deep);font:inherit;font-weight:700;cursor:pointer;padding:3px 6px}
  .invoice-page .invoice-period-amount span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
  .invoice-page .invoice-table .name-reg{display:flex;flex-wrap:nowrap;min-width:0;gap:5px;width:100%}
  .invoice-page .invoice-table .name-reg>strong:first-child{flex:1 1 0;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .invoice-page .invoice-table .name-reg>strong:last-child{flex:0 1 auto;min-width:0;max-width:48%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .invoice-period-mobile-heading{display:none}
  .invoice-page .invoice-month-heading{display:flex;flex-wrap:nowrap;align-items:center;justify-content:center;gap:5px;min-width:0}
  .invoice-page .invoice-month-heading>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
}
@media screen and (max-width:1440px){
  .invoice-period-mobile-heading{display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:8px;min-width:0;margin:8px 0}
  .invoice-period-mobile-heading>span,.invoice-period-mobile-heading>button{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .invoice-period-mobile-heading>button{min-height:44px;padding:4px 10px;border:1px solid var(--border);border-radius:12px;color:var(--primary-deep);background:#fff;font:inherit;cursor:pointer}
}
/* Dialog bodies keep complete names and registration numbers. */
@media screen {
  .invoice-page .app-dialog .dialog-head,.invoice-page .app-dialog .dialog-head>div{min-width:0;max-width:100%}
  .invoice-page .app-dialog .dialog-head h2,.invoice-page .app-dialog .dialog-head p{white-space:normal!important;overflow-wrap:anywhere;word-break:normal}
}
@media screen and (max-width:480px){
  .invoice-page .invoice-total-debt,.invoice-page .invoice-total-debt-card{min-width:0;max-width:100%}
  .invoice-page .invoice-total-debt-card strong{font-size:clamp(24px,8vw,38px)!important}
}
/* Fuel workspace: one responsive layout, including PJAX-loaded content. */
@media screen {
  .fuel-workspace { min-width: 0; }
  .fuel-workspace .fuel-toolbar { display: grid; grid-template-columns: auto minmax(180px,1fr) auto 44px auto auto; align-items: center; gap: 10px; padding: 14px; }
  .fuel-workspace .fuel-toolbar > * { min-width: 0; margin: 0; }
  .fuel-workspace .fuel-toolbar > .fuel-global-tools-btn { grid-column: auto; }
  .fuel-workspace .toolbar-meta h2 { margin: 0; white-space: nowrap; font-size: 18px; }
  .fuel-workspace .fuel-search-form { display: flex; flex-wrap: nowrap; gap: 6px; min-width: 0; }
  .fuel-workspace .fuel-search-input { flex: 1 1 auto; width: 0; min-width: 0; height: 44px; direction: rtl; text-align: right; }
  .fuel-workspace .fuel-toolbar-actions, .fuel-workspace .traffic-month-nav { display: flex !important; flex-wrap: nowrap; width: auto; gap: 6px; }
  .fuel-workspace .fuel-toolbar .button { min-height: 44px; white-space: nowrap; padding-inline: 10px; }
  .fuel-workspace .fuel-toolbar-actions .button { width: auto; font-size: 12px !important; }
  .fuel-workspace .fuel-filter-active-count[hidden] { display: none !important; }
  .fuel-workspace .fuel-stage-tabs { display: grid !important; grid-template-columns: repeat(5,minmax(0,1fr)); overflow: visible !important; margin-inline: 0; gap: 8px; }
  .fuel-workspace .fuel-stage-tab { min-width: 0 !important; flex: initial !important; white-space: nowrap; }
  .fuel-workspace .fuel-stage-tab-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .fuel-workspace .fuel-board-status-zone { display: flex; flex-wrap: nowrap; align-items: center; gap: 12px; margin-block: 12px; }
  .fuel-workspace .fuel-board-stats { display: flex; flex-wrap: nowrap; min-width: 0; }
  .fuel-workspace .fuel-stat-chip { min-height: 44px; white-space: nowrap; }
  .fuel-workspace .fuel-stage-panel { padding: 8px !important; background: #f7fafb !important; }
  .fuel-workspace .fuel-stage-list { width: 100%; min-width: 0; max-height: none; gap: 7px; }
  .fuel-workspace .fuel-stage-card { display: grid !important; grid-template-columns: minmax(0,1fr) minmax(0,.6fr) auto; grid-template-areas: "info extra tools"; gap: 12px; min-height: 62px; padding: 8px 10px !important; }
  .fuel-workspace .fuel-stage-panel.selection-mode .fuel-stage-card { grid-template-columns: 26px minmax(0,1fr) minmax(0,.6fr) auto; grid-template-areas: "select info extra tools"; }
  .fuel-workspace .fuel-row-select { grid-area: select; }
  .fuel-workspace .fuel-stage-card .fuel-card-info { grid-area: info; display: flex; flex-wrap: nowrap; gap: 8px; }
  .fuel-workspace .fuel-card-name { flex: 0 1 auto; font-size: 14px !important; }
  .fuel-workspace .fuel-card-reg { flex: 0 0 auto; direction: ltr; unicode-bidi: isolate; }
  .fuel-workspace .fuel-stage-card .fuel-card-extra { grid-area: extra; min-width: 0; min-height: 0; padding: 0; }
  .fuel-workspace .fuel-row-tools { grid-area: tools; gap: 4px; min-width: 0; flex-wrap: nowrap; }
  .fuel-workspace .fuel-row-tools :is(.fuel-row-tool,.fuel-approve-btn,.fuel-confirm-btn) { display: inline-grid; place-items: center; opacity: 1; pointer-events: auto; width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 10px; }
  .fuel-workspace .fuel-global-tools-menu { display: grid; grid-template-columns: minmax(0,1fr) repeat(4,auto); }
  .fuel-workspace .fuel-global-tools-menu .fuel-sort-select { min-width: 0; }
  #fuelQuickPopover { box-sizing: border-box; max-width: calc(100% - 24px); }
  #fuelQuickPopover header { align-items: flex-start; }
  #fuelQuickPopover header strong { min-width: 0; overflow-wrap: anywhere; line-height: 1.8; }
  #fuelQuickPopover .fuel-pop-close { flex: 0 0 44px; min-height: 44px; }
  #fuelQuickPopover :is(.fuel-pop-field b,.fuel-pop-meta b) { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
  #fuelQuickPopover .fuel-pop-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  #fuelQuickPopover .fuel-pop-actions .button { min-height: 44px; min-width: 0; }
}
@media screen and (max-width: 1200px) {
  .fuel-workspace .fuel-toolbar { grid-template-columns: auto minmax(0,1fr) auto 44px; }
  .fuel-workspace .fuel-toolbar-actions { grid-column: 1 / 3; }
  .fuel-workspace .traffic-month-nav { grid-column: 3 / 5; justify-content: flex-end; }
}
@media screen and (max-width: 760px) {
  #fuelQuickPopover { width: calc(100% - 24px); left: 12px !important; right: auto !important; }
  .fuel-workspace .fuel-toolbar { grid-template-columns: minmax(0,1fr) auto 44px; padding: 10px; gap: 8px; }
  .fuel-workspace .toolbar-meta { grid-column: 1; grid-row: 1; }
  .fuel-workspace .fuel-global-filter-btn { grid-column: 2; grid-row: 1; }
  .fuel-workspace .fuel-toolbar > .fuel-global-tools-btn { grid-column: 3; grid-row: 1; }
  .fuel-workspace .fuel-search-form { grid-column: 1 / -1; grid-row: 2; }
  .fuel-workspace .fuel-toolbar-actions { grid-column: 1 / -1; grid-row: 3; }
  .fuel-workspace .fuel-toolbar-actions .button { flex: 1 1 0; overflow: hidden; }
  .fuel-workspace .fuel-toolbar-actions .button span:last-child { display: inline !important; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .fuel-workspace .traffic-month-nav { grid-column: 1 / -1; grid-row: 4; width: 100%; }
  .fuel-workspace .traffic-month-nav .button { flex: 1 1 0; width: auto; }
  .fuel-workspace .fuel-stage-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .fuel-workspace .fuel-stage-tab:last-child { grid-column: 1 / -1; }
  .fuel-workspace .fuel-board-status-zone { display: grid; grid-template-columns: minmax(0,1fr); gap: 6px; }
  .fuel-workspace .fuel-board-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); width: 100%; gap: 4px; }
  .fuel-workspace .fuel-stat-chip { min-width: 0; padding-inline: 4px; gap: 3px; }
  .fuel-workspace .fuel-stat-chip span { overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
  .fuel-workspace .fuel-stage-card { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "info tools"; gap: 6px; }
  .fuel-workspace .fuel-stage-panel.selection-mode .fuel-stage-card { grid-template-columns: 24px minmax(0,1fr) auto; grid-template-areas: "select info tools"; }
  .fuel-workspace .fuel-stage-card .fuel-card-info { gap: 6px; }
  .fuel-workspace .fuel-stage-card .fuel-card-extra, .fuel-workspace .fuel-row-tools .fuel-row-extension { display: none; }
  .fuel-workspace .fuel-stage-card .fuel-card-idnum { display: none !important; }
  .fuel-workspace .fuel-card-name { flex: 1 1 auto; }
  .fuel-workspace .fuel-card-reg { max-width: 36%; overflow: hidden; text-overflow: ellipsis; }
  .fuel-workspace .fuel-row-tools { min-width: 0; }
  .fuel-workspace .fuel-global-tools-menu { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .fuel-workspace .fuel-global-tools-menu .fuel-sort-select { grid-column: 1 / -1; width: 100%; }
  .fuel-workspace .fuel-global-filter-panel { grid-template-columns: minmax(0,1fr) !important; }
}
@media screen {
  #bulkInvoiceDialog .bulk-issue-status { font-size: 11px; font-weight: 700; color: var(--primary); white-space: nowrap; }
  #bulkInvoiceDialog .is-issued .invoice-amount-stepper { opacity: .6; }
  #bulkInvoiceDialog .bulk-invoice-period-tools { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; min-width: 0; }
  #bulkInvoiceDialog .bulk-invoice-period-tools :is(select,input) { min-width: 0; min-height: 44px; font: inherit; }
  #invoiceBreakdownHistoryList .invoice-bulk-history-row { display: grid; grid-template-columns: max-content minmax(0,1fr) auto 44px; align-items: center; gap: 8px; }
  #invoiceBreakdownHistoryList .invoice-bulk-history-row > :is(.ledger-tag,.ledger-note,.ledger-amount) { grid-column: auto; min-width: 0; white-space: nowrap; font-size: 12px; }
  #invoiceBreakdownHistoryList .invoice-log-more { display: contents; }
  #invoiceBreakdownHistoryList .invoice-log-more > summary { display: grid; place-items: center; list-style: none; width: 44px; height: 44px; cursor: pointer; border: 1px solid var(--border); border-radius: 8px; }
  #invoiceBreakdownHistoryList .invoice-log-more > summary::-webkit-details-marker { display: none; }
  #invoiceBreakdownHistoryList .invoice-log-panel { grid-column: 1 / -1; min-width: 0; padding: 8px; background: #fff; border-radius: 8px; }
  #invoiceBreakdownHistoryList .invoice-log-panel p { white-space: normal; overflow-wrap: anywhere; margin: 0 0 8px; }
  #invoiceBreakdownHistoryList .invoice-log-actions { display: flex; flex-wrap: nowrap; gap: 8px; }
  #invoiceBreakdownHistoryList .invoice-log-actions :is(button,form) { width: auto; margin: 0; grid-column: auto; min-height: 44px; }
}
@media screen and (max-width: 640px) {
  #invoiceBreakdownHistoryList .invoice-bulk-history-row { grid-template-columns: minmax(0,1fr) auto 44px; }
  #invoiceBreakdownHistoryList .invoice-bulk-history-row > .ledger-note { display: none; }
}

/* Open workspaces: mobile records use readable groups, never a hidden action menu.
   This presentation exception is requested for the main working lists only.
   Keep existing inputs/handlers and all print styles authoritative. */
@media screen {
  :is(.index-page,.traffic-page,.invoice-page,.fuel-page) main { min-width:0; }
  :is(.invoice-page,.fuel-page) :is(button,a,input,select) { touch-action:manipulation; }
  /* A single flex track at every width; the complete readout is outside it. */
  #fuelBoard .fuel-stage-card { display:flex!important; flex-flow:row nowrap!important; align-items:center; min-width:0; gap:8px; min-height:56px; padding:6px 10px!important; overflow:hidden; transform:none!important; }
  #fuelBoard .fuel-stage-card[hidden] { display:none!important; }
  #fuelBoard .fuel-stage-card .fuel-card-info { display:flex!important; flex:1 1 280px; flex-wrap:nowrap!important; align-items:center; gap:8px; min-width:0; overflow:hidden; }
  #fuelBoard .fuel-stage-card .fuel-card-idnum { display:inline!important; flex:0 0 auto; white-space:nowrap; font-size:12px; }
  #fuelBoard .fuel-stage-card .fuel-card-name { flex:0 1 auto; min-width:44px; min-height:44px; padding:0; border:0; border-radius:4px; background:transparent; color:inherit; font:inherit; font-weight:800; text-align:start; cursor:pointer; white-space:nowrap!important; overflow:hidden!important; text-overflow:ellipsis!important; font-size:14px!important; }
  #fuelBoard .fuel-stage-card .fuel-card-reg { flex:0 0 auto; min-width:0; max-width:calc(100% - 48px); white-space:nowrap!important; overflow:hidden; text-overflow:ellipsis; font-size:12px; direction:ltr; unicode-bidi:isolate; }
  #fuelBoard .fuel-row-select { flex:0 0 24px; width:24px!important; min-width:24px; max-width:24px; min-height:44px; padding:0; }
  #fuelBoard .fuel-stage-card .fuel-card-extra { display:none; flex:1 1 360px; min-width:0; overflow:hidden; }
  #fuelBoard .fuel-row-tools { display:flex!important; flex:0 0 auto; flex-wrap:nowrap!important; align-items:center; gap:4px; width:auto; min-width:0; }
  #fuelBoard .fuel-row-tools :is(.fuel-row-tool,.fuel-approve-btn,.fuel-confirm-btn) { display:inline-grid!important; place-items:center; flex:0 0 44px; width:44px!important; height:44px!important; min-width:44px; min-height:44px; padding:0; opacity:1; pointer-events:auto; font-size:16px; }
  #fuelBoard .fuel-row-tools :is(.fuel-row-extension,.fuel-approve-btn,.fuel-confirm-btn)::after { content:none; }
  #fuelBoard .fuel-row-tools .fuel-row-undo { color:var(--danger); }
  #fuelBoard .fuel-complete-check { display:none; }
  .fuel-record-inspector { margin-top:12px; padding:12px; border:1px solid var(--border); border-radius:12px; background:var(--surface-solid,#fff); min-width:0; }
  .fuel-workspace .fuel-stage-panel { min-height:0!important; }
  .fuel-record-inspector .fuel-open-info { border:0; padding:0; }
  .fuel-inspector-heading { display:flex; flex-wrap:nowrap; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; padding-bottom:8px; border-bottom:1px solid var(--border); }
  .fuel-inspector-heading strong { min-width:0; white-space:normal; overflow-wrap:anywhere; font-size:14px; }
  .fuel-inspector-heading bdi { flex:0 1 40%; min-width:0; white-space:normal; overflow-wrap:anywhere; font-size:13px; text-align:end; }
  .fuel-inspector-title { margin:0 0 8px; font-size:12px; color:var(--muted); }
  .fuel-open-info { grid-area:open; min-width:0; border-top:1px solid var(--border); padding-top:8px; }
  .fuel-open-fields { display:grid; grid-template-columns:minmax(0,1fr); gap:4px 12px; }
  .fuel-open-info .fuel-pop-field { padding:4px 0; border-radius:0; background:transparent; min-width:0; }
  .fuel-open-info .fuel-pop-field span { flex:0 0 auto; font-size:12px; }
  .fuel-open-info .fuel-pop-field b { min-width:0; white-space:normal; overflow:visible; overflow-wrap:anywhere; font-size:13px; text-align:end; }
  .fuel-open-history { display:grid; grid-template-columns:minmax(0,1fr); gap:6px 16px; margin-top:8px; padding-top:8px; border-top:1px solid var(--border); }
  .fuel-open-history .fuel-pop-event { font-size:12px; min-width:0; }
  .fuel-open-history time { font-size:12px; white-space:normal; overflow-wrap:anywhere; }
  .fuel-open-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:8px; }
  .fuel-open-actions .button { min-height:44px; min-width:0; }
  .fuel-workspace #fuelGlobalToolsMenu { display:grid!important; position:static; width:100%; box-sizing:border-box; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; box-shadow:none; }
  .fuel-workspace #fuelGlobalToolsBtn { display:none; }
  .fuel-workspace .fuel-toolbar { grid-template-columns:minmax(0,1fr) auto; }
  .fuel-workspace .fuel-global-filter-btn { grid-column:2; }
  .fuel-workspace .fuel-search-form { grid-column:1 / -1; }
  .fuel-workspace #fuelGlobalToolsMenu .fuel-sort-select { grid-column:1 / -1; }
  .fuel-workspace .fuel-global-tools-menu .button { min-width:0; min-height:44px; }
  .fuel-workspace .fuel-portal-import form { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; min-width:0; }
  .fuel-workspace .fuel-portal-import label { min-width:0; max-width:100%; }
  .fuel-workspace .fuel-portal-import input[type=file] { display:block; width:100%; min-width:0; box-sizing:border-box; }
  .fuel-workspace .fuel-toolbar-actions .button { white-space:normal!important; min-height:48px; }
  .fuel-workspace .fuel-toolbar-actions .button span:last-child { white-space:normal!important; overflow:visible!important; text-overflow:clip!important; }

  .invoice-page .invoice-table-wrap { display:none!important; }
  .invoice-page .invoice-mobile-list { display:grid!important; grid-template-columns:minmax(0,1fr); gap:12px; }
  .invoice-page .invoice-period-mobile-heading { display:none; }
  .invoice-page .invoice-mobile-card { padding:12px!important; border:1px solid var(--border); border-radius:12px; box-shadow:none; min-width:0; }
  .invoice-page .invoice-mobile-compact-row { display:grid; grid-template-columns:minmax(0,1fr) 44px; gap:8px; }
  .invoice-page .invoice-mobile-ids { grid-column:1 / -1; display:flex; min-width:0; gap:8px; overflow:visible; }
  .invoice-page .invoice-mobile-ids::after { display:none!important; }
  .invoice-page .invoice-mobile-name { visibility:visible!important; white-space:normal!important; overflow:visible!important; overflow-wrap:anywhere; font-size:14px; flex:1 1 0; }
  .invoice-page .invoice-mobile-name bdi { display:inline-block; white-space:normal; overflow-wrap:anywhere; }
  .invoice-page .invoice-mobile-card>.invoice-identity-details { display:none; }
  .invoice-page .invoice-mobile-compact-row .invoice-total-button { width:100%; max-width:none; min-height:44px; padding:8px; justify-content:flex-start; overflow:visible; }
  .invoice-page .invoice-mobile-compact-row .invoice-total-button>strong { white-space:normal; overflow:visible; overflow-wrap:anywhere; }
  .invoice-page .invoice-mobile-send-btn { min-width:44px; min-height:44px; }
  .invoice-direct-actions { grid-column:1 / -1; min-width:0; }
  .invoice-direct-action-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .invoice-direct-action-grid button { min-width:0; min-height:44px; padding:6px 8px; border:1px solid var(--border); border-radius:8px; background:var(--surface-solid,#fff); color:var(--primary-deep); font:inherit; font-size:12px; white-space:normal; overflow-wrap:anywhere; cursor:pointer; }
  .invoice-direct-action-grid button.danger { color:var(--danger); }
  .invoice-direct-tariff { grid-column:1 / -1; min-width:0; order:2; border-top:1px solid var(--border); padding-top:8px; }
  .invoice-direct-tariff-label { display:flex; justify-content:space-between; gap:8px; color:var(--muted); font-size:12px; margin-bottom:8px; }
  .invoice-direct-tariff-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; }
  .invoice-direct-tariff-options button.active { background:var(--primary-soft); border-color:var(--primary); color:var(--primary-deep); }
  .invoice-open-amounts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 12px; border-top:1px solid var(--border); padding-top:8px; margin-top:8px; }
  .invoice-open-amounts>span { display:flex; flex-direction:column; min-width:0; gap:4px; }
  .invoice-open-amounts small { color:var(--muted); font-size:12px; }
  .invoice-open-amounts b { font-size:13px; white-space:normal; overflow-wrap:anywhere; }
  .invoice-page .invoice-toolbar { display:grid!important; grid-template-columns:minmax(0,1fr); gap:12px!important; }
  .invoice-page .invoice-toolbar .invoice-search-form { order:0; width:100%; }
  .invoice-page .invoice-toolbar .invoice-mobile-filters { display:none!important; }
  .invoice-page .invoice-toolbar .invoice-filter-tabs { display:grid!important; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; width:100%; }
  .invoice-page .invoice-filter-tabs a { min-width:0; min-height:44px; padding:6px 4px; justify-content:center; white-space:normal; font-size:12px; }
  #invoiceBreakdownHistoryList .invoice-bulk-history-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
  #invoiceBreakdownHistoryList .invoice-bulk-history-row>.ledger-note { display:block; grid-column:1 / -1; grid-row:2; white-space:normal; overflow:visible; overflow-wrap:anywhere; }
  #invoiceBreakdownHistoryList .invoice-log-actions { grid-column:1 / -1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  #invoiceBreakdownHistoryList .invoice-log-actions :is(form,button) { width:100%; min-height:44px; }
}
@media screen and (min-width:761px) {
  .fuel-open-fields { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .fuel-open-history { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .fuel-open-actions { display:flex; flex-wrap:nowrap; justify-content:flex-end; }
  .invoice-page .invoice-mobile-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .invoice-direct-tariff-options { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .invoice-page .invoice-toolbar { grid-template-columns:minmax(0,1fr) minmax(180px,.8fr) minmax(0,1fr); }
  .invoice-page .invoice-toolbar .invoice-category-tabs { order:0; }
  .invoice-page .invoice-toolbar .invoice-search-form { order:1; }
  .invoice-page .invoice-toolbar .invoice-status-tabs { order:2; }
}
@media screen and (min-width:1181px) {
  .invoice-page .invoice-toolbar .invoice-filter-tabs { display:flex!important; flex-wrap:nowrap; }
  .invoice-page .invoice-filter-tabs a { min-height:36px; font-size:11px; }
  .fuel-workspace .fuel-toolbar { grid-template-columns:auto minmax(0,1fr) auto auto auto; }
  .fuel-workspace .fuel-global-filter-btn { grid-column:auto; grid-row:auto; width:auto; }
  .fuel-workspace .fuel-search-form { grid-column:auto; }
  .fuel-workspace .fuel-toolbar-actions,.fuel-workspace .traffic-month-nav { grid-column:auto; grid-row:auto; }
  .fuel-workspace #fuelGlobalToolsMenu { grid-template-columns:minmax(0,1fr) repeat(4,auto); }
  .fuel-workspace #fuelGlobalToolsMenu .fuel-sort-select { grid-column:auto; }
}
@media screen and (min-width:1441px) {
  .invoice-page .invoice-table-wrap { display:block!important; }
  .invoice-page .invoice-mobile-list { display:none!important; }
}
@media screen and (max-width:900px) {
  :is(.invoice-page,.index-page,.traffic-page) #pageOpsDock { position:static!important; transform:none!important; inset:auto!important; width:auto!important; max-width:none!important; margin:12px; padding:0; border-radius:12px; }
  :is(.invoice-page,.index-page,.traffic-page) #pageOpsDock .page-ops-dock-inner { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; padding:8px; gap:8px; }
  :is(.invoice-page,.index-page,.traffic-page) #pageOpsDock .button { min-width:0; min-height:44px; padding:6px!important; width:100%; font-size:12px!important; }
  :is(.invoice-page,.index-page,.traffic-page) #pageOpsDock .button>span:last-child { display:inline!important; }
  body.index-page #mobileList .row-inline-strip { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); overflow:visible; gap:8px; padding:8px; }
  body.index-page #mobileList .row-inline-strip :is(.mobile-sea-days-big,.icon-menu-item) { width:100%; min-width:0; min-height:44px; box-sizing:border-box; white-space:normal; overflow-wrap:anywhere; border-radius:8px; }
  body.index-page #mobileList .name-reg { display:block; }
  body.index-page #mobileList .name-reg :is(strong,.mono-reg) { white-space:normal!important; overflow:visible; overflow-wrap:anywhere; }
  .traffic-mobile-row { display:grid!important; grid-template-columns:26px 32px minmax(0,1fr) auto; gap:8px; padding:12px!important; }
  .traffic-mobile-row .traffic-mobile-person { min-width:0; display:block; }
  .traffic-mobile-row .traffic-mobile-person :is(strong,span) { display:block; white-space:normal!important; overflow:visible; overflow-wrap:anywhere; }
  .traffic-mobile-row .traffic-mobile-events-inline { display:grid!important; grid-column:1 / -1; grid-template-columns:repeat(auto-fit,minmax(36px,1fr)); width:100%; gap:4px; overflow:visible; order:5; }
  .traffic-mobile-row .traffic-mobile-events-inline>* { min-width:0; width:100%; min-height:32px; }
  .traffic-mobile-row .traffic-mobile-total { order:0; grid-column:4; grid-row:1; }
}
@media screen and (pointer:coarse) {
  :is(.invoice-page,.fuel-page) main :is(input,select,textarea) { font-size:16px; }
}

@media screen and (min-width:1181px) {
  #fuelBoard .fuel-stage-card .fuel-card-extra { display:flex; flex-wrap:nowrap!important; gap:8px; align-items:center; }
  #fuelBoard .fuel-card-extra>* { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  #fuelBoard .fuel-complete-check { display:inline-grid; flex:0 0 28px; }
}
@media screen and (max-width:760px) {
  .fuel-workspace .fuel-stage-panel { padding:0!important; }
  .fuel-workspace .fuel-stage-list { padding:0!important; }
  #fuelBoard .fuel-stage-card { padding-inline:2px!important; gap:4px; }
  #fuelBoard .fuel-stage-card .fuel-card-info { gap:4px; }
  #fuelBoard .fuel-row-tools { gap:2px; }
  #fuelBoard .fuel-stage-card .fuel-card-idnum { display:none!important; }
}
@media print { .fuel-record-inspector { display:none!important; } }

/* Traffic cells share one vertical centre, including the identity cell. */
@media screen {
  .traffic-table tbody tr.traffic-report-row > td { vertical-align:middle!important; padding-block:8px!important; height:56px; box-sizing:border-box; }
  .traffic-table tbody .person-cell { display:flex; align-items:center; min-height:40px; min-width:0; margin:0; }
  .traffic-table tbody .person-info { min-width:0; width:100%; }
  .traffic-table tbody .name-reg { display:flex; flex-flow:row nowrap!important; align-items:center; justify-content:flex-start; gap:6px; min-width:0; margin:0; }
  .traffic-table tbody .name-reg strong { line-height:1.6; margin:0; white-space:nowrap!important; }
  .traffic-table tbody .name-reg strong:first-child { min-width:0; overflow:hidden; text-overflow:ellipsis; }
  .traffic-table tbody .name-reg .mono-reg { flex:0 0 auto; direction:ltr; unicode-bidi:isolate; }
}

@media screen {
 .fisher-profile-dialog .profile-dialog-head { display:grid!important; grid-template-columns:minmax(0,1fr) auto; align-items:center; }
 .fisher-profile-dialog .profile-identity { min-width:0; width:100%; }
 .fisher-profile-dialog .profile-identity>div { flex:1; min-width:0; }
 .fisher-profile-dialog #profileDialogName { max-width:none!important; white-space:normal!important; overflow:visible!important; text-overflow:clip!important; overflow-wrap:anywhere; line-height:1.6; }
 .fisher-profile-dialog #profileDialogRegistration { display:block; font-size:13px; line-height:1.7; color:inherit; unicode-bidi:isolate; overflow-wrap:anywhere; }
}
@media screen and (max-width:780px) {
 .fisher-profile-dialog .profile-dialog-head { grid-template-columns:minmax(0,1fr); gap:8px; }
 .fisher-profile-dialog .profile-print-template-links { justify-self:stretch; min-width:0; }
 .fisher-profile-dialog .profile-print-template-links a { min-height:44px; max-width:100%; }
}

/* Restore the compact mobile roster: selection / id / name+registration / two counters / SMS. */
@media screen and (max-width:900px) {
 body.index-page #mobileList .mobile-compact-card { display:flex!important; flex-flow:row nowrap!important; align-items:center; gap:6px; padding:6px!important; min-height:60px; border-radius:0; border-bottom:1px solid var(--border); }
 body.index-page #mobileList .fisher-card-row,body.index-page #mobileList .row-inline-strip { display:contents!important; }
 body.index-page #mobileList .mobile-select { flex:0 0 24px; width:24px; min-width:24px; margin:0; }
 body.index-page #mobileList .person-cell.compact-person { display:flex; flex:1 1 0; min-width:0; align-items:center; gap:6px; }
 body.index-page #mobileList .avatar { flex:0 0 32px; width:32px; height:40px; font-size:14px; }
 body.index-page #mobileList .person-info { flex:1; min-width:0; }
 body.index-page #mobileList .name-reg { display:flex!important; flex-flow:row nowrap!important; align-items:center; gap:4px; min-width:0; }
 body.index-page #mobileList .name-reg>strong:first-child { flex:0 1 auto; min-width:0; white-space:nowrap!important; overflow:hidden!important; text-overflow:ellipsis; font-size:13px!important; }
 body.index-page #mobileList .name-reg>.mono-reg { flex:0 0 auto; white-space:nowrap!important; font-size:11px!important; direction:ltr; unicode-bidi:isolate; }
 body.index-page #mobileList .row-inline-strip .mobile-days-boxes { display:flex!important; flex:0 0 auto; gap:4px; }
 body.index-page #mobileList .row-inline-strip .mobile-sea-days-big { display:flex; flex-direction:column; justify-content:center; gap:0; width:48px; min-width:0; min-height:44px; padding:2px!important; border-radius:8px; }
 body.index-page #mobileList .mobile-sea-days-big small { order:2; font-size:10px!important; white-space:nowrap; }
 body.index-page #mobileList .mobile-sea-days-big strong { order:1; font-size:14px!important; white-space:nowrap; max-width:100%; overflow:hidden; text-overflow:ellipsis; }
 body.index-page #mobileList .row-inline-strip .row-actions-list { display:flex!important; flex:0 0 44px; width:44px; min-width:0; }
 body.index-page #mobileList .row-actions-list>.icon-menu-item { display:none!important; }
 body.index-page #mobileList .row-actions-list>.icon-menu-item[title="ارسال پیامک / واتساپ"] { display:flex!important; justify-content:center; width:44px; height:44px; min-height:44px; padding:0!important; }
 body.index-page #mobileList .row-actions-list>.icon-menu-item[title="ارسال پیامک / واتساپ"]>span:last-child { display:none; }
}
@media screen and (max-width:380px) {
 body.index-page #mobileList .mobile-compact-card { gap:3px; padding-inline:3px!important; }
 body.index-page #mobileList .avatar { flex-basis:24px; width:24px; }
 body.index-page #mobileList .person-cell.compact-person { gap:3px; }
 body.index-page #mobileList .row-inline-strip .mobile-sea-days-big { width:40px; }
}

@media screen and (max-width:900px) {
 body.index-page #mobileList .name-reg { justify-content:flex-start!important; }
}

/* Profile identity and print occupy one aligned header track. */
@media screen {
 .fisher-profile-dialog .profile-dialog-head { display:flex!important; flex-flow:row nowrap!important; justify-content:space-between; align-items:center; gap:8px; }
 .fisher-profile-dialog .profile-identity { flex:1 1 0; min-width:0; width:auto; gap:8px; }
 .fisher-profile-dialog .profile-header-name-line { display:flex; flex-flow:row nowrap; align-items:baseline; justify-content:flex-start; gap:5px; min-width:0; }
 .fisher-profile-dialog .profile-header-name-line #profileDialogName { flex:0 1 auto; min-width:0; margin:0; font-size:16px; }
 .fisher-profile-dialog .profile-header-registration { flex:0 0 auto; position:relative; top:-.4em; font-size:10px; line-height:1; direction:ltr; unicode-bidi:isolate; white-space:nowrap; }
 .fisher-profile-dialog .profile-header-registration #profileDialogRegistration { display:inline; font:inherit; line-height:inherit; }
 .fisher-profile-dialog .profile-print-template-links { flex:0 0 auto; width:auto; margin:0; align-self:center; }
 .fisher-profile-dialog .profile-print-template-links a { min-height:44px; font-size:11px; padding-inline:8px; white-space:nowrap; }
}
@media screen and (max-width:480px) {
 .fisher-profile-dialog .profile-dialog-head { padding:10px!important; }
 .fisher-profile-dialog .profile-avatar { flex:0 0 32px!important; width:32px!important; height:36px!important; }
 .fisher-profile-dialog .profile-identity { gap:5px; }
 .fisher-profile-dialog .profile-header-name-line #profileDialogName { font-size:14px!important; }
 .fisher-profile-dialog .profile-header-registration { font-size:9px; }
 .fisher-profile-dialog .profile-print-template-links a { font-size:10px; padding-inline:6px; }
}

@media screen {
 .fisher-profile-dialog .profile-header-name-line #profileDialogName { font-size:20px!important; font-weight:800; }
 .fisher-profile-dialog .profile-header-registration { font-size:11px; }
}
@media screen and (max-width:480px) {
 .fisher-profile-dialog .profile-header-name-line #profileDialogName { font-size:18px!important; }
 .fisher-profile-dialog .profile-header-registration { font-size:10px; }
}

@media screen and (max-width:900px) {
 .traffic-page .traffic-toolbar .search-form { display:flex; flex-flow:row nowrap; align-items:center; width:100%; min-width:0; gap:6px; }
 .traffic-page .traffic-toolbar .search-box { display:flex!important; align-items:center; flex:1 1 0; width:auto; min-width:0; height:44px; min-height:44px; box-sizing:border-box; padding:0 10px; margin:0; border-radius:10px; }
 .traffic-page .traffic-toolbar .search-box svg { flex:0 0 18px; width:18px; height:18px; margin:0 0 0 6px; }
 .traffic-page .traffic-toolbar .search-box input { flex:1 1 0; width:0; min-width:0; height:40px; padding:0; font-size:14px; line-height:normal; }
 .traffic-page .traffic-toolbar .search-form>.button { flex:0 0 auto; width:auto!important; min-height:44px; padding-inline:10px; }
 .traffic-page .traffic-mobile-row { grid-template-columns:24px 30px minmax(0,1fr) 76px!important; align-items:center!important; min-height:56px; padding:6px!important; gap:6px; }
 .traffic-page .traffic-mobile-person { display:flex!important; flex-flow:row nowrap!important; align-items:center; justify-content:flex-start; gap:4px; min-width:0; }
 .traffic-page .traffic-mobile-person strong { display:block; flex:0 1 auto!important; min-width:0; white-space:nowrap!important; overflow:hidden!important; text-overflow:ellipsis; font-size:13px; line-height:1.6; }
 .traffic-page .traffic-mobile-person span { display:block; flex:0 0 auto; white-space:nowrap!important; font-size:11px; direction:ltr; unicode-bidi:isolate; }
 .traffic-page .traffic-mobile-row .traffic-mobile-total { display:flex; flex-direction:column!important; justify-content:center; align-items:center; gap:0; width:76px; height:44px; min-height:44px; padding:2px!important; box-sizing:border-box; }
 .traffic-page .traffic-mobile-row .traffic-mobile-total strong { font-size:16px!important; line-height:1.4; white-space:nowrap; }
 .traffic-page .traffic-mobile-row .traffic-mobile-total span { display:block!important; font-size:10px!important; line-height:1.4; white-space:nowrap; }
}

/* Shared compact density: retain readable type and touch targets. */
@media screen {
 .side-nav .side-nav-links { gap:4px!important; padding-block:4px!important; }
 .side-nav .side-nav-link { min-height:44px!important; padding:8px 10px!important; gap:8px!important; font-size:13px!important; border-radius:10px; white-space:nowrap; }
 .side-nav .side-nav-link .sidenav-mask-icon { width:18px; height:18px; flex:0 0 18px; }
 :is(.index-page,.traffic-page,.invoice-page) main .panel { border-radius:14px; }
 :is(.index-page,.traffic-page,.invoice-page) main .toolbar { gap:8px; padding:10px; }
 :is(.index-page,.traffic-page,.invoice-page) main .button { gap:6px; border-radius:9px; }
 :is(.index-page,.traffic-page,.invoice-page) main table :is(th,td) { padding-inline:8px; }
 :is(.index-page,.traffic-page,.invoice-page) main table th { font-size:12px; }
 :is(.index-page,.traffic-page,.invoice-page) main table td { font-size:13px; }
}
@media screen and (max-width:900px) {
 .side-nav { padding:10px!important; }
 .side-nav .side-nav-brand { gap:8px; min-height:44px; padding-block:6px!important; }
 .side-nav .side-nav-wallet { margin-block:8px!important; padding:10px!important; }
 :is(.index-page,.traffic-page,.invoice-page) main .button { min-height:44px; font-size:12px; }
 :is(.index-page,.traffic-page,.invoice-page) main .toolbar { padding:8px; }
 .invoice-page .invoice-mobile-card { padding:8px!important; border-radius:10px; }
 .invoice-direct-action-grid,.invoice-direct-tariff-options,.invoice-open-amounts { gap:4px 8px; }
}

/* Invoice list: compact working rows; secondary actions live in the existing editor. */
@media screen {
 body.invoice-page .invoice-hero { display:flex!important; flex-flow:row nowrap!important; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px!important; min-height:0!important; height:auto!important; margin-bottom:12px; }
 body.invoice-page .invoice-hero-copy { min-width:0; }
 body.invoice-page .invoice-hero-copy h2 { font-size:18px; margin:0; line-height:1.6; }
 body.invoice-page .invoice-hero-copy :is(.eyebrow,p) { display:none; }
 body.invoice-page .invoice-total-debt,body.invoice-page .invoice-total-debt-card { flex:0 1 auto!important; width:auto!important; min-width:0!important; height:auto!important; min-height:0!important; padding:4px!important; margin:0!important; }
 body.invoice-page .invoice-total-debt-card strong { font-size:24px!important; line-height:1.4; white-space:nowrap; }
 body.invoice-page .invoice-mobile-list { grid-template-columns:minmax(0,1fr)!important; gap:6px; }
 body.invoice-page .invoice-mobile-card { min-width:0; padding:6px!important; border-radius:10px; }
 body.invoice-page .invoice-mobile-compact-row { display:flex!important; flex-flow:row nowrap!important; align-items:center; gap:6px; min-height:44px; min-width:0; }
 body.invoice-page .invoice-mobile-ids { display:flex; flex:1 1 0; align-items:center; gap:4px; min-width:0; overflow:hidden; }
 body.invoice-page .invoice-mobile-name { flex:0 1 auto!important; min-width:0; white-space:nowrap!important; overflow:hidden!important; text-overflow:ellipsis!important; font-size:13px; }
 body.invoice-page .invoice-mobile-reg { flex:0 0 auto; font-size:11px; white-space:nowrap; }
 body.invoice-page .invoice-mobile-id { flex:0 0 auto; font-size:11px; }
 body.invoice-page .invoice-mobile-compact-row .invoice-total-button { flex:0 0 clamp(88px,22vw,120px)!important; width:auto!important; min-width:0; min-height:44px; padding:4px; justify-content:center; }
 body.invoice-page .invoice-mobile-compact-row .invoice-total-button>strong { font-size:12px!important; white-space:nowrap; }
 body.invoice-page .invoice-row-edit,body.invoice-page .invoice-mobile-send-btn { display:inline-grid; place-items:center; flex:0 0 44px; width:44px; height:44px; min-height:44px; padding:0; border:1px solid var(--border); border-radius:8px; background:var(--surface-solid,#fff); color:var(--primary-deep); font:inherit; cursor:pointer; }
 body.invoice-page .invoice-mobile-card :is(.invoice-direct-actions,.invoice-open-amounts,.invoice-identity-details) { display:none!important; }
 #invoiceEditorActions { padding:8px 12px; min-width:0; }
 #invoiceEditorActions:empty { display:none; }
 #invoiceEditorActions .invoice-direct-actions { display:block; }
 #invoiceEditorActions .invoice-open-amounts { display:grid; }
 body.invoice-page .invoice-toolbar { display:flex!important; flex-flow:row nowrap!important; align-items:center; gap:8px!important; }
 body.invoice-page .invoice-toolbar .invoice-filter-tabs { display:none!important; }
 body.invoice-page .invoice-toolbar .invoice-mobile-filters { display:contents!important; }
 body.invoice-page .invoice-mobile-filter { flex:0 1 110px; min-width:0; }
 body.invoice-page .invoice-mobile-filter:first-child { order:2; }
 body.invoice-page .invoice-mobile-filter:last-child { order:0; }
 body.invoice-page .invoice-toolbar .invoice-search-form { order:1; flex:1 1 0; min-width:0; width:auto; }
 body.invoice-page .invoice-mobile-filter-btn { width:100%; min-width:0; min-height:44px; padding:6px; }
 body.invoice-page .invoice-mobile-filter-btn span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
}
@media screen and (max-width:600px) {
 body.invoice-page .invoice-hero { padding:8px!important; gap:8px; }
 body.invoice-page .invoice-hero-copy h2 { font-size:14px; }
 body.invoice-page .invoice-total-debt-card strong { font-size:20px!important; }
 body.invoice-page .invoice-mobile-id { display:none; }
 body.invoice-page .invoice-mobile-filter { flex-basis:84px; }
}
@media screen and (min-width:901px) and (max-width:1440px) {
 body.invoice-page #sideNav { flex-wrap:nowrap!important; gap:6px!important; }
 body.invoice-page #sideNav .side-nav-brand-text { display:none; }
 body.invoice-page #sideNav .side-nav-links { flex-wrap:nowrap!important; gap:2px!important; }
 body.invoice-page #sideNav .side-nav-link { padding-inline:6px!important; font-size:11px!important; gap:4px!important; }
 body.invoice-page #sideNav .desktop-account-trigger { padding-inline:6px; font-size:11px; }
}

@media screen and (min-width:1441px) { body.invoice-page .invoice-mobile-list { display:none!important; } }
/* Invoice debt and fuel dialogs: one scroll owner, natural content height, consistent RTL fields. */
@media screen {
 :is(#invoiceBreakdownDialog,#invoiceBreakdownEditDialog,#fuelApproveDialog,#bulkImportDialog,#fuelExportDialog,#fuelPrintDialog,#fuelPrintSelectionDialog) {
   box-sizing:border-box; width:calc(100% - 24px)!important; max-width:680px!important;
   max-height:calc(100dvh - 24px)!important; padding:0!important;
   overflow-y:auto!important; overflow-x:hidden; scrollbar-gutter:stable;
   border:1px solid var(--border); border-radius:14px!important; font-size:13px; line-height:1.65;
 }
 :is(#invoiceBreakdownDialog,#invoiceBreakdownEditDialog,#fuelApproveDialog,#bulkImportDialog,#fuelExportDialog,#fuelPrintDialog,#fuelPrintSelectionDialog) :is(input,select,textarea) {
   box-sizing:border-box; min-width:0; max-width:100%; min-height:44px; font-size:16px!important;
 }
 :is(#invoiceBreakdownDialog,#invoiceBreakdownEditDialog,#fuelApproveDialog,#bulkImportDialog,#fuelExportDialog,#fuelPrintDialog,#fuelPrintSelectionDialog) :is(.button,.icon-button) {
   min-height:44px; box-sizing:border-box; font-size:13px!important; line-height:1.5; border-radius:8px;
 }
 :is(#invoiceBreakdownDialog,#invoiceBreakdownEditDialog,#fuelApproveDialog,#bulkImportDialog,#fuelExportDialog,#fuelPrintDialog,#fuelPrintSelectionDialog) :is(.dialog-head,.fuel-print-dialog-head) {
   display:flex; flex-flow:row nowrap; align-items:flex-start; justify-content:space-between;
   gap:12px; margin:0 0 12px!important; padding:0 0 12px!important; border-bottom:1px solid var(--border);
 }
 :is(#invoiceBreakdownDialog,#invoiceBreakdownEditDialog,#fuelApproveDialog,#bulkImportDialog,#fuelExportDialog,#fuelPrintDialog,#fuelPrintSelectionDialog) :is(.dialog-head,.fuel-print-dialog-head)>div {min-width:0; flex:1;}
 :is(#invoiceBreakdownDialog,#invoiceBreakdownEditDialog,#fuelApproveDialog,#bulkImportDialog,#fuelExportDialog,#fuelPrintDialog,#fuelPrintSelectionDialog) :is(h2,h3) {font-size:18px!important; line-height:1.65; margin:0;}
 :is(#invoiceBreakdownDialog,#invoiceBreakdownEditDialog,#fuelApproveDialog,#bulkImportDialog,#fuelExportDialog,#fuelPrintDialog,#fuelPrintSelectionDialog) :is(.dialog-head,.fuel-print-dialog-head) p {font-size:12px!important; margin:4px 0 0; line-height:1.8;}
 :is(#invoiceBreakdownDialog,#invoiceBreakdownEditDialog,#fuelApproveDialog,#bulkImportDialog,#fuelExportDialog,#fuelPrintDialog,#fuelPrintSelectionDialog) .icon-button {flex:0 0 44px!important; width:44px!important; height:44px!important; padding:0;}
 :is(#invoiceBreakdownEditDialog,#fuelApproveDialog,#bulkImportDialog,#fuelExportDialog,#fuelPrintDialog,#fuelPrintSelectionDialog)>:is(form,div) {padding:12px!important; min-width:0; box-sizing:border-box;}
 /* Block flow avoids flex-shrinking sections into each other when the dialog is short. */
 #invoiceBreakdownDialog .invoice-breakdown-shell {display:block; max-height:none; overflow:visible; padding:12px;}
 #invoiceBreakdownDialog :is(.breakdown-total-banner,.quick-adjust-box,.invoice-breakdown-summary,.invoice-breakdown-list,#invoiceEditorActions,#invoiceBreakdownHistoryList) {box-sizing:border-box; min-width:0; margin:0 0 12px!important; width:100%;}
 #invoiceBreakdownDialog :is(.breakdown-total-banner,.invoice-breakdown-summary) {display:flex; flex-flow:row nowrap; align-items:center; justify-content:space-between; gap:8px; padding:12px; border-radius:10px;}
 #invoiceBreakdownDialog :is(.breakdown-total-banner,.invoice-breakdown-summary) span {font-size:12px;}
 #invoiceBreakdownDialog :is(.breakdown-total-banner,.invoice-breakdown-summary) strong {font-size:16px; white-space:nowrap;}
 #invoiceBreakdownDialog .quick-adjust-box {padding:12px; box-shadow:none; border-radius:10px;}
 #invoiceBreakdownDialog .quick-adjust-fields {display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px;}
 #invoiceBreakdownDialog .quick-adjust-fields input {width:100%; height:44px; padding-inline:8px;}
 #invoiceBreakdownDialog .quick-adjust-fields .button {width:auto; padding-inline:12px;}
 #invoiceBreakdownDialog .invoice-breakdown-list {padding:0; overflow:visible;}
 #invoiceBreakdownDialog .invoice-breakdown-item {grid-template-columns:minmax(0,1fr) auto; gap:8px; padding:12px;}
 #invoiceBreakdownDialog .invoice-breakdown-item>div:first-child {grid-column:1 / -1;}
 #invoiceBreakdownDialog .invoice-breakdown-item strong {font-size:13px;}
 #invoiceBreakdownDialog .invoice-breakdown-item span {font-size:12px; line-height:1.8;}
 #invoiceBreakdownDialog .invoice-breakdown-amount {text-align:right;}
 #invoiceBreakdownDialog .invoice-breakdown-amount b {font-size:14px;}
 #invoiceBreakdownDialog .invoice-breakdown-amount small {font-size:12px;}
 #invoiceBreakdownDialog #invoiceEditorActions {padding:12px; border:1px solid var(--border); border-radius:10px;}
 #invoiceEditorActions .invoice-direct-action-grid {display:grid; grid-template-columns:minmax(0,1fr); gap:8px;}
 #invoiceEditorActions .invoice-direct-action-grid button {font-size:13px; min-height:44px; padding:8px;}
 #invoiceEditorActions .invoice-direct-tariff-options {grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px;}
 #invoiceEditorActions .invoice-open-amounts {gap:12px; padding-top:12px; margin-top:12px;}
 #invoiceBreakdownDialog .dialog-actions {margin:0; padding:12px 0 0; flex-flow:row nowrap;}
 #fuelApproveDialog .fuel-approve-form {display:block; max-height:none; overflow:visible;}
 #fuelApproveDialog .fuel-approve-identity {grid-template-columns:auto minmax(0,1fr); gap:8px; margin-top:8px;}
 #fuelApproveDialog .fuel-approve-id-block {min-width:44px; padding:8px; border-radius:8px;}
 #fuelApproveDialog .fuel-approve-id-block strong {font-size:18px;}
 #fuelApproveDialog .fuel-approve-name-block {padding:8px; border-radius:8px;}
 #fuelApproveDialog .fuel-approve-name-block strong {font-size:16px; white-space:normal; overflow-wrap:anywhere;}
 #fuelApproveDialog .fuel-approve-name-block span {font-size:12px;}
 #fuelApproveDialog :is(.fuel-approve-grid,.fuel-approve-crew-grid) {grid-template-columns:minmax(0,1fr); gap:12px;}
 #fuelApproveDialog .fuel-approve-body {gap:12px; overflow:visible; max-height:none;}
 #fuelApproveDialog .fuel-approve-body>.fuel-approve-grid:has(>div[style*="display: none"]):not(:has(>div:not([style*="display: none"]))) {gap:0;}
 #fuelApproveDialog .fuel-approve-field {min-width:0;}
 #fuelApproveDialog .fuel-approve-label {font-size:12px; line-height:1.8;}
 #fuelApproveDialog .fuel-approve-input {height:44px;}
 #fuelApproveDialog .fuel-approve-actions {display:flex; flex-flow:row nowrap; gap:8px; padding:12px 0 0; margin:12px 0 0;}
 #fuelApproveDialog .fuel-approve-actions .fuel-dialog-nav-btn {flex:0 0 44px; width:44px; padding:0;}
 #fuelApproveDialog .fuel-dialog-nav-btn span {display:none;}
 #fuelApproveDialog #approveSubmitBtn {flex:1; min-width:0; white-space:normal;}
 #fuelExportDialog .dialog-actions {display:grid!important; grid-template-columns:minmax(0,1fr)!important; gap:8px!important;}
 #fuelExportDialog .dialog-actions .button {width:100%; margin:0; white-space:normal;}
 #bulkImportDialog :is(textarea,input[type=file]) {width:100%;}
 :is(#fuelPrintDialog,#fuelPrintSelectionDialog) .fuel-print-selection-actions {gap:8px; min-width:0;}
}
@media screen and (min-width:560px) {
 :is(#invoiceBreakdownEditDialog,#fuelApproveDialog,#bulkImportDialog,#fuelExportDialog,#fuelPrintDialog,#fuelPrintSelectionDialog)>:is(form,div) {padding:20px!important;}
 #invoiceBreakdownDialog .invoice-breakdown-shell {padding:20px;}
 #invoiceEditorActions .invoice-direct-action-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
 #fuelApproveDialog :is(.fuel-approve-grid,.fuel-approve-crew-grid) {grid-template-columns:repeat(2,minmax(0,1fr));}
 #fuelExportDialog .dialog-actions {grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media screen {
 #fuelApproveDialog .fuel-approve-field {padding:0!important; border:0!important; border-radius:0; background:transparent!important; box-shadow:none!important;}
 #fuelApproveDialog .fuel-approve-head {position:relative;}
 #fuelApproveDialog .fuel-approve-close {position:absolute; inset-inline-end:0; top:0;}
 #fuelApproveDialog .fuel-approve-title {padding-inline-end:52px; min-height:44px; display:flex; align-items:center;}
 #fuelApproveDialog .fuel-approve-identity small {font-size:11px;}
}
@media screen and (min-width:380px) {
 #fuelApproveDialog :is(.fuel-approve-grid,.fuel-approve-crew-grid) {grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media screen {
 #fuelApproveDialog .fuel-approve-close {top:0!important; left:0!important; right:auto!important;}
 :is(#invoiceBreakdownDialog,#invoiceBreakdownEditDialog,#fuelApproveDialog,#bulkImportDialog,#fuelExportDialog,#fuelPrintDialog,#fuelPrintSelectionDialog) input:is([type=checkbox],[type=radio]) {min-height:0; width:18px!important; height:18px!important; flex:0 0 18px;}
 #fuelExportColumns {grid-template-columns:minmax(0,1fr)!important; gap:8px!important;}
 #fuelExportColumns label {min-height:44px; font-size:13px!important; box-sizing:border-box;}
}
@media screen and (min-width:560px) {#fuelExportColumns {grid-template-columns:repeat(2,minmax(0,1fr))!important;}}
@media screen {
 #bulkImportDialog {height:auto!important;}
 #bulkImportDialog>.dialog-form {height:auto!important; max-height:none!important; overflow:visible!important;}
 #fuelPrintSelectionDialog .fuel-print-selection-list {min-height:0; align-content:start;}
 #fuelPrintSelectionDialog .fuel-print-selection-row {min-height:54px; box-shadow:none;}
 #fuelPrintSelectionDialog .fuel-print-selection-row strong {font-size:13px;}
 #fuelPrintSelectionDialog .fuel-print-selection-row small {font-size:11px;}
 #fuelPrintSelectionDialog .fuel-print-selection-group {min-height:0;}
 body:has(#fuelBoard) #fisherSendDialog {box-sizing:border-box; width:calc(100% - 24px); max-height:calc(100dvh - 24px)!important; padding:12px; overflow-y:auto; font-size:13px;}
 body:has(#fuelBoard) #fisherSendDialog .dialog-head {display:flex; align-items:center; gap:12px;}
 body:has(#fuelBoard) #fisherSendDialog .dialog-head>div {min-width:0; flex:1;}
 body:has(#fuelBoard) #fisherSendDialog .dialog-head h2 {font-size:18px!important;}
 body:has(#fuelBoard) #fisherSendDialog :is(.button,.icon-button) {min-height:44px; font-size:13px;}
}

/* Invoice receipt: saved preference beside the editable phone, independent send actions. */
#invoiceSendDialog[open]{display:flex;flex-direction:column;max-height:calc(100dvh - 24px)}
#invoiceSendDialog>.dialog-head,#invoiceSendDialog>.invoice-send-actions{flex-shrink:0}
#invoiceSendDialog>.form-grid{min-height:0;overflow-y:auto;overflow-x:hidden}
#invoiceSendDialog .invoice-send-recipient{display:flex;align-items:stretch;flex-wrap:nowrap;min-width:0;border:1px solid var(--border);border-radius:12px;background:var(--surface)}
#invoiceSendDialog .invoice-send-recipient:focus-within{outline:2px solid var(--primary);outline-offset:2px}
#invoiceSendDialog .invoice-send-recipient input{flex:1;min-width:0;width:0;border:0;border-radius:0 12px 12px 0;box-shadow:none;outline:none;min-height:44px;font-size:16px;text-align:right}
#invoiceSendDialog .invoice-send-recipient select{flex:0 1 140px;min-width:0;max-width:46%;width:140px;border:0;border-inline-start:1px solid var(--border);border-radius:12px 0 0 12px;background:var(--surface-hover);min-height:44px;font-size:13px;padding-inline:8px 24px;box-shadow:none;outline:none;text-overflow:ellipsis;white-space:nowrap}
#invoiceSendDialog .invoice-send-actions{display:flex;flex-flow:row nowrap;gap:6px;padding:12px 12px calc(12px + env(safe-area-inset-bottom));margin-top:12px}
#invoiceSendDialog .invoice-send-actions .button{flex:1 1 0;min-width:0;width:auto;min-height:44px;padding:8px 3px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#invoiceSendDialog .dialog-head .icon-button{min-width:44px;min-height:44px}
@media(min-width:768px){
 #invoiceSendDialog .invoice-send-actions{gap:10px;padding-inline:22px}
 #invoiceSendDialog .invoice-send-actions .button{padding-inline:10px;font-size:13px}
 #invoiceSendDialog .invoice-send-recipient select{flex-basis:160px;width:160px}
}

/* One invoice card at every width; full information/actions open in its editor. */
.invoice-page .invoice-unified-list{display:grid;gap:8px;min-width:0;max-width:100%;container:invoice-cards / inline-size}
.invoice-page .invoice-select-all{display:flex;align-items:center;gap:8px;min-height:44px;width:max-content;max-width:100%;font-size:13px}
.invoice-page .invoice-card{min-width:0;max-width:100%;margin:0;padding:8px;border:1px solid var(--border);border-radius:14px;background:var(--surface,#fff);box-shadow:none}
.invoice-page .invoice-card-row{display:flex;flex-flow:row nowrap;align-items:center;gap:4px;min-width:0;max-width:100%}
.invoice-page .invoice-card-row>*{min-width:0;white-space:nowrap}
.invoice-page .invoice-card-select{display:flex;align-items:center;justify-content:center;width:44px;min-height:44px;flex:0 0 44px;margin:0}
.invoice-page .invoice-card-person{display:flex;flex:1 1 150px;align-items:center;gap:4px;min-width:0;min-height:44px;border:0;padding:0;background:transparent;color:var(--text);font:inherit;text-align:right;cursor:pointer;overflow:hidden}
.invoice-page .invoice-card-person .invoice-mobile-name{display:block;visibility:visible;flex:1 1 auto;min-width:0;max-width:100%;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.invoice-page .invoice-card-person .invoice-mobile-reg{display:none;flex:0 1 auto;min-width:0;max-width:44%;overflow:hidden;text-overflow:ellipsis;unicode-bidi:isolate;font-size:12px}
.invoice-page .invoice-card-person .invoice-mobile-id{display:none}
.invoice-page .invoice-card-row .invoice-total-button{display:flex;flex:0 1 104px;align-items:center;justify-content:center;min-width:72px;max-width:130px;min-height:44px;padding:4px;border-radius:10px;overflow:hidden}
.invoice-page .invoice-card-row .invoice-total-button strong{display:block;flex:1 1 0;width:100%;min-width:0;max-width:100%;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}
.invoice-page .invoice-card-row .invoice-total-button small{display:none}
.invoice-page .invoice-card-row .invoice-mobile-send-btn,.invoice-page .invoice-card-details,.invoice-page .invoice-card-row .invoice-icon-action,.invoice-page .invoice-card-row .invoice-row-edit{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:0;border:1px solid var(--border);border-radius:10px;background:var(--surface-hover,#f3f8f8);color:var(--primary-deep);font-size:20px;cursor:pointer}
.invoice-page .invoice-card-row .invoice-card-secondary,.invoice-page .invoice-card-row .invoice-card-desktop-action,.invoice-page .invoice-card-row .invoice-row-edit{display:none}
.invoice-page .invoice-card-store{display:none!important}
.invoice-page .invoice-card button:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
@container invoice-cards (min-width:600px){
 .invoice-page .invoice-card-row{gap:6px}
 .invoice-page .invoice-card-row .invoice-row-edit{display:inline-flex}
 .invoice-page .invoice-card-row .invoice-tariff-tag,.invoice-page .invoice-card-row .invoice-status{display:inline-flex;flex:0 1 80px;justify-content:center;overflow:hidden;text-overflow:ellipsis;font-size:12px}
 .invoice-page .invoice-card-person .invoice-mobile-reg{display:inline}
 .invoice-page .invoice-card-person .invoice-mobile-id{display:inline;flex:0 0 auto;font-size:12px}
}
@container invoice-cards (min-width:1300px){
 .invoice-page .invoice-card-row .invoice-card-desktop-action{display:inline-flex}
 .invoice-page .invoice-card-row .invoice-card-amount{display:flex;align-items:center;justify-content:center;gap:5px;flex:0 1 125px;min-height:44px;padding:4px;border:0;border-radius:8px;background:transparent;color:var(--text);font:inherit;overflow:hidden}
 .invoice-page .invoice-card-amount span{display:inline;flex:0 0 auto;font-size:12px}
 .invoice-page .invoice-card-amount b{flex:1 1 0;width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
}

/* Resist legacy compact-button rules without reducing the 44px touch area. */
.invoice-page .invoice-card-row .invoice-mobile-send-btn,.invoice-page .invoice-card-details,.invoice-page .invoice-card-row .invoice-icon-action,.invoice-page .invoice-card-row .invoice-row-edit{appearance:none;flex:0 0 44px!important;min-width:44px!important;max-width:44px;box-sizing:border-box;border:1px solid var(--border,#c9dddf)!important;border-radius:10px!important;background:var(--surface-hover,#f3f8f8)!important}
.invoice-page .invoice-card-select .check-input{appearance:none;accent-color:var(--primary);width:20px;height:20px;min-width:20px;min-height:20px}
.invoice-page .invoice-card-row .invoice-total-button strong{direction:ltr;unicode-bidi:isolate}
.invoice-page .invoice-card.selected{border-color:var(--primary);background:var(--primary-soft,#edf8f4)}

/* Traffic column order: keyboard-operable headers and one compact mobile control. */
.traffic-panel .traffic-column-sort{display:flex;flex-flow:row nowrap;align-items:center;justify-content:center;gap:6px;width:100%;min-width:0;min-height:44px;padding:4px;border:0;background:transparent;color:inherit;font:inherit;font-weight:700;cursor:pointer;white-space:nowrap}
.traffic-panel .traffic-column-sort .traffic-sort-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.traffic-panel .traffic-column-sort [data-sort-arrow]{flex:0 0 auto;font-size:14px;color:var(--primary-deep)}
.traffic-panel th[aria-sort="ascending"] .traffic-column-sort,.traffic-panel th[aria-sort="descending"] .traffic-column-sort{color:var(--primary-deep);background:var(--primary-soft,#edf8f4);border-radius:8px}
.traffic-panel .traffic-column-sort:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.traffic-panel .traffic-sort-controls{display:flex;flex-flow:row nowrap;align-items:center;gap:6px;min-width:0;width:100%;margin-block:8px;font-size:13px}
.traffic-sort-controls label{flex:0 0 auto;white-space:nowrap}
.traffic-sort-controls select{flex:1 1 0;min-width:0;width:0;max-width:320px;min-height:44px;font:inherit}
.traffic-sort-controls [data-traffic-sort-direction]{flex:0 0 auto;min-width:84px;min-height:44px;padding:6px;font-size:13px;white-space:nowrap}
.traffic-sort-controls [data-traffic-sort-status]{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
/* Invoice ledger columns: one renderer, aligned desktop headings and compact mobile summary. */
@media screen {
 .invoice-page .invoice-panel{container:invoice-panel / inline-size}
 .invoice-page .invoice-columns-heading{display:none}
 .invoice-page .invoice-print-toolbar{display:grid;grid-template-columns:auto minmax(160px,1fr) auto auto;align-items:center;gap:8px;margin-bottom:16px;min-width:0}
 .invoice-page .invoice-print-toolbar>*{min-width:0;min-height:44px}
 .invoice-page .invoice-print-toolbar select{font:inherit;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);padding:6px}
 .invoice-page .invoice-print-toolbar .button{white-space:nowrap;font-size:13px}
 .invoice-page .invoice-card-row .invoice-total-button.credit{color:#126b45}
 .invoice-page .invoice-mobile-filter-panel{width:240px;max-width:calc(100vw - 24px);min-width:0;left:auto;right:0}
 .invoice-page .invoice-mobile-filter:first-child .invoice-mobile-filter-panel{right:auto;left:0}
}
@media screen and (max-width:700px){
 .invoice-page .invoice-print-toolbar{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .invoice-page .invoice-print-toolbar label{display:none}
 .invoice-page .invoice-print-toolbar select{grid-column:1 / -1}
 .invoice-page .invoice-print-toolbar .button{padding:8px 4px;font-size:12px}
}
@container invoice-panel (min-width:1300px){
 .invoice-page .invoice-columns-heading,.invoice-page .invoice-card-row{display:grid;grid-template-columns:44px minmax(150px,1.8fr) 86px repeat(4,minmax(76px,1fr)) 120px repeat(4,44px) 90px repeat(3,44px);align-items:center;gap:4px}
 .invoice-page .invoice-columns-heading{padding:10px 8px;background:var(--surface-hover,#f3f8f8);font-size:12px;font-weight:700;text-align:center;border-bottom:1px solid var(--border)}
 .invoice-page .invoice-columns-heading>*{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .invoice-page .invoice-unified-list{gap:0}
 .invoice-page .invoice-card{border-radius:0;border-width:0 0 1px;padding:6px 8px}
 .invoice-page .invoice-card:nth-child(even){background:var(--surface-hover,#f7faf9)}
 .invoice-page .invoice-card-row .invoice-card-person{width:100%}
 .invoice-page .invoice-card-row .invoice-card-secondary{display:flex;width:100%;max-width:100%;min-width:0;justify-content:center;overflow:hidden;text-overflow:ellipsis}
 .invoice-page .invoice-card-row .invoice-card-amount{background:transparent;border:0;padding:4px;min-height:44px;color:var(--text)}
 .invoice-page .invoice-card-row .invoice-card-amount span{display:none}
 .invoice-page .invoice-card-row .invoice-card-amount b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
 .invoice-page .invoice-card-row .invoice-card-desktop-action,.invoice-page .invoice-card-row .invoice-row-edit{display:inline-flex}
 .invoice-page .invoice-card-row .invoice-total-button{width:100%;max-width:100%;min-width:0}
}

@media screen {
 body.invoice-page .invoice-mobile-filter-panel.invoice-floating-filter-panel{position:fixed;inset:auto;z-index:2400;box-sizing:border-box;min-width:0;max-width:none;margin:0;overflow:auto;overscroll-behavior:contain;animation:none;}
 body.invoice-page .invoice-floating-filter-panel a{min-height:44px;display:flex;align-items:center;white-space:normal;overflow-wrap:anywhere;font-size:12px;}
}

/* Latest panel SMS shares the existing single-line send control. */
.invoice-panel-status{display:block;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:700}
.invoice-panel-status-full{display:none}.invoice-panel-status-short{display:inline}
.invoice-panel-status[data-state=delivered],.invoice-panel-last-status[data-state=delivered]{color:#126b45}
.invoice-panel-status[data-state=pending],.invoice-panel-last-status[data-state=pending]{color:#765900}
.invoice-panel-status[data-state=failed],.invoice-panel-status[data-state=invalid],.invoice-panel-last-status[data-state=failed],.invoice-panel-last-status[data-state=invalid]{color:#b4233c}
.invoice-panel-status[data-state=blacklisted],.invoice-panel-status[data-state=blocked_local],.invoice-panel-last-status[data-state=blacklisted],.invoice-panel-last-status[data-state=blocked_local]{color:#20252b}
.invoice-panel-last-status{padding:8px 0;font-weight:700}
@container invoice-panel (min-width:1300px){
 .invoice-page .invoice-columns-heading,.invoice-page .invoice-card-row{grid-template-columns:44px minmax(120px,1.8fr) 86px repeat(4,minmax(76px,1fr)) 120px 44px 90px repeat(2,44px) 90px repeat(3,44px)}
 .invoice-page .invoice-card-row .invoice-mobile-send-btn{width:100%!important;max-width:100%;min-width:44px!important}
 .invoice-panel-status-full{display:inline}.invoice-panel-status-short{display:none}
}

.invoice-breakdown-panel-status{display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:8px;min-width:0}
.invoice-breakdown-panel-status .invoice-panel-last-status{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.invoice-breakdown-panel-status .button{flex:none;min-height:44px;font-size:12px}
/* Historical manual selections are independent, readable single-line rows. */
.manual-trip-chip { min-width:0; flex-wrap:nowrap; font-size:13px; }
.manual-trip-chip > span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.manual-trip-chip > button { flex:0 0 44px; min-width:44px; min-height:44px; }

/* Deleted-row selection keeps classification/print accessible without wrapping. */
@media screen {
 .index-page .selection-bar.trash-selection-bar{transition:none!important;overflow:visible!important;flex-wrap:nowrap!important;gap:4px;min-width:0;max-width:calc(100% - 16px);padding:6px}
 .index-page .trash-selection-bar .selection-summary{flex:0 1 auto;min-width:0;gap:2px}
 .index-page .trash-selection-bar .selection-summary strong{font-size:12px;white-space:nowrap}
 .index-page .trash-selection-bar>div:last-child{display:flex;flex-wrap:nowrap!important;gap:2px;min-width:0;flex:none}
 .index-page .trash-selection-bar .bar-btn:not(.bar-btn-text),.index-page .trash-selection-bar .clear-btn{width:44px;min-width:44px;height:44px;min-height:44px;margin:0;padding:0;flex:none}
 .index-page .trash-selection-bar .selection-summary [data-selection-scope-note]{max-width:36px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .index-page #trashActionsDialog{max-width:min(440px,calc(100vw - 24px));max-height:calc(100dvh - 24px)}
 .index-page #trashActionsDialog .quick-pick-list{display:grid;gap:8px;padding:12px}
}

@media screen {
 .index-page .trash-selection-bar .bar-btn>span:not(.btn-icon){display:none}
 .index-page .trash-selection-bar .bar-btn .btn-icon{display:inline-flex!important}
 .index-page #trashActionsDialog .quick-pick-list button{min-height:44px}
 .index-page #trashActionsDialog .trash-scope-controls{padding:8px 12px;display:grid;gap:8px;min-width:0}
 .index-page #trashActionsDialog .trash-scope-controls button{min-height:44px;white-space:normal;overflow-wrap:anywhere}
}
