/* Shared paper treatment for the workbench's secondary screens.
   Keep the album, reader geometry and action handlers in their own modules. */
body.report-studio,body.report-intake-paper{
  --paper:#fffdf8;--paper-ink:#4b2568;--paper-muted:#796b74;--paper-line:#dfd1b7;--paper-gold:#b99957;
}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet){
  color-scheme:light;color:var(--paper-ink);background:var(--paper);border:1px solid #c9b181;border-top:3px solid var(--paper-gold);border-radius:3px;box-shadow:0 20px 80px #2d163c30;scrollbar-width:thin;scrollbar-color:#c9b992 transparent;
}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet)::backdrop{background:#39264c55;backdrop-filter:blur(4px)}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) :is(h2,h3,legend,strong){color:var(--paper-ink)}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) h2{font-weight:700;letter-spacing:0;line-height:1.5}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) :is(label,p,small){color:var(--paper-muted)}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) label{font-size:13px;font-weight:500;line-height:1.7}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) .agent-section-label{color:#917244;font-size:10px;letter-spacing:.16em;opacity:1}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) :is(input,textarea,select){
  min-width:0;max-width:100%;background:var(--paper);color:var(--paper-ink);border:1px solid var(--paper-line);border-radius:2px;font-size:15px;box-shadow:none;color-scheme:light;
}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) :is(input:not([type=checkbox]):not([type=radio]),select){min-height:44px}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) :is(input,textarea)::placeholder{color:#8b7c83;opacity:1}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) :is(input,textarea,select):focus{background:var(--paper);border-color:var(--paper-gold);box-shadow:none}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) :is(input[type=checkbox],input[type=radio]){accent-color:var(--paper-ink);width:18px;height:18px;flex:none}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) input::file-selector-button{padding:8px 12px;margin-right:12px;border:1px solid var(--paper-line);border-radius:2px;background:#f5eedf;color:var(--paper-ink);font:inherit;cursor:pointer}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) :is(button,.button-link,.agent-button){min-height:44px;border-color:var(--paper-line);border-radius:2px;background:transparent;color:var(--paper-ink);font-weight:400;box-shadow:none;text-shadow:none;transform:none}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) :is(button,.button-link,.agent-button):hover{background:#f5eedf;border-color:var(--paper-gold);transform:none}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) :is(.agent-button-primary,.primary,.family-share-primary,.archive-read,[data-save]),body.report-studio .mobile-sheet form button{
  border:1px solid #765280;border-radius:2px;background:linear-gradient(110deg,#543071,#442160);color:#f0dba9;box-shadow:inset 0 0 0 1px #ffffff16;
}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) :is(.agent-button-primary,.primary,.family-share-primary,.archive-read,[data-save]):hover{background:#543071;color:#f0dba9}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) button:disabled{opacity:.45;cursor:not-allowed}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) :is(.agent-button-danger,[data-share-command=revoke],[data-share-command=reset]){color:#984b40;background:#fcf2ed;border-color:#dfbfb2}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) :focus-visible{outline:2px solid var(--paper-gold);outline-offset:3px}
body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) :is(.dialog-close,.sheet-close,.report-login-close){min-width:44px;width:44px;height:44px;padding:0;border:0;border-radius:0;background:transparent;color:#705074;font-size:27px}
body.report-studio .agent-dialog .dialog-heading{gap:18px;border-color:var(--paper-line);padding-bottom:20px;align-items:flex-start}
body.report-studio .agent-dialog .dialog-heading p{margin-top:8px;font-size:13px;line-height:1.8;color:var(--paper-muted)}
body.report-studio .agent-dialog .dialog-actions{position:sticky;bottom:0;z-index:2;gap:12px;flex-wrap:wrap;padding:18px 0 0;margin:24px 0 0;border-top:1px solid var(--paper-line);background:var(--paper);box-shadow:0 -10px 12px var(--paper)}
body.report-studio .agent-dialog .message:empty{display:none}
body.report-studio #institution-settings-dialog{width:min(740px,calc(100% - 40px));max-height:calc(100dvh - 40px);padding:28px 30px 24px}
body.report-studio #institution-settings-dialog h2{font-size:26px}
body.report-studio #institution-settings-dialog .dialog-heading{
  margin:-28px -30px 20px;padding:22px 30px;border-bottom:1px solid #b99958;
  background:repeating-linear-gradient(14deg,#ffffff04 0 .6px,transparent .7px 3px),linear-gradient(110deg,#543071,#442160);
}
body.report-studio #institution-settings-dialog .dialog-heading>div{min-width:0}
body.report-studio #institution-settings-dialog .dialog-heading .agent-section-label{color:#d9be85}
body.report-studio #institution-settings-dialog .dialog-heading h2{color:#f0dba9;font-family:"Noto Serif SC","Songti SC","SimSun",serif;font-weight:500;letter-spacing:.06em}
body.report-studio #institution-settings-dialog .dialog-heading p{color:#e2d3e8}
body.report-studio #institution-settings-dialog .dialog-close{flex-shrink:0;color:#e9ddee;background:transparent}
body.report-studio #institution-settings-dialog .dialog-close:hover{color:#f0dba9;background:#ffffff0d}
body.report-studio #institution-settings-dialog .form-grid{gap:20px}
body.report-studio #institution-settings-dialog .settings-logo-panel{min-width:0;margin:24px 0 0;padding:16px 0 0;border:0;border-top:1px solid var(--paper-line);border-radius:0;background:transparent}
body.report-studio #institution-settings-dialog legend{padding:0 12px 0 0;font-size:16px;font-weight:700}
body.report-studio #institution-settings-dialog .settings-logo-toggle{display:flex;align-items:flex-start;gap:10px;margin:12px 0;line-height:1.8;color:var(--paper-ink)}
body.report-studio #institution-settings-dialog .settings-logo-toggle input{margin:3px 0 0}
body.report-studio #institution-settings-dialog .settings-logo-panel p{font-size:12px;line-height:1.9;color:var(--paper-muted)}
body.report-studio #institution-settings-dialog :is(.settings-rule-panel,.settings-report-option)>p{margin:0 0 2px 28px;padding:0}
body.report-studio #institution-settings-dialog .settings-report-option{border-color:var(--paper-line)}
body.report-studio #institution-settings-dialog #brand-logo-preview{grid-template-columns:110px minmax(0,1fr);gap:20px}
body.report-studio #institution-settings-dialog #brand-logo-image{max-width:110px;max-height:100px;object-fit:contain;background:white}
body.report-studio #institution-settings-dialog #brand-logo-name{overflow-wrap:anywhere}
body.report-studio #institution-settings-dialog #brand-logo-remove{margin-top:8px;padding:6px 12px;font-size:12px}
body.report-studio #studio-create .composer-step{border:1px solid var(--paper-line);border-radius:2px;background:transparent}
body.report-studio #studio-create .composer-step-number{border-color:var(--paper-line);border-radius:2px;background:#f5eedf;color:var(--paper-ink)}
body.report-studio #studio-create .composer-step-copy :is(em,small){color:var(--paper-muted)}
body.report-studio #studio-create .composer{padding:22px 0}
body.report-studio #report-auth-dialog{border:1px solid #c9b181;border-top:3px solid var(--paper-gold);border-radius:3px;background:var(--paper);color:var(--paper-ink)}
body.report-studio #report-auth-dialog h2{color:var(--paper-ink)}
/* Imported text confirmation, report details, deletion and copy fallback. */
body.report-studio #intake-confirm-dialog{--confirm-inset:24px;padding:var(--confirm-inset);border-radius:3px}
body.report-studio #intake-confirm-dialog .dialog-heading{
  margin:calc(-1 * var(--confirm-inset)) calc(-1 * var(--confirm-inset)) 18px;padding:22px var(--confirm-inset);
  border-bottom:1px solid #b99958;background:repeating-linear-gradient(14deg,#ffffff04 0 .6px,transparent .7px 3px),linear-gradient(110deg,#543071,#442160);
}
body.report-studio #intake-confirm-dialog .dialog-heading>div{min-width:0}
body.report-studio #intake-confirm-dialog .dialog-heading .agent-section-label{color:#d9be85}
body.report-studio #intake-confirm-dialog .dialog-heading h2{margin:4px 0 8px;color:#f0dba9;font-family:"Noto Serif SC","Songti SC","SimSun",serif;font-size:22px;font-weight:500;letter-spacing:.06em;line-height:1.5}
body.report-studio #intake-confirm-dialog .dialog-heading p{color:#e2d3e8}
body.report-studio #intake-confirm-dialog .dialog-close{flex-shrink:0;color:#e9ddee;background:transparent}
body.report-studio #intake-confirm-dialog .dialog-close:hover{color:#f0dba9;background:#ffffff0d}
body.report-studio #intake-confirm-dialog .intake-preview{gap:0 24px;background:transparent;border:0;border-bottom:1px solid var(--paper-line)}
body.report-studio #intake-confirm-dialog .intake-preview p{padding:14px 0;background:transparent;border-bottom:1px solid #eee4d3;color:var(--paper-muted)}
body.report-studio #intake-confirm-dialog .intake-preview strong{color:var(--paper-ink);font-size:15px}
body.report-studio #intake-confirm-dialog :is(.creation-settings-preview,.high-cost-warning){border-color:var(--paper-line);border-radius:2px;background:#faf3e5}
body.report-studio #intake-confirm-dialog .creation-settings-grid{border-color:var(--paper-line)}
body.report-studio #intake-confirm-dialog .creation-settings-grid :is(strong,span){color:var(--paper-ink)}
body.report-studio #intake-confirm-dialog .confirm{border-color:var(--paper-line);border-radius:2px;background:transparent;color:var(--paper-ink)}
body.report-studio #intake-confirm-dialog .report-charge-summary{border-color:var(--paper-line);border-radius:2px;background:#faf3e5;color:var(--paper-ink)}
body.report-studio #delete-dialog .danger-copy{color:#984b40}
body.report-studio #studio-archive .archive-details dl{background:transparent;border:0;border-top:1px solid var(--paper-line);border-radius:0}
body.report-studio #studio-archive .archive-details :is(dt,dd){color:var(--paper-muted)}
body.report-studio #studio-archive .archive-details dd{color:var(--paper-ink)}
body.report-studio #studio-archive :is(.sheet-top,.archive-manage,.report-profile-wide){border-color:var(--paper-line)}
body.report-studio #studio-archive .actions .archive-read{border-radius:2px;background:linear-gradient(110deg,#543071,#442160);color:#f0dba9;border:1px solid #765280}
body.report-studio #studio-archive .actions button{border-color:var(--paper-line);border-radius:2px;color:var(--paper-ink)}
body.report-studio #studio-archive .archive-manage .delete{color:#984b40}
body.report-studio .family-share-simple{padding:28px;width:min(540px,calc(100% - 32px));max-height:calc(100dvh - 32px)}
body.report-studio .family-share-simple h2{font-size:23px;margin:0 40px 12px 0;overflow-wrap:anywhere}
body.report-studio .family-share-simple .family-share-close{position:absolute;top:16px;right:16px;min-width:44px;width:44px;height:44px;padding:0;border:0;background:transparent;color:#705074;font-size:27px}
body.report-studio .family-share-simple>p{font-size:13px;line-height:1.8}
body.report-studio .family-share-simple details{margin-top:24px;padding-top:18px;border-top:1px solid var(--paper-line)}
body.report-studio .family-share-simple summary{min-height:44px;color:var(--paper-ink);cursor:pointer}
body.report-studio .family-share-simple .family-share-actions{gap:10px}
body.report-studio .family-share-simple .family-share-actions button{flex:1;white-space:normal;font-size:13px}
body.report-studio .family-share-simple .family-share-copy{display:block;width:100%;margin-top:10px;border:1px solid var(--paper-gold);color:var(--paper-ink)}
body.report-studio .family-share-simple .family-share-copy[data-copied=true]{background:#f5eedf;border-color:#b9975f;font-weight:600}
body.report-studio .family-share-simple [data-copy-setup]{display:block;margin:0 0 14px}
body.report-studio .family-share-simple [data-copy-fallback]{margin-top:14px}
body.report-studio .family-share-simple [data-copy-text]{box-sizing:border-box;width:100%;min-height:110px;resize:vertical;margin-top:6px;padding:10px;font:13px/1.6 ui-monospace,Consolas,monospace;overflow-wrap:anywhere}
body.report-studio .family-share-primary[aria-busy=true]{display:flex;align-items:center;justify-content:center;gap:10px;opacity:1;cursor:wait}
body.report-studio .family-share-primary[aria-busy=true]::before{content:"";width:18px;height:18px;flex:none;border:2px solid #f0dba945;border-top-color:currentColor;border-radius:50%;animation:family-share-spin .85s linear infinite}
body.report-studio .family-poster-dialog{padding:18px;max-height:calc(100dvh - 24px)}
body.report-studio .family-poster-dialog [hidden]{display:none!important}
body.report-studio .family-poster-loading{min-height:clamp(240px,48dvh,400px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;text-align:center;color:var(--paper-muted);font-size:13px;line-height:1.7}
body.report-studio .family-poster-loading strong{font-size:18px;font-weight:500;letter-spacing:.04em}
body.report-studio .family-share-spinner{display:block;width:38px;height:38px;margin-bottom:6px;border:2px solid var(--paper-line);border-top-color:var(--paper-ink);border-radius:50%;animation:family-share-spin .85s linear infinite}
body.report-studio .family-poster-dialog .family-share-actions{display:grid;grid-template-columns:minmax(0,1fr) 76px;align-items:stretch;padding:14px 0 0;border-top:1px solid var(--paper-line);gap:12px;background:var(--paper)}
body.report-studio .family-poster-dialog .family-share-actions button{min-width:0;min-height:64px;padding:10px 8px;border-style:solid;border-width:1px;white-space:nowrap;line-height:1.4}
body.report-studio .family-poster-dialog [data-save]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}
body.report-studio .family-poster-save-label{font-size:16px;line-height:22px}
body.report-studio .family-poster-save-hint{font-size:12px;line-height:18px;letter-spacing:.03em}
body.report-studio .family-poster-dialog [data-retry]{display:block;margin:0 auto 16px}
@keyframes family-share-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){body.report-studio .family-share-primary[aria-busy=true]::before,body.report-studio .family-share-spinner{animation:none}}
body.report-studio .mobile-sheet>header{border-bottom:1px solid var(--paper-line);margin-bottom:12px!important}
body.report-studio .mobile-sheet .mobile-sheet-action{padding:14px 0;border:0;border-bottom:1px solid var(--paper-line);border-radius:0;background:transparent;text-align:left}
body.report-studio .mobile-sheet-content p{color:var(--paper-muted)}
body.report-studio #studio-action-message{border-color:var(--paper-line);border-radius:3px;background:var(--paper);color:var(--paper-ink);box-shadow:0 10px 30px #39264c18}
body.report-studio #studio-action-message :is(p,button){color:var(--paper-ink)}
/* The embedded payment page measures itself; keep the frame border separate. */
body.report-studio .credit-topup-dialog{padding:0;border:1px solid #c9b181;border-top:3px solid var(--paper-gold);border-radius:3px;background:var(--paper)}
body.report-studio .credit-topup-dialog iframe{margin:0;background:var(--paper)}
body.reader-studio #report-auth-dialog{background:#fffdf8;color:#4b2568;border:1px solid #c9b181;border-top:3px solid #b99957;border-radius:3px;box-shadow:0 20px 80px #2d163c30}
body.reader-studio #report-auth-dialog::backdrop{background:#39264c55;backdrop-filter:blur(4px)}
body.reader-studio #report-auth-dialog h2{color:#4b2568}body.reader-studio #report-auth-dialog p{color:#796b74}
body.reader-studio #report-auth-dialog button{min-height:44px;border:1px solid #dfd1b7;border-radius:2px;background:transparent;color:#4b2568}
body.reader-studio #report-auth-dialog .report-login-close{min-width:44px;border:0}
body.reader-studio #report-auth-dialog .agent-button-primary{background:linear-gradient(110deg,#543071,#442160);color:#f0dba9;border-color:#765280}
/* Existing direct form URL remains supported, without introducing another entry. */
html:has(.report-intake-paper){background:#e9e5de;color-scheme:light}
body.report-intake-paper{background:#e9e5de;color:var(--paper-ink);font:14px/1.7 "Microsoft YaHei",sans-serif;--ink:#4b2568;--muted:#796b74;--line:#dfd1b7;--cyan:#4b2568;--cyan-soft:#4b2568}
.report-intake-paper .intake-topbar{background:var(--paper);border-color:var(--paper-line)}
.report-intake-paper .agent-panel{border:1px solid var(--paper-line);border-radius:3px;background:var(--paper);box-shadow:none}
.report-intake-paper .agent-panel::before{display:none}
.report-intake-paper :is(label,legend,.agent-section-label){color:var(--paper-muted)}
.report-intake-paper :is(input,select,textarea){background:var(--paper);color:var(--paper-ink);border-color:var(--paper-line);border-radius:2px}
.report-intake-paper .agent-button{background:var(--paper);color:var(--paper-ink);border-color:var(--paper-line);border-radius:2px;box-shadow:none}
.report-intake-paper .agent-button-primary{background:linear-gradient(110deg,#543071,#442160);color:#f0dba9}
.report-intake-paper :is(fieldset,.confirm){border-color:var(--paper-line);background:transparent;border-radius:2px}
.report-intake-paper :focus-visible{outline:2px solid var(--paper-gold);outline-offset:3px}
body.report-studio .production-notice,body.report-studio .agent-dialog .production-notice,body.report-intake-paper .production-notice{margin:14px 0;padding:12px 16px;border:1px solid #a98a50;background:#4c2864;color:#f0dba9;font-size:14px;line-height:1.6;letter-spacing:.03em}
.production-notice[hidden]{display:none}
body.report-studio [data-open-create]:disabled{opacity:.5;cursor:not-allowed;filter:saturate(.5)}
@media(max-width:760px),(max-width:1024px) and (pointer:coarse){
  body.report-studio #intake-confirm-dialog{--confirm-inset:18px}
  body.report-studio #intake-confirm-dialog .dialog-heading{padding-top:18px;padding-bottom:18px;gap:12px}
  body.report-studio #intake-confirm-dialog .dialog-heading h2{font-size:20px}
  body.report-studio #institution-settings-dialog{width:calc(100% - 24px);max-width:calc(100% - 24px);max-height:calc(100dvh - 24px);padding:20px 18px 16px}
  body.report-studio #institution-settings-dialog h2{font-size:23px}
  body.report-studio #institution-settings-dialog .dialog-heading{margin:-20px -18px 20px;padding:20px 18px;gap:12px}
  body.report-studio #institution-settings-dialog .form-grid{grid-template-columns:1fr;gap:0}
  body.report-studio #institution-settings-dialog #brand-logo-preview{grid-template-columns:76px minmax(0,1fr);gap:12px}
  body.report-studio #institution-settings-dialog #brand-logo-image{max-width:76px}
  body.report-studio .agent-dialog .dialog-actions{gap:10px;bottom:-18px;margin:24px -18px -18px;padding:14px 18px calc(14px + env(safe-area-inset-bottom))}
  body.report-studio #institution-settings-dialog .dialog-actions{bottom:-16px;margin-bottom:-16px}
  body.report-studio .agent-dialog .dialog-actions button{flex:1;min-width:0;white-space:normal;padding:10px 12px}
  body.report-studio :is(.agent-dialog,.family-share-dialog,.mobile-sheet) :is(input:not([type=checkbox]):not([type=radio]),textarea,select){font-size:16px}
  body.report-studio .family-share-simple{padding:22px 18px}
  body.report-studio .family-share-simple h2{font-size:21px}
  body.report-studio .mobile-sheet{border-radius:3px 3px 0 0}
  .report-intake-paper .intake-shell{padding:18px 12px}.report-intake-paper .intake-topbar{padding:16px 12px}.report-intake-paper .form-grid{grid-template-columns:1fr}
}
