/* Genesis Home stable visual contract
   One surface. One hierarchy. Loaded last. */

#home.home-view{
  --home-max: 1440px;
  --home-gap: clamp(30px,4vw,56px);
  --home-radius: 22px;
  --home-tile-radius: 16px;
  --home-border: color-mix(in srgb,var(--border) 72%,transparent);
  display:flex!important;
  flex-direction:column;
  gap:var(--home-gap);
  width:min(100%,var(--home-max));
  margin:0 auto;
  padding:8px clamp(14px,2.5vw,34px) 64px;
}

#home.home-view > [hidden],
#home.home-view #homeCompatibility{
  display:none!important;
}

/* NOW */
#home .home-primary{
  display:grid;
  gap:18px;
  padding:clamp(26px,4vw,52px);
  border-radius:30px;
  background:
    radial-gradient(circle at 88% 12%,color-mix(in srgb,var(--accent,#7c5cff) 22%,transparent),transparent 34%),
    color-mix(in srgb,var(--surface) 94%,var(--page,#111) 6%);
  box-shadow:0 18px 50px rgba(0,0,0,.10);
}
#home .home-primary-copy{display:grid;gap:4px}
#home .home-primary h2{
  margin:0;
  max-width:880px;
  font-size:clamp(36px,5vw,66px);
  line-height:.98;
  letter-spacing:-.045em;
}
#home .home-focus{display:grid;gap:6px}
#home .home-focus input{
  width:100%;
  min-height:56px;
  padding:0 16px;
  border:1px solid var(--home-border);
  border-radius:15px;
  background:color-mix(in srgb,var(--surface) 82%,transparent);
  color:inherit;
  font:inherit;
  font-size:clamp(17px,2vw,22px);
}
#home .home-focus small,
#home .home-capacity small{color:var(--muted)}
#home .home-now-guidance{display:block;margin:0}
#home .home-next-action,
#home .today-usefulness-next{
  display:grid;
  gap:6px;
  padding:17px 18px;
  border:1px solid var(--home-border);
  border-radius:17px;
  background:color-mix(in srgb,var(--surface) 78%,transparent);
}
#home .home-next-action strong,
#home .today-usefulness-next strong{
  font-size:clamp(20px,2.4vw,29px);
  line-height:1.25;
  letter-spacing:-.02em;
}
#home .home-capacity{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(130px,280px) auto;
  gap:14px;
  align-items:center;
  padding-top:16px;
  border-top:1px solid var(--home-border);
}
#home .home-capacity>div:first-child{display:grid;gap:3px}
#home .home-capacity>div:first-child>span{
  font-size:11px;
  font-weight:800;
  letter-spacing:.09em;
  text-transform:uppercase;
  opacity:.62;
}

/* Repeated section language */
#home .home-section{display:grid;gap:14px}
#home .home-section-head{
  display:flex;
  justify-content:space-between;
  align-items:end;
  gap:18px;
  padding:0 2px;
}
#home .home-section-head>div:first-child{display:grid;gap:2px}
#home .home-section-head h2{
  margin:0;
  font-size:clamp(28px,3vw,40px);
  line-height:1;
  letter-spacing:-.035em;
}
#home .home-section-head .eyebrow{margin:0;opacity:.58}
#home .home-section-actions{display:flex;align-items:center;gap:8px}
#home .home-icon-button,
#home .home-overflow>summary{
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  padding:0;
  border-radius:999px;
  border:1px solid color-mix(in srgb,var(--accent,#8a72ff) 68%,var(--border));
  background:transparent;
  color:inherit;
  font-size:18px;
  cursor:pointer;
}
#home .home-icon-button:hover,
#home .home-overflow>summary:hover,
#home .home-icon-button:focus-visible,
#home .home-overflow>summary:focus-visible{
  background:color-mix(in srgb,var(--accent,#8a72ff) 12%,transparent);
}
#home .home-overflow{position:relative}
#home .home-overflow>summary{list-style:none;border-color:transparent;font-size:14px}
#home .home-overflow>summary::-webkit-details-marker{display:none}
#home .home-overflow[open]{
  z-index:30;
}
#home .home-overflow>button{
  position:absolute;
  right:0;
  top:44px;
  min-width:180px;
  padding:11px 12px;
  border:1px solid var(--home-border);
  border-radius:12px;
  background:var(--surface);
  color:inherit;
  text-align:left;
  box-shadow:0 14px 38px rgba(0,0,0,.20);
  z-index:31;
}
#home .home-overflow>button+button{top:88px}
#home .home-panel{
  min-width:0;
  padding:clamp(14px,2vw,20px);
  border:1px solid var(--home-border);
  border-radius:var(--home-radius);
  background:color-mix(in srgb,var(--surface) 95%,var(--page,#111) 5%);
  box-shadow:0 8px 26px rgba(0,0,0,.06);
}
#home .home-panel-meta{
  display:flex;
  gap:6px;
  align-items:baseline;
  margin:0 0 12px;
  color:var(--muted);
  font-size:12px;
}
#home .home-filter{margin:0 0 12px}
#home .home-filter>summary{
  width:max-content;
  cursor:pointer;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}
#home .home-filter[open] .daily-checklist-filters{margin-top:10px}

/* Medication */
#home .medication-dashboard-list{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(250px,1fr))!important;
  gap:12px!important;
}
#home .medication-dashboard-row{
  display:flex!important;
  min-width:0;
  min-height:124px;
  flex-direction:column;
  justify-content:space-between;
  gap:16px!important;
  padding:17px!important;
  border:0!important;
  border-radius:var(--home-tile-radius)!important;
  background:color-mix(in srgb,var(--surface) 86%,var(--page,#111) 14%)!important;
  box-shadow:none!important;
}
#home .medication-dashboard-row strong{font-size:17px;line-height:1.25}
#home .medication-dashboard-row small{color:var(--muted)}
#home .medication-dashboard-actions{display:flex!important;flex-wrap:wrap;gap:8px!important}

/* Routines */
#home .home-routines .today-kanban-controls{
  display:flex!important;
  justify-content:space-between;
  gap:10px;
  margin:0 0 14px;
}
#home .home-routines .today-kanban-filters{
  display:flex!important;
  gap:7px;
  overflow-x:auto;
  scrollbar-width:none;
}
#home .home-routines .today-kanban-filters::-webkit-scrollbar{display:none}
#home .home-routines .today-kanban-filters button{
  flex:0 0 auto;
  border-radius:999px!important;
}
#home .home-routines .today-kanban-board{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:12px!important;
}
#home .home-routines .today-kanban-column{
  min-width:0!important;
  border:0!important;
  border-radius:var(--home-tile-radius)!important;
  background:color-mix(in srgb,var(--surface) 86%,var(--page,#111) 14%)!important;
  overflow:hidden!important;
}
#home .home-routines .today-kanban-column-header{
  padding:14px 15px 9px!important;
  border:0!important;
  background:transparent!important;
}
#home .home-routines .today-kanban-stack{padding:0 9px 9px!important}
#home .home-routines .today-kanban-arena{
  border:0!important;
  background:transparent!important;
}
#home .home-routines .today-kanban-card{
  border:0!important;
  border-radius:13px!important;
  background:color-mix(in srgb,var(--surface) 96%,transparent)!important;
  box-shadow:none!important;
}
#home .home-routines .today-kanban-more{display:none!important}

/* Creative */
#home #creativeChecklistList{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr))!important;
  gap:12px!important;
  max-height:none!important;
  overflow:visible!important;
}
#home .home-creative .daily-checklist-row{
  display:grid!important;
  min-width:0;
  min-height:136px;
  grid-template-columns:auto 1fr;
  grid-template-rows:1fr auto;
  gap:12px!important;
  align-items:start!important;
  padding:16px!important;
  border:0!important;
  border-radius:var(--home-tile-radius)!important;
  background:color-mix(in srgb,var(--surface) 86%,var(--page,#111) 14%)!important;
  box-shadow:none!important;
}
#home .home-creative .daily-checklist-copy{display:grid;gap:6px}
#home .home-creative .daily-checklist-copy strong{font-size:16px;line-height:1.3}
#home .home-creative .daily-checklist-taxonomy{color:var(--muted);font-size:12px}
#home .home-creative .daily-checklist-row-actions{
  grid-column:1/-1;
  display:flex!important;
  justify-content:space-between;
  align-items:center;
}
#home .home-empty,
#home .daily-checklist-empty{
  min-height:110px;
  display:grid;
  place-items:center;
  padding:18px;
  border-radius:var(--home-tile-radius);
  background:color-mix(in srgb,var(--surface) 86%,var(--page,#111) 14%);
  color:var(--muted);
  text-align:center;
}

/* Schedule, quick add, later */
#home .home-schedule .os-compact-list{display:grid;gap:9px}
#home .home-quick-add,
#home .home-later{
  border:1px solid var(--home-border);
  border-radius:18px;
  background:transparent;
}
#home .home-quick-add>summary,
#home .home-later>summary{
  cursor:pointer;
  padding:15px 17px;
  font-weight:750;
}
#home .home-quick-add[open] .today-quick-buttons,
#home .home-later[open] .later-content{
  padding:0 17px 17px;
}
#home .home-later>summary{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
}
#home .home-later>summary span:first-child{display:grid;gap:2px}
#home .home-later>summary small{color:var(--muted);font-weight:500}

/* Theme discipline */
:root[data-genesis-appearance="dark"] #home.home-view{--page:#1d1d1f}
:root[data-genesis-appearance="dark"] #home .home-panel{background:#2c2c30}
:root[data-genesis-appearance="dark"] #home .medication-dashboard-row,
:root[data-genesis-appearance="dark"] #home .home-routines .today-kanban-column,
:root[data-genesis-appearance="dark"] #home .home-creative .daily-checklist-row,
:root[data-genesis-appearance="dark"] #home .home-empty,
:root[data-genesis-appearance="dark"] #home .daily-checklist-empty{background:#3a3942!important}
:root[data-genesis-appearance="light"] #home.home-view{--page:#f5f5f7}
:root[data-genesis-appearance="light"] #home .home-panel{background:#f5f5f7}
:root[data-genesis-appearance="light"] #home .medication-dashboard-row,
:root[data-genesis-appearance="light"] #home .home-routines .today-kanban-column,
:root[data-genesis-appearance="light"] #home .home-creative .daily-checklist-row,
:root[data-genesis-appearance="light"] #home .home-empty,
:root[data-genesis-appearance="light"] #home .daily-checklist-empty{background:#fff!important}

@media(max-width:980px){
  #home .home-routines .today-kanban-board{grid-template-columns:1fr!important}
}
@media(max-width:720px){
  #home.home-view{--home-gap:30px;padding-inline:10px}
  #home .home-primary{padding:22px;border-radius:22px}
  #home .home-capacity{grid-template-columns:1fr}
  #home .home-section-head{align-items:center}
  #home .medication-dashboard-list,
  #home #creativeChecklistList{grid-template-columns:1fr!important}
  #home .home-panel{padding:12px}
}
@media(prefers-reduced-motion:reduce){
  #home *,
  #home *::before,
  #home *::after{
    scroll-behavior:auto!important;
    transition:none!important;
    animation:none!important;
  }
}


/* Shell QA pass: make navigation and section identity unmistakable. */
body:has(#home.home-view) .shell{
  grid-template-columns:224px minmax(0,1fr)!important;
}
body:has(#home.home-view) .shell>aside{
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  padding:20px 14px!important;
  gap:18px!important;
  background:color-mix(in srgb,var(--surface) 92%,#000 8%)!important;
  border-right:1px solid var(--home-border)!important;
  overflow-y:auto!important;
}
body:has(#home.home-view) .shell>aside .brand{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  padding:0 6px 10px!important;
  margin:0!important;
}
body:has(#home.home-view) .shell>aside .brand strong{
  font-size:15px!important;
  line-height:1.1!important;
}
body:has(#home.home-view) .shell>aside .brand small{
  display:block!important;
  margin-top:2px!important;
  font-size:10px!important;
  line-height:1.2!important;
  letter-spacing:.01em!important;
  text-transform:none!important;
  opacity:.56!important;
}
body:has(#home.home-view) .genesis-sidebar-nav{
  display:flex!important;
  flex-direction:column!important;
  gap:14px!important;
}
body:has(#home.home-view) .genesis-nav-group{
  display:flex!important;
  flex-direction:column!important;
  gap:3px!important;
}
body:has(#home.home-view) .genesis-nav-label{
  margin:4px 10px 5px!important;
  font-size:10px!important;
  line-height:1.2!important;
  font-weight:800!important;
  letter-spacing:.11em!important;
  text-transform:uppercase!important;
  color:var(--muted)!important;
}
body:has(#home.home-view) .genesis-sidebar-nav .nav,
body:has(#home.home-view) .genesis-nav-disclosure>summary{
  min-height:38px!important;
  padding:8px 10px!important;
  margin:0!important;
  border:0!important;
  border-radius:10px!important;
  font-size:14px!important;
  line-height:1.2!important;
  font-weight:650!important;
  color:inherit!important;
  background:transparent!important;
  text-decoration:none!important;
}
body:has(#home.home-view) .genesis-sidebar-nav .nav{
  display:flex!important;
  align-items:center!important;
  gap:9px!important;
  width:100%!important;
  text-align:left!important;
}
body:has(#home.home-view) .genesis-sidebar-nav .nav.active,
body:has(#home.home-view) .genesis-sidebar-nav .nav[aria-current="page"]{
  background:color-mix(in srgb,var(--text,currentColor) 12%,transparent)!important;
  color:inherit!important;
  box-shadow:none!important;
}
body:has(#home.home-view) .genesis-sidebar-nav .nav-glyph{
  width:16px!important;
  flex:0 0 16px!important;
  font-size:13px!important;
  text-align:center!important;
  opacity:.78!important;
}
body:has(#home.home-view) .genesis-nav-disclosure{
  border-top:1px solid var(--home-border);
  padding-top:8px;
}
body:has(#home.home-view) .genesis-nav-disclosure>summary{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  cursor:pointer!important;
  list-style:none!important;
  color:var(--muted)!important;
}
body:has(#home.home-view) .genesis-nav-disclosure>summary::-webkit-details-marker{display:none}
body:has(#home.home-view) .genesis-nav-disclosure>summary::after{
  content:"⌄";
  font-size:12px;
  transition:transform .15s ease;
}
body:has(#home.home-view) .genesis-nav-disclosure[open]>summary::after{transform:rotate(180deg)}
body:has(#home.home-view) .genesis-nav-disclosure>.nav{
  padding-left:18px!important;
}
body:has(#home.home-view) .genesis-sidebar-footer{
  margin-top:auto;
  display:grid;
  gap:10px;
  padding-top:10px;
  border-top:1px solid var(--home-border);
}
body:has(#home.home-view) .genesis-sidebar-footer .command-hint{
  width:100%;
  min-height:38px;
  justify-content:space-between;
  border-radius:10px!important;
  font-size:12px!important;
}
body:has(#home.home-view) .genesis-account-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  color:var(--muted);
}
body:has(#home.home-view) .genesis-account-row small{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:10px;
}
body:has(#home.home-view) .genesis-account-row button{
  padding:5px 7px!important;
  font-size:10px!important;
  border-radius:8px!important;
}

/* Section labels must never disappear behind legacy Today styles. */
#home.home-view .home-section-head{
  display:flex!important;
  visibility:visible!important;
  opacity:1!important;
  min-height:44px;
}
#home.home-view .home-section-head h2,
#home.home-view .home-section-head .eyebrow{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  color:inherit!important;
  -webkit-text-fill-color:currentColor!important;
}
#home.home-view .home-section-head .eyebrow{
  color:var(--muted)!important;
}
#home.home-view .home-section-head h2{
  font-weight:760!important;
}
#home.home-view .home-section{
  scroll-margin-top:20px;
}

/* The work-session prompt is supportive, not a second hero. */
#home .home-session-start{
  display:grid;
  grid-template-columns:minmax(130px,.45fr) minmax(0,1fr);
  gap:14px;
  align-items:end;
  padding:14px 0 2px;
}
#home .home-session-start>div:first-child{
  display:grid;
  gap:2px;
}
#home .home-session-start>div:first-child span{
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
}
#home .home-session-start>div:first-child strong{
  font-size:15px;
  line-height:1.25;
}
#home .home-session-start .session-start{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
}
#home .home-session-start .session-start input{
  min-height:44px;
  border-radius:12px!important;
}

@media(max-width:980px){
  body:has(#home.home-view) .shell{
    grid-template-columns:196px minmax(0,1fr)!important;
  }
}
@media(max-width:820px){
  body:has(#home.home-view) .shell{
    grid-template-columns:1fr!important;
  }
  body:has(#home.home-view) .shell>aside{
    position:static!important;
    height:auto!important;
    padding:12px!important;
    border-right:0!important;
    border-bottom:1px solid var(--home-border)!important;
  }
  body:has(#home.home-view) .genesis-sidebar-nav{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:6px!important;
  }
  body:has(#home.home-view) .genesis-sidebar-nav>.genesis-nav-group:first-child{
    grid-column:1/-1;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  body:has(#home.home-view) .genesis-sidebar-nav>.genesis-nav-group:nth-child(2){
    grid-column:1/-1;
    display:flex!important;
    flex-direction:row!important;
    overflow-x:auto!important;
  }
  body:has(#home.home-view) .genesis-nav-label{display:none!important}
  body:has(#home.home-view) .genesis-nav-disclosure{
    border-top:0;
    padding-top:0;
  }
  body:has(#home.home-view) .genesis-sidebar-footer{
    display:none;
  }
  #home .home-session-start{
    grid-template-columns:1fr;
  }
}
@media(max-width:560px){
  body:has(#home.home-view) .genesis-sidebar-nav{
    grid-template-columns:1fr 1fr;
  }
  #home .home-session-start .session-start{
    grid-template-columns:1fr;
  }
}
