/* Study plan (2026-11-22). Scoped to #plan-root and the plan's modals.
   Approved design: canvas "Study plan v2" (M1–M8), P1, P5. */
#plan-root { --sp-navy: #0A2463; --sp-blue: #1563D6; --sp-line: #E3E8F1; --sp-ground: #F6F8FC; --sp-ink: #0F1B3D; --sp-ink2: #3D4A66; --sp-mute: #66728C;
  --sp-ok: #12805C; --sp-warn: #B45309; font-family: Inter, system-ui, sans-serif; color: var(--sp-ink); max-width: 1320px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
#plan-root *, .sp-modal * { box-sizing: border-box; }
/* Like the tutor: nothing floating over Next / Create / Send (bottom right). */
body:has(#screen-plan.active) #float-feedback-btn, body:has(#screen-plan.active) #pwa-banner { display: none !important; }
.sp-h1 { margin: 0; font: 700 20px 'Plus Jakarta Sans', Inter, sans-serif; color: var(--sp-ink, #0F1B3D); }
.sp-h2 { margin: 0; font: 700 16px 'Plus Jakarta Sans', Inter, sans-serif; color: #0F1B3D; }
.sp-h3 { margin: 0 0 8px; font: 700 14px 'Plus Jakarta Sans', Inter, sans-serif; color: #0F1B3D; }
.sp-sub { margin: 0; color: #3D4A66; font-size: 14px; line-height: 1.55; }
.sp-muted { color: #66728C; font-size: 12.5px; }
.sp-small { font-size: 12px; margin: 6px 0 0; }
.sp-center { text-align: center; }
.sp-note { margin: 0; font-size: 13px; color: #3D4A66; }
.sp-note-ai { background: #F7FAFF; border: 1px solid #DCE7FA; border-radius: 10px; padding: 10px 12px; }
.sp-err { margin: 0; color: #B42318; font-size: 13px; min-height: 0; }
.sp-err:empty { display: none; }
.sp-warn { color: #B45309; font-size: 12.5px; font-weight: 600; }
.sp-okt { color: #12805C; font-size: 12.5px; font-weight: 600; }
.sp-label { font-size: 12.5px; font-weight: 600; color: #3D4A66; margin-top: 4px; }
.sp-eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #B45309; }
.sp-card { background: #fff; border: 1px solid #E3E8F1; border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sp-card-flush { padding: 0; gap: 0; overflow: hidden; }
.sp-card-soft { background: #F7FAFF; border-color: #DCE7FA; }
.sp-card-warn { background: #FFFAF3; border-color: #F3D9B8; }
.sp-pad { padding: 16px 18px 0; display: flex; flex-direction: column; gap: 10px; }
.sp-card-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sp-card-head > :last-child:not(:first-child) { margin-left: auto; }
.sp-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sp-row-end { justify-content: flex-end; margin-top: 6px; }
.sp-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sp-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sp-split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.sp-split-wide { grid-template-columns: minmax(0, 1fr) 440px; }
.sp-aside { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.sp-btn { height: 42px; padding: 0 18px; border: 1px solid #D5DCE8; background: #fff; border-radius: 8px; font: 600 14px Inter, sans-serif; color: #0F1B3D; cursor: pointer; }
.sp-btn:hover { border-color: #0A2463; }
.sp-btn:disabled { opacity: 0.6; cursor: default; }
.sp-btn-p { background: #0A2463; color: #fff; border-color: #0A2463; }
.sp-btn-p:hover { background: #12307A; }
.sp-btn-ok { background: #12805C; color: #fff; border-color: #12805C; }
.sp-btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.sp-btn-block { width: 100%; height: 46px; }
.sp-btn-danger { color: #B42318; }
.sp-link { border: 0; background: none; padding: 0; font: 600 13px Inter, sans-serif; color: #1563D6; cursor: pointer; text-align: left; }
.sp-link:hover { color: #0A2463; text-decoration: underline; }
.sp-link-sm { font-size: 12px; }
.sp-link.is-on { color: #8A3F06; }
.sp-mini { height: 30px; padding: 0 10px; border: 1px solid #D5DCE8; background: #fff; border-radius: 6px; font: 600 12px Inter, sans-serif; color: #0F1B3D; cursor: pointer; }
.sp-mini:hover { border-color: #0A2463; }
.sp-mini-p { border-color: #0A2463; color: #0A2463; }
.sp-iconbtn { width: 32px; height: 32px; border: 1px solid #E3E8F1; background: #fff; border-radius: 6px; cursor: pointer; font-size: 16px; }
.sp-input { height: 40px; border: 1px solid #D5DCE8; border-radius: 8px; padding: 0 10px; font: 14px Inter, sans-serif; color: #0F1B3D; background: #fff; max-width: 100%; }
.sp-input-sm { height: 34px; font-size: 13px; font-weight: 600; }
.sp-ta { height: auto; padding: 10px; width: 100%; line-height: 1.5; resize: vertical; }
.sp-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.sp-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #3D4A66; }
.sp-exam { display: flex; align-items: baseline; gap: 10px; }
.sp-exam b { font: 700 18px 'Plus Jakarta Sans', sans-serif; }
.sp-pill { font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 700; }
.sp-pill.ok { background: #E8F5EF; color: #0B5E43; }
.sp-pill.warn { background: #FDF3E6; color: #B45309; }
.sp-pill.bad { background: #FDECEC; color: #B42318; }

/* intro */
.sp-intro { max-width: 720px; gap: 14px; padding: 26px; }

/* builder */
.sp-bhead { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: #fff; border: 1px solid #E3E8F1; border-radius: 12px; padding: 14px 18px; }
.sp-bhead .sp-link { margin-left: auto; }
.sp-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.sp-step { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: #F1F4F9; color: #3D4A66; }
.sp-step.is-on { background: #0A2463; color: #fff; font-weight: 600; }
.sp-step.is-done { background: #E8F5EF; color: #0B5E43; font-weight: 600; }
.sp-opt { height: 38px; padding: 0 18px; border: 1px solid #D5DCE8; background: #fff; border-radius: 8px; font: 600 13px Inter, sans-serif; cursor: pointer; color: #0F1B3D; }
.sp-opt.is-on { border: 2px solid #0A2463; background: #EEF3FC; color: #0A2463; padding: 0 17px; }
.sp-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; border: 1px solid #D5DCE8; border-radius: 8px; padding: 6px; }
.sp-chip { font: 500 12.5px Inter, sans-serif; background: #EEF3FC; color: #0A2463; border: 0; border-radius: 6px; padding: 5px 8px; cursor: pointer; }
.sp-chips .sp-input { border: 0; height: 30px; }
.sp-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.sp-day { border: 1px solid #D5DCE8; background: #fff; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; color: #66728C; min-width: 0; cursor: pointer; }
.sp-day.is-on { border: 2px solid #0A2463; background: #EEF3FC; color: #0A2463; padding: 11px; }
.sp-day-name { display: flex; gap: 6px; align-items: center; }
.sp-day input[type=checkbox] { accent-color: #0A2463; width: 16px; height: 16px; }
.sp-day .sp-input-sm { width: 100%; padding: 0 4px; }
.sp-week-sm { gap: 6px; }
.sp-week-sm .sp-day { padding: 8px; font-size: 12.5px; }
.sp-totals { display: flex; gap: 24px; flex-wrap: wrap; font-size: 13px; color: #3D4A66; }
.sp-totals b { color: #0F1B3D; }
.sp-foot { display: flex; justify-content: flex-end; gap: 10px; }
.sp-foot-aside .sp-btn { flex: 1; }
.sp-foot-left { justify-content: flex-start; }
.sp-tabs { display: flex; gap: 4px; border-bottom: 1px solid #E3E8F1; overflow-x: auto; }
.sp-tab { height: 40px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; font: 500 13.5px Inter, sans-serif; color: #3D4A66; cursor: pointer; white-space: nowrap; }
.sp-tab.is-on { border-bottom-color: #0A2463; color: #0A2463; font-weight: 700; }
.sp-quick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-bottom: 6px; }
.sp-quick .sp-label { margin: 0; }
.sp-topics { padding: 0 18px 12px; }
.sp-trow { display: grid; grid-template-columns: minmax(0, 1fr) auto 170px; gap: 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid #EEF1F6; font-size: 13.5px; }
.sp-trow:last-child { border-bottom: 0; }
.sp-trow.is-unsure { background: #F7FAFF; margin: 0 -18px; padding: 9px 18px; }
.sp-tname { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.sp-from { font-size: 11px; font-weight: 600; color: #1563D6; background: #EEF3FC; border-radius: 4px; padding: 2px 6px; }
.sp-coach { font-size: 11px; font-weight: 600; color: #6B3FB8; background: #F2EDFB; border-radius: 4px; padding: 2px 6px; }
.sp-tside { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.sp-seg { display: flex; gap: 4px; }
.sp-segb { height: 30px; padding: 0 10px; border: 1px solid #D5DCE8; background: #fff; border-radius: 6px; font: 500 12px Inter, sans-serif; color: #3D4A66; cursor: pointer; white-space: nowrap; }
.sp-segb.is-on { font-weight: 700; padding: 0 9px; border-width: 2px; }
.sp-segb.lv-not_started.is-on { border-color: #66728C; background: #F1F4F9; color: #0F1B3D; }
.sp-segb.lv-studying.is-on { border-color: #1563D6; background: #EEF3FC; color: #0A2463; }
.sp-segb.lv-weak.is-on { border-color: #B45309; background: #FDF3E6; color: #8A3F06; }
.sp-segb.lv-strong.is-on { border-color: #12805C; background: #E8F5EF; color: #0B5E43; }
.sp-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-size: 12.5px; }
.sp-count { border-radius: 8px; padding: 8px 10px; background: #F1F4F9; }
.sp-count b { display: block; font: 700 18px 'Plus Jakarta Sans', sans-serif; }
.sp-count.lv-studying { background: #EEF3FC; color: #0A2463; }
.sp-count.lv-weak { background: #FDF3E6; color: #8A3F06; }
.sp-count.lv-strong { background: #E8F5EF; color: #0B5E43; }
.sp-legend { font-size: 12.5px; color: #3D4A66; }
.sp-aside input[type=range] { accent-color: #0A2463; width: 100%; }
.sp-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sp-optc { border: 1px solid #D5DCE8; background: #fff; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 4px; text-align: left; font: 500 12.5px Inter, sans-serif; color: #66728C; cursor: pointer; }
.sp-optc b { font-size: 14px; color: #0F1B3D; }
.sp-optc.is-on { border: 2px solid #0A2463; background: #EEF3FC; padding: 11px; }
.sp-optc.is-on b { color: #0A2463; }
.sp-result { position: sticky; top: 12px; }
.sp-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.sp-nums-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sp-num { background: #F6F8FC; border-radius: 8px; padding: 10px 4px; display: flex; flex-direction: column; gap: 2px; }
.sp-num b { font: 700 20px 'Plus Jakarta Sans', sans-serif; }
.sp-num span { font-size: 11.5px; color: #66728C; }
.sp-kbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #EEF1F6; }
.sp-kleg { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; }
.sp-kleg span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; background: currentColor; }
.sp-kbar .k-learn { background: #1563D6; } .sp-kbar .k-practise { background: #6C9BE8; } .sp-kbar .k-fix { background: #D9822B; }
.sp-kbar .k-revise { background: #12805C; } .sp-kbar .k-checkup { background: #8A5A00; } .sp-kbar .k-mock { background: #6B3FB8; }
.sp-kleg .k-learn { color: #1563D6; } .sp-kleg .k-practise { color: #4C7BD0; } .sp-kleg .k-fix { color: #B45309; }
.sp-kleg .k-revise { color: #12805C; } .sp-kleg .k-checkup { color: #8A5A00; } .sp-kleg .k-mock { color: #6B3FB8; }
.sp-phases { display: flex; flex-direction: column; gap: 6px; }
.sp-phase { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 8px; font-size: 12.5px; color: #3D4A66; }
.sp-phase.ph-build { background: #EEF3FC; } .sp-phase.ph-build b { color: #0A2463; }
.sp-phase.ph-rev { background: #E8F5EF; } .sp-phase.ph-rev b { color: #0B5E43; }
.sp-short { border: 1px solid #F3D9B8; background: #FFFAF3; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.sp-short > b { font-size: 13px; color: #8A3F06; }
.sp-details summary { cursor: pointer; font-size: 12.5px; color: #1563D6; font-weight: 600; }

/* plan views */
.sp-phead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: #fff; border: 1px solid #E3E8F1; border-radius: 12px; padding: 12px 16px; }
.sp-ptitle { display: flex; align-items: baseline; gap: 12px; }
.sp-vtabs { display: flex; gap: 2px; background: #F1F4F9; border-radius: 8px; padding: 3px; }
.sp-vtab { height: 32px; padding: 0 14px; border: 0; background: transparent; border-radius: 6px; font: 500 13px Inter, sans-serif; color: #3D4A66; cursor: pointer; white-space: nowrap; }
.sp-vtab.is-on { background: #fff; color: #0A2463; font-weight: 700; box-shadow: 0 1px 2px rgba(15, 27, 61, 0.12); }
.sp-pacts { margin-left: auto; display: flex; gap: 8px; }
.sp-banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: #FFFAF3; border: 1px solid #F3D9B8; border-radius: 10px; padding: 10px 14px; font-size: 13px; color: #8A3F06; }
.sp-body { display: flex; flex-direction: column; gap: 14px; }
.sp-prompt { border-color: #F3D9B8; background: #FFFCF7; }
.sp-timechips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sp-tc { height: 32px; padding: 0 10px; border: 1px solid #D5DCE8; background: #fff; border-radius: 8px; font: 600 12.5px Inter, sans-serif; cursor: pointer; color: #0F1B3D; }
.sp-tc.is-on { border: 2px solid #0A2463; background: #EEF3FC; color: #0A2463; padding: 0 9px; }
.sp-pace .sp-btn { align-self: flex-start; }
.sp-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0 10px 10px; border-bottom: 1px solid #EEF1F6; border-left: 3px solid var(--subj, #1563D6); margin-left: -2px; }
.sp-item:last-child { border-bottom: 0; }
.sp-tick { width: 24px; height: 24px; flex: none; border: 2px solid #C4CCDA; background: #fff; border-radius: 6px; cursor: pointer; color: #fff; font: 700 13px Inter, sans-serif; display: flex; align-items: center; justify-content: center; padding: 0; margin-top: 1px; }
.sp-tick.is-done { background: #12805C; border-color: #12805C; }
.sp-tick:disabled { cursor: default; opacity: 0.6; }
.sp-item-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sp-item-t { font-size: 14px; font-weight: 600; }
.st-done .sp-item-t, .st-partly .sp-item-t { color: #66728C; text-decoration: line-through; }
.st-partly .sp-item-t { text-decoration: none; }
.sp-item-m { font-size: 12px; color: #66728C; }
.sp-item-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

/* calendar */
.sp-cal-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sp-seg2 { margin-left: auto; display: flex; gap: 2px; background: #F1F4F9; border-radius: 6px; padding: 2px; }
.sp-seg2b { height: 28px; padding: 0 10px; border: 0; background: transparent; border-radius: 5px; font: 500 12px Inter, sans-serif; cursor: pointer; color: #3D4A66; }
.sp-seg2b.is-on { background: #fff; font-weight: 700; color: #0A2463; }
.sp-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.sp-cal-hdr span { font-size: 11.5px; font-weight: 600; color: #66728C; padding: 0 6px; }
.sp-cell { min-height: 104px; background: #fff; border: 1px solid #E3E8F1; border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow: hidden; cursor: pointer; }
.sp-cell.is-off, .sp-cell.is-out { background: #F6F8FC; }
.sp-cell.is-out .sp-cell-h { color: #A3ACBF; }
.sp-cell.is-today { border: 2px solid #1563D6; padding: 5px; }
.sp-cell.is-sel { box-shadow: 0 0 0 2px #C9D9F5 inset; }
.sp-cell.is-drop { background: #EEF3FC; border-style: dashed; }
.sp-cell-h { display: flex; justify-content: space-between; gap: 4px; font-size: 12px; font-weight: 600; color: #3D4A66; width: 100%; }
.sp-cell-tag { font-size: 10.5px; color: #A3ACBF; font-weight: 500; }
.sp-cell.is-today .sp-cell-tag:first-of-type { color: #1563D6; }
.sp-exam-tag { color: #B42318 !important; font-weight: 700 !important; }
.sp-more { font-size: 10.5px; color: #66728C; padding-left: 2px; }
.sp-key { gap: 6px; font-size: 12.5px; }
.sp-key > span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c); margin-right: 7px; vertical-align: -1px; }

/* subjects & topics */
.sp-subjcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.sp-subjcard { background: #fff; border: 1px solid #E3E8F1; border-left: 4px solid var(--subj); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.sp-lbar { height: 8px; border-radius: 4px; background: #EEF1F6; overflow: hidden; display: flex; }
.lb-strong { background: #12805C; } .lb-weak { background: #D9822B; } .lb-studying { background: #1563D6; } .lb-rest { background: transparent; }
.sp-subhead { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; background: #fff; border: 0; border-bottom: 1px solid #E3E8F1; font: 14px Inter, sans-serif; color: #0F1B3D; cursor: pointer; text-align: left; }
.sp-caret { width: 14px; color: #3D4A66; }
.sp-tr { display: grid; grid-template-columns: minmax(0, 1.5fr) 130px 170px 150px 90px 150px; gap: 12px; align-items: center; padding: 9px 16px; border-bottom: 1px solid #EEF1F6; font-size: 13px; }
.sp-th { font-size: 11.5px; font-weight: 600; color: #66728C; text-transform: uppercase; letter-spacing: 0.06em; background: #F6F8FC; }
.sp-tr.is-today { background: #F7FAFF; }
.sp-tr.is-skipped { opacity: 0.75; }
.sp-tr-name { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-width: 0; }
.sp-tr-acts { display: flex; gap: 6px; justify-content: flex-end; }
.sp-lvl { height: 30px; border-radius: 999px; border: 1px solid #D5DCE8; font: 700 11.5px Inter, sans-serif; padding: 0 8px; background: #F1F4F9; color: #3D4A66; max-width: 100%; }
.sp-lvl.lv-studying { background: #EEF3FC; color: #0A2463; border-color: #C9D9F5; }
.sp-lvl.lv-weak { background: #FDF3E6; color: #8A3F06; border-color: #F3D9B8; }
.sp-lvl.lv-strong { background: #E8F5EF; color: #0B5E43; border-color: #BFE3D3; }
.sp-lvl.lv-unsure { background: #FFF4E5; color: #8A3F06; border-style: dashed; border-color: #D9822B; }

/* pace: see round 2 below */
/* modal */
.sp-modal-ov { position: fixed; inset: 0; background: rgba(15, 27, 61, 0.38); z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.sp-modal { background: #fff; border-radius: 14px; padding: 20px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; display: flex; flex-direction: column; gap: 10px; font-family: Inter, system-ui, sans-serif; color: #0F1B3D; box-shadow: 0 20px 50px rgba(15, 27, 61, 0.25); }
.sp-movelist { margin: 0; padding-left: 18px; font-size: 13px; color: #3D4A66; }
.sp-danger { border-top: 1px solid #E3E8F1; padding-top: 12px; margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sp-danger .sp-label { width: 100%; margin: 0; }

@media (max-width: 1100px) {
  .sp-tr { grid-template-columns: minmax(0, 1.4fr) 120px 150px 120px 70px 120px; }
  .sp-split-wide { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 900px) {
  .sp-split, .sp-split-wide { grid-template-columns: minmax(0, 1fr); }
  .sp-result { position: static; }
  .sp-opts { grid-template-columns: minmax(0, 1fr); }
  .sp-week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  #plan-root { gap: 10px; }
  .sp-grid2 { grid-template-columns: minmax(0, 1fr); }
  .sp-card { padding: 14px; }
  .sp-bhead, .sp-phead { padding: 10px 12px; gap: 10px; }
  .sp-bhead .sp-link { margin-left: 0; }
  .sp-steps .sp-step span:last-child { display: none; }
  .sp-steps .sp-step.is-on span:last-child { display: inline; }
  .sp-vtabs { width: 100%; }
  .sp-vtab { flex: 1; padding: 0 6px; font-size: 12.5px; }
  .sp-pacts { margin-left: 0; }
  .sp-trow { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .sp-trow.is-unsure { margin: 0 -14px; padding: 9px 14px; }
  .sp-topics { padding: 0 14px 10px; }
  .sp-pad { padding: 12px 14px 0; }
  .sp-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sp-segb { padding: 0 2px; font-size: 11px; white-space: normal; line-height: 1.1; height: 36px; }
  .sp-segb.is-on { padding: 0 1px; }
  .sp-tside { flex-direction: row; gap: 10px; justify-content: space-between; width: 100%; }
  .sp-week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-nums-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-cal-grid { gap: 3px; }
  .sp-cell { min-height: 58px; padding: 4px; }
  .sp-cell.is-today { padding: 3px; }
  .sp-cell-tag { display: none; }
  .sp-tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'n l' 'x x'; gap: 4px 10px; }
  .sp-tr > :nth-child(1) { grid-area: n; font-weight: 600; }
  .sp-tr > :nth-child(2) { grid-area: l; }
  .sp-tr > :nth-child(3), .sp-tr > :nth-child(4), .sp-tr > :nth-child(5) { grid-column: 1 / -1; font-size: 12px; }
  .sp-tr > :nth-child(5):empty { display: none; }
  .sp-tr-acts { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ══ Round 2 (2026-11-23, roadmap/2026-11-22-plan-empty-home, E1–E13) ══ */
.sp-grow { flex: 1; }
.sp-strong { margin: 0; font-weight: 700; font-size: 15px; color: #0F1B3D; }
.sp-pill.mute { background: #F1F4F9; color: #3D4A66; }
.sp-eyebrow-blue { color: #1563D6; }
.sp-pad-b { padding: 4px 18px 14px; }
/* empty plan */
.sp-emptybar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: #F7FAFF; border: 1px solid #DCE7FA; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; color: #0A2463; }
.sp-emptybar > span { flex: 1 1 260px; }
.sp-emptynote { background: #F7FAFF; border: 1px dashed #C9D9F5; border-radius: 10px; padding: 10px 14px; font-size: 13px; color: #3D4A66; }
.sp-np { font-size: 11px; font-weight: 600; color: #66728C; background: #F1F4F9; border-radius: 999px; padding: 2px 9px; justify-self: start; white-space: nowrap; }
.sp-trs { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid #EEF1F6; font-size: 13px; }
.sp-weekmini { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.sp-weekmini-d { border: 1px solid #E3E8F1; border-radius: 8px; padding: 6px 2px; font-size: 11px; font-weight: 600; color: #A3ACBF; text-align: center; min-height: 48px; }
.sp-weekmini-d.is-today { border: 2px solid #1563D6; color: #1563D6; }
.sp-cal-empty { margin: 0; }
.sp-tr-empty { color: #3D4A66; }
/* pop-up (E1) — a bottom sheet on phones (E3) */
.sp-pop { width: min(520px, 100%); gap: 12px; padding: 24px; }
.sp-pop-h { margin: 0; font: 700 20px 'Plus Jakarta Sans', Inter, sans-serif; color: #0F1B3D; }
.sp-pop-opts { display: flex; flex-direction: column; gap: 10px; }
.sp-pop-opt { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 1px solid #D5DCE8; background: #fff; border-radius: 12px; padding: 14px 16px; cursor: pointer; font: 500 13px Inter, sans-serif; color: #66728C; }
.sp-pop-opt b { font-size: 15px; color: #0F1B3D; }
.sp-pop-opt:hover, .sp-pop-opt:focus-visible { border-color: #0A2463; }
.sp-pop-opt.is-main { border: 2px solid #0A2463; background: #EEF3FC; padding: 13px 15px; }
.sp-pop-opt.is-main b { color: #0A2463; }
.sp-pop-skip { align-self: center; font-size: 14px; padding: 6px 10px; }
/* coaching picker (E4) */
.sp-sheet { width: min(620px, 100%); }
.sp-pick-list { display: flex; flex-direction: column; gap: 12px; max-height: min(52vh, 460px); overflow: auto; border: 1px solid #E3E8F1; border-radius: 10px; padding: 10px 12px; }
.sp-pick-g { display: flex; flex-direction: column; gap: 2px; }
.sp-pick-gh { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; padding: 4px 0; border-bottom: 1px solid #EEF1F6; margin-bottom: 2px; }
.sp-pick-row { padding: 5px 2px; min-height: 32px; }
.sp-pick-row input { width: 18px; height: 18px; accent-color: #0A2463; flex: none; }
.sp-pick-foot { align-items: center; }
/* step 2 lengths (E13) */
.sp-trow.sp-trow-len { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.sp-trow-len .sp-tname { flex: 1 1 200px; }
.sp-trow-len .sp-seg { flex: 0 1 auto; flex-wrap: wrap; }
.sp-trow-len .sp-len { flex: 0 0 auto; }
.sp-trow-len .sp-tside { flex: 1 1 100%; }
.sp-len { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sp-len-b { width: 30px; height: 30px; border: 1px solid #D5DCE8; background: #fff; border-radius: 6px; font: 700 15px Inter, sans-serif; color: #0A2463; cursor: pointer; padding: 0; }
.sp-len-b:hover { border-color: #0A2463; }
.sp-len-v { min-width: 62px; text-align: center; font-weight: 700; font-size: 13px; }
.sp-len-u { display: flex; border: 1px solid #D5DCE8; border-radius: 6px; overflow: hidden; }
.sp-len-ub { height: 28px; padding: 0 8px; border: 0; background: #fff; font: 600 11.5px Inter, sans-serif; color: #3D4A66; cursor: pointer; }
.sp-len-ub.is-on { background: #0A2463; color: #fff; }
.sp-len-src { font-size: 11px; color: #66728C; width: 100%; }
.sp-len-src.is-own { color: #6B3FB8; font-weight: 600; }
.sp-len-lg .sp-len-b { width: 40px; height: 40px; font-size: 18px; }
.sp-len-lg .sp-len-v { font-size: 16px; min-width: 90px; }
.sp-bignum { font: 700 22px 'Plus Jakarta Sans', Inter, sans-serif; color: #0A2463; }
/* calendar: colourful month (E7) */
.sp-daypill { font-size: 10.5px; font-weight: 600; color: #0A2463; background: #EEF3FC; border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.sp-chipc { display: flex; gap: 4px; align-items: center; font-size: 11px; line-height: 1.25; padding: 3px 6px; border-radius: 5px; background: var(--subj); color: #fff; white-space: nowrap; overflow: hidden; min-width: 0; }
.sp-chip-i { flex: none; font-size: 10px; width: 12px; text-align: center; }
.sp-chip-t { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sp-chipc[draggable=true] { cursor: grab; }
.sp-chipc.is-done { opacity: 0.55; }
.sp-chipc.is-missed { background: repeating-linear-gradient(135deg, #FDF0E1 0 6px, #FFFFFF 6px 12px); color: #8A3F06; box-shadow: inset 0 0 0 1px #D9822B; }
.sp-chipc.is-dragging, .sp-wcard.is-dragging, .sp-ord.is-dragging { opacity: 0.4; }
.sp-more { border: 0; background: none; padding: 1px 2px; font: 600 10.5px Inter, sans-serif; color: #1563D6; cursor: pointer; text-align: left; }
.sp-more:hover { text-decoration: underline; }
.sp-key-missed { display: inline-block; padding: 1px 8px; border-radius: 4px; background: repeating-linear-gradient(135deg, #FDF0E1 0 4px, #fff 4px 8px); box-shadow: inset 0 0 0 1px #D9822B; color: #8A3F06; font-size: 11.5px; font-weight: 600; }
.sp-keyline { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; font-size: 12px; margin-top: 4px; }
.sp-keyline-c::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c); margin-right: 6px; vertical-align: -1px; }
.sp-cal-sum { margin-left: 4px; }
/* week columns (E8) */
.sp-calwrap { display: flex; flex-direction: column; gap: 14px; }
.sp-weekcols { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: start; }
.sp-wcol { background: #F6F8FC; border: 1px solid #E3E8F1; border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 180px; min-width: 0; }
.sp-wcol.is-today { border: 2px solid #1563D6; padding: 7px; background: #fff; }
.sp-wcol.is-off { background: #EEF1F6; opacity: 0.8; }
.sp-wcol.is-drop { background: #EEF3FC; border-style: dashed; }
.sp-wcol-h { display: flex; flex-direction: column; gap: 1px; font-size: 13px; padding-bottom: 4px; border-bottom: 1px solid #E3E8F1; }
.sp-wcol-h .sp-muted { font-size: 11px; }
.sp-wcard { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 0; border-left: 4px solid var(--subj); background: #fff; border-radius: 7px; padding: 7px 8px; font: 12px Inter, sans-serif; color: #0F1B3D; cursor: pointer; box-shadow: 0 1px 2px rgba(15, 27, 61, 0.08); min-width: 0; }
.sp-wcard:hover, .sp-wcard:focus-visible { box-shadow: 0 0 0 2px #C9D9F5; }
.sp-wcard[draggable=true] { cursor: grab; }
.sp-wcard-s { font-size: 10.5px; font-weight: 700; color: var(--subj); text-transform: uppercase; letter-spacing: 0.04em; }
.sp-wcard-t { font-weight: 700; font-size: 12.5px; }
.sp-wcard-m { font-size: 11px; color: #66728C; }
.sp-wcard-st { font-size: 10.5px; font-weight: 700; }
.sp-wcard-st.ok { color: #12805C; } .sp-wcard-st.warn { color: #B45309; }
.sp-wcard.is-done { opacity: 0.6; }
.sp-wcard.is-missed { background: repeating-linear-gradient(135deg, #FDF0E1 0 6px, #FFFFFF 6px 12px); }
.sp-wadd { align-self: flex-start; }
/* phone week list (E11) */
.sp-daystrip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; position: sticky; top: 0; background: #fff; z-index: 1; padding: 4px 0; }
.sp-daystrip-d { display: flex; flex-direction: column; align-items: center; gap: 1px; border: 1px solid #E3E8F1; background: #fff; border-radius: 8px; padding: 5px 0; font: 11px Inter, sans-serif; color: #66728C; cursor: pointer; }
.sp-daystrip-d b { font-size: 14px; color: #0F1B3D; }
.sp-daystrip-d.is-today { border: 2px solid #1563D6; padding: 4px 0; }
.sp-daystrip-d.is-on { background: #EEF3FC; }
.sp-dsec { border-top: 1px solid #E3E8F1; padding-top: 10px; display: flex; flex-direction: column; gap: 2px; scroll-margin-top: 70px; }
.sp-item.is-missed { background: repeating-linear-gradient(135deg, #FFF7EE 0 6px, #FFFFFF 6px 12px); }
/* schedule (E9) */
.sp-sched-tools { gap: 8px; }
.sp-sched { display: flex; flex-direction: column; gap: 12px; }
.sp-sched-earlier summary { cursor: pointer; font-size: 13px; font-weight: 600; color: #1563D6; padding: 6px 0; }
.sp-sched-week { border: 1px solid #E3E8F1; border-radius: 10px; overflow: hidden; }
.sp-sched-wh { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; background: #F6F8FC; padding: 8px 12px; font-size: 13px; border-bottom: 1px solid #E3E8F1; }
.sp-sched-day { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; padding: 7px 12px; border-bottom: 1px solid #EEF1F6; align-items: start; scroll-margin-top: 70px; }
.sp-sched-day:last-child { border-bottom: 0; }
.sp-sched-day.is-today { background: #F7FAFF; box-shadow: inset 3px 0 0 #1563D6; }
.sp-sched-day.is-off .sp-sched-d { color: #A3ACBF; }
.sp-sched-d { display: flex; gap: 6px; align-items: center; font-size: 12.5px; }
.sp-today-tag { font-size: 10.5px; font-weight: 700; color: #1563D6; }
.sp-sched-its { display: flex; gap: 6px; flex-wrap: wrap; }
.sp-sched-it { display: inline-flex; gap: 5px; align-items: center; border: 0; border-radius: 6px; background: var(--subj); color: #fff; padding: 4px 8px; font: 600 11.5px Inter, sans-serif; cursor: pointer; max-width: 100%; text-align: left; }
.sp-sched-it.is-done { opacity: 0.55; }
.sp-sched-it.is-missed { background: repeating-linear-gradient(135deg, #FDF0E1 0 6px, #FFFFFF 6px 12px); color: #8A3F06; box-shadow: inset 0 0 0 1px #D9822B; }
/* subjects & topics: tools, subject header, order (E10) */
.sp-subtools { gap: 8px; }
.sp-subhead-wrap { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #E3E8F1; padding-right: 12px; background: #fff; }
.sp-subhead-wrap .sp-subhead { border-bottom: 0; flex: 1; min-width: 0; }
.sp-orderm { width: min(640px, 100%); }
.sp-seg2-left { margin-left: 0; align-self: flex-start; }
.sp-seg2-wrap { flex-wrap: wrap; }
.sp-order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: min(52vh, 480px); overflow: auto; }
.sp-ord { display: flex; align-items: center; gap: 10px; border: 1px solid #E3E8F1; border-left: 4px solid var(--subj); border-radius: 8px; padding: 8px 10px; background: #fff; cursor: grab; }
.sp-ord.is-drop { border-style: dashed; background: #EEF3FC; }
.sp-ord-h { color: #A3ACBF; font-weight: 700; letter-spacing: -2px; user-select: none; }
.sp-ord-n { width: 22px; text-align: right; font-weight: 700; color: #66728C; font-size: 12.5px; }
.sp-ord-t { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.sp-ord-t b { overflow-wrap: anywhere; }
.sp-orderfoot { align-items: center; margin-top: 6px; }
/* pace (E5, E6) */
.sp-pacehead { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.sp-pace-h { margin: 0; font: 700 20px 'Plus Jakarta Sans', Inter, sans-serif; color: #0F1B3D; flex: 1 1 260px; }
.sp-pacehead .sp-muted { flex-basis: 100%; margin: 0; }
.sp-pies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sp-pierow { display: flex; align-items: center; gap: 16px; }
.sp-pie { flex: none; }
.sp-pie-c { font: 700 22px 'Plus Jakarta Sans', Inter, sans-serif; fill: #0F1B3D; }
.sp-pie-c.sm { font-size: 12px; }
.sp-pieleg { display: flex; flex-direction: column; gap: 5px; font-size: 13px; min-width: 0; flex: 1; }
.sp-pie-sub { font-weight: 600; color: #3D4A66; font-size: 12.5px; }
.sp-pieleg-r { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.sp-pieleg-r.is-missed span:nth-child(2) { color: #8A3F06; font-weight: 600; }
.sp-sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; box-shadow: inset 0 0 0 1px rgba(15, 27, 61, 0.08); }
.sp-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sp-twon { background: #fff; border: 1px solid #E3E8F1; border-radius: 12px; padding: 16px 18px; display: flex; align-items: center; gap: 14px; font-size: 13.5px; color: #3D4A66; }
.sp-twon b { font: 700 30px 'Plus Jakarta Sans', Inter, sans-serif; color: #0A2463; min-width: 44px; }
.sp-lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.sp-bsub { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid #EEF1F6; }
.sp-bsub:last-child { border-bottom: 0; }
.sp-bsub-t { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }

@media (max-width: 1100px) {
  .sp-lists { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sp-pies { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sp-weekcols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sp-modal-ov.sp-pop-ov, .sp-modal-ov.sp-sheet-ov { align-items: flex-end; padding: 0; }
  .sp-pop, .sp-sheet { width: 100%; border-radius: 16px 16px 0 0; max-height: 92vh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .sp-sheet .sp-pick-list, .sp-sheet .sp-order { max-height: 56vh; }
  .sp-trow-len .sp-seg { flex: 1 1 100%; }
  .sp-cell { min-height: 64px; }
  .sp-chipc { font-size: 0; height: 7px; padding: 0; border-radius: 3px; }
  .sp-chipc .sp-chip-i, .sp-chipc .sp-chip-t { display: none; }
  .sp-daypill { display: none; }
  .sp-cell .sp-more { font-size: 9.5px; }
  .sp-pies, .sp-two, .sp-lists { grid-template-columns: minmax(0, 1fr); }
  .sp-twon b { font-size: 24px; }
  .sp-sched-day { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .sp-pierow { gap: 12px; }
  .sp-ord { gap: 6px; padding: 8px; }
  .sp-ord-h { display: none; }
  .sp-subhead-wrap { padding-right: 8px; }
  .sp-emptybar { padding: 10px 12px; }
}
@media print {
  body * { visibility: hidden !important; }
  #plan-root .sp-sched, #plan-root .sp-sched * { visibility: visible !important; }
  #plan-root .sp-sched { position: absolute; left: 0; top: 0; width: 100%; }
  .sp-sched-earlier:not([open]) { display: none; }
  .sp-sched-it { color: #000 !important; background: #fff !important; box-shadow: inset 0 0 0 1px #888 !important; }
  .sp-sched-week { break-inside: avoid; }
}
/* Week columns follow the card's own width (the side menu narrows it). */
.sp-cal { container-type: inline-size; }
.sp-wcard-t { overflow-wrap: break-word; word-break: normal; hyphens: auto; }
@container (max-width: 900px) { .sp-weekcols { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (max-width: 560px) { .sp-weekcols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sp-pierow { flex-wrap: wrap; }
.sp-pieleg { flex: 1 1 130px; min-width: 130px; }
@container (max-width: 640px) { .sp-daypill { display: none; } }
