/* GS_SOLID_FUEL_MOBILE_COMPACT_V1: records first on phones; desktop layout unchanged. */
@media screen and (max-width: 760px) {
  html:has(body.sf-mobile-compact), body.sf-mobile-compact { min-width: 0 !important; background: #fff !important; }
  body.sf-mobile-compact .page { width: 100% !important; margin: 0 !important; padding: 8px 7px 14px !important; }
  body.sf-mobile-compact .page-head { display: block !important; margin: 0 0 7px !important; padding: 0 !important; }
  body.sf-mobile-compact .page-title .eyebrow,
  body.sf-mobile-compact .page-title > p { display: none !important; }
  body.sf-mobile-compact .page-title h1 { font-size: 17px !important; line-height: 1.3 !important; margin: 0 0 7px !important; }
  body.sf-mobile-compact .head-actions { display: flex !important; flex-wrap: wrap !important; justify-content: flex-start !important; gap: 4px !important; }
  body.sf-mobile-compact .head-actions > button { flex: 1 1 0 !important; min-width: 0 !important; min-height: 36px !important; padding: 4px !important; font-size: 11px !important; line-height: 1.2 !important; }
  body.sf-mobile-compact .solid-fuel-inline-tabs-row { display: block !important; margin: 0 0 5px !important; padding: 0 !important; }
  body.sf-mobile-compact .solid-fuel-inline-tabs-row > .tabs { display: flex !important; gap: 5px !important; margin: 0 !important; width: 100% !important; }
  body.sf-mobile-compact .tabs > .tab { flex: 1 1 0 !important; min-width: 0 !important; min-height: 36px !important; padding: 5px !important; font-size: 12px !important; border-radius: 7px !important; }
  body.sf-mobile-compact .tabs > .tab > span { margin-left: 4px !important; padding: 1px 5px !important; font-size: 11px !important; }
  body.sf-mobile-compact .sheet { border-radius: 8px !important; margin: 0 !important; }
  body.sf-mobile-compact .sheet-head { display: flex !important; flex-wrap: wrap !important; gap: 5px !important; padding: 6px !important; }
  body.sf-mobile-compact .sheet-head > small { display: none !important; }
  body.sf-mobile-compact .sheet-head > div:not(.solid-fuel-inline-quick--above):not(.solid-fuel-unload-tonnage-summary) { display: flex !important; align-items: center !important; gap: 5px !important; }
  body.sf-mobile-compact .sheet-head strong { font-size: 12px !important; }
  body.sf-mobile-compact .sheet-head span { font-size: 10px !important; }
  body.sf-mobile-compact #unloadPanel > .sheet-head > .solid-fuel-inline-quick--above {
    display: grid !important; grid-template-columns: 1fr 1.15fr 36px 1.15fr 36px !important;
    flex: 0 0 100% !important; gap: 4px !important; margin: 0 !important; padding: 0 !important;
  }
  body.sf-mobile-compact #solidFuelUnloadListQuickV4 > button { width: 100% !important; min-width: 0 !important; height: 36px !important; min-height: 36px !important; padding: 3px !important; font-size: 12px !important; }
  body.sf-mobile-compact #solidFuelUnloadTonnageSummary.solid-fuel-unload-tonnage-summary { display: flex !important; align-items: center !important; gap: 5px !important; margin: 0 0 0 auto !important; padding: 4px 6px !important; width: auto !important; min-height: 0 !important; }
  body.sf-mobile-compact #solidFuelUnloadTonnageSummary .solid-fuel-unload-tonnage-summary__value { font-size: 14px !important; }
  body.sf-mobile-compact .table-wrap { overflow: auto !important; max-height: 48vh !important; -webkit-overflow-scrolling: touch; }
  body.sf-mobile-compact .table-wrap::before { content: '표를 좌우로 밀면 전체 항목을 볼 수 있습니다'; display: block; position: sticky; left: 0; padding: 4px 7px; color: #718398; font-size: 10px; background: #f8fafc; }
  body.sf-mobile-compact .data-table { table-layout: fixed !important; min-width: 850px !important; width: 850px !important; }
  body.sf-mobile-compact .data-table thead th { height: 30px !important; padding: 5px 3px !important; font-size: 10px !important; }
  body.sf-mobile-compact .data-table tbody td { padding: 7px 4px !important; font-size: 11px !important; line-height: 1.35 !important; }
  body.sf-mobile-compact .data-table .no { width: 32px !important; }
  body.sf-mobile-compact .data-table .date { width: 84px !important; }
  body.sf-mobile-compact .data-table .clock { width: 48px !important; }
  body.sf-mobile-compact .data-table .duration { width: 52px !important; }
  body.sf-mobile-compact .data-table .fuel-type { width: 64px !important; }
  body.sf-mobile-compact .data-table .receipt-ton { width: 64px !important; }
  body.sf-mobile-compact .data-table .company { width: 86px !important; }
  body.sf-mobile-compact .data-table .vehicle { width: 70px !important; }
  body.sf-mobile-compact .data-table .silo { width: 42px !important; }
  body.sf-mobile-compact .data-table .actions { width: 70px !important; }
  body.sf-mobile-compact .data-table .duration-pill { padding: 3px 5px !important; font-size: 12px !important; }
  body.sf-mobile-compact .data-table .row-btn { min-height: 32px !important; padding: 4px 5px !important; font-size: 11px !important; }
  /* Seven visible fields, one row. Tap to reveal full values/native actions. */
  body.sf-mobile-compact #unloadPanel .table-wrap { overflow-x: hidden !important; }
  body.sf-mobile-compact #unloadPanel .table-wrap::before { content: '행을 누르면 상세정보 · 수정'; font-size: 10px; }
  body.sf-mobile-compact #unloadPanel .unload-table { width: 100% !important; min-width: 0 !important; max-width: 100% !important; table-layout: fixed !important; }
  body.sf-mobile-compact #unloadPanel .unload-table :is(th, td):is(.duration, .vehicle, .silo, .unload-note, .actions) { display: none !important; }
  body.sf-mobile-compact #unloadPanel .unload-table :is(th, td) {
    box-sizing: border-box !important; min-width: 0 !important; max-width: none !important; height: 34px !important;
    padding: 4px 1px !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
    line-height: 1.25 !important; font-size: 11px !important; font-weight: 600 !important; text-align: center !important;
    border-right: 1px solid #e2e8ef !important;
  }
  body.sf-mobile-compact #unloadPanel .unload-table th { height: 28px !important; font-size: 10px !important; background: #edf3f8 !important; }
  body.sf-mobile-compact #unloadPanel .unload-table .sfmc-record-row { height: 34px !important; min-height: 34px !important; }
  body.sf-mobile-compact #unloadPanel .unload-table .no { width: 7% !important; padding: 0 !important; }
  body.sf-mobile-compact #unloadPanel .unload-table .date { width: 13% !important; padding: 0 !important; }
  body.sf-mobile-compact #unloadPanel .unload-table .clock { width: 13% !important; }
  body.sf-mobile-compact #unloadPanel .unload-table .fuel-type { width: 13% !important; }
  body.sf-mobile-compact #unloadPanel .unload-table .receipt-ton { width: 17% !important; }
  body.sf-mobile-compact #unloadPanel .unload-table .company { width: 24% !important; border-right: 0 !important; }
  body.sf-mobile-compact #unloadPanel .fuel-pill { display: inline !important; padding: 0 !important; border: 0 !important; background: transparent !important; font-size: inherit !important; font-weight: 600 !important; }
  body.sf-mobile-compact #unloadPanel .sfmc-date-year { display: none !important; }
  body.sf-mobile-compact #unloadPanel .sfmc-row-toggle {
    display: block; width: 100%; height: 34px; min-height: 34px; padding: 0; border: 0; border-radius: 0;
    background: transparent; color: #345d84; font: inherit; font-weight: 650; cursor: pointer;
  }
  body.sf-mobile-compact #unloadPanel .sfmc-record-row { cursor: pointer; }
  body.sf-mobile-compact #unloadPanel .sfmc-record-open > td { background: #edf5fd !important; }
  body.sf-mobile-compact #unloadPanel .sfmc-row-toggle:focus-visible { outline: 2px solid #477bb2; outline-offset: -2px; }
  body.sf-mobile-compact #unloadPanel .unload-table .sfmc-record-detail > td {
    display: table-cell !important; width: auto !important; height: auto !important; padding: 8px !important;
    background: #f5f9fd !important; white-space: normal !important; text-align: left !important;
  }
  body.sf-mobile-compact #unloadPanel .sfmc-record-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; margin: 0; }
  body.sf-mobile-compact #unloadPanel .sfmc-record-fields > div { display: flex; gap: 6px; min-width: 0; }
  body.sf-mobile-compact #unloadPanel .sfmc-record-fields dt { flex: 0 0 34px; color: #6b7c90; font-size: 10px; }
  body.sf-mobile-compact #unloadPanel .sfmc-record-fields dd { min-width: 0; margin: 0; color: #2d475f; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
  body.sf-mobile-compact #unloadPanel .sfmc-record-note { grid-column: 1 / -1; }
  body.sf-mobile-compact #unloadPanel .sfmc-record-detail .row-actions { display: flex !important; flex-direction: row !important; justify-content: flex-end; gap: 5px; margin-top: 8px; }
  body.sf-mobile-compact #unloadPanel .sfmc-record-detail .row-actions > button { flex: 0 0 auto !important; width: auto !important; min-width: 60px !important; height: 34px !important; min-height: 34px !important; padding: 4px 12px !important; font-size: 12px !important; }
  body.sf-mobile-compact .sfmc-disclosure { margin-top: 7px; border: 1px solid #dbe4ed; border-radius: 8px; background: #f8fafc; }
  body.sf-mobile-compact .sfmc-disclosure > summary { min-height: 38px; padding: 10px; color: #405b75; font-size: 12px; font-weight: 650; cursor: pointer; }
  body.sf-mobile-compact .sfmc-disclosure .query-card { display: block !important; margin: 0 !important; padding: 7px !important; border: 0 !important; }
  /* GS_MOBILE_DETAIL_V4: matched rows and constrained native Safari fields. */
  body.sf-mobile-compact #queryMode { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 4px !important; margin: 0 0 8px !important; }
  body.sf-mobile-compact #queryMode button { width: 100% !important; height: 34px !important; min-height: 34px !important; padding: 4px !important; font-size: 12px !important; }
  body.sf-mobile-compact #filterForm {
    display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-areas: 'period company' 'vehicle sort' 'search search' 'actions actions';
    align-items: start !important; gap: 8px !important; width: 100% !important; min-width: 0 !important;
  }
  body.sf-mobile-compact #filterForm:has(#rangeFilterBox:not([hidden])) { grid-template-areas: 'period period' 'company vehicle' 'search search' 'sort actions'; }
  body.sf-mobile-compact #filterForm:has(#monthFilterBox[hidden]):has(#rangeFilterBox[hidden]) { grid-template-areas: 'company vehicle' 'search search' 'sort actions'; }
  body.sf-mobile-compact #filterForm label {
    display: flex !important; flex-direction: column !important; align-self: start !important;
    width: 100% !important; min-width: 0 !important; max-width: 100% !important;
    margin: 0 !important; padding: 0 !important; gap: 3px !important; box-sizing: border-box !important;
  }
  body.sf-mobile-compact #filterForm [hidden] { display: none !important; }
  body.sf-mobile-compact #monthFilterBox { grid-area: period !important; }
  body.sf-mobile-compact #rangeFilterBox { grid-area: period !important; display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; min-width: 0 !important; }
  body.sf-mobile-compact #filterForm label:has(> #filterCompany) { grid-area: company !important; }
  body.sf-mobile-compact #filterForm label:has(> #filterVehicle) { grid-area: vehicle !important; }
  body.sf-mobile-compact #filterForm label:has(> #filterSort) { grid-area: sort !important; }
  body.sf-mobile-compact #filterForm .search { grid-area: search !important; }
  body.sf-mobile-compact #filterForm label > span { display: block !important; height: 15px !important; line-height: 15px !important; margin: 0 !important; font-size: 11px !important; }
  body.sf-mobile-compact #filterForm input,
  body.sf-mobile-compact #filterForm select {
    display: block !important; box-sizing: border-box !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important;
    height: 36px !important; min-height: 36px !important; max-height: 36px !important;
    padding: 4px 7px !important; margin: 0 !important; font-size: 16px !important; font-weight: 500 !important;
    line-height: normal !important; border-radius: 6px !important; text-align: left !important;
  }
  body.sf-mobile-compact #filterForm input[type='date'],
  body.sf-mobile-compact #filterForm input[type='month'] { appearance: none; -webkit-appearance: none; min-inline-size: 0 !important; }
  body.sf-mobile-compact #filterForm input::-webkit-date-and-time-value { min-width: 0; padding: 0; margin: 0; text-align: left; }
  body.sf-mobile-compact #filterForm input::-webkit-datetime-edit { padding: 0; min-width: 0; }
  body.sf-mobile-compact #filterForm input::placeholder { font-size: 13px; font-weight: 400; }
  body.sf-mobile-compact #filterForm .filter-buttons { grid-area: actions !important; display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; align-self: end !important; gap: 4px !important; margin: 0 !important; }
  body.sf-mobile-compact #filterForm .filter-buttons > button { width: 100% !important; height: 36px !important; min-height: 36px !important; padding: 4px !important; font-size: 12px !important; }
  body.sf-mobile-compact .sfmc-disclosure .summary-strip { margin: 0 7px 7px !important; gap: 0 !important; }
  body.sf-mobile-compact .sfmc-disclosure .summary-strip article { min-height: 42px !important; padding: 7px !important; }
  body.sf-mobile-compact .sfmc-disclosure .summary-strip strong { font-size: 20px !important; }
  body.sf-mobile-compact .sfmc-disclosure .analytics { margin: 0 7px 7px !important; padding: 7px !important; }
}
@media screen and (max-width: 760px) and (max-height: 400px) {
  body.sf-mobile-compact .page-title { display: none !important; }
}
