/* Phone layouts are isolated from the established desktop marketplace. */
@media (max-width: 760px) {
  :root {
    --mobile-gutter: 16px;
    --mobile-nav-height: 72px;
    --mobile-nav-reserve: 0px;
    --mobile-viewport-height: 100dvh;
    --keyboard-inset: 0px;
  }

  html { scroll-padding-top: 20px; scroll-padding-bottom: 100px; -webkit-text-size-adjust: 100%; }
  body { width: 100%; min-width: 0; height: auto; min-height: 100svh; overflow-y: auto; padding-bottom: var(--mobile-nav-reserve); font-size: 14px; line-height: 1.65; }
  body[data-account-role="customer"], body[data-account-role="admin"] { --mobile-nav-reserve: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px)); }
  body.has-open-dialog { overflow: hidden; }
  body > main { width: 100%; min-width: 0; overflow: visible; padding: 0 var(--mobile-gutter); margin: 0 auto; }
  main, .page, .workspace, .workspace-grid, .workspace-panel, .form-panel, .simple-rows, #adminContent, #ordersContent, #adsContent, #sellerContent { min-width: 0; max-width: 100%; }
  button, a, input, textarea, select, summary { touch-action: manipulation; }
  button, .primary, .secondary, .text-link, .account-link, .nav-link, .market-tab, .admin-small-button, .admin-row-actions button { min-height: 44px; }
  button, .primary, .secondary { font-size: 14px; line-height: 1.45; }
  input, select, textarea, .form-grid input, .form-grid select, .form-grid textarea, .seller-ad-form input, .seller-ad-form select, .seller-ad-form textarea,
  #sellerForm input, #sellerForm select, .admin-filters input, .admin-filters select, .search-line input, .item-search-filters select, #orderChatForm textarea,
  .form-grid .martion-select-trigger, .search-line .martion-select-trigger, .item-search-filters .martion-select-trigger, .admin-filters .martion-select-trigger, .martion-select-menu {
    font-size: 16px;
  }
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, .martion-select-trigger { min-height: 48px; }
  input, select, textarea { scroll-margin-top: 24px; scroll-margin-bottom: 110px; }
  .primary, .secondary { border-radius: 10px; padding: 12px 16px; }
  button:focus-visible, a:focus-visible, summary:focus-visible { outline-offset: 3px; }

  .order-payment-policy{padding:17px;margin:18px 0}.order-payment-policy h4{font-size:15px}.order-payment-policy p,.order-payment-policy summary,.payment-policy-form .check-label{font-size:14px;line-height:1.8}.payment-policy-form .primary{font-size:14px;min-height:48px}.payment-policy-form input[type="checkbox"]{width:21px;height:21px;min-width:21px;margin-top:3px}

  /* A compact masthead and a thumb-friendly signed-in navigation bar. */
  .site-header { display: grid; position: relative; width: 100%; max-width: none; min-height: 0; margin: 0; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; padding: calc(18px + env(safe-area-inset-top, 0px)) var(--mobile-gutter) 14px; }
  .site-header > .brand { grid-column: 1 / -1; grid-row: 1; width: 100%; justify-content: center; padding: 0; text-align: center; }
  .site-header .brand b { font-size: clamp(18px, 4.8vw, 25px); line-height: 1.4; letter-spacing: .035em; }
  .site-header .brand .project-subtitle { font-size: 11px; margin-top: 3px; line-height: 1.5; }
  .site-header > .header-register { grid-column: 1; grid-row: 2; justify-self: start; }
  .site-header > .header-account { grid-column: 2; grid-row: 2; justify-self: end; width: auto; gap: 10px; height: auto; }
  .site-header .header-account > .text-link { font-size: 13px; padding: 8px 6px; }
  .site-header[data-signed-in="false"] .account-link { width: auto; max-width: none; min-width: 114px; min-height: 44px; height: auto; padding: 10px 16px; font-size: 13px; }
  .site-header[data-signed-in="false"] > nav { display: flex; grid-column: 1 / -1; grid-row: 3; width: 100%; height: auto; justify-self: center; justify-content: center; gap: 0; }
  .site-header[data-signed-in="false"] > nav > .nav-link { min-height: 44px; height: auto; font-size: 18px; font-weight: 500; line-height: 1.4; }
  .site-header[data-signed-in="true"] > .header-account { grid-column: 1 / -1; grid-row: 2; justify-self: end; align-self: center; }
  .site-header[data-signed-in="true"] > nav { position: fixed; inset: auto 0 0; z-index: 50; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); width: 100%; height: auto; min-height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px)); padding: 8px max(12px,env(safe-area-inset-right,0px)) calc(8px + env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px)); margin: 0; gap: 6px; background: #200c12f5; border-top: 1px solid #dfc8a54d; box-shadow: 0 -8px 30px #09030645; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
  .site-header[data-signed-in="true"] .customer-nav { display: contents; }
  .site-header[data-signed-in="true"] > nav .nav-link { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 52px; height: auto; width: 100%; padding: 10px 6px; border: 1px solid transparent; border-radius: 12px; font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--muted); text-align: center; white-space: normal; }
  .site-header[data-signed-in="true"] > nav .nav-link.active { background: #dfc8a513; border-color: #dfc8a542; color: var(--champagne); }
  .site-header[data-account-role="admin"] > nav { grid-template-columns: minmax(0,1fr); }
  .site-header[data-signed-in="true"]:not(:has(#myOrdersNav:not([hidden]))) > nav { grid-template-columns: minmax(0,1fr); }
  body.has-open-dialog .site-header[data-signed-in="true"] > nav, body[data-keyboard-open="true"] .site-header[data-signed-in="true"] > nav { visibility: hidden; pointer-events: none; }
  .notification-button { width: 44px; height: 44px; min-width: 44px; }
  .notification-button svg { width: 21px; height: 21px; }

  .simple-market, .workspace { padding: 24px 0 28px; min-height: 0; }
  .workspace > h1 { font-size: 30px; margin: 10px 0 14px; line-height: 1.25; }
  .page-intro { font-size: 14px; line-height: 1.7; margin-bottom: 24px; }
  .eyebrow { font-size: 11px; line-height: 1.5; letter-spacing: .1em; }
  .simple-market > .business-subtitle { font-size: 14px; margin-bottom: 18px; overflow-wrap: anywhere; }
  .market-tabs { width: 100%; max-width: 440px; margin: 0 auto 22px; padding: 5px; gap: 5px; border-radius: 13px; }
  .market-tab { min-width: 0; flex: 1; min-height: 46px; padding: 10px 14px; font-size: 14px; border-radius: 9px; }
  .simple-intro { margin: 0 0 18px; }
  .simple-intro > h1 { font-size: 12px; letter-spacing: .17em; }
  .simple-search { width: 100%; max-width: none; margin: 0 0 18px; }
  #searchForm .search-line { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; width: 100%; }
  #searchForm .search-line > label { grid-column: auto; min-width: 0; display: block; }
  #searchForm .search-line > .item-search-field { grid-column: 1 / -1; }
  #searchForm .search-line input, #searchForm .search-line .martion-select-trigger { width: 100%; min-height: 49px; height: 49px; padding-left: 13px; padding-right: 13px; border-radius: 10px; }
  #searchForm .search-line > .primary { grid-column: auto; min-width: 0; min-height: 49px; margin: 0; font-size: 14px; }
  #searchForm[data-market="services"] .search-line { grid-template-columns: minmax(0,1fr) minmax(100px,.55fr); }
  #searchForm[data-market="services"] .search-line > .item-search-field { grid-column: 1 / -1; }
  .search-message { font-size: 13px; line-height: 1.65; text-align: left; }
  .item-search-filters { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; width: 100%; margin: 0 0 22px; }
  .item-search-filters label { min-width: 0; gap: 6px; text-align: left; font-size: 11px; }
  .item-search-filters .martion-select-trigger { min-height: 46px; height: 46px; padding: 0 10px; font-size: 16px; border-radius: 9px; }
  .item-search-filters select { min-height: 46px; padding: 10px 28px 10px 10px; font-size: 16px; }
  .delivery-settings { font-size: 13px; }
  .delivery-settings summary { min-height: 44px; padding: 10px; }
  .delivery-fields { grid-template-columns: minmax(0,1fr); }
  .delivery-fields > .secondary { height: auto; min-height: 46px; }
  .delivery-marketplace-prompt { padding: 16px; margin: 0 0 20px; }
  .delivery-marketplace-prompt p { font-size: 14px; line-height: 1.7; }
  .delivery-marketplace-prompt .wizard-actions { display: grid; grid-template-columns: minmax(0,1fr); }

  /* The item anchors each mobile card; buyer and seller remain distinct. */
  .simple-headings { display: none; }
  .ongoing-subtitle { font-size: 15px; text-align: left; margin: 8px 0 16px; letter-spacing: .035em; }
  .simple-rows { display: grid; gap: 18px; }
  .simple-row, .simple-row.goods-market-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 14px; row-gap: 14px; min-height: 0; padding: 16px; border: 1px solid #dfc8a536; border-radius: 18px; background: linear-gradient(150deg,#3b131b55,#1c0b104a); text-align: left; }
  .simple-row > .simple-item { grid-column: 1 / -1; grid-row: 1; display: grid; grid-template-columns: 45px minmax(0,1fr); align-items: center; column-gap: 12px; row-gap: 5px; width: 100%; min-width: 0; padding: 0 0 15px; border-bottom: 1px solid var(--line); text-align: left; }
  .simple-item > .market-item-art { grid-column: 1; grid-row: 1 / span 2; width: 45px; height: 45px; min-width: 45px; margin: 0; filter: none; }
  .simple-item h3 { grid-column: 2; font-size: 22px; line-height: 1.35; margin: 0; letter-spacing: -.02em; }
  .simple-item > .open-order-demo, .simple-item > small, .simple-item > p { grid-column: 2; justify-self: start; margin: 0; font-size: 11px; }
  .simple-row > .buyer-side { grid-column: 1; grid-row: 2; }
  .simple-row > .seller-side { grid-column: 2; grid-row: 2; }
  .simple-row > .party-side { min-width: 0; align-self: stretch; align-items: stretch; justify-content: flex-start; text-align: left; padding: 18px 14px; gap: 6px; border-radius: 13px; border-color: #dfc8a53e; box-shadow: none; background: #2c1117c4; }
  .party-side::after { display: none; }
  .simple-row > .buyer-side::before, .simple-row > .seller-side::before { display: block; color: var(--champagne); font-size: 11px; font-weight: 600; letter-spacing: .13em; line-height: 1.6; padding-right: 36px; margin-bottom: 4px; }
  .simple-row > .buyer-side::before { content: "BUYING AD"; }
  .simple-row > .seller-side::before { content: "SELLING AD"; }
  .party-side .price-label { font-size: 10px; letter-spacing: .1em; line-height: 1.6; color: var(--muted); }
  .party-side > strong { font-size: 29px; line-height: 1.3; font-weight: 500; letter-spacing: -.025em; overflow-wrap: anywhere; }
  .party-side > small { font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
  .party-side .party-name { font-size: 15px; margin-top: 9px; line-height: 1.5; }
  .party-side .seller-cost-breakdown { font-size: 12px; margin: 5px 0; line-height: 1.7; }
  .party-side .service-ad-experience, .party-side .service-ad-visit { font-size: 12px; }
  .price-box-actions, .party-side > .price-box-actions { align-items: stretch; gap: 9px; margin-top: auto; padding-top: 15px; }
  .price-box-actions button { width: 100%; max-width: none; min-height: 45px; padding: 11px 10px; font-size: 13px; line-height: 1.4; border-radius: 9px; }
  .ad-create-actions { width: 100%; max-width: none; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .price-box-actions .ad-create-actions button { padding: 10px 6px; font-size: 12px; }
  .more-sellers, .next-market-ad { width: 44px; height: 44px; min-height: 44px; top: 9px; right: 9px; border-radius: 50%; }
  .simple-row .more-sellers { top: 8px; right: 8px; width: 44px; height: 44px; min-height: 44px; border-color: #dfc8a562; }
  .simple-row .more-sellers svg { width: 19px; height: 19px; }
  .simple-row .party-side:has(.more-sellers)::before { min-height: 28px; }
  .empty-state { padding: 30px 20px; margin-top: 14px; border-radius: 15px; }
  .empty-state h3 { font-size: 20px; line-height: 1.4; }
  .empty-state p { font-size: 14px; line-height: 1.7; }
  .empty-state > button { width: 100%; margin-top: 8px; }

  /* Form controls never require pinch zoom and actions remain inside the sheet. */
  .workspace-grid, .form-grid, .seller-ad-form { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .workspace-panel, .form-panel { padding: 19px 16px; border-radius: 15px; overflow-x: visible; }
  .workspace-panel h2, .form-panel h2 { font-size: 23px; line-height: 1.4; }
  .form-grid > *, .form-grid .wide, .seller-ad-form > * { min-width: 0; grid-column: 1; }
  .form-grid label, .seller-ad-form > label { font-size: 13px; line-height: 1.6; gap: 8px; }
  .form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .form-grid select, #sellerForm input, #sellerForm select, .seller-ad-form input, .seller-ad-form select { height: 49px; min-height: 49px; padding: 0 13px; line-height: normal; border-radius: 9px; }
  .form-grid textarea, .seller-ad-form textarea { min-height: 100px; padding: 12px 13px; line-height: 1.6; border-radius: 9px; }
  .form-grid .martion-select-trigger, #buyerAdStep .martion-select-trigger { min-height: 49px; height: 49px; padding: 0 13px; border-radius: 9px; font-size: 16px; }
  .martion-select-menu { max-width: calc(100vw - 24px); max-height: min(50dvh,360px); border-radius: 12px; padding: 6px; font-size: 16px; }
  .martion-select-option { min-height: 46px; padding: 11px 12px; line-height: 1.5; }
  .martion-select-group { font-size: 11px; }
  .form-grid .check-label, .admin-action-dialog .check-label { min-height: 44px; gap: 12px; font-size: 13px; line-height: 1.7; padding: 8px 0; }
  .form-grid .check-label input, .admin-action-dialog .check-label input { width: 20px; height: 20px; min-height: 20px; margin-top: 2px; }
  .account-kind-options { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 3px; }
  .account-kind-options > label { min-height: 48px; padding: 10px; font-size: 14px; border-radius: 10px; }
  .account-kind-options input { min-height: 0; width: 1px; height: 1px; }
  .auth-dialog .form-grid { gap: 18px; }
  .account-purpose { font-size: 14px; line-height: 1.7; margin-bottom: 22px; }
  .auth-dialog .account-purpose { font-size: 14px; }
  .auth-switch { font-size: 14px; line-height: 1.6; margin-top: 18px; padding: 10px; }
  .account-mode-buttons, .auth-inline-actions { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; margin-top: 20px; }
  .location-pin-row { grid-template-columns: minmax(0,1fr); gap: 9px; }
  .location-pin-row .location-detect { min-height: 46px; font-size: 13px; padding: 10px 14px; }
  .location-permission-note, .location-status, .form-grid .account-registration-note { font-size: 12px; line-height: 1.7; }
  .auth-dialog .form-grid .account-registration-note { margin: 8px 0 0; }
  .ad-location-detect { justify-items: stretch; }
  .ad-location-detect > button { width: 100%; }
  .form-message, .compare-note, .fixed-price-note, .seller-fee-disclaimer { font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
  .seller-fee-disclaimer { padding: 15px; margin: 0; border-radius: 10px; }
  .notice { padding: 16px; font-size: 13px; line-height: 1.7; border-radius: 11px; }
  .notice p { font-size: 13px; line-height: 1.7; }
  .item-specification-fields, .ad-delivery-choice, .delivery-route-fields { padding: 16px 13px; border-radius: 11px; }
  .item-specification-fields legend, .ad-delivery-choice legend, .delivery-route-fields legend { font-size: 13px; }
  .item-specification-fields .compare-note { font-size: 12px; }
  .item-spec-readout { grid-template-columns: minmax(0,1fr); gap: 13px; padding: 15px; }
  .item-spec-readout dt { font-size: 12px; }
  .item-spec-readout dd { font-size: 14px; line-height: 1.6; }
  .delivery-choice-buttons { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; }
  .delivery-choice-buttons > label { min-height: 44px; padding: 9px 0; gap: 12px; align-items: center; font-size: 13px; }
  .delivery-choice-buttons input[type="radio"] { width: 20px; height: 20px; min-height: 20px; }
  .delivery-selection-summary, .delivery-booking-note { font-size: 12px; text-align: left; line-height: 1.7; }
  .delivery-change-provider { min-height: 44px; font-size: 13px; }
  .journey-steps { gap: 8px; margin: 20px 0 24px; justify-content: space-between; }
  .journey-steps li { font-size: 12px; gap: 6px; line-height: 1.4; }
  .journey-steps b { min-width: 25px; width: 25px; height: 25px; font-size: 11px; }
  #buyerAdStep .wizard-actions, .wizard-actions { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; width: 100%; margin-top: 8px; }
  #buyerAdStep .wizard-actions > .primary { grid-column: 2; min-width: 0; width: 100%; justify-self: stretch; padding: 12px 10px; }
  #buyerAdStep .wizard-actions > .secondary { grid-column: 1; min-width: 0; width: 100%; font-size: 13px; white-space: normal; padding: 12px 10px; }
  #buyerAdStep .wizard-actions:not(:has(.secondary)) > .primary, .wizard-actions > :only-child { grid-column: 1 / -1; width: 100%; }
  .seller-ad-form > button[type="submit"], .form-grid > .primary.wide, .form-grid > .secondary.wide { width: 100%; min-width: 0; justify-self: stretch; }
  .ad-type-options { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 22px 0 5px; }
  .ad-type-card { padding: 22px 13px; gap: 10px; border-radius: 13px; }
  .ad-type-card strong { font-size: 17px; line-height: 1.45; }
  .ad-type-card small { font-size: 12px; line-height: 1.65; }
  .seller-journey-panel .seller-journey-summary { white-space: normal; font-size: 14px; }
  .seller-registration-title, .seller-journey-title { font-size: 24px; }
  .steps { gap: 22px; }
  .steps strong { font-size: 15px; }
  .steps small { font-size: 13px; line-height: 1.7; }

  dialog, .order-dialog, .offer-dialog, .auth-dialog, .buyer-dialog, .invoice-dialog, .order-chat-dialog, .admin-action-dialog {
    width: calc(100% - 16px); max-width: min(680px,calc(100% - 16px)); max-height: calc(var(--mobile-viewport-height,100dvh) - 16px - env(safe-area-inset-top,0px)); margin: auto; border-radius: 20px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  }
  .dialog-inner, .order-chat-dialog .dialog-inner { position: relative; padding: 62px 20px calc(24px + env(safe-area-inset-bottom,0px)); min-width: 0; }
  .close-dialog { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; min-height: 44px; border-radius: 50%; background: #311219; color: var(--champagne); z-index: 20; font-size: 25px; }
  .dialog-inner > h2, .dialog-inner > div > h2, .auth-dialog #authContent > h2, #bidContent > .buyer-step-heading, .admin-action-dialog h2 { margin: 0 0 20px; font-size: 25px; line-height: 1.35; text-align: center; overflow-wrap: anywhere; }
  .selling-ad-heading h2 { margin: 10px 0; font-size: 25px; }
  .dialog-inner .account-email { font-size: 15px; }
  .success-mark { width: 52px; height: 52px; margin-left: auto; margin-right: auto; }
  .ad-review { padding: 18px 15px; border-radius: 12px; }
  .ad-review h3 { font-size: 21px; line-height: 1.45; }
  .ad-review > strong { font-size: 28px; overflow-wrap: anywhere; }
  .ad-review p { font-size: 13px; }
  .ad-review small { font-size: 12px; }
  .price-breakdown { padding: 16px; border-radius: 11px; }
  .price-breakdown div { font-size: 14px; line-height: 1.65; gap: 12px; }

  .seller-market-heading { align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
  .seller-market-heading h2, .selling-ads-panel .seller-market-heading h2, .orders-section-title { font-size: 23px; line-height: 1.4; }
  .selling-ads-panel .seller-market-heading > .primary { min-height: 44px; font-size: 13px; padding: 11px 14px; }
  .seller-profile { align-items: flex-start; padding: 17px; border-radius: 12px; gap: 12px; margin-bottom: 24px; }
  .seller-profile b { font-size: 17px; overflow-wrap: anywhere; }
  .seller-profile span:not(.status-pill) { font-size: 13px; }
  .owned-ads > article { display: grid; grid-template-columns: minmax(0,1fr); gap: 17px; padding: 20px 0; }
  .owned-ads h3 { font-size: 21px; line-height: 1.4; }
  .owned-ads p, .owned-ads small { font-size: 13px; line-height: 1.7; }
  .owned-ad-actions, .saved-ad-drafts .owned-ad-actions { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 9px; width: 100%; }
  .owned-ad-actions .status-pill { flex-basis: auto; margin-right: auto; }
  .owned-ad-actions .secondary, .owned-ad-actions .primary { min-height: 44px; font-size: 13px; padding: 11px 13px; }
  .owned-ad-actions > .text-link { min-height: 44px; font-size: 13px; padding: 9px 10px; }
  .status-pill, .admin-badge { font-size: 11px; padding: 5px 9px; line-height: 1.6; white-space: normal; }
  .buy-ads { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .buy-ad { padding: 20px 16px; border-radius: 14px; }
  .buy-ad h3 { font-size: 23px; }
  .ad-description, .ad-material { font-size: 14px; line-height: 1.7; }
  .ad-card-top { align-items: flex-start; margin-bottom: 15px; }
  .ad-card-top > small { font-size: 11px; line-height: 1.6; }
  .ad-facts { gap: 14px; margin: 18px 0; }
  .ad-facts > span { font-size: 12px; }
  .ad-facts b { font-size: 13px; line-height: 1.65; }
  .ad-card-bottom { align-items: stretch; gap: 14px; flex-wrap: wrap; }
  .ad-card-bottom > div { min-width: 0; }
  .ad-card-bottom strong { font-size: 28px; }
  .ad-card-bottom small { font-size: 12px; line-height: 1.6; }
  .ad-card-bottom > button { flex-basis: 100%; min-height: 46px; font-size: 14px; }

  .order-card { padding: 19px 15px; border-radius: 16px; margin-bottom: 18px; }
  .order-card-layout, .has-order-controls .order-card-layout, .order-card-head { display: grid; grid-template-columns: minmax(0,1fr); gap: 22px; }
  .order-card h3 { font-size: 21px; line-height: 1.4; }
  .order-card .order-id { font-size: 12px; line-height: 1.6; }
  .order-role, .order-counterparty > span { font-size: 12px; }
  .order-meta, .order-private-address, .order-card .compare-note { font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
  .order-counterparty > strong { font-size: 17px; }
  .order-card-financials { max-width: none; width: 100%; text-align: left; justify-self: stretch; }
  .order-status-timers, .order-card-financials > .order-status-timers, .order-card-head > .order-status-timers { width: 100%; max-width: none; justify-content: flex-start; gap: 8px; margin-left: 0; align-self: stretch; }
  .order-status-timers .status-pill, .order-status-timers .admin-badge { font-size: 11px; padding: 7px 10px; line-height: 1.5; max-width: 100%; white-space: normal; }
  .order-payment-summary { padding-top: 18px; }
  .payment-payable-label, .payment-payer-note { font-size: 12px; }
  .payment-payable-amount { font-size: 30px; line-height: 1.3; }
  .payment-amount-breakdown { font-size: 13px; gap: 10px; }
  .payment-amount-breakdown > div { gap: 12px; }
  .payment-payable-total strong { font-size: 18px; }
  .order-bank-transfer { padding: 17px; border-radius: 12px; margin-top: 20px; }
  .order-bank-transfer dt { font-size: 12px; }
  .order-bank-transfer dd { font-size: 15px; line-height: 1.6; }
  .payment-bank-title { font-size: 14px; }
  .payment-bank-reference, .payment-bank-pending { font-size: 12px; }
  .payment-bank-reference strong { font-size: 23px; letter-spacing: .045em; }
  .payment-bank-reference small { font-size: 12px; }
  .checkout-payment-summary, .claim-payment-summary { padding: 17px; margin: 18px 0; border-radius: 12px; }
  .order-workflow-actions { width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; gap: 10px; border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 0; margin-top: 0; }
  .order-action-wrap { display: block; width: auto; height: auto; min-width: 0; }
  .order-action-wrap:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .order-action-icon { width: 100%; height: auto; min-height: 62px; display: flex; justify-content: flex-start; align-items: center; gap: 10px; padding: 12px; border-radius: 11px; }
  .order-action-icon svg { flex: none; width: 22px; height: 22px; }
  .order-action-label { display: block; min-width: 0; font-size: 12px; line-height: 1.5; font-weight: 500; text-align: left; overflow-wrap: anywhere; }
  .order-action-tooltip { left: 0; right: auto; top: calc(100% + 8px); transform: none; width: min(290px,calc(100vw - 64px)); max-width: none; }
  .order-action-wrap:nth-child(even) > .order-action-tooltip { left: auto; right: 0; }
  .order-chat-open { width: 100%; min-height: 46px; font-size: 14px; border-radius: 10px; }
  .order-card .secondary[data-order-invoices] { width: 100%; margin-top: 10px; font-size: 14px; }
  .event-list { font-size: 12px; }
  .event-list > summary { min-height: 44px; padding: 10px 0; }
  .event-list p { font-size: 12px; line-height: 1.7; }
  .timeline { overflow-x: auto; padding-bottom: 14px; }
  .timeline li { min-width: 65px; font-size: 11px; }
  .orders-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .orders-metrics > div { min-width: 0; padding: 14px; }
  .orders-metrics span { font-size: 12px; }
  .orders-metrics b { font-size: 24px; }

  .order-chat-dialog .dialog-inner { padding-top: 62px; }
  .order-chat-heading h2 { font-size: 22px; margin: 0 0 12px; }
  .order-chat-heading > p { font-size: 13px; }
  .order-chat-heading > small { font-size: 12px; line-height: 1.7; }
  .order-chat-messages { height: clamp(160px,38dvh,360px); max-height: calc(var(--mobile-viewport-height,100dvh) - 300px); min-height: 120px; padding: 13px; border-radius: 12px; }
  .order-chat-message { max-width: 93%; padding: 11px 12px; }
  .order-chat-message p { font-size: 14px; line-height: 1.7; }
  .order-chat-message > div { flex-wrap: wrap; gap: 5px 12px; font-size: 11px; }
  .order-chat-message time { font-size: 10px; }
  #orderChatForm { grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 9px; }
  #orderChatForm textarea { min-height: 62px; max-height: 140px; font-size: 16px; padding: 10px 12px; border-radius: 10px; }
  #orderChatForm > .primary { min-width: 62px; min-height: 49px; padding: 12px 13px; font-size: 14px; border-radius: 10px; }
  .order-chat-connection { font-size: 12px; min-height: 0; margin: 8px 0; }
  .order-chat-earlier { min-height: 44px; font-size: 13px; }
  .notification-card { padding: 17px; border-radius: 13px; }
  .notification-card p, .notification-card small { font-size: 13px; line-height: 1.7; }
  .notification-card .secondary { width: 100%; }
  .invoice-document { padding: 17px 14px; }
  .invoice-document h3 { font-size: 18px; line-height: 1.4; }
  .invoice-document ul, .invoice-contact-note { font-size: 13px; line-height: 1.75; }
  .invoice-profile-section { padding: 15px 12px; }
  .invoice-profile-section > summary { min-height: 44px; font-size: 14px; padding: 8px 0; }
  .invoice-download { width: 100%; min-height: 46px; font-size: 14px; }

  /* Data-rich screens scroll within their own tables and charts. */
  .admin-workspace { width: 100%; padding: 24px 0 32px; }
  .admin-page-heading { min-height: 0; padding: 0; margin-bottom: 22px; gap: 14px; align-items: stretch; }
  .admin-page-heading > div { text-align: left; width: 100%; }
  .admin-page-heading .eyebrow { font-size: 12px; line-height: 1.6; letter-spacing: .09em; }
  .admin-page-heading > .secondary { position: static; transform: none; width: 100%; min-height: 44px; font-size: 13px; }
  .admin-topline { flex-wrap: wrap; gap: 10px 14px; margin-bottom: 20px; font-size: 12px; }
  .admin-topline > span:nth-child(2) { font-size: 11px; }
  .admin-topline > .secondary { width: 100%; margin: 0; min-height: 44px; font-size: 13px; }
  .admin-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; margin-bottom: 20px; }
  .admin-metric { padding: 16px 13px; min-height: 122px; border-radius: 13px; }
  .admin-metric > span { font-size: 12px; line-height: 1.5; }
  .admin-metric strong { font-size: 30px; margin: 6px 0; }
  .admin-metric small { font-size: 11px; line-height: 1.5; }
  .admin-tabs { width: 100%; max-width: 100%; gap: 5px; padding-bottom: 13px; margin-bottom: 20px; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .admin-tabs > button { min-height: 45px; padding: 11px 14px; font-size: 13px; border-radius: 9px; }
  .admin-overview-grid, .admin-flow-grid { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .admin-panel { padding: 19px 15px; border-radius: 14px; }
  .admin-panel h2, .admin-section-intro h2, .admin-audit-heading { font-size: 20px; line-height: 1.4; }
  .admin-panel-heading { flex-wrap: wrap; gap: 10px; }
  .admin-panel-heading .text-link { min-height: 44px; font-size: 13px; }
  .admin-health-row, .admin-muted, .admin-section-intro p, .admin-mini-activity > div, .admin-audit-list > li { font-size: 13px; line-height: 1.7; }
  .admin-count-link { min-height: 44px; padding: 8px 4px; }
  .admin-activity-totals { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .admin-activity-totals strong { font-size: 25px; }
  .admin-activity-totals span { font-size: 11px; line-height: 1.5; }
  .admin-filters { display: grid; grid-template-columns: minmax(0,1fr); align-items: stretch; gap: 10px; }
  .admin-filters label, .admin-filters label:first-child, .admin-filters label:nth-child(2) { min-width: 0; width: 100%; }
  .admin-filters input, .admin-filters select, .admin-filters .martion-select-trigger { min-height: 48px; height: 48px; font-size: 16px; }
  .admin-filters .martion-select { min-width: 0; width: 100%; }
  .admin-filters > .secondary { height: auto; min-height: 46px; width: 100%; margin: 0; font-size: 14px; }
  .admin-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; border-radius: 12px; }
  .admin-table { min-width: 640px; font-size: 13px; }
  .admin-table th { font-size: 11px; padding: 13px 14px; }
  .admin-table td { padding: 15px 14px; }
  .admin-table td small { font-size: 12px; line-height: 1.6; }
  .admin-row-actions { gap: 8px; }
  .admin-row-actions button, .admin-small-button { min-height: 44px; font-size: 12px; padding: 10px 12px; border-radius: 8px; }
  .admin-pagination { flex-direction: column; align-items: stretch; gap: 12px; font-size: 12px; }
  .admin-pagination > div { justify-content: space-between; gap: 12px; }
  .admin-pagination button { min-height: 44px; padding: 10px 14px; font-size: 13px; }
  .admin-order-details { grid-template-columns: minmax(0,1fr); gap: 12px; margin-top: 20px; }
  .admin-order-details dt { font-size: 12px; }
  .admin-order-details dd { font-size: 14px; margin-top: 5px; line-height: 1.7; }
  .admin-order-details .admin-item-visual { justify-content: flex-start; }
  .admin-flow-card { padding: 18px 15px; gap: 13px; }
  .admin-flow-card h3 { font-size: 17px; line-height: 1.4; }
  .admin-flow-card p, .admin-flow-detail { font-size: 13px; line-height: 1.7; }
  .admin-flow-detail { flex-direction: column; gap: 4px; }
  .admin-switch { width: 60px; height: 44px; min-height: 44px; align-self: start; padding: 8px; }
  .admin-switch > span { width: 18px; height: 18px; }
  .admin-danger-button { min-height: 46px; width: 100%; padding: 12px 15px; font-size: 14px; }
  .admin-empty { padding: 28px 16px; font-size: 13px; line-height: 1.7; }
  .admin-bank-check-alert { flex-direction: column; align-items: stretch; gap: 13px; }
  .admin-bank-check-alert > .secondary { width: 100%; }
  .admin-payment-review { gap: 15px; margin-top: 22px; padding-top: 22px; }
  .admin-payment-review h3 { font-size: 19px; line-height: 1.4; }
  .admin-payment-review p { font-size: 13px; line-height: 1.75; }
  .admin-settlement-report-grid { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .admin-settlement-report-grid > div > span { font-size: 13px; }
  .admin-earnings-panel { padding: 19px 15px; }
  .admin-earnings-panel .admin-panel-heading { gap: 15px; }
  .admin-earnings-periods { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); width: 100%; gap: 8px; }
  .admin-earnings-periods button { min-height: 44px; padding: 10px 8px; font-size: 13px; }
  .admin-earnings-totals { grid-template-columns: minmax(0,1fr); gap: 10px; margin: 18px 0 24px; }
  .admin-earnings-total { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 15px; padding: 16px; }
  .admin-earnings-total > span { font-size: 13px; }
  .admin-earnings-total > strong { font-size: 25px; }
  .admin-earnings-total > small { grid-column: 1 / -1; font-size: 12px; }
  .admin-earnings-chart-heading { flex-wrap: wrap; gap: 8px; }
  .admin-earnings-chart-heading h3 { font-size: 16px; }
  .admin-earnings-chart-heading > span { display: block; font-size: 11px; }
  .admin-earnings-axis { width: 58px; font-size: 10px; padding-right: 6px; }
  .admin-earnings-chart { min-width: 0; margin-left: 58px; max-width: calc(100% - 58px); overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; padding-bottom: 38px; }
  .admin-earnings-bars { min-width: max(500px,calc(var(--earnings-buckets) * 50px)); gap: 6px; }
  .admin-earnings-bar { min-height: 0; }
  .admin-earnings-tick { font-size: 10px; }
  .admin-earnings-legend { gap: 10px 15px; justify-content: flex-start; font-size: 12px; line-height: 1.6; }
  .admin-earnings-detail { flex-direction: column; align-items: flex-start; gap: 12px; font-size: 13px; }
  .admin-earnings-detail strong { font-size: 24px; }
  .admin-earnings-detail p { font-size: 12px; text-align: left; line-height: 1.75; }
  .admin-earnings-note { font-size: 12px; line-height: 1.7; }
  .mini-table { min-width: 570px; font-size: 13px; }
  .workspace-panel:has(.mini-table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .mini-table th { font-size: 11px; }
  .mini-table td, .mini-table th { padding: 12px; }
  .mini-table .secondary { min-height: 44px; font-size: 12px; padding: 10px; }

  .delivery-services-page { padding: 24px 0 32px; }
  .delivery-services-heading, .delivery-service-actions { align-items: stretch; flex-direction: column; gap: 15px; }
  .delivery-services-heading h1 { font-size: 27px; line-height: 1.35; }
  .delivery-services-heading > .text-link { width: 100%; text-align: left; font-size: 13px; }
  .delivery-service-actions p { font-size: 14px; line-height: 1.75; }
  .delivery-service-actions > button { width: 100%; }
  .delivery-services-page .delivery-quote-list { grid-template-columns: minmax(0,1fr); }
  .delivery-quote-card { padding: 17px; gap: 14px; border-radius: 13px; }
  .delivery-quote-card h3 { font-size: 18px; }
  .delivery-quote-card p, .delivery-quote-card small { font-size: 13px; line-height: 1.7; }
  .delivery-quote-card strong { font-size: 25px; }
  .delivery-quote-card > button { min-height: 46px; width: 100%; font-size: 14px; }
  .seller-comparison-card { padding: 18px 15px; border-radius: 13px; }
  .seller-comparison-heading { flex-wrap: wrap; gap: 10px; }
  .seller-comparison-heading h3 { font-size: 21px; line-height: 1.5; }
  .seller-comparison-card > p { font-size: 13px; line-height: 1.7; }
  .seller-comparison-facts dt { font-size: 12px; }
  .seller-comparison-facts dd { font-size: 14px; }
  .seller-comparison-facts .seller-comparison-total { font-size: 23px; }
  .seller-comparison-bottom { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; }
  .seller-comparison-bottom small { font-size: 12px; }
  .seller-comparison-bottom button { width: 100%; min-height: 44px; font-size: 14px; }

  body > footer { width: 100%; display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; padding: 22px var(--mobile-gutter) 24px; margin: 0; text-align: center; font-size: 11px; }
  footer > p:first-child, footer > p:nth-child(2) { justify-self: center; text-align: center; }
  .footer-legal { grid-column: 1; justify-self: center; justify-content: center; flex-wrap: wrap; gap: 0 16px; width: 100%; white-space: normal; margin-top: 4px; }
  body > footer > a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 0; font-size: 13px; }
  .footer-legal > a { min-height: 44px; padding: 8px 0; font-size: 12px; line-height: 1.5; }
  .toast { bottom: calc(var(--mobile-nav-reserve) + 16px); width: max-content; max-width: calc(100% - 32px); padding: 13px 17px; border-radius: 13px; font-size: 13px; line-height: 1.7; z-index: 70; }
  body[data-keyboard-open="true"] .toast { bottom: calc(var(--keyboard-inset) + 14px); }
  .legal-header { padding: calc(22px + env(safe-area-inset-top,0px)) 20px 22px; }
  .legal-header > a { font-size: 21px; line-height: 1.4; }
  .legal-header > span { font-size: 12px; }
  .legal-page { width: 100%; padding: 24px var(--mobile-gutter) 40px; }
  .legal-page > h1 { font-size: 30px; line-height: 1.3; }
  .legal-page h2 { font-size: 21px; line-height: 1.4; }
  .legal-page p, .legal-page li { font-size: 15px; line-height: 1.85; }
  .legal-page > .text-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }
}

@media (max-width: 560px) {
  .simple-row, .simple-row.goods-market-row { grid-template-columns: minmax(0,1fr); padding: 15px; gap: 14px; }
  .simple-row > .simple-item { grid-column: 1; grid-row: 1; }
  .simple-row > .buyer-side { grid-column: 1; grid-row: auto; }
  .simple-row > .seller-side { grid-column: 1; grid-row: auto; }
  .simple-row > .party-side { padding: 19px 16px; }
  .price-box-actions .ad-create-actions button { font-size: 13px; padding: 11px 10px; }
  .party-side > strong { font-size: 31px; }
  .party-side > small, .party-side .seller-cost-breakdown { font-size: 13px; }
  .party-side .price-label { font-size: 11px; }
  .simple-row > .buyer-side::before, .simple-row > .seller-side::before { font-size: 12px; }
  .item-search-filters { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .item-search-filters > label { display: grid; grid-template-columns: 70px minmax(0,1fr); align-items: center; gap: 10px; font-size: 12px; }
  .item-search-filters .martion-select-trigger, .item-search-filters select { font-size: 16px; }
}

@media (max-width: 360px) {
  :root { --mobile-gutter: 12px; }
  .site-header .brand b { font-size: 17px; }
  .site-header[data-signed-in="false"] .account-link { min-width: 106px; font-size: 12px; }
  .dialog-inner, .order-chat-dialog .dialog-inner { padding-left: 16px; padding-right: 16px; }
  .journey-steps { gap: 6px; }
  .journey-steps li { font-size: 11px; gap: 5px; }
  .order-workflow-actions { grid-template-columns: minmax(0,1fr); }
  .order-action-wrap { grid-column: 1; }
  .order-action-tooltip, .order-action-wrap:nth-child(even) > .order-action-tooltip { left: 0; right: auto; }
  .ad-facts, .seller-comparison-facts { grid-template-columns: minmax(0,1fr); }
  .footer-legal { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 10px; }
}

@media (max-width: 760px) and (max-height: 520px) {
  dialog, .order-dialog, .offer-dialog, .auth-dialog, .buyer-dialog, .invoice-dialog, .order-chat-dialog, .admin-action-dialog { max-height: calc(var(--mobile-viewport-height,100dvh) - 8px); width: calc(100% - 12px); }
  .dialog-inner, .order-chat-dialog .dialog-inner { padding-top: 58px; padding-bottom: 20px; }
  .order-chat-messages { height: 150px; max-height: 180px; min-height: 100px; }
}
