/* V7.3.7 — unified iPhone/iPad Safari compatibility + unobstructed landscape visual */
:root{--mws-vvh:100dvh;--mws-vvw:100vw;--mws-vvtop:0px;--mws-vvleft:0px;--mws-keyboard-inset:0px}
html,body{width:100%;max-width:100%;min-height:100svh;min-height:var(--mws-vvh);overflow-x:hidden;-webkit-text-size-adjust:100%;overscroll-behavior:none}
.app-shell,.main-shell,.content{min-width:0;max-width:100vw}
input,textarea,select{font-size:max(16px,1rem)}
.sidebar{overscroll-behavior:contain}
@media(max-width:900px){
  .sidebar{height:var(--mws-vvh)!important;overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch!important;padding-bottom:calc(86px + env(safe-area-inset-bottom))!important}
  html.mws-sidebar-open .mobile-tabs{opacity:0!important;pointer-events:none!important;transform:translateY(120%)!important}
  .mobile-tabs{bottom:max(6px,env(safe-area-inset-bottom))!important;transition:opacity .15s ease,transform .18s ease!important}
  .topbar{padding-top:env(safe-area-inset-top)!important}
}
/* Viewer height always follows the visual viewport, not layout viewport. */
.viewer{height:var(--mws-vvh)!important;max-height:var(--mws-vvh)!important;min-height:0!important}
.viewer-stage{min-height:0!important}
.viewer-safe-area-probe{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
/* Full-screen landscape canvas. Controls overlay rather than reserve visual height. */
html.mws-landscape .viewer.landscape-study{display:grid!important;grid-template-rows:minmax(0,1fr)!important;background:#000!important;overflow:hidden!important}
html.mws-landscape .viewer.landscape-study .viewer-stage{grid-row:1!important;width:100%!important;height:100%!important;min-height:0!important;padding:0!important;background:#000!important;touch-action:none!important;overscroll-behavior:none!important}
html.mws-landscape .viewer.landscape-study .viewer-ambient{display:none!important}
html.mws-landscape .viewer.landscape-study .viewer-canvas-wrap{background:#000!important;border-radius:0!important;box-shadow:none!important}
html.mws-landscape .viewer.landscape-study .viewer-canvas-wrap img,html.mws-landscape .viewer.landscape-study .viewer-canvas-wrap canvas{width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;object-fit:contain!important}
html.mws-landscape .viewer.landscape-study .viewer-header,html.mws-landscape .viewer.landscape-study .viewer-toolbar,html.mws-landscape .viewer.landscape-study .viewer-footer{position:absolute!important;left:max(6px,env(safe-area-inset-left))!important;right:max(6px,env(safe-area-inset-right))!important;width:auto!important;z-index:95!important;background:rgba(7,10,15,.9)!important;border:1px solid rgba(255,255,255,.08)!important;box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
html.mws-landscape .viewer.landscape-study .viewer-header{top:max(5px,env(safe-area-inset-top))!important;min-height:43px!important;padding:4px 7px!important;border-radius:13px!important}
html.mws-landscape .viewer.landscape-study .viewer-toolbar{top:calc(max(5px,env(safe-area-inset-top)) + 47px)!important;min-height:37px!important;padding:3px 5px!important;border-radius:11px!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important}
html.mws-landscape .viewer.landscape-study .viewer-footer{bottom:max(5px,env(safe-area-inset-bottom))!important;max-height:56px!important;padding:4px 7px!important;border-radius:13px!important;overflow:hidden!important}
html.mws-landscape .viewer.landscape-study .viewer-title span,html.mws-landscape .viewer.landscape-study .viewer-session-progress,html.mws-landscape .viewer.landscape-study .viewer-shortcuts,html.mws-landscape .viewer.landscape-study .confidence-control>span,html.mws-landscape .viewer.landscape-study .confidence-control small,html.mws-landscape .viewer.landscape-study .viewer-navigation>span{display:none!important}
html.mws-landscape .viewer.landscape-study .viewer-title h2{font-size:.72rem!important;max-width:46vw!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
html.mws-landscape .viewer.landscape-study .tool-button{height:29px!important;min-height:29px!important;padding:0 7px!important}.viewer.landscape-study .tool-label{display:none!important}
html.mws-landscape .viewer.landscape-study .viewer-footer-grid{grid-template-columns:auto minmax(220px,1fr) auto!important;gap:5px!important}.viewer.landscape-study .confidence-button,.viewer.landscape-study .viewer-actions .button,.viewer.landscape-study .viewer-navigation .button{height:31px!important;min-height:31px!important;padding:0 7px!important;font-size:.5rem!important}
/* Concept/chunk rails are overlays only. */
html.mws-landscape .viewer.landscape-study .guided-chunks{left:50%!important;right:auto!important;bottom:48px!important;transform:translateX(-50%)!important;max-width:64vw!important;display:flex!important;gap:3px!important;padding:4px!important;border-radius:12px!important;background:rgba(7,9,14,.88)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;overflow-x:auto!important;scrollbar-width:none!important}
html.mws-landscape .viewer.landscape-study .guided-chunks::-webkit-scrollbar{display:none!important}.viewer.landscape-study .guided-chunks button{height:29px!important;min-width:43px!important;padding:0 7px!important;font-size:.49rem!important}
html.mws-landscape .viewer.landscape-study .concept-pathway-rail{left:50%!important;right:auto!important;bottom:86px!important;transform:translateX(-50%)!important;width:auto!important;max-width:58vw!important;min-height:32px!important;padding:4px 7px!important;grid-template-columns:minmax(120px,1fr) auto!important;gap:5px!important;border-radius:11px!important;background:rgba(7,9,14,.9)!important;box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}.viewer.landscape-study .concept-pathway-rail-stages{display:none!important}
/* Tap-to-hide chrome. */
html.mws-landscape .viewer.landscape-study.controls-hidden .viewer-header,html.mws-landscape .viewer.landscape-study.controls-hidden .viewer-toolbar,html.mws-landscape .viewer.landscape-study.controls-hidden .viewer-footer,html.mws-landscape .viewer.landscape-study.controls-hidden .guided-chunks,html.mws-landscape .viewer.landscape-study.controls-hidden .concept-pathway-rail,html.mws-landscape .viewer.landscape-study.controls-hidden .viewer-fit-fab,html.mws-landscape .viewer.landscape-study.controls-hidden .viewer-floating-dock,html.mws-landscape .viewer.landscape-study.controls-hidden .focus-exit,html.mws-landscape .viewer.landscape-study.controls-hidden .clinical-timeline{opacity:0!important;pointer-events:none!important}
html.mws-landscape .viewer.landscape-study .viewer-edge-zone{width:14px!important;opacity:.18!important}
/* Compact timer is viewport-driven: no pointer/media-query dependency. */
html.mws-compact-landscape [data-mws-timer][data-compact-landscape="true"] .mws-timer-bar{display:none!important}
html.mws-compact-landscape [data-mws-timer][data-compact-landscape="true"] .mws-timer-launch{display:flex!important;position:fixed!important;right:max(7px,env(safe-area-inset-right))!important;top:max(7px,env(safe-area-inset-top))!important;bottom:auto!important;left:auto!important;width:78px!important;min-width:78px!important;height:34px!important;min-height:34px!important;padding:0 7px!important;gap:5px!important;border-radius:11px!important;background:rgba(7,10,16,.92)!important;border:1px solid rgba(102,216,255,.15)!important;box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;z-index:150!important}
html.mws-compact-landscape [data-mws-timer][data-compact-landscape="true"] .mws-timer-launch b{font-size:.66rem!important;letter-spacing:.02em!important;color:#dff8ff!important}
.mws-timer-sheet{max-height:calc(var(--mws-vvh) - 16px)!important;overflow:auto!important;-webkit-overflow-scrolling:touch!important}
html.mws-compact-landscape .mws-timer-sheet{inset:max(45px,calc(env(safe-area-inset-top) + 40px)) max(7px,env(safe-area-inset-right)) auto auto!important;width:min(320px,48vw)!important;max-height:calc(var(--mws-vvh) - 52px)!important;border-radius:17px!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
/* Orientation/splash cleanup: transitions are never allowed to cover a rotated screen. */
html.mws-viewport-settling .mws-timer-transition{display:none!important}
/* Keyboard: let Spence/input panels follow visual viewport and remove competing fixed chrome. */
html.mws-keyboard-open .mobile-tabs,html.mws-keyboard-open [data-mws-timer],html.mws-keyboard-open .viewer-footer{display:none!important}
html.mws-keyboard-open .mws-companion-sheet.open{position:fixed!important;left:max(6px,env(safe-area-inset-left))!important;right:max(6px,env(safe-area-inset-right))!important;top:calc(var(--mws-vvtop) + 6px)!important;bottom:auto!important;width:auto!important;height:calc(var(--mws-vvh) - 12px)!important;max-height:calc(var(--mws-vvh) - 12px)!important;transform:none!important}
html.mws-keyboard-open .mws-companion-sheet form{position:sticky!important;bottom:0!important;background:#090d15!important;padding-bottom:max(8px,env(safe-area-inset-bottom))!important}
html.mws-keyboard-open .mws-companion-sheet form textarea{font-size:16px!important;max-height:32dvh!important}
/* iPad-specific panel sizes and landscape nav. */
html.mws-ipad .sidebar{max-width:340px}.mws-universal-panel{max-height:calc(var(--mws-vvh) - 24px)!important}
html.mws-ipad.mws-landscape .mws-companion-sheet.open{width:min(760px,70vw)!important;height:min(650px,calc(var(--mws-vvh) - 24px))!important}
/* Performance: no expensive blur/shadows/animations on iOS. */
html.mws-ios .sidebar,html.mws-ios .sidebar-scrim,html.mws-ios .topbar,html.mws-ios .mobile-tabs,html.mws-ios .viewer-header,html.mws-ios .viewer-toolbar,html.mws-ios .viewer-footer,html.mws-ios .guided-chunks,html.mws-ios .concept-pathway-rail,html.mws-ios .viewer-more-menu,html.mws-ios .annotation-palette,html.mws-ios .notes-sheet,html.mws-ios .mws-timer-sheet,html.mws-ios .mws-timer-bar,html.mws-ios .mws-companion-sheet,html.mws-ios .compare-mode-sheet,html.mws-ios .consultant-coach-sheet,html.mws-ios .visual-sources-drawer,html.mws-ios .chunk-study-panel{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
html.mws-ios .viewer-canvas-wrap,html.mws-ios .topic-tile,html.mws-ios .mission-primary,html.mws-ios .ct-mission-hero,html.mws-ios .mission-misconception-card{box-shadow:none!important}
html.mws-ios .viewer.chunk-recall-active #viewer-transform-space{filter:none!important;opacity:.22!important}
html.mws-ios .viewer.visual-thinking-transition .viewer-transform-space,html.mws-ios .viewer .session-segment,html.mws-ios .visual-hotspot,html.mws-ios .concept-pathway-rail,html.mws-ios .guided-chunks{transition-duration:.05s!important;animation:none!important}
html.mws-viewport-settling *{scroll-behavior:auto!important}
@media(prefers-reduced-motion:reduce){.viewer *{transition:none!important;animation:none!important}}
/* Login / activation / reset keyboard safety. */
.auth-body,.portal-shell{min-height:100svh!important;min-height:var(--mws-vvh)!important}.portal-main{min-height:calc(var(--mws-vvh) - 84px)!important}.portal-auth-card{min-width:0}
@media(max-width:767px){
  .portal-main{padding-inline:max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right))!important;padding-bottom:calc(28px + env(safe-area-inset-bottom))!important}
  html.mws-keyboard-open .portal-story{display:none!important}
  html.mws-keyboard-open .portal-main{display:block!important;min-height:var(--mws-vvh)!important;padding-top:8px!important;padding-bottom:8px!important}
  html.mws-keyboard-open .portal-auth-card{width:100%!important;max-height:calc(var(--mws-vvh) - 16px)!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;margin:0!important;padding:18px!important;border-radius:20px!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  html.mws-keyboard-open .portal-nav,html.mws-keyboard-open .portal-footer{display:none!important}
  .portal-auth-card input,.portal-auth-card textarea,.portal-auth-card select{font-size:16px!important}
}

/* V7.3.5 — orientation/focus hardening. These rules are intentionally last. */
/* Never transform the fixed viewer root. WebKit can retain a stale composited
   transform after rotation/browser-bar changes, leaving only a narrow strip of
   the real viewer visible. Anchor the modal directly to VisualViewport bounds. */
.slide-modal{
  position:fixed!important;
  left:var(--mws-vvleft,0px)!important;
  top:var(--mws-vvtop,0px)!important;
  right:auto!important;
  bottom:auto!important;
  width:var(--mws-vvw,100vw)!important;
  height:var(--mws-vvh,100dvh)!important;
  max-width:none!important;
  max-height:none!important;
  transform:none!important;
  transform-origin:0 0!important;
  overflow:hidden!important;
  contain:layout paint style!important;
}
.slide-modal>.modal-backdrop,.slide-modal>.viewer{width:100%!important;height:100%!important;inset:0!important}
html.mws-viewer-open,html.mws-viewer-open body{width:100%!important;height:100%!important;overflow:hidden!important;overscroll-behavior:none!important}
html.mws-viewer-open .app-shell{overflow:hidden!important}

/* Study Mode is one-row layout. Hidden normal-view rows must not reserve height
   after a slide re-render or an orientation transition. */
html.mws-study-mode .slide-modal .viewer.focus-mode.study-mode{
  grid-template-rows:minmax(0,1fr)!important;
  grid-template-columns:minmax(0,1fr)!important;
  width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;
}
html.mws-study-mode .slide-modal .viewer.focus-mode.study-mode>.viewer-header,
html.mws-study-mode .slide-modal .viewer.focus-mode.study-mode>.viewer-toolbar,
html.mws-study-mode .slide-modal .viewer.focus-mode.study-mode>.viewer-footer{display:none!important}
html.mws-study-mode .slide-modal .viewer.focus-mode.study-mode>.viewer-stage{
  grid-row:1!important;grid-column:1!important;min-width:0!important;min-height:0!important;width:100%!important;height:100%!important;
}
html.mws-study-mode.mws-portrait .slide-modal .viewer.focus-mode.study-mode>.viewer-stage{padding-top:58px!important}
html.mws-study-mode.mws-landscape .slide-modal .viewer.focus-mode.study-mode>.viewer-stage{padding-top:0!important}

/* Phone timer: drag is deliberately disabled. The visible children are now
   exactly three columns (timer / Pause / Finish), so Finish cannot auto-place
   onto a second grid row and escape the 48px container. */
@media(max-width:740px){
  html.mws-study-mode [data-mws-timer] .mws-timer-drag{display:none!important}
  html.mws-study-mode [data-mws-timer] .mws-timer-bar{
    left:max(60px,calc(env(safe-area-inset-left) + 60px))!important;
    right:max(8px,env(safe-area-inset-right))!important;
    top:max(8px,calc(var(--mws-vvtop,0px) + env(safe-area-inset-top)))!important;
    bottom:auto!important;width:auto!important;height:48px!important;min-height:48px!important;
    grid-template-columns:minmax(0,1fr) auto auto!important;grid-template-rows:1fr!important;
    align-items:center!important;gap:5px!important;padding:5px!important;border-radius:15px!important;
    overflow:hidden!important;transform:none!important;contain:layout paint!important;
  }
  html.mws-study-mode [data-mws-timer] .mws-timer-bar.is-user-positioned{
    left:max(60px,calc(env(safe-area-inset-left) + 60px))!important;
    right:max(8px,env(safe-area-inset-right))!important;
    top:max(8px,calc(var(--mws-vvtop,0px) + env(safe-area-inset-top)))!important;
  }
  html.mws-study-mode [data-mws-timer] .mws-timer-bar-main{min-width:0!important;grid-template-columns:auto auto!important;gap:7px!important;padding:0 4px!important;overflow:hidden!important}
  html.mws-study-mode [data-mws-timer] .mws-timer-bar-main span{font-size:.54rem!important}
  html.mws-study-mode [data-mws-timer] .mws-timer-bar-main strong{font-size:1rem!important;white-space:nowrap!important}
  html.mws-study-mode [data-mws-timer] .mws-timer-bar-main small{display:none!important}
  html.mws-study-mode [data-mws-timer] .mws-timer-bar>button:not(.mws-timer-bar-main):not(.mws-timer-drag){height:36px!important;min-width:0!important;padding:0 10px!important;white-space:nowrap!important}
  html.mws-study-mode .viewer.study-mode .focus-exit{
    display:grid!important;place-items:center!important;left:max(8px,env(safe-area-inset-left))!important;right:auto!important;
    top:max(8px,calc(var(--mws-vvtop,0px) + env(safe-area-inset-top)))!important;width:44px!important;height:44px!important;
    padding:0!important;font-size:0!important;border-radius:14px!important;
  }
  html.mws-study-mode .viewer.study-mode .focus-exit svg{width:18px!important;height:18px!important}
}

/* Rotation is a transient state. Nothing modal-like may remain visually stuck
   while Safari is changing the visual viewport. */
html.mws-viewport-settling .mws-timer-transition,
html.mws-viewport-settling .orientation-overlay{display:none!important}
html.mws-viewport-settling .slide-modal{transition:none!important;animation:none!important}

/* All full-screen/sheet overlays use the visible Safari viewport. */
html.mws-ios .spence-ai-overview-modal,
html.mws-ios .visual-sources-modal,
html.mws-ios .personal-license-modal,
html.mws-ios .shortcut-modal{
  left:var(--mws-vvleft,0px)!important;top:var(--mws-vvtop,0px)!important;right:auto!important;bottom:auto!important;
  width:var(--mws-vvw,100vw)!important;height:var(--mws-vvh,100dvh)!important;max-height:var(--mws-vvh,100dvh)!important;
}

/* ===== v7.3.5 final fixed-layer hardening ===== */
html.mws-ios .slide-modal .viewer.landscape-study {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

html.mws-ios .cross-track-sheet {
  left: var(--mws-vvleft, 0px) !important;
  top: var(--mws-vvtop, 0px) !important;
  right: auto !important;
  bottom: auto !important;
  width: var(--mws-vvw, 100vw) !important;
  height: var(--mws-vvh, 100dvh) !important;
  max-width: none !important;
  max-height: none !important;
}
html.mws-ios .cross-track-panel {
  width: min(1180px, calc(var(--mws-vvw, 100vw) - 32px)) !important;
  max-width: calc(var(--mws-vvw, 100vw) - 32px) !important;
  max-height: calc(var(--mws-vvh, 100dvh) - 32px) !important;
}

@media (min-width: 741px) {
  html.mws-ios .mws-companion-sheet {
    width: min(430px, calc(var(--mws-vvw, 100vw) - 24px)) !important;
    max-height: min(760px, calc(var(--mws-vvh, 100dvh) - 24px)) !important;
  }
  html.mws-ios .mws-timer-sheet {
    width: min(410px, calc(var(--mws-vvw, 100vw) - 24px)) !important;
  }
  html.mws-ios .mws-companion-mini {
    width: min(420px, calc(var(--mws-vvw, 100vw) - 24px)) !important;
  }
}

@media (max-width: 740px) {
  html.mws-ios .annotation-palette,
  html.mws-ios .viewer-more-menu,
  html.mws-ios .notes-sheet {
    max-height: calc(var(--mws-vvh, 100dvh) - 14px) !important;
  }
}

/* V7.3.6 — timer/pathway collision guard + landscape swipe ergonomics. */
/* On touch Safari the timer is never user-positioned. Persisted drag coordinates
   are a common source of overlay collisions after rotation, especially on iPad. */
@media (pointer:coarse) and (max-width:1180px){
  html.mws-study-mode [data-mws-timer] .mws-timer-drag{display:none!important}
  html.mws-study-mode [data-mws-timer] .mws-timer-bar{
    left:auto!important;
    right:max(8px,env(safe-area-inset-right))!important;
    top:max(8px,calc(var(--mws-vvtop,0px) + env(safe-area-inset-top)))!important;
    bottom:auto!important;
    width:min(620px,calc(100vw - 76px - env(safe-area-inset-left) - env(safe-area-inset-right)))!important;
    transform:none!important;
    grid-template-columns:minmax(0,1fr) auto auto!important;
    grid-template-rows:1fr!important;
    overflow:hidden!important;
  }
  html.mws-study-mode [data-mws-timer] .mws-timer-bar.is-user-positioned{
    left:auto!important;right:max(8px,env(safe-area-inset-right))!important;
    top:max(8px,calc(var(--mws-vvtop,0px) + env(safe-area-inset-top)))!important;
    bottom:auto!important;transform:none!important;
  }
  html.mws-study-mode .viewer.study-mode .concept-pathway-rail{
    z-index:120!important;
  }
  html.mws-study-mode [data-mws-timer] .mws-timer-bar{z-index:1800!important}
}

/* A running timer outside Study Mode becomes a small status pill on touch
   viewers. This keeps the Concept Pathway and six-chunk rails completely clear
   in both portrait and landscape. Tap the pill to reopen Pause / Finish. */
@media (pointer:coarse) and (max-width:1180px){
  html.mws-viewer-open:not(.mws-study-mode) [data-mws-timer][data-compact-viewer="true"] .mws-timer-launch{
    display:flex!important;
    position:fixed!important;
    left:auto!important;
    right:max(8px,env(safe-area-inset-right))!important;
    top:calc(var(--mws-vvtop,0px) + env(safe-area-inset-top) + 92px)!important;
    bottom:auto!important;
    width:auto!important;min-width:82px!important;height:36px!important;min-height:36px!important;
    padding:0 9px!important;gap:6px!important;border-radius:12px!important;
    background:rgba(6,13,23,.95)!important;border:1px solid rgba(93,214,255,.22)!important;
    box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
    z-index:170!important;
  }
  html.mws-viewer-open:not(.mws-study-mode) [data-mws-timer][data-compact-viewer="true"] .mws-timer-launch b{
    color:#e9f9ff!important;font-size:.68rem!important;font-variant-numeric:tabular-nums!important;
  }
}

/* Compact phone landscape keeps timer at the top-right and Concept Pathways at
   the bottom band, guaranteeing disjoint rectangles even as Safari bars resize. */
html.mws-compact-landscape.mws-viewer-open [data-mws-timer][data-compact-landscape="true"] .mws-timer-launch{
  top:max(7px,calc(var(--mws-vvtop,0px) + env(safe-area-inset-top)))!important;
  right:max(7px,env(safe-area-inset-right))!important;
}
html.mws-landscape .viewer.landscape-study .concept-pathway-rail{
  bottom:max(84px,calc(env(safe-area-inset-bottom) + 82px))!important;
}

/* Make horizontal page-swipe intent explicit to WebKit while JS owns the
   gesture. Pinch/zoom and zoomed-slide panning remain handled by Pointer Events. */
html.mws-landscape .viewer.landscape-study .viewer-stage{
  touch-action:none!important;
  -webkit-user-select:none!important;
  user-select:none!important;
}

/* V7.3.7 — keep the visual completely unobstructed in touch-device landscape.
   The personal licence remains part of the secure delivery/account record; the
   floating serial chip is hidden only while the viewer is landscape. */
@media (orientation: landscape) and (pointer: coarse) {
  .viewer .viewer-license-chip,
  #viewer-license-chip {
    display: none !important;
  }
}


/* ==========================================================================
   V7.3.8 — Login simplification + dismissible Focus timer
   ========================================================================== */

/* Hidden is authoritative. Older Study Mode/compact-landscape selectors used
   display: grid/flex !important, which could resurrect timer UI after JS set
   hidden=true. These selectors deliberately meet/exceed the old specificity. */
[data-mws-timer] [hidden]{display:none!important}
html.mws-study-mode [data-mws-timer] .mws-timer-bar[hidden]{display:none!important}
html.mws-compact-landscape [data-mws-timer][data-compact-landscape="true"] .mws-timer-launch,
html.mws-compact-landscape.mws-viewer-open [data-mws-timer][data-compact-landscape="true"] .mws-timer-launch,
html.mws-viewer-open:not(.mws-study-mode) [data-mws-timer][data-compact-viewer="true"] .mws-timer-launch,
html [data-mws-timer] .mws-timer-launch,
html [data-action="open-study-timer"]{display:none!important}

/* Focus bar: drag handle + main + pause + close on pointer devices. */
html.mws-study-mode [data-mws-timer] .mws-timer-bar:not([hidden]){
  display:grid!important;
  grid-template-columns:34px minmax(0,1fr) auto auto!important;
  grid-template-rows:1fr!important;
  overflow:hidden!important;
}
html.mws-study-mode [data-mws-timer] .mws-timer-close{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:62px!important;
  padding-inline:12px!important;
  color:#eef8ff!important;
  border-color:rgba(113,221,255,.22)!important;
  background:rgba(113,221,255,.07)!important;
}

/* Touch Safari has deterministic positioning, so the drag handle is removed
   and the remaining controls get an exact three-column layout. */
@media (pointer:coarse), (max-width:740px){
  html.mws-study-mode [data-mws-timer] .mws-timer-drag{display:none!important}
  html.mws-study-mode [data-mws-timer] .mws-timer-bar:not([hidden]){
    grid-template-columns:minmax(0,1fr) auto auto!important;
    left:max(64px,calc(env(safe-area-inset-left) + 64px))!important;
    right:max(8px,env(safe-area-inset-right))!important;
    width:auto!important;
  }
}

/* Landscape Safari: keep the closeable Focus bar visible instead of replacing
   it with the old 78px Timer launcher. */
@media (orientation:landscape) and (pointer:coarse){
  html.mws-compact-landscape [data-mws-timer][data-compact-landscape="true"] .mws-timer-bar:not([hidden]),
  html.mws-study-mode [data-mws-timer] .mws-timer-bar:not([hidden]){
    display:grid!important;
    top:max(7px,calc(var(--mws-vvtop,0px) + env(safe-area-inset-top)))!important;
    left:max(58px,calc(var(--mws-vvleft,0px) + env(safe-area-inset-left) + 58px))!important;
    right:max(8px,env(safe-area-inset-right))!important;
    width:auto!important;
    max-width:min(620px,calc(var(--mws-vvw,100vw) - 86px))!important;
    height:46px!important;
    transform:none!important;
  }
}

/* Login/home: hero + authentication only. Keep the visual identity but reduce
   typographic scale so iPhone users reach sign-in without a long promo page. */
.auth-body .portal-proof-grid,
.auth-body .portal-showcase,
.auth-body .portal-ethos-quote{display:none!important}
.auth-body .portal-story{align-self:center}
.auth-body .portal-main{gap:clamp(24px,4vw,52px)!important}
.auth-body .portal-story h1{
  font-size:clamp(3.35rem,6.4vw,6.6rem)!important;
  line-height:.91!important;
  letter-spacing:-.066em!important;
  margin:24px 0 20px!important;
}
.auth-body .portal-lead{max-width:680px!important}

@media (max-width:1100px){
  .auth-body .portal-main{padding-top:24px!important;gap:26px!important}
  .auth-body .portal-story h1{font-size:clamp(3.1rem,8vw,4.7rem)!important}
}
@media (max-width:740px){
  .auth-body .portal-main{padding-top:20px!important;gap:22px!important}
  .auth-body .portal-story h1{
    font-size:clamp(2.7rem,12.2vw,3.45rem)!important;
    line-height:.94!important;
    letter-spacing:-.058em!important;
    margin:20px auto 16px!important;
    max-width:640px!important;
  }
  .auth-body .portal-lead{font-size:.96rem!important;line-height:1.52!important}
  .auth-body .portal-auth-card{margin-top:0!important}
}
