/* Davix H2I Studio -- layout and components specific to Studio (tokens, buttons, cards, modals and
   the app shell come from /assets/css/davix-h2i-design-system.css). */

/* ---------- App shell ---------- */
/* The shell always fits the visible viewport (no minimum height): panels scroll inside it, so nothing is cut off at any browser zoom or window size. */
.shell{display:flex;height:var(--app-h,100vh);min-height:0;overflow:hidden;}
.plan-pill{display:flex;align-items:center;justify-content:space-between;background:var(--ink-3);border:1px solid var(--ink-border);border-radius:9px;padding:9px 11px;font-size:12px;}
.plan-pill .name{font-weight:700;color:var(--ink-text);}
.plan-pill .tag{font-size:10px;padding:2px 6px;border-radius:99px;background:var(--accent-ink-soft);color:var(--accent-strong);font-weight:700;letter-spacing:.3px;}
.main{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;}
/* clip, not hidden: hidden would turn <body> into a scroll container and the top bar could no longer stay fixed while the page scrolls */
html,body{max-width:100%;overflow-x:clip;}
.workspace>*,.content>*{min-width:0;}
.content{flex:1;min-height:0;overflow:auto;}
@media (min-width:981px){ #panel-workspace{height:100%;overflow:hidden;} html{overflow-y:hidden;} }   /* the page never scrolls by itself here: only the areas inside it do, and only when they need to */
.topbar .btn:disabled{opacity:.45;cursor:not-allowed;}

/* ---------- Workspace: canvas | right sidebar (the Operations drawer floats above) ---------- */
.workspace{display:grid;grid-template-columns:minmax(0,1fr) 6px var(--right-w,340px);height:100%;min-height:0;position:relative;}
.panel{border-right:1px solid var(--border);display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;}
.panel:last-child{border-right:none;}
.panel-head{padding:13px 16px 10px;border-bottom:1px solid var(--border);flex:none;display:flex;align-items:center;gap:8px;}
.panel-head h2{font-size:12px;text-transform:uppercase;letter-spacing:.6px;color:var(--text-muted);margin:0;font-weight:700;}
.panel-body{flex:1;overflow-y:auto;overflow-x:hidden;padding:10px;min-height:0;overscroll-behavior:contain;}

.drag-grip{position:relative;background:transparent;flex:none;}
.drag-grip::before{content:'';position:absolute;background:transparent;transition:background .15s;}
.drag-grip::after{content:'';position:absolute;border-radius:99px;background:var(--accent);opacity:0;transition:opacity .15s,transform .15s;}
.drag-grip:hover::before,.drag-grip.dragging::before{background:var(--border-strong);}
.drag-grip:hover::after,.drag-grip.dragging::after{opacity:1;}
.resize-handle{cursor:col-resize;width:6px;}
.resize-handle::before{top:0;bottom:0;left:2px;width:2px;}
.resize-handle::after{top:50%;left:50%;width:4px;height:0;transform:translate(-50%,-50%) scaleY(0);}
.resize-handle:hover::after,.resize-handle.dragging::after{transform:translate(-50%,-50%) scaleY(1);height:36px;}
@media (max-width:980px){ .resize-handle{display:none;} }

/* Operations drawer */
#opsPanel{position:absolute;left:0;top:0;bottom:0;width:var(--ops-w,260px);z-index:8;background:var(--bg);box-shadow:8px 0 24px rgba(0,0,0,.35);transition:transform .2s ease;border-right:1px solid var(--border);}
#opsPanel.closed{transform:translateX(-100%);}
.ops-width-handle{top:0;bottom:0;right:-4px;width:8px;cursor:col-resize;position:absolute;}
.ops-width-handle::before{top:0;bottom:0;left:3px;width:2px;}
.ops-width-handle::after{top:50%;left:50%;width:4px;height:0;transform:translate(-50%,-50%) scaleY(0);}
.ops-width-handle:hover::after,.ops-width-handle.dragging::after{transform:translate(-50%,-50%) scaleY(1);height:36px;}
.ops-backdrop{position:absolute;inset:0;background:rgba(5,6,9,.45);z-index:7;opacity:0;pointer-events:none;transition:opacity .18s;}
.ops-backdrop.visible{opacity:1;pointer-events:auto;}
@media (max-width:980px){ .ops-width-handle{display:none;} }
@media (min-width:601px) and (max-width:980px){ #opsPanel{width:min(340px,calc(100vw - 40px));} }
@media (max-width:600px){ #opsPanel{width:100vw;} }
/* The way back to the operations: one small icon button in the top bar, next to the menu button (no row of its own) */
#opsReopenTab svg{color:var(--accent);}
body.not-workspace #opsReopenTab{display:none;}
#opsReopenTab:hover{border-color:var(--accent);}
.ops-search{padding:8px 10px;border-bottom:1px solid var(--border);flex:none;}
.ops-search input{width:100%;box-sizing:border-box;padding:8px 10px;border-radius:8px;border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:13px;}
.ops-count{margin-left:auto;font-size:10.5px;font-weight:700;font-family:var(--font-mono);color:var(--text-faint);}

.tool-group{margin-bottom:10px;}
.tool-group-head{width:100%;display:flex;align-items:center;gap:7px;padding:6px 8px;border-radius:7px;background:none;border:1px solid transparent;cursor:pointer;text-align:left;font:inherit;color:inherit;}
.tool-group-head:hover{background:var(--surface-2);border-color:var(--border);}
.tool-group-head .flash{width:12px;height:12px;flex:none;color:var(--accent);}
.tool-group-label{font-size:11px;font-weight:700;color:var(--text-faint);text-transform:uppercase;letter-spacing:.5px;}
.tool-group-count{margin-left:auto;font-size:10px;font-weight:600;color:var(--text-faint);font-family:var(--font-mono);white-space:nowrap;}
.tool-group-head .chev{width:13px;height:13px;flex:none;color:var(--text-faint);transition:transform .15s;}
.tool-group.collapsed .tool-group-head .chev{transform:rotate(-90deg);}
.tool-group-list{padding-top:2px;}
.tool-item{display:flex;align-items:center;gap:9px;padding:8px 9px;border-radius:8px;font-size:13px;font-weight:500;color:var(--text);cursor:pointer;border:1px solid transparent;position:relative;}
.tool-item:hover,.tool-item:focus-visible{background:var(--surface-2);border-color:var(--border);outline:none;}
.tool-item.active{background:var(--accent-soft);border-color:var(--accent);}
.tool-item svg{width:15px;height:15px;flex:none;color:var(--text-muted);}
.tool-item .lbl{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

/* ---------- Canvas ---------- */
.canvas-wrap{background:var(--surface-2);display:flex;flex-direction:column;overflow-y:auto;position:relative;}
.error-banner{flex:none;margin:10px 14px 0;padding:12px 14px;border-radius:10px;background:var(--danger-soft);color:var(--danger);font-size:12.5px;line-height:1.45;border:1px solid var(--danger);}
.error-banner code{font-family:var(--font-mono);font-size:11px;}
#uploadView{display:flex;flex-direction:column;min-height:0;flex:1;}
#uploadView.dropping{outline:2px dashed var(--accent);outline-offset:-6px;}
.drop-strip{flex:none;display:flex;gap:8px;padding:16px 18px 10px 14px;border-bottom:1px solid var(--border);overflow-x:auto;background:var(--surface);}
.thumb{width:52px;height:52px;border-radius:8px;border:2px solid transparent;flex:none;background-size:cover;background-position:center;position:relative;cursor:pointer;}
.thumb.active{border-color:var(--accent);}
.thumb .rm{position:absolute;top:-8px;right:-8px;width:20px;height:20px;border-radius:99px;background:var(--danger);color:#fff;border:2px solid var(--surface);box-sizing:border-box;font-size:12px;line-height:16px;text-align:center;display:none;z-index:1;}
.thumb:hover .rm{display:block;}
.thumb.add{border:1.5px dashed var(--border-strong);display:flex;align-items:center;justify-content:center;color:var(--text-faint);background:var(--surface-2);}
.pdf-chip{display:flex;align-items:center;justify-content:center;overflow:visible;background:var(--surface-3);}
.pdf-chip canvas{max-width:100%;max-height:100%;border-radius:6px;}
@media (hover:none){ .thumb .rm{display:block;} }
.page-count{position:absolute;bottom:0;right:0;font-size:8.5px;font-family:var(--font-mono);background:rgba(15,17,20,.7);color:#fff;padding:1px 3px;border-radius:4px 0 0 0;}
.preview-stage{flex:1 1 auto;display:flex;align-items:center;justify-content:center;padding:24px;position:relative;min-height:0;box-sizing:border-box;}
.single-preview{width:100%;max-width:560px;height:100%;max-height:380px;min-height:120px;border-radius:var(--radius);border:0;background:transparent center/contain no-repeat;box-shadow:none;}   /* no grey card behind a preview: the dotted canvas shows around it */

#pdfPreviewInline{max-width:560px;}
.file-card{display:flex;flex-direction:column;align-items:center;gap:8px;padding:24px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);}
.file-card .fc-name{font-weight:700;font-size:13px;word-break:break-all;text-align:center;}
.empty-hint{font-size:12px;color:var(--text-faint);text-align:center;padding:20px 8px;}

/* Running view: loader */
.running-view{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:40px 20px;text-align:center;}
.loader{position:relative;width:76px;height:76px;}
.loader::before,.loader::after{content:'';position:absolute;inset:0;border-radius:50%;border:4px solid transparent;}
.loader::before{border-top-color:var(--accent);border-right-color:var(--accent);animation:spin 1s linear infinite;}
.loader::after{inset:12px;border-bottom-color:var(--blue,#4da3ff);border-left-color:var(--blue,#4da3ff);opacity:.9;animation:spin 1.6s linear infinite reverse;}
@keyframes spin{to{transform:rotate(360deg);}}
.loader-label{font-size:15px;font-weight:700;}
.loader-detail,.loader-time{font-size:12px;color:var(--text-muted);font-family:var(--font-mono);min-height:16px;}
.loader-bar{width:min(320px,70%);height:4px;border-radius:99px;background:var(--surface-3);overflow:hidden;}
.loader-bar span{display:block;width:38%;height:100%;background:var(--accent);border-radius:99px;animation:slide 1.1s ease-in-out infinite;}
@keyframes slide{0%{margin-left:-38%;}100%{margin-left:100%;}}
@media (prefers-reduced-motion:reduce){ .loader::before,.loader::after,.loader-bar span{animation-duration:3s;} }

/* Result view: large preview on top, rows below */
.result-view{flex:1;display:flex;flex-direction:column;min-height:0;}
.result-head{flex:none;display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--border);background:var(--surface);}
.result-head h3{margin:0;font-size:13px;font-weight:700;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

/* ---------- Right sidebar ---------- */
.rp-head{flex:none;display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border-bottom:1px solid var(--border);}
.rp-title{flex:1;min-width:0;}
.rp-name{display:flex;align-items:center;gap:8px;min-width:0;}
.rp-name h2{min-width:0;}
.rp-hint:empty{display:none;}
.rp-hint{display:inline-flex;flex:none;}
.rp-title h2{font-size:14px;margin:0;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.rp-title .sub{font-size:10.5px;color:var(--text-faint);font-family:var(--font-mono);margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#generateBtn{flex:none;}
#generateBtn:disabled{opacity:.45;cursor:not-allowed;}
.preset-bar{flex:none;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:var(--surface);margin:0 0 10px;}
.preset-bar[hidden]{display:none;}
.pb-id,.pb-note{font-size:11px;color:var(--text-faint);margin-top:8px;word-break:break-all;}
.pb-id code{font-family:var(--font-mono);font-size:10.5px;}
.pb-id{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;word-break:normal;} .pb-id-l{font-weight:700;letter-spacing:.3px;text-transform:uppercase;font-size:10.5px;color:var(--text-muted);} .pb-id code{font-size:11.5px;color:var(--text);background:var(--surface-3);border-radius:6px;padding:2px 7px;overflow-wrap:anywhere;}
.pb-copy{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:7px;background:var(--surface-2);border:1px solid var(--border);color:var(--text-muted);cursor:pointer;padding:0;flex:none;} .pb-copy:hover{color:var(--accent-strong);border-color:var(--accent);} .pb-copy svg{width:14px;height:14px;}
.pb-count{flex-basis:100%;color:var(--text-faint);}
.file-slots{flex:none;}
.slot{display:flex;align-items:center;gap:8px;padding:5px 0;font-size:12px;}
.slot-name{font-family:var(--font-mono);font-size:11px;width:84px;flex:none;}
.slot-files{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

/* Parameter form */
.params-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:12px 14px 24px;overscroll-behavior:contain;}

/* Export modal */
.curl-block{margin-bottom:16px;}
.curl-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;font-size:12px;font-weight:700;color:var(--text-muted);}
.curl-block pre{background:#0d111a;border:1px solid var(--border);border-radius:8px;padding:14px;font-size:12.5px;line-height:1.6;white-space:pre;overflow-x:auto;margin:0;font-family:var(--font-mono);}
.export-lang{display:flex;align-items:center;gap:10px;margin:0 0 14px;}
.export-lang label{font-size:12px;font-weight:700;color:var(--text-muted);}
.export-lang select{flex:1;min-width:0;max-width:280px;}
.export-note{font-size:11.5px;color:var(--text-faint);}
.export-note code{font-size:11px;}

/* History / presets / capabilities pages */

@media (max-width:980px){
  .workspace{grid-template-columns:minmax(0,1fr);}
  .panel{border-right:none;border-bottom:1px solid var(--border);}
  .sidebar{position:fixed;left:0;top:0;bottom:0;width:var(--sidebar-drawer-w);max-width:none;transform:translateX(-100%);transition:transform .18s;z-index:20;}
  .sidebar.open{transform:translateX(0);}
  .params-body{max-height:none;}
}

/* ---------- Readable result data (no raw JSON) ---------- */

/* ---------- Preset bar ----------
   Small screens: label + dropdown on the first row, the buttons on a second row starting exactly under the
   dropdown's left edge. Large screens (1500px+): label, dropdown and buttons on a single row. */
.pb-line{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px 10px;align-items:center;}
.pb-line label{font-size:11px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:.4px;display:inline-flex;align-items:center;gap:2px;}
.pb-line label .hint-btn{margin-left:4px;}
.pb-line select{min-width:0;width:100%;padding:6px 8px;border-radius:8px;border:1px solid var(--border);background:var(--surface-2);color:var(--text);font:inherit;font-size:12.5px;}
.pb-line .pb-actions{grid-column:2;display:flex;gap:6px;flex-wrap:wrap;}
/* One row whenever the sidebar itself is wide enough (container width, not screen width), two rows when it is not. */
.preset-bar{container-type:inline-size;}
@container (min-width:430px){
  .pb-line{grid-template-columns:auto minmax(0,1fr) auto;}
  .pb-line .pb-actions{grid-column:3;grid-row:1;flex-wrap:nowrap;}
}

/* ---------- Result screen: only the result is shown ---------- */
body.result-mode .sidebar,
body.result-mode #menuBtn,
body.result-mode #opsPanel,
body.result-mode .ops-backdrop,
body.result-mode #opsReopenTab,
body.result-mode #resizeRight,
body.result-mode #rightPanel{display:none !important;}
body.result-mode .workspace{grid-template-columns:minmax(0,1fr);}
/* No operation chosen yet: no parameters panel, the canvas takes the full width */
body.no-op #rightPanel,
body.no-op #resizeRight{display:none !important;}
body.no-op .workspace{grid-template-columns:minmax(0,1fr);}

/* ---------- Scrolling that works in every browser ----------
   --app-h is the real visible height, set from JavaScript (see app.js) so the layout never depends on
   how a browser resolves vh/dvh. On phones/tablets and on the result screen the normal page scrolls
   (reliable everywhere) instead of nested scroll boxes. */
@media (max-width:980px){
  .shell{height:auto;min-height:var(--app-h,100vh);overflow:visible;}
  .main,.content,#panel-workspace,.workspace,.panel,.canvas-wrap{height:auto;overflow:visible;}
  .panel-body,.params-body{max-height:none;overflow:visible;}
  .topbar{position:sticky;top:0;z-index:6;}
  #opsPanel{position:fixed;top:0;bottom:0;box-sizing:border-box;padding-top:var(--sat);padding-bottom:max(var(--sab),var(--pwa-nav-offset,0px));padding-left:var(--sal);}
  #opsPanel .panel-body{overflow-y:auto;}
}
/* phones and tablets: the page scrolls under the fixed top bar. Big screens: the page stays put, only the content area under the top bar scrolls. */
@media (max-width:980px){
  body.result-mode .shell{height:auto;min-height:var(--app-h,100vh);overflow:visible;}
  body.result-mode .main,
  body.result-mode .content,
  body.result-mode #panel-workspace,
  body.result-mode .workspace,
  body.result-mode .panel,
  body.result-mode .canvas-wrap,
  body.result-mode .result-view{height:auto;overflow:visible;min-height:0;}
}
@media (min-width:981px){
  /* the page and the content area stay put; the result bar stays; only the preview + rows area under the bar has a scrollbar */
  body.result-mode .content{overflow:hidden;}
  body.result-mode #panel-workspace,
  body.result-mode .workspace,
  body.result-mode .canvas-wrap{height:100%;min-height:0;}
  body.result-mode .canvas-wrap .result-view{height:100%;min-height:0;overflow:hidden;}
  body.result-mode .result-head{position:static;}
  body.result-mode .result-body{flex:1;min-height:0;overflow:auto;}
}
body.result-mode .topbar{position:sticky;top:0;z-index:6;}
/* A mouse or trackpad at any width: the top bar is fixed and only the area under it scrolls, so the scrollbar never runs up beside the top bar.
   (A touch screen keeps the page scroll above: its scrollbars are overlays, and iOS is most reliable that way.) */
@media (max-width:980px) and (hover:hover) and (pointer:fine){
  html{overflow-y:hidden;}
  .shell,body.result-mode .shell{height:var(--app-h,100vh);min-height:0;overflow:hidden;}
  .main,body.result-mode .main{height:auto;min-height:0;overflow:hidden;}
  .content,body.result-mode .content{flex:1;min-height:0;height:auto;overflow-x:hidden;overflow-y:auto;}
  .topbar,body.result-mode .topbar{position:static;}
  /* the result bar (Export code, Start over) sticks at the top of the area that scrolls, which already starts under the top bar: no gap above it */
  body.result-mode .result-view .result-head{top:0;}
}
/* while a request runs the loader fills the whole screen under the top bar and sits in the middle of it */
body.result-mode .running-view{min-height:calc(var(--app-h,100vh) - var(--topbar-h,56px));width:100%;box-sizing:border-box;}
/* The result bar (title, Export code, Start over) stays under the top bar while only the result scrolls */
@media (max-width:980px){ body.result-mode .result-head{position:sticky;top:var(--topbar-h,56px);z-index:5;} }

/* ---------- Result header: Export as curl sits next to Start over ---------- */
.result-actions{display:flex;align-items:center;gap:8px;flex:none;flex-wrap:wrap;justify-content:flex-end;}
.result-actions .btn[hidden]{display:none;}

/* ---------- Results that are only data: same full-height canvas, rows centred ---------- */
.result-view{min-height:calc(var(--app-h,100vh) - 58px);}
.result-view.data-only{display:flex;flex-direction:column;}
.result-view.data-only .result-rows{flex:none;width:min(760px,100%);box-sizing:border-box;margin:auto;align-self:center;padding:20px 16px;}
/* an answer without a file: its text fills the preview box and can be read in full */

.result-head{flex-wrap:wrap;}

body.result-mode .result-view{min-height:calc(var(--app-h,100vh) - 58px);}

/* ---------- Presets page: detail view ---------- */

/* ---------- Hints beside parameter labels ---------- */

/* Hint beside each operation: visible on hover/focus/active (always on touch screens), never steals the row's click. */
.tool-item .hint-btn{margin-left:2px;}
.tool-item .lbl{flex:0 1 auto;}
.tool-item::after{content:'';flex:1;}
.tool-item .hint-btn svg{width:9px;height:9px;color:inherit;}
@media (hover:none),(pointer:coarse){ .tool-item .hint-btn svg{width:12px;height:12px;} }

/* A file badge on a thumbnail (Compare PDFs: A / B) */
.thumb[data-badge]::before{content:attr(data-badge);position:absolute;left:-5px;top:-5px;min-width:18px;height:18px;padding:0 4px;box-sizing:border-box;border-radius:99px;background:var(--accent);color:var(--pink-on);font-size:10.5px;font-weight:800;line-height:18px;text-align:center;z-index:1;border:2px solid var(--bg);}

/* ---------- Extra upload slots (watermark logo, file to attach, ...) ---------- */
.file-slots{display:flex;flex-direction:column;gap:12px;margin-bottom:14px;transition:opacity .15s,filter .15s;}
.file-slots.locked{opacity:.45;filter:grayscale(.4);pointer-events:none;}
.xslot{border:1px solid var(--border);border-radius:12px;background:var(--surface);padding:10px 10px 10px;transition:border-color .15s,background .15s,box-shadow .15s;}
.xslot.dropping{border-color:var(--accent);background:var(--accent-soft);box-shadow:0 0 0 3px var(--accent-soft);}
.xslot-head{display:flex;align-items:center;margin-bottom:8px;min-height:22px;}
.xslot-title{font-size:12px;font-weight:700;}
.xslot-drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;text-align:center;padding:16px 10px;border:1.5px dashed var(--border-strong);border-radius:10px;background:var(--surface-2);color:var(--text-muted);cursor:pointer;transition:border-color .15s,background .15s,color .15s;}
.xslot-drop:hover,.xslot-drop:focus-visible{border-color:var(--accent);color:var(--text);background:var(--accent-soft);outline:none;}
.xslot-drop svg{width:22px;height:22px;color:var(--accent);margin-bottom:2px;}
.xslot-cta{font-size:12.5px;}
.xslot-cta b{color:var(--text);font-weight:700;} .xslot-cta u{text-decoration:none;color:var(--accent-strong);font-weight:700;}
.xslot-types{font-size:10.5px;color:var(--text-faint);font-family:var(--font-mono);letter-spacing:.2px;}
.xslot-files{display:flex;flex-direction:column;gap:8px;}
.xslot-file{display:flex;align-items:center;gap:10px;padding:7px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2);}
.xslot-thumb{width:40px;height:40px;flex:none;border-radius:8px;background:var(--surface-3) center/cover no-repeat;display:flex;align-items:center;justify-content:center;overflow:hidden;border:1px solid var(--border);}
.xslot-thumb svg{width:20px;height:20px;}
.xslot-meta{flex:1;min-width:0;display:flex;flex-direction:column;}
.xslot-meta b{font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.xslot-meta i{font-size:10.5px;color:var(--text-faint);font-style:normal;font-family:var(--font-mono);}
.xslot-x{width:26px;height:26px;flex:none;border-radius:8px;border:1px solid var(--border);background:var(--surface);color:var(--text-muted);font-size:16px;line-height:1;}
.xslot-x:hover{color:var(--danger);border-color:var(--danger);}
.xslot-add{align-self:flex-start;background:none;border:none;color:var(--accent-strong);font:inherit;font-size:12px;font-weight:700;padding:2px 0;}
@media (pointer:coarse){ .xslot-x{width:36px;height:36px;} .xslot-drop{padding:20px 10px;} }

/* ---------- Demo mode (a visitor who is not signed in) ---------- */
.demo-bar{flex:none;display:flex;align-items:center;gap:12px;padding:8px max(16px,var(--sar)) 8px max(16px,var(--sal));background:linear-gradient(90deg,var(--pink-soft),var(--blue-soft));border-bottom:1px solid var(--border);font-size:12.5px;}
.demo-pill{flex:none;padding:2px 8px;border-radius:99px;background:var(--accent);color:var(--pink-on);font-size:10px;font-weight:800;letter-spacing:.8px;text-transform:uppercase;}
.demo-text{flex:1;min-width:0;color:var(--text);line-height:1.4;}
html.is-demo [data-notif-bell],html:not(.is-demo) #userAvatar{display:none;}
html.is-demo #chatsSection,html.is-demo #presetBar{display:none !important;}   /* the Assistant, History and Saved stay in the menu, locked (locked-pages.js) */
.demo-ops-note{margin:10px 8px 4px;padding:10px 12px;border-radius:10px;border:1px dashed var(--border-strong);font-size:12px;color:var(--text-muted);line-height:1.5;}
.demo-ops-note .btn-link{background:none;border:0;padding:0;color:var(--accent-strong);font:inherit;font-weight:700;cursor:pointer;}
@media (max-width:640px){ .demo-bar{flex-wrap:wrap;} .demo-text{flex-basis:100%;order:3;} .demo-close{margin-left:auto;} }
.demo-close{flex:none;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:8px;background:transparent;color:var(--text-muted);cursor:pointer;}
.demo-close:hover{background:var(--surface-3);color:var(--text);}
.demo-close svg{width:15px;height:15px;}
@media (pointer:coarse){ .demo-close{width:40px;height:40px;} }

/* The demo's profile: no avatar and no e-mail -- a "Sign in" pill in the top bar, a "Demo mode" card in the sidebar. */
html.is-demo #userAvatar{width:auto;height:34px;padding:0 13px 0 10px;gap:7px;border-radius:99px;background:var(--accent);color:var(--pink-on);border-color:var(--accent);font-size:12.5px;font-weight:800;letter-spacing:.1px;display:inline-flex;align-items:center;cursor:pointer;transition:background .12s,transform .12s;}
html.is-demo #userAvatar:hover{background:var(--accent-strong);border-color:var(--accent-strong);}
html.is-demo #userAvatar svg{width:15px;height:15px;flex:none;}
html.is-demo #sideProfile{padding:10px 12px;border-radius:12px;background:linear-gradient(135deg,var(--pink-soft),var(--blue-soft));border:1px solid var(--border-strong);position:relative;transition:border-color .12s,background .12s;}
html.is-demo #sideProfile:hover{border-color:var(--accent);}
html.is-demo #sideProfile::after{content:'';position:absolute;right:13px;top:50%;width:7px;height:7px;margin-top:-5px;border-right:2px solid var(--text-faint);border-top:2px solid var(--text-faint);transform:rotate(45deg);}
html.is-demo #sideAvatar{background:var(--accent);color:var(--pink-on);border-color:transparent;}
html.is-demo #sideAvatar svg{width:17px;height:17px;}
html.is-demo #sideName{font-weight:800;}
html.is-demo #sideEmail{color:var(--accent-strong);font-weight:600;}
@media (max-width:520px){ html.is-demo #userAvatar span{display:none;} html.is-demo #userAvatar{padding:0;width:38px;justify-content:center;height:38px;} }

/* Limits line, Check banner, ZIP results, stored certificates */
.limits-line{display:flex;align-items:center;gap:6px;justify-content:center;flex-wrap:wrap;margin:10px 14px 18px;font-size:12px;color:var(--text-muted);text-align:center;}
#limitsLineParams{justify-content:flex-start;text-align:left;margin:0 0 14px;}
.limits-line .ll-more{width:auto;height:auto;margin:0;cursor:pointer;color:var(--text);font:inherit;font-size:11.5px;font-weight:600;padding:3px 10px;}
.limits-line .ll-more:hover,.limits-line .ll-more[aria-expanded="true"]{color:var(--pink-on);background:var(--accent);border-color:var(--accent);}
.limits-line .ll-title{font-size:10.5px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:var(--text-faint);margin-right:2px;}
.limits-line .ll-chip{padding:3px 10px;border-radius:99px;background:var(--surface-2);border:1px solid var(--border);font-size:11.5px;font-weight:600;color:var(--text);white-space:nowrap;}
.topbar-title.is-blank{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}
.check-banner{margin:10px 14px 0;padding:10px 12px;border-radius:var(--radius-sm,10px);font-size:12.5px;border:1px solid var(--border);background:var(--surface-2);}
.check-banner.ok{border-color:var(--success);background:var(--success-soft);color:var(--text);}
.check-banner.bad{border-color:var(--danger);background:var(--danger-soft);color:var(--text);}
.check-banner ul{margin:6px 0 0;padding-left:18px;}
.check-banner code{font-size:11.5px;}
#checkBtn{margin-right:6px;}
.hist-delete{flex:none;padding:0 9px;color:var(--text-muted);}
.hist-delete:hover{color:var(--danger);border-color:var(--danger);}
.cert-intro{font-size:12.5px;color:var(--text-muted);margin:0 0 12px;}
.cert-list{border:1px solid var(--border);border-radius:var(--radius-sm,10px);margin-bottom:6px;}
.cert-row{display:flex;align-items:center;gap:10px;padding:9px 12px;border-bottom:1px solid var(--border);}
.cert-row:last-child{border-bottom:0;}
.cert-main{flex:1;min-width:0;}
.cert-name{font-weight:700;font-size:13px;overflow-wrap:anywhere;}
.cert-meta{font-size:11.5px;color:var(--text-faint);overflow-wrap:anywhere;}
.cert-empty{padding:12px;font-size:12.5px;color:var(--text-faint);}
.cert-sub{font-size:13px;margin:16px 0 8px;}
.cert-file{font-size:11.5px;color:var(--accent-strong);font-weight:600;cursor:pointer;}
.cert-error{margin-top:8px;font-size:12.5px;color:var(--danger);}

/* Several files, one group per input file */


/* Saved: sub-tabs and the Templates page */
/* Template bar */

/* ---------- History page heading (matches the portal's page heading) ---------- */
.hx-pagehead{margin-bottom:22px;}
.hx-pagehead h1{font-size:22px;font-weight:800;letter-spacing:-.2px;margin:0;}
.hx-pagehead .sub{font-size:13px;color:var(--text-muted);margin-top:3px;}

/* the expand icon at the far right of a long text field's label, and the full-screen editor it opens */
.pf-label .pf-expand{margin-left:auto;flex:none;width:26px;height:26px;border-radius:7px;border:1px solid var(--border);background:var(--surface-2);color:var(--text-muted);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;}
.pf-label .pf-expand svg{width:14px;height:14px;}
.pf-label .pf-expand:hover,.pf-label .pf-expand:focus-visible{color:var(--accent);border-color:var(--accent);outline:none;}
.pf-label .pf-reset + .pf-expand{margin-left:8px;}
.pf-full{position:fixed;inset:0;z-index:90;background:var(--bg);display:flex;flex-direction:column;padding:max(12px,var(--sat)) max(14px,var(--sar)) max(12px,var(--sab)) max(14px,var(--sal));box-sizing:border-box;gap:10px;}
.pf-full-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:none;}
.pf-full-title{font-weight:800;font-size:15px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.pf-full-text{flex:1;min-height:0;width:100%;box-sizing:border-box;resize:none;border-radius:10px;border:1px solid var(--border);background:var(--surface);color:var(--text);font-family:var(--font-mono);font-size:13px;line-height:1.55;padding:14px 16px;tab-size:2;}
.pf-full-text:focus{outline:none;border-color:var(--accent);}

/* Operation first: an operation that needs no file has no canvas -- the parameters take the whole page (a comfortable column in the middle on a big screen) */
body.no-file-op:not(.result-mode) .canvas-wrap,
body.no-file-op:not(.result-mode) #resizeRight{display:none;}
body.no-file-op:not(.result-mode) .workspace{grid-template-columns:minmax(0,1fr);}
body.no-file-op:not(.result-mode) #rightPanel{border-left:none;}
body.no-file-op:not(.result-mode) #rightPanel > .rp-head,
body.no-file-op:not(.result-mode) #rightPanel > .params-body,
body.no-file-op:not(.result-mode) #rightPanel > .req-msg,
body.no-file-op:not(.result-mode) #rightPanel > .check-banner,
body.no-file-op:not(.result-mode) #rightPanel > .error-banner,
body.no-file-op:not(.result-mode) #rightPanel > .empty-hint{width:100%;max-width:880px;margin-left:auto;margin-right:auto;box-sizing:border-box;}
@media (max-width:980px){ body.no-file-op:not(.result-mode) #rightPanel{min-height:calc(var(--app-h,100vh) - var(--topbar-h,56px));} }
.stage-choose{display:flex;flex-direction:column;align-items:center;gap:12px;color:var(--text-muted);font-size:13px;}

/* the preview and the rows: one column, the same width for every kind of result */
.result-body{display:flex;flex-direction:column;}
.result-view.data-only .result-rows{margin:0 auto;padding:12px 16px 24px;align-self:auto;flex:none;}
/* a text result: the answer with room around it */

/* a button that is only an icon (Copy in Export code) */
.btn-icon{padding:0;width:34px;min-width:34px;height:34px;min-height:34px;justify-content:center;}
.btn-icon svg{width:15px;height:15px;}
.result-view.has-groups .pv-stage{height:260px;}
#pdfPreviewInline.pv .pv-stage{height:min(60vh,560px);}

/* Metadata screen (metadata.js): preview + choice + tags, one Apply. Same inputs, buttons and tokens as the rest of Studio. */
.meta-host{flex:1;padding:16px 16px 0;overflow:auto;}
.me{display:flex;flex-direction:column;gap:16px;max-width:900px;margin:0 auto;width:100%;}
.me-top{display:grid;grid-template-columns:220px minmax(0,1fr);gap:18px;align-items:start;}
.me-prevwrap{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-2);overflow:hidden;height:220px;display:flex;align-items:center;justify-content:center;}
.me-prev{width:100%;height:100%;}
.me-prev.img{background:center/contain no-repeat;}
.me-prev.pdf{overflow:auto;padding:8px;box-sizing:border-box;}
.me-prev.doc{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:var(--text-faint);font-size:12px;font-weight:700;letter-spacing:.5px;}
.me-prev.doc svg{width:42px;height:42px;}
.me-info{min-width:0;display:flex;flex-direction:column;gap:10px;}
.me-pick{display:flex;flex-direction:column;gap:4px;font-size:11px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;color:var(--text-faint);}
.me-pick select,.me-field input,.me-search,.me-input{width:100%;box-sizing:border-box;padding:7px 9px;border-radius:8px;border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:12.5px;}
.me-pick select{text-transform:none;letter-spacing:0;font-weight:600;font-size:13px;}
.me-fname{font-size:15px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.me-fmeta{margin-top:-6px;font-size:11.5px;color:var(--text-muted);font-family:var(--font-mono);}
.me-reveal{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:12px;}
.me-reveal-l{color:var(--text-faint);font-weight:700;font-size:11px;letter-spacing:.4px;text-transform:uppercase;margin-right:2px;}
.me-chip{padding:2px 9px;border-radius:99px;font-size:11.5px;font-weight:700;background:var(--warn-soft);color:var(--warn);}
.me-chip-location,.me-chip-personal{background:var(--danger-soft);color:var(--danger);}
.me-clean{display:inline-flex;align-items:center;gap:6px;color:var(--success);font-weight:600;}
.me-clean svg{width:14px;height:14px;}
.me-field{display:flex;flex-direction:column;gap:4px;font-size:11px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;color:var(--text-faint);}
.me-field input{text-transform:none;letter-spacing:0;font-weight:400;}
.me-input:focus,.me-field input:focus,.me-search:focus,.me-pick select:focus{outline:2px solid var(--accent-soft);border-color:var(--accent);}
.me-choose{display:flex;flex-direction:column;gap:8px;}
.me-seg{display:flex;flex-wrap:wrap;gap:0;border:1px solid var(--border);border-radius:9px;overflow:hidden;background:var(--surface);align-self:flex-start;max-width:100%;}
.me-seg-b{padding:8px 14px;font:inherit;font-size:12.5px;font-weight:600;color:var(--text-muted);background:none;border:0;border-right:1px solid var(--border);cursor:pointer;}
.me-seg-b:last-child{border-right:0;}
.me-seg-b:hover{background:var(--surface-2);color:var(--text);}
.me-seg-b.on{background:var(--accent);color:var(--pink-on);}
.me-seg-hint{font-size:12px;color:var(--text-muted);}
.me-same{display:inline-flex;align-items:center;gap:7px;font-size:12.5px;color:var(--text-muted);cursor:pointer;}
.me-same input,.me-only input{accent-color:var(--accent);width:15px;height:15px;}
.me-note{padding:9px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface-2);font-size:12.5px;color:var(--text-muted);}
.me-tools{display:flex;align-items:center;gap:14px;flex-wrap:wrap;}
.me-search{flex:1;min-width:180px;max-width:340px;}
.me-only{display:inline-flex;align-items:center;gap:7px;font-size:12.5px;color:var(--text-muted);cursor:pointer;}
.me-list{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);overflow:hidden;}
.me-sec+.me-sec{border-top:1px solid var(--border);}
.me-sec-h{display:flex;align-items:center;gap:8px;padding:0 12px 0 4px;background:var(--surface-2);}
.me-sec-t{flex:1;display:flex;align-items:center;gap:8px;background:none;border:0;padding:9px 8px;font:inherit;font-size:12px;letter-spacing:.3px;text-transform:uppercase;color:var(--text-muted);cursor:pointer;text-align:left;}
.me-sec-t b{font-weight:700;}
.me-sec-t .chev{width:14px;height:14px;color:var(--text-faint);transition:transform .15s;transform:rotate(-90deg);flex:none;}
.me-sec.open .me-sec-t .chev{transform:none;}
.me-count{font-size:10.5px;font-family:var(--font-mono);background:var(--surface-3);padding:0 7px;border-radius:99px;}
.me-link{background:none;border:0;padding:4px 2px;font:inherit;font-size:12px;font-weight:600;color:var(--accent);cursor:pointer;}
.me-link:hover{text-decoration:underline;}
.me-row{display:grid;grid-template-columns:minmax(120px,.9fr) minmax(0,2fr) 104px 30px;gap:12px;align-items:center;padding:6px 12px;border-top:1px solid var(--border);min-height:40px;}
.me-row.removed{background:var(--danger-soft);}
.me-row.edited{background:var(--accent-soft);}
.me-name{min-width:0;display:flex;flex-direction:column;}
.me-name b{font-size:12.5px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.me-key{font-size:10.5px;color:var(--text-faint);font-family:var(--font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.me-value{min-width:0;}
.me-val{display:block;font-family:var(--font-mono);font-size:12px;color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.me-val.struck{text-decoration:line-through;color:var(--text-faint);}
.me-row .me-input{background:var(--surface-2);border:1px solid var(--border);font-family:var(--font-mono);font-size:12px;padding:6px 8px;}
.me-row .me-input:hover{border-color:var(--border-strong,var(--text-faint));}
.me-row .me-input:focus{border-color:var(--accent);background:var(--surface);}
.me-prev{position:relative;}
.me-prev.pdf,.me-prev.doc{display:flex;align-items:center;justify-content:center;overflow:hidden;padding:6px;box-sizing:border-box;}
.me-prev-page{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;background:#fff;border-radius:3px;box-shadow:0 2px 10px rgba(0,0,0,.35);}
.me-prev-wait{display:flex;flex-direction:column;align-items:center;gap:8px;color:var(--text-faint);font-size:12px;font-weight:600;}
.me-prev-wait svg{width:40px;height:40px;}
.me-prev-pages{position:absolute;right:8px;bottom:8px;padding:2px 8px;border-radius:99px;background:rgba(0,0,0,.65);color:#fff;font-size:11px;font-weight:700;}
.me-risks{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end;}
.me-risk{font-size:10px;font-weight:700;padding:1px 7px;border-radius:99px;background:var(--surface-3);color:var(--text-muted);}
.me-risk-location,.me-risk-personal{background:var(--danger-soft);color:var(--danger);}
.me-risk-device,.me-risk-identifier,.me-risk-thumbnail{background:var(--warn-soft);color:var(--warn);}
.me-act{display:flex;justify-content:flex-end;}
.me-rm{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border-radius:7px;border:1px solid transparent;background:none;color:var(--text-faint);cursor:pointer;padding:0;}
.me-rm svg{width:15px;height:15px;}
.me-rm:hover{background:var(--surface-3);color:var(--text);}
.me-rm.on{background:var(--danger-soft);color:var(--danger);border-color:var(--danger);}
.me-lockico{display:inline-flex;color:var(--text-faint);opacity:.6;}
.me-lockico svg{width:13px;height:13px;}
.me-empty{padding:24px;text-align:center;color:var(--text-muted);font-size:13px;}
.me-add{display:flex;flex-direction:column;gap:8px;align-items:flex-start;}
.me-add-row{display:grid;grid-template-columns:minmax(120px,1fr) minmax(0,2fr) 30px;gap:8px;width:100%;align-items:center;}
.me-bar{position:sticky;bottom:0;margin:0 -16px;padding:12px 16px;display:flex;align-items:center;gap:10px;justify-content:flex-end;background:var(--surface);border-top:1px solid var(--border);}
.me-bar-t{flex:1;font-size:12.5px;color:var(--text-muted);min-width:0;}
.me-bar .btn:disabled{opacity:.45;cursor:not-allowed;}
@media (max-width:720px){
  .me-top{grid-template-columns:1fr;}
  .me-prevwrap{height:200px;}
  .me-row{grid-template-columns:minmax(0,1fr) 30px;grid-template-areas:"n a" "v v" "r r";gap:4px 8px;padding:8px 12px;}
  .me-name{grid-area:n;}.me-act{grid-area:a;}.me-value{grid-area:v;}.me-risks{grid-area:r;justify-content:flex-start;}
  .me-add-row{grid-template-columns:1fr 30px;}
  .me-seg-b{flex:1 1 45%;border-bottom:1px solid var(--border);}
  .me-bar{flex-wrap:wrap;}.me-bar-t{flex-basis:100%;}
}

/* The + menu and the paste-web-addresses dialog */
.add-menu{position:fixed;z-index:300;min-width:250px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:0 12px 32px rgba(0,0,0,.4);padding:6px;display:flex;flex-direction:column;gap:2px;}
.add-menu button{display:flex;align-items:center;gap:12px;text-align:left;background:none;border:0;border-radius:8px;padding:9px 10px;color:var(--text);font:inherit;cursor:pointer;}
.add-menu button:hover,.add-menu button:focus-visible{background:var(--surface-2);outline:none;}
.add-menu svg{width:18px;height:18px;flex:none;color:var(--accent);}
.add-menu span{display:flex;flex-direction:column;line-height:1.25;}
.add-menu b{font-size:13px;font-weight:600;}
.add-menu i{font-style:normal;font-size:11.5px;color:var(--text-muted);}
.url-hint{margin:0 0 10px;font-size:12.5px;color:var(--text-muted);}
.url-box{width:100%;box-sizing:border-box;min-height:120px;resize:vertical;padding:9px 10px;border-radius:8px;border:1px solid var(--border);background:var(--surface);color:var(--text);font-family:var(--font-mono);font-size:12px;line-height:1.5;}
.url-box:focus{outline:2px solid var(--accent-soft);border-color:var(--accent);}
.url-count{margin-top:6px;font-size:11.5px;color:var(--text-muted);min-height:16px;}
.url-count.over{color:var(--danger);font-weight:600;}
.url-err{margin-top:8px;padding:9px 11px;border-radius:8px;background:var(--danger-soft);color:var(--danger);font-size:12.5px;}
.url-err ul{margin:6px 0 0;padding-left:18px;color:var(--text);}
.url-err code{font-size:11.5px;}

.file-card .doc-first{max-width:100%;max-height:60vh;border-radius:6px;box-shadow:0 2px 10px rgba(0,0,0,.35);background:#fff;}
.file-card.zoomable{cursor:zoom-in;}

/* Result rows: one tight row per file (no headings above them), good on every width */

/* code colours: the same palette as the Dashboard's "Make your first call" */
.hl .tk-c{color:#6b7893;font-style:italic;} .hl .tk-s{color:#9ece6a;} .hl .tk-k{color:#bb9af7;} .hl .tk-f{color:#7aa2f7;} .hl .tk-t{color:#e0af68;} .hl .tk-v{color:#f7768e;} .hl .tk-n{color:#ff9e64;} .hl .tk-o{color:#2ac3de;}
.hl .tk-ph{background:rgba(255,100,180,.18);color:#ff8fcf;border-radius:4px;padding:0 3px;}

/* the result row: the title repeats the header above it, so only the buttons stay (the title remains for screen readers) */
.result-head h3{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}
.result-head{justify-content:flex-end;}
.result-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;}
/* the result header never runs past the screen: its buttons wrap and share the width */
.result-head{flex-wrap:wrap;min-width:0;}
.result-actions{flex:1 1 auto;min-width:0;max-width:100%;}
@media (max-width:640px){
  .result-head{padding:10px 12px;}
  .result-actions{width:100%;justify-content:stretch;}
  .result-actions .btn{flex:1 1 auto;justify-content:center;}
}

/* back to default: a plain icon in the colour of the label, with a generous area to click */
button.pf-reset{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;margin:-4px 0 -4px 2px;padding:0;background:none;border:0;border-radius:6px;color:inherit;opacity:.7;cursor:pointer;vertical-align:middle;}
button.pf-reset:hover,button.pf-reset:focus-visible{opacity:1;outline:none;}
.pf-reset svg{display:block;}

/* the name and the icons beside it share one centre line */
.pf-label label{margin:0;line-height:1.2;}

/* ---------- Empty state (no operation chosen yet): one calm surface from the top bar to the bottom ---------- */
body.no-op .canvas-wrap{min-height:calc(var(--app-h,100vh) - var(--topbar-h,56px));background:
  radial-gradient(60% 50% at 18% 12%,rgba(255,100,180,.22),transparent 70%) 0 var(--strip-h,0px)/100% calc(100% - var(--strip-h,0px)) no-repeat,radial-gradient(55% 45% at 88% 92%,rgba(77,163,255,.18),transparent 70%) 0 var(--strip-h,0px)/100% calc(100% - var(--strip-h,0px)) no-repeat,
  radial-gradient(circle,rgba(255,255,255,.07) 1px,transparent 1.5px) 0 0/22px 22px,var(--bg);}
body.no-op #uploadView,body.no-op .preview-stage{background:transparent;flex:1 1 auto;}
body.no-op .preview-stage{min-height:60vh;}
body.no-op .stage-choose{gap:22px;max-width:420px;padding:0 24px;border:0;background:none;text-align:center;}
body.no-op .stage-choose .sc-text{font-size:clamp(20px,4.6vw,28px);font-weight:800;color:var(--text);line-height:1.35;letter-spacing:-.01em;}
body.no-op .stage-choose .btn{min-width:200px;height:46px;padding:0 28px;font-size:14px;font-weight:700;border-radius:999px;justify-content:center;box-shadow:0 10px 28px rgba(255,100,180,.28);}

/* ---------- Fit-everything pass: every language, every screen width ---------- */
/* parameters header: the name gets the whole row when the buttons do not fit beside it (long names in German, Russian ...) */
.rp-head{flex-wrap:wrap;row-gap:8px;}
.rp-title{flex:1 1 150px;min-width:150px;}
.rp-title h2{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.3;}
.rp-title .sub{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;}
.rp-head #checkBtn:not([hidden]){margin-inline-start:auto;}
.rp-head #checkBtn[hidden] + #generateBtn{margin-inline-start:auto;}
.rp-head .btn{flex:none;white-space:nowrap;}
/* template / preset bars: label on its own row until the bar is wide enough for label + list side by side; buttons wrap, never leave the screen */
.pb-line{grid-template-columns:minmax(0,1fr);}
.pb-line .pb-actions{grid-column:1;}
.pb-line label{white-space:normal;flex-wrap:wrap;}
.pb-line .pb-actions .btn{white-space:normal;max-width:100%;text-align:center;height:auto;min-height:30px;}
/* label | list | buttons stay on ONE row as soon as the bar is wide enough for the three (every row placed explicitly, so nothing falls to a second row) */
@container (min-width:380px){
  .pb-line{grid-template-columns:auto minmax(0,1fr) auto;}
  .pb-line > label{grid-column:1;grid-row:1;}
  .pb-line > .pl-select,.pb-line > select{grid-column:2;grid-row:1;min-width:0;}
  .pb-line .pb-actions{grid-column:3;grid-row:1;flex-wrap:nowrap;}
  .pb-line .pb-actions .btn{white-space:nowrap;}
}
/* tags under the canvas and the variables title: never cut */
.limits-line .ll-more,.limits-line .ll-chip{overflow:visible;text-overflow:clip;max-width:100%;}
.vr-title{flex-wrap:wrap;overflow:visible;}
/* phones: the operation's name is already the title of the parameters panel, so the top bar keeps room for its buttons */
@media (max-width:560px){
  .topbar-title{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}
}
@media (max-width:420px){ .pfw-grid{grid-template-columns:minmax(0,1fr) !important;} }
/* a closed dropdown whose text is long shows it on two lines instead of cutting it after a few letters */
.pl-select-label{white-space:normal;line-height:1.2;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:break-word;}
/* dropdowns in the parameters use the whole width of their field, so their text is not squeezed */
#paramsForm .pf-field > .pl-select,#paramsForm .pfw-f > .pl-select{display:block;width:100%;}
#paramsForm .pf-field > .pl-select .pl-select-native,#paramsForm .pfw-f > .pl-select .pl-select-native{width:100%;}
.pf-cert{flex-wrap:wrap;}
.pf-cert > .pl-select{flex:1 1 100%;min-width:0;}
.rp-head #checkBtn,.rp-head #generateBtn{min-width:64px;justify-content:center;}
/* a long operation name wraps (two lines at most) instead of ending in "..." */
.topbar h1{white-space:normal;overflow-wrap:break-word;hyphens:auto;line-height:1.2;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;}
.topbar .sub{white-space:normal;overflow-wrap:anywhere;}
/* operation names in the list wrap instead of ending in "..." */
.tool-item .lbl{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.3;}
/* when the parameters header is too narrow for name + both buttons, the name takes its own row and the two buttons share the next one */
.rp-head{container-type:inline-size;}
@container (max-width:470px){ .rp-title{flex:1 1 100%;} }

/* limits: capsules beyond the visible slots sit behind a "Show more" / "Hide" capsule */
.limits-line [hidden]{display:none !important;}
.limits-line .ll-toggle{display:inline-flex;align-items:center;gap:4px;padding:3px 6px;margin:0 2px;border:0;border-radius:4px;background:none;color:var(--accent);font:inherit;font-size:12px;font-weight:700;cursor:pointer;white-space:nowrap;text-decoration:none;transition:background .12s,color .12s;}
.limits-line .ll-toggle:hover{background:var(--accent-ink-soft);text-decoration:none;color:var(--accent-strong,var(--accent));}
.limits-line .ll-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
.limits-line .ll-toggle svg{flex:none;transition:transform .15s;}
.limits-line .ll-toggle[aria-expanded="true"] svg{transform:rotate(180deg);}
.limits-line .ll-toggle .ll-tg-less,.limits-line .ll-toggle[aria-expanded="true"] .ll-tg-more{display:none;}
.limits-line .ll-toggle[aria-expanded="true"] .ll-tg-less{display:inline;}
.limits-line .ll-title + .hint-btn{margin:0 4px 0 -2px;}
.limits-line .ll-toggle svg{display:none;}

/* ---------- Upload first: the parameters stay hidden until the operation has the files it needs ---------- */
body.await-files:not(.peek) #rightPanel,
body.await-files:not(.peek) #resizeRight{display:none !important;}
body.await-files:not(.peek) .workspace{grid-template-columns:minmax(0,1fr);}
.drop-hero{width:100%;max-width:520px;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center;padding:44px 28px 38px;border:2px dashed var(--border-strong);border-radius:22px;background:linear-gradient(180deg,var(--surface-2),var(--surface));transition:border-color .15s,background .15s,box-shadow .15s;}
.drop-hero[hidden]{display:none;}
#uploadView.dropping .drop-hero{border-color:var(--accent);box-shadow:0 0 0 6px rgba(255,100,180,.12);}
.drop-hero .dh-icon{width:68px;height:68px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--pink-on,#fff);background:linear-gradient(135deg,var(--pink,#ff64b4),var(--blue,#5b8cff));box-shadow:0 10px 28px rgba(255,100,180,.28);margin-bottom:6px;}
.drop-hero .dh-icon svg{width:30px;height:30px;}
.drop-hero .dh-title{font-size:clamp(19px,4.4vw,24px);font-weight:800;letter-spacing:-.01em;color:var(--text);}
.drop-hero .dh-sub{font-size:13px;color:var(--text-muted);line-height:1.5;}
.drop-hero .dh-btn{margin-top:12px;min-width:180px;display:inline-flex;align-items:center;gap:8px;height:46px;padding:0 28px;font-size:14px;font-weight:700;border-radius:999px;justify-content:center;box-shadow:0 10px 28px rgba(255,100,180,.28);}
.drop-hero .dh-btn svg{width:18px;height:18px;flex:none;}
.drop-hero .dh-link{margin-top:4px;border:0;background:none;color:var(--accent);font:inherit;font-size:12.5px;font-weight:700;cursor:pointer;text-decoration:underline;text-decoration-color:transparent;text-underline-offset:3px;}
.drop-hero .dh-link:hover{text-decoration-color:currentColor;}
.await-note{flex:none;margin:0 14px 6px;padding:9px 14px;border-radius:12px;background:var(--blue-soft);color:var(--blue-light);font-size:12.5px;font-weight:600;text-align:center;}
.await-note[hidden]{display:none;}
.thumb.add{transition:border-color .12s,color .12s,background .12s;}
.thumb.add:hover{border-color:var(--accent);color:var(--accent);background:var(--surface-3);}
body:not(.await-files) .drop-strip .thumb.add{font-size:22px;}
/* limit tags explain themselves in the same pop-up as the ? marks */
.limits-line .ll-chip.hint-chip{cursor:help;transition:color .12s,background .12s,border-color .12s;}
.limits-line .ll-chip.hint-chip:hover,.limits-line .ll-chip.hint-chip:focus-visible{color:var(--pink-on);background:var(--accent);border-color:var(--accent);outline:none;}

/* The upload screen never scrolls: the canvas is exactly the visible height under the top bar and the upload card shrinks to fit it (smaller icon,
   padding and text as the screen gets shorter), so the card, the "+" tile and the limits always stay in view. */
:is(body.await-files,body.hero-shown) .canvas-wrap{height:calc(var(--app-h,100vh) - var(--topbar-h,56px)) !important;min-height:0 !important;overflow:hidden !important;display:flex;flex-direction:column;}
:is(body.await-files,body.hero-shown) #uploadView:not([hidden]){flex:1 1 auto;min-height:0;overflow:hidden;}
:is(body.await-files,body.hero-shown) .preview-stage{padding:clamp(8px,2vh,24px) 14px;min-height:0;overflow:hidden;}
:is(body.await-files,body.hero-shown) .limits-line{margin:clamp(4px,1.2vh,10px) 14px clamp(6px,1.6vh,18px);}
:is(body.await-files,body.hero-shown) .drop-strip{padding-top:clamp(8px,1.8vh,16px);padding-bottom:clamp(6px,1.2vh,10px);}
:is(body.await-files,body.hero-shown) .drop-hero{max-height:100%;padding:clamp(14px,4.2vh,44px) clamp(16px,3vw,28px) clamp(14px,3.6vh,38px);gap:clamp(5px,1.1vh,10px);}
:is(body.await-files,body.hero-shown) .drop-hero .dh-icon{width:clamp(40px,8.5vh,68px);height:clamp(40px,8.5vh,68px);margin-bottom:0;}
:is(body.await-files,body.hero-shown) .drop-hero .dh-icon svg{width:50%;height:50%;}
:is(body.await-files,body.hero-shown) .drop-hero .dh-title{font-size:clamp(16px,3.2vh,24px);}
:is(body.await-files,body.hero-shown) .drop-hero .dh-btn{height:clamp(38px,6vh,46px);margin-top:clamp(4px,1.4vh,12px);}
@media (max-height:640px){ :is(body.await-files,body.hero-shown) .drop-hero .dh-sub{font-size:12px;} :is(body.await-files,body.hero-shown) .drop-hero .dh-sub + .dh-sub{display:none;} }
@media (max-height:520px){ :is(body.await-files,body.hero-shown) .drop-hero .dh-sub{display:none;} :is(body.await-files,body.hero-shown) .limits-line .ll-title,:is(body.await-files,body.hero-shown) .limits-line .hint-btn{display:none;} }

/* "Rows per page" (Studio + Customer Portal only): wide enough for a number and its tick on ONE line, and centred under the text on a phone like History's */
.pg-size .pl-select{min-width:96px;}
.pg-size .pl-select-label{display:block;white-space:nowrap;-webkit-line-clamp:unset;}
@media (max-width:560px){ .pg-size{margin-left:auto;margin-right:auto;align-self:center;} }

/* Upload card: the same calm background as "choose an operation" (soft glow + fine dots), and a lighter card on a phone */
:is(body.await-files,body.hero-shown) .canvas-wrap{background:radial-gradient(60% 50% at 18% 12%,rgba(255,100,180,.22),transparent 70%) 0 var(--strip-h,0px)/100% calc(100% - var(--strip-h,0px)) no-repeat,radial-gradient(55% 45% at 88% 92%,rgba(77,163,255,.18),transparent 70%) 0 var(--strip-h,0px)/100% calc(100% - var(--strip-h,0px)) no-repeat,radial-gradient(circle,rgba(255,255,255,.07) 1px,transparent 1.5px) 0 0/22px 22px,var(--bg);}
:is(body.await-files,body.hero-shown) #uploadView,:is(body.await-files,body.hero-shown) .preview-stage{background:transparent;}
:is(body.await-files,body.hero-shown) .drop-hero{background:transparent;}
@media (max-width:600px){
  :is(body.await-files,body.hero-shown) .drop-hero{padding:clamp(12px,3.4vh,28px) 16px clamp(12px,3vh,26px);border-radius:18px;}
  :is(body.await-files,body.hero-shown) .drop-hero .dh-icon{width:clamp(36px,7vh,48px);height:clamp(36px,7vh,48px);}
  :is(body.await-files,body.hero-shown) .drop-hero .dh-title{font-size:clamp(15px,2.8vh,18px);}
  :is(body.await-files,body.hero-shown) .drop-hero .dh-sub{font-size:11.5px;}
  :is(body.await-files,body.hero-shown) .drop-hero .dh-btn{min-width:170px;height:clamp(34px,5vh,38px);padding:0 20px;font-size:12.5px;box-shadow:0 6px 18px rgba(255,100,180,.24);}
  :is(body.await-files,body.hero-shown) .drop-hero .dh-link{font-size:11.5px;margin-top:0;}
}

/* The same dotted background in every phase of the upload screen: no operation, operation chosen, and after the files are added (with the preview) */
body:not(.result-mode) .canvas-wrap{background:radial-gradient(60% 50% at 18% 12%,rgba(255,100,180,.22),transparent 70%) 0 var(--strip-h,0px)/100% calc(100% - var(--strip-h,0px)) no-repeat,radial-gradient(55% 45% at 88% 92%,rgba(77,163,255,.18),transparent 70%) 0 var(--strip-h,0px)/100% calc(100% - var(--strip-h,0px)) no-repeat,radial-gradient(circle,rgba(255,255,255,.07) 1px,transparent 1.5px) 0 0/22px 22px,var(--bg);}
body:not(.result-mode) #uploadView,body:not(.result-mode) .preview-stage{background:transparent;}

/* ---------- The start screen (replaces the operations drawer): goals, search, tool families ---------- */
#opsPanel,#opsBackdrop,#resizeLeft,#opsReopenTab{display:none !important;}
body.result-mode #backBtn{display:none !important;}
body.no-op #noFileHint{width:100%;padding:0;text-align:left;color:var(--text);font-size:14px;}
body.no-op .preview-stage{align-items:flex-start;justify-content:center;padding:0;min-height:0;}
.home{width:100%;max-width:880px;margin:0 auto;padding:34px 24px 48px;box-sizing:border-box;}
.home-h{margin:0 0 6px;font-size:clamp(22px,3.4vw,30px);font-weight:800;letter-spacing:-.02em;}
.home-lead{margin:0 0 18px;color:var(--text-muted);font-size:13.5px;line-height:1.5;}
.home-search{display:flex;align-items:center;gap:10px;background:var(--surface);border:1px solid var(--border-strong);border-radius:12px;padding:5px 5px 5px 14px;}
.home-search input{flex:1;min-width:0;background:none;border:0;outline:0;padding:9px 0;font:inherit;color:var(--text);box-shadow:none;}
.home-search .btn{flex:none;height:36px;padding:0 18px;display:inline-flex;align-items:center;justify-content:center;gap:8px;}
.home-search .hg-ic{display:none;}
/* on a phone the button is a magnifier only, so the typed words get the room */
@media (max-width:600px){ .home-search .btn{width:40px;min-width:40px;padding:0;} .home-search .hg-t{display:none;} .home-search .hg-ic{display:block;} }
.home-sec{font-size:10.5px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:var(--text-faint);margin:24px 0 10px;}
.home-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:10px;}
.home-card{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:14px;color:var(--text);cursor:pointer;transition:border-color .15s,transform .15s;}
.home-card:hover,.home-card:focus-visible{border-color:var(--accent);outline:none;transform:translateY(-1px);}
.home-card .hc-ic{width:34px;height:34px;border-radius:10px;background:var(--pink-soft);color:var(--accent);display:flex;align-items:center;justify-content:center;margin-bottom:8px;}
.home-card .hc-ic svg{width:17px;height:17px;}
.home-card b{font-size:13.5px;font-weight:700;}
.home-card .hc-t{color:var(--text-muted);font-size:12.5px;line-height:1.4;}
.home-fam{display:flex;flex-wrap:wrap;gap:8px;}
.home-chip{display:inline-flex;align-items:center;gap:7px;background:var(--surface);border:1px solid var(--border);border-radius:99px;padding:7px 13px;font:inherit;font-size:12.5px;font-weight:600;color:var(--text-muted);cursor:pointer;}
.home-chip i{font-style:normal;font-size:10.5px;color:var(--text-faint);}
.home-chip:hover{border-color:var(--accent);color:var(--text);}
.home-chip.on{border-color:var(--accent);color:var(--accent);background:var(--pink-soft);}
.home-all{columns:3 230px;column-gap:16px;margin-top:16px;}
.home-grp{break-inside:avoid;margin:0 0 16px;}
.home-gt{display:flex;justify-content:space-between;font-size:10.5px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:var(--text-faint);margin:0 0 6px;}
.home-gt i{font-style:normal;}
.home-op{display:flex;align-items:center;gap:9px;width:100%;background:none;border:0;border-radius:8px;padding:6px 8px;text-align:left;font:inherit;font-size:13px;color:var(--text);cursor:pointer;}
.home-op:hover{background:var(--surface-2);color:var(--accent);}
.home-op svg{width:15px;height:15px;flex:none;color:var(--text-faint);}
.home-empty{padding:16px 0;color:var(--text-muted);font-size:13px;}

.home-hint{margin:8px 2px 0;color:var(--text-muted);font-size:12.5px;line-height:1.5;}
.home-hint code,.home-card .hc-id{font-family:var(--font-mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace);}
.home-hint code{background:var(--surface-2);border:1px solid var(--border);border-radius:6px;padding:0 5px;font-size:11.5px;color:var(--text);}
.home-card{width:100%;}
.home-card .hc-meta{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin-top:auto;padding-top:10px;max-width:100%;}
.home-card .hc-id{font-size:11px;color:var(--text-muted);background:var(--surface-2);border:1px solid var(--border);border-radius:6px;padding:1px 6px;overflow-wrap:anywhere;}
.home-card:hover .hc-id,.home-card:focus-visible .hc-id{color:var(--accent);border-color:var(--accent);}
.home-card .hc-why{font-size:11px;color:var(--accent);}
@media(max-width:560px){.home{padding:22px 14px 34px;}.home-cards{grid-template-columns:1fr;}}

/* profile menu: a little wider, with room for the icons */
.user-menu-panel{width:230px;}
.user-menu-item{padding:9px 10px;gap:10px;}

/* ---------- Parameters: Simple and Advanced ---------- */
.pm-seg{display:flex;background:var(--surface-2);border:1px solid var(--border);border-radius:9px;padding:3px;margin:0 0 12px;}
.pm-seg[hidden]{display:none;}
.pm-seg button{flex:1;background:none;border:0;border-radius:7px;padding:6px;font:inherit;font-weight:700;font-size:12.5px;color:var(--text-muted);cursor:pointer;}
.pm-seg button.on{background:var(--pink-soft);color:var(--accent);}
body.params-simple #paramsForm{display:none;}
body:not(.params-simple) #simpleForm{display:none;}
.sm-form{display:flex;flex-direction:column;gap:16px;}
.sm-field{display:flex;flex-direction:column;gap:6px;}
.sm-label{font-size:12.5px;font-weight:700;display:flex;align-items:center;gap:8px;}
.sm-label .req-star{margin-inline-start:-5px;}   /* the star hugs the label (the row has a gap) */
.sm-help{font-size:11.5px;color:var(--text-faint);line-height:1.4;}
.sm-err{font-size:11.5px;color:var(--danger);font-weight:600;}
.sm-field.has-error .sm-in,.sm-field.has-error .sm-opts{border-color:var(--danger);}
.sm-opts{display:grid;grid-template-columns:repeat(auto-fit,minmax(88px,1fr));gap:6px;}
.sm-opt{background:var(--surface-2);border:1px solid var(--border);border-radius:9px;padding:9px 6px;text-align:center;font:inherit;font-weight:700;font-size:12.5px;color:var(--text);cursor:pointer;line-height:1.25;}
.sm-opt small{display:block;font-weight:500;color:var(--text-faint);font-size:10.5px;margin-top:2px;}
.sm-opt:hover{border-color:var(--border-strong);}
.sm-opt.on{border-color:var(--accent);background:var(--pink-soft);}
.sm-in{width:100%;box-sizing:border-box;background:var(--surface-2);border:1px solid var(--border);border-radius:9px;padding:9px 11px;font:inherit;font-size:13px;color:var(--text);outline:0;}
.sm-in:focus{border-color:var(--accent);}
textarea.sm-in{resize:vertical;min-height:70px;}
textarea.sm-in.sm-big{min-height:150px;} textarea.sm-in.sm-code{min-height:220px;font-family:'IBM Plex Mono',ui-monospace,monospace;font-size:12.5px;line-height:1.55;}
.sm-label{display:flex;align-items:center;gap:8px;}
.sm-label .pf-expand{margin-left:auto;flex:none;width:26px;height:26px;border-radius:7px;border:1px solid var(--border);background:var(--surface-2);color:var(--text-muted);display:inline-flex;align-items:center;justify-content:center;padding:0;cursor:pointer;}
.sm-label .pf-expand svg{width:14px;height:14px;} .sm-label .pf-expand:hover,.sm-label .pf-expand:focus-visible{color:var(--accent);border-color:var(--accent);outline:none;}
.sm-numrow{display:flex;align-items:center;gap:8px;}
.sm-unit{font-size:12px;color:var(--text-faint);white-space:nowrap;}
.sm-quick{display:flex;gap:6px;flex-wrap:wrap;}
.sm-q{background:var(--surface);border:1px solid var(--border);border-radius:99px;padding:3px 10px;font:inherit;font-size:11.5px;color:var(--text-muted);cursor:pointer;}
.sm-q:hover{border-color:var(--accent);color:var(--accent);}
.sm-switch{display:inline-flex;align-items:center;gap:10px;background:none;border:0;padding:0;font:inherit;font-size:12.5px;color:var(--text-muted);cursor:pointer;width:max-content;}
.sm-switch i{width:36px;height:20px;border-radius:99px;background:var(--surface-3);position:relative;transition:background .15s;}
.sm-switch i::after{content:'';position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;transition:transform .15s;}
.sm-switch.on i{background:var(--accent);}
.sm-switch.on i::after{transform:translateX(16px);}
.sm-colorrow{display:flex;gap:8px;align-items:center;}
.sm-color{width:40px;height:36px;padding:2px;border:1px solid var(--border);border-radius:9px;background:var(--surface-2);cursor:pointer;flex:none;}
.sm-details{border:1px solid var(--border);border-radius:10px;padding:0 12px;margin-top:6px;}
.sm-details>summary{cursor:pointer;list-style:none;padding:11px 0;font-size:12.5px;font-weight:700;color:var(--text);display:flex;align-items:center;gap:8px;}
.sm-details>summary::-webkit-details-marker{display:none;}
.sm-details>summary::after{content:'';margin-left:auto;width:7px;height:7px;border-right:2px solid var(--text-faint);border-bottom:2px solid var(--text-faint);transform:rotate(45deg);transition:transform .15s;}
.sm-details[open]>summary::after{transform:rotate(-135deg);}
.sm-details>summary span{font-size:11px;font-weight:700;color:var(--text-faint);background:var(--surface-2);border-radius:999px;padding:1px 7px;}
.sm-details[open]{padding-bottom:4px;}
.sm-more{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--text-faint);border-top:1px solid var(--border);padding-top:12px;margin-top:2px;}
.sm-linkbtn{background:none;border:0;padding:0;font:inherit;font-weight:700;color:var(--accent);cursor:pointer;}
.sm-empty{font-size:12.5px;color:var(--text-muted);}
.home .filter-top{margin:12px 0 10px;}
.home .filter-panel{margin-bottom:6px;}
/* the label and the Filters button share a row; on a phone the label sits on top */
.home-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:24px 0 10px;}
.home-row .home-sec{margin:0;}
.home-row .filter-top{margin:0;}
@media(max-width:560px){.home-row .home-sec{flex:1 1 auto;min-width:0;}.home-row .filter-top{width:auto;flex:none;}}

/* tablets and phones: the language drop-down moves into the profile menu */
@media(max-width:1100px){.topbar [data-h2i-lang-switch]{display:none;}}
.user-menu-panel{width:230px;}
.user-menu-item{padding:9px 10px;gap:10px;}

/* The upload screen and the loading screen are one fixed screen: the page itself cannot be scrolled and it fills the whole visible screen (on an installed
   iPhone app the window is about 55 px shorter than the screen, but the page is drawn all the way down, so --fit-h from app.js is the screen height there).
   Every height inside is taken from it, so the card, the "+" tile and the limits always fit and the background reaches the bottom. */
html:has(body.await-files),html:has(body.hero-shown),html:has(body.running-mode){overflow:hidden !important;overscroll-behavior:none;height:var(--fit-h,100dvh);background:var(--bg);}
body.await-files,body.hero-shown,body.running-mode{--topbar-h:calc(56px + var(--sat,0px));--app-h:var(--fit-h,100dvh);height:var(--fit-h,100dvh);overflow:hidden !important;overscroll-behavior:none;}
body.await-files .shell,body.hero-shown .shell,body.running-mode .shell{height:var(--fit-h,100dvh) !important;min-height:0 !important;overflow:hidden !important;}
/* the loading screen has the same dotted pink and blue background as the upload screen */
body.running-mode .canvas-wrap{height:calc(var(--fit-h,100dvh) - var(--topbar-h,56px)) !important;min-height:0 !important;overflow:hidden !important;display:flex;flex-direction:column;background:radial-gradient(60% 50% at 18% 12%,rgba(255,100,180,.22),transparent 70%) no-repeat,radial-gradient(55% 45% at 88% 92%,rgba(77,163,255,.18),transparent 70%) no-repeat,radial-gradient(circle,rgba(255,255,255,.07) 1px,transparent 1.5px) 0 0/22px 22px,var(--bg);}
body.running-mode .running-view{flex:1 1 auto;height:auto;min-height:0;overflow:hidden;background:transparent;}
/* Before a file is uploaded, the limits sit right under the upload card (card and capsules are centred as one group); after an upload they stay where they were. */
:is(body.await-files,body.hero-shown) #dropStrip{margin-bottom:auto;}
:is(body.await-files,body.hero-shown) #uploadView .preview-stage{flex:0 1 auto;}
:is(body.await-files,body.hero-shown) #uploadView .limits-line{margin-top:clamp(8px,1.6vh,16px);margin-bottom:auto;}
/* the tool-list loader fills the whole canvas under the top bar, so the ring sits in the middle of the dotted background */
#noFileHint:has(.pl-pageload){padding:0;flex:1 1 auto;display:flex;align-self:stretch;}
#noFileHint .pl-pageload{min-height:100%;flex:1;}
body.no-op .preview-stage:has(.pl-pageload){align-items:stretch;min-height:calc(100dvh - var(--topbar-h,56px));}

/* Tools whose upload is optional: the choice and the file sit at the top of the parameters panel (Simple and Advanced share it). */
.input-choice{display:flex;flex-direction:column;gap:6px;margin:0 0 12px;}
.input-choice:not([hidden]){padding-top:2px;}
.ic-seg{display:flex;background:var(--surface-2);border:1px solid var(--border);border-radius:9px;padding:3px;}
.ic-seg button{flex:1;background:none;border:0;border-radius:7px;padding:6px;font:inherit;font-weight:700;font-size:12.5px;color:var(--text-muted);cursor:pointer;}
.ic-seg button.on{background:var(--pink-soft);color:var(--accent);}
.ic-note{font-size:11.5px;color:var(--text-faint);}
body.optional-upload .workspace{grid-template-columns:minmax(0,1fr);}

/* a colour in the Simple tab: the same round swatch and code box as Advanced */
.sm-field .pf-color{display:flex;gap:10px;align-items:center;}
.sm-field .pf-color .sm-in{flex:1;min-width:0;}

/* The Simple tab's colour setting: a grid of ready-made colours (the first one is the default), then Custom, which opens the colour picker. The colour in use has a ring. */
/* Advanced: one circle and the box with the value beside it (color-row.js field()) */
.ca-row{display:flex;align-items:center;gap:10px;width:100%;min-width:0;box-sizing:border-box;}
.ca-row .ca-dot{flex:none;width:40px;height:40px;}
.ca-row .ca-in{flex:1 1 auto;min-width:0;width:100%;box-sizing:border-box;height:40px;font-family:var(--font-mono);}
.sm-colors{display:grid;grid-template-columns:repeat(auto-fill,36px);gap:10px 12px;align-items:center;justify-content:start;width:100%;box-sizing:border-box;}
.sm-cdot{width:36px;height:36px;border-radius:50%;padding:0;cursor:pointer;border:2px solid var(--border-strong,var(--border));background:var(--sw);box-shadow:inset 0 0 0 2px var(--surface);}
.sm-cdot:hover,.sm-cdot:focus-visible{border-color:var(--accent);outline:none;}
.sm-cdot.on{border-color:var(--accent);box-shadow:inset 0 0 0 2px var(--surface),0 0 0 2px var(--accent);}
.sm-cdot.sm-cclear{background:linear-gradient(135deg,transparent 46%,var(--danger,#e5484d) 47% 53%,transparent 54%),conic-gradient(#8a93a6 25%,#5b6477 0 50%,#8a93a6 0 75%,#5b6477 0) 0 0/10px 10px;}
.sm-cpill{grid-column:span 3;display:inline-flex;align-items:center;justify-content:center;gap:8px;height:36px;padding:0 12px;border-radius:999px;border:1px solid var(--border);background:var(--surface-2);color:var(--text);font:inherit;font-weight:700;font-size:12.5px;cursor:pointer;}
.sm-cpill.on{background:var(--pink-soft);color:var(--accent);border-color:var(--accent);}
.sm-cdot-s{width:18px;height:18px;border-radius:50%;border:1px solid var(--border-strong,var(--border));flex:none;background:linear-gradient(var(--sw,transparent),var(--sw,transparent)),conic-gradient(#8a93a6 25%,#5b6477 0 50%,#8a93a6 0 75%,#5b6477 0) 0 0/8px 8px;}

/* "Custom" is an icon in the same row as the colours: a ring of every colour with a pen, which opens the colour picker (it shows the colour chosen when it is not a ready-made one) */
.sm-ccustom{position:relative;display:grid;place-items:center;grid-column:auto;color:var(--text);background:conic-gradient(#ff5252,#ffd740,#69f0ae,#40c4ff,#b388ff,#ff4081,#ff5252) !important;}
.sm-ccustom::before{content:'';position:absolute;inset:4px;border-radius:50%;background:linear-gradient(var(--sw,transparent),var(--sw,transparent)),var(--surface-2,#222632);}
.sm-ccustom svg{position:relative;width:16px;height:16px;filter:drop-shadow(0 0 2px rgba(0,0,0,.6));}
.sm-ccustom.on{color:#fff;}

/* Simple: the controls inside "More settings" had no space between them (an expand button sat right on the field above it) */
.sm-details>.sm-field{margin:0 0 16px;}
.sm-details>.sm-field:first-of-type{margin-top:4px;}
.sm-details>.sm-empty{margin:0 0 12px;}
/* switches for inputs that cannot be sent together (exclusive.js) */
.ex-groups{gap:14px;}
.ex-group{display:flex;flex-direction:column;gap:6px;}
.ex-title{font-size:12.5px;font-weight:700;color:var(--text);}
/* a choice of inputs that cannot be sent together: its switch is drawn inside the parameters, and the field(s) of the chosen choice sit directly below it */
.ex-inline{display:flex;flex-direction:column;gap:6px;margin:0 0 14px;}
.ex-body{display:flex;flex-direction:column;gap:14px;margin-top:8px;}
.ex-body>.ex-slot{display:block;}
.ex-body>.pf-field,.ex-body>.sm-field{margin:0;}
/* the template of Mail Merge, the first parameter */
.tpl-save{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px;}
.tpl-note{font-size:12px;color:var(--text-faint);}
.tpl-lbl{display:block;font-size:12.5px;font-weight:600;margin:0 0 6px;}
.tpl-id{display:flex;align-items:center;gap:8px;margin-top:8px;font-size:12px;flex-wrap:wrap;}
.tpl-id code{overflow-wrap:anywhere;}
.ex-slot select{width:100%;}
/* Preset and Template: two small buttons (saved-bars.js); the bar of the open one shows right below */
.sb-row{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 10px;}
.sb-row[hidden],.sb-pill[hidden],.sb-dot[hidden]{display:none;}
.sb-row.sb-wait{min-height:36px;}
.sb-pill{position:relative;display:inline-grid;place-items:center;width:36px;height:36px;padding:0;border:1px solid var(--border);border-radius:50%;background:var(--surface);color:var(--text-muted);cursor:pointer;}
.sb-pill:hover,.sb-pill.open{color:var(--text);border-color:var(--accent,var(--border));}
.sb-pill .sb-ic{display:grid;place-items:center;}
.sb-pill svg{width:17px;height:17px;}
.sb-pill.open{background:var(--pink-soft);color:var(--accent);border-color:var(--accent);}
.sb-dot{position:absolute;top:-1px;right:-1px;width:9px;height:9px;border-radius:50%;background:var(--accent,#ff2d78);box-shadow:0 0 0 2px var(--surface);}
.preset-bar.sb-shut{display:none;}
@media (max-width:480px){.sb-row{gap:8px;}}

/* ---------- Previews keep their own room: top, bottom and sides, on every screen size ----------
   The page of an inline PDF preview takes the height that is left; its page bar, the note and the limits keep their own space and never overlap. */
:is(body.await-files,body.hero-shown) .preview-stage{padding:clamp(14px,2.4vh,24px) clamp(12px,3vw,24px);}
:is(body.await-files,body.hero-shown) #uploadView .preview-stage:has(#pdfPreviewInline:not([hidden])){flex:1 1 0;min-height:180px;align-items:stretch;}
:is(body.await-files,body.hero-shown) #pdfPreviewInline.pv{display:flex;flex-direction:column;height:100%;min-height:0;max-height:none;overflow:hidden;padding:0;}
:is(body.await-files,body.hero-shown) #pdfPreviewInline.pv .pv-slider{flex:1 1 auto;min-height:0;height:100%;justify-content:center;}
:is(body.await-files,body.hero-shown) #pdfPreviewInline.pv .pv-stage{flex:1 1 auto;height:auto;min-height:120px;}
:is(body.await-files,body.hero-shown) .await-note{margin:0 clamp(12px,3vw,24px) clamp(8px,1.4vh,12px);}
:is(body.await-files,body.hero-shown) #uploadView .limits-line{margin-top:clamp(8px,1.4vh,14px);margin-bottom:auto;padding-bottom:calc(clamp(14px,2.4vh,22px) + env(safe-area-inset-bottom,0px));}   /* auto margin keeps the upload card in the middle; the room under the limits is padding */
#pdfPreviewInline .pv-bar{padding-top:2px;}
#pdfPreviewInline .pv-bar,#pdfPreviewInline .pv-step{cursor:default;}
#pdfPreviewInline .pv-step:not(:disabled){cursor:pointer;}

/* The uploaded files are always ONE row that scrolls sideways; its scrollbar is fully hidden (touch, wheel and trackpad still scroll it). */
.drop-strip{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-ms-overflow-style:none;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;}
.drop-strip::-webkit-scrollbar{display:none;width:0;height:0;}
.drop-strip>*{flex:none;}

/* The inline PDF page and its page bar sit together, centred in the room they have; the circles stay small. */
#pdfPreviewInline.pv .pv-slider{justify-content:center;gap:10px;}
#pdfPreviewInline .pv-step{width:30px;height:30px;}
#pdfPreviewInline .pv-step svg{width:14px;height:14px;}
#pdfPreviewInline .pv-bar{gap:8px;padding-top:0;}
#pdfPreviewInline .pv-count{min-width:56px;font-size:12px;}
@media (max-width:560px){ #pdfPreviewInline .pv-step{width:26px;height:26px;} #pdfPreviewInline .pv-step svg{width:13px;height:13px;} #pdfPreviewInline .pv-count{min-width:48px;font-size:11.5px;} }

/* Tool cards never run past the screen: a long word or id wraps inside its card (a plain 1fr column would grow to the longest word). */
.home-cards{grid-template-columns:repeat(auto-fill,minmax(min(210px,100%),1fr));}
.home-card{min-width:0;max-width:100%;box-sizing:border-box;}
.home-card b,.home-card .hc-t{max-width:100%;overflow-wrap:anywhere;}
@media(max-width:560px){.home-cards{grid-template-columns:minmax(0,1fr);}}
/* Touch: small controls keep their look but get a bigger invisible area to tap, so a finger never lands on the neighbour. */
@media (pointer:coarse){
  .sm-linkbtn,.sm-switch{position:relative;}
  .sm-linkbtn::after,.sm-switch::after{content:'';position:absolute;left:-6px;right:-6px;top:-10px;bottom:-10px;}
}

.limits-line.ll-pending{visibility:hidden;min-height:34px;}
@media (max-width:600px){ .limits-line.ll-pending{min-height:56px;} }

/* ---- tools the plan does not include: shown locked, with the plan that unlocks them (locked-tools.js) -------------------------------------- */
.pl-t0{--pl:var(--text-muted);}
.pl-t1{--pl:#5b8cff;}
.pl-t2{--pl:#d99a14;}
.pl-t3{--pl:#a066ff;}
.pl-t4{--pl:#1fae9a;}
.pl-soon{--pl:var(--text-muted);}
.lk-pill{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:99px;font-size:11.5px;font-weight:700;line-height:1;white-space:nowrap;color:var(--pl,var(--text-muted));background:color-mix(in srgb,var(--pl,var(--text-muted)) 12%,var(--surface));border:1px solid color-mix(in srgb,var(--pl,var(--text-muted)) 45%,transparent);box-shadow:0 1px 8px rgba(0,0,0,.16);}
.lk-pill svg{width:12px;height:12px;flex:none;}
.lk-glyph{font-size:13px;line-height:1;}
.home-card.is-locked{position:relative;overflow:hidden;cursor:pointer;}
/* the whole card sits under a soft dark veil (the text stays readable) and the plan is named at the top right; locked cards have no hover effect */
.home-card.is-locked .hc-ic{filter:grayscale(.85);}
.home-card.is-locked .hc-veil{position:absolute;inset:0;display:flex;align-items:flex-start;justify-content:flex-end;padding:10px;border-radius:inherit;pointer-events:none;background:color-mix(in srgb,var(--bg,#0b0d14) 52%,transparent);}
.home-card.is-locked:hover,.home-card.is-locked:focus-visible{border-color:var(--border);transform:none;}
.home-card.is-locked:focus-visible{outline:2px solid color-mix(in srgb,var(--pl,var(--text-muted)) 60%,transparent);outline-offset:2px;}
.home-card.is-locked:hover .hc-id,.home-card.is-locked:focus-visible .hc-id{color:var(--text-muted);border-color:var(--border);}
.tool-item.is-locked{opacity:.78;}
.tool-item.is-locked .lbl{color:var(--text-muted);}
.tool-item.is-locked .lk-pill{margin-left:auto;padding:3px 8px;font-size:10.5px;box-shadow:none;}
.home-label-locked{color:var(--text-muted);}
/* the panel a locked tool opens */
.lk-modal{display:grid;gap:14px;}
.lk-head{display:flex;gap:12px;align-items:flex-start;}
.lk-head .lk-ic{width:38px;height:38px;flex:none;border-radius:11px;background:var(--pink-soft,var(--surface-2));color:var(--accent);display:flex;align-items:center;justify-content:center;filter:grayscale(.4);}
.lk-head .lk-ic svg{width:18px;height:18px;}
.lk-head b{font-size:14.5px;}
.lk-head p{margin:3px 0 0;color:var(--text-muted);font-size:12.5px;line-height:1.45;}
.lk-state{display:flex;gap:12px;align-items:center;padding:12px 14px;border-radius:12px;color:var(--pl,var(--text));background:color-mix(in srgb,var(--pl,var(--text-muted)) 10%,var(--surface));border:1px solid color-mix(in srgb,var(--pl,var(--text-muted)) 40%,transparent);}
.lk-state .lk-glyph{font-size:24px;width:30px;text-align:center;}
.lk-state .lk-glyph svg{width:22px;height:22px;}
.lk-state b{display:block;font-size:14px;color:var(--text);}
.lk-state span:not(.lk-glyph){font-size:12.5px;color:var(--text-muted);}
.lk-plans{list-style:none;margin:0;padding:0;display:grid;gap:6px;}
.lk-plans li{display:flex;align-items:center;gap:9px;padding:9px 12px;border:1px solid var(--border);border-radius:10px;opacity:.55;color:var(--text);}
.lk-plans li.has{opacity:1;}
.lk-plans li .lk-pn{font-weight:600;font-size:13px;}
.lk-plans li.mine{border-color:var(--accent);}
.lk-plans li .lk-you{font-size:10.5px;font-weight:700;padding:2px 7px;border-radius:99px;background:var(--accent-soft);color:var(--accent);}
.lk-plans li .lk-mark{margin-left:auto;font-weight:700;color:var(--pl,var(--text-muted));}
@media (max-width:560px){.home-card.is-locked .hc-veil{padding:8px;}.lk-pill{font-size:11px;padding:4px 9px;}}

/* ---------- Pages the plan does not have: shown in the menu with a lock; opening one shows a single pop-up on a fixed page (locked-pages.js) ---------- */
.side-link.is-locked,.pwa-tab.is-locked{position:relative;}
.side-link.is-locked > span{opacity:.82;}
.side-link.is-locked::after{content:'';margin-left:auto;width:14px;height:14px;flex:none;opacity:.7;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center/contain no-repeat;}
.pwa-tab.is-locked::after{content:'';position:absolute;top:6px;right:calc(50% - 20px);width:11px;height:11px;background:currentColor;opacity:.75;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center/contain no-repeat;}
/* the page: the same dotted canvas with the pink glow (top left) and the blue glow (bottom right) as the login page and the tool screens; it does not scroll */
.lp-panel{position:absolute;inset:0;height:auto;min-height:0;box-sizing:border-box;overflow:hidden;background:radial-gradient(60% 50% at 18% 12%,rgba(255,100,180,.22),transparent 70%) 0 0/100% 100% no-repeat,radial-gradient(55% 45% at 88% 92%,rgba(77,163,255,.18),transparent 70%) 0 0/100% 100% no-repeat,radial-gradient(circle,rgba(255,255,255,.07) 1px,transparent 1.5px) 0 0/22px 22px,var(--bg);}
.lp-panel[hidden]{display:none;}
.lp-stage{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:clamp(14px,4vh,32px) 16px;box-sizing:border-box;}
.lp-card{position:relative;width:100%;max-width:420px;max-height:100%;overflow:auto;box-sizing:border-box;text-align:center;padding:30px 26px 26px;border-radius:22px;background:var(--surface);border:1px solid var(--border-strong,var(--border));box-shadow:0 24px 70px rgba(0,0,0,.5);scrollbar-width:none;}
.lp-card::-webkit-scrollbar{display:none;}
.lp-lock{position:absolute;top:14px;right:14px;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:var(--pink-soft);color:var(--accent);}
.lp-lock svg{width:15px;height:15px;}
.lp-ic{width:56px;height:56px;margin:0 auto 14px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(135deg,var(--pink),var(--blue,#5b8cff));color:var(--pink-on,#fff);box-shadow:0 10px 28px rgba(255,100,180,.28);}
.lp-ic svg{width:27px;height:27px;}
.lp-card h2{margin:0 0 8px;font-size:21px;font-weight:800;letter-spacing:-.01em;}
.lp-text{margin:0 auto 14px;max-width:34ch;color:var(--text-muted);font-size:13.5px;line-height:1.55;}
.lp-perks{list-style:none;margin:0 0 16px;padding:0;display:flex;flex-wrap:wrap;justify-content:center;gap:6px;}
.lp-perks li{padding:4px 10px;border-radius:99px;background:var(--surface-2);border:1px solid var(--border);color:var(--text);font-size:11.5px;font-weight:600;}
.lp-plan{display:inline-block;margin:0 0 6px;padding:7px 14px;border-radius:12px;background:var(--pink-soft);border:1px solid rgba(255,100,180,.35);color:var(--text);font-size:13px;}
.lp-plan b{color:var(--accent);}
.lp-how{margin:6px 0 16px;color:var(--text-muted);font-size:12.5px;line-height:1.5;}
.lp-actions{display:flex;flex-direction:column;gap:8px;align-items:stretch;}
.lp-actions .btn{justify-content:center;min-height:42px;border-radius:12px;text-decoration:none;}
.lp-note{color:var(--text-muted);font-size:12.5px;}
/* the page is fixed: it fills exactly the area under the top bar (and the demo notice), on every screen size, and nothing scrolls */
body.lp-open .shell{height:var(--app-h,100vh) !important;min-height:0 !important;overflow:hidden !important;}
body.lp-open .main{display:flex;flex-direction:column;height:100% !important;min-height:0 !important;overflow:hidden !important;}
body.lp-open .content{position:relative;flex:1 1 0 !important;min-height:0 !important;height:auto !important;overflow:hidden !important;}
@media (max-height:660px){ .lp-perks{display:none;} .lp-card{padding-top:22px;} .lp-ic{width:46px;height:46px;margin-bottom:10px;} .lp-card h2{font-size:18px;} }
@media (max-width:480px){ .lp-card{padding:26px 18px 20px;} .lp-card h2{font-size:19px;} }

/* The locked-page card on a phone: room on the left and right of the text and of the buttons, so nothing touches the card's edge or the screen's edge. */
@media (max-width:520px){
  .lp-stage{padding:clamp(14px,3vh,24px) 20px;}
  .lp-card{padding:28px 26px 26px;}
  .lp-card h2{font-size:19px;}
  .lp-text,.lp-how{padding:0 4px;overflow-wrap:anywhere;}
  .lp-plan{max-width:100%;box-sizing:border-box;padding:8px 14px;line-height:1.4;}
  .lp-actions{padding:0 2px;}
  .lp-actions .btn{padding-left:16px;padding-right:16px;white-space:normal;line-height:1.3;}
}

/* the trash button of a result: a real touch target on phones (the PWA too), never squeezed out of the row */

/* a number with its unit beside it (Advanced): the box takes the width, the unit stays on one line */
.pf-numunit{display:flex;align-items:center;gap:8px;}
.pf-numunit > input{flex:1 1 auto;min-width:0;}
.pf-unit{flex:none;font-size:12px;color:var(--text-faint);white-space:nowrap;}
.sm-opt{overflow-wrap:anywhere;min-width:0;}

/* the language drop-down in the drawer of a demo visitor (there is no profile menu to hold it): a slim bar just above the footer's divider; shown only where the header one is hidden */
.sidebar>.side-lang{display:none;}
@media(max-width:1100px){html.is-demo .sidebar>.side-lang{display:block;margin:auto 14px 10px;flex:none;}html.is-demo .sidebar>.side-lang+.sidebar-foot{margin-top:0;}}
.sidebar>.side-lang .h2i-lang-btn{width:100%;min-height:34px;height:34px;justify-content:flex-start;gap:8px;padding:0 10px;border-radius:10px;background:var(--surface-2);border:1px solid var(--border-strong);color:var(--text);font-weight:600;}
.sidebar>.side-lang .h2i-lang-btn .h2i-flag,.sidebar>.side-lang .h2i-lang-btn .h2i-flag svg{width:20px;height:13px;}
.sidebar>.side-lang .h2i-lang-btn .h2i-lang-name{display:block;flex:1;max-width:none;text-align:start;font-size:12.5px;}
.sidebar>.side-lang .h2i-lang-btn .h2i-lang-chev{margin-inline-start:auto;opacity:.7;width:12px;height:12px;}

/* a field that holds code (a JSON Schema): monospace, no spell check */
textarea[data-code]{font-family:var(--font-mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace);font-size:12.5px;line-height:1.5;tab-size:2;}

/* a result that is an HTML page: shown as the page it makes, in a sandboxed frame (html-preview.js) */
/* what a run will cost (js/credit-estimate.js) */
.credit-line{margin:10px 14px 0;font-size:12.5px;line-height:1.5;color:var(--text-muted);}
.credit-line[hidden]{display:none;}
.credit-line.warn{padding:9px 12px;border-radius:var(--radius-sm,10px);border:1px solid var(--warn);background:var(--warn-soft);color:var(--text);}
