* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; }
button, input, textarea, select, a { -webkit-tap-highlight-color: transparent; }
button {
  min-height: 48px;
  min-width: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: 28px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 140ms ease, border-radius 160ms ease;
}
button:hover { background: var(--surface-hover); }
button:active { transform: scale(.97); }
button:disabled { opacity: .5; cursor: default; transform: none; }
:where(button,a,input,textarea,select,[tabindex]):focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
button.primary { background: var(--primary); border-color: transparent; color: var(--on-primary); }
button.primary:hover { background: #e0ebf3; }
button.primary span { margin-right: 8px; font-size: 1.1rem; }
.icon { display: inline-flex; flex: 0 0 48px; align-items: center; justify-content: center; width: 48px; height: 48px; border: 0; padding: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.4rem; }
.icon:hover { color: var(--text); }
.danger { color: var(--danger); background: transparent; border-color: transparent; }
input, textarea, select { min-height: 52px; min-width: 0; border: 0; border-radius: 14px; background: var(--surface-raised); color: var(--text); padding: 13px 15px; }
input:not([type=checkbox]):not([type=radio]):hover, textarea:hover, select:hover { background-color: var(--surface-hover); }
input::placeholder, textarea::placeholder { color: #a2adb6; opacity: 1; }
textarea { resize: vertical; line-height: 1.6; }
label { display: block; font-size: .875rem; color: var(--muted); margin-bottom: var(--field-label-gap); }
h1, h2, p { margin: 0; }
h1 { font-size: 2rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
h2 { font-size: 1.2rem; font-weight: 600; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 20; border-radius: 16px; padding: 16px 24px; background: var(--primary); color: var(--on-primary); }
.skip-link:focus { top: 16px; }
#app { display: flex; min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 256px; padding: 28px 16px 20px; background: var(--surface); display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; align-items: center; min-height: 48px; color: var(--text); text-decoration: none; padding: 0 16px; margin-bottom: 40px; font-size: 1.8rem; font-weight: 600; border-radius: 16px; }
.brand > span { color: var(--muted); font-weight: 400; }
.brand strong { font-size: .95rem; margin-left: 14px; font-weight: 600; }
.nav-heading { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding-left: 18px; color: var(--muted); font-size: .875rem; }
.sidebar nav button { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border-color: transparent; background: transparent; padding: 13px 18px; margin: 4px 0; overflow-wrap: anywhere; font-weight: 500; }
.sidebar nav button.active { color: #e0eaf2; background: var(--selected); font-weight: 600; }
.sidebar nav button:hover { background: var(--surface-hover); }
.nav-symbol { color: var(--muted); font-size: 1.1rem; }
.nav-count { margin-left: auto; font-size: .875rem; color: var(--muted); }
.group-heading { margin-top: 24px; }
.sidebar-bottom { margin-top: auto; padding-top: 28px; }
.sidebar-bottom button { display: flex; width: 100%; justify-content: space-between; border-color: transparent; background: transparent; color: var(--muted); text-align: left; }
main { margin-left: 256px; min-width: 0; width: calc(100% - 256px); }
main:focus { outline: none; }
header { height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 40px; color: var(--muted); font-size: .875rem; }
.breadcrumb span { margin: 0 12px; color: var(--muted); }
#main-content > header { padding-inline: var(--page-gutter); flex-wrap: nowrap; gap: 8px; }
#main-content > header .breadcrumb { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-sync { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.workspace-sync #sync-status:not(.visually-hidden) { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-button[aria-busy=true] { opacity: 1; }
.sync-button[data-state=error] { color: var(--danger); }
.sync-button[aria-busy=true] > .material-symbols-rounded { width: 20px; height: 20px; font-size: 0; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; }
:root[data-motion=full] .sync-button[aria-busy=true] > .material-symbols-rounded { animation: control-spin 850ms linear infinite; }
:root[data-motion=full] .sync-button[aria-busy=false] > .material-symbols-rounded { animation: control-reveal 220ms ease-out; }
@keyframes control-spin { to { transform: rotate(360deg); } }
@keyframes control-reveal { from { opacity: .2; } to { opacity: 1; } }
@keyframes loading-shine { from { background-position: 150% 50%; } to { background-position: -150% 50%; } }
@media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  :root[data-motion=full] .loading-caption { background: linear-gradient(105deg, var(--muted) 35%, var(--text) 48%, var(--muted) 61%); background-size: 250% 100%; background-clip: text; color: transparent; animation: loading-shine 1800ms ease-in-out infinite; }
}
.board-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 22px 40px 28px; gap: 24px; }
.board-title-row { display: flex; align-items: center; gap: 12px; }
.board-toolbar p { margin-top: 8px; font-size: .875rem; color: var(--muted); }
.board-toolbar > .primary { flex-shrink: 0; min-height: 56px; }
.view-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 40px 24px; min-height: 56px; }
.view-name { display: flex; align-items: center; align-self: stretch; font-size: .875rem; font-weight: 600; border-bottom: 3px solid var(--primary); border-radius: 2px; padding: 0 6px; }
.search { display: flex; align-items: center; gap: 12px; height: 56px; min-width: 0; margin: 0; border-radius: 28px; background: var(--surface-raised); padding: 0 16px; }
.search:focus-within { background: var(--surface-hover); }
.search .material-symbols-rounded { color: var(--muted); }
.search input { appearance: none; flex: 1; min-height: 0; min-width: 0; height: 100%; width: 220px; margin: 0; padding: 0; border: 0; background: transparent; border-radius: 0; font-size: .875rem; line-height: 24px; }
.search input:focus-visible { outline: none; }
.kanban { display: flex; gap: 18px; padding: 4px 40px 40px; overflow-x: auto; min-height: calc(100dvh - 302px); align-items: stretch; scrollbar-color: #606b73 transparent; }
.column { flex: 1 0 290px; max-width: 400px; min-height: 390px; border-radius: 24px; background: var(--surface); padding: 10px; }
.column-head { display: flex; align-items: center; gap: 10px; padding: 0 2px 8px 12px; }
.column-head h2 { font-size: .875rem; line-height: 1.5; overflow-wrap: anywhere; }
.column-count { color: var(--muted); font-size: .875rem; }
.column-head .icon { margin-left: auto; }
.drop-zone { min-height: calc(100% - 58px); padding: 4px; border-radius: 18px; }
.drop-zone.dragover { background: #303b45; outline: 2px dashed #9bafbf; outline-offset: -2px; }
.task-card { position: relative; border: 0; border-radius: 18px; background: var(--surface-raised); padding: 18px; margin-bottom: 12px; cursor: grab; transition: border-color 160ms ease, background-color 160ms ease; }
.task-card:hover { background: #292f34; }
.task-card:active { cursor: grabbing; }
.task-card.drop-before::before, .task-card.drop-after::after { content: ''; position: absolute; height: 3px; background: var(--primary); left: 8px; right: 8px; border-radius: 3px; }
.task-card.drop-before::before { top: -8px; }
.task-card.drop-after::after { bottom: -8px; }
.card-group { font-size: .875rem; color: #bdccd7; margin-bottom: 10px; }
.task-card h3 { font-size: .95rem; line-height: 1.5; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.card-description { margin-top: 8px; color: var(--muted); font-size: .875rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card-bottom { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; color: var(--muted); font-size: .875rem; }
.overdue { color: var(--danger); }
progress { display: block; appearance: none; border: 0; width: 100%; height: 5px; border-radius: 8px; overflow: hidden; background: #46505a; color: var(--primary); }
progress::-webkit-progress-bar { background: #46505a; border-radius: 8px; }
progress::-webkit-progress-value { background: var(--primary); border-radius: 8px; }
progress::-moz-progress-bar { background: var(--primary); border-radius: 8px; }
.card-progress { margin-top: 12px; height: 4px; }
.column-empty { border: 0; background: color-mix(in srgb, var(--surface-raised) 45%, transparent); border-radius: 18px; display: flex; align-items: center; justify-content: center; min-height: 120px; }
.column-empty button { background: transparent; border-color: transparent; color: var(--muted); }
.add-column { white-space: nowrap; padding-inline: 12px; flex: 0 0 160px; align-self: flex-start; border-color: transparent; background: transparent; color: var(--muted); text-align: left; }
.no-results { padding: 24px 8px; color: var(--muted); font-size: .875rem; }
dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 28px; border: 0; border-radius: 28px; background: var(--surface); color: var(--text); box-shadow: 0 24px 80px #0008; }
dialog::backdrop { background: #050708b3; backdrop-filter: none; }
dialog.sheet { margin: 12px 12px 12px auto; width: min(590px, calc(100% - 24px)); max-width: 100%; height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); border-radius: 28px; padding: 28px; }
#editor { overflow: hidden; }
#editor:has(> #global-lirio-toggle:popover-open) { padding-bottom: 88px; }
#task-form { height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; margin: -4px; padding: 4px; }
.dialog-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: var(--form-section-gap); color: var(--muted); font-size: .875rem; }
.task-title-input { font-size: 1.5rem; font-weight: 600; width: 100%; margin-bottom: var(--form-section-gap); padding: 14px; background: var(--surface-raised); }
.task-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--field-gap); margin-bottom: var(--form-section-gap); }
.task-fields label { min-width: 0; }
.task-fields select, .task-fields input { display: block; width: 100%; margin-top: 0; font-size: .875rem; }
.sheet textarea { width: 100%; font-size: .95rem; }
dialog :is(input:not([type=checkbox]), textarea, select) { border-color: transparent; background: var(--surface-raised); }
dialog :is(input:not([type=checkbox]), textarea, select):hover { border-color: transparent; }
dialog :is(input:not([type=checkbox]), textarea, select):focus-visible { outline-width: 2px; outline-offset: 2px; }
dialog .check-row input[type=text] { background: transparent; }
.check-heading { display: flex; align-items: center; justify-content: space-between; margin-top: 28px; color: var(--muted); font-size: .875rem; }
.check-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.check-target { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin: 0; flex: 0 0 48px; cursor: pointer; border-radius: 50%; }
.check-target:hover { background: var(--surface-hover); }
.check-row input[type=checkbox] { accent-color: var(--primary); width: 22px; height: 22px; min-height: 22px; margin: 0; cursor: pointer; }
.check-row input[type=text] { flex: 1; width: 100%; padding: 10px 8px; background: transparent; border-color: transparent; font-size: .9rem; }
.check-row input[type=text]:hover { background: var(--surface-hover); }
.check-row.done input[type=text] { text-decoration: line-through; color: var(--muted); }
.add-check { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.add-check input { flex: 1; width: 100%; background: var(--surface-raised); font-size: .875rem; }
.add-check > .icon { flex-basis: 52px; width: 52px; height: 52px; border-radius: 16px; background: var(--selected); color: var(--primary); }
.add-check > .icon:hover { background: var(--primary); color: var(--on-primary); }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.dialog-actions .danger { margin-right: auto; }
#task-save-status { margin-top: 24px; color: var(--muted); font-size: .875rem; line-height: 1.6; min-height: 1.6em; }
#task-save-status:empty { margin-top: 0; min-height: 0; }
#task-save-status.save-error { color: var(--danger); }
#settings-content > label input { display: block; width: 100%; margin-top: 8px; }
#settings-content h3 { font-size: .9rem; margin: 24px 0 12px; }
.setting-row { display: flex; gap: 6px; align-items: center; margin: 12px 0; }
.setting-row input { width: 100%; font-size: .875rem; }
.setting-row .order { font-size: 1rem; }
.subtle { background: transparent; border-color: transparent; color: var(--primary); }
#confirm-text { font-size: .95rem; line-height: 1.7; margin-top: 16px; color: var(--muted); overflow-wrap: anywhere; }
#toast { position: fixed; inset: auto; margin: 0; border: 0; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 10; max-width: min(560px, 90vw); padding: 16px 24px; background: #dfe5e9; color: #20272c; border-radius: 16px; box-shadow: 0 8px 32px #0005; font-size: .875rem; line-height: 1.5; }
#auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
#auth form { width: min(400px, 100%); padding: 32px; background: var(--surface); border-radius: 28px; }
.brand-mark { font-size: 2.4rem; font-weight: 600; margin-bottom: 28px; }
.eyebrow { font-size: .875rem; color: var(--muted); margin-bottom: 8px; }
#auth h1 { font-size: 1.75rem; margin-bottom: 28px; }
#auth input, #auth button { width: 100%; }
#auth button { margin-top: 24px; }
#auth-hint { font-size: .875rem; line-height: 1.6; color: var(--muted); margin-top: 12px; }
#auth-error { font-size: .875rem; line-height: 1.6; color: var(--danger); margin-top: 16px; }
@media (max-width: 1100px) {
  .sidebar { width: 224px; }
  main { margin-left: 224px; width: calc(100% - 224px); }
  header { padding: 0 24px; }
  .board-toolbar { padding: 20px 24px 24px; }
  .view-toolbar { margin: 0 24px 20px; }
  .kanban { padding: 4px 24px 32px; }
}
@media (max-width: 700px) {
  #app { display: block; }
  .sidebar { position: static; width: 100%; padding: 16px; overflow: visible; }
  .brand { margin-bottom: 12px; padding: 0 8px; }
  .nav-heading { display: none; }
  .sidebar nav { display: flex; overflow-x: auto; gap: 8px; padding: 4px; }
  .sidebar nav button { flex-shrink: 0; width: auto; white-space: nowrap; margin: 0; min-height: 48px; }
  #groups { margin-top: 8px; }
  #groups button { font-size: .875rem; }
  .sidebar-bottom { display: flex; justify-content: flex-end; padding-top: 8px; }
  .sidebar-bottom button { width: auto; }
  .sidebar-bottom button[data-action=groups] { display: none; }
  main { margin: 0; width: 100%; }
  header { height: 64px; padding: 0 20px; }
  .board-toolbar { padding: 16px 20px 24px; gap: 12px; flex-wrap: wrap; }
  h1 { font-size: 1.6rem; }
  .board-toolbar > .primary { min-height: 48px; }
  .view-toolbar { margin: 0 20px 20px; }
  .view-name { flex-shrink: 0; }
  .search { min-width: 0; }
  .search input { width: 100%; }
  .kanban { padding: 4px 16px 28px; gap: 14px; scroll-snap-type: x proximity; }
  .column { flex: 0 0 86vw; max-width: 380px; scroll-snap-align: center; }
  dialog.sheet { margin: 0; width: 100%; height: 100dvh; max-height: 100dvh; padding: 20px; border-radius: 0; }
  .setting-row { flex-wrap: wrap; justify-content: flex-end; }
  .setting-row input { flex: 1 0 100%; }
  #toast { bottom: 16px; }
}
@media (max-width: 560px) {
  .task-fields { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  button:active { transform: none; }
}

#sync-status { font-size: .875rem; text-align: right; }
.breadcrumb #view-label { margin: 0; }
.notes-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 18px; padding: 0 40px 40px; }
.note-card { display: flex; flex-direction: column; gap: 12px; min-height: 180px; text-align: left; border-radius: 22px; padding: 22px; border: 0; }
.note-card strong { font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.note-card > span { font-weight: 400; color: var(--muted); font-size: .9rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.notes-empty { color: var(--muted); padding: 24px 0; }
#note-save-status { margin-top: 20px; font-size: .875rem; color: var(--muted); min-height: 1.6em; line-height: 1.6; }
#note-save-status.save-error { color: var(--danger); }
@media (max-width: 700px) {
  :root { --page-gutter: 20px; }
  .notes-list { padding: 0 20px 28px; }
  header { flex-wrap: wrap; gap: 4px 12px; height: auto; min-height: 72px; padding-block: 8px; }
  .breadcrumb { flex: 1 0 100%; }
}

dialog[open]::backdrop { animation: backdrop-enter 300ms var(--motion-spring); }
dialog.is-closing::backdrop { animation: backdrop-exit 180ms var(--motion-exit) forwards; }
@keyframes backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdrop-exit { from { opacity: 1; } to { opacity: 0; } }

.view-name { gap: 10px; }



@font-face {
  font-family: 'Material Symbols Rounded 75119be9d51fd3fe';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('/fonts/material-symbols-rounded.woff2?v=75119be9d51fd3fe') format('woff2');
}
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded 75119be9d51fd3fe';
  font-weight: 400;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}
button.primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button.primary .material-symbols-rounded { margin: 0; font-size: 22px; }
.search .material-symbols-rounded { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 24px; width: 24px; height: 24px; font-size: 24px; line-height: 24px; }
.card-bottom > span { display: inline-flex; align-items: center; gap: 5px; }
.card-bottom .material-symbols-rounded { font-size: 16px; width: 16px; height: 16px; flex-basis: 16px; }
.column-empty button, .add-column, .subtle { display: inline-flex; align-items: center; gap: 8px; }
:root {
  --motion-spring: linear(0, .044 4%, .158 9%, .32 15%, .5 22%, .68 30%, .82 39%, .92 49%, .982 61%, 1.008 73%, 1.006 85%, 1);
  --motion-exit: cubic-bezier(.3, 0, .8, .15);
  view-transition-name: none;
}
button {
  transition: background-color 160ms, border-color 160ms, transform 360ms var(--motion-spring);
}
button:active { transform: scale(.975); }
button.icon:active { transform: scale(.92); border-radius: 50%; }
.workspace-view { view-transition-name: workspace; }
::view-transition { pointer-events: none; }
::view-transition-group(workspace) { animation: none; }
::view-transition-old(workspace), ::view-transition-new(workspace) { mix-blend-mode: normal; }
::view-transition-old(workspace) { animation: workspace-exit 160ms var(--motion-exit) both; }
::view-transition-new(workspace) { animation: workspace-enter 440ms var(--motion-spring) both; }
@keyframes workspace-exit {
  to { opacity: 0; transform: translateY(-6px) scale(.996); }
}
@keyframes workspace-enter {
  from { opacity: 0; transform: translateY(12px) scale(.996); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  button:active, button.icon:active { transform: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

.task-field, .custom-select { min-width: 0; }
.dropdown-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 52px; padding: 13px 15px; border: 0; border-radius: 14px;
  background: var(--surface-raised); text-align: left; font-size: .875rem; font-weight: 400;
}
.dropdown-trigger:hover, .dropdown-trigger[aria-expanded=true] { background: var(--surface-hover); }
.dropdown-trigger .dropdown-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-trigger > .material-symbols-rounded { color: var(--muted); transition: transform 320ms var(--motion-spring); }
.dropdown-trigger[aria-expanded=true] > .material-symbols-rounded { transform: rotate(180deg); }
.dropdown-menu {
  position: fixed; inset: auto; z-index: 30; margin: 0; padding: 6px; border: 0;
  border-radius: 18px; background: #30363b; color: var(--text);
  box-shadow: 0 12px 32px #0005, 0 3px 10px #0003;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  transform-origin: top center;
}
.dropdown-menu[data-side=above] { transform-origin: bottom center; }
.dropdown-menu::backdrop { background: transparent; }
.dropdown-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; padding: 12px; border-radius: 12px; cursor: pointer;
  font-size: .875rem; line-height: 1.5; overflow-wrap: anywhere;
}
.dropdown-option > span:first-child { min-width: 0; }
.dropdown-option > .material-symbols-rounded { visibility: hidden; color: var(--primary); }
.dropdown-option[aria-selected=true] { color: var(--primary); }
.dropdown-option[aria-selected=true] > .material-symbols-rounded { visibility: visible; }
.dropdown-option.is-active { background: #44515b; }
.dropdown-option[aria-disabled=true] { opacity: .45; cursor: default; }
.dropdown-searchable > input { position: sticky; top: 0; z-index: 1; width: 100%; min-height: 44px; padding: 10px 12px; margin-bottom: 6px; border-radius: 12px; background: var(--surface-raised); font-size: 14px; }
.dropdown-empty { padding: 16px 12px; margin: 0; color: var(--muted); font-size: 14px; }

.home-view { max-width: 1040px; margin: 0 auto; padding: clamp(48px, 12vh, 140px) 40px 64px; }
.home-intro { margin-bottom: 40px; }
.home-intro .eyebrow { color: var(--muted); text-transform: capitalize; margin-bottom: 20px; }
.home-intro h1 { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 500; letter-spacing: -.045em; line-height: 1.15; }
.home-intro > p:last-child { margin-top: 18px; color: var(--muted); font-size: 1.1rem; line-height: 1.6; }
.home-menu { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.home-card { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 12px; min-height: 190px; padding: 26px; border: 0; border-radius: 26px; background: var(--surface); }
.home-card > .material-symbols-rounded { color: var(--primary); margin-bottom: 12px; }
.home-card strong { font-size: 1.05rem; font-weight: 600; }
.home-card > span:last-child { color: var(--muted); font-weight: 400; line-height: 1.6; }
.home-card:hover { background: var(--surface-raised); transform: translateY(-3px); }
.home-card:active { transform: scale(.975); }
.connection-card { margin: 0 40px 40px; max-width: 640px; border-radius: 26px; background: var(--surface); padding: 28px; }
.connection-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
.connection-status { padding: 8px 12px; border-radius: 20px; background: var(--surface-raised); color: var(--muted); font-size: .875rem; }
.connection-card p { margin: 20px 0; color: var(--muted); line-height: 1.7; }
.connection-card a { display: inline-flex; gap: 12px; align-items: center; min-height: 48px; padding: 12px 20px; border-radius: 26px; background: var(--selected); color: var(--primary); text-decoration: none; font-weight: 600; font-size: .875rem; }
@media (max-width: 900px) {
  .home-view { padding: 48px 20px; }
  .home-menu { grid-template-columns: 1fr; }
  .home-card { min-height: 0; padding: 24px; gap: 8px; }
  .home-card > .material-symbols-rounded { margin-bottom: 4px; }
  .connection-card { margin: 0 20px 28px; padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-card:hover, .home-card:active { transform: none; }
}

#toast { display: flex; align-items: center; gap: 12px; padding: 6px 8px 6px 22px; border-radius: 24px; }
#toast-message { overflow-wrap: anywhere; }
#toast-close { color: inherit; }
#toast-close:hover { background: #20272c12; }
#toast-close:focus-visible { outline-color: #20313d; }
#toast[data-position="top-right"] { top: 24px; right: 24px; bottom: auto; left: auto; transform: none; display: grid; grid-template-columns: minmax(0, 1fr) 40px; column-gap: 12px; row-gap: 4px; width: min(400px, calc(100vw - 32px)); box-sizing: border-box; padding: 14px 12px 12px 20px; border-radius: 18px; background: var(--surface-raised); color: var(--text); font-size: 16px; }
#toast[data-position="top-right"] #toast-message { grid-column: 1; }
#toast[data-position="top-right"] #toast-close { grid-column: 2; grid-row: 1 / 3; align-self: start; }
.notification-open { display: block; width: fit-content; min-height: 40px; padding: 8px 0; border: 0; background: transparent; color: var(--primary); font-size: 14px; text-align: left; }
.notification-open:hover { background: transparent; text-decoration: underline; text-underline-offset: 3px; }
#toast[data-position="top-right"] .notification-open { grid-column: 1; }
@media (max-width: 600px) { #toast[data-position="top-right"] { top: 16px; right: 16px; } }

#task-menu { position: fixed; inset: auto; margin: 0; border: 0; z-index: 20; width: 200px; max-width: calc(100vw - 16px); padding: 6px; border-radius: 18px; background: #30363b; box-shadow: 0 12px 32px #0005; transform-origin: top left; }
#task-menu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 12px; border: 0; border-radius: 12px; background: transparent; text-align: left; }
#task-menu button:hover, #task-menu button:focus-visible { background: #44515b; }

header .breadcrumb { margin-right: auto; }
#notifications-toggle { position: relative; flex-shrink: 0; }
#notifications-badge { position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 10px; background: var(--primary); color: var(--on-primary); font-size: .875rem; line-height: 18px; font-weight: 600; }
#notifications-panel { position: fixed; inset: auto; margin: 0; border: 0; top: 76px; right: 24px; z-index: 15; width: min(400px, calc(100vw - 32px)); max-height: calc(100dvh - 100px); overflow-y: auto; overscroll-behavior: contain; padding: 16px; border-radius: 26px; background: var(--surface-raised); box-shadow: 0 16px 48px #0006; transform-origin: top right; }
.notifications-heading, .notifications-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notifications-heading { padding-left: 8px; }
.notifications-actions { color: var(--muted); font-size: .875rem; padding-left: 8px; }
.notifications-actions button { border: 0; background: transparent; padding: 10px; font-size: .875rem; }
#notifications-list { list-style: none; padding: 0; margin: 8px 0 0; }
#notifications-list li { padding: 16px; border-radius: 16px; margin-top: 6px; }
#notifications-list li.unread { background: var(--selected); }
#notifications-list p { font-size: .875rem; line-height: 1.6; overflow-wrap: anywhere; }
#notifications-list time, .notification-unread { display: inline-block; margin-top: 8px; color: var(--muted); font-size: .875rem; }
.notification-unread { margin-left: 12px; }
#notifications-empty { padding: 32px 16px; color: var(--muted); text-align: center; line-height: 1.7; font-size: .875rem; }
@media (max-width: 600px) { #notifications-panel { top: 84px; right: 16px; max-height: calc(100dvh - 108px); } }
#blearning-form input { display: block; width: 100%; margin-bottom: 18px; }
#blearning .connection-privacy { font-size: .875rem; line-height: 1.6; }
#blearning-controls { display: flex; gap: 8px; flex-wrap: wrap; }
#blearning-controls p { width: 100%; font-size: .875rem; margin: 8px 0; }
#blearning-feedback:empty { display: none; }
#blearning-pending, #blearning-courses { padding: 0; list-style: none; }
#blearning-pending li { padding: 18px; background: var(--surface-raised); border-radius: 18px; margin-bottom: 10px; overflow-wrap: anywhere; }
#blearning-pending p { margin: 8px 0 0; font-size: .875rem; }
#blearning-courses li { padding: 10px 0; }
#blearning summary { cursor: pointer; padding: 16px 0; }

.connections-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; padding: 0 40px 40px; }
.connection-plugin { display: flex; flex-direction: column; align-items: flex-start; padding: 26px; border-radius: 26px; background: var(--surface); }
.connection-plugin-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; margin-bottom: 24px; }
.connection-plugin-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; flex-basis: 48px; border-radius: 16px; background: var(--selected); color: var(--primary); }
.connection-plugin p { margin: 12px 0 24px; color: var(--muted); font-size: .875rem; line-height: 1.7; }
.connection-plugin button { margin-top: auto; }
.connection-back { padding: 16px 40px 0; }
.connection-back button { border: 0; background: transparent; color: var(--muted); }
.connection-back button:hover { background: var(--surface-raised); color: var(--text); }
@media (max-width: 600px) {
  .connections-catalog { padding: 0 20px 28px; }
  .connection-back { padding: 8px 20px 0; }
}

#note-editor { width: min(1100px, calc(100vw - 32px)); height: calc(100dvh - 32px); max-height: calc(100dvh - 32px); margin: auto; padding: 0; overflow: hidden; }
#note-form { position: relative; height: 100%; display: flex; flex-direction: column; }
.document-top { margin: 0; padding: 12px 20px; flex-shrink: 0; }
.document-tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; min-width: 0; gap: 8px; }
.document-tools > button:not(.icon), .document-formatting button { border: 0; background: transparent; padding: 10px 14px; }
.document-tools > button:hover, .document-formatting button:hover { background: var(--surface-hover); }
.document-formatting { display: flex; gap: 4px; padding: 4px 20px 12px; overflow-x: auto; flex-shrink: 0; }
.document-formatting button { white-space: nowrap; }
.document-page { flex: 1; min-height: 0; overflow-y: auto; padding: 32px max(24px, calc((100% - 760px)/2)); scrollbar-width: thin; }
#note-editor #note-title { display: block; resize: none; overflow: hidden; overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.25; min-height: 0; width: 100%; background: transparent; border: 0; padding: 8px 0; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 600; border-radius: 0; margin-bottom: 20px; }
#note-editor #note-content { display: block; width: 100%; min-height: 48vh; resize: vertical; border: 0; border-radius: 0; background: transparent; padding: 12px 0; line-height: 1.9; font-size: 1.05rem; }
.document-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; flex-shrink: 0; }
.document-footer .dialog-actions { margin: 0; }
.document-footer #note-save-status { margin: 0; }
#note-word-count { color: var(--muted); font-size: .875rem; }
.markdown-document { font-size: 1.05rem; line-height: 1.9; min-height: 48vh; overflow-wrap: anywhere; }
.markdown-document p, .markdown-document ul, .markdown-document ol, .markdown-document pre, .markdown-document blockquote, .markdown-document table { margin: 0 0 1.2em; }
.markdown-document h1, .markdown-document h2, .markdown-document h3 { margin: 1.3em 0 .6em; }
.markdown-document a { color: var(--primary); text-underline-offset: 4px; }
.markdown-document pre { padding: 20px; border-radius: 16px; background: var(--background); overflow-x: auto; }
.markdown-document code { font-size: .9em; background: var(--background); padding: 2px 5px; border-radius: 5px; }
.markdown-document blockquote { margin-left: 0; padding-left: 20px; border-left: 3px solid var(--muted); color: var(--muted); }
.markdown-document table { display: block; overflow-x: auto; border-collapse: collapse; }
.markdown-document td, .markdown-document th { border-bottom: 1px solid var(--outline); padding: 8px 14px; text-align: left; }
.markdown-document input[type=checkbox] { min-height: 0; }
.note-card small { color: var(--muted); font-weight: 400; line-height: 1.6; }
.note-card > .note-tags { display: flex; flex-wrap: wrap; gap: 6px; white-space: normal; }
.note-tags > span { padding: 4px 10px; border-radius: 14px; background: var(--selected); font-size: .875rem; }
#note-editor.is-zen { width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; border-radius: 0; }
.is-zen #note-formatting, .is-zen #delete-note, .is-zen #note-heading { display: none; }
.is-zen .document-top { justify-content: flex-end; }
@media (max-width: 650px) {
  #note-editor { width: 100vw; height: 100dvh; max-height: 100dvh; max-width: 100vw; border-radius: 0; }
  .document-top { padding: 8px; gap: 4px; flex-wrap: wrap; }
  .document-tools { gap: 0; }
  .document-tools > button:not(.icon) { padding: 10px; font-size: .875rem; }
  .document-page { padding: 20px; }
  .document-footer { padding: 10px; flex-wrap: wrap; }
  .document-formatting { padding-inline: 8px; }
}

.blearning-period-field { width: 100%; margin-bottom: 12px; }
#blearning-export-controls { margin: 24px 0; padding: 20px; border-radius: 20px; background: var(--surface-raised); }
#blearning-export-controls h3 { margin: 0 0 20px; }
#blearning-export-controls p { font-size: .875rem; margin-bottom: 0; }

/* Shared focus indicator; native focus remains available before initialization. */
.document-page { position: relative; }
.focus-indicator { position: fixed; inset: auto; margin: 0; padding: 0; max-width: none; max-height: none; background: transparent; overflow: visible; pointer-events: none; z-index: 25; box-sizing: border-box; border: 1px solid #79909d; border-radius: 16px; opacity: 0; }
.focus-indicator.viewport-focus { position: fixed; }
.focus-indicator.is-visible { opacity: .65; }
.focus-indicator.keyboard-focus { border-width: 2px; border-color: #a0b8c6; opacity: 1; }
.managed-focus:focus, .managed-focus:focus-visible { outline: none !important; }
.search:has(.managed-focus):focus-within { outline: none; }
#note-editor #note-title, #note-editor #note-content { border-radius: 14px; padding-left: 12px; padding-right: 12px; }
input, textarea, select, a, .note-card, .task-card { transition: background-color 180ms, border-color 220ms, color 180ms, box-shadow 220ms; }
.motion-option { display: flex; align-items: center; gap: 14px; min-height: 56px; cursor: pointer; font-size: .95rem; }
.motion-option input { width: 20px; height: 20px; min-height: 20px; accent-color: var(--primary); }
.motion-hint { color: var(--muted); font-size: .875rem; line-height: 1.7; margin-top: 16px; }
html[data-motion=reduced] *, html[data-motion=reduced] *::before, html[data-motion=reduced] *::after, html[data-motion=reduced] dialog::backdrop { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (forced-colors: active) {
  .focus-indicator { display: none; }
  .managed-focus:focus-visible { outline: 2px solid Highlight !important; }
}

.note-card, .note-card:hover { border-color: transparent; }
.focus-indicator.pointer-control { opacity: 0; }
.focus-indicator.pointer-control.keyboard-focus { opacity: 1; }
.resources-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 18px; padding: 0 40px 40px; }
.resource-card { padding: 22px; border-radius: 22px; background: var(--surface-raised); overflow-wrap: anywhere; }
.resource-card h2 { margin-bottom: 12px; }
.resource-card a { display: inline-flex; align-items: center; min-height: 48px; color: var(--primary); text-underline-offset: 4px; }
.resource-card p { color: var(--muted); line-height: 1.6; font-size: .875rem; margin-bottom: 12px; }
.resource-card button { border: 0; margin-top: 12px; }
#resource-form > input { width: 100%; margin-bottom: 18px; }
#resource-status { color: var(--muted); font-size: .875rem; line-height: 1.6; }
@media (max-width: 650px) {
  .resources-list { padding: 0 20px 28px; }
}
#blearning.connection-card { max-width: 1100px; }
.learning-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 24px 0; }
.learning-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.learning-results-heading { margin-top: 28px; }
.learning-results-heading label { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.learning-result { display: flex; align-items: flex-start; gap: 14px; margin: 0; color: var(--text); cursor: pointer; }
.learning-result input, .learning-results-heading input { min-height: 20px; width: 20px; height: 20px; accent-color: var(--primary); flex-shrink: 0; }
.learning-result-detail { display: block; margin-top: 8px; line-height: 1.6; color: var(--muted); font-size: .875rem; }
#blearning .learning-resource-link { display: inline-flex; margin: 10px 0 0 34px; padding: 10px 0; background: transparent; }
#blearning-new-board { width: 100%; }
#blearning-warnings:empty { display: none; }
@media (max-width: 800px) { .learning-filters { grid-template-columns: 1fr; } }
.is-opening .focus-indicator, .is-closing .focus-indicator { opacity: 0 !important; }
.caret-measure { position: fixed; left: -100000px; top: 0; visibility: hidden; pointer-events: none; border-style: solid; overflow: hidden; margin: 0; }
.smooth-caret { position: fixed; inset: auto; left: 0; top: 0; margin: 0; padding: 0; border: 0; max-width: none; max-height: none; width: 2px; border-radius: 2px; background: var(--text); pointer-events: none; z-index: 26; }
:is(input, textarea, [contenteditable="true"]).smooth-caret-target { caret-color: transparent; }
@media (forced-colors: active), (prefers-reduced-motion: reduce) {
  .smooth-caret { display: none; }
  :is(input, textarea, [contenteditable="true"]).smooth-caret-target { caret-color: auto; }
}

/* Visual Markdown uses the same document surface as source and reading modes. */
#note-editor #note-content[hidden] { display: none; }
#note-visual { min-height: 48vh; }
.visual-document { padding: 12px; border-radius: 14px; outline: none; white-space: pre-wrap; }
.visual-document:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.visual-document > :first-child { margin-top: 0; }
.visual-document p:only-child:empty::before { content: 'Empieza a escribir…'; color: var(--muted); pointer-events: none; float: left; height: 0; }
.visual-document ul[data-type=taskList] { list-style: none; padding-left: 0; }
.visual-document li[data-type=taskItem] { display: flex; align-items: baseline; gap: 12px; }
.visual-document li[data-type=taskItem] > label { margin: 0; padding: 8px 0; }
.visual-document li[data-type=taskItem] > label input { width: 18px; height: 18px; margin: 0; }
.visual-document li[data-type=taskItem] > div { flex: 1; min-width: 0; }
.visual-document li[data-checked=true] > div > p { color: var(--muted); text-decoration: line-through; }
.visual-document .ProseMirror-selectednode { outline: 1px solid var(--primary); border-radius: 8px; }
.visual-document .ProseMirror-separator { display: none; }
.visual-document .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; }
.visual-document.ProseMirror-focused .ProseMirror-gapcursor { display: block; }
.visual-document .ProseMirror-gapcursor:after { content: ''; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid currentColor; }
.document-formatting button[aria-pressed=true] { background: var(--selected); color: var(--text); }
@media (max-width: 650px) { .document-tools { flex-wrap: wrap; justify-content: flex-end; } }
.note-link-editor { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 20px 12px; padding: 12px; background: var(--surface-raised); border-radius: 16px; }
.note-link-editor label { margin: 0; font-size: .875rem; }
.note-link-editor input { flex: 1; min-width: 160px; }
.note-link-editor p { flex-basis: 100%; margin: 0; color: #ffb4ab; }
#task-menu { width: 230px; }

#note-editor.has-chat { width: min(1500px, calc(100vw - 32px)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); grid-template-rows: minmax(0, 1fr); }
#note-editor.is-zen.has-chat { width: 100vw; }
#note-form { min-width: 0; min-height: 0; }
#note-chat { min-height: 0; min-width: 0; display: flex; flex-direction: column; padding: 20px; gap: 12px; background: var(--background); overflow: hidden; }
.chat-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#chat-model, #chat-status { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
#chat-status { min-height: 20px; }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 4px; }
#chat-empty { color: var(--muted); line-height: 1.6; }
.chat-message { margin: 0 0 20px; overflow-wrap: anywhere; }
.chat-message strong { display: block; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.chat-message-content { white-space: pre-wrap; font-size: 15px; line-height: 1.7; }
.chat-message-user { background: var(--surface-raised); padding: 14px; border-radius: 18px; }
#chat-form { position: relative; display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
#chat-message { width: 100%; resize: none; max-height: 180px; background: var(--surface-raised); }
.chat-label { margin: 0; }
.chat-attachment { display: flex; align-items: center; gap: 10px; margin: 0; min-height: 44px; cursor: pointer; }
.chat-attachment input { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); }
.chat-actions { display: flex; justify-content: flex-end; gap: 8px; }
#chat-error { max-height: 144px; overflow-y: auto; flex-shrink: 0; }
.chat-warning { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: start; gap: 10px; color: var(--danger); font-size: 14px; line-height: 24px; margin: 8px 0; }
.chat-warning > .material-symbols-rounded { width: 24px; height: 24px; font-size: 24px; line-height: 24px; }
.chat-warning p { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-warning .chat-warning-detail { margin-top: 4px; color: inherit; }
.chat-message-failure { order: 2; }
#chat-resume { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
#chat-resume:disabled { cursor: progress; }
#chat-requests { max-height: 35%; overflow-y: auto; }
#chat-requests section { padding: 12px; border-radius: 16px; background: var(--surface-raised); display: flex; flex-wrap: wrap; gap: 8px; }
#chat-requests strong, #chat-requests p, #chat-requests textarea { width: 100%; }
@media (max-width: 1000px) {
  #note-editor.has-chat { display: block; }
  #note-chat { position: absolute; inset: 0 0 0 auto; width: min(100%, 440px); z-index: 2; box-shadow: -20px 0 60px #0004; }
}

.document-page > .focus-indicator:not(.is-visible) { display: none; }

.chat-message-content.markdown-document { min-height: 0; white-space: normal; }

.note-view-switch { position: relative; isolation: isolate; display: inline-grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 4px; border-radius: 28px; background: var(--background); flex-shrink: 0; }
.note-view-switch::before { content: ''; position: absolute; inset: 4px auto 4px 4px; width: calc((100% - 8px) / 2); border-radius: 24px; background: var(--selected); transform: translateX(100%); transition: transform 380ms var(--motion-spring); pointer-events: none; }
.note-view-switch[data-mode=code]::before { transform: translateX(0); }
.note-view-switch > button { z-index: 1; min-height: 44px; padding: 10px 16px; border: 0; background: transparent; color: var(--muted); font-size: 14px; white-space: nowrap; }
.note-view-switch > button[aria-pressed=true] { color: var(--text); }
.note-view-switch > button:hover { background: transparent; color: var(--text); }
.note-view-switch > button:active { transform: none; }
.motion-option input { appearance: none; display: grid; place-content: center; flex-shrink: 0; width: 24px; height: 24px; min-height: 24px; padding: 0; border: 1px solid var(--outline); border-radius: 7px; background: var(--surface-raised); transition: background-color 180ms, border-color 180ms; }
.motion-option input::after { content: ''; width: 6px; height: 11px; margin-top: -3px; border: solid var(--on-primary); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(.4); opacity: 0; transition: transform 220ms cubic-bezier(.16,1,.3,1), opacity 140ms; }
.motion-option input:checked { background: var(--primary); border-color: var(--primary); }
.motion-option input:checked::after { transform: rotate(45deg) scale(1); opacity: 1; }
/* Settings retain brief state feedback when interface motion is turned off. */
html[data-motion=reduced] .motion-option input { transition: background-color 160ms, border-color 160ms !important; }
html[data-motion=reduced] .motion-option input::after { transition: transform 160ms, opacity 120ms !important; }
@media (prefers-reduced-motion: reduce) {
  .note-view-switch::before, .motion-option input, .motion-option input::after,
  html[data-motion=reduced] .motion-option input, html[data-motion=reduced] .motion-option input::after { transition: none !important; }
}
@media (forced-colors: active) {
  .motion-option input:checked { background: Highlight; border-color: Highlight; }
  .motion-option input::after { border-color: HighlightText; }
  .note-view-switch::before { background: Highlight; }
  .note-view-switch > button[aria-pressed=true] { color: HighlightText; }
}
@media (max-width: 800px) {
  .document-tools { flex-wrap: wrap; justify-content: flex-end; }
  .note-view-switch > button { padding-inline: 12px; }
}

#note-chat { gap: 10px; padding: 20px 22px; }
.chat-mode-switch { display: grid; width: 100%; background: var(--surface); }
.chat-mode-switch[data-mode=light]::before { transform: translateX(0); }
.chat-mode-switch[data-mode=heavy]::before { transform: translateX(100%); }
.chat-mode-switch[data-mode=""]::before { opacity: 0; }
.chat-mode-switch button { display: flex; align-items: center; justify-content: center; gap: 8px; }
.chat-mode-switch small { font-size: 14px; color: var(--muted); font-weight: 400; }
.chat-messages { scrollbar-width: thin; scrollbar-color: var(--selected) transparent; overflow-anchor: none; padding: 12px 2px 20px; }
.chat-message { margin-bottom: 24px; }
.chat-message-user { margin-left: 26px; padding: 12px 16px; }
.chat-message > strong { font-size: 14px; margin-bottom: 6px; }
.chat-message-content { line-height: 1.75; }
.chat-message-content.is-streaming { white-space: pre-wrap; }
.chat-message-content > :last-child { margin-bottom: 0; }
#chat-form { padding: 12px; border-radius: 22px; background: var(--surface-raised); gap: 4px; }
#chat-message { border: 0; background: transparent; min-height: 80px; padding: 10px 4px; }
#chat-form .chat-label { font-size: 14px; padding: 0 4px; }
#chat-form .chat-attachment { font-size: 14px; }
#chat-form .chat-actions { margin: 0; gap: 4px; }
#chat-form .chat-actions button { padding: 10px 16px; }
#chat-latest { align-self: center; background: var(--surface-raised); border: 0; font-size: 14px; }
@media (max-width: 500px) {
  #note-chat { padding: 16px; }
  #chat-form .chat-actions { margin-top: 0; }
  #chat-form .chat-attachment { padding-right: 0; }
}

.chat-message-content details { margin-top: 12px; font-size: 14px; color: var(--muted); }
.chat-message-content summary { cursor: pointer; min-height: 36px; padding-block: 6px; }
.chat-message-content details > div { max-height: 240px; overflow-y: auto; padding-top: 8px; white-space: pre-wrap; }

.chat-activity { display: flex; align-items: center; gap: 10px; min-height: 24px; }
.chat-activity-mark { display: flex; align-items: center; justify-content: center; gap: 3px; width: 24px; height: 20px; flex-shrink: 0; }
.chat-activity-mark i { display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--muted); opacity: .4; }
.chat-activity[data-active=false] .chat-activity-mark i:not(:first-child) { display: none; }
.chat-activity[data-active=true] .chat-activity-mark i { animation: chat-think 1400ms cubic-bezier(.37,0,.2,1) infinite; }
.chat-activity[data-active=true] .chat-activity-mark i:nth-child(2) { animation-delay: 150ms; }
.chat-activity[data-active=true] .chat-activity-mark i:nth-child(3) { animation-delay: 300ms; }
@keyframes chat-think { 0%, 70%, 100% { transform: translateY(0); opacity: .35; } 35% { transform: translateY(-3px); opacity: 1; } }
#chat-status { line-height: 20px; font-size: 14px; }
.chat-compose-actions { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
#chat-form .chat-attachment { position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 50%; transition: background-color 200ms, color 200ms; }
.chat-attachment > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.chat-attachment:has(input:checked) { background: var(--selected); color: var(--text); }
.chat-attachment:hover { background: var(--surface-hover); }
.chat-attachment:has(input:disabled) { opacity: .45; cursor: default; }
.chat-attachment:has(input:disabled):hover { background: transparent; }
.chat-attachment:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.chat-attachment .material-symbols-rounded { font-size: 20px; }
.chat-note-card { background: var(--surface); border-radius: 18px; margin-top: 14px; overflow: hidden; white-space: normal; }
#chat-attachment-preview .chat-note-card { margin: 0 0 10px; background: var(--background); }
.chat-note-heading { display: grid; grid-template-columns: 36px minmax(0,1fr) 20px; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 18px; padding: 16px; text-align: left; background: transparent; }
.chat-note-heading:hover { background: var(--surface-hover); }
.chat-note-icon { display: grid; place-items: center; width: 36px; height: 44px; border-radius: 10px; background: var(--selected); color: var(--primary); font-size: 22px; }
.chat-note-label { display: grid; gap: 5px; min-width: 0; }
.chat-note-eyebrow { color: var(--muted); font-size: 14px; letter-spacing: .1em; font-weight: 600; }
.chat-note-heading .chat-note-label > strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; }
.chat-note-metadata { font-size: 14px; font-weight: 400; color: var(--muted); }
.chat-note-chevron { font-size: 20px; color: var(--muted); transition: transform 320ms var(--motion-spring); }
.chat-note-heading[aria-expanded=true] .chat-note-chevron { transform: rotate(180deg); }
.chat-note-preview.markdown-document { min-height: 0; max-height: 220px; overflow-y: auto; padding: 0 16px 16px; font-size: 14px; line-height: 1.65; scrollbar-width: thin; }
@media (prefers-reduced-motion: reduce) { .chat-activity-mark i { animation: none !important; } }
@media (forced-colors: active) { .chat-note-card { border: 1px solid CanvasText; } .chat-activity-mark i { background: CanvasText; } }

/* Thought status and tool activity are separate parts of a response. */
.chat-message { display: flex; flex-direction: column; gap: 0; }
.chat-message-activity { margin-bottom: 12px; color: var(--muted); font-size: 14px; line-height: 24px; }
.chat-thinking { display: flex; align-items: center; gap: 10px; min-height: 28px; margin: 0; }
.chat-thinking > .material-symbols-rounded { display: grid; place-items: center; width: 24px; height: 24px; font-size: 24px; line-height: 24px; }
.chat-thinking[data-active="true"] { color: var(--text); }
.chat-thinking[data-active="true"] > .material-symbols-rounded { animation: activity-breathe 1800ms cubic-bezier(.37,0,.2,1) infinite; }
@keyframes activity-breathe { 0%, 100% { opacity: .5; } 45% { opacity: 1; } 75% { opacity: .8; } }
.chat-tool-timeline ul { list-style: none; padding: 0; margin: 0; }
.chat-tool-timeline li { display: grid; grid-template-columns: 24px minmax(0,1fr); align-items: start; gap: 10px; padding: 2px 0; line-height: 24px; }
.chat-tool-timeline .material-symbols-rounded { display: grid; place-items: center; width: 24px; height: 24px; font-size: 24px; line-height: 24px; }
.chat-tool-description { color: var(--muted); font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.chat-tool-target { color: var(--muted); overflow-wrap: anywhere; }
.chat-tool-timeline li[data-status="running"] > .material-symbols-rounded { animation: activity-breathe 1800ms cubic-bezier(.37,0,.2,1) infinite; }
.chat-response-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; order: 3; margin-top: 8px; }
.chat-response-duration { margin: 0; font-size: 14px; line-height: 24px; color: var(--muted); }
.chat-mode-switch { grid-template-columns: repeat(3, minmax(0,1fr)); }
.chat-mode-switch::before { width: calc((100% - 8px) / 3); }
.chat-mode-switch[data-mode="custom"]::before { transform: translateX(200%); }
.chat-mode-switch button { padding-inline: 8px; font-size: 16px; }
.chat-mode-switch small { display: none; }
#note-chat { position: relative; }
@media (max-width: 1000px) { #note-chat { position: absolute; } }

/* One assistant surface shared by the workspace and its dialogs. */
#global-lirio-toggle { position: fixed; inset: auto 24px 24px auto; margin: 0; z-index: 40; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 18px; border: 0; background: var(--selected); color: var(--text); border-radius: 18px; box-shadow: 0 6px 24px #0003; }
#global-lirio-toggle:not(:popover-open) { display: none; }
#global-lirio-toggle::backdrop { background: transparent; pointer-events: none; }
#note-chat.is-global-chat { position: fixed; inset: 16px 16px 16px auto; width: min(440px, calc(100vw - 32px)); height: auto; max-height: calc(100dvh - 32px); z-index: 90; border-radius: 24px; box-shadow: 0 12px 48px #0005; }
#lirio-chat-home { width: min(860px, 100%); margin: 0 auto; }
#lirio-chat-home #note-chat { position: relative; inset: auto; width: 100%; height: calc(100dvh - 220px); min-height: 420px; padding-inline: 0; box-shadow: none; }
#lirio-chat-home #chat-close { display: none; }
.chat-context-summary { margin: 2px 0 0; color: var(--muted); font-size: 14px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-context-controls { display: grid; gap: 16px; }
.chat-context-controls label { margin: 0; font-size: 16px; line-height: 1.5; }
.chat-context-controls label:not(.chat-setting-toggle) { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.chat-context-controls input[type="number"] { width: 84px; min-height: 48px; padding: 10px 12px; font-size: 16px; }
.chat-context-controls button { justify-self: start; min-height: 44px; padding: 10px 14px; font-size: 16px; }
.history-filter { padding: 0 40px 20px; max-width: 480px; }
.history-filter label { font-size: 14px; color: var(--muted); }
[data-history-list] { padding: 0 40px; }
.history-entry { display: grid; gap: 5px; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 12px; padding: 14px 12px; }
.history-entry:hover { background: var(--surface-raised); }
.history-entry time, .history-entry small { font-size: 14px; color: var(--muted); font-weight: 400; }
[data-history-more] { margin: 20px 40px; }
.history-detail { width: min(1050px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.history-detail h2 { font-size: 18px; line-height: 1.4; }
.history-detail h3 { font-size: 15px; }
.history-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.history-comparison h4 { color: var(--muted); font-size: 14px; font-weight: 400; margin-bottom: 8px; }
.history-comparison pre { font: inherit; font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; background: var(--background); border-radius: 12px; padding: 14px; }
@media (max-width: 650px) {
  #note-chat.is-global-chat { inset: 8px; width: auto; max-height: calc(100dvh - 16px); }
  #lirio-chat-home #note-chat { min-height: 360px; height: calc(100dvh - 190px); padding: 12px; }
  .history-comparison { grid-template-columns: 1fr; gap: 0; }
  [data-history-list], .history-filter { padding-inline: 20px; }
}
.chat-tool-description { position: relative; }
.chat-tool-target[role="button"] { cursor: pointer; text-decoration: underline; text-decoration-color: var(--outline); text-underline-offset: 3px; border-radius: 3px; }
.chat-tool-target[role="button"]:focus-visible { outline: 2px solid var(--muted); outline-offset: 3px; }

/* Conversation layout and its configuration surface. */
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip-path: inset(50%); white-space: nowrap; border: 0; }
#note-chat { padding: 24px; gap: 20px; }
.chat-heading { align-items: center; column-gap: 12px; row-gap: 4px; flex-shrink: 0; }
.chat-heading-copy { min-width: 0; flex: 1; }
.chat-heading h2 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.chat-heading-actions { display: flex; gap: 4px; align-items: center; }
.chat-icon-button { position: relative; width: 48px; height: 48px; flex-basis: 48px; border-radius: 14px; color: var(--muted); }
.chat-icon-button .material-symbols-rounded { font-size: 24px; line-height: 24px; width: 24px; height: 24px; }
.chat-icon-button[aria-expanded="true"], .chat-icon-button[aria-pressed="true"] { background: var(--selected); color: var(--text); }
#chat-settings-panel { position: absolute; inset: 112px 8px 8px; z-index: 10; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border-radius: 24px; box-shadow: 0 16px 40px #0003; }
.chat-settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 16px 16px 24px; flex-shrink: 0; }
.chat-settings-heading h3 { margin: 0; font-size: 20px; line-height: 1.4; }
.chat-settings-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 24px 28px; display: grid; gap: 32px; scrollbar-width: thin; }
.chat-settings-group > h4 { font-size: 16px; font-weight: 600; line-height: 1.5; margin: 0 0 16px; }
#chat-settings-panel fieldset { border: 0; padding: 16px 0; margin: 0; min-width: 0; }
#chat-settings-panel legend { font-size: 16px; color: var(--muted); font-weight: 600; }
#chat-settings-panel label { margin: 12px 0 8px; font-size: 14px; }
#chat-settings-panel .dropdown-trigger { width: 100%; font-size: 16px; min-height: 48px; }
#chat-settings-panel label.chat-setting-toggle { display: flex; align-items: center; gap: 16px; min-height: 48px; margin: 0; font-size: 16px; cursor: pointer; }
#chat-settings-panel #chat-model, #chat-settings-status { font-size: 14px; line-height: 1.6; margin: 12px 0 0; overflow-wrap: anywhere; }
#chat-settings-status:empty { display: none; }
.chat-settings-actions { display: flex; justify-content: flex-end; margin-top: 24px; }
.chat-compact-settings { margin-top: 8px; }
.chat-compact-settings > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 8px 0; list-style: none; cursor: pointer; color: var(--muted); font-size: 14px; }
.chat-compact-settings > summary::-webkit-details-marker { display: none; }
.chat-compact-settings > summary .material-symbols-rounded { transition: transform 180ms ease; }
.chat-compact-settings[open] > summary .material-symbols-rounded { transform: rotate(180deg); }
#chat-model-settings-form > label:first-child { margin-top: 0; }
#chat-model-settings-form fieldset { padding: 0; }
#chat-model-settings-form fieldset > label { margin-top: var(--field-gap); }
#chat-model-settings-form .chat-setting-toggle { margin-top: var(--field-gap); }
.chat-provider-form > label { display:block; margin-top:var(--field-gap); }
.chat-provider-form > label:first-child { margin-top:0; }
.chat-provider-form > .primary { margin-top:var(--field-gap); }
.chat-provider-form > p { color:var(--muted); font-size:14px; }
.chat-auth-flow { display:grid; gap:var(--field-gap); margin-top:var(--field-gap); }
.chat-auth-flow:empty, .chat-auth-status:empty { display:none; }
.chat-auth-flow form { display:grid; gap:8px; }
.chat-auth-flow form > .primary { justify-self:end; margin-top:8px; }
.chat-auth-flow .chat-auth-link { color:var(--muted); text-underline-offset:3px; }
.chat-auth-code { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 16px; width:100%; }
.chat-auth-code code { font-size:18px; letter-spacing:2px; }
.chat-auth-hint, .chat-auth-status { color:var(--muted); font-size:14px; line-height:1.5; margin:12px 0; }
.chat-auth-status.is-error { color:var(--danger); }
#chat-settings-panel #chat-status { margin: 0; font-size: 16px; }
#chat-connect { margin-top: 12px; }
.chat-messages { padding: 16px 4px 24px; scroll-padding-block: 24px; }
.chat-message { margin-bottom: 32px; }
.chat-message-user { align-self: flex-end; max-width: 88%; width: fit-content; margin-left: auto; padding: 16px 20px; border-radius: 22px 22px 8px 22px; }
.chat-message-content { font-size: 16px; line-height: 1.75; }
.chat-message-content strong { display: inline; font-size: inherit; color: inherit; margin: 0; font-weight: 600; }
.chat-message-content > p { margin-top: 0; margin-bottom: 16px; }
#chat-form { padding: 16px; gap: 12px; border-radius: 24px; }
#chat-message { min-height: 88px; font-size: 16px; line-height: 1.65; padding: 8px; }
#chat-form .chat-attachment { font-size: 14px; gap: 8px; }
#chat-form .chat-actions button { min-height: 44px; font-size: 16px; }
.chat-note-eyebrow { font-size: 14px; letter-spacing: 0; font-weight: 400; }
.chat-note-metadata { font-size: 14px; }
.chat-note-heading .chat-note-label > strong { font-size: 16px; }
#lirio-view > .board-toolbar { display: none; }
#lirio-chat-home { width: min(960px, 100%); padding-inline: 24px; }
#lirio-chat-home #note-chat { height: calc(100dvh - 120px); min-height: 0; padding: 16px 0 24px; }
#chat-fullscreen { position: fixed; left: 0; top: 0; margin: 0; padding: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; border-radius: 0; background: var(--background); overflow: hidden; }
#chat-fullscreen::backdrop { background: #0009; }
#chat-fullscreen #note-chat { position: relative; inset: auto; width: 100%; height: 100%; max-height: none; padding: clamp(16px, 3vw, 36px); border-radius: 0; box-shadow: none; }
#chat-fullscreen .chat-heading { width: min(800px, 100%); align-self: center; }
#chat-fullscreen :is(.chat-timeline, #chat-form, #chat-requests, #chat-error) { width: min(800px, 100%); align-self: center; }
#chat-fullscreen .chat-messages { padding-block: 24px 56px; }
#chat-fullscreen #chat-settings-panel { left: 16px; right: 16px; width: min(680px, calc(100% - 32px)); margin-inline: auto; }
#chat-fullscreen #chat-close { display: inline-flex; }
@media (max-width: 650px) {
  #note-chat, #chat-fullscreen #note-chat { padding: 16px; gap: 16px; }
  #lirio-chat-home { padding-inline: 16px; }
  #lirio-chat-home #note-chat { height: calc(100dvh - 104px); min-height: 0; padding: 8px 0 16px; }
  .chat-heading { gap: 8px; }
  .chat-heading-actions { gap: 0; }
  .chat-message-user { max-width: 94%; }
  #chat-form { padding: 12px; }
  #chat-settings-panel { inset: 104px 8px 8px; }
  .chat-settings-scroll { padding-inline: 20px; }
}

/* Shared Material controls: semantic inputs with custom, animated visuals. */
input[type="checkbox"]:not(#chat-attach):not(.material-switch) { appearance: none; display: inline-grid; place-content: center; vertical-align: middle; flex-shrink: 0; width: 22px; height: 22px; min-height: 22px; padding: 0; border: 1.5px solid var(--outline); border-radius: 6px; background: var(--surface-raised); cursor: pointer; transition: background-color 180ms, border-color 180ms; }
input[type="checkbox"]:not(#chat-attach):not(.material-switch)::after { content: ''; display: block; width: 6px; height: 11px; margin-top: -3px; border: solid var(--on-primary); border-width: 0 2px 2px 0; opacity: 0; transform: rotate(45deg) scale(.4); transition: transform 240ms var(--motion-spring), opacity 160ms; }
input[type="checkbox"]:not(#chat-attach):not(.material-switch):checked { background: var(--primary); border-color: var(--primary); }
input[type="checkbox"]:not(#chat-attach):not(.material-switch):checked::after { transform: rotate(45deg) scale(1); opacity: 1; }
input[type="checkbox"].material-switch { appearance: none; display: inline-block; position: relative; flex-shrink: 0; width: 52px; height: 32px; min-height: 32px; margin: 0; padding: 0; border: 2px solid var(--outline); border-radius: 18px; background: var(--surface-raised); cursor: pointer; transition: background-color 240ms, border-color 240ms; }
input[type="checkbox"].material-switch::after { content: ''; display: block; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; margin: 0; border: 0; border-radius: 50%; background: var(--muted); transform: translateX(0); opacity: 1; transition: transform 340ms var(--motion-spring), background-color 180ms; }
input[type="checkbox"].material-switch:checked { background: var(--primary); border-color: var(--primary); }
input[type="checkbox"].material-switch:checked::after { transform: translateX(20px); background: var(--on-primary); }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
input[type="checkbox"]:disabled { cursor: default; opacity: .55; }
button, .main-nav button { font-size: 16px; }
#notifications-badge { min-width: 22px; height: 22px; line-height: 22px; }
html[data-motion="reduced"] .chat-message-activity *, html[data-motion="reduced"] :is(.chat-icon-button, .note-properties-button)::after, html[data-motion="reduced"] input[type="checkbox"], html[data-motion="reduced"] input[type="checkbox"]::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .chat-message-activity *, :is(.chat-icon-button, .note-properties-button)::after, input[type="checkbox"], input[type="checkbox"]::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  input[type="checkbox"]:checked { background: Highlight !important; border-color: Highlight !important; }
  input[type="checkbox"]::after { border-color: HighlightText !important; }
  input[type="checkbox"].material-switch:checked::after { background: HighlightText; }
}

label:has(> input[type="checkbox"]):not(.chat-attachment) { min-height: 44px; }

/* Scroll controls float over the conversation instead of occupying a row. */
.chat-timeline { position: relative; flex: 1; min-height: 0; width: 100%; }
.chat-timeline .chat-messages { height: 100%; padding: 16px 0 56px; scrollbar-gutter: stable; }
.chat-timeline::after { content: ''; position: absolute; z-index: 1; bottom: 0; left: 0; right: 0; height: 56px; background: linear-gradient(to bottom, transparent, var(--background)); pointer-events: none; }
#chat-latest { position: absolute; z-index: 2; left: 50%; bottom: 8px; transform: translateX(-50%); width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; border: 0; background: var(--surface-hover); color: var(--text); box-shadow: 0 4px 14px #0003; }
#chat-latest:active { transform: translateX(-50%); }
#note-chat { gap: 16px; }
#chat-requests:empty { display: none; }
.chat-note-card.is-draft { position: relative; }
.chat-note-card.is-draft .chat-note-heading { padding-right: 60px; }
.chat-remove-note { position: absolute; right: 8px; top: 8px; }
.chat-attachment-actions { display: flex; align-items: center; gap: 4px; }
#chat-form :is(.chat-attachment, .chat-icon-button) { flex: 0 0 44px; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; }
#chat-form .chat-actions .chat-icon-button { padding: 0; }
#chat-form .chat-icon-button .material-symbols-rounded { margin: 0; font-size: 22px; }
#chat-form .chat-actions { align-items: center; }
#chat-form { gap: 8px; }
#chat-message { min-height: 72px; }
.chat-image-previews { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 8px; }
.chat-image-preview { position: relative; flex: 0 0 128px; margin: 0; }
.chat-image-preview img { display: block; width: 128px; height: 96px; object-fit: cover; border-radius: 14px; background: var(--background); }
.chat-image-preview figcaption { max-width: 128px; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--muted); }
.chat-remove-image { position: absolute; top: 4px; right: 4px; width: 40px; min-width: 40px; height: 40px; min-height: 40px; background: var(--surface); box-shadow: 0 2px 10px #0004; }
.chat-sent-images { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.chat-sent-images a { display: block; border-radius: 14px; overflow: hidden; }
.chat-sent-images img { display: block; width: auto; max-width: min(280px, 100%); height: 160px; object-fit: contain; background: var(--background); }
#chat-attachment-preview { overflow: hidden; }

.chat-image-preview { min-width: 0; overflow: hidden; }
.chat-sent-images a { max-width: 100%; }

/* Note metadata lives in a separate, dismissible properties panel. */
.note-properties-button { position: relative; border-radius: 14px; }
.note-properties-button[aria-expanded="true"] { background: var(--selected); color: var(--text); }
#note-properties { position: absolute; z-index: 5; right: 20px; width: min(360px, calc(100% - 40px)); max-height: calc(100% - 160px); overflow-y: auto; padding: 16px 20px 24px; border-radius: 24px; background: var(--surface-raised); box-shadow: 0 12px 40px #0005; scrollbar-width: thin; }
.note-properties-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.note-properties-heading h2 { font-size: 18px; }
#note-properties label { margin: 0 0 8px; font-size: 16px; }
#note-properties #note-tags { width: 100%; min-height: 48px; padding: 12px; background: var(--surface); font-size: 16px; }
#note-properties small { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.5; }
#note-properties .document-dates { display: grid; gap: 20px; margin: 28px 0 0; font-size: 14px; line-height: 1.6; }
.document-dates dt { color: var(--muted); }
.document-dates dd { margin: 4px 0 0; color: var(--text); font-variant-numeric: tabular-nums; }
.chat-message.is-intermediate { margin-bottom: 8px; }
.chat-message-content > :last-child { margin-bottom: 0; }
.chat-response-footer:empty { display: none; }
.chat-message.is-activity-only { margin-bottom: 6px; }
.chat-message.is-activity-only > .chat-message-activity { margin-bottom: 0; }
.chat-message.is-activity-only > .chat-message-content { display: none; }
.chat-thinking:not([hidden]) + .chat-tool-timeline:not([hidden]) { margin-top: 4px; }
@media (max-width: 650px) {
  #note-properties { right: 12px; width: min(360px, calc(100% - 24px)); max-height: calc(100% - 192px); }
}

.chat-floating-tooltip { position: fixed; inset: auto; margin: 0; border: 0; padding: 10px 14px; width: max-content; max-width: min(480px, calc(100vw - 24px)); max-height: min(320px, calc(100dvh - 24px)); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; border-radius: 12px; background: var(--surface-hover); color: var(--text); box-shadow: 0 8px 24px #0004; font-size: 14px; font-weight: 400; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.chat-floating-tooltip::backdrop { background: transparent; pointer-events: none; }

#chat-queue-status { margin: 0; overflow: hidden; color: var(--muted); font-size: 14px; line-height: 1.5; }

.chat-settings-hint { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

#chat-sessions-panel { position: absolute; inset: 72px 12px 12px; z-index: 6; display: flex; flex-direction: column; padding: 16px; border-radius: 20px; background: var(--surface); box-shadow: 0 12px 36px #0004; }
.chat-sessions-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 2px; }
.chat-session-list { display: grid; gap: 4px; }
.chat-session-choice { display: grid; gap: 4px; text-align: left; width: 100%; min-height: 64px; padding: 12px 14px; border: 0; border-radius: 14px; background: transparent; transition: background-color 180ms; }
.chat-session-choice[aria-current="true"] { background: var(--selected); }
.chat-session-choice strong { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.chat-session-choice > span, .chat-session-help { font-size: 14px; color: var(--muted); line-height: 1.6; }
.chat-session-choice[data-status="working"] > span { color: var(--primary); }
.chat-session-choice[data-status="error"] > span { color: var(--danger); }
.chat-create-agent { display: flex; align-items: center; gap: 10px; min-height: 48px; margin-top: 16px; width: 100%; }
.chat-new-agent { display: grid; gap: 12px; margin-top: 4px; }
.chat-new-agent h4 { font-size: 18px; margin: 0 0 8px; }
.chat-new-agent label { font-size: 14px; margin: 0; }
.chat-new-agent input, .chat-new-agent textarea { font-size: 16px; min-width: 0; }
.chat-agent-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.chat-aside-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.chat-aside-actions > div { display: flex; gap: 4px; }
.chat-aside-actions button { font-size: 14px; min-height: 44px; padding-inline: 12px; }
.chat-icon-button[data-unread="true"]::before { content: ''; position: absolute; right: 7px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
#chat-fullscreen #chat-sessions-panel { inset-inline: max(12px, calc((100% - 800px) / 2)); }


/* References use normal inline text flow, including wrapping and punctuation. */
.chat-output { display: inline; margin: 0; padding: 0; background: transparent; }
.chat-output .chat-output-heading { display: inline; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--primary); font: inherit; text-decoration: underline; text-decoration-color: var(--outline); text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; cursor: pointer; transition: color 180ms, text-decoration-color 180ms; }
.chat-output .chat-output-heading:hover { background: transparent; color: var(--text); text-decoration-color: currentColor; }
.chat-output .chat-output-heading:active { transform: none; }
.chat-output .chat-output-heading[aria-busy="true"] { opacity: .6; cursor: progress; }
.chat-artifact-menu { position: fixed; inset: auto; margin: 0; padding: 6px; width: 220px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; border: 0; border-radius: 14px; background: var(--surface-hover); color: var(--text); box-shadow: 0 8px 28px #0004; }
.chat-artifact-menu::backdrop { background: transparent; pointer-events: none; }
.chat-artifact-menu :is(a, button) { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: left; text-decoration: none; font-size: 15px; font-weight: 400; }
.chat-artifact-menu :is(a, button):hover { background: var(--selected); }
.chat-artifact-menu .material-symbols-rounded { font-size: 20px; }
.chat-artifact-menu p { padding: 10px; font-size: 15px; line-height: 1.5; }

/* Keep tool execution after its preceding message, and the chat above modal transforms. */
.chat-message > .chat-tool-timeline { margin-top: 10px; margin-bottom: 0; color: var(--muted); }
.chat-message.is-activity-only > .chat-tool-timeline { margin-top: 0; }
.chat-message.is-activity-only > .chat-message-activity:not([hidden]) { margin-bottom: 4px; }
#note-chat.is-global-chat[popover] { margin: 0; border: 0; color: var(--text); }
#note-chat[popover]:not(:popover-open) { display: none; }
#note-chat[popover]::backdrop { background: transparent; pointer-events: none; }

/* Inspect Pi activity without adding detail payloads to the message timeline. */
button.chat-thinking { width: fit-content; max-width: calc(100% + 16px); min-height: 32px; min-width: 0; margin-inline: -8px; padding: 4px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 400; line-height: 24px; text-align: left; transition: background-color 180ms, color 180ms; }
button.chat-thinking:hover { color: var(--text); background: color-mix(in srgb, var(--surface-hover) 45%, transparent); }
.chat-tool-timeline li { display: block; padding: 0; }
.chat-tool-inspect { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: start; gap: 10px; width: fit-content; max-width: calc(100% + 16px); min-width: 0; min-height: 32px; margin-inline: -8px; padding: 4px 8px; border: 0; border-radius: 8px; background: transparent; font-weight: 400; line-height: 24px; text-align: left; transition: background-color 180ms, color 180ms; }
.chat-tool-inspect:hover { background: color-mix(in srgb, var(--surface-hover) 45%, transparent); }
.chat-activity-icon { display: block; flex-shrink: 0; width: 24px; height: 24px; fill: currentColor; color: var(--muted); opacity: .68; transition: opacity 180ms; }
.chat-tool-inspect:is(:hover, :focus-visible) > .chat-activity-icon,
.chat-thinking:is(:hover, :focus-visible) > .chat-activity-icon { opacity: 1; }
:is(.chat-warning, .chat-compaction-status[data-failed="true"], .chat-tool-timeline li[data-status="error"]) .chat-activity-icon { color: var(--danger); opacity: 1; }
.chat-copy-response .chat-activity-icon { width: 20px; height: 20px; }
:root[data-motion="full"] .chat-thinking[data-active="true"] > .chat-activity-icon,
:root[data-motion="full"] .chat-tool-timeline li[data-status="running"] .chat-activity-icon { animation: activity-breathe 2200ms ease-in-out infinite; }

.chat-tool-inspect:is(:hover, :focus-visible) .chat-tool-description { color: var(--text); }
.chat-tool-inspect .chat-tool-target { text-decoration: underline; text-decoration-color: var(--outline); text-underline-offset: 3px; }
.chat-tool-timeline li[data-status="error"] :is(.chat-tool-inspect, .chat-tool-description, .chat-tool-target) { color: var(--danger); text-decoration-color: currentColor; }
.chat-tool-timeline li[data-status="running"] .chat-tool-inspect > .material-symbols-rounded { animation: activity-breathe 1800ms cubic-bezier(.37,0,.2,1) infinite; }
#chat-inspector { position: fixed; inset: 0; margin: auto; width: min(900px, calc(100vw - 32px)); max-width: none; height: min(680px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px); padding: 24px; border: 0; border-radius: 28px; background: var(--surface); color: var(--text); overflow: hidden; box-shadow: 0 24px 80px #0005; }
#chat-inspector[open] { display: flex; flex-direction: column; gap: 20px; }
#chat-inspector::backdrop { background: #0008; backdrop-filter: none; }
#chat-inspector .chat-inspector-heading { display: flex; flex: 0 0 auto; flex-wrap: nowrap; align-items: flex-start; justify-content: space-between; height: auto; min-height: 0; padding: 0; gap: 16px; color: var(--text); }
#chat-inspector .chat-inspector-heading > .icon { flex-shrink: 0; }
.chat-inspector-heading > div { min-width: 0; }
.chat-inspector-heading h2 { margin: 0; font-size: 20px; line-height: 1.4; overflow-wrap: anywhere; }
.chat-inspector-status { margin: 6px 0 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.chat-inspector-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; flex: 0 0 auto; padding: 4px; border-radius: 18px; background: var(--background); isolation: isolate; }
.chat-inspector-tabs::before { content: ''; position: absolute; inset: 4px auto 4px 4px; width: calc((100% - 8px) / 2); border-radius: 14px; background: var(--selected); transition: transform 340ms var(--motion-spring); z-index: -1; }
.chat-inspector-tabs[data-selected="output"]::before { transform: translateX(100%); }
.chat-inspector-tabs button { min-width: 0; border: 0; border-radius: 14px; background: transparent; font-size: 16px; color: var(--muted); }
.chat-inspector-tabs button[aria-selected="true"] { color: var(--text); }
.chat-inspector-content { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 20px; border-radius: 16px; background: var(--background); }
.chat-inspector-content pre { margin: 0; font: 15px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
.chat-inspector-content pre.is-thinking { font: inherit; font-size: 16px; line-height: 1.8; }
.chat-inspector-empty { margin: 0; font-size: 16px; line-height: 1.7; color: var(--muted); }
html[data-motion="reduced"] .chat-inspector-tabs::before, html[data-motion="reduced"] :is(.chat-tool-inspect, .chat-thinking) { transition: none; }
@media (prefers-reduced-motion: reduce) { .chat-inspector-tabs::before, .chat-tool-inspect, .chat-thinking { transition: none; } }
@media (max-width: 700px) { #chat-inspector { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 20px 16px; gap: 16px; } .chat-inspector-content { padding: 16px; } }

/* Session identity and the floating agent monitor. */
.agent-avatar { position: relative; display: inline-flex; flex: 0 0 36px; align-items: center; justify-content: center; width: 36px; height: 36px; aspect-ratio: 1; box-sizing: border-box; border-radius: 50%; background: #33464e; color: #e3edf1; font-size: 14px; line-height: 1; font-weight: 600; letter-spacing: 0; }
.agent-avatar[data-color="1"] { background: #464252; color: #eee7fa; }
.agent-avatar[data-color="2"] { background: #3b4942; color: #e0eee5; }
.agent-avatar[data-color="3"] { background: #50463b; color: #f3e8d9; }
.agent-avatar[data-color="4"] { background: #4b3f45; color: #f3e2e9; }
.agent-avatar::after { content: ''; position: absolute; width: 7px; height: 7px; right: -1px; bottom: -1px; border: 2px solid var(--surface); border-radius: 50%; background: var(--muted); }
.agent-avatar[data-status="working"]::after, .agent-avatar[data-status="starting"]::after { background: #b8d5be; }
.agent-avatar[data-status="waiting"]::after, .agent-avatar[data-status="error"]::after { background: #efba8b; }
:root[data-motion="full"] .agent-avatar[data-status="working"]::after,
:root[data-motion="full"] .agent-avatar[data-status="starting"]::after { animation: agent-presence-breathe 2200ms ease-in-out infinite; }
@keyframes agent-presence-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.agent-presence-count { font-size: 14px; line-height: 20px; font-weight: 500; white-space: nowrap; }
#global-lirio-toggle { max-width: calc(100vw - 32px); padding: 6px 14px 6px 6px; border-radius: 28px; }
#global-lirio-toggle > span:first-child { display: inline-flex; }
#global-lirio-toggle[data-agent-state="stale"] .agent-avatar::after,
[data-stale="true"] .agent-avatar::after { animation: none; background: var(--muted); }
.agent-presence-menu { position: fixed; inset: auto; margin: 0; padding: 4px 8px; width: max-content; max-width: calc(100vw - 32px); box-sizing: border-box; overflow: auto; overscroll-behavior: contain; border: 0; border-radius: 28px; background: var(--background); color: var(--text); box-shadow: 0 6px 24px #0002; scrollbar-width: thin; }
.agent-presence-menu::backdrop { background: transparent; pointer-events: none; }
.agent-presence-list { display: flex; flex-direction: row-reverse; width: max-content; padding-inline: 4px; }
.agent-avatar-choice { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 4px; border: 0; border-radius: 50%; background: transparent; transition: background-color 180ms, transform 260ms var(--motion-spring); }
.agent-presence-list .agent-avatar-choice + .agent-avatar-choice { margin-right: -8px; }
.agent-avatar-choice:hover, .agent-avatar-choice:focus-visible { z-index: 1; background: var(--surface-hover); transform: translateY(-2px); }
.agent-avatar-choice[aria-current="true"] { background: var(--selected); }
.agent-avatar-choice .agent-avatar { box-shadow: 0 0 0 2px var(--background); }
.agent-avatar[data-status="error"]::after { background: var(--danger); }
.chat-session-copy { display: grid; gap: 3px; min-width: 0; }
.chat-session-copy > span { font-size: 14px; line-height: 21px; color: var(--muted); }
.chat-heading { flex-wrap: wrap; }
.chat-running-agents { display: flex; align-items: center; gap: 8px; flex: 0 0 100%; min-width: 0; min-height: 44px; }
.chat-running-label { flex: 0 1 auto; min-width: 0; max-width: 45%; font-size: 14px; line-height: 20px; color: var(--muted); }
.chat-running-avatars { display: flex; align-items: center; flex: 1; min-width: 0; gap: 2px; overflow-x: auto; padding: 2px; scrollbar-width: thin; }
html[data-motion="reduced"] .agent-avatar-choice { transition: none; }
html[data-motion="reduced"] .agent-avatar-choice:hover { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .agent-avatar-choice { transition: none; }
  .agent-avatar-choice:hover { transform: none; }
}
.chat-session-choice { grid-template-columns: 36px minmax(0, 1fr); align-items: center; column-gap: 12px; }
.chat-session-choice > .agent-avatar { color: #e3edf1; }
.chat-session-choice[data-status="working"] .chat-session-copy > span { color: var(--primary); }
.chat-session-choice[data-status="error"] .chat-session-copy > span { color: var(--danger); }
.chat-heading-copy.has-agent-avatar { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 10px; align-items: center; }
.chat-agent-avatar { grid-row: 1 / 3; align-self: center; margin-top: 0; }
.chat-heading-copy.has-agent-avatar > :not(.chat-agent-avatar) { grid-column: 2; }
.chat-heading-copy.has-agent-avatar h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) {
  #global-lirio-toggle { right: 16px; }
}

.chat-response-actions { display: flex; align-items: center; gap: 4px; min-height: 36px; }
.chat-copy-response { flex: 0 0 36px; min-width: 36px; min-height: 36px; width: 36px; height: 36px; padding: 8px; border-radius: 10px; color: var(--muted); }
.chat-copy-feedback { font-size: 14px; line-height: 22px; color: var(--muted); }
.chat-copy-buffer { position: fixed; inset: 0 auto auto 0; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; pointer-events: none; }

/* Pointer focus uses the surface; keyboard navigation retains a visible outline. */
:root[data-input-modality="pointer"] :is(button, a, input, textarea, select, [tabindex], [contenteditable="true"]):focus { outline: none; }
:root[data-input-modality="pointer"] .visual-document:focus { box-shadow: none; }
.search input:hover, .search input:focus { background: transparent; }
#chat-message:hover, #chat-message:focus { background: transparent; }
.chat-copy-response:hover { background: var(--surface-raised); }

.chat-task-search, .chat-agent-options { display: grid; gap: 10px; min-width: 0; }
.chat-task-search-field { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding-inline: 12px 4px; border-radius: 16px; background: var(--surface-raised); }
.chat-task-search-field input { width: 100%; padding-inline: 0; background: transparent; }
.chat-task-search-field input:hover, .chat-task-search-field input:focus { background: transparent; }
.chat-task-search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.chat-task-search-field > .material-symbols-rounded { color: var(--muted); }
.chat-task-results { display: grid; gap: 4px; max-height: 240px; overflow-y: auto; overscroll-behavior: contain; }
.chat-task-result { display: grid; gap: 4px; text-align: left; padding: 10px 12px; border-radius: 12px; background: transparent; }
.chat-task-result span { font-size: 16px; overflow-wrap: anywhere; }
.chat-task-result small, .chat-task-search-status { font-size: 14px; color: var(--muted); line-height: 1.5; }
.chat-task-search-status, .chat-new-agent .chat-session-help { margin: 0 0 8px; }
.chat-agent-options-toggle { display: flex; align-items: center; gap: 10px; padding-inline: 12px; background: transparent; text-align: left; }
.chat-agent-options-toggle .material-symbols-rounded:last-child { margin-left: auto; transition: rotate 220ms; }
.chat-agent-options-toggle[aria-expanded="true"] .material-symbols-rounded:last-child { rotate: 180deg; }
.chat-agent-options { padding: 4px 0 12px; }
:root[data-motion="reduced"] .chat-agent-options-toggle .material-symbols-rounded { transition: none; }

/* Decorative overlays share the browser top layer without intercepting input. */
:is(.smooth-caret, .focus-indicator)::backdrop { background: transparent; pointer-events: none; }
:root[data-motion="reduced"] :is(input, textarea, [contenteditable="true"]).smooth-caret-target { caret-color: auto; }
:root[data-motion="reduced"] .smooth-caret { display: none; }

:is(#toast, #task-menu, #notifications-panel)::backdrop { background: transparent; pointer-events: none; }

.chat-runtime-bar { display: flex; align-items: center; justify-self: end; min-width: 0; max-width: 100%; }
#chat-form .chat-runtime-mode { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: auto; max-width: 100%; height: 44px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 22px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; line-height: 20px; box-shadow: none; transition: color 180ms, background-color 180ms; }
#chat-form .chat-runtime-mode:hover, #chat-form .chat-runtime-mode[aria-expanded=true] { color: var(--text); background: var(--surface-hover); }
#chat-form .chat-runtime-mode > .material-symbols-rounded { display: block; width: 20px; height: 20px; margin: 0; font-size: 20px; line-height: 20px; flex: 0 0 20px; }
.chat-message-field { position: relative; min-width: 0; }
#chat-form .chat-message-field #chat-message { display: block; width: 100%; padding-inline-end: 52px; }
#chat-form .chat-runtime-context { position: absolute; top: 0; right: 0; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 8px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); box-shadow: none; transition: background-color 200ms, color 200ms; }
#chat-form .chat-runtime-context:hover { background: color-mix(in srgb, var(--muted) 10%, transparent); color: var(--text); }
.chat-context-ring { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.5; }
.chat-context-track { opacity: .22; }
.chat-context-fill { transform: rotate(-90deg); transform-origin: center; stroke-linecap: round; transition: stroke-dashoffset 360ms ease; }
.chat-runtime-context[data-known="false"] .chat-context-track { stroke-dasharray: 3 3; opacity: .5; }
#chat-form .chat-runtime-context[data-level="high"] { color: var(--primary); }
button.chat-compaction-status { flex-shrink: 0; margin-block: 4px 8px; }
button.chat-compaction-status[data-failed="true"] { color: var(--danger); }
html[data-motion="reduced"] :is(.chat-runtime-bar button, .chat-context-fill) { transition: none; }
@media (prefers-reduced-motion: reduce) { .chat-runtime-bar button, .chat-context-fill { transition: none; } }

.chat-message-content.markdown-document a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--outline); text-underline-offset: 3px; transition: text-decoration-color 200ms; }
.chat-message-content.markdown-document a:hover { text-decoration-color: var(--muted); }
@keyframes chat-activity-shine {
  0% { background-position: 150% 50%; }
  100% { background-position: -150% 50%; }
}
@media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  @supports (background-clip: text) {
    :root[data-motion="full"] .chat-thinking[data-active="true"] > span,
    :root[data-motion="full"] .chat-tool-timeline li:is([data-status="preparing"], [data-status="requested"], [data-status="running"]) .chat-tool-verb {
      background-image: linear-gradient(105deg, var(--muted) 35%, var(--text) 48%, var(--muted) 61%);
      background-size: 250% 100%;
      background-clip: text;
      -webkit-background-clip: text;
      color: transparent;
      animation: chat-activity-shine 2400ms ease-in-out infinite;
    }
  }
  :root[data-motion="full"] .chat-tool-timeline li:is([data-status="preparing"], [data-status="requested"]) .chat-activity-icon {
    animation: activity-breathe 2200ms ease-in-out infinite;
  }
  :root[data-motion="full"] #chat-form .chat-compose-actions button:not(:disabled):active { opacity: .72; }
}
html[data-motion="reduced"] :is(.chat-runtime-context, .chat-message-content.markdown-document a) { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .chat-runtime-context, .chat-message-content.markdown-document a { transition: none; }
  .chat-thinking > span, .chat-tool-verb, .chat-activity-icon { animation: none !important; }
}

/* Keep board columns within the viewport; only each task list scrolls vertically. */
#app:has(#board-view:not([hidden])) { height: 100dvh; min-height: 0; overflow: hidden; }
main:has(#board-view:not([hidden])) { display: flex; flex-direction: column; height: 100dvh; min-height: 0; overflow: hidden; }
#board-view:not([hidden]) { display: flex; flex: 1 1 0; flex-direction: column; min-height: 0; overflow: hidden; }
#board-view > .board-toolbar, #board-view > .view-toolbar { flex: 0 0 auto; }
#kanban { flex: 1 1 0; height: auto; min-height: 0; overflow-y: hidden; }
.column { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
.column-head { flex: 0 0 auto; }
.drop-zone { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #606b73 transparent; }
@media (max-width: 700px) {
  #app:has(#board-view:not([hidden])) { display: flex; flex-direction: column; }
  #app:has(#board-view:not([hidden])) > .sidebar { flex: 0 0 auto; }
  main:has(#board-view:not([hidden])) { flex: 1 1 0; height: auto; margin: 0; width: 100%; }
}
@media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  @keyframes task-card-arrival {
    0% { opacity: 0; transform: translateY(8px); outline: 1px solid transparent; outline-offset: 1px; box-shadow: none; }
    42% { opacity: 1; transform: translateY(0); outline: 1px solid transparent; outline-offset: 1px; box-shadow: none; }
    58%, 64% { outline: 1px solid var(--primary); outline-offset: 1px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent), 0 0 18px color-mix(in srgb, var(--primary) 16%, transparent); }
    76% { outline-color: color-mix(in srgb, var(--primary) 55%, transparent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 5%, transparent), 0 0 12px color-mix(in srgb, var(--primary) 8%, transparent); }
    100% { opacity: 1; transform: none; outline-color: transparent; box-shadow: none; }
  }
  html[data-motion="full"] .task-card.task-card-new { animation: task-card-arrival 880ms cubic-bezier(.2, .7, .3, 1); }
}
