/* V166 — ONLY requested fixes 1–3. Planner week/date logic untouched. */

/* 1) Dashboard task selection + distinct subject colors */
#refToday .ref-task-row{
  appearance:none!important;-webkit-appearance:none!important;border:1px solid transparent!important;
  background:rgba(255,255,255,.50)!important;color:#18324d!important;text-align:left!important;
  cursor:pointer!important;border-radius:12px!important;transition:.15s ease!important;
}
#refToday .ref-task-row:hover{background:rgba(255,255,255,.78)!important;border-color:#cddcf0!important}
#refToday .ref-task-row.selected{background:#eef6ff!important;border-color:#2f80ed!important;box-shadow:0 0 0 2px rgba(47,128,237,.12)!important}
#refToday .ref-task-row.selected .ref-check{background:#2f80ed!important;color:#fff!important;border-color:#2f80ed!important}
#refToday .ref-subject-badge{font-weight:900!important;border:0!important;color:#fff!important;min-width:48px!important;text-align:center!important}
#refToday .ref-subject-badge.math{background:#3b82f6!important}
#refToday .ref-subject-badge.geo{background:#8b5cf6!important}
#refToday .ref-subject-badge.physics{background:#ef4444!important}
#refToday .ref-subject-badge.chem{background:#f59e0b!important;color:#3b2a00!important}
#refToday .ref-subject-badge.bio{background:#22c55e!important}
#refToday .ref-subject-badge.turkish{background:#ec4899!important}
#refToday .ref-subject-badge.social{background:#6366f1!important}
#refToday .ref-subject-badge.science{background:#06b6d4!important}
#refToday .ref-subject-badge.generic{background:#64748b!important}
#refToday .ref-duration{background:#e9f8ef!important;color:#16834f!important;font-weight:850!important}

/* 2) Desktop sidebar stays readable; flyouts never collapse */
@media (min-width:901px){
  body:not(.planner-focus) .sidebar,
  body.planner-focus .sidebar{width:230px!important;min-width:230px!important;padding:22px 16px!important;align-items:stretch!important;overflow:visible!important}
  body:not(.planner-focus) .main-shell,
  body.planner-focus .main-shell{margin-left:230px!important;width:calc(100% - 230px)!important}
  body .side-brand>div:last-child,body .season-label,body .season,body .sidebar-footer{display:block!important}
  body .side-brand{justify-content:flex-start!important}
  body .side-nav{width:100%!important;overflow:visible!important}
  body .side-nav>button,body .nav-group>.nav-group-trigger{font-size:14px!important;justify-content:flex-start!important;padding:12px 12px!important;gap:10px!important;white-space:nowrap!important}
  body .side-nav .nav-text{display:inline!important;font-size:14px!important;line-height:1.2!important;white-space:nowrap!important;overflow:visible!important;opacity:1!important}
  body .side-nav .nav-icon{flex:0 0 26px!important;width:26px!important;min-width:26px!important;margin:0!important}
  body .nav-caret{display:inline!important;margin-left:auto!important}
  body .nav-flyout{left:calc(100% + 10px)!important;top:0!important;width:380px!important;min-width:380px!important;max-width:380px!important;padding:10px!important;overflow:hidden auto!important;z-index:10050!important}
  body .nav-flyout button{width:100%!important;display:grid!important;grid-template-columns:34px minmax(0,1fr)!important;gap:10px!important;align-items:center!important;padding:11px!important;overflow:hidden!important}
  body .nav-flyout .flyout-copy,body .nav-flyout button>b{display:flex!important;flex-direction:column!important;align-items:flex-start!important;min-width:0!important;width:100%!important;white-space:normal!important}
  body .nav-flyout strong,body .nav-flyout button>b{font-size:13px!important;line-height:1.25!important;color:#18324d!important}
  body .nav-flyout small{display:block!important;font-size:11px!important;line-height:1.3!important;color:#6d7c90!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important}
}

/* 3) AI coach: readable, contained, send button always visible */
#coachPage{background:#f5f8fc!important;overflow:hidden!important;padding:18px!important}
#coachPage .v123-coach{width:min(1220px,100%)!important;max-width:1220px!important;height:calc(100dvh - 124px)!important;min-height:620px!important;max-height:calc(100dvh - 124px)!important;margin:0 auto!important;overflow:hidden!important;grid-template-columns:280px minmax(0,1fr)!important}
#coachPage .v123-coach-side{background:linear-gradient(180deg,#123b62,#194f7c)!important;color:#fff!important;overflow-y:auto!important}
#coachPage .v123-coach-side b,#coachPage .v123-coach-side strong{color:#fff!important;opacity:1!important}
#coachPage .v123-coach-side small,#coachPage .v123-coach-side label{color:#d7e6f3!important;opacity:1!important}
#coachPage .v123-side-block>button,#coachPage .v123-clear{color:#f6fbff!important;background:rgba(255,255,255,.09)!important;border-color:rgba(255,255,255,.14)!important;opacity:1!important}
#coachPage .v123-chat{min-width:0!important;min-height:0!important;height:100%!important;overflow:hidden!important;display:grid!important;grid-template-rows:auto minmax(0,1fr) auto auto auto!important;background:#fff!important}
#coachPage .v123-msgs{min-height:0!important;height:auto!important;max-height:none!important;overflow-y:auto!important;padding:20px!important}
#coachPage .v123-chips{min-width:0!important;overflow-x:auto!important;padding:8px 18px!important}
#coachPage .v123-compose{box-sizing:border-box!important;width:calc(100% - 36px)!important;max-width:calc(100% - 36px)!important;margin:0 18px 8px!important;display:grid!important;grid-template-columns:44px minmax(0,1fr) 52px!important;gap:8px!important;padding:7px!important;overflow:visible!important}
#coachPage .v123-compose textarea{box-sizing:border-box!important;width:100%!important;min-width:0!important;color:#243b53!important;font-size:14px!important;line-height:1.35!important}
#coachPage .v123-compose>button{width:52px!important;min-width:52px!important;height:44px!important;padding:0!important;display:grid!important;place-items:center!important;overflow:visible!important}
#coachPage .v136-attach{width:44px!important;min-width:44px!important;height:44px!important}
#coachPage .v123-foot{color:#7f8fa3!important;font-size:9px!important}
@media(max-width:900px){
  #coachPage{padding:10px 10px 92px!important;overflow:auto!important}
  #coachPage .v123-coach{height:calc(100dvh - 112px)!important;min-height:0!important;max-height:none!important;grid-template-columns:1fr!important}
  #coachPage .v123-coach-side{display:none!important}
  #coachPage .v123-compose{width:calc(100% - 20px)!important;max-width:calc(100% - 20px)!important;margin:0 10px 8px!important;grid-template-columns:42px minmax(0,1fr) 48px!important}
  #coachPage .v123-compose>button{width:48px!important;min-width:48px!important}
}
