/* Shared list feedback: keep the same radius before, during and after hover. */
:is(.task-row, .simple-row, .project-list-row, .meeting-row,
    .project-linked-row, .meeting-linked-row, .meeting-area-option,
    .meeting-pick-item, .person-option, .subtask-row) {
  border-radius: 12px;
}
:is(.task-row, .simple-row, .project-list-row, .meeting-row,
    .project-linked-row, .meeting-area-option, .meeting-pick-item):hover {
  background: var(--bg);
}
.task-open, .meeting-linked-open { border-radius: 12px; }

/* Timeline: neutral surfaces without changing date/grid or drag geometry. */
.schedule-grid {
  --weekend-background: linear-gradient(to right, transparent var(--weekdays-width), #EEEFF2 var(--weekdays-width));
}
.schedule-scroll { border-radius: 16px; }
.schedule-header, .schedule-header .schedule-labels { background: var(--bg); }
.schedule-months span, .schedule-days span { border-color: var(--line); }
.schedule-months span { color: var(--muted); }
.schedule-row { border-color: var(--line); }
.schedule-row.is-project .schedule-labels { background: #F8F9FA; }
.schedule-row:hover .schedule-labels { background: #EEEFF2; }
.schedule-branch { border-color: #D3D6DC; }
.schedule-track {
  background-image: repeating-linear-gradient(to right, transparent 0,
    transparent calc(var(--tick-width) - 1px), #E4E6E9 calc(var(--tick-width) - 1px),
    #E4E6E9 var(--tick-width)), var(--weekend-background);
}
.schedule-bar { background: #CDD1D8; border-color: #969DA8; border-radius: 6px; }
.schedule-bar > .schedule-progress-fill { background: #626A77; }
.schedule-bar.project-bar, .schedule-bar.project-bar::before,
.schedule-bar.project-bar::after { background: var(--ink); }
.schedule-today-line { background: var(--editorial-focus); }
.schedule-no-date, .schedule-reorder-handle { color: var(--muted); }
.schedule-resize::after { background: #434A56; }
.schedule-bar.is-dragging { box-shadow: 0 3px 10px #20212430; }
.schedule-drag-feedback, .schedule-reorder-ghost {
  background: var(--ink); color: #FFF; box-shadow: 0 4px 16px #20212420;
}

/* Canvas chrome and native shapes only; uploaded images/PDF pixels keep their colors. */
.canvas-stage {
  background-color: var(--editorial-canvas);
  background-image: radial-gradient(circle, #C9CDD4 .9px, transparent .9px);
}
.canvas-edge-line, .canvas-edge-preview { stroke: #747C88; }
#canvas-arrowhead path { fill: #747C88; stroke: #747C88; }
.canvas-zoom button, .canvas-history button, .canvas-hint { color: var(--muted); }
.canvas-empty > svg { stroke: #969DA8; }
.canvas-node.is-selected::after, .canvas-node:focus-visible::after,
.canvas-node.is-connecting::after, .canvas-node.is-connecting-target::after {
  border-color: var(--editorial-focus);
}
.canvas-shape-svg { fill: var(--editorial-paper); stroke: #969DA8; }
.canvas-circle .canvas-shape-svg { fill: #E4E6E9; }
.canvas-triangle .canvas-shape-svg { fill: #EEEFF2; stroke: #969DA8; }
.canvas-port { background: var(--editorial-paper); border-color: #747C88; }
.canvas-port.is-port-target { background: var(--editorial-focus); box-shadow: 0 0 0 4px #456FB530; }
.canvas-resize { border-color: var(--editorial-focus); }
.canvas-task, .canvas-note { border-color: var(--line); background: var(--editorial-paper); box-shadow: 0 2px 8px #20212408; }
.canvas-card-handle, .canvas-note .canvas-card-handle { border-color: var(--line); background: var(--bg); }
.canvas-card-handle > span, .canvas-card-handle button, .canvas-card-meta { color: var(--muted); }
.canvas-card-handle button:hover { background: #E4E6E9; }
.canvas-rich-body { color: #43474F; }
.canvas-rich-body strong { color: var(--ink); }
.canvas-inspector-heading button, .canvas-inspector label,
.canvas-inspector p { color: var(--muted); }
.canvas-inspector textarea, .canvas-inspector select { background: var(--editorial-paper); }
#canvas-remove { color: var(--danger); }
.saved-board { border-color: var(--line); }
.saved-board:hover { border-color: #969DA8; box-shadow: 0 5px 17px #20212408; }
.board-preview {
  background-color: var(--bg);
  background-image: radial-gradient(circle, #CDD1D8 .7px, transparent .7px);
  border-color: var(--line);
}
.board-preview g > rect, .board-preview g > polygon, .board-preview g > ellipse {
  stroke: #969DA8; fill: var(--editorial-paper);
}
.board-preview .board-mini-circle > ellipse { fill: #E4E6E9; }
.board-preview .board-mini-triangle > polygon { fill: #EEEFF2; stroke: #969DA8; }
.board-preview .board-mini-task > rect { fill: #F4F5F7; }
.board-preview .board-mini-note > rect { fill: var(--editorial-paper); stroke: #969DA8; }
.board-mini-edge { stroke: #747C88; }
.board-mini-text { stroke: #A2A8B2; }
.board-preview-empty > svg { stroke: #969DA8; }
.board-preview-empty span, .board-card-date, .board-open-arrow,
.board-card-footer, .board-card-footer button, .canvas-back,
.canvas-rename-current { color: var(--muted); }
.board-card-footer { border-color: var(--line); }
.canvas-heading-divider { color: #A2A8B2; }
.canvas-name-dialog input { background: var(--editorial-paper); }
.canvas-segment-handle circle, .canvas-end-handle circle {
  fill: var(--editorial-paper); stroke: #747C88;
}
.canvas-segment-handle:hover circle, .canvas-segment-handle:focus circle,
.canvas-end-handle:hover circle:not(.canvas-handle-hit), .canvas-end-handle:focus circle:not(.canvas-handle-hit) {
  fill: #E7F0FF; stroke: var(--editorial-focus);
}
.canvas-node-preview { fill: #FCFCFC30; stroke: #969DA8; }
.canvas-inline-fields label > span, .canvas-inline-people legend,
.canvas-inline-description-label { color: var(--muted); }
.canvas-inline-fields input:not([type=checkbox]), .canvas-inline-fields select,
.canvas-inline-fields textarea { border-color: #D3D6DC; background: var(--editorial-paper); }
.canvas-inline-fields :is(input, select, textarea):focus { outline-color: var(--editorial-focus); }
.canvas-inline-description .description-toolbar { border-color: var(--line); }
.canvas-inline-rich .tiptap:focus-visible,
.canvas-inline-rich .ProseMirror-selectednode { outline-color: var(--editorial-focus); }
.editorial-ui :is(#description-editor, .is-body-editing .canvas-inline-rich) .tiptap li::marker {
  color: var(--muted);
}
.editorial-ui :is(#description-editor, .is-body-editing .canvas-inline-rich) .ProseMirror-selectednode {
  outline-color: var(--editorial-focus);
}
:is(#description-editor, .canvas-inline-rich) .description-image { background: var(--bg); }
:is(#description-editor, .canvas-inline-rich) .image-remove { background: #FCFCFCF5; color: var(--muted); }
.canvas-image { background: var(--editorial-paper); box-shadow: 0 2px 8px #20212412; }
.canvas-archive-badge { border-color: #D3D6DC; background: #EEEFF2; color: var(--muted); }
.canvas-inline-summary dd { color: #43474F; }
.canvas-export-shade { fill: var(--ink); }
.canvas-export-region { stroke: var(--editorial-focus); }
.canvas-export-panel { border-color: var(--line); box-shadow: 0 2px 10px #20212412; }
.canvas-export-panel p, .canvas-export-panel [role=status] { color: var(--muted); }
.canvas-pdf { border-color: #D3D6DC; background: var(--editorial-paper); box-shadow: 0 2px 8px #20212412; }
.canvas-pdf-handle, .pdf-state { background: var(--editorial-paper); }
.pdf-file-symbol { border-color: #D3D6DC; color: var(--muted); }
.pdf-modes { background: #EEEFF2; }
.pdf-modes button, .pdf-file-actions button, .pdf-file-actions a { color: var(--muted); }
.pdf-modes button[aria-pressed=true] { background: var(--editorial-paper); color: var(--ink); box-shadow: 0 1px 4px #2021241A; }
.pdf-file-actions button:hover, .pdf-file-actions a:hover { background: #EEEFF2; }
.pdf-pages { background: #E4E6E9; }
.pdf-page { box-shadow: 0 2px 6px #20212420; }
.pdf-page-placeholder { color: #969DA8; }
.pdf-state { color: var(--muted); }
.canvas-pdf[data-pdf-error=true] .pdf-state { color: var(--danger); }
.pdf-storage-dialog { border-color: var(--line); background: var(--editorial-paper); color: var(--ink); }
.pdf-storage-dialog::backdrop { background: #20212455; }
.pdf-storage-dialog header button, .pdf-storage-summary span, .pdf-storage-note,
.pdf-storage-list span, .pdf-storage-list small, .pdf-storage-empty { color: var(--muted); }
.pdf-storage-summary, .pdf-storage-list li { border-color: var(--line); }
.pdf-storage-summary strong { color: var(--ink); }

/* Both item editors span the entire content pane. Insets belong to the text
   and controls, not to an outer sheet or a centered width-limited wrapper. */
#task-dialog { --editorial-document-inset: 32px; }
#task-dialog #task-form > .form-body {
  display: flex; flex-direction: column;
  padding: 0; background: var(--editorial-paper); scrollbar-gutter: auto;
}
#task-dialog #task-form .item-description {
  flex: 1 0 auto; width: 100%; max-width: none; min-height: 0; margin: 0;
  padding: 24px 0 32px; border: 0; border-radius: 0;
}
#task-dialog .editorial-item-appearance > .editorial-reading { margin: 0; }
#task-dialog :is(.description-label, .description-shell, .description-status) {
  width: 100%; max-width: none; margin-left: 0; margin-right: 0;
}
#task-dialog .description-label { padding: 0 var(--editorial-document-inset); }
#task-dialog .description-label button { padding-left: 0; padding-right: 0; }
#task-dialog .description-toolbar {
  width: 100%; padding: 8px var(--editorial-document-inset);
  border-radius: 0; margin-bottom: 12px;
}
#task-dialog :is(.description-viewport, #description-editor) { width: 100%; max-width: none; }
#task-dialog #description-editor .tiptap {
  box-sizing: border-box; width: 100%; max-width: none;
  padding: 16px var(--editorial-document-inset) 24px; border-radius: 0; margin: 0;
}
#task-dialog #description-editor .tiptap:focus-visible {
  outline-offset: -2px;
}
#task-dialog :is(.description-status, #form-error) { padding: 0 var(--editorial-document-inset); }
#task-dialog .item-subtasks { padding: 24px var(--editorial-document-inset); }
#task-dialog .item-subtasks[hidden] { display: none; }
#task-dialog .editorial-item-inspector .item-subtasks {
  min-width: 0; margin: 24px 0 0; padding: 24px 0 0;
  border-top: 1px solid var(--line);
}
#task-dialog .editorial-item-inspector .item-subtasks.is-empty {
  justify-content: flex-start; margin-top: 24px; padding-top: 16px;
  border-top: 1px solid var(--line);
}
.editorial-item-inspector .item-subtasks .project-section-heading { margin-bottom: 12px; }
.editorial-item-inspector .item-subtasks h3 { margin-top: 4px; font-size: 14px; line-height: 20px; }
.editorial-item-inspector .item-subtasks .project-linked-row { min-width: 0; }
.editorial-item-inspector .item-subtasks .project-linked-open { gap: 8px; padding: 11px 4px 11px 10px; }
.editorial-item-inspector .item-subtasks .project-linked-copy strong { font-size: 11px; line-height: 16px; }
.editorial-item-inspector .item-subtasks .project-linked-copy small { font-size: 10px; line-height: 16px; }
.editorial-item-inspector .item-subtasks .project-linked-open > svg { width: 12px; align-self: center; }
.editorial-item-inspector .item-subtasks .project-unlink { flex: 0 0 32px; width: 32px; height: 36px; margin-right: 4px; }
.editorial-item-inspector .item-subtasks:not([hidden]) + .editorial-item-appearance { margin-top: 20px; padding-top: 20px; }
.editorial-item-inspector .item-meetings {
  margin-top: 24px; padding: 24px 0 0; border: 0; border-top: 1px solid var(--line);
  border-radius: 0; background: transparent;
}
.editorial-item-inspector .item-meetings-heading {
  align-items: stretch; flex-direction: column; gap: 12px;
}
.editorial-item-inspector .item-meetings-heading h3 { font-size: 12px; line-height: 18px; }
.editorial-item-inspector .item-meetings-heading button { width: 100%; min-height: 44px; }
.editorial-item-inspector .item-meetings>p { font-size: 12px; line-height: 20px; }
.editorial-item-inspector .item-meeting-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 16px; gap: 4px 8px;
  min-width: 0; padding: 12px; overflow-wrap: anywhere;
}
.editorial-item-inspector .item-meeting-row strong { grid-column: 1; }
.editorial-item-inspector .item-meeting-row small { grid-column: 1; grid-row: 2; }
.editorial-item-inspector .item-meeting-row svg { grid-column: 2; grid-row: 1 / 3; align-self: center; }
@media (min-width: 960px) and (max-width: 1099px) {
  #task-form { grid-template-columns: minmax(0, 1fr) 320px; }
  #task-form > .editorial-item-inspector {
    display: block; position: static; width: auto; max-width: none;
    grid-column: 2; grid-row: 2; box-shadow: none;
  }
  #editorial-details-toggle { display: none; }
}
@media (max-width: 1099px) {
  #task-dialog { --editorial-document-inset: 24px; }
}
@media (max-width: 767px) {
  #task-dialog { --editorial-document-inset: 20px; }
  #task-dialog #task-form .item-description { padding: 16px 0 24px; }
}

/* iOS zooms focused fields below 16px. Cover touch devices in either
   orientation, including editors moved into dialogs or canvas cards.
   Keep native pinch zoom available through the existing viewport settings. */
@media (max-width: 1023px), (any-pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]):not([type=button]):not([type=submit]):not([type=reset]),
  textarea,
  select {
    font-size: 16px !important;
  }

  [contenteditable=""],
  [contenteditable="true"],
  [contenteditable="plaintext-only"] {
    font-size: max(16px, var(--editorial-reading-size, 16px)) !important;
  }
}
