/* Mobile layout for the shared editor, preview and Skill pipeline. */
/* V2 桌面三卡在手机端永不显示（桌面增强层 ≥1081px 才放开） */
#mp-format .mpf-v2only{display:none!important}
#mp-format :is(.mpf-mobile-header,.mpf-mobile-title,.mpf-mobile-paste,.mpf-mobile-style,.mpf-mobile-preview-head,.mpf-mobile-dock){display:none}
@media(max-width:760px){
  html:has(#mp-format:not([hidden])),body:has(#mp-format:not([hidden])){overflow:hidden!important}
  body:has(#mp-format:not([hidden])) .v3-topbar{display:none!important}
  body:is(.atelier, body) #mp-format:not([hidden]){
    display:grid;grid-template-rows:auto minmax(0,1fr) auto;position:fixed;inset:0;z-index:100;
    height:100dvh!important;height:var(--mpf-viewport-height,100dvh)!important;top:var(--mpf-viewport-top,0px);min-height:0!important;max-height:none;margin:0;padding:0!important;overflow:hidden!important;
    color:#17382d;background:radial-gradient(ellipse at 104% -8%,#a2dcc3,transparent 51%),linear-gradient(145deg,#e5f5ed,#f6faf7 59%,#e2f3e8)!important;
  }
  body:is(.atelier, body) #mp-format :is(.mpf-top,.mpf-strip,.mpf-ed-head,.mpf-empty,.mf-gates,.mpf-stage-head,.mf-crop,.mpf-statusbar,.mpf-endbar,.mpf-paper-foot,.mpf-side-note,.mpf-ruler,.mpf-compare,.mpf-focus-exit){display:none!important}
  body:is(.atelier, body) #mp-format .mpf-mobile-header{display:block;padding:calc(12px + env(safe-area-inset-top)) 19px 8px;background:#f0fcf57a;backdrop-filter:blur(18px)}
  #mp-format .mpf-mobile-nav{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;min-height:48px}
  #mp-format .mpf-mobile-nav strong{font-size:17px;letter-spacing:.04em}
  #mp-format .mpf-mobile-nav :is(a,button){display:grid;place-items:center;width:44px;height:44px;border:1px solid #fffd;border-radius:50%;background:#ffffff75;color:inherit;box-shadow:inset 0 1px 0 #fff}
  #mp-format .mpf-mobile-nav button{justify-self:end}
  #mp-format .mpf-mobile-nav svg{width:19px;height:19px;stroke:currentColor;fill:#fafffc;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
  #mp-format .mpf-mobile-tabs{display:flex;gap:3px;margin-top:9px;padding:4px;border:1px solid #fff9;border-radius:24px;background:#51846e10}
  #mp-format .mpf-mobile-tabs button{flex:1;min-height:42px;border:0;border-radius:19px;background:transparent;color:#506c61;font-size:14px}
  #mp-format .mpf-mobile-tabs [aria-pressed=true]{background:#fbfffd;color:#17382d;font-weight:750;box-shadow:0 2px 7px #274b3710}
  #mp-format .mpf-mobile-tabs :disabled{opacity:.65}
  body:is(.atelier, body) #mp-format .mpf-workspace{display:block;width:100%;height:100%!important;min-height:0!important;max-height:none;padding:22px 19px;margin:0;overflow:auto!important;overscroll-behavior:contain}
  #mp-format[data-mpf-mobile-pane=preview] .mpf-editor-panel,#mp-format:not([data-mpf-mobile-pane=preview]) .mpf-canvas{display:none!important}
  body:is(.atelier, body) #mp-format .mpf-editor-panel{display:block;position:static;width:100%;height:auto!important;min-height:0;max-height:none;overflow:visible;margin:0;padding:0;border:0;background:none;box-shadow:none;backdrop-filter:none}
  body:is(.atelier, body) #mp-format .mf-src-hd{display:flex;align-items:center;justify-content:space-between;padding:0;margin:0 0 13px;border:0}
  #mp-format .mf-src-hd > :is(.no,b){display:none}
  #mp-format :is(.mpf-mobile-title,.mpf-mobile-preview-head h1){display:block;font-family:var(--mf-font)!important;font-size:23px;line-height:1.3;letter-spacing:-.035em;margin:0}
  #mp-format .mf-src-hd .mf-cnt{color:#506c61;font-size:12px}
  body:is(.atelier, body) #mp-format .mpf-editor{height:clamp(170px,34dvh,310px);min-height:0;margin:0;border:1px solid white;border-radius:20px 20px 0 0;overflow:hidden;background:#fffaf7a8;box-shadow:none}
  body:is(.atelier, body) #mp-format .mpf-editor textarea{display:block;width:100%;height:100%;min-height:0;padding:17px;border:0;border-radius:inherit;background:#ffffff50;color:#17382d;font-size:16px;line-height:1.7;resize:none}
  body:is(.atelier, body) #mp-format .mpf-ed-foot{display:flex;flex-wrap:nowrap;gap:2px;margin:0;padding:3px 8px;border:1px solid white;border-top-color:#3a795414;border-radius:0 0 24px 24px;background:#ffffffa8;box-shadow:0 8px 25px #23573c0d}
  #mp-format .mpf-ed-foot :is([data-mpf-source],[data-mpf-aistate],.grow){display:none}
  #mp-format .mpf-ed-foot [data-mpf-clear]{margin-left:auto}
  #mp-format .mpf-ed-foot button{min-height:44px;padding:0 7px;white-space:nowrap;font-size:13px;color:#21634e}
  #mp-format .mpf-ed-foot .mpf-mobile-paste{display:inline-block}
  #mp-format .mpf-mobile-style{display:block;margin-top:22px}
  #mp-format .mpf-mobile-style h2{margin:0 0 9px;font:700 15px/1.4 var(--mf-font)}
  #mp-format .mpf-mobile-style-card{width:100%;min-height:75px;display:grid;grid-template-columns:42px 1fr auto;align-items:center;gap:11px;text-align:left;padding:11px 14px;border:1px solid white;border-radius:18px;background:#ffffffa6;box-shadow:0 5px 12px #23573c0a}
  #mp-format .mpf-mobile-style-card i{width:40px;height:50px;border-radius:8px;border:1px solid #c8e1d2;background:linear-gradient(var(--mpf-swatch) 0 0) 8px 10px/16px 3px no-repeat,linear-gradient(#b3d0c2 0 0) 8px 19px/22px 3px no-repeat,linear-gradient(#b3d0c2 0 0) 8px 28px/19px 3px no-repeat,linear-gradient(160deg,#fbfffd,#e6f4eb)}
  #mp-format .mpf-mobile-style-card :is(b,small){display:block}
  #mp-format .mpf-mobile-style-card b{font-size:14px}
  #mp-format .mpf-mobile-style-card small{font-size:12px;color:#506c61;margin-top:3px;overflow-wrap:anywhere}
  body:is(.atelier, body) #mp-format .mpf-canvas{height:auto;min-height:0;overflow:visible;margin:0;padding:0}
  #mp-format .mpf-mobile-preview-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:13px}
  #mp-format .mpf-mobile-preview-head button{min-height:44px;padding:0 7px;font-size:14px}
  body:is(.atelier, body) #mp-format .mpf-reader-wrap{display:block;width:100%;margin:0;padding:0}
  body:is(.atelier, body) #mp-format .mpf-paper{width:100%;min-height:0;margin:0!important;padding:9px 5px;border:1px solid white;border-radius:21px;background:#fff;box-shadow:0 8px 22px #23573c12}
  body:is(.atelier, body) #mp-format .mpf-phone{max-height:none!important;min-height:0;margin:0;overflow:hidden!important;border:0;border-radius:17px}
  body:is(.atelier, body) #mp-format .mpf-phone iframe{display:block;min-height:0;width:100%;border:0}
  #mp-format .mpf-mobile-dock{display:grid;gap:5px;text-align:center;padding:10px 19px max(13px,env(safe-area-inset-bottom));border-top:1px solid white;background:#edf9f1ed;backdrop-filter:blur(20px)}
  #mp-format :is(.mpf-mobile-dock,.mpf-mobile-sheet) .mpf-primary{width:100%;height:auto;min-height:52px;border:0;border-radius:19px;background:linear-gradient(155deg,#256951,#164c3a);color:white;font-size:16px;font-weight:750}
  #mp-format :is(.mpf-mobile-dock,.mpf-mobile-sheet) .mpf-primary:disabled{background:#d0e2d7;color:#486256;box-shadow:none}
  #mp-format .mpf-mobile-dock small{color:#506c61;font-size:11px}
  #mp-format .mpf-mobile-dock [data-mpf-mobileRetry]{min-height:44px}
  #mp-format .mpf-mobile-dock .mpf-progress{margin:0 0 4px}
  #mp-format .mpf-mobile-sheet{width:min(100%,520px);max-width:none;max-height:85dvh;margin:auto auto 0;padding:15px 19px max(18px,env(safe-area-inset-bottom));border:1px solid white;border-radius:25px 25px 0 0;background:#f3fbf6;color:#17382d;box-shadow:0 -10px 40px #12472d20;overflow:auto;overscroll-behavior:contain}
  #mp-format .mpf-mobile-sheet::backdrop{background:#153b2d58}
  #mp-format .mpf-mobile-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
  #mp-format .mpf-mobile-sheet h2{margin:0;font:700 19px/1.4 var(--mf-font)}
  #mp-format :is(.mpf-mobile-sheet,.mpf-mobile-style) h2{font-family:var(--mf-font)!important}
  #mp-format .mpf-mobile-sheet-head button{min-height:44px}
  #mp-format [data-mpf-mobileThemes]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:6px 0 12px}
  #mp-format [data-mpf-mobileThemes] button{min-height:59px;text-align:left;padding:7px 8px;border:1px solid #cfdfd5;border-radius:12px;background:white}
  #mp-format [data-mpf-mobileThemes] button[aria-pressed=true]{background:#e1f3e9;border-color:#2d775e}
  #mp-format [data-mpf-mobileThemes] :is(b,small){display:block}
  #mp-format [data-mpf-mobileThemes] small{color:#506c61;font-size:11px;margin-top:3px}
  #mp-format .mpf-mobile-sheet .mpf-style-brief{display:block;margin:15px 0 0;padding:11px 0 0;border-top:1px solid #cfe2d7}
  #mp-format .mpf-mobile-sheet .mpf-style-brief label{font-size:14px}
  #mp-format .mpf-mobile-sheet .mpf-style-brief label::before,#mp-format .mpf-mobile-sheet .mpf-style-brief label::after{content:none}
  #mp-format .mpf-mobile-sheet .mpf-style-row input{min-width:0;min-height:44px;font-size:16px}
  #mp-format .mpf-mobile-sheet .mpf-style-row button{min-height:44px;white-space:nowrap}
  body:is(.atelier, body) #mp-format .mpf-drawer{position:absolute;inset:auto 10px max(10px,env(safe-area-inset-bottom));width:auto;max-height:80dvh;overflow:auto;z-index:15}
  #mp-format [data-mpf-toast]{bottom:calc(92px + env(safe-area-inset-bottom));max-width:calc(100% - 32px);white-space:normal;text-align:center}
}
@media(max-width:350px){
  body:is(.atelier, body) #mp-format :is(.mpf-mobile-header,.mpf-workspace,.mpf-mobile-dock){padding-inline:14px}
}
