/* Option 4 · Day planner layout: sage icon rail, date header, week strip. Swap this file (and layouts/planner.js) to change layouts. */
.jb-app { display: flex; flex-direction: column; min-height: calc(100vh / var(--zf, 1)); background: var(--paper); }
.jb-body { flex: 1 1 auto; display: flex; min-width: 0; }
.jb-rail { width: 96px; flex: none; background: var(--sage); padding: 14px 8px 24px; display: flex; flex-direction: column; align-items: center; gap: 4px; position: sticky; top: var(--jb-head, 0px); height: calc(100vh / var(--zf, 1) - var(--jb-head, 0px)); overflow-y: auto; scrollbar-width: none; }
.jb-rail::-webkit-scrollbar { display: none; }
.jb-rail .grp { width: 80px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--on-sage-rule); }
.jb-rail .grp:last-child { border-bottom: 0; }
.jb-rail .gname { font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--on-sage-muted); padding: 4px 0; text-align: center; }
.jb-rail a { position: relative; width: 76px; min-height: 54px; padding: 6px 2px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--on-sage); }
.jb-rail a:hover { background: var(--on-sage-hover); }
.jb-rail a[aria-current="page"] { background: var(--paper); color: var(--sage-text); }
.jb-rail a .lbl { font-size: 10.5px; font-weight: 600; line-height: 1.15; text-align: center; }
.jb-rail a .jb-badge { position: absolute; top: 2px; right: 8px; min-width: 18px; height: 18px; font-size: 10px; border: 2px solid var(--sage); }
.jb-rail a .jb-ico { width: 21px; height: 21px; }

.jb-main { flex: 1 1 auto; min-width: 0; padding: 24px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
/* full-width header, always at the top: school logo, date, search, role switch, bell, account */
.jb-top { position: sticky; top: 0; z-index: 35; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 12px 32px 12px 32px; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 4px 14px rgba(40,30,20,.04); }
.jb-top .logolink { display: inline-flex; }
html { scroll-padding-top: calc(var(--jb-head, 0px) + 12px); }
.jb-top .logo { height: 54px; width: auto; max-width: 260px; object-fit: contain; }
.jb-top .date { flex: 1 1 220px; display: flex; flex-direction: column; border-left: 1px solid var(--line); padding-left: 22px; }
.jb-top .date .d1 { font-family: var(--caps); font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--sage-text); }
.jb-top .date .d2 { font-family: var(--serif); font-size: 36px; font-weight: 600; line-height: 1.05; }
.jb-top .who { display: flex; align-items: center; gap: 12px; }
.jb-top .who .nm { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.jb-top .who .nm .g { font-family: var(--serif); font-size: 18px; }
.jb-top .who .nm .r { font-size: 13px; color: var(--ink-3); }
.jb-top .me { width: 44px; height: 44px; border-radius: 50%; background: var(--maroon); color: var(--on-maroon); border: 0; font-weight: 700; font-size: 14px; cursor: pointer; }
.jb-menu { position: absolute; right: 0; top: 52px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 220px; padding: 6px; z-index: 40; display: flex; flex-direction: column; }
.jb-menu a, .jb-menu button { text-align: left; padding: 10px 12px; border-radius: 8px; border: 0; background: none; text-decoration: none; color: var(--ink); font-size: 15px; cursor: pointer; }
.jb-menu a:hover, .jb-menu button:hover { background: var(--chip-soft); }
.jb-menu-h { padding: 8px 12px 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.jb-menu [role="menuitemradio"] { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.jb-menu [aria-checked="true"] { color: var(--maroon-text); font-weight: 700; }
.jb-menu [role="menuitemradio"] svg { width: 18px; height: 18px; }
.jb-menu hr { border: 0; border-top: 1px solid var(--line-soft); margin: 6px 4px; }
.jb-notif { position: relative; }
.jb-notif .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--maroon); }
.jb-pop { position: absolute; right: 0; top: 48px; width: min(360px, calc(100vw / var(--zf, 1) - 32px)); background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); z-index: 40; padding: 8px 14px; max-height: 420px; overflow: auto; }

.jb-week { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.jb-week .day { min-height: 62px; min-width: 84px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: #333; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; line-height: 1.2; text-decoration: none; }
.jb-week .day .n { font-size: 18px; }
.jb-week .day .note { font-size: 11px; font-weight: 500; color: var(--ink-3); margin-top: 2px; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jb-week .day.on { background: var(--maroon); border-color: var(--maroon); color: var(--on-maroon); }
.jb-week .day.on .note { color: var(--on-maroon); opacity: .8; }

.jb-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.jb-page-head .jb-h1 { font-size: 32px; }
/* Today: the week sits on the greeting's line, to its right (it wraps below on narrow screens) */
.jb-page-head:has(> .jb-headstrip) { align-items: center; }
.jb-page-head > .jb-headstrip:empty { display: none; }
.jb-headstrip .jb-week { flex-wrap: nowrap; }
@media (max-width: 760px) { .jb-page-head > .jb-headstrip { flex: 1 1 100%; min-width: 0; order: -1; } }

/* timeline */
.jb-tl { display: grid; grid-template-columns: 52px 18px minmax(0, 1fr); column-gap: 10px; }
.jb-tl .tm { font-size: 13px; font-weight: 700; color: var(--sage-text); text-align: right; padding-top: 1px; }
.jb-tl .rail { display: flex; flex-direction: column; align-items: center; }
.jb-tl .rail .pt { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; border: 2px solid var(--sage); background: #fff; flex: none; }
.jb-tl .rail .pt.now { background: var(--maroon); border-color: var(--maroon); }
.jb-tl .rail .pt.past { background: var(--sage-soft); border-color: var(--sage-soft); }
.jb-tl .rail .ln { flex: 1; width: 2px; background: var(--line); min-height: 22px; }
.jb-tl .bd { display: flex; flex-direction: column; padding-bottom: 14px; align-items: flex-start; }
.jb-tl .bd .tt { font-weight: 600; color: var(--ink); text-decoration: none; }
.jb-tl .bd a.tt:hover { text-decoration: underline; }
.jb-tl .bd.past .tt { color: var(--ink-3); }
.jb-upnext { margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--maroon-text); background: var(--maroon-tint); padding: 3px 8px; border-radius: 4px; }

/* docked list beside the menu (people split view): names stay scrollable and clickable while a profile is open */
.jb-sublist { width: 264px; flex: none; position: sticky; top: var(--jb-head, 0px); height: calc(100vh / var(--zf, 1) - var(--jb-head, 0px)); background: var(--sage-mist); border-right: 1px solid var(--sage-line); display: flex; flex-direction: column; }
.jb-sublist[hidden] { display: none; }
.jb-sl-head { padding: 18px 14px 12px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--sage-line); }
.jb-sl-head .back { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; color: var(--sage-text); text-decoration: none; }
.jb-sl-head .back .jb-ico { width: 16px; height: 16px; }
.jb-sl-head .back:hover { text-decoration: underline; }
.jb-sl-search { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.jb-sl-search .jb-ico { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.jb-sl-search input { border: 0; outline: 0; background: none; font: inherit; font-size: 14px; width: 100%; min-width: 0; }
.jb-sl-search:focus-within { border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-tint); }
.jb-sl-list { flex: 1 1 auto; overflow-y: auto; padding: 6px 8px 28px; overscroll-behavior: contain; }
.jb-sl-list a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; line-height: 1.25; font-size: 14.5px; }
.jb-sl-list a[hidden] { display: none; }
.jb-sl-list a .sb { display: block; font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.jb-sl-list a:hover { background: rgba(255, 255, 255, .7); }
.jb-sl-list a:focus-visible { outline: 2px solid var(--sage); outline-offset: -2px; }
.jb-sl-list a[aria-current="page"] { background: #fff; color: var(--maroon-text); font-weight: 700; box-shadow: inset 3px 0 0 var(--maroon), 0 1px 2px rgba(0, 0, 0, .06); }
.jb-sl-group { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 12px 10px 4px; }
.jb-sl-group[hidden] { display: none; }
.jb-sl-none { padding: 10px; font-size: 14px; }
.jb-sl-mobileback { display: none; margin: 0; }
.jb-sl-mobileback a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--sage-text); text-decoration: none; }
body:not(.jb-has-sublist) .jb-sl-mobileback { display: block; }
@media (max-width: 1100px) { .jb-sublist { width: 220px; } }

/* phones: the rail becomes a bottom tab bar with "More" */
.jb-tabbar, .jb-more { display: none; }
@media (max-width: 760px) {
  .jb-rail { display: none; }
  .jb-sublist { display: none !important; }
  .jb-sl-mobileback { display: block; }
  .jb-main { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); gap: 16px; }
  .jb-top { flex-wrap: nowrap; gap: 10px; padding: 8px 12px; }
  .jb-top .logo { height: 34px; max-width: 96px; }
  .jb-top .date { flex: 1 1 auto !important; padding-left: 10px; min-width: 0; overflow: hidden; }
  .jb-top .date .d1 { display: none; }
  .jb-top .date .d2 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .jb-top .jb-top-search { flex: 0 0 auto !important; margin-left: 0; }
  .jb-top .jb-iconbtn, .jb-top .me { width: 40px; height: 40px; min-height: 40px; }
  .jb-top .who .nm { display: none; }
  .jb-week { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .jb-week .day { min-width: 70px; }
  .jb-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .jb-tabbar a, .jb-tabbar button { position: relative; flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #6A6A6A; text-decoration: none; font-size: 11px; font-weight: 600; background: none; border: 0; }
  .jb-tabbar [aria-current="page"] { color: var(--maroon-text); }
  .jb-tabbar .jb-badge { position: absolute; top: 0; right: calc(50% - 22px); min-width: 18px; height: 18px; font-size: 10px; border: 2px solid #fff; }
  .jb-more.open { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(27,20,15,.38); }
  .jb-more .panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(80vh / var(--zf, 1)); overflow: auto; background: var(--paper); border-radius: 18px 18px 0 0; padding: 14px 16px calc(20px + env(safe-area-inset-bottom)); }
  .jb-more .panel .gname { font-family: var(--caps); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--sage-text); margin: 12px 0 6px; }
  .jb-more .panel .gr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .jb-more .panel a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 12px; font-weight: 600; text-align: center; }
}

/* header search (Option 4 places it between the date and the account buttons) */
.jb-top-search { flex: 1 1 300px; max-width: 480px; display: flex; justify-content: flex-end; }
.jb-gsearch { position: relative; width: 100%; }
.jb-gsearch .jb-search { min-height: 44px; }
.jb-gsearch-btn { display: none; }
@media (max-width: 760px) {
  .jb-top-search { flex: 0 0 auto; order: 3; }
  .jb-gsearch { display: none; }
  .jb-gsearch-btn { display: inline-flex; }
}
.jb-top .date { flex: 0 1 auto; }
.jb-top-search { flex: 1 1 260px; max-width: 520px; margin-left: auto; }
@media (max-width: 1500px) { .jb-top .who .nm { display: none; } }
@media (max-width: 1100px) { .jb-top .jb-kbd { display: none; } }
