/* Web TextEditor. Fonts come from /css/fonts.css. */

:root { --bg: #282a36; --toolbar: #44475a; --accent: #bd93f9; --text: #f8f8f2; }
body.light-theme { --bg: #ffffff; --toolbar: #f5f5f7; --accent: #007aff; --text: #333333; }

body { margin: 0; display: flex; flex-direction: column; height: 100vh; font-family: var(--sans); background: var(--bg); color: var(--text); }

.toolbar { padding: 10px 16px; background: var(--toolbar); box-shadow: 0 2px 4px rgba(0,0,0,0.1); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-right: auto; }
.logo { width: 24px; height: 24px; fill: var(--accent); }
.site-link { color: #ff7a33; font-weight: 800; letter-spacing: 0.04em; text-decoration: none; padding-right: 10px; border-right: 1px solid rgba(128, 128, 128, 0.35); }
body.light-theme .site-link { color: #e8590c; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.btn, .file-label, select { font-family: inherit; background: rgba(128, 128, 128, 0.1); border: 1px solid rgba(128, 128, 128, 0.2); border-radius: 6px; padding: 6px 12px; cursor: pointer; color: var(--text); font-size: 13px; font-weight: 500; transition: 0.2s; }
.btn:hover, .file-label:hover { background: rgba(128, 128, 128, 0.2); }
#saveBtn { background: var(--accent); color: white; border: none; }

#fileInput { display: none; }
.CodeMirror { flex-grow: 1; font-size: 14px; font-family: var(--mono); }
.CodeMirror-dialog { background: var(--toolbar); color: var(--text); padding: 5px 10px; }
.file-label.open-btn { background: #9E57B5; color: white; }
/* The search dialog sets this width with an inline style, which the CSP blocks. */
.CodeMirror-search-field { width: 10em; }
