/* Readable workbench sizing. Explicit dimensions, not browser zoom: image coordinates stay correct. */
:root{font-size:18px;--muted:#626776}body{font-size:18px}
.topbar{height:92px;padding:0 28px;gap:20px}.brand-mark{width:46px;height:48px;border-radius:13px}.brand-mark svg{width:27px;height:27px}.brand strong{font-size:22px;letter-spacing:-.5px}.brand small{font-size:12px}
.workspace-tabs{padding:5px;border-radius:12px}.workspace-tabs button{height:46px;min-width:112px;font-size:17px;gap:10px}svg.icon{width:22px;height:22px}.privacy{font-size:14px}.privacy svg{width:18px;height:18px}
.btn{height:48px;padding:0 17px;font-size:16px;border-radius:10px;gap:9px}.btn.small{height:40px;font-size:15px;padding:0 12px}.btn.ghost{color:#606675}.icon-btn{width:42px;height:42px;border-radius:9px}
.app{grid-template-columns:104px minmax(0,1fr) 390px;height:calc(100dvh - 128px)}.rail{padding:18px 10px;gap:12px;overflow-y:auto}.rail-tools{gap:9px}.tool{height:74px;min-height:74px;gap:9px;font-size:15px;border-radius:12px;color:#656b79}.tool svg{width:26px;height:26px}.rail-bottom{padding-top:20px;gap:10px}
.contentbar{height:72px;padding:0 26px;gap:15px}.crumbs{font-size:15px;gap:12px}.crumbs strong{font-size:18px}.crumbs span:last-child{max-width:220px}.toolbar-actions{gap:5px}.inspector-head{min-height:72px;padding:0 26px}.inspector-head h2{font-size:22px}.inspector-head>span{display:none}.inspector-scroll{padding:26px}.section-kicker{display:none}
.section-title{font-size:19px;line-height:1.5;margin-bottom:12px;gap:10px}.mode-tag{font-size:12px;padding:5px 7px}.description{font-size:16px;line-height:1.85;color:#686e7c;margin-bottom:22px}.helper{font-size:14px;line-height:1.85;color:#777d88;margin:12px 0}
.preset-grid{gap:16px 14px}.preset-thumb{height:104px;border-radius:10px;padding:10px}.preset.active .preset-thumb{padding:9px}.preset .preset-name{font-size:16px;line-height:1.4;padding:10px 0 2px}.preset.active:after{width:20px;height:20px;line-height:20px;font-size:12px;right:8px;top:8px}
.scan-filters{gap:7px;margin:0 0 20px;flex-wrap:wrap}.scan-filters button{font-size:14px;min-height:38px;padding:7px 10px}.scan-hint{font-size:14px;line-height:1.8;color:#747a88}
.inspector-divider{margin:26px 0 22px}.inspector-footer{font-size:14px;line-height:1.6;padding:16px 22px}.inspector-footer svg{width:18px;height:18px}.hint-box{font-size:14px;line-height:1.85;padding:16px;margin-top:22px;color:#736987}.hint-box svg{width:19px;height:19px}
.field{margin:19px 0}.field>span,.field>label{font-size:16px;line-height:1.5;margin-bottom:10px;color:#555c6b}.field input:not([type=range]),.field select,.input{height:46px;font-size:16px;padding:0 12px;border-radius:9px;color:#404756}input[type=range]{height:6px;margin:12px 0 7px}input[type=checkbox]{width:18px;height:18px;flex:none}.field output{color:#707784}.pair{gap:14px}details{margin-top:24px;padding-top:18px}summary{font-size:16px;color:#535a68;line-height:1.5}.image-info{font-size:15px;padding:15px;line-height:1.8}.image-info strong{font-size:16px}
.empty{max-width:560px;padding:24px}.empty h1,.empty h2{font-size:32px;line-height:1.4;letter-spacing:-.8px}.empty p{font-size:17px;line-height:1.9;margin-bottom:24px;color:#737987}.empty .btn{height:50px;font-size:17px;padding:0 24px}.empty .empty-links{font-size:15px;gap:14px}.empty-links button{font-size:15px;padding:8px}.empty-formats{font-size:13px!important;margin-top:24px!important}.empty-art{margin-bottom:20px}
.canvas-controls{min-height:64px;height:auto;padding:10px 22px;gap:14px;flex-wrap:wrap}.canvas-controls small{font-size:14px;color:#747b89}.segmented{padding:4px;gap:4px}.segmented button{height:34px;font-size:14px;padding:0 13px}.compare-slider{width:170px;font-size:13px}
.filmstrip{height:152px;padding:14px 22px;gap:14px}.thumb{min-width:108px;width:108px;height:122px;padding:8px}.thumb.active{padding:7px}.thumb img{height:82px}.thumb .thumb-name{font-size:13px;line-height:1.4}.thumb .thumb-index{min-width:23px;height:23px;font-size:12px}.thumb-add{min-width:72px;height:112px}.strip-empty{font-size:15px}
.zoom-controls{height:48px;right:18px;bottom:18px;padding:4px 6px;gap:3px}.zoom-controls button{height:38px;min-width:38px;font-size:17px;padding:0 9px}.zoom-controls output{width:51px;font-size:15px}.preview-label{font-size:13px;padding:7px 10px}
.pdf-grid{padding:26px;gap:22px;grid-template-columns:repeat(auto-fill,minmax(164px,1fr))}.pdf-thumb{height:200px}.pdf-card{padding:12px}.pdf-card.selected{padding:11px}.pdf-card-head{font-size:15px;margin-bottom:10px}.pdf-card-name{font-size:13px;line-height:1.5;margin-top:12px}.pdfbar{padding:14px 22px;gap:9px}.pdfbar small{font-size:14px;width:100%}
.dialog{width:min(550px,calc(100vw - 28px));padding:28px;border-radius:16px}.dialog h2{font-size:25px}.dialog .description{font-size:16px}.dialog footer{flex-wrap:wrap;gap:12px}.warning,.checkline,.download-info{font-size:15px;line-height:1.8}.warning{padding:14px}.toast{font-size:16px;padding:14px 20px;bottom:52px}.progress-wrap{width:min(470px,92vw)}.progress-wrap>div{font-size:15px;gap:10px}.statusbar{height:36px;font-size:13px;padding:0 24px}.statusbar .status-right{display:none}
.ts-brand-group{gap:22px}.ts-studio-menu{padding:0;margin:0;border:0}.ts-studio-menu .ts-menu-summary{font-size:16px;min-height:44px;gap:8px}.ts-menu-panel .tool-switcher__item-name{font-size:17px}.ts-menu-panel .tool-switcher__item-detail{font-size:14px;line-height:1.7}.ts-menu-panel .ts-nav-note,.ts-menu-panel .ts-quicklinks a{font-size:14px}.ts-menu-panel .ts-menu-heading strong{font-size:23px}.ts-unified .ts-menu-panel{top:86px}
@media(min-width:1700px){.app{grid-template-columns:112px minmax(0,1fr) 430px}.inspector-scroll{padding:30px}.preset-thumb{height:120px}}
@media(max-width:1200px) and (min-width:801px){.app{grid-template-columns:90px minmax(0,1fr) 350px}.topbar{padding:0 20px;gap:12px}.brand small{display:none}.brand strong{font-size:20px}.ts-brand-group{gap:12px}.privacy{display:none}.inspector-scroll{padding:22px}.contentbar{padding:0 18px}.crumbs span:last-child{display:none}.workspace-tabs button{min-width:90px}}
@media(max-width:800px){.topbar{height:80px;padding:0 16px;gap:10px}.app{height:calc(100dvh - 112px);grid-template-columns:84px minmax(0,1fr)}.brand strong{font-size:19px}.brand small{display:none}.brand-mark{width:40px;height:42px}.workspace-tabs button{min-width:80px;height:42px;font-size:16px}.top-actions .btn{height:44px;font-size:16px;padding:0 12px}.contentbar{height:64px;padding:0 16px}.crumbs strong{font-size:17px}.crumbs span:last-child{display:none}.inspector{top:80px;bottom:32px;width:380px}.drawer-shade.open{inset:80px 0 32px}.inspector-head{min-height:64px}.filmstrip{height:134px;padding:10px 16px}.thumb{min-width:96px;width:96px;height:108px}.thumb img{height:69px}.thumb-add{height:104px}.statusbar{height:32px;font-size:12px;padding:0 15px}.canvas-controls small{display:none}.canvas-controls{padding:9px 14px;min-height:58px}.empty h1,.empty h2{font-size:28px}.empty p{font-size:16px}.tool{font-size:14px;height:70px;min-height:70px}.rail{padding:14px 8px}.ts-studio-menu .ts-menu-summary{font-size:14px}.ts-brand-group{gap:12px}}
@media(max-width:520px){.topbar{height:76px;padding:0 10px;gap:5px}.app{height:calc(100dvh - 106px);grid-template-columns:64px minmax(0,1fr)}.brand-mark{width:34px;height:36px}.brand-mark svg{width:23px;height:23px}.brand span:not(.brand-mark){display:none}.ts-brand-group{gap:5px}.ts-studio-menu .ts-menu-summary{width:34px;min-height:40px;padding:0;justify-content:center}.ts-studio-menu .ts-menu-summary>span{display:none}.ts-studio-menu .ts-menu-summary .ts-icon{width:21px;height:21px}.workspace-tabs{padding:3px;gap:1px}.workspace-tabs button{min-width:62px;height:39px;font-size:15px;gap:5px}.workspace-tabs .icon{width:18px;height:18px}.top-actions{gap:4px}.top-actions .btn{height:42px;padding:0 9px;font-size:15px}.top-actions .btn svg{width:18px;height:18px}.top-actions .add-label{display:none}.rail{padding:10px 4px;gap:6px}.rail-tools{gap:5px}.tool{height:64px;min-height:64px;font-size:13px;gap:7px}.tool svg{width:23px;height:23px}.contentbar{height:62px;padding:0 10px;gap:5px}.crumbs{gap:5px}.crumbs strong{font-size:16px}.crumbs>span{display:none}.toolbar-actions{gap:1px}.toolbar-actions .icon-btn{width:33px;height:38px}.toolbar-actions .divider{margin:0 2px}.toolbar-actions .icon{width:20px;height:20px}.empty{padding:18px 5px}.empty-art{height:115px;transform:scale(.8);margin-bottom:8px}.empty h1,.empty h2{font-size:23px;line-height:1.5;letter-spacing:-.5px}.empty p{font-size:14px;line-height:1.9;margin-bottom:20px}.empty .btn{font-size:16px;height:46px}.empty .empty-links{font-size:14px!important}.empty-links button{font-size:14px}.empty-formats{font-size:11px!important;margin-top:18px!important;letter-spacing:0}.stage{padding:17px}.canvas-controls{gap:8px;min-height:56px;padding:8px 10px}.segmented button{font-size:13px;height:32px;padding:0 10px}.compare-slider{width:130px;font-size:12px}.compare-slider input{min-width:50px}.filmstrip{height:122px;padding:9px 12px;gap:11px}.thumb{width:85px;min-width:85px;height:100px}.thumb img{height:62px}.thumb .thumb-name{font-size:12px}.thumb-add{height:92px;min-width:54px}.strip-empty{font-size:13px;line-height:1.7}.zoom-controls{right:8px;bottom:10px;height:44px;padding:3px;gap:1px}.zoom-controls button{font-size:15px;height:36px;min-width:32px;padding:0 7px}.zoom-controls output{font-size:14px;width:42px}.inspector{top:auto;bottom:30px;left:0;right:0;width:100%;height:min(75dvh,660px);border-radius:18px 18px 0 0}.inspector-head{min-height:66px;padding:0 22px}.inspector-scroll{padding:22px}.inspector-head h2{font-size:23px}.drawer-shade.open{inset:76px 0 30px}.inspector-footer{font-size:13px;padding:13px 22px}.preset-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.preset-thumb{height:104px}.preset .preset-name{font-size:16px}.scan-filters button{font-size:14px}.field input:not([type=range]),.field select{font-size:16px;height:46px}.statusbar{height:30px;font-size:11px;padding:0 12px}.statusbar>div:last-child{display:none}.pdf-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:12px}.pdf-thumb{height:145px}.pdf-card-head{font-size:13px}.pdf-card-name{font-size:12px}.pdfbar{padding:10px 12px;gap:6px}.pdfbar .btn{font-size:13px;height:38px;padding:0 9px}.pdfbar small{font-size:13px}.dialog{padding:22px;max-height:calc(100dvh - 24px)}.dialog h2{font-size:23px}.dialog footer .btn{flex:1}.ts-studio-menu .ts-menu-panel{position:fixed;left:10px;right:10px;top:76px;width:auto;max-height:calc(100dvh - 96px);overflow:auto}.ts-menu-panel .tool-switcher__grid{grid-template-columns:1fr}.ts-menu-panel .tool-switcher__item-name{font-size:17px}.ts-unified .ts-menu-panel{top:76px}}
@media(max-width:380px){.topbar{height:122px;display:grid;grid-template-columns:1fr auto;grid-template-rows:46px 44px;gap:7px;padding:9px 10px}.ts-brand-group{grid-row:1;grid-column:1}.top-actions{grid-row:1;grid-column:2}.workspace-tabs{grid-row:2;grid-column:1/-1}.workspace-tabs button{flex:1}.app{height:calc(100dvh - 152px)}.drawer-shade.open{top:122px}.ts-unified .ts-menu-panel{top:122px}.contentbar{height:62px}.toolbar-actions .divider{display:none}.toolbar-actions .icon-btn{width:29px}.crumbs strong{font-size:15px}}

/* Visible file management when a workspace already contains content. */
.thumb-item{position:relative;flex:0 0 auto}
.thumb-remove,.pdf-page-remove,.pdf-file-remove{display:inline-grid;place-items:center;flex:none;cursor:pointer;border:1px solid #e3e1e9;background:#fff;color:#777687;transition:background .15s,color .15s,border-color .15s}
.thumb-remove:hover:not(:disabled),.pdf-page-remove:hover:not(:disabled),.pdf-file-remove:hover:not(:disabled){background:#fff1f1;color:#b23c4c;border-color:#ecc0c7}
.thumb-remove:focus-visible,.pdf-page-remove:focus-visible,.pdf-file-remove:focus-visible{outline:3px solid #8d79da;outline-offset:2px}
.thumb-remove{position:absolute;z-index:2;top:-5px;right:-5px;width:27px;height:27px;border-radius:50%;box-shadow:0 2px 8px #22212b1c}
.thumb-remove .icon,.pdf-page-remove .icon,.pdf-file-remove .icon{width:15px;height:15px}
.thumb-add{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:9px;min-width:102px;padding:8px 12px;border-color:#afa5e7;background:#f9f7ff;color:#6250bd;font-size:13px;font-weight:650;white-space:nowrap}
.thumb-add:hover:not(:disabled){border-color:#7560d2;background:#efebff}
.thumb-add .icon{width:22px;height:22px}
.pdf-filebar{display:flex;align-items:center;gap:14px;padding:12px 22px;background:#fff;border-bottom:1px solid var(--line);flex:none;min-width:0}
.pdf-filebar-title{display:flex;flex-direction:column;gap:2px;flex:none}
.pdf-filebar-title strong{font-size:14px;font-weight:650;white-space:nowrap}
.pdf-filebar-title small{color:#8c8e9b;font-size:12px}
.pdf-file-list{display:flex;gap:8px;flex:1;min-width:0;overflow-x:auto;align-items:center;padding:2px 0;scrollbar-width:thin}
.pdf-file-chip{display:flex;align-items:center;gap:8px;flex:0 0 auto;max-width:min(280px,55vw);border:1px solid #e0e1e9;border-radius:8px;background:#f8f9fc;padding:5px 6px 5px 11px;min-width:0}
.pdf-file-name{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:20px}
.pdf-file-chip small{font-size:12px;white-space:nowrap;color:#9395a1}
.pdf-file-remove{width:26px;height:26px;border-radius:6px}
.pdf-add-files{height:38px!important;font-size:13px!important;font-weight:650!important;flex:none;border-color:#d7d0f6!important;color:#6653c5!important;background:#f8f6ff!important}
.pdf-add-files:hover:not(:disabled){background:#f0ecff!important}
.pdf-page-remove{width:26px;height:26px;border-radius:6px;margin-left:auto;margin-right:8px}
.pdf-card-head label{cursor:pointer;white-space:nowrap}
@media(max-width:800px){
 .pdf-filebar{padding:10px 12px;flex-wrap:wrap;gap:8px}
 .pdf-file-list{order:3;flex:0 0 100%;width:100%}
 .pdf-filebar-title strong{font-size:13px}
 .pdf-add-files{margin-left:auto;height:34px!important}
 .pdf-page-remove{width:25px;height:25px;margin-right:7px}
 .thumb-remove{width:26px;height:26px}
 .thumb-add{min-width:88px;padding:6px;font-size:12px}
}


/* Empty canvases remain reachable by touch on short mobile screens.
   The loaded image deliberately retains touch-action:none for pointer-driven
   one-finger panning and two-finger zooming. */
#imageStage:not(.has-image),
#pdfEmpty {
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: pan-y;
  align-items: safe center;
  justify-content: safe center;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}
#imageStage:not(.has-image) > .empty,
#pdfEmpty > .empty {
  width: min(100%, 560px);
  max-width: 100%;
  min-width: 0;
  flex-shrink: 0;
}
@media (max-width: 760px) {
  /* Comparison tools and the empty filmstrip waste valuable preview height
     until an image has actually been loaded. */
  #imageStage:not(.has-image) ~ .canvas-controls,
  #imageStage:not(.has-image) ~ .filmstrip {
    display: none;
  }
  #imageStage:not(.has-image),
  #pdfEmpty {
    padding: 16px 12px;
  }
}
