@layer components {
/* Markdown editor: toolbar, textarea, preview, @mention picker. Used by descriptions, comments and dialogs. */
.editor { position: relative; border: 1px solid var(--line-2); border-radius: var(--r-12); background: var(--bg-1); max-width: 900px; }
.editor:focus-within { border-color: var(--accent-line); }
.editor-bar { display: flex; gap: 2px; padding: 5px 6px; border-bottom: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
.editor-bar button, .editor-bar label { min-width: 28px; height: 28px; padding: 0 6px; border-radius: var(--r-7); display: grid; place-items: center; color: var(--fg-3); font-size: var(--fs-11-5); }
.editor-bar button:hover, .editor-bar button.on, .editor-bar label:hover { background: var(--bg-4); color: var(--fg); }
.editor-bar button:disabled { opacity: 0.35; pointer-events: none; }
.editor-bar label { cursor: pointer; }
.editor-bar label.off { opacity: 0.35; pointer-events: none; }
.editor-bar .vr { width: 1px; height: 18px; background: var(--line-2); margin: 0 4px; }
.editor-bar .glyph { font-family: var(--f-mono); font-size: var(--fs-11); font-weight: 600; }
.editor textarea { display: block; width: 100%; min-height: 180px; background: none; border: 0; outline: none; resize: vertical; padding: 12px 14px; font-family: var(--f-mono); font-size: var(--fs-12-5); line-height: 1.7; color: var(--fg-prose); }
.editor textarea[hidden] { display: none; }
.editor .editor-preview { padding: 12px 14px; min-height: 180px; }
.editor-foot { display: flex; align-items: center; gap: 8px; padding: 6px 8px 8px; border-top: 1px solid var(--line); font-size: var(--fs-11-5); }

/* Compact: the comment composer and inline comment edits. Grows with the text instead of a toolbar. */
.editor.compact textarea { min-height: 54px; resize: none; padding: 10px 12px 4px; font-family: var(--f-ui); font-size: var(--fs-12-8); line-height: 1.55; }
.editor.compact .editor-foot { border-top: 0; padding-top: 2px; }

.mention-pop { position: absolute; left: 10px; bottom: calc(100% + 4px); z-index: var(--z-pop); min-width: 240px; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: var(--r-9); box-shadow: var(--shadow-pop); padding: 4px; }
.mention-pop button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border-radius: var(--r-7); text-align: left; font-size: var(--fs-11-5); color: var(--fg-2); }
.mention-pop button:hover, .mention-pop button.on { background: var(--bg-4); color: var(--fg); }
.mention-pop .muted { margin-left: auto; font-size: var(--fs-11); }

/* Inline calculator (smarttext.js): the faint answer right after "5*5=", written in on Enter. Fixed, so any text box can show it. */
.calc-hint { position: fixed; z-index: var(--z-pop); display: flex; align-items: center; gap: 6px; pointer-events: none; font-family: var(--f-mono); font-size: var(--fs-12-5); color: var(--fg-3); white-space: nowrap; }
.calc-hint span { opacity: 0.85; }
.calc-hint kbd { font-family: var(--f-mono); font-size: var(--fs-10); line-height: 1.4; padding: 0 5px; border-radius: var(--r-4); border: 1px solid var(--line-2); background: var(--bg-3); color: var(--fg-3); }

/* Sketch dialog: a dark page you draw on; touch-action off so a pen or finger draws instead of scrolling. */
.sketch-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.sketch-canvas { display: block; width: 100%; aspect-ratio: 12 / 7; border: 1px solid var(--line-2); border-radius: var(--r-10); background: var(--bg-1); touch-action: none; cursor: crosshair; }
}
