/* Shared item editor: a non-modal dock, expandable without remounting the form. */
body { --editor-dock-width: 540px; }
:root :is(#editor,#entry-editor).editor-workspace {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: var(--editor-dock-width);
  height: 100dvh;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius:0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
  overflow: hidden;
  z-index: 35;
}
:is(#editor,#entry-editor).editor-workspace[open] { display: flex; flex-direction: column; }
:is(#editor,#entry-editor).editor-workspace::backdrop { background: transparent; }
body.editor-docked .app-shell .main { margin-right: var(--editor-dock-width); }
body.editor-docked .topbar { flex-wrap: wrap; gap: 14px; }
body.editor-docked .topbar .heading { min-width: 170px; }
body.editor-docked .topbar .search-box { display: none; }
body.editor-docked .topbar .search-button { display: inline-flex; }
body.editor-docked .app-shell .fab { display: none; }
body.editor-docked .task-summary { display: none; }
body.editor-docked .task-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
body.editor-docked .task-tools > div { display: flex; gap: 8px; align-items: center; }
body.editor-docked .task-tools > div + div { margin-top: 0; }
@media(min-width:1101px) {
  body.editor-docked #main[data-view=tasks] { position: relative; }
  body.editor-docked #main[data-view=tasks] .top-actions .search-button { display: none; }
  body.editor-docked #main[data-view=tasks] .task-search-field { position: static; width: 100%; }
  body.editor-docked #main[data-view=tasks] .task-filters { padding: 0; border: 0; background: transparent; box-shadow: none; margin-bottom: 14px; }
  body.editor-docked #main[data-view=tasks] .task-tools { display: flex; flex-wrap: wrap; gap: 12px; }
  body.editor-docked #main[data-view=tasks] .task-order { display: flex; flex-direction: row; flex-wrap: wrap; gap: 12px; width: auto; }
  body.editor-docked #main[data-view=tasks] .task-tools .filter-field { flex: 0 1 auto; min-width: 0; display: flex; flex-direction: row; align-items: center; gap: 8px; }
  body.editor-docked #main[data-view=tasks] .task-row { gap: 8px; padding: 12px 6px; }
  body.editor-docked #main[data-view=tasks] .task-project-column { flex: 0 0 20px; width: 20px; min-width: 20px; }
  body.editor-docked #main[data-view=tasks] .task-project-column .project-label-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  body.editor-docked #main[data-view=tasks] .task-row [data-action=open] { font-size: 0; min-width: 36px; min-height: 36px; padding: 7px; }
}
.editor-selected { outline: 2px solid var(--teal); outline-offset: -2px; }
:is(#editor,#entry-editor).editor-workspace .editor-head {
  flex: none;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  padding: 23px 26px 19px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.editor-heading { flex: 1; min-width: 0; }
:is(#editor,#entry-editor).editor-workspace .editor-head h2 {
  margin: 0;
  font: 700 30px/1.18 Georgia, serif;
  letter-spacing: -.6px;
  color: var(--ink);
}
.editor-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.editor-subtitle:empty { display: none; }
:is(#editor,#entry-editor).editor-workspace .editor-head-actions { display: flex; align-items: center; flex: none; gap: 5px; }
:is(#editor,#entry-editor).editor-workspace .editor-head-actions .icon { width: 20px; height: 20px; }
.editor-back-line, .editor-back, .editor-page-actions, .editor-label-short { display: none; }
.editor-menu { position: relative; }
.editor-menu:not(:has(.editor-menu-body > button)) { display: none; }
.editor-menu > summary { list-style: none; }
.editor-menu > summary::-webkit-details-marker { display: none; }
.editor-menu-body { position: absolute; right: 0; top: 44px; min-width: 170px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius:var(--radius-card,8px); box-shadow: 0 8px 24px #14203520; z-index: 2; }
.editor-menu-body:empty { display: none; }
:is(#editor,#entry-editor) .editor-menu-body .btn { width: 100%; justify-content: flex-start; border: 0; font-size: 14px; }
.editor-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scroll-padding-block: 18px; }
:is(#editor,#entry-editor).editor-workspace #item-form { display: block; margin: 0; }
:is(#editor,#entry-editor).editor-workspace .editor-body { display: flex; flex-direction: column; gap: 0; padding: 25px 26px 16px; }
.editor-primary, .editor-properties { min-width: 0; }
.editor-primary { display: flex; flex-direction: column; gap: 20px; }
:is(#editor,#entry-editor).editor-workspace .field { gap: 7px; margin: 0; font-size: 14px; }
:is(#editor,#entry-editor).editor-workspace .field :is(input:not([type=checkbox],[type=range]), select, textarea) { width: 100%; min-height: 44px; padding: 10px 12px; font-size: 14px; }
.editor-core-properties { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 16px; }
.task-schedule { min-width: 0; margin: 0; padding: 14px; display: grid; gap: 14px; border: 1px solid var(--line); border-radius: var(--radius-card,8px); }
.task-schedule legend { padding: 0 5px; font-weight: 650; color: var(--ink); }
.task-schedule-field { display: grid; gap: 5px; min-width: 0; }
.task-schedule-field:has(.ma-validation-field-message) > .task-schedule-error { display: none; }
#editor.editor-workspace .task-schedule .task-due-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,155px),1fr)); gap: 12px; align-items: start; }
/* Share the caption and input rows when a label wraps or a field has an error. */
@supports (grid-template-rows: subgrid) {
  #editor .task-due-grid > .task-schedule-field,
  #editor .task-schedule .task-due-grid > label.field { display: grid; grid-row: span 3; grid-template-rows: subgrid; align-self: stretch; row-gap: 5px; }
  #editor .task-due-grid > .task-schedule-field > label.field { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 5px; }
  #editor .task-schedule .task-due-grid input { grid-row: 2; }
}
.task-schedule .duplicate-recurrence, .task-schedule .recurrence-controls { display: grid; gap: 12px; min-width: 0; }
.task-schedule .task-due-field > .helper, .task-schedule .recurrence-weekdays, .task-schedule .task-repeat-summary { margin: 0; }
.task-schedule .task-repeat-summary { border-inline-start: 3px solid var(--teal); background: var(--teal-soft); padding: 10px 12px; font-size: 14px; line-height: 1.55; }
.task-schedule .task-schedule-error { color: var(--danger,var(--ink)); font-weight: 500; }
.task-schedule [hidden] { display: none !important; }
.editor-core-properties > :is(.editor-due-row,.event-dates,.event-date-help) { grid-column: 1 / -1; }
:is(#editor,#entry-editor) .editor-core-properties .task-due-grid, :is(#editor,#entry-editor) .editor-core-properties .event-dates { gap: 16px; }
:is(#editor,#entry-editor) .editor-core-properties .task-due-field > .helper { margin: 6px 0 0; }
:is(#editor,#entry-editor) .editor-core-properties .event-date-help { margin: 0; }
:is(#editor,#entry-editor).editor-workspace .rich-toolbar { gap: 0; padding: 4px 5px; flex-wrap: wrap; border-radius:var(--radius-control,6px) var(--radius-control,6px) 0 0; }
:is(#editor,#entry-editor).editor-workspace .rich-toolbar button { min-height: 36px; font-size: 13px; padding: 5px 7px; }
:is(#editor,#entry-editor).editor-workspace .rich-toolbar .icon { width: 18px; height: 18px; }
:is(#editor,#entry-editor).editor-workspace .rich-editor { height: 160px; min-height: 158px; max-height: none; padding: 14px; font-size: 14px; line-height: 1.7; border-radius:0 0 var(--radius-control,6px) var(--radius-control,6px); }
:is(#editor,#entry-editor).editor-workspace .rich-editor > p:first-child { margin-top: 0; }
:is(#editor,#entry-editor).editor-workspace .rich-editor img { max-width: 100%; height: auto; }
:is(#editor,#entry-editor) .save-status { margin-top: 2px; font-size: 12px; }
.editor-properties > h3 { display: none; }
:is(#editor,#entry-editor).editor-workspace .editor-section { border: 0; border-bottom: 1px solid var(--line); border-radius:0; background: transparent; padding: 0; }
:is(#editor,#entry-editor).editor-workspace .editor-section > summary,
:is(#editor,#entry-editor).editor-workspace .editor-advanced > summary {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 15px 0;
  list-style: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
:is(#editor,#entry-editor) .editor-section > summary::-webkit-details-marker,
:is(#editor,#entry-editor) .editor-advanced > summary::-webkit-details-marker { display: none; }
:is(#editor,#entry-editor).editor-workspace .editor-advanced > summary::before { content: none; }
:is(#editor,#entry-editor) .editor-section > summary > span, :is(#editor,#entry-editor) .editor-advanced > summary > span { flex: 1; min-width: 0; }
:is(#editor,#entry-editor) .editor-section > summary > .icon { width: 21px; height: 21px; color: var(--ink); }
:is(#editor,#entry-editor) .editor-section > summary .editor-chevron, :is(#editor,#entry-editor) .editor-advanced > summary .editor-chevron { width: 17px; height: 17px; flex: none; }
:is(#editor,#entry-editor) .editor-section[open] > summary .editor-chevron, :is(#editor,#entry-editor) .editor-advanced[open] > summary .editor-chevron { transform: rotate(180deg); }
:is(#editor,#entry-editor) .editor-section summary small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
:is(#editor,#entry-editor)[data-editor-mode=panel] :is(.editor-subtasks,.editor-attachments) > summary > span { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
:is(#editor,#entry-editor)[data-editor-mode=panel] :is(.editor-subtasks,.editor-attachments) summary small { display: inline; margin-top: 0; }
:is(#editor,#entry-editor)[data-editor-mode=panel] :is(.editor-subtasks,.editor-attachments) summary small::before { content: '· '; }
:is(#editor,#entry-editor) .editor-section-body { display: flex; flex-direction: column; gap: 18px; padding: 0 0 20px; }
:is(#editor,#entry-editor) .editor-section-body > .field > span:first-child:empty { display: none; }
:is(#editor,#entry-editor) .editor-project .editor-section-body { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
:is(#editor,#entry-editor) .editor-project .editor-section-body > :is(.task-progress-editor,.check-field,details), :is(#editor,#entry-editor) .editor-project label:has([name=project_id]), :is(#editor,#entry-editor) .editor-project label:has([name=location]) { grid-column: 1 / -1; }
:is(#editor,#entry-editor).editor-workspace .task-progress-editor { margin: 0; padding: 0; border: 0; background: transparent; }
:is(#editor,#entry-editor) .task-progress-heading { font-size: 14px; }
:is(#editor,#entry-editor).editor-workspace .task-progress-editor input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(to right,var(--teal) 0 var(--progress),var(--line) var(--progress) 100%); }
:is(#editor,#entry-editor).editor-workspace .task-progress-editor input[type=range]::-moz-range-track { background: var(--line); }
:is(#editor,#entry-editor).editor-workspace .task-progress-editor input[type=range]::-moz-range-progress { background: var(--teal); }
:is(#editor,#entry-editor) .task-progress-scale, :is(#editor,#entry-editor) .task-progress-editor .helper { font-size: 12px; }
:is(#editor,#entry-editor).editor-workspace .editor-advanced { padding: 0; margin: 0; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius:0; }
:is(#editor,#entry-editor).editor-workspace .advanced-body { padding: 0; display: flex; flex-direction: column; gap: 0; }
:is(#editor,#entry-editor) .advanced-body > .fields-two:empty { display: none; }
:is(#editor,#entry-editor) .editor-links .links-options { max-height: 230px; overflow: auto; }
:is(#editor,#entry-editor) .editor-subtasks > .editor-section-body > .field { gap: 12px; }
:is(#editor,#entry-editor) .subtasks-editor { display: block; }
:is(#editor,#entry-editor) .subtask-edit { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
:is(#editor,#entry-editor) .subtask-edit .subtask-title { flex: 1; width: auto; min-width: 150px; }
:is(#editor,#entry-editor) .subtask-edit .subtask-done { width: 22px; height: 22px; flex: none; }
:is(#editor,#entry-editor) .subtask-edit .subtask-assignee { width: 100%; }
:is(#editor,#entry-editor) .subtask-options { flex: none; position: relative; margin-left: auto; }
:is(#editor,#entry-editor) .subtask-options > summary { width: 36px; min-height: 36px; padding: 7px; gap: 0; }
:is(#editor,#entry-editor) .subtask-options > summary > :is(span,.editor-chevron) { display: none; }
:is(#editor,#entry-editor) .subtask-options .editor-section-body { position: absolute; width: 260px; right: 0; top: 38px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius:var(--radius-card,8px); box-shadow: 0 8px 24px #14203520; z-index: 3; }
:is(#editor,#entry-editor).editor-workspace .editor-foot { display: flex; flex: none; justify-content: flex-end; gap: 12px; padding: 19px 26px; border-top: 1px solid var(--line); background: var(--surface); }
:is(#editor,#entry-editor) .editor-foot .btn { min-width: 106px; }
.editor-supplements { padding: 0 26px 24px; }
.editor-supplements:empty { display: none; }
:is(#editor,#entry-editor) .editor-addon .panel { padding: 0; margin: 0; border: 0; background: transparent; box-shadow: none; }
:is(#editor,#entry-editor) .editor-addon .panel-header h3, :is(#editor,#entry-editor) .editor-addon [data-pl-editor] > h3 { display: none; }
:is(#editor,#entry-editor) .editor-addon .panel-header { margin-bottom: 10px; }
:is(#editor,#entry-editor) .editor-addon :is(.co-comment-form,.mail-source-options) { min-width: 0; }
/* Full-page mode uses the same mounted form and the existing navigation. */
body.editor-page-open .app-shell .main { display: none; }
body.editor-page-open .sidebar { z-index: 40; }
body.editor-page-open .app-shell :is(.fab,.bottom-nav,.create-menu.mobile) { display: none; }
:is(#editor,#entry-editor).editor-workspace[data-editor-mode=page] { left: var(--editor-nav-width,76px); width: auto; background: var(--canvas); border-left: 0; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-head { padding: 28px 32px 24px; background: var(--canvas); border-bottom: 0; align-items: center; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-back-line { display: block; flex-basis: 100%; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-back { display: inline-flex; padding: 0; margin-bottom: 4px; font-size: 14px; color: var(--ink); }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-head h2 { font-size: 38px; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-head-actions { gap: 12px; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-page-actions { display: flex; gap: 12px; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-close-icon, :is(#editor,#entry-editor)[data-editor-mode=page] .editor-foot { display: none; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-body { display: grid; grid-template-columns: minmax(0,1fr) clamp(300px,29vw,430px); gap: 28px; padding: 16px 32px 24px; align-items: start; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-primary { gap: 22px; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-description .rich-editor { min-height: 220px; }
:is(#editor,#entry-editor)[data-editor-mode=page][data-item-type=note] .rich-editor { min-height: 400px; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-properties { padding: 20px; border: 1px solid var(--line); border-radius:var(--radius,10px); background: var(--surface); }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-properties > h3 { display: block; margin: 0 0 20px; font: 700 22px/1.2 Georgia,serif; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-core-properties { margin-bottom: 20px; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-core-properties { grid-template-columns: 1fr; }
:is(#editor,#entry-editor)[data-editor-mode=page][data-item-type=task] .task-due-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-label-short { display: block; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-label-long { display: none; }
:is(#editor,#entry-editor)[data-editor-mode=page] .task-due-grid { gap: 8px; }
:is(#editor,#entry-editor).editor-workspace[data-editor-mode=page] .task-due-grid input { padding: 9px 7px; font-size: 13px; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-project > summary, :is(#editor,#entry-editor)[data-editor-mode=page] .editor-advanced > summary { display: none; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-project { border-bottom: 0; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-advanced { border: 0; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-subtasks > summary > span { display: flex; justify-content: space-between; align-items: center; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-subtasks { border-bottom: 0; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-subtasks .editor-section-body { padding: 0 16px 10px; border: 1px solid var(--line); border-radius:var(--radius-control,6px); background: var(--surface); }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-primary > .editor-section:not(.editor-subtasks) { padding: 0 16px; border: 1px solid var(--line); border-radius:var(--radius-control,6px); background: var(--surface); }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-subtasks .subtask-title { border: 0; background: transparent; min-height: 36px; }
:is(#editor,#entry-editor)[data-editor-mode=page] .editor-supplements { margin-right: calc(clamp(300px,29vw,430px) + 28px); padding: 0 32px 28px; }
@media(min-width:1600px) { body { --editor-dock-width: 560px; } }
@media(max-width:1100px) {
  :is(#editor,#entry-editor).editor-workspace { left: var(--editor-nav-width,76px); width: auto; }
  :root[data-theme] :is(#editor,#entry-editor).editor-workspace { left: var(--editor-nav-width,76px); width: auto; }
  body.editor-docked .app-shell .main { visibility: hidden; margin-right: 0; }
  :is(#editor,#entry-editor)[data-editor-mode=page] .editor-body { grid-template-columns: minmax(0,1fr); }
  :is(#editor,#entry-editor)[data-editor-mode=page] .editor-supplements { margin-right: 0; padding: 0 32px 24px; }
  :is(#editor,#entry-editor) .editor-properties { margin-top: 0; }
}
@media(max-width:700px) {
  :is(#editor,#entry-editor).editor-workspace { left: 0; border: 0; }
  :root[data-theme] :is(#editor,#entry-editor).editor-workspace { left: 0; width: auto; border: 0; }
  body.editor-docked .app-shell :is(.bottom-nav,.fab,.create-menu.mobile) { display: none; }
  :is(#editor,#entry-editor).editor-workspace .editor-head { padding: 18px 18px 14px; gap: 8px; }
  :is(#editor,#entry-editor).editor-workspace .editor-head h2 { font-size: 25px; }
  :is(#editor,#entry-editor).editor-workspace .editor-head-actions { gap: 0; }
  :is(#editor,#entry-editor).editor-workspace .editor-body { padding: 20px 18px 16px; }
  :is(#editor,#entry-editor).editor-workspace .editor-foot { padding: 14px 18px max(14px,env(safe-area-inset-bottom)); }
  .editor-supplements, :is(#editor,#entry-editor)[data-editor-mode=page] .editor-supplements { padding: 0 18px 20px; }
  :is(#editor,#entry-editor)[data-editor-mode=page] .editor-head .editor-page-actions { flex-basis: 100%; }
  :is(#editor,#entry-editor)[data-editor-mode=page] .editor-head-actions { flex-wrap: wrap; }
  :is(#editor,#entry-editor).editor-workspace[data-editor-mode=page] .editor-head { display: grid; grid-template-columns: minmax(0,1fr) 40px 40px; gap: 8px; align-items: start; }
  :is(#editor,#entry-editor)[data-editor-mode=page] .editor-head .editor-heading { grid-column: 1; grid-row: 2; }
  :is(#editor,#entry-editor)[data-editor-mode=page] .editor-back-line { grid-column: 1 / -1; }
  :is(#editor,#entry-editor).editor-workspace[data-editor-mode=page] .editor-head-actions { display: contents; }
  :is(#editor,#entry-editor)[data-editor-mode=page] .editor-menu { grid-column: 2; grid-row: 2; }
  :is(#editor,#entry-editor)[data-editor-mode=page] [data-editor-action=expand] { grid-column: 3; grid-row: 2; }
  :is(#editor,#entry-editor)[data-editor-mode=page] .editor-page-actions { grid-column: 1 / -1; justify-self: end; }
  :is(#editor,#entry-editor).editor-workspace[data-editor-mode=page] .editor-foot { display: none; }
  :is(#editor,#entry-editor)[data-editor-mode=page] .editor-page-actions .btn { padding: 8px 12px; min-height: 40px; }
  :is(#editor,#entry-editor)[data-editor-mode=page] .editor-properties { padding: 18px; }
  :is(#editor,#entry-editor)[data-editor-mode=page][data-item-type=task] .task-due-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  :is(#editor,#entry-editor)[data-editor-mode=page] .editor-head h2 { font-size: 28px; }
  :is(#editor,#entry-editor)[data-editor-mode=page][data-item-type=note] .rich-editor { min-height: 260px; }
}
@media(prefers-reduced-motion:reduce) { :is(#editor,#entry-editor) .editor-chevron { transition: none; } }

:is(#editor,#entry-editor)[hidden]{display:none!important}
body.entry-docked .app-shell .main{margin-right:var(--editor-dock-width)}
@media(max-width:1100px){body.entry-docked .app-shell .main{margin-right:0}}

.note-conflict-dialog{width:min(1100px,calc(100% - 24px));max-height:calc(100dvh - 24px)}
.note-conflict-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.note-conflict-columns section{min-width:0}.note-conflict-columns .rich-editor{max-height:45vh;overflow:auto}.rich-editor table{border-collapse:collapse;max-width:100%}.rich-editor td,.rich-editor th{border:1px solid var(--line);padding:6px;overflow-wrap:anywhere}
@media(max-width:700px){.note-conflict-columns{grid-template-columns:minmax(0,1fr)}}
