/* V231: source Markdown stays editable as plain text, but the Notebook editor
   receives a synchronized syntax-color layer. No rendered HTML is placed into
   the editable field and no external CDN/library is used. */
.autosave-status{font-size:12px;margin-left:8px}
.autosave-status[data-state="saved"]{color:#006000}
.autosave-status[data-state="dirty"]{color:#804000}
.autosave-status[data-state="saving"]{color:#000080}
.autosave-status[data-state="error"]{color:#a00000}
.note-edit-toolbar{display:flex;align-items:center;gap:6px;margin-top:6px}
.note-export-actions{display:flex;gap:5px;margin:6px 0;flex-wrap:wrap}
textarea[data-live-markdown-editor]{display:block;width:100%;box-sizing:border-box;font-family:Consolas,"Courier New",monospace;white-space:pre-wrap}

.markdown-syntax-editor{
  --md-syntax-scrollbar-width:0px;
  --md-syntax-content-top:6px;
  --md-syntax-content-right:6px;
  --md-syntax-content-bottom:6px;
  --md-syntax-content-left:6px;
  --md-syntax-heading:#16713a;
  --md-syntax-heading-marker:#24924d;
  --md-syntax-list:#8a6112;
  --md-syntax-link:#075db8;
  --md-syntax-code:#9b2f5f;
  --md-syntax-strong:#8b2a76;
  --md-syntax-emphasis:#7351a3;
  --md-syntax-strike:#8b4c27;
  --md-syntax-quote:#60713f;
  --md-syntax-checkbox:#927000;
  position:relative;
  width:100%;
  height:100%;
  min-height:180px;
  overflow:hidden;
  background:var(--input-bg,#fff);
  color:var(--input-text,#111);
}

.markdown-syntax-highlight{
  position:absolute;
  z-index:1;
  inset:0 var(--md-syntax-scrollbar-width) 0 0;
  margin:0;
  padding:0;
  overflow:hidden;
  border:0;
  background:var(--input-bg,#fff);
  color:var(--input-text,#111);
  pointer-events:none;
  font-family:Consolas,"Courier New",monospace;
  font-size:inherit;
  line-height:1.35;
  white-space:pre-wrap;
  overflow-wrap:break-word;
  word-break:break-word;
  tab-size:4;
}

.markdown-syntax-highlight code{
  display:block;
  width:100%;
  min-height:100%;
  padding:var(--md-syntax-content-top) var(--md-syntax-content-right) var(--md-syntax-content-bottom) var(--md-syntax-content-left);
  box-sizing:border-box;
  font:inherit;
  white-space:inherit;
  overflow-wrap:inherit;
  word-break:inherit;
  tab-size:inherit;
  will-change:transform;
}

textarea.markdown-syntax-input{
  position:relative;
  z-index:2;
  display:block;
  width:100%;
  height:100%;
  min-height:180px;
  margin:0;
  padding:4px;
  overflow:auto;
  resize:none;
  border:2px solid;
  border-color:var(--dark) var(--light) var(--light) var(--dark);
  border-radius:var(--radius-sm,0);
  background:transparent!important;
  color:transparent!important;
  -webkit-text-fill-color:transparent;
  caret-color:var(--input-text,#111);
  font-family:Consolas,"Courier New",monospace;
  font-size:inherit;
  line-height:1.35;
  white-space:pre-wrap;
  overflow-wrap:break-word;
  word-break:break-word;
  tab-size:4;
}

textarea.markdown-syntax-input::selection{
  background:rgba(70,115,190,.28);
  -webkit-text-fill-color:transparent;
}
textarea.markdown-syntax-input::placeholder{
  color:var(--muted-text-color,#777);
  -webkit-text-fill-color:var(--muted-text-color,#777);
  opacity:1;
}
.markdown-syntax-editor.is-focused textarea.markdown-syntax-input{
  outline:2px solid color-mix(in srgb,var(--accent,#245edb) 45%,transparent);
  outline-offset:-2px;
}

.md-syntax-heading-marker{color:var(--md-syntax-heading-marker)}
.md-syntax-heading-text{color:var(--md-syntax-heading)}
.md-syntax-list-marker{color:var(--md-syntax-list)}
.md-syntax-link,.md-syntax-image{color:var(--md-syntax-link);text-decoration:underline}
.md-syntax-inline-code,.md-syntax-code-fence,.md-syntax-code-language,.md-syntax-code-block{color:var(--md-syntax-code)}
.md-syntax-code-block{background:color-mix(in srgb,var(--md-syntax-code) 8%,transparent)}
.md-syntax-strong{color:var(--md-syntax-strong)}
.md-syntax-emphasis{color:var(--md-syntax-emphasis)}
.md-syntax-strike{color:var(--md-syntax-strike);text-decoration:line-through}
.md-syntax-quote-marker,.md-syntax-quote-text{color:var(--md-syntax-quote)}
.md-syntax-checkbox{color:var(--md-syntax-checkbox)}
.md-syntax-checkbox.checked{color:var(--success,#16803b)}
.md-syntax-rule{color:var(--muted-text-color,#777)}

.notebook-focus-editor-label .markdown-syntax-editor{height:100%;min-height:360px}
.notebook-focus-editor-label textarea.markdown-syntax-input{height:100%;min-height:360px}

body.theme-ubuntu24 .markdown-syntax-editor{
  --md-syntax-heading:#18723d;
  --md-syntax-heading-marker:#2c944f;
  --md-syntax-list:#8c6516;
  --md-syntax-link:#b94100;
  --md-syntax-code:#9a3861;
}

@supports not (color:color-mix(in srgb,black 50%,white)){
  .markdown-syntax-editor.is-focused textarea.markdown-syntax-input{outline:2px solid var(--accent,#245edb)}
  .md-syntax-code-block{background:transparent}
}

body.theme-ubuntu24 .markdown-syntax-editor.is-focused textarea.markdown-syntax-input{outline-color:rgba(233,84,32,.38)}
