/* fs-mobile.css — mobile app-style fill + builder shell (2026-11-25). Everything here is scoped to <=768px
   or to elements fs-mobile.js adds (hidden on desktop), so desktop layout is unchanged. */
.fsm-help-btn,.fsm-more-btn,.fsm-tiles,.fsm-quick,.fsm-photo-btn,.fsm-bar,.fsm-hdr-back,.fsm-tabbar{ display:none; }

@media (max-width:768px){
  /* ---------- Fill: app header ---------- */
  html body.fill-mode{ background:#f1f5f9; }
  html body.fill-mode #preview-overlay{ position:fixed; inset:0; margin:0 !important; padding:0 !important; height:auto; }
  body.fill-mode #preview-overlay .preview-overlay-panel{ display:flex; flex-direction:column; height:100% !important; max-height:none !important; background:#f1f5f9; }
  body.fill-mode #preview-overlay .paper-wrap,body.fill-mode #preview-overlay .phone-shell{ padding:0 !important; margin:0 !important; background:transparent !important; border:0 !important; box-shadow:none !important; max-width:none !important; }
  body.fill-mode #preview-overlay .preview-overlay-header{
    position:sticky; top:0; z-index:6; display:flex !important; flex-wrap:nowrap !important; align-items:center; gap:8px;
    min-height:56px; padding:calc(6px + env(safe-area-inset-top)) 10px 6px !important; background:#fff !important;
    border-bottom:1px solid #e2e8f0; box-shadow:none !important;
  }
  body.fill-mode #preview-overlay .preview-overlay-header > div:first-child{ flex:1 1 auto; min-width:0; gap:4px !important; }
  body.fill-mode #preview-overlay .preview-overlay-header > div:last-child{ flex:0 0 auto; flex-wrap:nowrap !important; gap:4px !important; }
  body.fill-mode #preview-overlay .preview-overlay-header #preview-heading{
    font-size:17px !important; font-weight:700; line-height:1.25; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin:0;
  }
  body.fill-mode .fsm-hdr-back{
    display:inline-flex; align-items:center; justify-content:center; flex:0 0 44px; width:44px; height:44px; margin-left:-4px;
    border-radius:12px; color:#0b5fff; font-size:18px; text-decoration:none;
  }
  body.fill-mode .fsm-hdr-back:active{ background:#eef4ff; }
  body.fill-mode #preview-overlay #btn-print-form{
    width:44px; height:44px; padding:0 !important; border-radius:12px !important; display:inline-flex; align-items:center; justify-content:center;
    border:0 !important; background:transparent !important; box-shadow:none !important; color:#475569 !important; font-size:17px !important;
  }
  body.fill-mode #preview-overlay #btn-print-form span{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
  body.fill-mode #preview-overlay #btn-print-form:active{ background:#f1f5f9 !important; }

  /* ---------- Fill: scroll area, banner, progress ---------- */
  body.fill-mode #preview-overlay .preview-overlay-body{
    flex:1 1 auto; min-height:0; overflow:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
    padding:0 12px 24px !important; background:#f1f5f9 !important; max-width:none !important;
  }
  body.fill-mode #fill-banner{ margin:0 !important; padding:0 !important; border:0 !important; background:none !important; box-shadow:none !important; }
  body.fill-mode #fill-banner > *:not(.fs-fill-restored){ display:none !important; }
  body.fill-mode #fill-banner .fs-fill-restored:not([hidden]){
    display:flex; align-items:center; gap:8px; margin:10px 0 0; padding:10px 12px; border-radius:12px; background:#fff; border:1px solid #e2e8f0; font-size:14px;
  }
  body.fill-mode #fill-banner .fs-fill-startover{ min-height:40px; padding:0 12px; margin-left:auto; }
  body.fill-mode #preview-overlay .preview-paper-shell{ padding:0 !important; }
  body.fill-mode #preview-overlay .fs-fill-progress{
    top:0 !important; margin:0 -12px 12px !important; width:calc(100% + 24px) !important; max-width:none !important;
    border-radius:0 !important; border:0 !important; border-bottom:1px solid #e2e8f0 !important; box-shadow:none !important;
    padding:8px 16px 9px !important; background:rgba(255,255,255,.96) !important; -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
    min-height:44px; display:flex; flex-direction:column; justify-content:center;
  }
  body.fill-mode #preview-overlay .fs-fill-progress .fs-fill-progress-text{ font-size:13px !important; margin:0 0 6px !important; }
  body.fill-mode #preview-overlay .fs-fill-progress .fs-fill-progress-next{ margin-left:auto; }

  /* ---------- Fill: cards ---------- */
  body.fill-mode .fsb #paper-full.paper{
    padding:0 !important; gap:10px !important; background:transparent !important; border:0 !important; box-shadow:none !important; border-radius:0 !important;
  }
  body.fill-mode .fsb #paper-full .row{ position:relative; padding:16px !important; gap:10px !important; border-radius:16px !important; border:1px solid #e2e8f0 !important; box-shadow:0 1px 2px rgba(15,23,42,.04) !important; }
  body.fill-mode .fsb #paper-full .row.preview-form-meta{ background:transparent !important; border:0 !important; box-shadow:none !important; padding:2px 4px 0 !important; }
  body.fill-mode .fsb #paper-full .row.preview-form-meta h2{ display:none; }
  body.fill-mode .fsb #paper-full .row.preview-form-meta .helper{ font-size:14px !important; color:#64748b; }
  body.fill-mode .fsb #paper-full .row > h2{ font-size:18px; font-weight:800; margin:0; }
  body.fill-mode .fsb #paper-full .row:has(> h2:only-child){ background:transparent !important; border:0 !important; box-shadow:none !important; padding:12px 4px 0 !important; }
  body.fill-mode .fsb #paper-full .row > label{ font-size:16px !important; font-weight:700 !important; line-height:1.35; padding-right:0; }
  body.fill-mode .fsb #paper-full .row.fsm-has-help > label{ padding-right:44px; }
  body.fill-mode .fsb #paper-full .helper{ font-size:15px; }
  body.fill-mode .fsb #paper-full .fsm-clamp{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  body.fill-mode .fsb #paper-full .fsm-more-btn{
    display:inline-flex; align-items:center; justify-content:center; min-height:44px; min-width:44px; margin:-8px 0 -10px -10px; padding:0 10px; border:0; background:none; color:#0b5fff; font-weight:600; font-size:14px; justify-self:start;
  }
  body.fill-mode .fsb #paper-full .fsm-help-btn{
    display:inline-flex; align-items:center; justify-content:center; position:absolute; top:6px; right:6px; width:44px; height:44px;
    border:0; border-radius:12px; background:transparent; color:#64748b; font-size:18px;
  }
  body.fill-mode .fsb #paper-full .fsm-help-btn[aria-expanded="true"]{ color:#0b5fff; background:#eef4ff; }
  body.fill-mode .fsb #paper-full .row.fsm-has-help:not(.fsm-help-open) .fs-field-help{ display:none !important; }
  body.fill-mode .fsb #paper-full .fs-field-help{ font-size:14px; margin:0; padding:8px 10px; border-radius:10px; background:#f8fafc; color:#475569; }

  /* inputs: 16px+ (no iOS zoom), tall targets */
  body.fill-mode .fsb #paper-full .input,
  body.fill-mode .fsb #paper-full input[type="text"],body.fill-mode .fsb #paper-full input[type="number"],
  body.fill-mode .fsb #paper-full input[type="date"],body.fill-mode .fsb #paper-full input[type="email"],
  body.fill-mode .fsb #paper-full input[type="tel"],body.fill-mode .fsb #paper-full input[type="time"],
  body.fill-mode .fsb #paper-full input[type="search"],body.fill-mode .fsb #paper-full textarea,body.fill-mode .fsb #paper-full select{
    font-size:17px !important; min-height:52px; padding:12px 14px !important; border-radius:12px !important; border-color:#cbd5e1 !important; background:#fff;
  }
  body.fill-mode .fsb #paper-full input[type="date"],body.fill-mode .fsb #paper-full input[type="time"]{ -webkit-appearance:none; appearance:none; display:block; text-align:left; }
  body.fill-mode .fsb #paper-full textarea{ min-height:112px; }
  body.fill-mode .fsb #paper-full select{ -webkit-appearance:none; appearance:none; background-image:linear-gradient(45deg,transparent 50%,#64748b 50%),linear-gradient(135deg,#64748b 50%,transparent 50%); background-position:calc(100% - 20px) 50%,calc(100% - 14px) 50%; background-size:6px 6px,6px 6px; background-repeat:no-repeat; padding-right:40px !important; }
  body.fill-mode .fsb #paper-full .fs-odo-unit{ font-size:15px; border-radius:0 12px 12px 0; }
  body.fill-mode .fsb #paper-full .fs-odo-wrap .input{ border-top-right-radius:0 !important; border-bottom-right-radius:0 !important; }

  /* choices: big tiles */
  body.fill-mode .fsb #paper-full .opt-group{ gap:8px !important; }
  body.fill-mode .fsb #paper-full .opt-choice{
    position:relative; min-height:56px; padding:12px 14px !important; gap:12px !important; border-radius:14px !important;
    border:1.5px solid #d6dde8 !important; background:#fff !important; font-size:16px !important; font-weight:600 !important;
    -webkit-tap-highlight-color:transparent; user-select:none; -webkit-user-select:none; transition:background-color .12s, border-color .12s;
  }
  body.fill-mode .fsb #paper-full .opt-choice:active{ transform:scale(.985); }
  body.fill-mode .fsb #paper-full .opt-choice input{ width:24px !important; height:24px !important; }
  body.fill-mode .fsb #paper-full .opt-choice:has(input:checked),
  body.fill-mode .fsb #paper-full .opt-choice.fsm-on{ border-color:#0b5fff !important; background:#eef4ff !important; color:#0b3fb3; }
  body.fill-mode .fsb #paper-full .opt-choice:has(input:focus-visible){ outline:3px solid rgba(11,95,255,.45); outline-offset:2px; }
  /* segmented (Yes / No / N/A style) */
  body.fill-mode .fsb #paper-full .opt-group.fsm-seg{ display:grid !important; grid-template-columns:repeat(var(--fsm-n,3),minmax(0,1fr)); }
  body.fill-mode .fsb #paper-full .opt-group.fsm-seg .opt-choice{ justify-content:center; text-align:center; padding:12px 6px !important; min-height:60px; }
  body.fill-mode .fsb #paper-full .opt-group.fsm-seg .opt-choice input{ position:absolute; opacity:0; width:1px !important; height:1px !important; pointer-events:none; }
  body.fill-mode .fsb #paper-full .opt-group.fsm-seg .opt-choice[data-fsm-val="yes"]:has(input:checked){ background:#ecfdf5 !important; border-color:#16a34a !important; color:#166534; }
  body.fill-mode .fsb #paper-full .opt-group.fsm-seg .opt-choice[data-fsm-val="no"]:has(input:checked){ background:#fef2f2 !important; border-color:#dc2626 !important; color:#991b1b; }
  body.fill-mode .fsb #paper-full .opt-group.fsm-seg .opt-choice[data-fsm-val="na"]:has(input:checked){ background:#f1f5f9 !important; border-color:#64748b !important; color:#334155; }
  body.fill-mode .fsb #paper-full .opt-group.fsm-seg .opt-choice:has(input:checked)::before{ content:"\2713"; font-weight:800; margin-right:2px; }
  /* inspection OK / Minor / Major */
  body.fill-mode .fsb #paper-full .fs-sev-group{ gap:8px !important; }
  body.fill-mode .fsb #paper-full .fs-sev-opt{ min-height:64px !important; border-radius:14px !important; font-size:15px !important; }
  body.fill-mode .fsb #paper-full .fs-defect .input{ font-size:16px !important; }

  /* dropdown -> tiles (select kept for submit, visually hidden) */
  body.fill-mode .fsb #paper-full .row.fsm-select-tiles select{ position:absolute !important; opacity:0 !important; pointer-events:none !important; width:1px !important; height:1px !important; min-height:0 !important; padding:0 !important; border:0 !important; }
  body.fill-mode .fsb #paper-full .fsm-tiles{ display:grid; grid-template-columns:repeat(var(--fsm-n,2),minmax(0,1fr)); gap:8px; }
  body.fill-mode .fsb #paper-full .fsm-tile{
    min-height:56px; padding:10px 8px; border-radius:14px; border:1.5px solid #d6dde8; background:#fff; color:#0f172a;
    font:inherit; font-size:16px; font-weight:600; line-height:1.25; -webkit-tap-highlight-color:transparent; overflow-wrap:anywhere;
  }
  body.fill-mode .fsb #paper-full .fsm-tile[aria-pressed="true"]{ border-color:#0b5fff; background:#eef4ff; color:#0b3fb3; }
  body.fill-mode .fsb #paper-full .fsm-tile:focus-visible{ outline:3px solid rgba(11,95,255,.45); outline-offset:2px; }

  /* quick Today / Now */
  body.fill-mode .fsb #paper-full .fsm-field-line{ display:flex; gap:8px; align-items:stretch; }
  body.fill-mode .fsb #paper-full .fsm-field-line > input{ flex:1 1 auto; min-width:0; }
  body.fill-mode .fsb #paper-full .fsm-quick{
    display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; min-width:76px; min-height:52px; padding:0 12px;
    border-radius:12px; border:1.5px solid #bfd3ff; background:#eef4ff; color:#0b5fff; font-weight:700; font-size:15px;
  }

  /* photo: big camera tile */
  body.fill-mode .fsb #paper-full .photo-field{ display:grid; gap:10px; }
  body.fill-mode .fsb #paper-full .photo-field.fsm-photo input[type="file"]{ position:absolute !important; opacity:0 !important; width:1px !important; height:1px !important; min-height:0 !important; padding:0 !important; border:0 !important; pointer-events:none; }
  body.fill-mode .fsb #paper-full .fsm-photo-btn{
    display:flex; align-items:center; justify-content:center; gap:10px; min-height:64px; border-radius:14px; border:2px dashed #93b4ff;
    background:#f5f8ff; color:#0b5fff; font-weight:700; font-size:16px; cursor:pointer; -webkit-tap-highlight-color:transparent;
  }
  body.fill-mode .fsb #paper-full .fsm-photo-btn i{ font-size:20px; }
  body.fill-mode .fsb #paper-full .photo-field.fsm-has-photo .fsm-photo-btn{ border-style:solid; min-height:52px; background:#fff; }
  body.fill-mode .fsb #paper-full .photo-field:has(input:focus-visible) .fsm-photo-btn{ outline:3px solid rgba(11,95,255,.45); outline-offset:2px; }
  body.fill-mode .fsb #paper-full img.photo-preview{ width:100%; max-height:260px; object-fit:cover; border-radius:12px; }

  /* signature: full-width pad */
  body.fill-mode .fsb #paper-full .sig-pad{ overflow:hidden; min-height:124px; border-radius:14px; touch-action:none; }
  body.fill-mode .fsb #paper-full canvas.sig-canvas{ width:100% !important; display:block; touch-action:none; }
  body.fill-mode .fsb #paper-full .sig-tools{ display:flex; justify-content:flex-end; }
  body.fill-mode .fsb #paper-full .sig-tools button{ min-height:44px; min-width:88px; font-size:15px !important; border-radius:12px !important; }

  /* errors */
  body.fill-mode .fsb #paper-full .row.field-error{ outline:2px solid #dc2626 !important; outline-offset:0 !important; }

  /* ---------- Fill: bottom action bar ---------- */
  body.fill-mode .fsm-bar{
    display:flex; flex:0 0 auto; gap:10px; align-items:center; position:relative; z-index:6;
    padding:10px 12px calc(10px + env(safe-area-inset-bottom)); background:rgba(255,255,255,.97); border-top:1px solid #e2e8f0;
    box-shadow:0 -6px 18px rgba(15,23,42,.06); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
  }
  body.fill-mode .fsm-bar #btn-submit-full{
    flex:1 1 auto; width:100%; min-height:54px; font-size:17px !important; border-radius:14px !important; padding:0 18px !important; min-width:0 !important;
  }
  body.fill-mode .fsm-bar .fsm-next{
    flex:0 0 auto; min-height:54px; padding:0 16px; border-radius:14px; border:1.5px solid #d6dde8; background:#fff; color:#0f172a; font-weight:700; font-size:15px;
  }
  body.fill-mode .fsm-bar .fsm-next[hidden]{ display:none; }
  body.fill-mode.fsm-done .fsm-bar{ display:none; }
  body.fill-mode .fs-app-done,body.fill-mode .fs-thankyou{ margin:14px 0 !important; border-radius:16px !important; padding:24px 16px !important; }
  body.fill-mode .fs-app-done a,body.fill-mode .fs-app-done button{ min-height:52px !important; }

  /* ---------- Builder shell (not fill) ---------- */
  body:not(.fill-mode) .fs-mobile-topbar{ position:sticky; top:0; z-index:40; min-height:56px; padding-top:env(safe-area-inset-top); }
  body:not(.fill-mode) .fs-nav-toggle{ min-width:44px; min-height:44px; }
  body:not(.fill-mode) #fs-sidebar nav li > button,
  body:not(.fill-mode) #fs-sidebar nav li > a{ min-height:48px; }
  body.fsm-has-tabs:not(.fill-mode) .fs-app-shell{ padding-bottom:calc(64px + env(safe-area-inset-bottom)); }
  body.fsm-has-tabs:not(.fill-mode) .fsm-tabbar{
    display:grid; grid-template-columns:repeat(var(--fsm-n,5),minmax(0,1fr)); position:fixed; left:0; right:0; bottom:0; z-index:45;
    padding:4px 4px calc(4px + env(safe-area-inset-bottom)); background:rgba(255,255,255,.97); border-top:1px solid #e2e8f0;
    -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
  }
  body.fsm-has-tabs.fsm-tabs-off .fsm-tabbar{ display:none; }
  body.fsm-has-tabs.fsm-tabs-off:not(.fill-mode) .fs-app-shell{ padding-bottom:0; }

  /* home: compact tappable rows, less text */
  body:not(.fill-mode) .home-hero > p{ display:none; }
  body:not(.fill-mode) .home-hero h1{ font-size:22px !important; margin-bottom:12px !important; }
  body:not(.fill-mode) .home-grid{ gap:10px !important; }
  body:not(.fill-mode) .home-tile{ display:grid !important; grid-template-columns:44px 1fr; align-items:center; column-gap:14px; min-height:68px; padding:12px 14px !important; text-align:left; border-radius:16px !important; }
  body:not(.fill-mode) .home-tile .home-tile-icon{ margin:0 !important; width:44px !important; height:44px !important; }
  body:not(.fill-mode) .home-tile h3{ margin:0 !important; font-size:16px !important; }
  body:not(.fill-mode) .home-tile p{ display:none !important; }
  body.fill-mode.fsm-done-app #paper-full,body.fill-mode.fsm-done-app #fs-fill-progress{ display:none !important; }
  .fsm-tab{
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; min-height:56px; border:0; background:none;
    color:#64748b; font:inherit; font-size:11.5px; font-weight:600; border-radius:12px; -webkit-tap-highlight-color:transparent;
  }
  .fsm-tab i{ font-size:19px; }
  .fsm-tab[aria-current="page"]{ color:#0b5fff; }
  .fsm-tab:focus-visible{ outline:2px solid #0b5fff; outline-offset:-2px; }
}
