.workspace-heading { height: auto; min-height: 92px; padding: 16px var(--page-gutter) 24px; color: var(--text); }
.workspace-heading h1 { font-size: 28px; }
.workspace-heading .text-button { display: inline-flex; align-items: center; gap: 4px; padding: 0; color: var(--muted); background: transparent; min-height: 36px; margin-bottom: 8px; }
.workspace-tabs { display: flex; align-items: stretch; gap: 24px; min-height: 52px; }
.workspace-tabs > button { position: relative; background: transparent; color: var(--muted); border-radius: 8px; padding: 10px 2px; font-size: 16px; font-weight: 500; white-space: nowrap; }
.workspace-tabs > button:hover { color: var(--text); background: transparent; }
.workspace-tabs > button[aria-selected=true] { color: var(--text); }
.workspace-tabs > button::after { content: ''; position: absolute; inset: auto 0 0; height: 3px; background: var(--primary); border-radius: 4px; opacity: 0; transition: opacity 200ms; }
.workspace-tabs > button[aria-selected=true]::after { opacity: 1; }
.workspace-tabs.small { min-height: 44px; gap: 20px; }
.project-panel { margin: 0 40px 32px; container-type: inline-size; }
.field-hint, .home-updated { color: var(--muted); font-size: 14px; line-height: 1.55; }
.field-hint:empty, .form-error:empty { display: none; }
.form-error { margin-top: 16px; color: var(--danger); line-height: 1.5; }
.empty-state { padding: 24px 12px; color: var(--muted); font-size: 15px; font-weight: 400; line-height: 1.6; }
.compact-toggle { display: flex; align-items: center; gap: 12px; min-height: 48px; margin: 0; font-size: 15px; cursor: pointer; }
.event-editor h2, #project-material-editor h2, #home-settings h2, #blearning-destination h2 { font-size: 20px; font-weight: 600; color: var(--text); }
.event-editor form > input, .event-editor textarea, #project-material-editor input, #home-settings .custom-select { width: 100%; }
.event-editor .compact-toggle { margin: var(--field-gap) 0; }
.event-editor .task-fields, #project-material-editor form > div:not(.dialog-top):not(.dialog-actions) { margin-top: var(--field-gap); }
.column-completion { display: flex; align-items: center; justify-content: center; min-width: 40px; min-height: 48px; margin: 0; cursor: pointer; }
.project-options-toggle { margin-top: 20px; display: flex; align-items: center; gap: 12px; padding-inline: 4px; }
.project-options-toggle > :last-child { margin-left: auto; }
.project-options input, .project-options textarea { width: 100%; margin-bottom: 16px; }
.task-timestamps { display: grid; gap: 4px; color: var(--muted); font-size: 14px; line-height: 1.5; margin-top: 20px; }

/* A short overview, with project progress kept in the same workspace. */
.home-view { max-width: 1256px; padding: 20px 40px 40px; }
.home-header { height: auto; min-height: 80px; padding: 0; margin-bottom: 28px; color: var(--text); }
.home-header h1 { font-size: 28px; font-weight: 600; }
.home-header p { color: var(--muted); font-size: 15px; margin-bottom: 10px; }
.home-header p::first-letter { text-transform: uppercase; }
#home-blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 36px; }
.home-block { min-width: 0; }
.home-block:has(.home-projects) { grid-column: 1 / -1; }
.home-block-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.home-block-heading h2 { font-size: 18px; font-weight: 600; }
.home-block-heading h2 > span { margin-left: 8px; color: var(--muted); font-size: 14px; font-weight: 400; }
.home-list, .home-projects { list-style: none; margin: 0; padding: 0; }
.home-list { display: grid; gap: 8px; }
.home-row, .agenda-item, .material-row { display: flex; width: 100%; align-items: center; text-align: left; gap: 14px; padding: 12px; background: transparent; border-radius: 12px; font-size: 16px; font-weight: 400; color: var(--text); text-decoration: none; }
.home-row > span:not(.material-symbols-rounded), .agenda-item > span:not(.material-symbols-rounded), .material-row > span:not(.material-symbols-rounded) { min-width: 0; flex: 1; }
.home-row strong, .agenda-item strong { display: block; font-size: 15px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.home-row small, .agenda-item small { display: block; color: var(--muted); font-size: 14px; margin-top: 5px; line-height: 1.45; }
.home-row > .material-symbols-rounded, .agenda-item > .material-symbols-rounded, .material-row > .material-symbols-rounded { color: var(--muted); font-size: 22px; flex-shrink: 0; }
.home-row > :last-child.material-symbols-rounded { font-size: 18px; opacity: .6; }
.home-row:hover, .agenda-item:hover, .material-row:hover { background: var(--surface-raised); }
.home-row { padding-block: 16px; }
.home-row strong { font-size: 16px; }
.home-updated { margin: -6px 12px 8px; }
.home-more { background: transparent; color: var(--muted); margin-top: 8px; padding-inline: 12px; font-size: 15px; }
.home-older > .home-more { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; }
.home-older > .home-more .material-symbols-rounded { font-size: 20px; transition: rotate 200ms; }
.home-older > .home-more[aria-expanded=true] .material-symbols-rounded { rotate: 180deg; }
.home-projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.home-projects button { width: 100%; height: 100%; min-width: 0; text-align: left; padding: 20px; background: var(--surface); border-radius: 18px; }
.home-projects button:hover { background: var(--surface-raised); }
.home-projects strong, .home-projects small { display: block; }
.home-projects strong { margin-bottom: 8px; font-size: 16px; font-weight: 500; }
.home-projects small { color: var(--muted); font-size: 14px; font-weight: 400; line-height: 1.5; }
.home-block-settings { display: grid; gap: 4px; margin-bottom: 24px; }
.home-block-option { display: flex; align-items: center; gap: 4px; }
.home-block-option label { display: flex; align-items: center; gap: 16px; flex: 1; margin: 0; font-size: 16px; }
.home-block-option > .icon { flex-basis: 44px; width: 44px; height: 44px; }

.calendar-toolbar { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.calendar-period, .calendar-actions { display: flex; align-items: center; gap: 8px; }
.calendar-period h2 { min-width: 160px; text-align: center; font-size: 18px; }
.calendar-period h2::first-letter, .calendar-agenda h3::first-letter { text-transform: uppercase; }
.calendar-actions button { display: inline-flex; align-items: center; gap: 8px; }
.calendar-actions .primary .material-symbols-rounded { margin: 0; font-size: 22px; }
.calendar-mode-toggle { justify-content: center; width: 48px; padding: 12px; }
.calendar-mode-icons { display: grid; place-items: center; width: 24px; height: 24px; }
.calendar-mode-icons > .material-symbols-rounded { grid-area: 1 / 1; transition: opacity 220ms ease-in-out; }
.calendar-mode-icons > :last-child { opacity: 0; }
[data-calendar-mode=agenda] .calendar-mode-icons > :first-child { opacity: 0; }
[data-calendar-mode=agenda] .calendar-mode-icons > :last-child { opacity: 1; }
.calendar-filters { display: flex; align-items: end; gap: 20px; margin-bottom: 24px; }
.calendar-filters > div { min-width: 180px; max-width: 280px; flex: 1; }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr); gap: 32px; align-items: start; }
.calendar-month { min-width: 0; }
.calendar-week, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar-week span { padding: 10px 0; text-align: center; color: var(--muted); font-size: 14px; }
.calendar-grid { height: min(480px, 52dvh); min-height: 300px; grid-template-rows: repeat(6, minmax(0, 1fr)); }
.calendar-day { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: 44px; gap: 8px; background: var(--surface); border-radius: 12px; padding: 8px 2px; font-size: 16px; font-weight: 400; }
.calendar-day.outside { background: transparent; color: var(--muted); opacity: .6; }
.calendar-day.today { color: var(--primary); font-weight: 700; }
.calendar-day.today > span:first-child { text-decoration: underline; text-underline-offset: 4px; }
.calendar-day[aria-pressed=true] { background: var(--selected); color: var(--text); opacity: 1; }
.calendar-dots { min-height: 5px; display: flex; gap: 3px; align-items: center; justify-content: center; }
.calendar-dots i { width: 4px; height: 4px; background: var(--muted); border-radius: 50%; }
.calendar-dots small { font-size: 11px; }
.calendar-agenda h3 { font-size: 16px; font-weight: 500; margin: 8px 12px 14px; }
.calendar-agenda > div { max-height: min(480px, 52dvh); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.agenda-item { align-items: flex-start; }
.agenda-item.is-complete { color: var(--muted); }
.agenda-item.is-complete strong { text-decoration: line-through; }
.calendar-layout.agenda-only { display: block; }

.materials-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.materials-actions { display: flex; align-items: center; gap: 4px; }
.materials-actions > button { display: inline-flex; align-items: center; gap: 6px; }
.material-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 8px 0 16px; }
.material-breadcrumb:empty { display: none; }
.material-breadcrumb button { padding-inline: 8px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 400; }
.material-breadcrumb > .material-symbols-rounded { font-size: 16px; color: var(--muted); }
.materials-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.materials-layout.has-preview { grid-template-columns: minmax(180px, .65fr) minmax(0, 1.5fr); }
.material-list { min-width: 0; max-height: calc(100dvh - 355px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.material-row { min-height: 56px; line-height: 1.55; overflow-wrap: anywhere; }
.material-row > :last-child.material-symbols-rounded { margin-left: auto; font-size: 18px; }
.material-note { display: flex; align-items: center; gap: 4px; }
.material-note > .material-row { flex: 1; min-width: 0; }
.material-note > .icon { opacity: .65; }
.material-note:hover > .icon, .material-note:focus-within > .icon { opacity: 1; }
.material-preview { min-width: 0; overflow: hidden; border-radius: 16px; background: var(--surface); }
.preview-heading { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 20px; }
.preview-heading strong { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-heading .icon { flex: 0 0 40px; width: 40px; height: 44px; min-width: 40px; }
.preview-body { height: max(360px, calc(100dvh - 425px)); min-height: 0; overflow: auto; }
.preview-body iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--surface-raised); }
.preview-body > img { width: 100%; height: 100%; object-fit: contain; display: block; }
.preview-body pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 15px/1.7 ui-monospace, monospace; padding: 24px; margin: 0; }
.note-search-results { max-height: 260px; overflow-y: auto; margin-top: 12px; }
.note-search-results button[aria-pressed=true] { background: var(--selected); }

/* Filters and selection stay in view; only the results scroll. */
.learning-view { height: calc(100dvh - 88px); display: flex; flex-direction: column; min-height: 460px; padding-bottom: 24px; }
body:has(#global-lirio-toggle:popover-open) :is(.learning-view, .home-view) { padding-bottom: 88px; }
body:has(#global-lirio-toggle:popover-open) #blearning-destination { max-height: calc(100dvh - 128px); }
.learning-view .workspace-heading { flex-shrink: 0; padding-bottom: 16px; min-height: 100px; }
.learning-workspace { display: flex; flex-direction: column; min-height: 0; flex: 1; margin: 0 var(--page-gutter); }
.learning-topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-shrink: 0; margin-bottom: 16px; }
#blearning-browse { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#blearning .learning-filters { display: grid; grid-template-columns: minmax(120px,.7fr) minmax(180px,1.5fr) minmax(140px,1fr) minmax(140px,1fr); align-items: end; gap: var(--field-gap); margin: 0 0 var(--form-section-gap); }
#blearning .learning-filters label { font-size: 14px; }
#blearning .learning-filters .dropdown-trigger { min-height: 48px; height: 48px; }
#blearning-results { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#blearning .learning-results-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; margin: 0 0 8px; }
#blearning .learning-results-heading label { font-size: 15px; font-weight: 400; }
.learning-result-status { min-height: 24px; color: var(--muted); font-size: 14px; line-height: 24px; text-align: right; }
#blearning #blearning-pending { list-style: none; padding: 0; margin: 0; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-gutter: stable; }
#blearning #blearning-pending > li { display: flex; align-items: center; gap: 16px; padding: 12px 0; border: 0; border-radius: 12px; margin: 0; background: transparent; }
#blearning #blearning-pending > li:hover { background: var(--surface); }
#blearning .learning-result { flex: 1; min-width: 0; align-items: center; gap: 16px; }
#blearning .learning-result > span { min-width: 0; }
#blearning .learning-result strong { font-size: 16px; font-weight: 500; line-height: 1.5; }
#blearning .learning-result-detail { margin-top: 6px; font-size: 14px; line-height: 1.5; }
.learning-item-status { color: var(--muted); font-size: 14px; white-space: nowrap; }
.learning-selection-bar { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding: 12px 16px; margin-top: 12px; border-radius: 16px; background: var(--surface-raised); }
.learning-selection-bar > span { flex: 1; font-size: 15px; }
.learning-selection-bar > button { flex-shrink: 0; }
.learning-destination-context { margin-bottom: var(--form-section-gap); }
.learning-destination-context ul { display: grid; gap: var(--field-gap); padding: 0; margin: 0; list-style: none; }
.learning-destination-context strong { display: block; font-size: 16px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.learning-destination-context span, .learning-destination-context p { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.5; }
#blearning-account { max-width: 520px; min-height: 0; overflow-y: auto; padding: 16px 4px; }
#blearning-form > input { width: 100%; margin-bottom: 20px; }
#blearning-form .field-hint { margin: 0 0 24px; }
.connection-account { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 8px 14px; margin-bottom: 24px; }
.connection-account > .material-symbols-rounded { grid-row: span 2; color: var(--muted); }
.connection-account > span:last-child { color: var(--muted); font-size: 14px; }
#blearning-connected .field-hint { margin-top: 24px; }
#blearning-feedback { flex-shrink: 0; padding: 12px 0; color: var(--muted); font-size: 15px; }
#blearning-feedback:empty { display: none; }
#blearning-warnings { max-height: 64px; overflow: auto; margin-bottom: 12px; }

:root[data-motion=full] :is(.project-panel, .home-block, #blearning-account, #blearning-browse, .material-preview):not([hidden]) { animation: workspace-reveal 280ms ease-out both; }
@keyframes workspace-reveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes workspace-shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
@container (max-width: 780px) {
  .calendar-layout { grid-template-columns: 1fr; gap: 20px; }
  .calendar-grid { height: 310px; min-height: 280px; }
  .calendar-agenda > div { max-height: 320px; }
  .materials-layout.has-preview { grid-template-columns: 1fr; }
  .has-preview .material-list { max-height: 180px; }
  .calendar-filters { flex-wrap: wrap; }
}
@media (min-width: 1280px) {
  body:has(#lirio-chat-dock #note-chat:popover-open) main { width: calc(100% - 720px); margin-right: 464px; }
  body:has(#lirio-chat-dock #note-chat:popover-open) #home-blocks { grid-template-columns: 1fr; }
  body:has(#lirio-chat-dock #note-chat:popover-open) #blearning .learning-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  #blearning .learning-filters { grid-template-columns: repeat(2, minmax(0,1fr)); }
  #home-blocks { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  #home-settings { padding: 20px; }
  .home-block-option label { gap: 10px; }
  .workspace-heading { padding-inline: 20px; }
  .home-view { padding: 12px 20px 28px; }
  .home-header h1 { font-size: 24px; }
  .project-panel { margin-inline: 20px; }
  #board-view .view-toolbar { flex-wrap: wrap; }
  .workspace-tabs { gap: 20px; }
  .workspace-tabs > button { font-size: 15px; }
  .calendar-period { gap: 0; width: 100%; }
  .calendar-period h2 { min-width: 0; flex: 1; }
  .calendar-filters > div { min-width: 120px; }
  .materials-toolbar { flex-wrap: wrap; }
  .materials-actions { margin-left: auto; }
  .learning-view { height: auto; min-height: calc(100dvh - 80px); }
  .learning-workspace { margin-inline: 20px; }
  .learning-topbar { gap: 8px; }
  .learning-topbar .connection-status { display: none; }
  #blearning #blearning-pending { max-height: 50dvh; flex: auto; }
  #blearning .learning-results-heading { grid-template-columns: 1fr; gap: 0; }
  .learning-result-status { text-align: left; }
  #blearning #blearning-pending > li { flex-wrap: wrap; gap: 6px 12px; }
  #blearning .learning-result { flex-basis: calc(100% - 60px); }
  #blearning .learning-item-status { order: 2; flex-basis: 100%; padding-left: 42px; }
  #blearning .learning-result { gap: 10px; }
  .learning-selection-bar { padding: 12px; gap: 8px; flex-wrap: wrap; }
  .learning-selection-bar > .primary { flex: 1 0 100%; }
}
@media (prefers-reduced-motion: reduce) {
  :is(.project-panel, .home-block, #blearning-account, #blearning-browse, .material-preview, #blearning-feedback) { animation: none !important; }
}

.learning-home-toggle { margin-top: 28px; }

.sidebar-brand { display: contents; }
.sidebar-mobile-toggle { display: none; }
@media (max-width: 700px) {
  .sidebar { padding: 8px 16px; }
  .sidebar-brand { display: flex; align-items: center; justify-content: space-between; min-height: 56px; flex-shrink: 0; }
  .sidebar .brand { margin: 0; padding: 0 4px; }
  .sidebar-mobile-toggle { display: inline-flex; }
  .sidebar:not(.mobile-nav-open) > :not(.sidebar-brand) { display: none; }
  .sidebar.mobile-nav-open { position: fixed; inset: 0; z-index: 30; width: 100%; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
  .sidebar.mobile-nav-open nav { display: block; overflow: visible; padding: 0; }
  .sidebar.mobile-nav-open nav button { width: 100%; white-space: normal; margin: 4px 0; }
  .sidebar.mobile-nav-open .nav-heading { display: flex; margin-top: 12px; }
  .sidebar.mobile-nav-open .sidebar-bottom { flex-direction: column; padding-top: 12px; }
  .sidebar.mobile-nav-open .sidebar-bottom button { width: 100%; }
  body:has(.sidebar.mobile-nav-open) { overflow: hidden; }
  :root[data-motion=full] .sidebar.mobile-nav-open nav { animation: workspace-reveal 240ms ease-out both; }
}
