/* WEB editor shares the home page's tokens and navigation. */
body.web-editor-page { padding-top: var(--topbar); font-size: 14px; line-height: 1.6; }
body.web-editor-page.code-tool { padding-top: var(--topbar) !important; }
.web-editor-page [hidden] { display: none !important; }
.web-editor-page button, .web-editor-page input, .web-editor-page select { font: inherit; }
.web-editor-page button { cursor: pointer; }
.web-editor-page button:disabled { cursor: wait; opacity: .6; }
.web-editor-page .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.editor-main { max-width: 1680px; margin: 0 auto; padding: 22px clamp(16px, 2.7vw, 44px) 26px; }
.editor-crumbs { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.editor-crumbs a:hover { color: var(--brand); }
.editor-crumbs > span:last-child { color: var(--text); }
.editor-eyebrow { color: var(--brand); font-size: 10px; font-weight: 700; letter-spacing: 1.7px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #38b481; }
.editor-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; background: #fff; color: var(--text); font-size: 12px !important; font-weight: 600 !important; white-space: nowrap; transition: background .15s, border-color .15s; }
.editor-button:hover { border-color: #cadbf7; background: #f8faff; color: var(--brand-dark); }
.editor-button.primary-button { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: 0 3px 8px #367bf51a; }
.editor-button.primary-button:hover { border-color: var(--brand-dark); background: var(--brand-dark); }
.workbench { overflow: hidden; border: 1px solid #dfe6ef; border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.workbench-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.project-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.project-icon { color: var(--brand); font-size: 19px; }
.project-info input { width: 150px; min-width: 60px; border: 1px solid transparent; border-radius: 5px; padding: 4px 5px; background: transparent; color: var(--ink); font-size: 14px; font-weight: 600; }
.project-info input:hover, .project-info input:focus { border-color: var(--line); outline-color: var(--brand); }
.draft-state { padding-left: 10px; border-left: 1px solid var(--line); color: var(--muted); font-size: 11px; white-space: nowrap; }
.draft-state.unsaved { color: #b17d24; }
.project-actions, .option-group, .preview-actions { display: flex; align-items: center; gap: 8px; }
.shortcut-hint { margin-left: 4px; color: #dce9ff; font-size: 10px; font-weight: 400; }
.workspace-options { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 8px 16px; background: #fcfdff; border-bottom: 1px solid var(--line); color: var(--text); font-size: 12px; }
.option-group { flex-wrap: wrap; gap: 16px; }
.auto-run { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap; }
.auto-run input { width: 14px; height: 14px; margin: 0; accent-color: var(--brand); }
.option-divider { height: 16px; border-right: 1px solid var(--line); }
.text-button { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; border: 0; padding: 3px 0; background: transparent; color: #67768d; font-size: 12px !important; white-space: nowrap; }
.text-button:hover { color: var(--brand); }
.workspace-options select { max-width: 180px; border: 1px solid var(--line); border-radius: 6px; padding: 5px 23px 5px 8px; background: #fff; color: var(--text); font-size: 12px; cursor: pointer; }
.view-options { gap: 4px; }
.icon-button { display: inline-grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border: 1px solid transparent; border-radius: 6px; padding: 0; background: transparent; color: #8190a5; font-size: 14px !important; }
.icon-button:hover, .icon-button[aria-pressed="true"] { border-color: #dce8fc; background: var(--brand-soft); color: var(--brand); }
.editor-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 18px; border-bottom: 1px solid #dfeafc; background: #f1f6ff; color: #355d94; font-size: 12px; overflow-wrap: anywhere; }
.editor-notice.warning { background: #fffaed; border-color: #f2e5bf; color: #8e681c; }
.editor-notice .text-button { flex-shrink: 0; color: inherit; font-weight: 600; }
.editor-grid { --editor-share: 50%; display: grid; grid-template-columns: minmax(0, var(--editor-share)) 9px minmax(0, 1fr); height: clamp(380px, 54vh, 680px); min-height: 360px; }
.source-pane, .preview-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: #fff; }
.pane-heading { display: flex; align-items: center; justify-content: space-between; flex: 0 0 47px; height: 47px; gap: 10px; border-bottom: 1px solid var(--line); padding: 0 12px 0 7px; background: #fff; }
.source-tabs { display: flex; align-self: stretch; gap: 3px; }
.source-tab { position: relative; display: flex; align-items: center; gap: 6px; border: 0; padding: 0 14px; background: transparent; color: #8490a2; font-size: 12px !important; font-weight: 600 !important; }
.source-tab:hover { color: var(--brand); }
.source-tab.active { color: var(--brand-dark); }
.source-tab.active::after { position: absolute; right: 12px; bottom: -1px; left: 12px; height: 2px; border-radius: 2px; background: var(--brand); content: ""; }
.language-dot { width: 6px; height: 6px; border-radius: 2px; }
.html-dot { background: #f18d63; }.css-dot { background: #6499f2; }.js-dot { background: #e0bc51; }
.code-panel { flex: 1; min-height: 0; overflow: hidden; }
.code-panel textarea { display: block; width: 100%; height: 100%; resize: none; border: 0; padding: 15px; outline: none; color: var(--ink); font: 13px/1.8 SFMono-Regular, Consolas, "Liberation Mono", monospace; tab-size: 2; }
.web-editor-page .CodeMirror { height: 100%; padding-top: 9px; color: #33435b; font: 13px/1.9 SFMono-Regular, Consolas, "Liberation Mono", monospace; }
.web-editor-page .CodeMirror-gutters { border-right: 0; background: #fff; }
.web-editor-page .CodeMirror-linenumber { min-width: 26px; padding: 0 11px 0 5px; color: #b1bccb; font-size: 11px; }
.web-editor-page .CodeMirror-lines { padding: 4px 0 14px; }
.web-editor-page .CodeMirror pre.CodeMirror-line, .web-editor-page .CodeMirror pre.CodeMirror-line-like { padding: 0 12px; }
.web-editor-page .CodeMirror-selected { background: #e8f0ff; }
.web-editor-page .cm-tag { color: #d56858; }.web-editor-page .cm-attribute { color: #9865b8; }.web-editor-page .cm-string { color: #33876a; }.web-editor-page .cm-keyword { color: #8d5fba; }.web-editor-page .cm-property { color: #487fb9; }.web-editor-page .cm-comment { color: #96a2b4; }
.source-status, .preview-status { display: flex; align-items: center; flex: 0 0 29px; gap: 16px; padding: 0 15px; border-top: 1px solid var(--line); background: #fcfdff; color: #95a0b1; font-size: 10px; }
.source-status span:last-child, .preview-status span:last-child { margin-left: auto; }
.pane-resizer { display: grid; place-items: center; background: #f3f6fa; border: solid var(--line); border-width: 0 1px; cursor: col-resize; touch-action: none; }
.pane-resizer span { width: 2px; height: 26px; border-radius: 2px; background: #ccd5e2; }
.pane-resizer:hover, .pane-resizer:focus-visible { background: #e8f0ff; }
body.resizing, body.resizing * { cursor: col-resize !important; user-select: none !important; }
body.resizing .preview-pane { pointer-events: none; }
.preview-heading { padding-left: 16px; }
.preview-label { display: flex; align-items: center; gap: 7px; color: #67768b; font-size: 12px; font-weight: 600; white-space: nowrap; }
.device-switch { display: flex; gap: 3px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: #f8fafd; }
.device-switch button { display: grid; place-items: center; width: 28px; height: 25px; border: 0; border-radius: 4px; padding: 0; background: transparent; color: #92a0b4; font-size: 14px; }
.device-switch button.active { background: #fff; color: var(--brand); box-shadow: 0 1px 4px #17203314; }
.preview-canvas { display: flex; flex: 1; min-height: 0; overflow: auto; background: #edf1f7; }
.preview-frame-wrap { flex-shrink: 0; width: 100%; min-height: 100%; margin: 0 auto; background: #fff; }
.preview-frame-wrap.device-fixed { box-shadow: 0 0 0 1px #dbe2eb, 0 5px 20px #1720330a; }
#iframeResult { display: block; width: 100%; height: 100%; min-height: 100%; border: 0; background: #fff; }
.console-panel { border-top: 1px solid var(--line); background: #fff; }
.console-heading { display: flex; align-items: center; justify-content: space-between; min-height: 40px; gap: 10px; padding: 0 16px; background: #fcfdff; }
.console-toggle { display: flex; align-items: center; align-self: stretch; gap: 8px; border: 0; padding: 0; background: transparent; color: #66758c; font-size: 11px !important; font-weight: 600 !important; }
.console-toggle[aria-expanded="false"] > i { transform: rotate(-90deg); }
.console-count { display: grid; place-items: center; min-width: 18px; height: 17px; border-radius: 4px; background: #edf1f8; color: #8d99ac; font-size: 10px; }
.console-count.has-errors { background: #ffebe8; color: #c45847; }
.console-actions { display: flex; align-items: center; gap: 16px; color: #a0aabc; font-size: 10px; }
.console-actions .text-button { font-size: 11px !important; }
.console-output { max-height: 170px; min-height: 56px; overflow: auto; border-top: 1px solid #f0f3f8; padding: 6px 16px; font: 11px/1.7 SFMono-Regular, Consolas, "Liberation Mono", monospace; }
.console-empty { margin: 9px 0; color: #a9b2c0; font-family: inherit; }
.console-entry { display: flex; align-items: baseline; gap: 12px; padding: 4px 0; border-bottom: 1px solid #f5f6f9; color: #63738a; white-space: pre-wrap; overflow-wrap: anywhere; }
.console-entry time { flex-shrink: 0; color: #a7b1c1; font-size: 10px; }
.console-entry.error { color: #c9574e; }.console-entry.warn { color: #a17a23; }.console-entry.alert { color: var(--brand-dark); }
.workbench-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; padding: 5px 16px; border-top: 1px solid var(--line); color: #97a3b4; font-size: 10px; }
.workbench-bottom > span { display: flex; align-items: center; gap: 6px; }
.workbench-bottom .text-button { color: #8a98ac; font-size: 10px !important; }
.editor-tips { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 14px 3px 0; color: #96a2b4; font-size: 11px; }
.editor-tips > span { display: inline-flex; align-items: center; gap: 6px; }
.editor-tips .fa-lightbulb-o { color: #b6a16c; font-size: 13px; }
.editor-tips kbd { border: 1px solid #e1e7f0; border-radius: 4px; padding: 0 4px; background: #fff; color: #8796ab; font-family: inherit; font-size: 10px; line-height: 1.6; }
.tip-separator { margin: 0 6px; color: #c5ccd6; }
.editor-dialog { width: min(580px, calc(100% - 30px)); max-height: min(740px, 90dvh); overflow-y: auto; border: 1px solid var(--line); border-radius: 16px; padding: 24px; background: #fff; color: var(--ink); box-shadow: 0 24px 90px #17203335; }
.editor-dialog::backdrop { background: #17203366; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.dialog-heading h2 { margin: 3px 0 0; font-size: 20px; line-height: 1.6; }
.dialog-description { margin: 12px 0 18px; color: var(--muted); font-size: 13px; }
.library-search { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 0 13px; color: #a0acbc; background: #fbfcfe; }
.library-search:focus-within { border-color: var(--brand); }
.library-search input { width: 100%; min-height: 42px; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 13px; }
.library-search-status { margin: 13px 0; color: var(--muted); font-size: 11px; }
.library-list { display: grid; gap: 8px; min-height: 80px; }
.library-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; }
.library-card strong { display: block; color: var(--ink); font-size: 13px; }
.library-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.library-card .editor-button { min-width: 62px; }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.confirm-dialog { max-width: 420px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.editor-noscript { margin: 24px; padding: 20px; color: #a15e38; background: #fff4e8; }
.editor-grid.stacked { grid-template-columns: minmax(0, 1fr); height: auto; }
.editor-grid.stacked .source-pane { height: 420px; }
.editor-grid.stacked .preview-pane { height: 460px; }
.editor-grid.stacked .pane-resizer { display: none; }
.editor-grid.stacked .preview-pane { border-top: 1px solid var(--line); }
body.editor-focus { overflow: hidden; }
.editor-focus .workbench { position: fixed; z-index: 100; inset: 12px; display: flex; flex-direction: column; border-radius: 12px; }
.editor-focus .editor-grid { flex: 1; height: auto; min-height: 0; }
.editor-focus .editor-grid.stacked { overflow-y: auto; flex: 1; }
.editor-focus .editor-grid.stacked .source-pane, .editor-focus .editor-grid.stacked .preview-pane { min-height: 350px; }
.editor-focus .console-output { max-height: 130px; }
@media (min-width: 1800px) { .editor-grid { height: 60vh; } }
@media (max-width: 1100px) { .project-info input { width: 125px; }.project-actions { gap: 6px; }.editor-button { padding: 7px 10px; }.shortcut-hint { display: none; }.draft-state { padding-left: 7px; }.project-info { gap: 6px; } }
@media (max-width: 900px) { .workbench-toolbar { gap: 11px; }.project-info { width: 100%; }.project-info input { flex: 1; max-width: 250px; }.project-actions { width: 100%; }.project-actions .primary-button { margin-left: auto; }.source-tab { padding: 0 10px; }.pane-heading { padding-right: 7px; }.preview-heading { padding-left: 10px; } }
@media (max-width: 760px) {
    .web-editor-page .topbar .brand { flex-basis: auto; flex-grow: 1; font-size: 15px; }
    .web-editor-page .topnav a { display: none !important; }
    .web-editor-page .topnav a:nth-child(2) { display: inline-flex !important; width: auto; height: auto; min-height: 38px; padding: 0 10px; font-size: 12px; }
    .editor-main { padding: 16px 12px 22px; }
    .editor-crumbs { margin-bottom: 14px; font-size: 11px; }
    .editor-eyebrow { font-size: 9px; }
    .workbench { border-radius: 11px; }
    .workbench-toolbar { padding: 12px; }
    .editor-button { min-height: 40px; }
    .workspace-options { gap: 5px; padding: 5px 8px 5px 12px; }
    .option-group { gap: 10px; }
    .option-divider { display: none; }
    .workspace-options select { max-width: 130px; min-height: 38px; padding-left: 5px; font-size: 11px; }
    .workspace-options .text-button { min-height: 38px; font-size: 11px !important; }
    .view-options { margin-left: auto; gap: 1px; }
    .view-options .icon-button { min-width: 34px; height: 38px; }
    #layoutButton { display: none; }
    .editor-grid, .editor-grid.stacked { display: flex; flex-direction: column; height: auto; min-height: 0; }
    .editor-grid .source-pane, .editor-grid.stacked .source-pane { height: 370px; }
    .editor-grid .preview-pane, .editor-grid.stacked .preview-pane { height: 410px; border-top: 1px solid var(--line); }
    .pane-resizer { display: none; }
    .source-tab { min-height: 44px; padding: 0 14px; }
    .pane-heading { flex-basis: 47px; }
    .preview-heading { padding: 0 12px 0 16px; }
    .device-switch button { width: 32px; height: 30px; }
    .icon-button { width: 34px; height: 34px; }
    .console-actions > span { display: none; }
    .console-heading { min-height: 43px; padding: 0 12px; }
    .console-output { padding: 6px 12px; }
    .workbench-bottom { padding: 6px 12px; }
    .editor-tips { gap: 8px; margin-top: 12px; font-size: 10px; }
    .editor-focus .workbench { inset: 5px; }
    .editor-focus .editor-grid { overflow-y: auto; flex: 1; }
    .editor-focus .editor-grid .source-pane { flex-shrink: 0; min-height: 300px; }
    .editor-focus .editor-grid .preview-pane { flex-shrink: 0; min-height: 350px; }
    .editor-dialog { padding: 20px 17px; }
    .dialog-footer > span { max-width: 210px; }
}
@media (max-width: 380px) { .editor-main { padding-right: 8px; padding-left: 8px; }.project-actions .editor-button { padding: 7px 8px; font-size: 11px !important; }.project-actions { gap: 5px; }.option-group { gap: 7px; }.workspace-options select { max-width: 110px; }.view-options { width: 100%; justify-content: flex-end; margin-top: -3px; } }
@media (prefers-reduced-motion: reduce) { .web-editor-page *, .web-editor-page *::before, .web-editor-page *::after { scroll-behavior: auto !important; transition: none !important; } }
