/* Mobile task surfaces use the existing Jade palette and business HTML. */
.qms-mobile-taskbar, .qms-mobile-only { display: none; }
.qms-mobile-disclosure > summary, .qms-mobile-row-toggle { display: none; }
.qms-mobile-dialog { border: 0; border-radius: 20px; padding: 0; color: #203c35; background: #fbfcfa; max-width: min(94vw, 760px); }
.qms-mobile-dialog::backdrop { background: rgba(22, 42, 34, .55); }
.qms-mobile-preview-head { display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 16px; border-bottom: 1px solid #dce5df; }
.qms-mobile-preview-head strong { overflow-wrap: anywhere; }
.qms-mobile-preview-content { padding: 12px; }
.qms-mobile-preview-content :is(img,video,iframe) { width: 100%; max-height: 75dvh; object-fit: contain; border: 0; }
.qms-mobile-preview-content iframe { height: 70dvh; }
.qms-mobile-file-queue, .qms-mobile-attachment-open { display: none; }
.qms-mobile-field-error { color: #9e3827; font-size: 14px; margin: 6px 0 0; }
.qms-mobile-error-summary { padding: 14px 16px; background: #fff4ee; border: 1px solid #edcfc2; border-radius: 14px; }
.qms-mobile-error-summary a { display: block; padding: 7px 0; }

@media screen and (max-width: 900px), screen and (max-width: 1024px) and (max-height: 600px) and (pointer: coarse) {
  /* Keep the window as the scroll container so the taskbar stays reachable. */
  html:has(body.qms-mobile-foundation) { overflow-x: clip; overflow-y: visible; }
  body.qms-p1.qms-jade.qms-mobile-foundation {
    --qms-mobile-header-offset: calc(60px + env(safe-area-inset-top, 0px));
    --mobile-ink: #203c35; --mobile-muted: #587069; --mobile-line: #dde7df;
    --mobile-surface: #fff; --mobile-accent: #29674f;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 16px; line-height: 1.6; -webkit-text-size-adjust: 100%;
    background: #f6f5f0; color: var(--mobile-ink); overflow-x: clip; overflow-y: visible;
  }
  .qms-mobile-foundation .app-shell { min-width: 0; }
  body.qms-p1.qms-jade.qms-mobile-foundation .main { margin-left: 0; min-width: 0; }
  body.qms-p1.qms-jade.qms-mobile-foundation .qms-mobile-taskbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 48; min-height: var(--qms-mobile-header-offset);
    padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px;
    background: #fbfcfa; border-bottom: 1px solid var(--mobile-line);
  }
  .qms-mobile-foundation .qms-mobile-taskbar > strong { flex: 1; min-width: 0; font-size: 18px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
  body.qms-p1.qms-jade.qms-mobile-foundation .qms-mobile-taskbar :is(a,button) { display: flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 10px; border: 1px solid var(--mobile-line); border-radius: 13px; background: #fff; color: var(--mobile-ink); }
  .qms-mobile-foundation .qms-mobile-taskbar .jade-icon { width: 22px; height: 22px; }
  body.qms-p1.qms-jade.qms-mobile-foundation .command-header { min-height: 0; height: 0; position: static; border: 0; }
  .qms-mobile-foundation .command-topline, .qms-mobile-foundation .command-nav-row > [data-sidebar-toggle], .qms-mobile-foundation .topbar { display: none; }
  .qms-mobile-foundation .command-nav-row { display: block; min-height: 0; padding: 0; }
  body.qms-p1.qms-jade.qms-mobile-foundation .command-nav-row .nav {
    position: fixed; display: none; flex-direction: column;
    top: var(--qms-mobile-header-offset); left: 0; width: min(88vw, 360px);
    height: calc(100dvh - var(--qms-mobile-header-offset)); max-height: none;
    padding: 16px 12px calc(24px + env(safe-area-inset-bottom, 0px));
    overscroll-behavior: contain; background: #fbfcfa; border: 0;
    box-shadow: 10px 0 35px rgba(26, 51, 37, .13); z-index: 47;
  }
  body.qms-mobile-foundation.sidebar-open::before { inset: var(--qms-mobile-header-offset) 0 0; z-index: 46; background: rgba(26, 42, 34, .42); }
  body.qms-p1.qms-jade.qms-mobile-foundation.sidebar-open .command-nav-row .nav { display: flex; }
  body.qms-p1.qms-jade.qms-mobile-foundation .command-nav-row .nav :is(a,summary) { min-height: 46px; font-size: 15px; color: var(--mobile-ink); padding: 11px 12px; }
  /* Pair submenu surfaces with their text; legacy hover/focus rules use a dark panel. */
  body.qms-p1.qms-jade.qms-mobile-foundation .command-nav-row .nav-menu {
    background: #f3f7f4; color: var(--mobile-ink); border: 1px solid var(--mobile-line);
    border-radius: 12px; padding: 4px 6px; margin: 4px 0 10px;
    box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  body.qms-p1.qms-jade.qms-mobile-foundation .command-nav-row .nav-menu a {
    background: transparent; color: var(--mobile-ink); border: 0; border-left: 3px solid transparent;
    border-radius: 8px; margin: 2px 0; padding-left: 12px;
  }
  body.qms-p1.qms-jade.qms-mobile-foundation .command-nav-row .nav-menu a:is(:hover,:focus-visible) { background: #e8f1eb; color: #184b37; }
  body.qms-p1.qms-jade.qms-mobile-foundation .command-nav-row .nav-menu a.active { background: #dcece2; color: #184b37; border-left-color: #29674f; font-weight: 700; }
  body.qms-p1.qms-jade.qms-mobile-foundation .command-nav-row .nav :is(a,summary):focus-visible { outline: 3px solid #278173; outline-offset: 2px; }
  .qms-mobile-foundation .nav .user-name, .qms-mobile-foundation .nav .role-badge { color: var(--mobile-ink); }
  body.qms-p1.qms-jade.qms-mobile-foundation .content { padding: 14px 14px calc(28px + env(safe-area-inset-bottom, 0px)); }
  .qms-mobile-foundation .qms-mobile-only { display: block; }
  body.qms-p1.qms-jade.qms-mobile-foundation :is(.panel,.metric-card,.command-kpi,.attachment-group) { border-color: var(--mobile-line); border-radius: 18px; box-shadow: 0 1px 3px rgba(29, 54, 39, .035), 0 8px 24px rgba(29, 54, 39, .04); }
  body.qms-p1.qms-jade.qms-mobile-foundation .panel { padding: 16px; margin-bottom: 14px; }
  body.qms-p1.qms-jade.qms-mobile-foundation :is(h1,h2,h3) { letter-spacing: -.02em; }
  .qms-mobile-foundation h1 { font-size: 24px; }
  .qms-mobile-foundation h2 { font-size: 19px; }
  .qms-mobile-foundation h3 { font-size: 17px; }
  .qms-mobile-foundation :is(.muted,.hint,.help-text,.field-help,.form-help,.panel>p) { font-size: 13px; line-height: 1.65; color: var(--mobile-muted); }
  .qms-mobile-foundation label { font-size: 14px; line-height: 1.6; color: var(--mobile-ink); }
  body.qms-p1.qms-jade.qms-mobile-foundation :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]),select,textarea) { font-size: 16px; min-height: 50px; border-radius: 12px; padding: 12px; color: var(--mobile-ink); border: 1px solid #cfdcd3; background: #fff; box-shadow: none; }
  .qms-mobile-foundation :is(input[readonly],input:disabled,textarea[readonly]) { background: #f0f4f0 !important; color: #52675a !important; }
  .qms-mobile-foundation input:is([type=checkbox],[type=radio]) { width: 22px; height: 22px; flex: 0 0 22px; accent-color: var(--mobile-accent); }
  .qms-mobile-foundation textarea { width: 100%; min-height: 116px; resize: vertical; line-height: 1.7; }
  body.qms-p1.qms-jade.qms-mobile-foundation :is(button:not(.workflow-port),.button) { min-height: 48px; padding: 11px 16px; font-size: 16px; line-height: 1.4; border-radius: 12px; font-family: inherit; font-weight: 600; }
  body.qms-p1.qms-jade.qms-mobile-foundation :is(button,.button).secondary:not(.danger) { background: #f1f6f0; color: #345943; border-color: var(--mobile-line); }
  .qms-mobile-foundation :is(button,.button):not(.secondary):not(.danger):not(.text-button):not(.workflow-port) { background-color: var(--mobile-accent); }
  .qms-mobile-foundation :is(a,button,input,select,textarea,summary):focus-visible { outline: 3px solid #278173; outline-offset: 3px; }
  body.qms-p1.qms-jade.qms-mobile-foundation .form-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 18px; }
  .qms-mobile-foundation .form-grid > label, .qms-mobile-foundation .form > label { display: flex; flex-direction: column; gap: 7px; width: 100%; min-width: 0; }
  .qms-mobile-foundation .form-grid label.wide { grid-column: 1/-1; }
  .qms-mobile-foundation :is(.form-actions,.module-actions,.table-actions) { gap: 10px; overflow: visible; flex-wrap: wrap; }
  .qms-mobile-foundation .form-actions,
  body.qms-p1.qms-jade.qms-mobile-foundation .form:not(.filter-bar) .form-actions {
    position: static; inset: auto; z-index: auto; margin-top: 20px; padding: 12px 0 0;
    background: transparent; border-top: 1px solid var(--mobile-line); box-shadow: none;
  }
  .qms-mobile-foundation .form-actions > :is(button,.button) { flex: 1 1 160px; }
  .qms-mobile-foundation .qms-mobile-disclosure { border: 1px solid var(--mobile-line); border-radius: 14px; background: #f9fbf8; margin: 0 0 16px; padding: 0; }
  .qms-mobile-foundation .qms-mobile-disclosure > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 11px 14px; gap: 10px; color: #435d4b; font-size: 14px; cursor: pointer; list-style: none; }
  .qms-mobile-disclosure > summary::-webkit-details-marker { display: none; }
  .qms-mobile-disclosure > summary .jade-icon { width: 18px; height: 18px; flex: 0 0 18px; transition: transform 180ms ease; }
  .qms-mobile-disclosure[open] > summary .jade-icon { transform: rotate(180deg); }
  .qms-mobile-foundation .qms-mobile-disclosure > .qms-mobile-disclosure-body { padding: 0 14px 16px; }
  .qms-mobile-foundation .qms-mobile-disclosure .panel { border: 0; background: transparent; box-shadow: none; padding: 0; }
  .qms-mobile-foundation .qms-mobile-inspection-section { padding: 0; margin: 0 0 22px; border: 0; }
  .qms-mobile-foundation .qms-mobile-inspection-section > h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 0; background: transparent; border: 0; }
  .qms-mobile-foundation .qms-mobile-step { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 9px; background: #e7f1e9; color: #29674f; font-size: 13px; font-weight: 700; }
  .qms-mobile-foundation [data-mobile-inspection-form] .section-heading { margin-top: 18px; }
  .qms-mobile-foundation [data-mobile-inspection-form] > .qms-mobile-disclosure { order: 5; }
  .qms-mobile-foundation .qms-mobile-qc-groups { display: flex; flex-direction: column; }
  .qms-mobile-foundation.qms-mobile-task .qms-module-navigation { display: none; }
  .qms-mobile-foundation.qms-mobile-ready [data-mobile-inspection-head], .qms-mobile-foundation.qms-mobile-ready [data-mobile-qc-title], .qms-mobile-foundation .qms-mobile-empty-grid { display: none; }
  .qms-mobile-foundation .qms-module-navigation { padding: 0; margin: 0 0 14px; background: transparent; border: 0; }
  .qms-mobile-foundation .qms-module-navigation nav { display: flex; flex-wrap: nowrap; gap: 7px; overflow-x: auto; padding: 2px 2px 6px; }
  .qms-mobile-foundation .qms-module-navigation nav a { flex-shrink: 0; white-space: nowrap; }
  .qms-mobile-foundation .qms-module-navigation nav a { min-height: 44px; padding: 9px 12px; background: #eef3ee; border: 1px solid transparent; border-radius: 12px; font-size: 14px; }
  .qms-mobile-foundation .qms-module-navigation nav a.is-active { color: #245c40; background: #e2eee4; border-color: #cbdcce; }
  .qms-mobile-foundation.qms-mobile-ready .qms-module-navigation > p { display: none; }
  .qms-mobile-foundation [data-mobile-list-head] { gap: 10px; margin-bottom: 12px; }
  .qms-mobile-foundation [data-mobile-list-head] > div:first-child p { display: none; }
  .qms-mobile-foundation.qms-mobile-ready [data-mobile-list-actions] > :not([data-mobile-primary-action]):not(.qms-mobile-more-actions) { display: none; }
  .qms-mobile-foundation [data-mobile-primary-action] { width: 100%; text-align: center; }
  .qms-mobile-foundation .qms-mobile-more-actions { width: 100%; padding: 0; margin: 0; border: 0; background: transparent; }
  .qms-mobile-foundation .qms-mobile-more-actions > summary { font-size: 14px; justify-content: center; min-height: 44px; }
  .qms-mobile-foundation [data-mobile-list-filters] { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: end; }
  .qms-mobile-foundation [data-mobile-list-filters] > .qms-mobile-disclosure { grid-column: 1/-1; }
  .qms-mobile-foundation [data-mobile-list-filters] > label:not([data-mobile-search]) { grid-column: 1/-1; }
  .qms-mobile-foundation [data-mobile-list-filters] > button { grid-column: 2; grid-row: 1; }
  .qms-mobile-foundation [data-mobile-list-filters] > label { width: 100%; }
  .qms-mobile-foundation [data-mobile-list-filters] .qms-mobile-disclosure { margin: 0; }
  .qms-mobile-foundation [data-mobile-list-filters] .qms-mobile-disclosure-body { display: grid; grid-template-columns: 1fr; gap: 14px; }
  .qms-mobile-foundation [data-mobile-sort-form] { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin: 12px 0; }
  .qms-mobile-foundation [data-mobile-sort-form] > label { flex: 1 1 100px; }
  .qms-mobile-foundation [data-mobile-sort-form] select { width: 100%; }
  .qms-mobile-foundation .qms-mobile-only { color: var(--mobile-muted); }
  body.qms-p1.qms-jade.qms-mobile-foundation .qms-mobile-card-table { display: block; width: 100% !important; min-width: 0 !important; table-layout: auto; }
  .qms-mobile-foundation .qms-mobile-card-table > thead { display: none; }
  .qms-mobile-foundation .qms-mobile-card-table > tbody { display: flex; flex-direction: column; width: 100%; gap: 12px; }
  body.qms-p1.qms-jade.qms-mobile-foundation .qms-mobile-card-table > tbody > tr[data-mobile-record] { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 5px 10px; padding: 15px; margin: 0; min-width: 0; border: 1px solid var(--mobile-line); border-radius: 16px; background: #fff; box-shadow: 0 2px 8px rgba(27, 51, 36, .035); }
  body.qms-p1.qms-jade.qms-mobile-foundation .qms-mobile-card-table > tbody > tr[data-mobile-issue="1"] { border-left: 3px solid #b27638; }
  body.qms-p1.qms-jade.qms-mobile-foundation .qms-mobile-card-table > tbody > tr[data-mobile-record] > td { display: block; width: auto; min-width: 0; min-height: 0; height: auto; padding: 2px 0; border: 0; font-size: 15px; line-height: 1.55; background: transparent; overflow-wrap: anywhere; white-space: normal; text-align: left; box-shadow: none; position: static; }
  .qms-mobile-foundation .qms-mobile-card-table td { grid-column: 1/-1; }
  .qms-mobile-foundation .qms-mobile-card-table td:is([data-mobile-cell="date"],[data-mobile-cell="supplier"],[data-mobile-cell="decision"],[data-mobile-cell="qa"]) { grid-column: auto; }
  .qms-mobile-foundation .qms-mobile-card-table td[data-mobile-cell="name"] { order: -8; }
  .qms-mobile-foundation .qms-mobile-card-table td:is([data-mobile-cell="decision"],[data-mobile-cell="qa"]) { order: -7; }
  .qms-mobile-foundation .qms-mobile-card-table td[data-mobile-cell="flags"] { order: -6; }
  .qms-mobile-foundation .qms-mobile-card-table td[data-mobile-cell="code"] { order: -5; }
  .qms-mobile-foundation .qms-mobile-card-table td[data-mobile-cell="batch"] { order: -4; }
  .qms-mobile-foundation .qms-mobile-card-table td.qms-mobile-row-secondary { order: 2; }
  .qms-mobile-foundation .qms-mobile-card-table td[data-mobile-cell="actions"] { order: 3; }
  .qms-mobile-foundation .qms-mobile-card-table td.qms-mobile-toggle-cell { order: 4; }
  .qms-mobile-foundation .panel:has(.qms-mobile-card-table) { padding: 0; background: transparent; box-shadow: none; border: 0; }
  .qms-mobile-foundation .qms-mobile-cell-empty { display: none !important; }
  .qms-mobile-foundation .qms-mobile-card-table td::before { display: inline; content: attr(data-qms-column-label); color: #667d6e; margin-right: 8px; font-weight: 400; font-size: 13px; }
  .qms-mobile-foundation .qms-mobile-card-table td[data-mobile-cell="name"] { font-size: 17px !important; font-weight: 650; color: #203c35; }
  .qms-mobile-foundation .qms-mobile-card-table td[data-mobile-cell="name"]::before, .qms-mobile-foundation .qms-mobile-card-table td[data-mobile-cell="actions"]::before, .qms-mobile-foundation .qms-mobile-card-table td.qms-mobile-toggle-cell::before { display: none; }
  body.qms-p1.qms-jade.qms-mobile-foundation .qms-mobile-card-table tr:not(.qms-mobile-row-expanded) > td.qms-mobile-row-secondary { display: none; }
  .qms-mobile-foundation .qms-mobile-card-table .status-chip { font-size: 13px; padding: 4px 8px; min-height: 26px; line-height: 1.5; border-radius: 8px; }
  .qms-mobile-foundation .qms-mobile-card-table td[data-mobile-cell="actions"] .table-actions { margin-top: 7px; }
  .qms-mobile-foundation .qms-mobile-card-table td[data-mobile-cell="actions"] :is(button,a) { min-height: 44px; padding: 10px 12px; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d8e4da; border-radius: 10px; }
  .qms-mobile-foundation .qms-mobile-card-table td.qms-mobile-toggle-cell { grid-column: 1/-1; }
  .qms-mobile-foundation .qms-mobile-row-toggle { display: inline-flex; width: 100%; min-height: 44px; justify-content: center; margin-top: 4px; background: #f1f6f0 !important; color: #42654c; border: 0; font-size: 14px !important; }
  .qms-mobile-foundation .qms-mobile-card-table .qms-mobile-toggle-cell { border-top: 1px solid #edf2ed !important; margin-top: 5px; }
  .qms-mobile-foundation .qms-mobile-card-table td[data-mobile-cell="flags"]:empty { display: none !important; }
  .qms-mobile-foundation .table-wrap:has(> .qms-mobile-card-table) { border: 0; background: transparent; overflow: visible; }
  .qms-mobile-foundation .qms-table-scroll-host:has(> .qms-mobile-card-table) { overflow: visible; border: 0; }
  .qms-mobile-foundation .qms-table-density-toolbar, .qms-mobile-foundation .qms-floating-table-head { display: none !important; }
  .qms-mobile-foundation .qms-abnormal-entry { display: flex; flex-direction: column; }
  .qms-mobile-foundation.qms-mobile-ready .online-feedback-entry-panel > .module-head { display: none; }
  .qms-mobile-foundation .qms-abnormal-entry > .flash-info { order: 6; font-size: 13px; }
  .qms-mobile-foundation .qms-abnormal-entry > details { border: 1px solid var(--mobile-line); border-radius: 14px; background: #f9fbf8; padding: 0 14px 14px; }
  .qms-mobile-foundation .qms-abnormal-entry > details > summary { min-height: 48px; padding: 12px 0; font-size: 14px; }
  .qms-mobile-foundation .qms-abnormal-entry > .mobile-form-primary { order: 1; }
  .qms-mobile-foundation .qms-abnormal-entry > .mobile-form-evidence { order: 2; }
  .qms-mobile-foundation .qms-abnormal-entry > .mobile-form-context { order: 3; }
  .qms-mobile-foundation .qms-abnormal-entry > .mobile-form-details { order: 4; }
  .qms-mobile-foundation .qms-abnormal-entry > .mobile-form-notes { order: 5; }
  .qms-mobile-foundation .qms-abnormal-entry > .mobile-form-routing { order: 7; }
  .qms-mobile-foundation .qms-abnormal-entry > .form-actions { order: 9; }
  .qms-mobile-foundation .attachment-groups { display: flex; flex-direction: column; gap: 12px; }
  .qms-mobile-foundation .attachment-preview-card { border: 0; border-top: 1px solid var(--mobile-line); border-radius: 0; box-shadow: none; padding: 12px 0; }
  .qms-mobile-foundation .attachment-preview-head { display: flex; align-items: flex-start; flex-direction: column; gap: 10px; }
  .qms-mobile-foundation .attachment-preview-head strong { font-size: 15px; overflow-wrap: anywhere; }
  .qms-mobile-foundation .attachment-preview-head small { font-size: 13px; }
  .qms-mobile-foundation.qms-mobile-ready .attachment-preview-card > :is(.attachment-inline-image,.attachment-inline-pdf,.attachment-inline-video) { display: none; }
  .qms-mobile-foundation .qms-mobile-attachment-open { display: inline-flex; min-height: 44px; align-items: center; border: 1px solid var(--mobile-line); border-radius: 10px; padding: 9px 12px; background: #f1f6f0; font-size: 14px; color: #2c6545; }
  .qms-mobile-foundation .qms-mobile-file-queue { display: grid; gap: 8px; margin: 10px 0 0; }
  .qms-mobile-foundation .qms-mobile-file-controls { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
  .qms-mobile-foundation .qms-mobile-file-controls small { flex: 1; font-size: 13px; color: var(--mobile-muted); line-height: 1.5; }
  .qms-mobile-foundation .qms-mobile-file-controls > input[hidden] { display: none; }
  .qms-mobile-foundation .qms-mobile-submit-status { flex: 1 1 100%; font-size: 14px; }
  .qms-mobile-foundation .qms-mobile-account { padding: 8px 0 16px; margin-bottom: 12px; border-bottom: 1px solid var(--mobile-line); }
  .qms-mobile-foundation .qms-mobile-account > a { display: inline-flex; }
  .qms-mobile-foundation .qms-mobile-account > .role-badge { display: block; background: #e6eee7; color: #385443; }
  .qms-mobile-foundation .qms-mobile-error-jump { display: inline-flex; align-items: center; min-height: 44px; margin-right: 12px; }
  .qms-mobile-foundation .qms-mobile-card-table td:is([data-mobile-cell="code"],[data-mobile-cell="batch"],[data-mobile-cell="supplier"]) a.trace-link { display: inline-flex; min-height: 44px; align-items: center; vertical-align: middle; }
  .qms-mobile-foundation .qms-mobile-file-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--mobile-line); border-radius: 12px; background: #f8faf6; }
  .qms-mobile-foundation .qms-mobile-file-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
  .qms-mobile-foundation .qms-mobile-file-item span { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
  .qms-mobile-foundation .qms-mobile-file-item button { min-height: 44px; padding: 9px 12px; font-size: 14px; background: transparent !important; color: #9d4730; border: 1px solid #e5d7cc; }
  .qms-mobile-foundation .qms-mobile-file-item button { color: #9d4730 !important; }
  .qms-mobile-foundation .qms-mobile-row-toggle { color: #42654c !important; }
  .qms-mobile-foundation .qms-mobile-dialog { max-width: none; max-height: none; width: 100%; height: 100dvh; margin: 0; border-radius: 0; }
  .qms-mobile-foundation .qms-mobile-preview-head { padding-top: calc(12px + env(safe-area-inset-top)); }
  .qms-mobile-foundation .qms-mobile-preview-content { max-height: calc(100dvh - 96px); overflow: auto; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .qms-mobile-foundation .qms-mobile-preview-content img { max-height: none; object-fit: contain; touch-action: pan-x pan-y pinch-zoom; }
  .qms-mobile-foundation .qms-mobile-preview-content iframe { height: calc(100dvh - 160px); }
  .qms-mobile-foundation .qms-mobile-status { position: static; top: auto; margin: 0 0 12px; max-height: 48px; width: 100%; }
  .qms-mobile-foundation .qms-mobile-status.is-open { max-height: min(75dvh,640px); }
  .qms-mobile-foundation .qms-mobile-status-handle { min-height: 44px; font-size: 14px; }
  .qms-mobile-foundation .qms-mobile-status-panel { max-height: 60dvh; overflow: auto; }
  .qms-mobile-foundation .qms-home-welcome { padding: 4px 0 12px; }
  .qms-mobile-foundation .qms-home-welcome h1 { font-size: 25px; }
  .qms-mobile-foundation .qms-mobile-start-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .qms-mobile-foundation .qms-mobile-start .qms-launch-tile { display: flex; flex-direction: column; align-items: flex-start; padding: 16px 14px; gap: 12px; }
  .qms-mobile-foundation .qms-mobile-start .qms-launch-copy b { font-size: 16px; line-height: 1.5; }
  .qms-mobile-foundation .qms-mobile-start :is(.qms-launch-copy small,.qms-launch-arrow) { display: none; }
  .qms-mobile-foundation .qms-home-quick-section .qms-launch-tile { min-height: 84px; }
  .qms-mobile-foundation .qms-home-quick-section .qms-launch-copy small { display: none; }
  .qms-mobile-foundation .qms-launch-tile { border-radius: 18px; min-height: 104px; border: 1px solid var(--mobile-line); box-shadow: 0 4px 16px rgba(30, 56, 38, .035); }
  .qms-mobile-foundation .qms-launch-tile span, .qms-mobile-foundation .qms-home-category b { font-size: 16px; }
  .qms-mobile-foundation .qms-home-section-head h2 { font-size: 19px; }
  .qms-mobile-foundation .qms-home-category { min-height: 88px; border-radius: 18px; }
  .qms-mobile-foundation .qms-management-scope { display: grid; grid-template-columns: minmax(0,1fr); width: 100%; gap: 12px; }
  .qms-mobile-foundation .qms-management-scope > label { width: 100%; min-width: 0; }
  .qms-mobile-foundation .qms-management-scope input[type=date] { width: 100%; min-width: 0; }
  .qms-mobile-foundation .profile-mobile-handles { display: flex; position: static; z-index: auto; flex-direction: row; flex-wrap: wrap; width: auto; height: auto; transform: none; gap: 8px; margin: 0 0 16px; }
  .qms-mobile-foundation .profile-mobile-handles button { display: inline-flex; align-items: center; gap: 8px; width: auto; height: auto; min-height: 44px; writing-mode: horizontal-tb; border-radius: 12px; border: 1px solid var(--mobile-line); background: #fff !important; color: var(--mobile-ink); box-shadow: none; font-size: 14px; }
  .qms-mobile-foundation .profile-mobile-handles button strong { position: static; width: auto; height: auto; min-width: 24px; padding: 3px 6px; font-size: 13px; }
  .qms-mobile-foundation .profile-mobile-handles button, .qms-mobile-foundation .profile-mobile-handles button > span { color: var(--mobile-ink) !important; }
  .qms-mobile-foundation .bom-recent-drawer, .qms-mobile-foundation .bom-recent-drawer[open] { position: static; width: 100%; max-width: none; height: auto; max-height: none; inset: auto; transform: none; margin: 0 0 16px; border: 1px solid var(--mobile-line); border-radius: 14px; background: #f9fbf8; box-shadow: none; }
  .qms-mobile-foundation .bom-recent-drawer > summary { position: static; display: flex; align-items: center; justify-content: space-between; width: auto; height: auto; min-height: 48px; inset: auto; writing-mode: horizontal-tb; transform: none; padding: 12px 14px; border-radius: 14px; background: transparent; color: var(--mobile-ink); font-size: 14px; }
  .qms-mobile-foundation .bom-recent-drawer > div { width: 100%; margin-left: 0; max-height: 60dvh; overflow: auto; }
  .qms-mobile-foundation .qms-mobile-chart-hint { font-size: 13px; color: var(--mobile-muted); margin: 10px 0; }
  .qms-mobile-foundation .record-detail-row { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
  .qms-mobile-foundation .record-detail-row > :is(dt,th,label) { color: var(--mobile-muted); font-size: 14px; }
  .qms-mobile-foundation .record-detail-row > :is(dd,td,div) { font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
  .qms-mobile-foundation :is(.flash,.license-banner) { font-size: 14px; line-height: 1.65; }
  .qms-mobile-foundation .qms-mobile-notice-disclosure { margin: 12px 14px 0; }
  .qms-mobile-foundation .qms-mobile-notice-disclosure > summary { font-size: 13px; }
  .qms-mobile-foundation .qms-mobile-notice-disclosure .notice-banner { width: 100%; margin: 0; }
  body.qms-p1.qms-jade.qms-mobile-foundation.qms-keyboard-open .qms-mobile-taskbar { position: static; }
  .qms-mobile-foundation.qms-keyboard-open .form-actions { position: static !important; }
  .qms-mobile-foundation.qms-mobile-task .profile-side-rail, .qms-mobile-foundation.qms-mobile-task .qms-profile-floating-tabs { display: none; }
  .qms-mobile-foundation .login-card { border-radius: 22px; padding: 26px 22px; box-shadow: 0 12px 32px rgba(28, 48, 34, .065); }
  .qms-mobile-foundation .login-card input { min-height: 52px; }
  .qms-mobile-foundation .login-card button { width: 100%; }
}

@media screen and (max-width:900px) and (prefers-reduced-motion:no-preference), screen and (max-width:1024px) and (max-height:600px) and (pointer:coarse) and (prefers-reduced-motion:no-preference) {
  .qms-mobile-foundation :is(button,.button,.qms-launch-tile,.qms-home-category) { transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease; }
  .qms-mobile-foundation :is(button,.button,.qms-launch-tile,.qms-home-category):active { transform: scale(.985); }
  .qms-mobile-foundation .qms-mobile-disclosure[open] > .qms-mobile-disclosure-body { animation: qms-mobile-reveal 180ms ease; }
  .qms-mobile-foundation .qms-mobile-row-expanded .qms-mobile-row-secondary { animation: qms-mobile-reveal 160ms ease; }
  .qms-mobile-foundation .qms-mobile-dialog[open] { animation: qms-mobile-sheet 200ms cubic-bezier(.2,.7,.2,1); }
  .qms-mobile-foundation .content > .panel:first-of-type { animation: qms-mobile-reveal 200ms ease; }
  @keyframes qms-mobile-reveal { from { opacity: .6; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes qms-mobile-sheet { from { opacity: .6; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
}
@media (prefers-reduced-motion:reduce) {
  .qms-mobile-foundation *, .qms-mobile-foundation *::before, .qms-mobile-foundation *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media print { .qms-mobile-taskbar,.qms-mobile-only,.qms-mobile-row-toggle,.qms-mobile-file-queue,.qms-mobile-attachment-open,.qms-mobile-dialog { display: none !important; } .qms-mobile-disclosure > summary { display:none; } }
