/* Bovolab HTML Editor v1 — Obsidian Purple */
.editor-hero{padding:45px 0 30px}.editor-hero h1{font-size:clamp(36px,4.7vw,55px);margin:13px 0 12px}.editor-hero>p{font-size:13px;max-width:740px}.editor-shell{max-width:1500px}
.editor-workspace{border:1px solid #513766;border-radius:18px;background:linear-gradient(155deg,#251733,#140f22);box-shadow:0 22px 55px #03010777;overflow:hidden}
.editor-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:15px 17px;background:#1a122a;border-bottom:1px solid #423154}
.toolbar-cluster{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.toolbar-right{margin-left:auto}
.editor-btn{background:#322441;border:1px solid #5f4974;color:#e6d8fa;border-radius:8px;min-height:36px;padding:8px 12px;font-size:11px;font-weight:750;white-space:nowrap;cursor:pointer;transition:background .15s,border-color .15s}.editor-btn:hover{background:#46305d;border-color:#966bc8}.editor-btn:disabled{opacity:.48;cursor:default}.editor-btn-primary{background:linear-gradient(125deg,#7745bf,#a35de0);border-color:#a67bdf;color:#fff}.editor-btn-primary:hover{background:linear-gradient(125deg,#8854d3,#b170e8)}.icon-btn{font-size:19px;min-width:36px;line-height:1;padding:5px}.refresh-btn{font-size:20px;line-height:1;padding:4px 10px}
.find-panel{display:flex;align-items:center;gap:9px;flex-wrap:wrap;background:#241730;border-bottom:1px solid #503766;padding:12px 17px}.find-panel label{font-size:11px;color:#cbb8db;font-weight:720}.find-panel input{min-width:115px;flex:1;max-width:270px;border-radius:7px;border:1px solid #705187;background:#100b1b;color:#fff;padding:9px 11px;font-size:12px;outline:none}.find-panel input:focus{border-color:#b684f5}.find-message{font-size:11px;color:#c9aedf}
.editor-panels{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0;min-height:580px}.editor-pane{min-width:0;display:flex;flex-direction:column;min-height:0}.code-pane{border-right:1px solid #503760}.pane-heading{height:54px;flex-shrink:0;display:flex;align-items:center;justify-content:space-between;padding:0 17px;gap:10px;background:#20152f;border-bottom:1px solid #443058}.pane-title{font-size:12px;font-weight:800;color:#f2eaff;display:flex;align-items:center;gap:9px;min-width:0}.pane-indicator,.preview-dot{width:8px;height:8px;border-radius:50%;background:#b88aff;box-shadow:0 0 12px #a464fb}.preview-dot{background:#98dec6;box-shadow:0 0 12px #6fbc9c}.filename-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:140px;border:1px solid #543b69;border-radius:6px;padding:5px 7px;font:10px ui-monospace,monospace;color:#bda7d6}.pane-meta{font-size:10px;color:#a994bc;white-space:nowrap}
.code-surface{height:505px;min-height:320px;display:flex;position:relative;background:#0c0a14;overflow:hidden}.gutter{flex:0 0 47px;overflow:hidden;position:relative;background:#151021;border-right:1px solid #302340;user-select:none}.gutter pre{margin:0;position:absolute;left:0;top:0;width:100%;padding:17px 7px 50px 0;color:#7c698f;text-align:right;font:12px/21px ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre}.code-content{position:relative;flex:1;overflow:hidden;min-width:0}
.code-content textarea,.highlight-layer{margin:0;position:absolute;inset:0;width:100%;height:100%;padding:17px 18px 50px;border:0;outline:none;resize:none;font:12px/21px ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:0;tab-size:2;white-space:pre;overflow:auto;overflow-wrap:normal}.code-content textarea{z-index:2;background:transparent;color:transparent;-webkit-text-fill-color:transparent;caret-color:#f3e4ff;overscroll-behavior:contain}.code-content textarea::selection{background:#8150c470;-webkit-text-fill-color:#fff}.highlight-layer{z-index:1;pointer-events:none;color:#e7dff3;overflow:hidden;transform:none}.syntax-comment{color:#82918b}.syntax-tag{color:#c38dff}.syntax-decl{color:#e4a0cc}.syntax-entity{color:#f0b67c}.code-content textarea:focus{box-shadow:inset 0 0 0 1px #7e52b166}
.pane-bottom{flex-shrink:0;padding:10px 15px;display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:10px;color:#a494b8;background:#1a1328;border-top:1px solid #403051}.preview-footer{flex-wrap:wrap}.plain-link{border:0;background:none;padding:2px 0;color:#c8a5fa;font-size:10px;font-weight:780;cursor:pointer}.plain-link:hover{color:#fff}
.preview-heading{gap:10px}.preview-actions{display:flex;align-items:center;gap:7px}.preview-modes{display:flex;background:#150e22;border:1px solid #523d62;border-radius:8px;padding:3px}.preview-mode{border:0;background:transparent;color:#baa6cf;font-size:10px;font-weight:760;padding:8px 11px;border-radius:5px;cursor:pointer}.preview-mode.active{color:#fff;background:#67418c}
.preview-viewport{height:505px;background:repeating-linear-gradient(45deg,#31233b,#31233b 8px,#251b31 8px,#251b31 16px);overflow:auto;display:flex;justify-content:center;align-items:stretch;padding:0}.preview-frame{background:#fff;width:100%;height:100%;transition:width .2s;box-shadow:0 0 0 1px #3b2850}.preview-frame.is-mobile{width:375px;min-width:0;max-width:100%;box-shadow:0 10px 28px #07040a80}.preview-frame iframe{display:block;width:100%;height:100%;border:0;background:white}
.editor-mobile-switch{display:none}.editor-notice{color:#b5a1cb;font-size:11px;padding:12px 19px;background:#140e20;border-top:1px solid #382947;line-height:1.6}
.editor-guide{padding-top:46px}.editor-faq{padding-top:40px}
@media(max-width:1100px){.editor-toolbar{gap:9px}.editor-btn{padding:7px 10px}.editor-panels{min-height:500px}.code-surface,.preview-viewport{height:445px}.pane-heading{padding:0 12px}}
@media(max-width:760px){.editor-hero{padding:33px 0 22px}.editor-hero h1{font-size:39px}.editor-workspace{border-radius:13px}.editor-toolbar{padding:12px}.toolbar-cluster{gap:6px}.toolbar-right{margin-left:0}.editor-panels{display:block;min-height:0}.editor-pane{display:none;border:0}.editor-panels.show-code .code-pane,.editor-panels.show-preview .preview-pane{display:flex}.code-surface,.preview-viewport{height:450px}.editor-mobile-switch{display:flex;border-top:1px solid #49355e;background:#1b1329;padding:8px;gap:6px}.editor-mobile-switch button{flex:1;border:0;border-radius:8px;background:#2b203a;color:#c4afd8;font-size:12px;font-weight:750;padding:12px;cursor:pointer}.editor-mobile-switch button.active{background:#7544ad;color:#fff}.find-panel{padding:12px}.find-panel input{max-width:unset;min-width:80px}.find-panel label{min-width:40px}.editor-notice{padding:11px 13px}}
@media(max-width:410px){.editor-btn{font-size:10px;padding:8px}.toolbar-cluster{gap:5px}.code-content textarea,.highlight-layer{font-size:11px}.gutter{flex-basis:39px}.gutter pre{font-size:11px}}
@media(prefers-reduced-motion:reduce){.preview-frame{transition:none}}

.asset-options{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:11px 16px;border-top:1px solid #443058;background:#1c142a}.asset-options label,.asset-options span{color:#bfaed2;font-size:11px}.asset-options input{flex:1;min-width:180px;background:#0e0b19;border:1px solid #674a7c;border-radius:8px;padding:9px 12px;color:#f6ecff;font-size:11px}.notice-error{color:#ffc2ce}.asset-options[hidden]{display:none!important}


/* v1.1 — distraction-reduced workspace; changes apply ONLY to HTML Editor. */
.editor-page .site-header { position: static; top: auto; }
.editor-page .shell.editor-shell { max-width: none; width: 100%; padding-left: clamp(12px, 1.4vw, 24px); padding-right: clamp(12px, 1.4vw, 24px); }
.editor-page .editor-hero { padding: 16px 0 14px; }
.editor-page .editor-hero h1 { font-size: clamp(26px, 2.5vw, 38px); margin: 6px 0 6px; }
.editor-page .editor-hero > p { font-size: 12px; line-height: 1.5; max-width: 920px; }
.editor-page .editor-workspace { border-radius: 12px; }
.editor-page .editor-toolbar { padding: 11px 14px; }
.editor-page .editor-panels { min-height: 0; }
.editor-page .code-surface, .editor-page .preview-viewport { height: clamp(500px, calc(100dvh - 310px), 1100px); }
.editor-page .editor-panels.preview-hidden { grid-template-columns: minmax(0, 1fr); }
.editor-page .editor-panels.preview-hidden .preview-pane { display: none !important; }
.editor-page .editor-panels.preview-hidden .code-pane { border-right: 0; }
.editor-page .editor-btn[hidden] { display: none !important; }
.editor-page .code-pane-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.editor-page .editor-btn-small { min-height: 29px; padding: 5px 9px; font-size: 10px; }
.editor-page #toggle-wrap[aria-pressed="true"] { background: #62408a; border-color: #b481ed; color: white; }
.editor-page .code-surface.word-wrapped .code-content textarea,
.editor-page .code-surface.word-wrapped .highlight-layer { white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; overflow-x: hidden; }
/* Soft-wrapped visual lines have variable heights; hide the fixed-line gutter rather than show incorrect numbers. */
.editor-page .code-surface.word-wrapped .gutter { display: none; }
.editor-page .find-message { min-width: 100px; font-variant-numeric: tabular-nums; color: #e1c4ff; }
.editor-page #find-panel[hidden] { display: none !important; }
@media (max-width: 760px) {
  .editor-page .editor-hero { padding: 13px 0 12px; }
  .editor-page .editor-hero h1 { font-size: clamp(25px, 7vw, 32px); }
  .editor-page .code-surface, .editor-page .preview-viewport { height: max(480px, calc(100dvh - 285px)); }
  .editor-page .editor-panels.preview-hidden .code-pane { display: flex !important; }
  .editor-page .editor-panels.preview-hidden ~ .editor-mobile-switch button[data-panel="preview"] { display: none; }
  .editor-page .pane-heading { height: auto; min-height: 54px; padding-top: 6px; padding-bottom: 6px; }
  .editor-page .code-pane-actions { gap: 5px; }
  .editor-page .pane-meta { font-size: 9px; }
}
@media (max-width: 460px) {
  .editor-page .code-pane-actions .pane-meta { display: none; }
  .editor-page .editor-hero > p { font-size: 11px; }
  .editor-page .editor-btn-small { padding: 5px 7px; }
}

/* HTML Editor v1.2: local recovery, persistent find, HTML check annotations. */
.editor-page .find-panel { display:flex !important; }
.editor-page .draft-save-status { color:#cba8eb; font-size:10px; max-width:210px; line-height:1.4; }
.editor-page .draft-save-status.save-error { color:#ffb0c0; }
.editor-page .syntax-tag.tag-pair-active { background:#6a3b9b99; box-shadow:inset 0 -2px #d0a2ff; border-radius:2px; }
.editor-page .syntax-tag.tag-issue { text-decoration:underline wavy #ff8aaa; text-underline-offset:3px; }
.editor-page .highlight-layer .find-highlight { background:#8b6c3040; box-shadow:inset 0 -2px #eab861; border-radius:2px; }
.editor-page .highlight-layer .find-highlight.find-current { background:#7f4dc199; box-shadow:inset 0 -2px #eac8ff; }
.editor-page .tag-audit { background:#171020; border-top:1px solid #403050; }
.editor-page .tag-audit>button { display:flex; align-items:center; gap:7px; width:100%; text-align:left; cursor:pointer; color:#c6a9de; border:0; background:none; padding:9px 15px; font-size:11px; }
.editor-page .tag-audit strong { color:#e5cbf8; }
.editor-page .tag-audit-list { border-top:1px solid #392a46; padding:6px 12px; max-height:145px; overflow:auto; }
.editor-page .tag-audit-list[hidden] { display:none; }
.editor-page .tag-issue-row { display:block; width:100%; text-align:left; font:11px/1.6 ui-monospace,Consolas,monospace; color:#e7c7dd; border:0; border-radius:5px; cursor:pointer; padding:6px 8px; background:transparent; }
.editor-page .tag-issue-row:hover, .editor-page .tag-issue-row:focus-visible { background:#3a254d; }
.editor-page .tag-check-ok { font-size:11px; color:#a8d9c7; padding:8px; }
.editor-page .draft-dialog { position:fixed; inset:0; display:grid; place-items:center; z-index:150; padding:20px; background:#05040bdc; }
.editor-page .draft-dialog[hidden] { display:none !important; }
.editor-page .draft-dialog-card { width:min(470px,100%); background:linear-gradient(145deg,#281839,#171023); color:#f3e8ff; border:1px solid #8b61b6; border-radius:15px; box-shadow:0 30px 90px #0008; padding:26px; }
.editor-page .draft-dialog-card h2 { font-size:23px; margin:12px 0; }
.editor-page .draft-dialog-card p { font-size:13px; line-height:1.65; color:#cab5dc; }
.editor-page .draft-dialog-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:20px; }
@media (max-width:760px) { .editor-page .draft-save-status { width:100%; max-width:none; } .editor-page .find-panel input { min-width:0; flex-basis:140px; } .editor-page .tag-audit-list { max-height:130px; } }


/* v1.3 — distraction-free toolbar, immediate typing feedback. */
.editor-page .toolbar-file-meta { display:inline-flex; align-items:center; gap:8px; min-width:0; max-width:360px; }
.editor-page .toolbar-file-meta .filename-label { max-width:170px; }
.editor-page .toolbar-file-meta .pane-meta { color:#bfa8da; font-variant-numeric:tabular-nums; }
.editor-page .find-panel .find-spacer { flex:1 1 8px; min-width:0; }
.editor-page .find-panel #toggle-wrap { margin-left:auto; }
.editor-page .find-panel #show-preview { border-color:#895bb6; background:#503268; color:#f6ebff; }
.editor-page .find-panel #show-preview:hover { background:#6a4289; }
/* Native textarea paints characters instantly while heavier syntax rendering waits
   for an idle moment. Only one layer may show visible text at a time. */
.editor-page .code-surface.is-editing .highlight-layer { visibility:hidden; }
.editor-page .code-surface.is-editing .code-content textarea {
  color:#e7dff3;
  -webkit-text-fill-color:#e7dff3;
}
@media(max-width:900px) {
  .editor-page .find-panel .find-spacer { flex-basis:100%; height:0; }
  .editor-page .find-panel #toggle-wrap { margin-left:auto; }
}
@media(max-width:760px) {
  .editor-page .toolbar-file-meta { flex:1 1 180px; }
  .editor-page .toolbar-file-meta .filename-label { max-width:115px; }
  .editor-page .find-panel .find-spacer { flex-basis:100%; }
}


/* HTML Editor v1.3.1 — level preview/editor edges; compact bottom controls. */
.editor-page .preview-pane > .preview-viewport,
.editor-page .code-pane > .code-surface {
  /* Both work surfaces now begin immediately under the shared Find toolbar. */
  flex: 0 0 auto;
}
.editor-page .editor-code-footer { min-height: 39px; position: relative; }
.editor-page .editor-code-status { min-width: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.editor-page .editor-code-status #tag-pair-status { white-space: nowrap; }
.editor-page .editor-shortcuts { margin-left: auto; }
.editor-page .editor-code-footer .tag-audit { background: transparent; border: 0; position: relative; min-width: 0; }
.editor-page .editor-code-footer .tag-audit > button {
  width: auto; display: inline-flex; padding: 2px 4px; gap: 5px; align-items: center;
  border: 0; border-radius: 5px; font-size: 10px; color: #c6a9de; white-space: nowrap;
}
.editor-page .editor-code-footer .tag-audit > button:hover,
.editor-page .editor-code-footer .tag-audit > button:focus-visible { background: #362448; }
.editor-page .editor-code-footer .tag-audit-list {
  position: absolute; left: 0; bottom: calc(100% + 9px); z-index: 25;
  width: min(420px, 80vw); max-height: 200px; overflow: auto;
  background: #1d1429; border: 1px solid #674883; border-radius: 9px;
  box-shadow: 0 12px 32px #050308b8; padding: 8px;
}
.editor-page .preview-footer { min-height: 39px; padding: 5px 12px; flex-wrap: wrap; row-gap: 6px; }
.editor-page .preview-footer-actions {
  margin-left: auto; display: flex; align-items: center; justify-content: flex-end;
  flex-wrap: wrap; gap: 7px;
}
.editor-page .preview-footer .preview-modes { flex-shrink: 0; padding: 2px; border-radius: 7px; }
.editor-page .preview-footer .preview-mode { padding: 5px 9px; font-size: 10px; }
.editor-page .preview-footer .refresh-btn { min-height: 27px; padding: 2px 8px; font-size: 16px; }
.editor-page .preview-footer .plain-link { white-space: nowrap; }
@media (max-width: 1100px) {
  .editor-page .editor-shortcuts { display: none; }
}
@media (max-width: 760px) {
  .editor-page .preview-footer { gap: 8px; padding: 7px 10px; }
  .editor-page .preview-footer-actions { gap: 6px; }
  .editor-page .editor-code-status { gap: 7px; }
  .editor-page .editor-code-footer { padding: 8px 10px; }
}


/* v1.3.2 — accurate caret for large HTML and Word Wrap.
   In these modes textarea renders the text AND caret: no separate visual glyph layer. */
.editor-page .code-surface.native-render .highlight-layer { display: none !important; }
.editor-page .code-surface.native-render .code-content textarea {
  color: #e7dff3 !important;
  -webkit-text-fill-color: #e7dff3 !important;
  caret-color: #f3e4ff;
}
