/**
 * Text written in Markdown on the task pages (descriptions and comments),
 * rendered on the server. Colours follow the text's own, so it reads the
 * same light and dark.
 */
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }
.markdown p, .markdown ul, .markdown ol, .markdown blockquote, .markdown pre, .markdown table { margin: 0.5em 0; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4 { margin: 0.9em 0 0.35em; font-weight: 600; line-height: 1.3; }
.markdown h1 { font-size: 1.25em; }
.markdown h2 { font-size: 1.125em; }
.markdown h3, .markdown h4 { font-size: 1em; }
.markdown ul { list-style: disc; padding-inline-start: 1.4em; }
.markdown ol { list-style: decimal; padding-inline-start: 1.6em; }
.markdown li + li { margin-top: 0.2em; }
.markdown li > ul, .markdown li > ol { margin: 0.2em 0; }
.markdown a { text-decoration: underline; text-underline-offset: 2px; color: #0060c2; }
.markdown strong { font-weight: 600; }
.markdown code { font-size: 0.875em; padding: 0.1em 0.35em; border-radius: 0.25rem; background: rgb(127 127 127 / 0.15); }
.markdown pre { padding: 0.6em 0.8em; border-radius: 0.375rem; background: rgb(127 127 127 / 0.12); overflow-x: auto; direction: ltr; text-align: left; }
.markdown pre code { padding: 0; background: none; }
.markdown blockquote { padding-inline-start: 0.8em; border-inline-start: 3px solid rgb(127 127 127 / 0.35); opacity: 0.85; }
.markdown hr { margin: 0.8em 0; border-color: rgb(127 127 127 / 0.25); }
.markdown table { border-collapse: collapse; font-size: 0.9375em; }
.markdown th, .markdown td { padding: 0.3em 0.6em; border: 1px solid rgb(127 127 127 / 0.25); }

/** A checklist: its items carry their box in place of the bullet. */
.markdown li:has(> input[type="checkbox"]:first-child) { list-style: none; margin-inline-start: -1.4em; }
.markdown li > input[type="checkbox"]:first-child { margin-inline-end: 0.45em; vertical-align: -0.1em; border-radius: 0.25rem; }
.markdown li > input[type="checkbox"]:first-child:not(:disabled) { cursor: pointer; }
.markdown li:has(> input[type="checkbox"]:first-child:checked) { text-decoration: line-through; opacity: 0.6; }

/**
 * `<markdown-editor>` (resources/js/jasmine/markdown-editor.js): a toolbar
 * over the text, both in the box an input would be.
 */
markdown-editor { display: block; min-width: 0; border: 1px solid rgb(203 213 225); border-radius: 0.5rem; background: white; overflow: hidden; }
markdown-editor:focus-within { border-color: #0073ea; box-shadow: 0 0 0 1px #0073ea; }
.dark markdown-editor { border-color: rgb(255 255 255 / 0.1); background: rgb(31 41 55); }
.markdown-editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.125rem; padding: 0.25rem 0.375rem; border-bottom: 1px solid rgb(127 127 127 / 0.15); }
.markdown-editor-toolbar button { display: inline-flex; align-items: center; justify-content: center; width: 1.875rem; height: 1.75rem; border-radius: 0.375rem; color: rgb(100 116 139); cursor: pointer; font-size: 0.95rem; }
.markdown-editor-toolbar button:hover { background: rgb(127 127 127 / 0.12); color: inherit; }
.markdown-editor-toolbar button.is-active { background: rgb(0 115 234 / 0.12); color: #0060c2; }
.markdown-editor-gap { width: 1px; height: 1.125rem; margin: 0 0.25rem; background: rgb(127 127 127 / 0.25); }
.markdown-editor-toolbar > [data-slot] { display: inline-flex; align-items: center; justify-content: center; width: 1.875rem; height: 1.75rem; border-radius: 0.375rem; color: rgb(100 116 139); cursor: pointer; font-size: 0.95rem; }
.markdown-editor-toolbar > [data-slot]:hover { background: rgb(127 127 127 / 0.12); color: inherit; }
.markdown-editor-footer { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0 0.5rem 0.5rem; }
.markdown-editor-link { display: flex; gap: 0.375rem; padding: 0.375rem; border-bottom: 1px solid rgb(127 127 127 / 0.15); }
.markdown-editor-link[hidden] { display: none; }
.markdown-editor-link input { flex: 1; min-width: 0; padding: 0.25rem 0.5rem; font-size: 0.875rem; border: 1px solid rgb(203 213 225); border-radius: 0.375rem; background: transparent; }
.markdown-editor-link button { padding: 0.25rem 0.625rem; font-size: 0.8125rem; border-radius: 0.375rem; background: rgb(127 127 127 / 0.12); cursor: pointer; }
.markdown-editor-body { min-height: 5rem; max-height: 28rem; overflow-y: auto; padding: 0.5rem 0.75rem; font-size: 15px; outline: none; }
markdown-editor[compact] .markdown-editor-body { min-height: 2.75rem; }
markdown-editor[tall] .markdown-editor-body { min-height: 18rem; max-height: 40rem; }
.markdown-editor-body p.is-editor-empty:first-child::before { content: attr(data-placeholder); float: inline-start; height: 0; color: rgb(148 163 184); pointer-events: none; }

/** TipTap's checklist: each item a box beside its text. */
.markdown ul[data-type="taskList"] { list-style: none; padding-inline-start: 0.25em; }
.markdown ul[data-type="taskList"] li { display: flex; align-items: flex-start; gap: 0.45em; }
.markdown ul[data-type="taskList"] li > label { flex: none; margin-top: 0.2em; }
.markdown ul[data-type="taskList"] li > label input { border-radius: 0.25rem; cursor: pointer; }
.markdown ul[data-type="taskList"] li > div { flex: 1; min-width: 0; }
.markdown ul[data-type="taskList"] li > div > p { margin: 0; }
.markdown ul[data-type="taskList"] li[data-checked="true"] > div { text-decoration: line-through; opacity: 0.6; }
.markdown-editor-body table p { margin: 0; }

/** Raw mode: the Markdown itself, and the toolbar's formats off. */
.markdown-editor-raw-toggle { margin-inline-start: auto; }
.markdown-editor-toolbar button:disabled { opacity: 0.35; cursor: default; background: none; }
.markdown-editor-raw { display: block; width: 100%; min-height: 8rem; padding: 0.5rem 0.75rem; border: 0; background: transparent; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; line-height: 1.6; resize: vertical; outline: none; box-shadow: none; }
.markdown-editor-raw:focus { box-shadow: none; }
.markdown-editor-raw[hidden], .markdown-editor-body[hidden] { display: none; }
markdown-editor[compact] .markdown-editor-raw { min-height: 3.25rem; }
markdown-editor[tall] .markdown-editor-raw { min-height: 18rem; }
