/* Year Plan (Figma "Year Plan" 22316:154278) — js/screens/yearplan.js. Prefix yp-.
   Reuses .sl-back / .ac-icon32 (back), .ci-star (bookmark), .rs-search, .mk-drop, .mk-select/.an-select, .sbp-ta,
   .as-list pickers, .an-foot/.an-next, .nd-preview / .nd-thumb. */

/* ---------- shared ---------- */
.screen.yp, .screen.yp-resources { display: flex; flex-direction: column; overflow: hidden; background: var(--goku); }
.yp-top { flex: none; display: flex; flex-direction: column; background: var(--gohan); padding-top: var(--sb-dash); }
.yp-head { display: flex; align-items: center; gap: 8px; height: 56px; padding: 8px 20px; }
.yp-head h1 { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yp-head:has(.yp-title) { height: auto; min-height: 56px; }
.yp-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.yp-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yp-year { font: 500 12px/16px var(--font); color: var(--trunks); }
.yp-icon { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; }
.yp-icon:hover, .yp-icon[aria-pressed="true"] { background: var(--heles); }
/* Report — quiet outlined button, not a primary action */
.yp-report { flex: none; display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 14px 0 8px; border: 1px solid rgba(78, 70, 180, 0.2); border-radius: 8px; background: rgba(78, 70, 180, 0.12); font: 600 14px/20px var(--font); color: var(--piccolo); }
.yp-report svg { flex: none; display: block; margin: -4px -3px; width: 32px; height: 32px; }
.yp-report:hover { background: rgba(78, 70, 180, 0.18); }
.yp-search { margin: 0 20px 4px; }
/* Class button (same as Assessment's .asm-class) — opens Select Form, Class & Subject */
.yp-class-wrap { padding: 8px 20px 12px; }
.yp-class { background: var(--goku); }
.yp-class:hover { background: var(--heles); }
.yp-topic-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.yp-topic-text small { font: 700 10px/16px var(--font); letter-spacing: 0.5px; text-transform: uppercase; color: #8E8E93; }
.yp-switch { display: flex; gap: 8px; padding: 12px 20px; overflow-x: auto; scrollbar-width: none; }
.yp-switch::-webkit-scrollbar { display: none; }
.yp-switch-tab { flex: none; height: 40px; padding: 0 12px; border-radius: 8px; font: 400 16px/24px var(--font); color: var(--bulma); white-space: nowrap; }
.yp-switch-tab.is-on { background: var(--goku); font: 700 14px/24px var(--font); }
.yp-switch-tab:not(.is-on):hover { background: var(--heles); }
.yp-count {
  flex: none; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 100px; background: var(--beerus);
  display: grid; place-items: center; font: 500 12px/16px var(--font); color: var(--bulma);
}
.yp-box { position: relative; flex: none; width: 24px; height: 24px; }
.yp-box::before { content: ''; position: absolute; inset: 5px; border: 1.5px solid var(--trunks); border-radius: 3px; }
.is-on > .yp-box::before, input:checked + .yp-box::before { border-color: var(--piccolo); background: var(--piccolo); }
.is-on > .yp-box::after, input:checked + .yp-box::after {
  content: ''; position: absolute; left: 9.5px; top: 6.5px; width: 5px; height: 9px; border: solid var(--gohan); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.yp-fab {
  position: absolute; right: 20px; bottom: 24px; z-index: 5; display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 20px 0 16px;
  border-radius: 16px; background: var(--piccolo); color: var(--gohan); font: 700 16px/24px var(--font);
  box-shadow: 0 4px 8px 3px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.3);
}
.yp-fab:hover { filter: brightness(1.08); }
.yp.tabbed .yp-fab { bottom: 97px; }

/* ---------- Year Plan list (154337) ---------- */
.yp-list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; gap: 8px; padding: 24px 20px 110px; }
.yp-list::-webkit-scrollbar { display: none; }
.yp-band { width: 100%; display: flex; align-items: center; gap: 24px; padding: 12px 16px; border-radius: 8px; background: var(--gohan); text-align: left; }
.yp-band:hover { background: #FCFCFC; }
.yp-band-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.yp-band-text small { font: 700 10px/16px var(--font); letter-spacing: 0.5px; text-transform: uppercase; color: #8E8E93; }
.yp-band-text span { font: 400 16px/24px var(--font); color: var(--bulma); }
.yp-band-chev, .yp-band-up { flex: none; display: grid; place-items: center; padding: 4px; border-radius: 4px; }
.yp-band-up { background: var(--jiren); }
.yp-band-open { border: 1px solid var(--beerus); border-radius: 8px; background: var(--heles); }
.yp-band-head { width: 100%; display: flex; align-items: center; gap: 24px; padding: 16px; text-align: left; font: 400 16px/24px var(--font); color: var(--bulma); }
.yp-band-head span:first-child { flex: 1; }
.yp-topics { display: flex; flex-direction: column; gap: 4px; padding: 4px; }
.yp-topic { border-radius: 8px; overflow: hidden; background: var(--gohan); }
.yp-topic-head { width: 100%; display: flex; align-items: center; gap: 24px; padding: 8px 16px; text-align: left; font: 400 16px/24px var(--font); color: var(--trunks); }
.yp-topic-head span { flex: 1; min-width: 0; }
.yp-topic-head img { flex: none; margin: 4px; transition: transform .15s; }
.yp-topic.is-open .yp-topic-head img { transform: rotate(180deg); }
.yp-topic.is-open { border: 1px solid var(--beerus); }
.yp-subs { display: flex; flex-direction: column; border-top: 1px solid var(--beerus); }
.yp-sub { width: 100%; display: flex; align-items: center; gap: 24px; padding: 12px 16px; text-align: left; background: var(--gohan); }
.yp-sub + .yp-sub { border-top: 1px solid var(--beerus); }
.yp-sub:hover { background: #FAFAFF; }
.yp-sub > img { flex: none; }
.yp-sub-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.yp-sub-title { font: 400 16px/24px var(--font); color: var(--piccolo); }
.yp-sub-meta { display: flex; align-items: center; gap: 4px; font: 400 12px/16px var(--font); color: var(--trunks); }
/* Topic as a dropdown (closed card / open panel like a band), then Subtopic dropdowns with their attachments */
.yp-topic-card { padding: 10px 14px; }
.yp-topic-open { background: var(--gohan); }
.yp-topic-open > .yp-band-head { padding: 12px 14px; }
.yp-topic-open > .yp-topics { background: var(--heles); border-top: 1px solid var(--beerus); border-radius: 0 0 8px 8px; }
.yp-sub-card { border-radius: 8px; background: var(--gohan); }
.yp-sub-card.is-open { border: 1px solid var(--beerus); }
.yp-sub-head { width: 100%; display: flex; align-items: center; gap: 16px; padding: 10px 14px; text-align: left; }
.yp-sub-head .yp-sub-link { text-align: left; align-items: flex-start; }
/* Chevron alone toggles Element/Aspect; a bigger hit area around the 24px visual. */
.yp-sub-head .yp-sub-toggle { position: relative; }
.yp-sub-head .yp-sub-toggle::before { content: ''; position: absolute; inset: -10px; }
.yp-sub-head .yp-sub-title { font: 400 16px/24px var(--font); color: var(--piccolo); }
.yp-sub-head .yp-sub-meta, .yp-sub-head .yp-sub-meta span { font: 400 12px/16px var(--font); color: var(--trunks); }
.yp-sub-head .yp-sub-meta .yp-sub-done { color: #2E7D32; }
.yp-sub-files { display: flex; flex-direction: column; gap: 8px; padding: 4px 14px 12px; border-top: 1px solid var(--beerus); padding-top: 12px; }
/* Inside an open subtopic: one tab per Element, then that Element's Aspects with their attachment counts */
.yp-label { display: block; font: 700 10px/16px var(--font); letter-spacing: 0.5px; text-transform: uppercase; color: #8E8E93; }
.yp-el-tabs { display: flex; gap: 4px; margin: 2px -14px 0; padding: 0 14px; overflow-x: auto; scrollbar-width: none; }
.yp-el-tabs::-webkit-scrollbar { display: none; }
.yp-el-tab { flex: none; height: 36px; padding: 0 10px; border-radius: 8px; font: 400 14px/20px var(--font); color: var(--bulma); white-space: nowrap; }
.yp-el-tab em { font-style: normal; color: var(--trunks); }
.yp-el-tab[aria-selected="true"] { background: var(--piccolo); color: var(--gohan); font-weight: 700; }
.yp-el-tab[aria-selected="true"] em { color: inherit; font-weight: 400; }
.yp-el-tab[aria-selected="false"]:hover { background: var(--heles); }
.yp-aspects { display: flex; flex-direction: column; gap: 8px; }
.yp-aspect { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 10px; border-left: 2px solid var(--jiren); text-align: left; }
.yp-aspect:hover { background: var(--heles); }
.yp-aspect > img { flex: none; }
.yp-aspect-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.yp-aspect-name { font: 400 16px/24px var(--font); color: var(--piccolo); }
.yp-aspect-count { display: flex; align-items: center; gap: 4px; font: 400 12px/16px var(--font); color: var(--trunks); }
.yp-aspect-count img { flex: none; }
.yp-aspect-sheet { display: flex; flex-direction: column; gap: 12px; }
.yp-aspect-sheet .yp-file { text-decoration: none; }
.yp-aspect-of { font: 400 14px/20px var(--font); color: var(--trunks); }
.yp-sub-more { align-self: flex-end; display: flex; align-items: center; gap: 4px; padding: 4px 0; font: 600 14px/20px var(--font); color: var(--piccolo); }
.yp-sub-done { margin-left: 8px; padding: 0 6px; border-radius: 4px; background: rgba(46, 125, 50, 0.12); color: #2E7D32; }

/* ---------- Sub Topic Detail (155274 / 154402 / 154365) ---------- */
.screen.yp-detail { display: flex; flex-direction: column; overflow: hidden; background: var(--goku); }
.yp-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; gap: 16px; padding: calc(var(--sb-dash) + 24px) 20px 110px; }
.yp-scroll::-webkit-scrollbar { display: none; }
.yp-dhead { flex: none; display: flex; align-items: center; justify-content: space-between; height: 40px; }
/* Academic year from Profile, top right of the sub topic detail */
.yp-dyear { font: 500 14px/20px var(--font); color: var(--trunks); }
.yp-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-bottom: 16px; text-align: center; }
.yp-hero-cls { display: flex; gap: 12px; font: 700 16px/24px var(--font); color: var(--trunks); }
.yp-hero-title { font: 700 24px/32px var(--font); color: var(--bulma); }
.yp-hero-sub { margin-top: -6px; padding: 0 16px; font: 400 16px/24px var(--font); color: var(--trunks); }
.yp-mark { margin-top: 28px; padding: 8px 24px; border-radius: 8px; background: var(--piccolo); font: 700 14px/24px var(--font); color: var(--gohan); }
.yp-mark:hover { filter: brightness(1.08); }
.yp-done { margin-top: 28px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.yp-done-badge { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; width: 200px; justify-content: center; border-bottom: 1px solid var(--beerus); font: 400 14px/24px var(--font); color: var(--trunks); }
.yp-done-when { font: 400 14px/24px var(--font); color: var(--trunks); }
.yp-cards { display: flex; flex-direction: column; gap: 16px; }
.yp-card { display: flex; flex-direction: column; gap: 16px; padding: 16px; border-radius: 8px; background: var(--gohan); }
.yp-card-head { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; font: 700 18px/28px var(--font); color: var(--bulma); }
.yp-card-head span { flex: 1; }
.yp-card-head img { flex: none; }
.yp-card-title { font: 700 18px/28px var(--font); color: var(--bulma); }
.yp-info { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px; border-radius: 8px; background: var(--heles); }
.yp-info-row { display: flex; gap: 2px; font: 400 12px/16px var(--font); }
.yp-info-row span { flex: 1 1 0; min-width: 0; color: var(--trunks); }
.yp-info-row span:first-child { font-weight: 500; color: var(--bulma); }
.yp-res { display: flex; flex-direction: column; gap: 8px; }
.yp-res-row { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 12px 16px; border-radius: 8px; background: var(--goku); text-align: left; font: 400 16px/24px var(--font); color: var(--bulma); }
.yp-res-row span:first-child { flex: 1; min-width: 0; }
.yp-res-row img { flex: none; margin-left: 14px; }
.yp-res-row:hover { background: #EDEDED; }
.yp-complete { gap: 24px; border: 1px solid var(--piccolo); box-shadow: 0 0 0 4px var(--jiren); }
.yp-checks { display: flex; gap: 12px; }
.yp-check { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border: 1px solid var(--beerus); border-radius: 8px; background: var(--gohan); font: 400 14px/20px var(--font); color: var(--trunks); }
.yp-check.is-on { border-color: var(--piccolo); color: var(--bulma); }
.yp-date { position: relative; display: flex; align-items: center; gap: 10px; padding: 16px; border: 1px solid var(--beerus); border-radius: 8px; cursor: pointer; }
.yp-date > span:first-child { flex: 1; font: 400 16px/24px var(--font); color: var(--trunks); }
.yp-date-chip { padding: 4px 8px; border-radius: 4px; background: var(--heles); font: 400 16px/24px var(--font); color: var(--piccolo); }
.yp-date input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.yp-date input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.yp-web { position: relative; display: flex; align-items: center; gap: 8px; padding: 16px; border: 1px solid var(--beerus); border-radius: 8px; background: var(--gohan); cursor: pointer; font: 400 16px/24px var(--font); color: var(--trunks); }
.yp-web > span:first-child { flex: 1; }
.yp-web input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.yp-web input:focus-visible + .yp-box::before { box-shadow: 0 0 0 4px rgba(78, 70, 180, 0.2); }
.yp-complete .an-next { margin: 0; }
.yp-foot { display: flex; flex-direction: column; gap: 4px; padding: 0 12px; font: 400 12px/16px var(--font); color: var(--trunks); }

/* ---------- Resources (154998) ---------- */
.yp-res-scroll { padding-top: 24px; gap: 24px; }
.yp-sec-head { display: flex; align-items: center; gap: 24px; }
.yp-sec-head h2 { flex: 1; font: 700 18px/28px var(--font); color: var(--bulma); }
.yp-items { display: flex; flex-direction: column; gap: 8px; }
.yp-item { display: flex; flex-direction: column; gap: 16px; padding: 12px 16px; border-radius: 8px; background: var(--gohan); }
.yp-item-head { display: flex; align-items: flex-start; gap: 10px; }
.yp-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.yp-item-title { font: 400 16px/24px var(--font); color: var(--bulma); }
.yp-item-sub { font: 400 12px/16px var(--font); color: var(--trunks); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yp-edit { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 4px; }
.yp-edit:hover { background: var(--heles); }
.yp-files { display: flex; flex-direction: column; gap: 8px; }
.yp-file { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; background: var(--goku); text-align: left; }
.yp-file:hover { background: #EDEDED; }
.yp-file > img { flex: none; }
.yp-file-play { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--piccolo); }
.yp-file-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.yp-file-text b { font: 700 14px/20px var(--font); color: var(--bulma); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yp-file-text span { font: 400 12px/16px var(--font); color: var(--trunks); }

/* ---------- New Framework / Edit (154279 · 154298 · 155257) ---------- */
.screen.yp-fw { display: flex; flex-direction: column; overflow: hidden; background: var(--gohan); }
.yp-fw-head { flex: none; display: flex; align-items: center; gap: 16px; padding: calc(var(--sb-dash) + 8px) 24px 12px; box-shadow: inset 0 -1px 0 #EAEAEA; }
.yp-fw-head h1 { flex: 1; min-width: 0; }
.yp-form-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; gap: 24px; padding: 24px 20px 32px; }
.yp-form-scroll::-webkit-scrollbar { display: none; }
.yp-details { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 8px; background: var(--goku); }
.yp-details .yp-card-head { margin-bottom: 8px; }
.yp-sel { flex: none; }
.yp-sel:not(.is-filled) { padding: 16px; color: var(--trunks); }
.yp-sel.is-filled { padding: 8px 16px; }
.yp-sel span { display: flex; flex-direction: column; }
.yp-desc { padding-top: 0; }
.yp-desc small { display: block; padding: 12px 15px 0; font: 400 12px/12px var(--font); color: var(--trunks); }
.yp-desc.is-filled textarea { padding-top: 4px; }
.yp-desc textarea { min-height: 72px; }
.yp-att { display: flex; flex-direction: column; gap: 16px; padding: 16px; border: 1px solid var(--beerus); border-radius: 8px; }
.yp-att-label { font: 400 16px/24px var(--font); color: var(--trunks); }
.yp-seg { display: flex; gap: 4px; padding: 4px; border-radius: 8px; background: var(--goku); }
.yp-seg-btn { flex: 1 1 auto; height: 40px; padding: 0 8px; border-radius: 6px; font: 700 14px/24px var(--font); color: var(--bulma); white-space: nowrap; }
.yp-seg-btn.is-on { background: var(--piccolo); color: var(--gohan); }
.yp-seg-btn:not(.is-on):hover { background: var(--heles); }
.yp-link { display: flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: 56px; border: 1px solid var(--beerus); border-radius: 8px; }
.yp-link img { flex: none; }
.yp-link-field { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.yp-link-field small { font: 400 12px/12px var(--font); color: var(--trunks); }
.yp-link input { width: 100%; border: 0; outline: 0; background: transparent; padding: 0; font: 400 16px/24px var(--font); color: var(--piccolo); text-decoration: underline; }
.yp-link input::placeholder { color: var(--trunks); text-decoration: none; }
.yp-link:focus-within { border-color: var(--piccolo); }
.yp-drop .mk-drop-sub { max-width: 280px; margin: 0 auto; }
.yp-att-list { border: 1px solid var(--beerus); border-radius: 8px; }
.yp-att-row { display: flex; align-items: center; gap: 12px; padding: 12px; }
.yp-att-row + .yp-att-row { border-top: 1px solid var(--beerus); }
.yp-att-row .nd-thumb { flex: none; border: 0.5px solid rgba(0, 0, 0, 0.25); border-radius: 4px; }
.yp-att-btn { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; }
.yp-att-btn:hover { background: var(--heles); }
.yp-att-add { align-self: flex-end; display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 8px; background: var(--piccolo); font: 700 14px/24px var(--font); color: var(--gohan); }
.yp-att-add img { filter: invert(1); }

/* ---------- Completion Graphs (154811) / band graph (154443 / 154637) ---------- */
.yp-graph-list { padding-top: 24px; gap: 16px; }
.yp-gcard { width: 100%; display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--beerus); border-radius: 8px; background: var(--gohan); text-align: left; }
.yp-gcard:hover { border-color: #CFCFCF; }
.yp-gcard-head { display: flex; align-items: center; gap: 8px; }
.yp-gcard-head b { flex: 1; font: 700 16px/24px var(--font); color: var(--bulma); }
.yp-bar { height: 8px; border-radius: 8px; background: #E5E4F4; overflow: hidden; }
.yp-bar span { display: block; height: 100%; background: var(--piccolo); border-radius: 8px 0 0 8px; }
.yp-bar.is-big { height: 16px; }
.yp-legend { display: flex; align-items: center; gap: 16px; font: 400 12px/16px var(--font); color: var(--trunks); }
.yp-legend b { font-weight: 700; color: var(--bulma); }
.yp-legend > span { display: flex; align-items: center; gap: 6px; }
.yp-legend.is-big { font-size: 14px; line-height: 20px; }
.yp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--piccolo); }
.yp-dot.is-plan { background: #E5E4F4; }
.yp-pct, .yp-total { margin-left: auto; }
.yp-pct { padding: 2px 6px; border-radius: 4px; background: var(--jiren); font: 400 12px/16px var(--font); color: var(--piccolo); }
.yp-gsum { display: flex; flex-direction: column; gap: 16px; padding: 16px; border: 1px solid var(--beerus); border-radius: 8px; background: var(--gohan); }
.yp-gsum h1 { font: 400 20px/28px var(--font); color: var(--bulma); }
.yp-gtopic { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--beerus); border-radius: 8px; background: var(--gohan); }
.yp-gtopic-head { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; font: 700 14px/24px var(--font); color: var(--bulma); }
.yp-gtopic-head > span:first-child { flex: 1; }
.yp-gtopic-head .yp-pct { margin-left: 0; font-weight: 400; }
.yp-gtopic-head img { flex: none; transition: transform .15s; }
.yp-gtopic.is-open .yp-gtopic-head img { transform: rotate(180deg); }
.yp-gsub { width: 100%; display: flex; flex-direction: column; gap: 12px; padding: 12px 16px; border-radius: 8px; background: var(--goku); text-align: left; }
.yp-gsub:hover { background: #EDEDED; }
.yp-gsub-title { font: 400 14px/20px var(--font); color: var(--bulma); }
.yp-rename { display: flex; flex-direction: column; gap: 24px; padding-bottom: 8px; }
.screen.yp-detail::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: var(--sb-dash); z-index: 2; background: var(--goku); pointer-events: none; }
