/* Quiet upper hierarchy. Options/words retained; 16px type / 44px touch floor. */
body.sl-simple header{padding-top:4px;padding-bottom:4px;border-bottom-color:#eceaf2;}
body.sl-simple header .start-guide-entry{border:0;background:transparent;min-height:44px;font-size:16px!important;font-weight:400;padding-inline:8px;}
body.sl-simple header .history-toggle{border:0;background:transparent;min-height:44px;font-size:16px!important;font-weight:400;padding-inline:8px;}
body.sl-simple .r4-types{padding-bottom:4px!important;border-bottom:1px solid #e7e4ef!important;}
body.sl-simple .r4-strip{padding-top:0!important;padding-bottom:0!important;gap:2px!important;}
body.sl-simple .r4-strip .r4-chip{font-size:16px!important;min-height:44px;min-width:44px;border:0!important;border-radius:8px!important;background:transparent!important;padding:0 10px!important;font-weight:400!important;}
body.sl-simple .r4-strip .r4-chip[aria-pressed=true]{background:#f2f1ff!important;font-weight:700!important;border-bottom:2px solid #6b6af6!important;}
body.sl-simple .r4-types .r4-all{width:auto!important;max-width:calc(100% - 24px);margin:0 12px!important;border:0!important;min-height:44px!important;padding:0 6px!important;font-weight:400!important;justify-content:flex-start!important;background:transparent!important;}
body.sl-simple .r4-all svg{width:16px!important;height:16px!important;}
body.sl-simple details.privacy-d{border:0;background:none;box-shadow:none;padding:4px 0 0;}
body.sl-simple details.privacy-d>summary{border:0;border-radius:0;background:none;min-height:44px;padding:0 4px;font-size:16px;}
body.sl-simple details.privacy-d .hint{font-size:16px;line-height:1.5;margin:8px 0;}
body.sl-simple .series-add-current{min-height:44px;min-width:44px;font-size:16px;}
body.sl-simple .history-panel{border:0;box-shadow:none;border-radius:0;padding:12px 16px;background:#fff;}
body.sl-simple .history-panel>.hint{font-size:16px;line-height:1.5;margin:8px 0 12px;}
/* Real save failure stays visible; routine privacy copy stays secondary. */
body.sl-simple .draft-save-error{position:fixed;z-index:55;bottom:calc(126px + env(safe-area-inset-bottom));left:12px;right:12px;margin:0;padding:10px 12px;border-inline-start:3px solid #8f2032;background:#fff9f2;color:#8f2032;font-size:16px;line-height:1.5;box-shadow:0 2px 12px #58484022;}
@media(min-width:900px){body.sl-simple .draft-save-error{max-width:600px;left:50%;right:auto;transform:translateX(-50%);width:calc(100% - 24px);}}
@media(max-width:359px){body.sl-simple header{display:grid;grid-template-columns:1fr auto;gap:0 8px;}body.sl-simple header>.wordmark{grid-column:1;grid-row:1 / span 2;justify-self:start;}body.sl-simple header>.start-guide-entry{grid-column:2;grid-row:1;min-height:44px;padding:0 4px;font-size:16px!important;}body.sl-simple header>.history-toggle{grid-column:2;grid-row:2;min-height:44px;padding:0 4px;font-size:16px!important;}}
/* At narrow phones the utility row is deliberate, not a stranded wrap. */
@media(max-width:359px){body.sl-simple header{grid-template-columns:1fr 1fr;column-gap:8px;row-gap:0;}body.sl-simple header>.wordmark{grid-column:1 / -1;grid-row:1;justify-self:center;}body.sl-simple header>.start-guide-entry{grid-column:1;grid-row:2;justify-self:stretch;}body.sl-simple header>.history-toggle{grid-column:2;grid-row:2;justify-self:stretch;}}
/* Hidden native file input must not widen the page when history opens. */
body.sl-simple .history-panel .sl-file-in{position:absolute!important;width:1px!important;min-width:0!important;height:1px!important;min-height:0!important;padding:0!important;margin:0!important;overflow:hidden!important;clip-path:inset(50%);}
/* Private upper-study: same controls and words, flatter utility styling. */
body.sl-simple header .start-guide-entry{border:0!important;background:transparent!important;box-shadow:none!important;border-radius:0!important;}
body.sl-simple .sl-hello{padding-top:0!important;padding-bottom:0!important;}
@media(max-width:359px){body.sl-simple header{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:0;padding-inline:12px;}body.sl-simple header>.wordmark{flex:0 0 100%;display:flex;justify-content:center;}body.sl-simple header>.start-guide-entry,body.sl-simple header>.history-toggle{flex:1 1 45%;min-height:44px;}}
body.sl-simple .sl-hello{margin-top:0!important;margin-bottom:0!important;}
body.sl-simple .r4-types{padding-top:0!important;}
/* Keep the existing import label, action and filename on readable rows. */
body.sl-simple .history-panel .backup-import{display:grid;gap:6px;justify-items:start;max-width:100%;}
body.sl-simple .history-panel .backup-import .sl-file-btn{max-width:100%;}
body.sl-simple .history-panel .backup-import .sl-file-st{margin-inline-start:0;max-width:100%;overflow-wrap:anywhere;}
body.sl-simple .history-panel .backup-import{flex-basis:100%;align-self:flex-start;}
/* Same approved resume words, surfaced only while the editor is off screen. */
body.sl-simple .r4-draft.sl-resume-visible{position:fixed;z-index:54;bottom:calc(126px + env(safe-area-inset-bottom));left:12px;right:12px;margin:0;min-height:44px;font-size:16px!important;background:#f2f1ff!important;border:1px solid #6b6af6!important;border-radius:8px;padding:8px 12px;box-shadow:0 2px 12px #14235022;}
@media(min-width:700px){body.sl-simple .r4-draft.sl-resume-visible{max-width:600px;left:50%;right:auto;width:calc(100% - 24px);transform:translateX(-50%);}}
body.sl-simple .r4-draft:not(.sl-resume-visible){display:block;min-height:44px;width:100%;padding:8px 12px;border:0!important;border-radius:8px;background:#f2f1ff!important;text-align:center;font-size:16px!important;}
body.sl-simple .loading{position:fixed;left:12px;right:12px;bottom:126px;z-index:55;width:auto!important;max-width:600px;margin:0 auto;padding:12px;box-sizing:border-box;font-size:16px!important;line-height:1.5;display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:#fff9f2;border-radius:8px;box-shadow:0 2px 10px #58484020;}
body.sl-simple .loading span{flex:1 1 160px;}body.sl-simple .loading button{min-width:44px;min-height:44px;font-size:16px!important;}
body.sl-simple .loading{transform:none!important;}
/* Private study: fixed recovery/output area has an opaque explicit boundary. */
.sl-recovery-dock{display:none;position:fixed;z-index:53;left:0;right:0;bottom:0;height:calc(182px + env(safe-area-inset-bottom));background:white;border-top:1px solid #e7e4ef;}
body:has(.r4-draft.sl-resume-visible)>.sl-recovery-dock{display:block;}
body.sl-simple .r4-bar{z-index:54!important;}
body.sl-simple:has(.r4-draft.sl-resume-visible){padding-bottom:220px!important;}
.sl-dock-obscured{opacity:0!important;pointer-events:none!important;}

/* Private action study: edit lives beside size, without adding another row. */
body.sl-simple .r4-bar.sl-out .sl-size{flex:1 1 0;min-width:0;width:auto;gap:0;}
body.sl-simple .r4-bar.sl-out .sl-size button{padding-inline:4px!important;min-width:44px!important;font-size:16px!important;}
body.sl-simple .r4-bar.sl-out .sl-dock-edit{flex:0 0 64px!important;min-width:64px;min-height:44px;height:44px;padding:0 8px!important;font-size:16px!important;background:white!important;color:#142350!important;border:1px solid #142350!important;border-radius:8px!important;}
body.sl-simple .r4-bar.sl-out .r4-wa{flex:1 1 50%!important;}
body.sl-simple .r4-bar.sl-out{display:grid!important;grid-template-columns:minmax(0,1fr) 90px;gap:6px 12px!important;}
body.sl-simple .r4-bar.sl-out .sl-size{width:100%!important;min-width:0!important;height:44px;}
body.sl-simple .r4-bar.sl-out .sl-dock-edit{width:90px!important;}
body.sl-simple .r4-bar.sl-out .r4-wa,body.sl-simple .r4-bar.sl-out .r4-dl{width:100%!important;min-width:0!important;}

body.sl-simple .r4-bar.sl-out .sl-dock-edit-slot{width:90px;height:44px;}
body.sl-simple>.sl-early-edit{position:fixed;z-index:54;min-width:44px;min-height:44px;padding:0 8px;font-size:16px;background:white;color:#142350;border:1px solid #142350;border-radius:8px;}
body.sl-simple>.sl-early-edit[hidden]{display:none!important;}
body.sl-simple>.sl-early-edit{z-index:55;}
/* Private short-height sheet study: preserve preview only when real body room remains. */
body.sl-simple .sl-sheet{top:min(clamp(300px,46vh,340px),max(12px,calc(100dvh - 480px)));}
body.sl-simple .sl-sheet-hd,body.sl-simple .sl-sheet-tabs{flex-shrink:0;}
body.sl-simple .sl-sheet-body{min-height:0;}

/* layout-repair branch (2026-10-23): post-export toast spans the full bar row in the grid */
.structure .r4-bar .r4-toast{grid-column:1 / -1}

/* layout-repair branch (2026-10-23): at <=359px let the wrapped utility-row design take effect.
   v29 (simple.css) forces header flex-wrap:nowrap !important up to 380px, which overrides the
   <=359px wrapped layout above and pushes the utility buttons off-screen (RTL negative x),
   widening the page (scrollWidth 492 at 320). One row is kept at 360-380px where it fits. */
@media (max-width: 359px){ body.sl-simple header{ flex-wrap: wrap !important; } }

/* editor-batch repair (2026-10-23): dock grid - guard text spans full row below the format row
   (flex-era order:-1 had placed it in the wide first column, pushing .r4-fmt into the 90px
   column and its third format button off-screen at 390 and 320); download button spans full
   row, restoring its authored width:100% intent instead of a squeezed 90px grid cell. */
body.sl-simple .r4-bar.sl-out .r4-why{grid-column:1/-1;order:0;}
body.sl-simple .r4-bar.sl-out{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);}
body.sl-simple .r4-bar.sl-out .sl-dock-edit-slot{justify-self:start;}

/* editor-batch repair (2026-10-23): let the simple route's bottom reservation track the real
   dock height. The fixed 150px rule (.statusli.structure) silently beat the --barh calc, so a
   grown dock (guard / toast) covered the edit pills. --barh is kept live by the observer. */
body.sl-simple .statusli.structure{padding-bottom:calc(var(--barh,150px) + 16px)!important;}

/* editor-batch repair (2026-10-23): .sl-toast pills used fixed offsets - the download toast
   (.sl-dl) pinned to top:76px rendered over the 99px header / type rail, and all bottom-anchored
   toasts (bottom:132px) land inside the grown dock (121-291px). Anchor every .sl-toast variant
   just above the live dock via --barh; text, timing and existence unchanged. */
body.sl-simple .sl-toast{top:auto!important;bottom:calc(var(--barh,132px) + 10px)!important;}
