/* FILE-O / Unified Tool UX v1 — one action hierarchy across file tools.
   Scoped to existing workspaces; this stylesheet never hides core functionality
   or touches backend processing. Results and special editors retain their own
   preview/editing capabilities. */
:root{
  --fu-accent:#7059df;--fu-accent-deep:#5740bc;
  --fu-ink:#2d2947;--fu-muted:#797187;
  --fu-stroke:#e2dbea;--fu-paper:#fff;
  --fu-soft:#f7f5fd;--fu-radius:13px;
}
body.filelo-unified .ut-heading{margin-bottom:20px}
body.filelo-unified .ut-heading h1{letter-spacing:-.042em}
body.filelo-unified .ut-card{
  border:1px solid var(--fu-stroke);
  border-radius:16px;box-shadow:0 9px 26px rgba(40,28,85,.055);
}
body.filelo-unified .ut-field input:focus-visible,
body.filelo-unified .ut-field select:focus-visible,
body.filelo-unified .ut-field textarea:focus-visible{
  outline:2px solid #a48be8;outline-offset:1px
}
body.filelo-unified .ut-main :is(button,a):focus-visible{
  outline:3px solid #b8a8f0;outline-offset:2px
}
body.filelo-unified .ut-actions.filelo-process-actions{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  margin:17px 0 5px;
}
body.filelo-unified .filelo-process-actions #utStart{
  min-height:44px;min-width:180px;display:inline-flex;
  justify-content:center;align-items:center;
  padding:12px 20px;background:var(--fu-accent);color:white;
  border:1px solid var(--fu-accent);border-radius:10px;
  box-shadow:0 5px 14px rgba(92,73,188,.13);
}
body.filelo-unified .filelo-process-actions #utStart:hover:not(:disabled){
  background:var(--fu-accent-deep);
}
body.filelo-unified .filelo-process-actions label.filelo-mode-label{
  display:flex;gap:9px;align-items:center;font:700 11px/1.4 system-ui;
  color:#615873;
}
body.filelo-unified .filelo-mode-label select{
  border:1px solid #d9d0ea;border-radius:9px;padding:9px 11px;
  background:white;color:#42345f;max-width:240px;
  font:650 11px/1.4 system-ui;outline-offset:2px;
}
body.filelo-unified .fu-output-bar{
  display:flex;align-items:center;justify-content:space-between;
  flex-wrap:wrap;gap:12px 16px;margin:14px 0 2px;
  padding:14px 16px;border:1px solid #dfd7ee;border-radius:13px;
  background:linear-gradient(107deg,#f7f3ff,#fff);
}
body.filelo-unified .fu-output-bar[hidden]{display:none!important}
body.filelo-unified .fu-output-caption{
  display:flex;flex-direction:column;min-width:140px;gap:3px;
}
body.filelo-unified .fu-output-caption strong{font-size:13px;color:#30264a}
body.filelo-unified .fu-output-caption small{
  font-size:10px;line-height:1.4;color:#7d7490;
}
body.filelo-unified .fu-output-actions{
  display:flex;align-items:center;justify-content:flex-end;
  flex-wrap:wrap;gap:9px;min-width:0;
}
body.filelo-unified .fu-output-actions :is(button,a){
  margin:0;min-height:42px;max-width:100%;
  display:inline-flex;align-items:center;justify-content:center;
  padding:10px 16px;border-radius:10px;white-space:normal;
  font:780 12px/1.4 system-ui,sans-serif;text-decoration:none;
  cursor:pointer;box-sizing:border-box;
}
body.filelo-unified .fu-output-actions #utDownload{
  background:var(--fu-accent);color:#fff;border:1px solid var(--fu-accent);
}
body.filelo-unified .fu-output-actions #utDownload:hover{
  background:var(--fu-accent-deep);
}
body.filelo-unified .fu-output-actions #utCopy{
  background:#fff;color:#5d4cb1;border:1px solid #d9cfed;
}
body.filelo-unified .fu-output-actions .ut-share-controls{
  margin:0!important;padding:0!important;border:0!important;
  background:transparent;display:flex;align-items:center;
}
body.filelo-unified .fu-output-actions .ut-share-controls[hidden]{display:none!important}
body.filelo-unified .fu-output-actions .ut-share-button{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:42px;padding:10px 16px;margin:0;
  color:#5c47b5;background:#fff;border:1px solid #cfc1e9;
  font-size:12px;border-radius:10px;white-space:normal;
}
body.filelo-unified .fu-output-actions .ut-share-hint{display:none!important}
body.filelo-unified .fu-output-actions :is([hidden],button[hidden],a[hidden]){
  display:none!important;
}
body.filelo-unified .ut-result{
  padding:17px 18px;background:#fcfbff;border-color:#e7e0f0;
  border-radius:12px;line-height:1.65;
}
body.filelo-unified .ut-preview{max-width:100%;border-radius:12px}
/* Families: file tools, generators, text converters and editable documents. */
body.filelo-unified .doc-ocr-result-actions,
body.filelo-unified .sp-files-actions,
body.filelo-unified .tf-complete-actions,
body.filelo-unified .filelo-result-action-row{
  display:flex;align-items:center;flex-wrap:wrap;gap:10px;
}
body.filelo-unified .doc-ocr-result-actions :is(button,a),
body.filelo-unified .sp-files-actions :is(button,a),
body.filelo-unified .tf-complete-actions :is(button,a),
body.filelo-unified .filelo-result-action-row :is(button,a){
  min-height:43px;border-radius:10px;
}
body.filelo-unified .tf-complete-actions[hidden],
body.filelo-unified .tf-result[hidden],
body.filelo-unified .sp-files-panel[hidden]{display:none!important}
body.filelo-unified .tf-actions{
  margin:12px 0 14px;padding:11px 12px;
}
body.filelo-unified .tf-actions #templateRender{min-height:44px}
body.filelo-unified #templatePreview[hidden]{display:none!important}
body.filelo-unified .tf-result-label{
  display:flex;align-items:center;justify-content:space-between;
}
body.filelo-unified #docOcrResult .doc-ocr-result-actions,
body.filelo-unified #speechResult .sp-files-actions{
  justify-content:flex-end;
}
body.filelo-unified #speechResult .sp-bundle-row{gap:13px}
/* One primary action, other modes are input choices, not duplicate run buttons. */
body.filelo-unified #academicFix[hidden]{display:none!important}
body.filelo-unified .filelo-result-action-row{
  width:100%;justify-content:center;
}
body.filelo-unified #sharePanel.filelo-inline-share[hidden]{display:none!important}
/* Information stays available but never competes visually with main actions. */
body.filelo-unified .ut-grid>.ut-help{background:linear-gradient(160deg,#fff,#fbfaff)}
body.filelo-unified .ut-guide-entry{font-size:11px;padding:9px 12px}
@media(max-width:760px){
 body.filelo-unified .fu-output-bar{padding:12px;gap:10px}
 body.filelo-unified .fu-output-caption{width:100%}
 body.filelo-unified .fu-output-actions{
   width:100%;justify-content:stretch;gap:8px;
 }
 body.filelo-unified .fu-output-actions>#utDownload,
 body.filelo-unified .fu-output-actions>.ut-share-controls{
   flex:1 1 44%;min-width:0;
 }
 body.filelo-unified .fu-output-actions>.ut-share-controls .ut-share-button{width:100%}
 body.filelo-unified .fu-output-actions>#utCopy{flex:1 1 100%}
 body.filelo-unified .ut-actions.filelo-process-actions{gap:9px}
 body.filelo-unified .ut-actions.filelo-process-actions #utStart{flex:1 1 100%}
 body.filelo-unified .filelo-mode-label{flex:1 1 100%}
 body.filelo-unified .filelo-mode-label select{flex:1;max-width:none}
}
@media(prefers-reduced-motion:reduce){
 body.filelo-unified .ut-main *{scroll-behavior:auto!important}
}

/* Speech has three valid export formats but only ONE download action.
   Existing native export handlers stay in the DOM and execute on selection. */
body.filelo-unified .sp-results .ut-actions{
 display:flex;align-items:center;flex-wrap:wrap;gap:8px;
 padding:12px 14px;margin:15px 0;
 border:1px solid #e0d8f0;border-radius:12px;
 background:linear-gradient(110deg,#f9f6ff,#fff);
}
body.filelo-unified .sp-results .fu-native-export-hidden{display:none!important}
body.filelo-unified .fu-speech-format-label{
 display:flex;align-items:center;gap:8px;
 color:#615879;font:720 11px/1.4 system-ui,sans-serif;
}
body.filelo-unified .fu-speech-format-label select{
 min-height:40px;max-width:190px;
 border:1px solid #d8cfeb;border-radius:9px;padding:9px 11px;
 background:#fff;color:#3e315e;
 font:650 12px/1.4 system-ui,sans-serif;
}
body.filelo-unified .sp-results #fuSpeechDownload{
 min-height:40px;padding:9px 17px;
 border-radius:9px;background:#7059df;color:white;
 border:1px solid #7059df;
}
body.filelo-unified .sp-results #speechCopy{
 min-height:40px;background:white;color:#6452b5;
 border:1px solid #d9cfec;
}
body.filelo-unified .sp-results :is(#fuSpeechDownload,.fu-speech-format-label)[hidden]{
 display:none!important;
}
@media(max-width:620px){
 body.filelo-unified .sp-results .ut-actions{gap:7px;padding:11px}
 body.filelo-unified .fu-speech-format-label{flex:1 1 100%}
 body.filelo-unified .fu-speech-format-label select{max-width:none;flex:1}
 body.filelo-unified .sp-results #fuSpeechDownload,
 body.filelo-unified .sp-results #speechCopy{flex:1 1 40%}
}

/* The original /tools/* SPA: common dimensions and interaction feedback,
   while leaving PDF forms, images, AI, video and specialized editors intact. */
body.filelo-unified #toolPage .tool-header{
  margin-bottom:22px;
}
body.filelo-unified #toolPage .tool-header h1{
  font-size:clamp(25px,3vw,33px);letter-spacing:-.04em;
}
body.filelo-unified #toolPage .workspace-main{
  border:1px solid var(--fu-stroke);
  border-radius:16px;box-shadow:0 10px 30px rgba(40,28,85,.045);
  padding:26px 29px;
}
body.filelo-unified #toolPage .panel-heading{margin-bottom:16px}
body.filelo-unified #toolPage .panel-heading h2{font-size:18px}
body.filelo-unified #toolPage .dropzone{
  min-height:190px;background:#faf9ff;
  border-radius:13px;
}
body.filelo-unified #toolPage .dropzone:focus-visible{
  outline:3px solid #baaaef;outline-offset:3px;
}
body.filelo-unified #toolPage .action-area{margin-top:20px;gap:12px}
body.filelo-unified #toolPage .action-area .primary-button{
  min-height:45px;justify-content:center;
  border-radius:10px;padding:11px 18px;
  box-shadow:0 5px 14px rgba(92,73,188,.15);
}
body.filelo-unified #toolPage .action-area .primary-button:hover:not(:disabled){
  background:var(--fu-accent-deep);
}
body.filelo-unified #toolPage #resultBox{
  padding:28px 18px 30px;
}
body.filelo-unified #toolPage .result-illustration{
  width:61px;height:61px;font-size:28px;margin-bottom:13px;
}
body.filelo-unified #toolPage #resultBox h2{font-size:23px}
body.filelo-unified #toolPage #resultBox>p{margin-bottom:19px}
body.filelo-unified #toolPage .filelo-result-action-row{
  display:flex;align-items:stretch;justify-content:center;
  gap:9px;flex-wrap:wrap;margin:14px 0;
}
body.filelo-unified #toolPage .filelo-result-action-row :is(a,button){
  min-height:44px;max-width:100%;
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:10px;font-weight:800;
}
body.filelo-unified #toolPage .filelo-result-action-row .result-share-plus-open{
  background:#fff;color:#6550ba;border:1px solid #d0c4ee;
}
body.filelo-unified #toolPage .filelo-result-action-row .result-share-plus-open:hover{
  background:#f4efff;
}
body.filelo-unified #toolPage .result-share-plus.filelo-inline-share{
  background:#fbfaff;
}
@media(max-width:800px){
 body.filelo-unified #toolPage .workspace-main{padding:19px 16px}
 body.filelo-unified #toolPage .dropzone{min-height:165px}
 body.filelo-unified #toolPage #resultBox{padding:23px 10px}
}

/* Compact pipeline: input → one process action → ready Download and Share.
   The result preview remains below, not the place to hunt for controls. */
body.filelo-unified .fu-workflow-row{
 display:flex;align-items:center;flex-wrap:wrap;gap:9px 11px;
 margin:13px 0 11px;min-height:48px;
}
body.filelo-unified .fu-workflow-row .fu-output-bar{
 width:auto;min-height:0;min-width:0;margin:0;
 padding:0;border:0;background:transparent;box-shadow:none;
 display:inline-flex;align-items:center;gap:9px;
}
body.filelo-unified .fu-workflow-row .fu-output-bar[hidden]{
 display:none!important;
}
body.filelo-unified .fu-workflow-row .fu-output-caption{display:none}
body.filelo-unified .fu-workflow-row .fu-output-actions{
 display:inline-flex;align-items:center;justify-content:flex-start;gap:8px;
}
body.filelo-unified .fu-workflow-row .fu-output-actions>button,
body.filelo-unified .fu-workflow-row .fu-output-actions>.ut-share-controls button{
 min-height:45px;min-width:105px;padding:11px 16px;
}
body.filelo-unified .fu-workflow-row .fu-output-actions .ut-share-controls{
 display:inline-flex!important;align-items:center;
}
body.filelo-unified .fu-workflow-row .fu-output-actions .ut-share-controls[hidden]{
 display:none!important;
}
body.filelo-unified .fu-workflow-row .fu-template-completed{
 display:flex;align-items:center;gap:9px;
 flex-wrap:wrap;padding:0;margin:0;
 background:transparent;border:0;
 min-height:0;
}
body.filelo-unified .fu-workflow-row .fu-template-completed[hidden]{
 display:none!important;
}
body.filelo-unified .fu-workflow-row .fu-template-completed>button,
body.filelo-unified .fu-workflow-row .fu-template-completed .ut-share-button{
 min-height:44px;font-size:12px;margin:0;white-space:normal;
}
body.filelo-unified .fu-pipeline-result[hidden]{display:none!important}
body.filelo-unified #toolPage .fu-workflow-row .filelo-result-action-row{
 display:flex;align-items:center;justify-content:flex-start;
 gap:9px;flex-wrap:wrap;width:auto;margin:0;
}
body.filelo-unified #toolPage .fu-workflow-row .filelo-result-action-row[hidden]{
 display:none!important;
}
body.filelo-unified #toolPage .fu-workflow-row .filelo-result-action-row :is(a,button){
 min-height:45px;align-self:stretch;white-space:normal;
}
body.filelo-unified #toolPage .fu-workflow-row .helper-caption{
 flex-basis:100%;order:10;margin:0;line-height:1.4;
}
body.filelo-unified .sp-upload .fu-speech-flow-actions{
 display:flex;align-items:center;flex-wrap:wrap;gap:9px;
 margin:11px 0 0;padding:0;border:0;background:transparent;
}
body.filelo-unified .sp-upload .fu-speech-flow-actions[hidden]{
 display:none!important;
}
body.filelo-unified .sp-upload .fu-speech-flow-actions label{margin:0}
body.filelo-unified .sp-upload .fu-speech-flow-actions>button{
 min-height:44px;padding:10px 15px;
}
body.filelo-unified .sp-upload .fu-speech-flow-actions #fuSpeechShare{
 background:#fff;color:#624ec1;border:1px solid #d9cdec;
}
body.filelo-unified .sp-upload .fu-speech-flow-actions #fuSpeechDownload{
 background:#7059df;color:#fff;border:1px solid #7059df;
}
body.filelo-unified .sp-bundle-row>.sp-files-actions{display:none}
body.filelo-unified .doc-ocr-input>.doc-ocr-result-actions{
 display:flex;align-items:center;flex-wrap:wrap;gap:9px;
 margin:12px 0 7px;
}
body.filelo-unified .doc-ocr-input>.doc-ocr-result-actions[hidden]{
 display:none!important;
}
@media(max-width:760px){
 body.filelo-unified .fu-workflow-row{gap:8px}
 body.filelo-unified .fu-workflow-row .fu-output-actions{width:auto;flex-wrap:wrap}
 body.filelo-unified .fu-workflow-row #utStart{flex:1 1 100%}
 body.filelo-unified .fu-workflow-row .fu-output-bar{flex:1 1 100%}
 body.filelo-unified .fu-workflow-row .fu-output-actions>button,
 body.filelo-unified .fu-workflow-row .fu-output-actions>.ut-share-controls{
  flex:1 1 43%;min-width:0;
 }
 body.filelo-unified .fu-workflow-row .fu-template-completed{width:100%;gap:7px}
 body.filelo-unified .fu-workflow-row .fu-template-completed>button,
 body.filelo-unified .fu-workflow-row .fu-template-completed>.ut-share-controls{
  flex:1 1 43%;min-width:0;
 }
 body.filelo-unified .sp-upload .fu-speech-flow-actions{gap:8px}
 body.filelo-unified .sp-upload .fu-speech-flow-actions>.fu-speech-format-label{
  flex:1 1 100%;
 }
 body.filelo-unified #toolPage .fu-workflow-row .filelo-result-action-row{
  flex:1 1 100%;
 }
 body.filelo-unified #toolPage .fu-workflow-row .filelo-result-action-row :is(a,button){
  flex:1 1 42%;min-width:0;
 }
}

/* One-click private result-sharing modal with ready link + QR. */
.filelo-share-ready-dialog{
 width:min(540px,calc(100vw - 28px));
 max-height:min(89dvh,760px);overflow:auto;
 box-sizing:border-box;border:1px solid #dcd5f0;
 border-radius:18px;padding:21px 22px;background:white;
 box-shadow:0 25px 75px rgba(26,18,63,.27);
 color:#30294d;
}
.filelo-share-ready-dialog::backdrop{background:rgba(19,12,46,.62)}
.filelo-share-ready-dialog[open]{
 display:flex;flex-direction:column;gap:9px;
}
.filelo-share-dialog-head{
 display:flex;justify-content:space-between;align-items:center;gap:12px;
}
.filelo-share-dialog-head h2{
 font-size:20px;line-height:1.3;margin:0;letter-spacing:-.03em;
}
.filelo-share-dialog-close{
 width:36px;height:36px;min-height:36px;
 display:grid;place-items:center;flex:none;
 border:1px solid #e7def3;border-radius:9px;
 background:#fff;color:#6454a8;font-size:22px;cursor:pointer;
}
.filelo-share-ready-dialog .result-share-plus-controls{
 margin:0;padding:0;border:0;
}
.filelo-share-ready-dialog .share-ready{
 margin-top:7px;padding:0;border:0;
}
.filelo-share-ready-dialog .share-qr-info{
 display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;
}
.filelo-share-ready-dialog #shareQrCanvas{
 width:175px;height:175px;flex-basis:175px;
}
.filelo-share-ready-dialog .share-forward-button{
 min-height:40px;border:1px solid #cfc2eb;border-radius:9px;
 color:#5945af;background:#f5f0ff;
 padding:9px 15px;cursor:pointer;font:780 12px/1.3 system-ui;
}
.filelo-share-ready-dialog .share-forward-button:hover{background:#ebe2ff}
.filelo-share-ready-dialog .share-create-button[hidden],
.filelo-share-ready-dialog .share-password-label[hidden]{
 display:none!important;
}
@media(max-width:520px){
 .filelo-share-ready-dialog{padding:17px}
 .filelo-share-ready-dialog .share-qr-info{flex-direction:column;align-items:center}
 .filelo-share-ready-dialog .share-qr-info>div{text-align:center}
 .filelo-share-ready-dialog .share-link-row{flex-wrap:wrap}
 .filelo-share-ready-dialog .share-link-row>input{flex:1 1 100%}
}

/* Standalone share dialogs: ready QR and link, no second Create step. */
.ut-share-qr-row{
 display:flex;align-items:center;gap:15px;justify-content:center;
 margin:3px 0 15px;flex-wrap:wrap;
}
.ut-share-qr{
 width:192px;height:192px;flex:0 0 192px;
 border:6px solid white;border-radius:11px;
 box-shadow:0 4px 17px rgba(51,35,103,.13);
}
.ut-share-qr-row p{
 flex:1 1 130px;font-size:12px;line-height:1.55;
 color:#625980;margin:0;
}
.ut-share-result{flex-wrap:wrap}
.ut-share-result .ut-share-url{flex:1 1 100%}
.ut-share-result .ut-share-forward{flex:1 1 auto}
.ut-share-result>.ut-share-copy{flex:1 1 auto}
.ut-share-forward{
 border:1px solid #d7cbef;border-radius:9px;background:#f5f1fe;
 color:#5a48ae;padding:10px 13px;cursor:pointer;
 font:750 11px/1.3 system-ui;
}
.ut-share-upgrade{
 background:#f6f2ff;border:1px solid #e4daf5;padding:14px;
 border-radius:11px;line-height:1.55;font-size:12px;color:#514470;
}
.ut-share-upgrade[hidden],.ut-share-submit[hidden],
.ut-share-label[hidden]{display:none!important}
@media(max-width:530px){
 .ut-share-qr-row{flex-direction:column}
 .ut-share-qr-row p{text-align:center}
}

/* The shared PDF workflow lives outside the upload stage so that it is
   still visible after that stage is hidden when a result is ready. */
body.filelo-unified #toolPage .fu-main-flow[hidden]{display:none!important}
body.filelo-unified #toolPage .fu-main-flow{
 position:relative;z-index:3;
 margin:12px 0 16px;padding:11px 13px;
 border:1px solid #e1d8f1;background:linear-gradient(110deg,#f8f5ff,#fff);
 border-radius:12px;box-shadow:0 6px 18px rgba(40,28,88,.06);
 display:flex;align-items:center;flex-wrap:wrap;gap:9px;
 scroll-margin-top:82px;
}
body.filelo-unified #toolPage .fu-main-flow>button[hidden],
body.filelo-unified #toolPage .fu-main-flow .helper-caption[hidden]{display:none!important}
body.filelo-unified #toolPage .fu-main-flow .fu-pipeline-result[hidden]{display:none!important}
body.filelo-unified #toolPage .fu-main-flow .fu-pipeline-result{
 display:flex;align-items:center;gap:8px;
 margin:0;padding:0;border:0;
}
body.filelo-unified #toolPage .fu-main-flow .fu-pipeline-result>a,
body.filelo-unified #toolPage .fu-main-flow .fu-pipeline-result>button{
 min-height:44px;padding:9px 16px;margin:0;
 white-space:normal;border-radius:10px;
}
@media(max-width:620px){
 body.filelo-unified #toolPage .fu-main-flow{gap:8px;padding:10px}
 body.filelo-unified #toolPage .fu-main-flow .fu-pipeline-result{
  flex:1 1 100%;
 }
 body.filelo-unified #toolPage .fu-main-flow .fu-pipeline-result>a,
 body.filelo-unified #toolPage .fu-main-flow .fu-pipeline-result>button{
  flex:1 1 40%;min-width:0;
 }
}

/* Reuse the same inline send/QR presentation on transcript sharing. */
body.filelo-unified #speechShareModal #speechShareReady[hidden]{display:none!important}
body.filelo-unified #speechShareModal #speechShareQR{
 border:6px solid white;box-shadow:0 4px 17px rgba(39,28,90,.15);
 border-radius:10px;
}
