/* TAKE X iPad/coarse-pointer ergonomics. Desktop (>1200px) intentionally untouched. */
.icon-only{display:none!important}
@media (max-width:1199px), (pointer:coarse), (hover:none) {
  .glyph-only{display:none}
  .icon-only{display:inline-block!important;vertical-align:-.18em}
  html,body{max-width:100%;overflow-x:clip;-webkit-text-size-adjust:100%}
  button,input,select,textarea,[role="button"]{-webkit-tap-highlight-color:transparent}
  input,select,textarea{font-size:16px!important}
  button:not(.port):not(.remove):not(.copy):not(.image-menu-toggle):not(.asset-mascot):not(.nav-toggle),[role="button"],input[type="button"],input[type="submit"],select{min-width:40px;min-height:40px}
  header a,nav a,.mobile-jump a,.links a,.btn{min-height:40px;display:inline-flex;align-items:center}
  header a,nav a,.mobile-jump a{min-width:40px;justify-content:center}
  .modal,.dialog,.drawer,.sheet,[role="dialog"]{max-height:calc(100dvh - 32px);overflow-y:auto;overscroll-behavior:contain}
  .modal-mask,.dialog-mask,.drawer-mask{min-height:100vh;min-height:100dvh}
  .txc-ball{min-height:44px!important;bottom:max(18px,env(safe-area-inset-bottom))!important}
  .horizontal-scroll,.carousel,.tabs,.chip-row{overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  .node .port{min-width:0;min-height:0}
  .tsn-theme,.project-more,.tools .btn{min-width:40px!important;min-height:40px!important}
  .project-title{min-height:40px;padding-block:8px}
  .home-mode,.pro-upload-generate{min-height:40px!important}
  .mobile-jump{overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  .mobile-jump a{padding-block:7px}
  .history-item:after{content:'继续创作'}
}
@media (pointer:coarse) {
  a,button,[role="button"]{touch-action:manipulation}
  [draggable="true"],.canvas,.board,.world{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
  .board,.world,.node,.nhead,.photo,.node-image,.port{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
  .node input,.node textarea,.node select,.node .result-text,.node .bubble,.node .bubble *{touch-action:auto;-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
}

@media (min-width:801px) and (max-width:1199px) {
  .pro-page .layout{grid-template-columns:170px minmax(0,1fr)}
  .pro-page .main{padding-inline:20px}
  .pro-page .table{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .pro-page .row{min-width:760px}
}

/* Tablet keeps desktop project access and leaves the canvas itself pannable. */
@media (min-width:744px) and (max-width:1399px) and (pointer:coarse){
 body.take-nav-canvas .app{display:grid;grid-template-columns:176px minmax(0,1fr);height:calc(100dvh - 127px)!important;min-height:400px}
 body.take-nav-canvas .app .rail{display:block;padding:16px 10px;min-width:0;overflow-y:auto}
 body.take-nav-canvas .app .board{height:auto;min-height:0;overscroll-behavior:contain}
 body.take-nav-canvas .app .tools{max-width:calc(100% - 20px);overflow-x:auto;overflow-y:hidden;touch-action:pan-x;justify-content:flex-start;height:50px;margin-bottom:-50px}
 body.take-nav-canvas .tools .btn{flex:none;white-space:nowrap}
 body.take-nav-canvas .nav{padding-inline:16px;gap:12px}
 body.take-nav-canvas .project-title{width:clamp(150px,25vw,260px)}
 body.take-nav-canvas .rail .project-more{min-width:40px;min-height:40px}
}

/* Shared rendering baseline: Safari must not substitute native button paint. */
button{-webkit-appearance:none;appearance:none;font-family:inherit}
body.take-nav-canvas #world{-webkit-text-size-adjust:none;text-size-adjust:none;transform-origin:0 0}
body.take-nav-canvas .history-action{display:inline-flex;align-items:center;justify-content:center;gap:5px;white-space:nowrap}
body.take-nav-canvas .history-action svg{width:15px;height:15px;flex:none;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.case-actions .case-btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;line-height:1.3;min-width:0;white-space:nowrap}
.case-actions .case-btn svg{flex:none;width:13px;height:13px}
.case-actions .case-btn.play{background:var(--cb-card-2);border:1px solid var(--cb-border);color:var(--cb-text)}
@media(min-width:744px) and (pointer:coarse){
 html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
 .home-app .home-mode-switch{gap:4px;padding:4px;align-items:center}
 .home-app .home-mode{display:inline-flex;gap:6px;align-items:center;justify-content:center;padding:0 14px;line-height:1.2;white-space:nowrap}
 .home-app .home-mode .ic{width:14px;height:14px;flex:none}
 .home-app #heroTitle,.home-app #heroSub{overflow-wrap:normal;word-break:normal}
 .home-app #heroSub{padding-inline:12px;max-width:100%;box-sizing:border-box}
 body.take-nav-canvas #world input,body.take-nav-canvas #world textarea,body.take-nav-canvas #world select{font-size:12px!important}
 body.take-nav-canvas .app .tools{height:48px;max-width:calc(100% - 24px)}
 body.take-nav-canvas .tools .btn{font-size:12px;min-height:36px!important;padding:0 10px;line-height:1.2}
 .case-actions .case-btn{padding:10px 5px;min-height:40px}
}

@media(min-width:744px) and (pointer:coarse){.home-app .sel-menu .sel-item{min-height:40px;display:flex;align-items:center;gap:6px;touch-action:manipulation}.home-app .sel-menu{max-height:min(60dvh,420px);overflow-y:auto;overscroll-behavior:contain}}

/* Long outputs use the same bounded panels on desktop and tablet. */
body.take-nav-canvas .app .generation .content>.output{max-height:360px!important;overflow-y:auto!important;overscroll-behavior:contain}
body.take-nav-canvas .app .generation .content>.node-refine-messages{max-height:120px!important;overflow-y:auto!important;overscroll-behavior:contain}

@media(pointer:coarse){body.take-nav-canvas .node .output,body.take-nav-canvas .node .node-refine-messages{touch-action:none}}
