/* MallowShare v50 — MOBILE VIEW ONLY. Do not change desktop, file processing, SEO, ads or sharing behavior.
 * Isolated override: last stylesheet on all public pages. Kept to viewport <= 850 px.
 */
@media screen and (max-width:850px) {
  html { overflow-x:clip; -webkit-text-size-adjust:100%; }
  body { max-width:100%; min-width:0; overflow-x:clip; }
  body *, body *::before, body *::after { box-sizing:border-box; }
  img, video, canvas, iframe { max-width:100%; }
  /* Native PDF viewing and 2-D editing surfaces must keep their intrinsic zoom/scroll behavior. */
  pre, code, .file-detail, .room-meta, .mw-workflow-header,
  .mw-workflow-header p, .dedicated-tool-intro,
  .tool-landing, .tool-seo-explain { overflow-wrap:anywhere; }
  input, select, textarea, button { max-width:100%; }
  input[type="file"] { min-width:0; }
  input[type="text"],input[type="password"],input[type="email"],input[type="search"],
  input[type="number"],input[type="url"],textarea,select { font-size:16px!important; }
  button, a, summary, select, label.drop { -webkit-tap-highlight-color:transparent; }
  button, .pill, .clean-mast nav a, .clean-card, .section-tab, .tool-nav a {
    touch-action:manipulation;
  }

  /* Header: brand first, navigation second, no tiny clipped links. */
  .topbar:not(.mast) { box-sizing:border-box; height:auto; min-height:66px; width:100%;
    padding:11px 15px!important; gap:9px; flex-wrap:wrap; align-items:center; }
  .topbar .brand { min-width:0; max-width:100%; font-size:18px!important; letter-spacing:-.025em!important; }
  .topbar .brand img { max-width:min(170px,42vw); height:auto; }
  .topbar .top-right { margin-left:auto; min-width:0; max-width:100%; gap:6px; justify-content:flex-end; flex-wrap:wrap; }
  .topbar .top-caption { display:none!important; }
  .topbar .center-top-link { padding:8px 10px!important; min-height:39px;
    font-size:12px!important; border-radius:11px; white-space:nowrap; }
  .topbar .language-switch { min-height:39px; min-width:70px; max-width:130px!important; }
  .topbar .round-button,.topbar .icon-button { min-width:39px; width:39px; height:39px; }
  .topbar .brand-full-lockup { flex-shrink:1; min-width:0; }

  /* Landing: hero + room actions should not compete side by side on a phone. */
  .landing { padding:20px 14px 24px!important; min-height:0!important; }
  .landing-inner { width:100%; min-width:0; grid-template-columns:minmax(0,1fr)!important;
    gap:16px!important; min-height:0!important; }
  .intro { padding:6px 0 0!important; min-width:0; }
  .intro h1 { font-size:clamp(36px,8.2vw,53px)!important; line-height:1.09!important;
    margin:12px 0!important; letter-spacing:-.055em!important; }
  .intro-copy { font-size:14px!important; line-height:1.55!important; margin:0 0 15px!important; }
  .hero-points { gap:7px 12px!important; font-size:11px!important; }
  .hero-art { display:none!important; } /* Decorative only; room form stays above the fold. */
  .access-card { width:100%!important; max-width:560px!important; min-width:0; margin:2px auto 20px!important;
    padding:19px 16px!important; border-radius:20px!important; }
  .access-heading { gap:10px; margin-bottom:13px!important; }
  .access-heading h2 { font-size:20px!important; }
  .access-card .segmented { margin-bottom:15px!important; }
  .access-card .seg { min-height:45px; }
  .access-card .field { min-height:46px; }
  .access-card .field input { min-height:44px; }
  .access-card .two-fields { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .access-card button[type="submit"],.access-card .quick-start { min-height:48px; }
  .prep-launch-area,.qr-feature,.sharefit-landing { margin-inline:auto; width:min(100%,100%); }
  .prep-actions,.simple-tool-links,.landing-bottom { min-width:0; }
  .prep-actions { flex-wrap:wrap; gap:8px; }
  .prep-actions > * { min-width:0; }
  .seo-information { padding-inline:16px!important; }
  .seo-steps,.explore-grid,.explore-mini-grid { min-width:0; }

  /* Private room: readable title; swipeable tab strip; files and chat occupy full width. */
  #room-page.room-page { width:100%; padding:12px 12px max(28px,env(safe-area-inset-bottom))!important; }
  #room-page .room-head { display:flex; flex-direction:column; gap:11px;
    align-items:stretch; min-width:0; }
  #room-page .room-head h1 { font-size:clamp(21px,5.8vw,29px)!important;
    line-height:1.23!important; overflow-wrap:anywhere; margin:4px 0 7px; }
  #room-page .room-meta { display:flex; flex-wrap:wrap; gap:6px; min-width:0; }
  #room-page .head-actions { display:flex; flex-wrap:wrap; width:100%; gap:7px;
    justify-content:flex-start; align-items:center; }
  #room-page .head-actions > * { flex:0 1 auto; min-height:42px; }
  #room-page .head-actions .room-mobile-upload { display:inline-flex; }
  #room-page .quick-guide { display:flex; flex-wrap:wrap; gap:7px; padding:11px!important;
    line-height:1.45!important; }
  #room-page .quick-guide-head { width:100%; }
  #room-page .workbench { display:flex!important; flex-direction:column!important;
    width:100%; min-width:0; gap:12px!important; }
  #room-page .main-panel, #room-page .chat-panel { width:100%!important; min-width:0!important; max-width:100%!important; }
  #room-page .main-panel { overflow:hidden; border-radius:16px; }
  #room-page .section-nav { display:flex!important; flex-wrap:nowrap!important;
    max-width:100%; overflow-x:auto!important; -webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain; scrollbar-width:none; scroll-snap-type:x proximity; }
  #room-page .section-nav::-webkit-scrollbar { display:none; }
  #room-page .section-tab { flex:0 0 auto!important; min-width:64px;
    padding:13px 13px!important; min-height:46px; scroll-snap-align:start; white-space:nowrap; }
  #room-page .tab-panel { padding:13px 12px!important; min-width:0; }
  #room-page .prep-inroom-controls { gap:7px; flex-wrap:wrap; }
  #room-page #dropzone { min-height:175px; padding:20px 12px;
    border-radius:16px; width:100%; max-width:100%; }
  #room-page .upload-controls { display:flex; justify-content:center; flex-wrap:wrap; gap:7px; }
  #room-page .upload-controls button { flex:1 1 94px; min-height:44px; }
  #room-page .files-heading { display:flex; flex-wrap:wrap; align-items:flex-start; gap:8px; }
  #room-page .mini-actions { margin-left:0; min-width:0; max-width:100%; }
  #room-page .file-tools { display:grid; grid-template-columns:minmax(0,1fr) minmax(105px,32%);
    gap:8px; width:100%; }
  #room-page .file-tools .searchbox, #room-page #search-files,
  #room-page #filter-files { min-width:0; width:100%; }
  #room-page .file-item { width:100%; min-width:0; overflow:hidden; }
  #room-page .file-detail { min-width:0; overflow-wrap:anywhere; }
  #room-page .file-buttons { display:flex; flex-wrap:wrap; gap:7px; justify-content:stretch; }
  #room-page .file-buttons button { min-height:42px; flex:1 1 auto; }
  #room-page .selection-bar { display:flex; flex-wrap:wrap; gap:8px; bottom:env(safe-area-inset-bottom,0px);
    max-width:100%; padding:10px; }
  #room-page .selection-bar .grow { display:none; }
  #room-page .selection-bar .pill { min-height:43px; flex:1 1 125px; }
  #room-page .sharefit-inline { display:flex; flex-wrap:wrap; align-items:flex-start; gap:9px; }
  #room-page .sharefit-inline button { min-height:42px; }
  #room-page .tb-v16-grid,#room-page .mallow-tools__grid { grid-template-columns:minmax(0,1fr)!important; }
  #room-page .tb-v16-row { display:flex; flex-wrap:wrap; gap:8px; }
  #room-page .tb-v16-row input { min-width:0; flex:1 1 155px; }
  #room-page .tb-v16-row button { min-height:42px; }
  #room-page .wonder-actions,.room-page .v10-actions,.room-page .v11-actions { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
  #room-page .wonder-actions button { min-width:0; min-height:63px; }
  #room-page .tb-receiver-buttons { display:flex; flex-wrap:wrap; gap:7px; }
  #room-page .tb-receiver-buttons button { min-height:40px; }
  #room-page #panel-chat { padding:0!important; }
  /* Do not move or remount the chat DOM on resize: styles only. */
  #room-page #mobile-chat-mount { min-width:0; }
  #room-page #mobile-chat-mount > #chat-panel.chat-panel { width:100%; max-width:100%;
    min-height:0!important; height:clamp(340px,65dvh,610px)!important; border:0;
    border-radius:0 0 15px 15px; }
  #room-page #chat-panel .chat-messages { min-height:0; overscroll-behavior-y:contain; }
  #room-page #chat-panel .chat-compose { min-width:0; gap:8px; }
  #room-page #chat-panel #chat-input { min-width:0; flex:1 1 auto; font-size:16px!important;
    min-height:43px; resize:vertical; }
  #room-page #chat-panel .send-button { min-width:44px; min-height:44px; }
  #room-page .chat-form { padding-bottom:calc(10px + env(safe-area-inset-bottom))!important; }

  /* Dialogs/editor overlays: scroll inside screen instead of clipping tools at bottom. */
  .modal-backdrop, .center-overlay, .sharefit-overlay, .prep-overlay, .annot-overlay { box-sizing:border-box; }
  .modal, .center-shell, .sharefit-panel, .prep-overlay > *, .annot-overlay > * {
    max-width:calc(100vw - 24px)!important; }
  .modal, .center-shell,.sharefit-panel { max-height:calc(100dvh - 24px)!important;
    overflow-y:auto; overscroll-behavior-y:contain; -webkit-overflow-scrolling:touch; }
  .center-shell { width:min(100%,710px); border-radius:18px; }
  .center-header { padding:13px!important; }
  .center-toolbar,.center-categories { min-width:0; }
  .center-categories { overflow-x:auto; display:flex; flex-wrap:nowrap; -webkit-overflow-scrolling:touch; }
  .center-categories button { flex:0 0 auto; white-space:nowrap; min-height:43px; }
  .center-search-label { min-width:0; }
  .center-main { min-width:0; }
  .toast-region { max-width:calc(100vw - 22px); }

  /* Catalogs: touch-sized navigation and predictable two-column cards. */
  body.clean-catalog .clean-mast, body[data-fixed-operation] .mast.clean-mast {
    width:100%; display:flex; gap:10px; flex-direction:column; align-items:stretch;
    padding:13px 15px!important; }
  body.clean-catalog .clean-mast .brand,body[data-fixed-operation] .mast.clean-mast .brand {
    max-width:100%; font-size:19px; min-height:40px; }
  body.clean-catalog .clean-mast nav,body[data-fixed-operation] .mast.clean-mast nav {
    display:flex; width:100%; gap:6px; flex-wrap:nowrap!important;
    overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
  body.clean-catalog .clean-mast nav::-webkit-scrollbar,body[data-fixed-operation] .mast.clean-mast nav::-webkit-scrollbar { display:none; }
  body.clean-catalog .clean-mast nav a,body[data-fixed-operation] .mast.clean-mast nav a {
    min-height:42px; flex:0 0 auto; white-space:nowrap; padding:9px 12px!important; font-size:13px!important; }
  .clean-main { width:100%; min-width:0; padding:0 14px 40px!important; }
  .catalog-hero { padding:29px 3px 16px!important; }
  .catalog-hero h1 { font-size:clamp(31px,8.2vw,44px)!important; margin:10px 0 8px; }
  .catalog-hero p { font-size:14px!important; line-height:1.55; }
  .clean-search-label { margin:20px auto 10px; width:100%; max-width:550px; }
  .clean-search-label input { min-width:0; }
  .catalog-section { margin:15px 0 30px; }
  .catalog-section>h2 { font-size:18px; margin:0 0 12px; }
  .clean-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:10px!important; }
  .clean-card { min-width:0; min-height:164px!important; gap:7px;
    padding:14px 12px!important; border-radius:14px; }
  .clean-card strong { font-size:14px; line-height:1.3; overflow-wrap:anywhere; }
  .clean-icon { width:40px; height:40px; font-size:21px; border-radius:11px; }
  .clean-desc { font-size:11.5px; line-height:1.4; -webkit-line-clamp:2; }
  .clean-open { margin-top:auto; }
  .clean-info { padding-top:20px; margin-top:24px; line-height:1.7; }

  /* Dedicated PDF and converted/editor pages: centered, fluid, consistent touch surfaces. */
  body[data-fixed-operation] .content { min-width:0; width:100%!important; padding:0 14px 35px!important; }
  body[data-fixed-operation] .hero { padding:24px 0 15px!important; min-width:0; }
  body[data-fixed-operation] .hero h1 { font-size:clamp(28px,7.8vw,39px)!important; }
  body[data-fixed-operation] .hero p { font-size:14px!important; line-height:1.55!important; }
  body[data-fixed-operation] .focus-workspace { width:100%; min-width:0; margin:0 auto 22px!important;
    padding:16px!important; border-radius:15px!important; }
  body[data-fixed-operation] label.drop { padding:17px 12px!important; min-height:155px!important; }
  body[data-fixed-operation] label.drop input[type=file] { min-width:0; max-width:100%!important; font-size:12px!important; }
  body[data-fixed-operation] .actions { gap:9px; width:100%; margin-top:16px!important; }
  body[data-fixed-operation] .actions button { min-height:45px!important; flex:1 1 150px; white-space:normal; }
  body[data-fixed-operation] .tool-landing, body[data-fixed-operation] .tool-seo-explain {
    width:100%; margin:20px auto!important; padding:17px!important; }
  body[data-fixed-operation] .processing-panel { min-width:0; width:100%; }
  body[data-focused-tool] .topbar { width:100%; padding:12px 14px!important; }
  body[data-focused-tool] .dedicated-tool-intro { width:calc(100% - 26px);
    margin:18px auto 10px!important; padding:12px 5px!important; }
  body[data-focused-tool] .dedicated-tool-intro h1 { font-size:clamp(27px,7.5vw,38px)!important;
    line-height:1.17!important; }
  body[data-focused-tool] .dedicated-tool-intro p { font-size:14px; line-height:1.55; }
  body[data-focused-tool] .mw-tool-workflow { width:100%; min-width:0; padding:8px 12px 22px!important; }
  body[data-focused-tool] #mw-tool-workflow .mw-tool-card { width:100%!important;
    max-width:100%!important; margin:0 auto!important; border-radius:15px!important; }
  body[data-focused-tool] .mw-workflow-header { min-width:0; padding:17px 15px!important; }
  body[data-focused-tool] .mw-workflow-header h2 { font-size:21px!important; }
  body[data-focused-tool] .mw-flow-layout { display:block!important; min-width:0; padding:14px!important; }
  body[data-focused-tool] .mw-flow-primary { min-width:0; max-width:100%!important; }
  body[data-focused-tool] .mw-upload-area { width:100%; min-width:0; min-height:165px!important;
    padding:16px 12px!important; border-radius:14px!important; }
  body[data-focused-tool] .mw-upload-area input[type=file] { width:100%; max-width:100%; }
  body[data-focused-tool] .tool-seo-explain { width:calc(100% - 26px);
    margin:20px auto!important; padding:17px!important; }
  body[data-focused-tool] .mw-tool-card button { min-height:43px; }
  .tool-nav { gap:7px; }
  .tool-nav a { min-height:41px; display:inline-flex; align-items:center; }
  body .mallow-ad-section:not([hidden]) { width:calc(100% - 26px)!important;
    max-width:100%!important; margin:19px auto!important; }
  body .mallow-ad-frame, body .mallow-ad-network-wrap { max-width:100%!important; }
}
@media screen and (max-width:430px) {
  .topbar:not(.mast) { padding:10px 12px!important; }
  .topbar .top-right { width:100%; justify-content:space-between; margin-left:0; }
  .topbar .center-top-link { flex:1 1 88px; text-align:center; }
  .topbar .language-switch { flex:0 1 100px; }
  .landing { padding:15px 12px 23px!important; }
  .access-card { padding:16px 13px!important; }
  .access-card .two-fields { grid-template-columns:1fr!important; }
  #room-page .head-actions .pill,#room-page .head-actions .room-mobile-upload { flex:1 1 115px; }
  #room-page .head-actions .icon-button { flex:0 0 44px; }
  #room-page .quick-guide { font-size:11px; }
  #room-page .file-buttons button { flex:1 1 112px; }
  #room-page .sharefit-inline button { flex:1 1 100%; }
  .clean-grid { gap:8px!important; }
  .clean-card { min-height:156px!important; padding:13px 10px!important; }
  .clean-card strong { font-size:13px; }
  .clean-desc { font-size:11px; }
  body[data-fixed-operation] .actions button { flex-basis:100%; }
  body[data-focused-tool] .mw-flow-layout { padding:12px!important; }
  .center-toolbar { flex-wrap:wrap; }
}
@media screen and (max-width:350px) {
  .clean-grid { grid-template-columns:minmax(0,1fr)!important; }
  .clean-card { min-height:120px!important; flex-direction:row;
    align-items:center; flex-wrap:wrap; }
  .clean-card .clean-desc { flex:1 1 100%; }
  #room-page .file-tools { grid-template-columns:minmax(0,1fr); }
  #room-page .wonder-actions,.room-page .v10-actions,.room-page .v11-actions { grid-template-columns:minmax(0,1fr)!important; }
}
@media screen and (max-width:850px) and (prefers-reduced-motion:reduce) {
  .clean-card { transition:none!important; }
}
/* Small-screen corrections found during inline-Chromium 320px/390px screenshot review. */
@media screen and (max-width:850px) {
  /* Original drop input is visually hidden in legacy PDF CSS: explicitly expose the native picker. */
  body[data-fixed-operation] label.drop input[type=file] {
    display:block!important; position:static!important; width:100%!important;
    height:auto!important; min-height:45px!important; opacity:1!important;
    visibility:visible!important; clip:auto!important; clip-path:none!important;
    pointer-events:auto!important; margin:4px 0 0!important;
    text-align:left!important; overflow:visible!important; transform:none!important;
  }
  body[data-fixed-operation] label.drop input[type=file]::file-selector-button {
    min-height:43px!important; font-size:13px!important; margin-right:10px;
  }
  #room-page .sharefit-inline { padding:10px!important; font-size:12px; }
  #room-page .sharefit-inline button { padding:9px 12px!important; font-size:12px; }
  #room-page .prep-inroom-controls button { min-height:40px; }
  #room-page .file-expiry-hint { font-size:12px; line-height:1.45; padding:9px 11px!important; }
}
@media screen and (max-width:380px) {
  body.clean-catalog .clean-mast nav, body[data-fixed-operation] .mast.clean-mast nav {
    flex-wrap:wrap!important; overflow-x:visible!important; justify-content:center;
  }
  body.clean-catalog .clean-mast nav a,body[data-fixed-operation] .mast.clean-mast nav a {
    padding:8px 10px!important; min-height:40px; font-size:12px!important;
  }
}
