.workspace .work-content {
  max-width: 1360px;
  padding-top: clamp(1.25rem, 3.2vw, 2.8rem);
}
.workspace-mast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .5rem 1rem;
}
.workspace-mast .workspace-title {
  margin: 0;
  min-width: 0;
  color: var(--fg);
  font: 700 clamp(1.85rem, 3.6vw, 3rem)/1.22 var(--sans);
  letter-spacing: -.01em;
}
.workspace-title > span { color: var(--fg); }
.workspace-title > b {
  margin-inline: .035em;
  color: var(--rule);
  font-weight: 400;
}
.schedule-mast, .settings-mast {
  padding-bottom: clamp(.6rem, 1.2vw, 1rem);
  border-bottom: 2px solid var(--rule);
}
.workspace-tools, .mast-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: .65rem;
}
.workspace-tools { grid-column: 2; grid-row: 1; }
.mast-actions .syncstatus { min-height: 44px; }
.compact-mast { margin: -.45rem 0 .4rem; }
.settings-mast { margin-bottom: 1rem; }
.schedule-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .2rem 1rem;
  padding: .55rem 0 .8rem;
}
.schedule-stamp {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 0 1.15rem;
  align-items: center;
}
.schedule-date {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .15rem .4rem;
  color: var(--fg);
  line-height: 1.4;
  font-size: clamp(1.03rem, 1.4vw, 1.2rem);
  font-weight: 600;
  margin: 0;
}
.schedule-date span { font-size: .88em; font-weight: 500; color: var(--secondary); }
.schedule-context .schedule-weather { margin: 0; min-height: 36px; }
.schedule-context .weather-link, .schedule-context .weather-detail > summary { min-height: 36px; }
.schedule-context > .primary { flex-shrink: 0; }
.schedule-main { gap: .78rem; }
.major-day-field { display: inline-flex; align-items: center; gap: .45rem; color: var(--secondary); font-size: .88rem; }
.major-day-field input {
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  padding: .3rem .5rem;
  font: inherit;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.major-panel .sectionhead, .major-panel .major-actions { flex-wrap: wrap; }
@media (max-width:640px) {
  .workspace .work-content { padding-top: .25rem; }
  .workspace-mast { grid-template-columns: minmax(0,1fr); gap: .3rem; }
  .workspace-mast .workspace-title { grid-row: 2; font-size: clamp(1.65rem, 6.8vw, 2.1rem); }
  .workspace-tools { grid-column: 1; grid-row: 1; justify-content: space-between; }
  .mast-actions { gap: .18rem; }
  .mast-actions .mobile-settings { display: inline-grid; width: 44px; height: 44px; }
  .schedule-mast, .settings-mast { padding-bottom: .58rem; }
  .compact-mast { margin: 0 0 .45rem; }
  .schedule-context { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 0 .5rem; padding: .35rem 0 .55rem; }
  .schedule-stamp { display: contents; }
  .schedule-context .schedule-date { grid-column: 1; grid-row: 1; }
  .schedule-context .schedule-weather { grid-column: 1 / -1; grid-row: 2; }
  .schedule-context > .primary { grid-column: 2; grid-row: 1; min-width: 44px; min-height: 44px; padding: .42rem .6rem; }
  .schedule-context > .primary span { display: none; }
  .schedule-context .schedule-weather { column-gap: .5rem; }
  .schedule-context .weather-link, .schedule-context .weather-detail > summary { min-height: 44px; }
  .major-day-field input { min-height: 44px; }
}


/* Keep the optional Undo action usable while notices leave the list interactive. */
#toast { pointer-events: none; }
#toast button { pointer-events: auto; }

/* The workspace group shares the first navigation level with Settings and Adventure. */
.sidebar .workspace-navigation { display: flex; flex-direction: column; gap: .3rem; margin-top: 1.35rem; }
.workspace-navigation .nav-primary { color: var(--fg); font-weight: 650; font-size: 1rem; }
.workspace-navigation .nav-primary svg { flex-shrink: 0; }
.workspace-children { display: grid; gap: .15rem; min-width: 0; }
.sidebar .workspace-children { margin: .15rem 0 .5rem 1.25rem; padding-left: .45rem; border-left: 1px solid var(--border); }
.sidebar .workspace-children .navitem { font-size: .92rem; padding-inline: .62rem; }
.workspace-navigation .game-entry { margin-top: 0; }
.workspace-mast .mast-actions .secondary { min-height: 40px; padding: .38rem .8rem; }
.schedule-content .compact-mast { margin-bottom: .55rem; }
@media(max-width:640px) {
  .mobilenav.workspace-navigation { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); grid-template-rows: auto auto; gap: 0; padding: .15rem .45rem max(.15rem,env(safe-area-inset-bottom)); align-items: stretch; background:var(--navbg); }
  .mobilenav .nav-workspace { display: contents; }
  .mobilenav .nav-primary { grid-row: 1; display:flex; flex-direction:row; justify-content:center; gap:.28rem; min-width:0; min-height:44px; padding:.25rem .13rem; font-size:.87rem; line-height:1.25; text-align:center; }
  .mobilenav .nav-primary span { overflow-wrap:anywhere; }
  .mobilenav .workspace-entry { grid-column:1; }
  .mobilenav .nav-primary[data-route=settings] { grid-column:2; }
  .mobilenav .game-entry { grid-column:3; }
  .mobilenav .nav-primary svg { width:16px; height:16px; }
  .mobilenav .workspace-children { grid-column:1 / -1; grid-row:2; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.13rem; padding:.13rem .15rem; background:var(--surface); border-radius:7px; }
  .mobilenav .workspace-children .navitem { display:flex; flex-direction:row; flex-wrap:wrap; align-content:center; justify-content:center; gap:.25rem; min-width:0; min-height:44px; padding:.2rem; color:var(--secondary); font-size:.79rem; line-height:1.25; }
  .mobilenav .workspace-children .navitem svg { width:14px; height:14px; }
  .mobilenav .workspace-children .active,.mobilenav .group-active { color:var(--action); }
  .workspace .work-content { padding-bottom:calc(7rem + env(safe-area-inset-bottom)); }
  .workspace-mast .mast-actions .secondary { min-height:44px; }
}
