.lede { color: var(--muted); max-width: 70ch; }
.editor-app { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); position: relative; }
.doc-tabs { display: flex; gap: 2px; overflow-x: auto; padding: var(--s2) var(--s2) 0; border-bottom: 1px solid var(--border); }
.doc-tab { display: inline-flex; align-items: center; border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--surface-2); max-width: 14rem; }
.doc-tab.is-active { background: var(--surface); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.doc-tab-title { background: none; border: 0; padding: .4em .7em; font: inherit; color: inherit; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 11rem; }
.doc-tab-close { background: none; border: 0; padding: .3em .5em; cursor: pointer; color: var(--muted); font-size: 1.1rem; line-height: 1; }
.doc-tab-new { min-height: 32px; padding: .2em .7em; }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; padding: var(--s3); border-bottom: 1px solid var(--border); }
.toolbar .btn, .toolbar select { min-height: 36px; padding: .3em .7em; font-size: .92rem; }
.toolbar .lang-toggle { font-weight: 700; min-width: 5.5em; }
.toolbar .lang-toggle[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.tb-field { display: inline-flex; align-items: center; gap: .4em; }
.tb-sep { width: 1px; align-self: stretch; background: var(--border); }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; } .menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 12rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: var(--s2); display: grid; gap: 2px; }
.menu-list > button, .menu-list > a { text-align: left; background: none; border: 0; padding: .5em .7em; border-radius: var(--radius-sm); font: inherit; color: var(--text); text-decoration: none; cursor: pointer; }
.menu-list > button:hover, .menu-list > a:hover { background: var(--surface-2); }
.menu-settings label { display: flex; gap: .5em; padding: .4em .5em; max-width: 22rem; }
.editor-main { display: flex; gap: 0; }
.editor-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
.editor-ta, .editor-backdrop { box-sizing: border-box; width: 100%; min-height: 22rem; padding: var(--s4); margin: 0; border: 0; font-family: var(--editor-font, var(--font-ui)); font-size: 22px; line-height: 1.8; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; letter-spacing: normal; }
.editor-ta { position: relative; z-index: 1; display: block; background: transparent; color: var(--text); resize: vertical; outline: none; }
.editor-backdrop { position: absolute; inset: 0; z-index: 0; color: transparent; overflow: auto; pointer-events: none; }
.editor-backdrop mark { color: transparent; background: none; text-decoration: underline dotted var(--warn); text-underline-offset: 6px; }
.editor-wrap:focus-within { box-shadow: inset 0 0 0 2px var(--focus); }
.suggest-popup { position: absolute; z-index: var(--z-popup); list-style: none; margin: 0; padding: 4px; min-width: 9rem; max-width: 24rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); font-family: var(--editor-font, var(--font-ui)); font-size: 1.1rem; }
.suggest-item { padding: .25em .7em; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.suggest-item.is-active { background: var(--accent); color: var(--accent-text); }
.suggest-item.kind-literal { font-family: var(--font-ui); font-size: .85em; color: var(--muted); }
.suggest-item.kind-literal.is-active { color: var(--accent-text); }
.suggest-item.kind-completion { opacity: .8; }
.reverse-panel { flex: 0 0 min(32%, 22rem); border-left: 1px solid var(--border); padding: var(--s3); background: var(--surface-2); }
.reverse-out { white-space: pre-wrap; word-break: break-word; font-family: var(--font-ui); margin: var(--s2) 0 0; max-height: 26rem; overflow: auto; }
.statusbar { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); padding: var(--s2) var(--s4); border-top: 1px solid var(--border); font-size: .88rem; color: var(--muted); }
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: .6em 1.1em; border-radius: 999px; z-index: var(--z-toast); }
.dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); max-width: min(46rem, 94vw); width: 100%; padding: var(--s4); }
.dialog::backdrop { background: rgba(0,0,0,.45); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: var(--s2); }
.help-item { display: flex; justify-content: space-between; align-items: center; gap: .5em; padding: .35em .6em; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; font-size: 1.05rem; }
.help-item:hover { background: var(--surface-2); }
.history-list { list-style: none; padding: 0; display: grid; gap: var(--s2); } .history-list li { display: flex; gap: var(--s2); }
.editor-tips, .faq { max-width: 70ch; }
.faq details { border-bottom: 1px solid var(--border); padding: .6em 0; } .faq summary { cursor: pointer; font-weight: 600; }
body.distraction-free .site-header, body.distraction-free .site-footer, body.distraction-free .editor-tips, body.distraction-free .faq, body.distraction-free .lede, body.distraction-free h1, body.distraction-free .toolbar, body.distraction-free .doc-tabs, body.distraction-free .ad-slot { display: none; }
body.distraction-free .editor-ta { min-height: 80vh; font-size: 26px; }
body.distraction-free .container { max-width: 56rem; }
