/* AAA HOUSE Material Control v2.6.3
 * Mobile UI Final Polish
 * Scope: phone/tablet only. Desktop layout intentionally untouched.
 */

/* 1) Guarantee readable foreground/background contrast for every standard action button
 * on iPhone/iPad. This intentionally overrides earlier "color: inherit" mobile rules.
 */
@media screen and (max-width: 1000px) and (pointer: coarse),
       screen and (max-width: 820px) {
  .button.secondary,
  .row-actions .button.secondary,
  .v26-action-body .button.secondary {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
  }

  .button.primary,
  .row-actions .button.primary,
  .v26-action-body .button.primary {
    color: #102112 !important;
    -webkit-text-fill-color: #102112 !important;
  }

  .button.ghost,
  .row-actions .button.ghost,
  .v26-action-body .button.ghost {
    color: #172127 !important;
    -webkit-text-fill-color: #172127 !important;
  }

  .button.success,
  .row-actions .button.success,
  .v26-action-body .button.success {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
  }

  .button.warning,
  .row-actions .button.warning,
  .v26-action-body .button.warning {
    color: #5d3a00 !important;
    -webkit-text-fill-color: #5d3a00 !important;
  }

  .button.danger,
  .row-actions .button.danger,
  .v26-action-body .button.danger {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
  }

  .button.danger-outline,
  .row-actions .button.danger-outline,
  .v26-action-body .button.danger-outline {
    color: #b42318 !important;
    -webkit-text-fill-color: #b42318 !important;
  }

  .button:disabled {
    -webkit-text-fill-color: currentColor !important;
  }
}

/* 2) Edit-request queue on portrait phones: keep a readable full-width table inside its
 * own horizontal viewport instead of compressing Thai action labels character-by-character.
 */
@media screen and (max-width: 820px) and (orientation: portrait) {
  #page-editrequests .panel {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  #page-editrequests .table-wrap.v263-editqueue-viewport {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    border: 1px solid #dce5df;
    border-radius: 13px;
    background: #fff;
  }

  #page-editrequests table.v263-editqueue-full-table,
  #page-editrequests table.v25-mobile-compact-table.v263-editqueue-full-table {
    display: table !important;
    width: 1180px !important;
    min-width: 1180px !important;
    max-width: none !important;
    table-layout: auto !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    transform: none !important;
    zoom: 1 !important;
  }

  #page-editrequests table.v263-editqueue-full-table th,
  #page-editrequests table.v263-editqueue-full-table td {
    display: table-cell !important;
    padding: 9px 10px !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    vertical-align: middle !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    line-break: loose !important;
    hyphens: none !important;
  }

  /* The final action column must be wide enough for full Thai labels. */
  #page-editrequests table.v263-editqueue-full-table th:last-child,
  #page-editrequests table.v263-editqueue-full-table td:last-child {
    width: 235px !important;
    min-width: 235px !important;
  }

  #page-editrequests table.v263-editqueue-full-table .actions,
  #page-editrequests table.v263-editqueue-full-table .row-actions {
    display: flex !important;
    flex-flow: row wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    width: auto !important;
    min-width: 0 !important;
  }

  #page-editrequests table.v263-editqueue-full-table .button,
  #page-editrequests table.v263-editqueue-full-table [data-edit-queue] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 98px !important;
    min-height: 40px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    text-indent: 0 !important;
  }

  #page-editrequests table.v263-editqueue-full-table [data-view-request] {
    min-width: 64px !important;
  }

  #page-editrequests .v263-editqueue-hint {
    position: sticky;
    left: 10px;
    display: inline-block;
    margin: 8px 10px 10px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(23,33,39,.88);
    color: #fff;
    -webkit-text-fill-color: #fff;
    font-size: 12px;
    font-weight: 800;
    pointer-events: none;
  }
}

@media print {
  .v263-editqueue-nav,
  .v263-editqueue-hint { display: none !important; }
}
