
/* WristKeep v0.1.2 — consolidated mobile beta hardening + desktop crop hotfix */
:root{--wk-mobile-header-h:58px}

/* 002 — preserve watch image ratio and reveal scores.
   HOTFIX (v0.1.2): moved out of the max-width:760px block below. The
   underlying crop bug lives in css/bundle.css line ~6823
   (#roomView .room-slot-filled .watch-tile-photo img { object-fit:cover;
   transform:scale(.92) }), which is NOT media-query-scoped -- it applies
   at every viewport width, including desktop, across Watch Box, Drawer,
   and Winders. Scoping this fix to mobile-only in v0.1.1 left desktop
   still cropping. Same specificity as the bundle.css rule (1 id, 2
   classes, 1 element), so cascade order alone is enough to win since
   this stylesheet loads after bundle.css -- no !important escalation
   needed beyond what bundle.css already uses. */
#roomView .room-slot-filled .watch-card,#roomView .room-slot-filled .watch-image,#roomView .room-slot-filled .watch-tile-photo{min-height:0!important;overflow:visible!important}
#roomView .room-slot-filled .watch-tile-photo img,#roomView .watch-image img{width:100%!important;height:100%!important;object-fit:contain!important;object-position:center!important;transform:none!important}
#roomView .room-slot-filled .watch-card-footer{display:flex!important;position:absolute!important;left:0!important;right:0!important;bottom:1px!important;z-index:8!important;justify-content:center!important;overflow:visible!important;pointer-events:none!important}
#roomView .room-slot-filled .overall-score{display:block!important;position:relative!important;inset:auto!important;margin:0!important;line-height:1!important;z-index:9!important}

@media(max-width:760px){
  /* 004 — highest rated mobile card */
  #dashboardCards .dashboard-card-highest{overflow:hidden!important;height:auto!important;min-height:330px!important;padding-bottom:20px!important}
  #dashboardCards .dashboard-card-highest>strong{height:auto!important;display:block!important}
  #dashboardCards .dashboard-card-highest .highest-rated-inline{display:grid!important;grid-template-columns:1fr!important;gap:14px!important;min-height:0!important;width:100%!important;overflow:hidden!important}
  #dashboardCards .dashboard-card-highest .highest-rated-image{grid-row:1;width:min(100%,280px)!important;height:210px!important;justify-self:center!important}
  #dashboardCards .dashboard-card-highest .highest-rated-image img{max-width:100%!important;max-height:100%!important;object-fit:contain!important}
  #dashboardCards .dashboard-card-highest .highest-rated-name{grid-row:2;overflow:visible!important;text-overflow:clip!important}
  #dashboardCards .dashboard-card-highest .score-heat{grid-row:3;justify-self:start!important}
  #dashboardCards .dashboard-card-highest>span{position:static!important;margin-top:10px!important}

  /* 005 — Rank + Watch + OVR visible */
  #libraryView #libraryTable.library-view-overall{width:100%!important;min-width:100%!important;table-layout:fixed!important}
  #libraryView #libraryTable.library-view-overall col:nth-child(1){width:48px!important}
  #libraryView #libraryTable.library-view-overall col:nth-child(2){width:auto!important}
  #libraryView #libraryTable.library-view-overall col:nth-child(3){width:38px!important}
  #libraryView #libraryTable.library-view-overall col:nth-child(4){width:64px!important}
  #libraryView #libraryTable.library-view-overall th,#libraryView #libraryTable.library-view-overall td{padding-left:8px!important;padding-right:8px!important}
  #libraryView #libraryTable.library-view-overall .watch-differentiators{white-space:normal!important;overflow-wrap:anywhere!important;font-size:10px!important}
  #libraryView #libraryTable.library-view-overall .watch-name-line{white-space:normal!important}
  #libraryView #libraryTable.library-view-overall .overall-cell{text-align:right!important}
  #libraryView #libraryTable.library-view-overall .medal-column{padding-left:0!important;padding-right:0!important}

  /* 006 — compare AI analysis readable */
  .wear-mode.results-mode .compare-ai-analysis,.wear-mode.results-mode [class*="ai-analysis"],.wear-mode.results-mode .ai-analysis-panel{height:auto!important;min-height:220px!important;max-height:62vh!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important}

  /* 007/011 — compact account icon */
  .wk-account-menu{top:calc(env(safe-area-inset-top,0px) + 8px)!important;right:10px!important}
  .wk-account-button{width:44px!important;height:44px!important;max-width:none!important;padding:0!important;border-radius:50%!important;font-size:0!important;display:grid!important;place-items:center!important}
  .wk-account-button::before{content:"♙";font-size:23px;line-height:1;color:#e5c77e}

  /* 009/013 — hamburger owns reserved header space, never overlays modals */
  .menu-toggle{position:fixed!important;left:10px!important;top:calc(env(safe-area-inset-top,0px) + 8px)!important;width:44px!important;height:44px!important;z-index:8500!important;margin:0!important;transform:none!important}
  .modal.open~.menu-toggle,.modal[aria-hidden="false"]~.menu-toggle{display:none!important}
  body:has(.modal.open) .menu-toggle,body:has(.modal[aria-hidden="false"]) .menu-toggle{display:none!important}
  .topbar{padding-left:64px!important;padding-right:64px!important}

  /* 012 — settings is a true internal-scroll modal */
  #watchRoomSetupModal{overflow:hidden!important;overscroll-behavior:none!important}
  #watchRoomSetupModal .watch-room-setup-card{height:min(92dvh,900px)!important;max-height:92dvh!important;display:grid!important;grid-template-rows:auto minmax(0,1fr) auto!important;overflow:hidden!important}
  #watchRoomSetupModal .modal-head{position:relative!important;z-index:3!important}
  #watchRoomSetupModal .setup-room-body{min-height:0!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior:contain!important}
  #watchRoomSetupModal .setup-room-actions{position:relative!important;z-index:3!important;margin:0!important}

  /* 016 — AI chooser: fixed shell, internal question scroll */
  #aiExportModal{overflow:hidden!important;overscroll-behavior:none!important}
  #aiExportModal .collection-ai-modal-card{height:min(92dvh,900px)!important;max-height:92dvh!important;display:grid!important;grid-template-rows:auto minmax(0,1fr) auto!important;overflow:hidden!important}
  #aiExportModal .modal-head,#aiExportModal .collection-ai-actions{position:relative!important;z-index:3!important;background:inherit!important}
  #aiExportModal .collection-ai-body,#aiExportModal .collection-ai-ready{min-height:0!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior:contain!important;padding-bottom:24px!important}

  /* 007 — compact library category tabs on one line */
  .library-column-sets{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:0!important;padding:4px!important}
  .library-column-sets button{min-width:0!important;padding:12px 4px!important;font-size:11px!important;line-height:1!important;letter-spacing:.06em!important;text-transform:uppercase!important;font-weight:700!important;white-space:nowrap!important;border-radius:10px!important}

  /* 008 — collapsible utility cards */
  .library-control-card.wk-collapsible>.wk-collapse-body[hidden]{display:none!important}
  .library-control-card.wk-collapsible{padding:0!important;overflow:hidden!important}
  .wk-collapse-trigger{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 20px;border:0;background:transparent;color:inherit;text-align:left}
  .wk-collapse-trigger::after{content:"⌄";font-size:24px;color:#c8a96b;transform:rotate(-90deg);transition:transform .2s ease}
  .wk-collapsible.is-open .wk-collapse-trigger::after{transform:rotate(0)}
  .wk-collapse-body{padding:0 20px 20px}

  /* 017 — dashboard section titles share Collection Size style */
  .watch-of-month-panel .dashboard-panel-heading h2,.highest-rated-panel .dashboard-panel-heading h2,#dashboardCards .dashboard-card>span{font-family:inherit!important;font-size:9.5px!important;font-weight:550!important;letter-spacing:.08em!important;text-transform:uppercase!important;color:#c8a96b!important;line-height:1.3!important}

  /* mobile popup close target */
  .wk-tooltip-close{display:grid!important;place-items:center!important;position:absolute!important;top:8px!important;right:8px!important;width:36px!important;height:36px!important;border-radius:50%!important;border:1px solid rgba(200,169,107,.35)!important;background:#191817!important;color:#eee!important;font-size:22px!important;z-index:4!important}
  #helpPopover,.dashboard-info-portal-tooltip{padding-top:48px!important}
}
@media(min-width:761px){.wk-tooltip-close{display:none!important}}

body.wk-modal-scroll-lock{overflow:hidden!important;overscroll-behavior:none!important} body.wk-touch-dragging{overflow:hidden!important;touch-action:none!important;user-select:none!important}

/* =====================================================================
   WristKeep v0.2.1 — approved desktop + mobile beta corrections
   This file is authoritative and loads after bundle/cloud styles.
   ===================================================================== */

/* ---------- Library accordions: dark, single-title, collapsed by default ---------- */
html body #libraryView .library-control-card.wk-collapsible{
  padding:0!important;
  overflow:hidden!important;
  border:1px solid rgba(199,164,95,.22)!important;
  border-radius:13px!important;
  background:linear-gradient(180deg,#11100e,#0b0b0a)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.018)!important;
}
html body #libraryView .wk-collapse-trigger{
  width:100%!important;
  min-height:54px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:14px!important;
  margin:0!important;
  padding:15px 18px!important;
  border:0!important;
  background:transparent!important;
  color:var(--gold,#c7a45f)!important;
  font-family:var(--sans,Inter,"Segoe UI",Arial,sans-serif)!important;
  font-size:11px!important;
  font-weight:750!important;
  line-height:1.1!important;
  letter-spacing:.105em!important;
  text-transform:uppercase!important;
  text-align:left!important;
  cursor:pointer!important;
}
html body #libraryView .wk-collapse-trigger:hover,
html body #libraryView .wk-collapse-trigger:focus-visible{
  background:rgba(199,164,95,.055)!important;
  outline:none!important;
}
html body #libraryView .wk-collapse-chevron{
  flex:0 0 auto!important;
  color:#d4b56f!important;
  font-size:22px!important;
  line-height:1!important;
  transform:rotate(-90deg)!important;
  transition:transform .18s ease!important;
}
html body #libraryView .wk-collapsible.is-open .wk-collapse-chevron{
  transform:rotate(0deg)!important;
}
html body #libraryView .wk-collapse-body{
  padding:0 18px 18px!important;
  border-top:1px solid rgba(199,164,95,.13)!important;
  background:transparent!important;
}
html body #libraryView .wk-collapse-body[hidden]{display:none!important}
html body #libraryView .scoring-method-summary{
  margin-top:0!important;
  padding-top:16px!important;
  border-top:0!important;
}

/* ---------- Dashboard typography: two canonical shared components ---------- */
html body #dashboardView .watch-of-month-panel .dashboard-panel-heading h2,
html body #dashboardView .highest-rated-panel .dashboard-panel-heading h2,
html body #dashboardView #dashboardCards .dashboard-card>span{
  margin:0 0 10px!important;
  min-height:12px!important;
  font-family:var(--sans,Inter,"Segoe UI",Arial,sans-serif)!important;
  font-size:9.5px!important;
  font-weight:550!important;
  line-height:1.3!important;
  letter-spacing:.08em!important;
  text-transform:uppercase!important;
  color:var(--gold,#c7a45f)!important;
  text-align:left!important;
}
html body #dashboardView .watch-of-month-panel .dashboard-panel-heading,
html body #dashboardView .highest-rated-panel .dashboard-panel-heading{
  min-height:28px!important;
  align-items:center!important;
}
html body #dashboardView .wotm-winner-copy strong,
html body #dashboardView .highest-rated-panel .hr-name{
  display:-webkit-box!important;
  width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:3!important;
  white-space:normal!important;
  font-family:Georgia,"Times New Roman",serif!important;
  font-size:18px!important;
  font-weight:600!important;
  line-height:1.12!important;
  letter-spacing:0!important;
  text-transform:uppercase!important;
  text-align:left!important;
}
html body #dashboardView .wotm-winner-copy strong{color:var(--text,#f2eee7)!important}
html body #dashboardView .highest-rated-panel .hr-name{color:#ead392!important}

/* ---------- Watch Room score geometry ---------- */
html body #roomView .room-slot-filled .watch-card{
  display:grid!important;
  grid-template-rows:minmax(0,1fr) auto!important;
  overflow:hidden!important;
}
html body #roomView .room-slot-filled .watch-image,
html body #roomView .room-slot-filled .watch-tile-photo{
  min-height:0!important;
  width:100%!important;
  max-width:100%!important;
  overflow:hidden!important;
}
html body #roomView .room-slot-filled .watch-tile-photo img,
html body #roomView .room-slot-filled .watch-image img{
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:contain!important;
  object-position:center!important;
  transform:none!important;
}
html body #roomView .room-slot-filled .watch-card-footer{
  position:static!important;
  inset:auto!important;
  z-index:auto!important;
  min-width:0!important;
  min-height:64px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:2px!important;
  padding:5px 5px 6px!important;
  overflow:hidden!important;
  pointer-events:none!important;
}
html body #roomView .room-slot-filled .watch-meta{
  width:100%!important;
  min-height:16px!important;
  margin-top:auto!important;
  display:flex!important;
  align-items:flex-end!important;
  justify-content:center!important;
  overflow:visible!important;
}
html body #roomView .room-slot-filled .overall-score{
  position:static!important;
  inset:auto!important;
  display:block!important;
  margin:0 auto!important;
  overflow:visible!important;
  line-height:1!important;
  text-align:center!important;
  transform:none!important;
}

/* ---------- Side menu account/footer ---------- */
html body .wk-account-menu.wk-menu-account-footer{
  position:static!important;
  inset:auto!important;
  z-index:auto!important;
  width:100%!important;
  display:grid!important;
  gap:9px!important;
  margin:7px 0 0!important;
  padding:13px 10px 10px!important;
  border-top:1px solid rgba(199,164,95,.18)!important;
  background:transparent!important;
}
html body .wk-account-menu.wk-menu-account-footer[hidden]{display:none!important}
html body .wk-account-copy{display:grid!important;gap:3px!important;min-width:0!important}
html body .wk-account-copy>span{
  color:#8e8274!important;
  font-size:8px!important;
  font-weight:750!important;
  letter-spacing:.13em!important;
  text-transform:uppercase!important;
}
html body .wk-account-email{
  padding:0!important;
  color:#ded6ca!important;
  font-size:10px!important;
  line-height:1.3!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
html body #wkSignOut{
  width:100%!important;
  min-height:38px!important;
  border:1px solid rgba(199,164,95,.25)!important;
  border-radius:8px!important;
  background:#15130f!important;
  color:#d9bd7c!important;
  padding:0 10px!important;
  text-align:left!important;
  font-size:10px!important;
  font-weight:700!important;
}
html body .wk-account-button,
html body .wk-account-popover{display:none!important}

/* ---------- Universal modal ownership ---------- */
body.wk-fullscreen-modal-open .menu-toggle,
body.wk-fullscreen-modal-open .menu-backdrop,
body.wk-fullscreen-modal-open .wk-account-button{
  display:none!important;
}
body.wk-fullscreen-modal-open{overflow:hidden!important;overscroll-behavior:none!important}

/* ---------- QC parent shell: one scroll owner (the iframe document) ---------- */
@media(max-width:780px){
  body.wk-qc-active{overflow:hidden!important;overscroll-behavior:none!important}
  body.wk-qc-active #qcView.qc-tool-view{
    position:fixed!important;
    inset:0!important;
    z-index:5000!important;
    width:100vw!important;
    max-width:none!important;
    height:100dvh!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
  }
  body.wk-qc-active #qcToolFrame.qc-tool-frame{
    width:100%!important;
    height:100dvh!important;
    min-height:0!important;
    border:0!important;
    border-radius:0!important;
  }
}

/* =====================================================================
   Mobile-only approved rules
   ===================================================================== */
@media(max-width:760px){
  /* M001 + M003: History and Library share the same four-up segmented tabs. */
  html body #timelineView .history-tabs,
  html body #libraryView .library-column-sets{
    width:100%!important;
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:4px!important;
    margin:0 0 12px!important;
    padding:4px!important;
    border:1px solid rgba(198,159,91,.18)!important;
    border-radius:12px!important;
    background:rgba(255,255,255,.025)!important;
  }
  html body #timelineView .history-tab,
  html body #libraryView .library-column-sets button{
    width:100%!important;
    min-width:0!important;
    min-height:38px!important;
    margin:0!important;
    padding:9px 3px!important;
    border:0!important;
    border-radius:8px!important;
    background:transparent!important;
    color:rgba(239,229,211,.58)!important;
    font-family:var(--sans,Inter,"Segoe UI",Arial,sans-serif)!important;
    font-size:9px!important;
    font-weight:700!important;
    line-height:1!important;
    letter-spacing:.055em!important;
    text-transform:uppercase!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:clip!important;
  }
  html body #timelineView .history-tab.active,
  html body #libraryView .library-column-sets button.active{
    background:rgba(198,159,91,.14)!important;
    color:#ead7ae!important;
    box-shadow:none!important;
  }

  /* M002: compact accordion headers, no duplicated large title or description. */
  html body #libraryView .library-control-grid{grid-template-columns:1fr!important;gap:10px!important}
  html body #libraryView .wk-collapse-trigger{min-height:50px!important;padding:13px 15px!important;font-size:10px!important}
  html body #libraryView .wk-collapse-body{padding:0 14px 14px!important}

  /* M004: search full width, Location + Type, then Metal full width. */
  html body #libraryView .library-tools{display:grid!important;gap:9px!important;padding-top:14px!important}
  html body #libraryView .library-tools>input{width:100%!important;grid-column:1/-1!important}
  html body #libraryView .library-filter-row{
    width:100%!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }
  html body #libraryView #libraryLocation,
  html body #libraryView #libraryType{grid-column:auto!important;min-width:0!important;width:100%!important}
  html body #libraryView #libraryMedal{grid-column:1/-1!important;width:100%!important}
  html body #libraryView .library-tools input,
  html body #libraryView .library-tools select{min-height:44px!important;padding-left:10px!important;padding-right:28px!important;font-size:10px!important}

  /* M005: Category Weights = 2 rows × 3 columns. */
  html body #weightEditorModal .weight-editor-modal-card .weight-grid{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:8px 6px!important;
  }
  html body #weightEditorModal .weight-grid label{
    min-width:0!important;
    gap:4px!important;
    font-size:8.5px!important;
    line-height:1.1!important;
    overflow-wrap:anywhere!important;
  }
  html body #weightEditorModal .weight-input-wrap input{
    height:42px!important;
    min-width:0!important;
    padding:0 23px 0 7px!important;
    font-size:12px!important;
  }
  html body #weightEditorModal .weight-input-wrap span{right:7px!important;font-size:10px!important}
  html body #weightEditorModal .weight-modal-body{padding:14px 10px!important}

  /* M006: Rank + Watch + first/active score remain visible at initial scroll. */
  html body #libraryView .table-shell{width:100%!important;overflow-x:auto!important;overflow-y:visible!important}
  html body #libraryView #libraryTable{table-layout:fixed!important;margin:0!important}
  html body #libraryView #libraryTable col.col-rank{width:42px!important}
  html body #libraryView #libraryTable col.col-watch{width:185px!important}
  html body #libraryView #libraryTable col.col-medal{width:30px!important}
  html body #libraryView #libraryTable col.col-overall{width:60px!important}
  html body #libraryView #libraryTable col.col-score,
  html body #libraryView #libraryTable col.col-fidelity,
  html body #libraryView #libraryTable col.col-wear{width:70px!important}
  html body #libraryView #libraryTable col.col-last-worn{width:100px!important}
  html body #libraryView #libraryTable.library-view-overall,
  html body #libraryView #libraryTable.library-view-fidelity{width:100%!important;min-width:100%!important}
  html body #libraryView #libraryTable.library-view-philosophy{width:677px!important;min-width:677px!important}
  html body #libraryView #libraryTable.library-view-wear{width:817px!important;min-width:817px!important}
  html body #libraryView #libraryTable th,
  html body #libraryView #libraryTable td{padding-left:6px!important;padding-right:6px!important}
  html body #libraryView #libraryTable .watch-name-line,
  html body #libraryView #libraryTable .watch-differentiators{white-space:normal!important;overflow-wrap:anywhere!important}
  html body #libraryView #libraryTable .watch-differentiators{font-size:9px!important;line-height:1.2!important}
  html body #libraryView #libraryTable .overall-cell,
  html body #libraryView #libraryTable .fidelity-column{text-align:right!important}

  /* M007: real mobile layouts for both feature cards. */
  html body #dashboardView .dashboard-columns.dashboard-top-row{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:12px!important;
  }
  html body #dashboardView .dashboard-match-panel{
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  html body #dashboardView .watch-of-month-body,
  html body #dashboardView .highest-rated-body{min-height:0!important;height:auto!important;overflow:hidden!important}
  html body #dashboardView .wotm-winner{
    display:grid!important;
    grid-template-columns:94px minmax(0,1fr)!important;
    gap:12px!important;
    align-items:center!important;
    min-height:132px!important;
    padding:12px!important;
  }
  html body #dashboardView .wotm-winner-image{width:94px!important;height:108px!important;min-width:0!important}
  html body #dashboardView .wotm-winner-copy{min-width:0!important;gap:3px!important}
  html body #dashboardView .wotm-winner-copy strong,
  html body #dashboardView .highest-rated-panel .hr-name{font-size:17px!important;line-height:1.1!important;-webkit-line-clamp:3!important}
  html body #dashboardView .wotm-winner-copy small{font-size:9.5px!important;line-height:1.2!important;white-space:normal!important}
  html body #dashboardView .wotm-runner-up{
    display:grid!important;
    grid-template-columns:60px minmax(0,1fr)!important;
    gap:10px!important;
    align-items:center!important;
    min-height:86px!important;
    padding:10px 12px!important;
  }
  html body #dashboardView .wotm-runner-image{width:60px!important;height:64px!important}
  html body #dashboardView .wotm-runner-copy{min-width:0!important}
  html body #dashboardView .wotm-runner-copy strong{white-space:normal!important;overflow-wrap:anywhere!important}
  html body #dashboardView .highest-rated-panel .hr-feature{
    width:100%!important;
    min-height:0!important;
    height:auto!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-rows:auto 190px auto!important;
    grid-template-areas:"rank score" "image image" "copy copy"!important;
    gap:9px 10px!important;
    padding:12px!important;
    overflow:hidden!important;
  }
  html body #dashboardView .highest-rated-panel .hr-rank{grid-area:rank!important;justify-self:start!important;align-self:center!important}
  html body #dashboardView .highest-rated-panel .hr-score-plaque{grid-area:score!important;justify-self:end!important;align-self:start!important;width:auto!important;min-width:88px!important;min-height:50px!important;margin:0!important;align-items:center!important}
  html body #dashboardView .highest-rated-panel .hr-image{
    grid-area:image!important;
    width:100%!important;
    height:190px!important;
    min-height:190px!important;
    max-height:190px!important;
    justify-self:stretch!important;
    overflow:hidden!important;
  }
  html body #dashboardView .highest-rated-panel .hr-image img{width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;transform:none!important}
  html body #dashboardView .highest-rated-panel .hr-copy{grid-area:copy!important;width:100%!important;min-width:0!important;align-items:flex-start!important;text-align:left!important}
  html body #dashboardView .highest-rated-panel .hr-name{text-align:left!important}
  html body #dashboardView .highest-rated-panel .hr-details{position:static!important;width:auto!important;height:auto!important;background:none!important;text-align:left!important;white-space:normal!important}

  /* M008: maximize usable photo well; score stays centered below. */
  html body #roomView .room-slot-filled .watch-image{padding:2px 0 0!important}
  html body #roomView .room-slot-filled .watch-tile-photo{padding:0!important}
  html body #roomView .room-slot-filled .watch-card-footer{min-height:61px!important;padding:4px 3px 5px!important;gap:1px!important}
  html body #roomView .room-slot-filled .watch-meta{min-height:14px!important}
  html body #roomView .room-slot-filled .overall-score{font-size:10px!important}

  /* M009: deliberate mobile drawer, not a squeezed desktop rail. */
  html body .topbar{
    width:min(86vw,360px)!important;
    padding:max(70px,calc(env(safe-area-inset-top) + 58px)) 14px max(18px,env(safe-area-inset-bottom))!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
  }
  html body .topnav{gap:7px!important;margin-top:12px!important}
  html body .topnav .utility-nav.wear-menu-card{
    width:100%!important;
    min-height:58px!important;
    padding:8px 10px!important;
    gap:9px!important;
    border-radius:10px!important;
  }
  html body .wear-menu-card .wear-menu-icon-copy{gap:10px!important;min-width:0!important}
  html body .wear-menu-icon{width:34px!important;height:34px!important;border-radius:8px!important}
  html body .wear-menu-icon svg{width:17px!important;height:17px!important}
  html body .wear-menu-copy strong{
    max-width:100%!important;
    font-size:12px!important;
    line-height:1.15!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  html body .wear-menu-copy small{
    display:-webkit-box!important;
    margin-top:3px!important;
    max-width:100%!important;
    overflow:hidden!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
    font-size:9.5px!important;
    line-height:1.25!important;
    white-space:normal!important;
  }
  html body .wear-menu-arrow{font-size:18px!important;margin-left:auto!important}
  html body .topnav .wk-menu-secondary{display:flex!important}
  html body .app-version-label{margin-top:4px!important;text-align:center!important}

  /* M010: generic full-screen mobile task shell. */
  html body .modal.open,
  html body .modal[aria-hidden="false"]{
    position:fixed!important;
    inset:0!important;
    z-index:10000!important;
    width:100vw!important;
    height:100dvh!important;
    max-width:none!important;
    max-height:none!important;
    padding:0!important;
    overflow:hidden!important;
    background:rgba(5,5,5,.96)!important;
  }
  html body .modal.open>.modal-card,
  html body .modal[aria-hidden="false"]>.modal-card{
    width:100%!important;
    max-width:none!important;
    height:100dvh!important;
    max-height:100dvh!important;
    margin:0!important;
    border-radius:0!important;
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr) auto!important;
    overflow:hidden!important;
  }
  html body .modal.open>.modal-card>.modal-head,
  html body .modal[aria-hidden="false"]>.modal-card>.modal-head{
    position:relative!important;
    z-index:4!important;
    background:#0e0d0c!important;
    border-bottom:1px solid rgba(199,164,95,.17)!important;
  }
  html body .modal.open>.modal-card>.modal-actions,
  html body .modal[aria-hidden="false"]>.modal-card>.modal-actions,
  html body .modal.open>.modal-card>form>.modal-actions,
  html body .modal[aria-hidden="false"]>.modal-card>form>.modal-actions{
    position:relative!important;
    z-index:4!important;
    background:#0e0d0c!important;
    border-top:1px solid rgba(199,164,95,.17)!important;
  }
  html body #watchRoomSetupModal .setup-room-body,
  html body #weightEditorModal .weight-modal-body,
  html body #aiExportModal .collection-ai-body,
  html body #aiExportModal .collection-ai-ready,
  html body .timeline-log-modal .compare-content-shell{
    min-height:0!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior:contain!important;
  }
  html body .wear-mode.open,
  html body .wear-mode[aria-hidden="false"]{
    position:fixed!important;
    inset:0!important;
    z-index:10000!important;
    width:100vw!important;
    height:100dvh!important;
    max-width:none!important;
    max-height:none!important;
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr) auto!important;
    overflow:hidden!important;
  }
  html body .wear-mode.open>.wear-mode-head,
  html body .wear-mode.open>.wear-mode-actions,
  html body .wear-mode[aria-hidden="false"]>.wear-mode-head,
  html body .wear-mode[aria-hidden="false"]>.wear-mode-actions{position:relative!important;z-index:4!important;background:#0e0d0c!important}
  html body .wear-mode.open>.wear-selection-grid,
  html body .wear-mode[aria-hidden="false"]>.wear-selection-grid,
  html body .wear-mode.open>.compare-content-shell,
  html body .wear-mode[aria-hidden="false"]>.compare-content-shell{min-height:0!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important}
}


/* =====================================================================
   v0.2.1 final architecture safeguards
   These selectors intentionally sit last in the cascade.
   ===================================================================== */

/* QC is a full-screen task on mobile. The iframe owns navigation and scroll. */
@media(max-width:780px){
  body.wk-qc-active .menu-toggle,
  body.wk-qc-active .menu-backdrop,
  body.wk-qc-active .wk-account-menu{display:none!important}
}

@media(max-width:760px){
  /* Full-screen modal contract: each workflow has one sticky header, one
     scrollable middle region, and one sticky footer. */
  html body #watchRoomSetupModal>.watch-room-setup-card,
  html body #weightEditorModal>.weight-editor-modal-card,
  html body #aiExportModal>.collection-ai-modal-card,
  html body #logTodayWearModal>.timeline-log-card,
  html body #logMissedWearPickModal>.timeline-log-card,
  html body #logMissedWearDateModal>.missed-wear-date-card{
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr) auto!important;
    width:100%!important;
    height:100dvh!important;
    max-height:100dvh!important;
    overflow:hidden!important;
  }
  html body #watchRoomSetupModal .setup-room-body,
  html body #weightEditorModal .weight-modal-body,
  html body #logTodayWearModal .compare-content-shell,
  html body #logMissedWearPickModal .compare-content-shell{
    grid-row:2!important;
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior:contain!important;
  }
  html body #aiExportModal .collection-ai-body,
  html body #aiExportModal .collection-ai-ready{
    grid-row:2!important;
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior:contain!important;
  }
  html body #watchRoomSetupModal .setup-room-actions,
  html body #weightEditorModal>.weight-editor-modal-card>.modal-actions,
  html body #aiExportModal>.collection-ai-modal-card>.modal-actions,
  html body #logTodayWearModal>.timeline-log-card>.modal-actions,
  html body #logMissedWearPickModal>.timeline-log-card>.modal-actions{
    grid-row:3!important;
  }
  html body #logMissedWearDateModal>.missed-wear-date-card{
    grid-template-rows:auto auto minmax(0,1fr)!important;
  }
  html body #logMissedWearDateModal .missed-wear-watch-row{grid-row:2!important}
  html body #logMissedWearDateModal form{
    grid-row:3!important;
    min-height:0!important;
    display:grid!important;
    grid-template-rows:minmax(0,1fr) auto auto!important;
    overflow:hidden!important;
  }
  html body #logMissedWearDateModal form>.form-grid{
    min-height:0!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }
  html body #watchModal>.modal-card{
    display:grid!important;
    grid-template-rows:auto auto minmax(0,1fr)!important;
  }
  html body #watchModal>.modal-card>.modal-head{grid-row:1!important}
  html body #watchModal>.modal-card>.modal-tabs{grid-row:2!important;overflow-x:auto!important;overflow-y:hidden!important}
  html body #watchModal #watchForm{
    grid-row:3!important;
    min-height:0!important;
    display:grid!important;
    grid-template-rows:minmax(0,1fr) auto!important;
    overflow:hidden!important;
  }
  html body #watchModal #watchForm>.modal-pane.active{
    grid-row:1!important;
    min-height:0!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }
  html body #watchModal #watchForm>.modal-actions{grid-row:2!important}

  /* Full-screen non-modal task surfaces use the same ownership model. */
  html body #wearMode,
  html body #compareMode,
  html body #compareResultsMode{
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr) auto!important;
    height:100dvh!important;
    max-height:100dvh!important;
    overflow:hidden!important;
  }
  html body #wearMode>.compare-content-shell,
  html body #compareMode>#compareSelectionGrid,
  html body #compareResultsMode>#compareResultsGrid{
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior:contain!important;
  }

  /* Side drawer backdrop owns the page while open. */
  html body.menu-open{overflow:hidden!important;overscroll-behavior:none!important}
}
@media(max-width:760px){
  body.wk-modal-scroll-lock{
    position:fixed!important;
    top:var(--wk-modal-scroll-y,0)!important;
    left:0!important;
    right:0!important;
    width:100%!important;
  }
}
@media(max-width:760px){
  /* The existing hamburger becomes the drawer-owned close control while open. */
  html body.menu-open #menuToggle.menu-toggle{
    left:min(calc(86vw - 54px),306px)!important;
    top:max(12px,calc(env(safe-area-inset-top) + 8px))!important;
    width:40px!important;
    height:40px!important;
    border-radius:9px!important;
    background:#15130f!important;
    border-color:rgba(199,164,95,.28)!important;
    box-shadow:none!important;
  }
}
