@import url('./compare.css');
@import url('./desktop-updates.css');
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;450;500;550;600;650;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --ui-zoom: .8925;
  color-scheme: dark;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 17px;
  font-synthesis: none;
  color: var(--tone-f2f2f2);
  background: var(--tone-191919);
  --border: 0;
  --muted: var(--tone-939393);
  --accent: var(--tone-aaaaaa);
  --accent-soft: var(--tone-343434);
  --accent-text: var(--tone-e7e7e7);
  --mono: 'JetBrains Mono', Consolas, monospace;
}
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--tone-454545) transparent; }
body { margin: 0; zoom: var(--ui-zoom, 1); }
button, input, textarea { font: inherit; }
button { cursor: pointer; border: 0; background: none; color: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 4px; transition: background .12s, color .12s; }
button:hover { background: var(--tone-343434); color: var(--tone-f3f3f3); }
button:disabled { opacity: .35; cursor: default; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, textarea { color: var(--tone-f2f2f2); }
input:focus, textarea:focus { outline: none; }
input:focus-visible, textarea:focus-visible { box-shadow: inset 0 0 0 1px var(--accent); }
input::placeholder, textarea::placeholder { color: var(--tone-999999); }
svg { flex-shrink: 0; }
kbd { font: 14px var(--mono); color: var(--tone-b5b5b5); border: 0; border-radius: 3px; padding: 1px 4px; white-space: nowrap; }
[hidden] { display: none !important; }

/* Readable navigation, with compact document-first chrome. */
/* Anchor to the viewport: WebKit already compensates viewport units for body
   zoom, so dividing 100dvh by our scale makes the shell taller than the window. */
.app { display: grid; --sidebar-size: min(var(--sidebar-width, 256px), calc(100vw / var(--ui-zoom, 1) - 76px)); position: fixed; inset: 0; grid-template-columns: 52px var(--sidebar-size) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); overflow: hidden; transition: grid-template-columns .16s; }
.app.drawer-closed { grid-template-columns: 52px 0 minmax(0, 1fr); }
.rail { background: var(--tone-0c0c0c); border: 0; display: flex; flex-direction: column; align-items: center; padding: 14px 0 10px; color: var(--tone-b1b1b1); z-index: 4; }
.brand-mark { width: 23px; height: 23px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 0 0 20px; }
.brand-mark span { background: #78b0ff; border-radius: 2px; }
.brand-mark span:nth-child(2) { background: #c0dbff; }
.brand-mark span:nth-child(3) { background: #3d6aab; }
.rail-top, .rail-bottom { display: flex; flex-direction: column; gap: 5px; }
.rail-top { min-height: 0; }
.rail button { width: 40px; height: 40px; border-radius: 6px; }
.rail button svg { width: 22px; height: 22px; }
.rail button:hover, .rail button.active { background: var(--tone-313131); color: var(--tone-cecece); }
.rail-bottom { margin-top: auto; flex-shrink: 0; }
.avatar { width: 27px !important; height: 27px !important; border-radius: 50% !important; background: var(--tone-434343) !important; color: var(--tone-eeeeee) !important; font-size: 16px; font-weight: 600; margin: 6px auto 0; border: 0; }
.sidebar { background: var(--tone-171717); border: 0; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.sidebar-brand { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; flex-shrink: 0; white-space: nowrap; font-size: 22px; font-weight: 700; letter-spacing: .2px; color: var(--tone-eeeeee); }
.sidebar-brand button { padding: 4px; color: var(--tone-a8a8a8); }
.sidebar-brand button svg { width: 17px; height: 17px; }
.sidebar-actions { padding: 0 10px; display: grid; gap: 3px; }
.sidebar-actions button { justify-content: flex-start; border-radius: 4px; padding: 7px 9px; font-size: 16px; font-weight: 500; white-space: nowrap; }
.sidebar-actions button svg { width: 22px; height: 22px; }
.sidebar-actions .new-document { background: var(--tone-3a3a3a); color: var(--tone-eeeeee); border: 0; }
.sidebar-actions .new-document:hover { background: var(--tone-4b4b4b); }
.new-document kbd { margin-left: auto; border: 0; color: var(--tone-d1d1d1); }
.compare-link { color: var(--tone-d1d1d1); }
.sidebar-search { margin: 11px 17px 0; display: flex; align-items: center; gap: 6px; color: var(--tone-a7a7a7); }
.sidebar-search svg { width: 18px; height: 18px; }
.sidebar-search input { width: 100%; min-width: 0; background: none; border: 0; font-size: 15px; padding: 6px 0; }
.sidebar-scroll { overflow: auto; flex: 1; padding: 0 9px; }
.nav-section { margin-top: 17px; }
.nav-section h2 { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; margin: 0 0 5px; font-size: 12px; font-weight: 600; color: var(--tone-949494); letter-spacing: 1.2px; text-transform: uppercase; }
.nav-section h2 > span { font-size: 11px; letter-spacing: .4px; color: var(--tone-858585); }
.nav-section h2 button { width: 24px; height: 24px; }
.nav-section h2 button svg { width: 18px; height: 18px; }
.document-link { width: 100%; justify-content: flex-start; padding: 6px 8px; min-height: 36px; border-radius: 4px; color: var(--tone-f0f0f0); gap: 9px; font-weight: 450; font-size: 16px; white-space: nowrap; text-align: left; }
.document-link > span:first-of-type { overflow: hidden; text-overflow: ellipsis; }
.document-row { display: flex; align-items: center; border-radius: 4px; }
.document-row.selected { background: var(--accent-soft); color: var(--tone-ffffff); }
.document-row:hover, .document-row:focus-within, .document-row.menu-open { background: var(--tone-303030); }
.document-row .document-link { min-width: 0; flex: 1; }
.document-more { flex: 0 0 28px; height: 28px; padding: 0; margin-right: 4px; font-size: 22px; opacity: 0; }
.document-row:hover .document-more, .document-row:focus-within .document-more, .document-row.menu-open .document-more { opacity: 1; }
@media (hover: none) { .document-more { opacity: 1; } }
.document-menu { position: fixed; z-index: 30; min-width: 160px; padding: 5px; background: var(--tone-292929); border-radius: 6px; box-shadow: 0 6px 24px #0008; }
.document-menu button { display: flex; width: 100%; justify-content: flex-start; padding: 8px 12px; border-radius: 3px; }
.document-menu button:last-child { color: #ffaaaa; border-top: 1px solid var(--tone-484848); margin-top: 4px; }
.folder { margin-bottom: 4px; }
.folder summary { list-style: none; cursor: pointer; display: flex; align-items: center; padding: 6px; gap: 8px; font-size: 15px; font-weight: 500; color: var(--tone-d6d6d6); white-space: nowrap; }
.folder summary::-webkit-details-marker { display: none; }
.folder summary > svg:first-child { width: 14px; height: 14px; color: var(--tone-a0a0a0); transition: transform .12s; }
.folder[open] > summary > svg:first-child { transform: rotate(90deg); }
.folder summary > svg:nth-child(2) { width: 21px; height: 21px; color: var(--tone-bfbfbf); }
.folder summary small { margin-left: auto; color: var(--tone-a0a0a0); }
.folder .document-link { padding-left: 34px; }
.history-section { margin-bottom: 14px; }
.history-date { font-size: 12px; margin: 10px 8px 4px; color: var(--tone-929292); }
.nav-empty { padding: 0 8px; color: var(--tone-a9a9a9); font-size: 15px; }
.sidebar-bottom { display: flex; align-items: center; gap: 4px; padding: 12px 10px; flex-shrink: 0; }
.sidebar-account { flex: 1; min-width: 0; justify-content: flex-start; gap: 10px; padding: 8px; min-height: 40px; color: var(--tone-d9d9d9); }
.sidebar-account > span:not(.pro-badge) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.pro-badge { display: inline-flex; align-items: center; flex-shrink: 0; padding: 3px 6px; border: 1px solid #d9b56855; border-radius: 5px; background: #d9b56818; color: #e5c681; font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: .7px; }
[data-theme="light"] .pro-badge { background: #f8efd9; border-color: #b78a3b66; color: #775217; }
.sidebar-account > svg { width: 22px; height: 22px; }
.sidebar-settings { width: 36px; height: 36px; color: var(--tone-bcbcbc); }
.sidebar-settings > svg { width: 20px; height: 20px; }
.rail-account { margin-top: 4px; }
.rail-account:has(.pro-badge) { flex-direction: column; gap: 2px; height: 48px; }
.rail-account .pro-badge { padding: 2px 4px; font-size: 8px; }
.rail-bottom { gap: 4px; }
.rail-bottom button svg { width: 21px; height: 21px; stroke-width: 1.7; }


/* Document tabs lead straight into the editor toolbar. */
.workspace { min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--tone-111111); }
.text-button { font-size: 15px; color: var(--tone-dedede); padding: 5px; }
.text-button svg { width: 11px; }
.tabs { display: flex; gap: 1px; align-items: stretch; min-height: 43px; padding: 3px 3px 0; background: var(--tone-191919); overflow: clip; flex-shrink: 0; }
.tab-overflow { flex: 0 0 32px; font-size: 19px; color: var(--tone-bdbdbd); }
.tab-download { flex: none; margin-left: auto; align-self: center; padding: 5px 10px; gap: 6px; font-size: 14px; background: var(--tone-272727); color: var(--tone-bdbdbd); }
.tab-download:disabled { cursor: default; }
.tab-download svg { width: 15px; height: 15px; }
.tab[style*="max-width"] > button:first-child { min-width: 0; }
.tab-overflow-menu { max-height: min(60vh, 400px); overflow-y: auto; }
.tab-overflow-menu button:last-child { color: inherit; border: 0; margin: 0; }
.tab { background: var(--tone-212121); display: flex; align-items: center; border-radius: 6px 6px 0 0; position: relative; color: var(--tone-aaaaaa); flex-shrink: 0; }
.tab:hover { background: var(--tone-272727); }
.tab.active { background: var(--tone-2e2e2e); color: var(--tone-eeeeee); box-shadow: inset 0 1px var(--tone-454545); }
.tab > button:first-child { font-size: 15px; padding: 8px 5px 8px 11px; gap: 8px; }
.tab > button:first-child:hover { background: transparent; }
.tab-name { max-width: 28ch; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tab-file-icon { font: bold 14px/1 var(--mono); color: light-dark(#796000, #e5c95c); }
.tab[data-tone="blue"] .tab-file-icon, .document-row[data-tone="blue"] .sidebar-file-icon { color: light-dark(#206b99, #78b8ed); }
.tab[data-tone="violet"] .tab-file-icon, .document-row[data-tone="violet"] .sidebar-file-icon { color: light-dark(#794cac, #bd9de8); }
.tab[data-tone="green"] .tab-file-icon, .document-row[data-tone="green"] .sidebar-file-icon { color: light-dark(#427536, #9bc987); }
.tab[data-tone="rose"] .tab-file-icon, .document-row[data-tone="rose"] .sidebar-file-icon { color: light-dark(#a63f64, #ec93af); }
.tab[data-tone="aqua"] .tab-file-icon, .document-row[data-tone="aqua"] .sidebar-file-icon { color: light-dark(#16736c, #82cec4); }
.tab svg { width: 16px; height: 16px; }
.tab-dot { height: 4px; width: 4px; border-radius: 50%; background: var(--tone-adadad); margin-left: 9px; }
.modified-dot { display: inline-block; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: #e9a23b; margin-left: 8px; vertical-align: middle; }
#sidebar .folder-drop-active { outline: 2px solid #4c9fe6; outline-offset: -2px; background: #4c9fe622; }
.tab-close { width: 28px; height: 28px; padding: 5px; margin: 0 4px 0 0; align-self: center; flex-shrink: 0; color: var(--tone-c6c6c6); opacity: 0; }
.tab-close svg { width: 18px; height: 18px; stroke-width: 2; }
.tab-close:hover { color: var(--tone-ffffff); background: var(--tone-454545); }
.tab-more { width: 24px; height: 28px; padding: 0; font-size: 20px; opacity: 0; }
.tab:hover :is(.tab-more, .tab-close), .tab:has(:focus-visible) :is(.tab-more, .tab-close), .tab.menu-open .tab-more { opacity: 1; }
@media (hover: none) { .tab-more, .tab-close { opacity: 1; } }
.tab-menu { min-width: 220px; }
.tab-menu button:last-child { color: inherit; border: 0; margin: 0; }
.tab-menu button:nth-child(2), .tab-menu button:nth-child(4) { border-top: 1px solid var(--tone-484848); margin-top: 4px; }
.tab-menu button:disabled { opacity: .4; cursor: default; }
.tabs-empty { margin: auto; padding: 32px; text-align: center; color: var(--tone-bcbcbc); }
.tabs-empty h2 { color: var(--tone-eeeeee); }
.tabs-empty button { display: inline-flex; margin: 8px; }
.tab-add { color: var(--tone-b0b0b0); padding: 0 11px; }
.tab-add svg { width: 14px; }
.content { padding: 0; flex: 1; overflow: auto; display: flex; flex-direction: column; min-height: 0; }
.document-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 11px; flex-shrink: 0; min-height: 31px; }
.eyebrow, .document-heading p { display: none; }
h1 { font-weight: 500; letter-spacing: -.4px; font-size: 21px; line-height: 1.2; margin: 0; display: flex; align-items: center; gap: 7px; color: var(--tone-f2f2f2); }
h1 button { color: var(--tone-a5a5a5); padding: 4px; }
h1 button svg { width: 13px; height: 13px; }
h1 .is-pinned { color: var(--tone-c9c9c9); }
.document-actions { display: flex; gap: 7px; }
.outline-button, .primary-button { border-radius: 4px; font-size: 15px; font-weight: 500; padding: 6px 10px; white-space: nowrap; min-height: 29px; }
.outline-button { background: var(--tone-272727); border: 0; color: var(--tone-dcdcdc); }
.primary-button { background: var(--tone-575757); color: var(--tone-f7f7f7); border: 0; }
.primary-button:hover { background: var(--tone-696969); }
.outline-button svg, .primary-button svg { width: 13px; height: 13px; }
.editor-card { background: var(--tone-1b1b1b); border: 0; border-radius: 0; display: flex; flex-direction: column; flex: 1; min-height: 240px; overflow: hidden; }
.editor-toolbar { background: var(--tone-292929); display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; border: 0; flex-shrink: 0; }
.view-switch { display: flex; background: var(--tone-1b1b1b); border: 0; border-radius: 4px; padding: 2px; gap: 2px; }
.view-switch button { padding: 6px 11px; font-size: 15px; color: var(--tone-aeaeae); border-radius: 3px; gap: 5px; }
.view-switch button svg { width: 17px; height: 17px; }
.view-switch button.active { background: var(--tone-444444); color: var(--tone-ececec); }
.toolbar-actions { display: flex; align-items: center; gap: 3px; }
.editor-view-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.editor-view-actions .document-actions { width: auto; margin-left: 0; flex-wrap: nowrap; }
.toolbar-actions button { width: 34px; height: 34px; color: var(--tone-bcbcbc); }
.toolbar-actions svg { width: 19px; height: 19px; }
.toolbar-group { display: flex; align-items: center; gap: 2px; }
.toolbar-divider { width: 1px; height: 20px; background: var(--tone-454545); margin: 0 7px; flex-shrink: 0; }
.editor-toolbar > .toolbar-search { margin-left: auto; flex-wrap: nowrap; width: auto; }
.toolbar-search .grid-search { margin-right: 0; }
.grid-search { margin-right: 10px; padding: 1px 7px; border-radius: 4px; background: var(--tone-1d1d1d); display: flex; align-items: center; gap: 5px; color: var(--tone-afafaf); }
.grid-search svg { width: 17px; height: 17px; }
.grid-search input { background: none; border: 0; width: 180px; font-size: 15px; padding: 5px; }
.editor-panes { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.grid-pane { flex: 1; overflow: auto; min-width: 0; padding: 4px 0 20px; }
.grid-pane > .jg { width: max-content; min-width: 100%; box-sizing: border-box; }
/* Root virtual tables use the pane directly. Wrapped tables measure their
   remaining space below the wrapper fields. */
.grid-pane > .jg:has(> .jg-collection > .jg-virtual) { width: 100%; height: 100%; }
.grid-pane > .jg > .jg-collection:has(> .jg-virtual) { height: 100%; display: flex; flex-direction: column; }
.grid-pane > .jg > .jg-collection > .jg-table-toolbar { flex: none; }
.grid-pane > .jg > .jg-collection > .jg-virtual { max-height: 100%; min-height: 0; flex: 1; }
.settings-row input[type="number"] { width: 90px; padding: 6px 8px; background: var(--tone-212121); border: 1px solid var(--tone-454545); border-radius: 4px; }
.app .jg { font-size: 15px; }
.source-pane { display: flex; flex: 1; flex-direction: column; min-width: 0; overflow: hidden; background: var(--tone-1e1e1e); }
.editor-panes.grid .source-pane, .editor-panes.source .grid-pane { display: none; }
.editor-panes.split .source-pane { border: 0; }
.source-label { display: flex; align-items: center; gap: 5px; font-size: 14px; letter-spacing: .7px; color: var(--tone-c3c3c3); padding: 10px 14px; }
.source-label svg { width: 12px; height: 12px; }
.source-label span { margin-left: auto; font-size: 14px; letter-spacing: 0; color: var(--tone-a6a6a6); }
.source-editor { display: flex; flex: 1; min-height: 0; overflow: hidden; position: relative; }
.monaco-source { position: absolute; inset: 0; }
.monaco-source:not([data-ready]) { visibility: hidden; }
.source-loading { padding: 4px 14px; font-size: 13px; color: var(--tone-bcbcbc); }
.source-editor textarea[hidden] { display: none; }
.source-editor pre { margin: 0; padding: 0 10px 15px 12px; color: var(--tone-8f8f8f); text-align: right; font: 15px/26px var(--mono); overflow: hidden; user-select: none; min-width: 36px; }
.source-editor > #source { border: 0; resize: none; flex: 1; min-width: 0; white-space: pre; tab-size: 2; color: var(--tone-dedede); background: transparent; font: 15px/26px var(--mono); padding: 0 12px 15px 0; }
.tree-row { display: grid; grid-template-columns: minmax(120px, 29%) minmax(130px, 1fr) 64px; align-items: center; min-height: 36px; border: 0; padding-right: 14px; font: 16px var(--mono); gap: 10px; }
.tree-row:hover { background: var(--tone-2a2a2a); }
.tree-row.selected { background: var(--tone-343434); }
.node-key { justify-content: flex-start; padding: 3px 0; min-width: 0; gap: 6px; font: 16px var(--mono); color: var(--tone-e3e3e3); }
.node-key span { overflow: hidden; text-overflow: ellipsis; }
.node-key svg { width: 10px; height: 10px; color: var(--tone-ababab); transition: transform .12s; }
.expanded > .node-key > svg { transform: rotate(90deg); }
.node-key:hover { background: none; color: var(--tone-f2f2f2); }
.node-leaf { width: 10px; flex-shrink: 0; }
.type-pill { font-size: 14px; color: var(--tone-bdbdbd); background: var(--tone-353535); border-radius: 3px; padding: 1px 4px; white-space: nowrap; margin-left: 3px; }
.node-value { color: var(--tone-c0c0c0); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15px; }
.node-value.string { color: var(--tone-dadada); }
.node-value.number, .number { color: var(--tone-d1d1d1); }
.node-value.boolean, .boolean { color: var(--tone-d5d5d5); }
.node-type { font-size: 14px; color: var(--tone-a4a4a4); text-align: right; }
.table-wrap { margin: 6px 12px 10px 33px; border: 0; border-radius: 4px; overflow: auto; }
table { border-collapse: collapse; white-space: nowrap; width: 100%; font: 15px var(--mono); }
th, td { text-align: left; padding: 10px 14px; border: 0; border: 0; max-width: 290px; overflow: hidden; text-overflow: ellipsis; }
th { font-weight: 500; background: var(--tone-2f2f2f); color: var(--tone-dfdfdf); font-size: 15px; }
th span { font: 13px 'DM Sans', sans-serif; color: var(--tone-adadad); margin-left: 6px; }
td { color: var(--tone-dedede); cursor: cell; }
td.string { color: var(--tone-dedede); }
td.boolean { color: var(--tone-d3d3d3); }
td.number { color: var(--tone-d1d1d1); }
td:where(:not(.jg *)):hover { background: var(--tone-3b3b3b); }
.table-wrap tr:last-child > td { border-bottom: 0; }
.row-number { color: var(--tone-a4a4a4); font-size: 14px; text-align: center; min-width: 30px; padding: 8px; }
.cell-input { width: 100%; border: 0; background: var(--tone-242424); padding: 3px; font: 16px var(--mono); }
.editor-footer { display: none; }
.editor-footer > span:first-child { display: flex; gap: 5px; align-items: center; color: var(--tone-cccccc); }
.editor-footer svg { width: 11px; height: 11px; }
.footer-separator { padding: 0 6px; }
.workspace-hint { display: none; }
.statusbar { display: none; }
.statusbar > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-right { display: flex; gap: 13px; align-items: center; white-space: nowrap; }
.status-right > span:first-child { font: 14px 'DM Sans', sans-serif; }
.validation { font-size: 16px; background: var(--tone-2e2e2e); color: var(--tone-dbdbdb); padding: 8px 12px; flex-shrink: 0; }
.match { background: var(--tone-3a3a3a); }
.limit-note { font-size: 15px; color: var(--tone-bebebe); padding: 6px 24px; }

.toast { position: fixed; inset: auto auto 36px 50%; margin: 0; transform: translateX(-50%); background: var(--tone-414141); color: var(--tone-f2f2f2); border: 0; padding: 10px 17px; border-radius: 6px; box-shadow: 0 6px 25px #00000055; z-index: 20; max-width: 85vw; font-size: 16px; }
.toast::backdrop { background: transparent; pointer-events: none; }
dialog:has(.settings-layout) { width:800px; max-width:calc(100vw / var(--ui-zoom, 1) - 32px); padding:24px; overflow:hidden; }
.settings-layout { display:grid; grid-template-columns:210px minmax(0,1fr); margin-top:20px; min-height:420px; height:min(520px,65dvh / var(--ui-zoom, 1)); border-top:1px solid var(--tone-454545); }
.settings-navigation { display:flex; flex-direction:column; gap:5px; padding:18px 16px 18px 0; border-right:1px solid var(--tone-454545); }
.settings-navigation button,.settings-navigation > a { display:grid; grid-template-columns:17px minmax(0,1fr); align-items:center; text-align:left; gap:7px; padding:11px 12px; font-size:14px; line-height:1.4; color:var(--tone-b5b5b5); border-radius:7px; }
.settings-navigation > a { text-decoration:none; }
.settings-navigation > a > span,.settings-navigation > #desktop-legal-settings > span { grid-column:2; }
.settings-navigation button[aria-selected="true"] { background:var(--tone-343434); color:var(--tone-f2f2f2); }
.settings-navigation button svg { width:17px; height:17px; }
.settings-navigation > small { margin-top:auto; padding:20px 10px 0; font-size:11px; color:var(--tone-939393); line-height:1.6; }
.settings-panels { overflow:auto; padding:22px 0 10px 26px; min-width:0; }
.settings-section-heading { margin-bottom:20px; }
.settings-section-heading h3 { margin:0; font-size:20px; font-weight:600; }
dialog .settings-section-heading p { margin:7px 0 0; font-size:13px; line-height:1.6; color:var(--tone-a7a7a7); }
.settings-layout .settings-row { gap:24px; padding:18px 0; border-bottom:1px solid var(--tone-454545); }
.settings-layout .settings-row strong { font-size:15px; font-weight:550; }
.settings-layout .settings-row small { font-size:13px; line-height:1.6; }
.settings-layout .settings-row input,.settings-layout .settings-row select { flex-shrink:0; }
.settings-layout .settings-row input[type="checkbox"] { width:17px; height:17px; accent-color:#5287b8; }
.settings-layout [role="status"]:empty { display:none; }
.settings-layout .settings-version { margin-top:0; }
@media(max-width:560px) {
  dialog:has(.settings-layout) { padding:18px; }
  .settings-layout { grid-template-columns:116px minmax(0,1fr); min-height:300px; }
  .settings-navigation { padding-right:8px; }
  .settings-navigation button,.settings-navigation > a { padding:10px 6px; font-size:12px; gap:5px; }
  .settings-navigation > small { padding:12px 4px 0; }
  .settings-panels { padding-left:14px; }
  .settings-layout .settings-row { flex-wrap:wrap; gap:10px; }
}
dialog { width: 410px; max-width: 90vw; border: 0; border-radius: 8px; padding: 22px; color: var(--tone-eaeaea); background: var(--tone-252525); box-shadow: 0 25px 100px #00000088; }
dialog::backdrop { background: #0b0b0b99; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.dialog-heading h2 { font-size: 21px; letter-spacing: -.3px; font-weight: 500; margin: 0; }
.dialog-heading button { padding: 3px; color: var(--tone-bdbdbd); }
#dialog:has(#rename-form) { border: 1px solid var(--tone-454545); border-radius: 14px; padding: 24px; }
#rename-form { margin-top: 22px; }
#rename-form label { display: block; margin-bottom: 8px; font-size: 14px; color: var(--tone-c8c8c8); }
.rename-field { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--tone-1b1b1b); border: 1px solid var(--tone-454545); border-radius: 7px; color: var(--tone-bdbdbd); }
.rename-field:focus-within { border-color: var(--accent); }
.rename-field input { flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; font: 16px var(--mono); }
.rename-field input:focus-visible { outline: none; box-shadow: none; }
#rename-error { font-size: 14px; margin: 8px 0 0; }
.rename-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.rename-actions button { padding: 7px 14px; border-radius: 6px; }
dialog p { font-size: 17px; line-height: 1.8; color: var(--tone-c8c8c8); margin: 15px 0; }
.dialog-notice { padding: 12px; background: var(--tone-313131); font-size: 16px; line-height: 1.8; color: var(--tone-cfcfcf); border-radius: 4px; margin: 16px 0; }
.profile-preview { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.profile-preview > .avatar { margin: 0; display: flex; align-items: center; justify-content: center; }
.profile-preview p { margin: 3px 0; font-size: 16px; }
.shortcut-row { display: flex; justify-content: space-between; padding: 9px 0; border: 0; font-size: 16px; }
.shortcut-table-wrap { overflow-x: auto; }
dialog:has(.shortcut-table) { width: 800px; }
.shortcut-table { width: 100%; border-collapse: collapse; table-layout: fixed; white-space: normal; font: 14px 'DM Sans', sans-serif; text-align: left; }
.shortcut-table th, .shortcut-table td { padding: 8px; max-width: none; overflow: visible; text-overflow: clip; cursor: default; border-bottom: 1px solid var(--tone-484848); }
.shortcut-table tbody th { font-weight: 400; }
.shortcut-table td { min-width: 130px; }
.settings-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border: 0; }
.settings-row strong { font-weight: 500; font-size: 17px; }
.settings-version { display: grid; gap: 7px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--tone-484848); color: var(--tone-b9b9b9); font-size: 15px; }
.settings-version-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--tone-eaeaea); }
.settings-version-heading strong { font-weight: 600; }
.settings-version small { font-size: 13px; }
.settings-version code { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.settings-update-status { font-size: 13px; line-height: 1.6; }
.settings-version button { justify-self: start; margin-top: 3px; }
.settings-version button[hidden] { display: none; }
.settings-row small { display: block; margin-top: 5px; color: var(--tone-b9b9b9); font-size: 16px; }
input[type=checkbox] { accent-color: var(--accent); width: 17px; height: 17px; }
.compact .tree-row { min-height: 32px; }
.compact td, .compact th { padding-top: 5px; padding-bottom: 5px; }

@media (max-width: 1000px) {
  .app { grid-template-columns: 52px var(--sidebar-size) minmax(0, 1fr); }
  .app.drawer-closed { grid-template-columns: 52px 0 minmax(0, 1fr); }
  .tree-row { grid-template-columns: 125px minmax(90px, 1fr) 54px; }
}
@media (max-width: 760px) {
  .app, .app.drawer-closed { grid-template-columns: 52px minmax(0, 1fr); }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 52px; width: var(--sidebar-size); z-index: 3; box-shadow: 12px 0 24px #00000055; transition: transform .16s; }
  .drawer-closed .sidebar { transform: translateX(-110%); pointer-events: none; }
  .document-heading { flex-wrap: wrap; gap: 8px; }
  .grid-search input { width: 95px; }
  .editor-panes.split { flex-direction: column; }
  .editor-card { min-height: 300px; }
  .status-right { gap: 8px; }
  .status-right > span:first-child { display: none; }
  .comparison-inputs { grid-template-columns: 1fr; }
  .comparison-inputs textarea { min-height: 140px; }
  .toolbar-actions { gap: 0; }
  .toolbar-actions button { width: 23px; }
  .view-switch button { padding: 4px 6px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.toolbar-actions .is-pinned { color: var(--tone-cacaca); background: var(--tone-323232); }

td:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Adjacent surfaces replace separator lines; grid rows stay plain. */
.wordmark { display: inline-flex; align-items: baseline; font-size: 22px; font-weight: 700; letter-spacing: .2px; color: var(--tone-f5f5f5); }
.wordmark > span { font-weight: 500; color: var(--tone-d5d5d5); }
.editor-panes.split { gap: 0; background: var(--tone-111111); }
.editor-panes.split > .grid-pane { flex: var(--grid-share, .5) 1 0; min-height: 0; }
.editor-panes.split > .source-pane { flex: var(--source-share, .5) 1 0; min-height: 0; }
.split-resize { flex: 0 0 8px; position: relative; cursor: col-resize; touch-action: none; }
.split-resize::after { content: ''; position: absolute; width: 3px; height: 42px; left: 3px; top: calc(50% - 21px); border-radius: 3px; background: var(--tone-666); opacity: .65; }
.split-resize:hover::after, .split-resize:focus-visible::after, .resizing-split .split-resize::after { opacity: 1; background: var(--tone-b5b5b5); }
.split-resize:focus-visible { outline: 1px solid var(--tone-aaa); outline-offset: -1px; }
.resizing-split, .resizing-split * { cursor: col-resize !important; user-select: none !important; }
@media (max-width: 760px) {
  .editor-panes.split > .grid-pane { padding: 0; }
  .split-resize { cursor: row-resize; }
  .split-resize::after { width: 42px; height: 3px; left: calc(50% - 21px); top: 3px; }
  .resizing-split, .resizing-split * { cursor: row-resize !important; }
}
.grid-pane { background: var(--tone-1b1b1b); }
.grid-intake { display: flex; align-items: center; justify-content: center; padding: 36px; background-image: radial-gradient(var(--tone-343434) .7px, transparent .7px); background-size: 22px 22px; }
.grid-intake-content { width: min(760px,100%); text-align: center; margin: auto; }
.grid-intake-mark { display: inline-grid; place-items: center; width: 60px; height: 60px; border: 1px solid var(--tone-484848); border-radius: 18px; background: var(--tone-252525); margin-bottom: 8px; }
.grid-intake-mark svg { width: 28px; height: 28px; }
.grid-intake h2 { font-size: 28px; font-weight: 600; letter-spacing: -.6px; margin: 12px 0 8px; }
.grid-intake p { color: var(--tone-b5b5b5); font-size: 16px; margin: 0 0 28px; }
.grid-intake-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.grid-intake-options > * { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 166px; padding: 22px 16px; border: 1px solid var(--tone-484848); border-radius: 14px; background: var(--tone-252525); color: var(--tone-eaeaea); }
.grid-intake-options > button:hover { background: var(--tone-343434); border-color: var(--tone-939393); }
.grid-intake-options > .grid-intake-drop { border-style: dashed; background: var(--tone-1b1b1b); }
.grid-intake-options svg { width: 27px; height: 27px; color: var(--tone-c8c8c8); }
.grid-intake-options strong { font-size: 15px; font-weight: 550; }
.grid-intake-options small { color: var(--tone-b5b5b5); font-size: 12px; line-height: 1.5; }
.grid-intake-note { display: block; margin-top: 22px; color: var(--tone-939393); font-size: 12px; }
.grid-intake.is-dragging { outline: 2px dashed var(--tone-b5b5b5); outline-offset: -12px; }
.editor-card:has(.grid-intake) .editor-footer,.editor-card:has(.grid-intake) .grid-search { display: none; }
.paste-json-input { width: 100%; min-height: 190px; resize: vertical; padding: 12px; background: var(--tone-191919); color: inherit; border: 1px solid var(--tone-575757); border-radius: 9px; font: 13px/1.6 var(--mono); }
@media(max-width:800px){ .grid-intake { padding: 22px; } .grid-intake-options { grid-template-columns: 1fr; gap: 10px; } .grid-intake-options > * { min-height: 105px; padding: 15px; gap: 8px; } .grid-intake h2 { font-size: 24px; } }
tbody tr:where(:not(.jg *)):hover { background: var(--tone-303030); }
.tree-row.selected { background: var(--tone-383838); }

/* Zoom controls remain reachable at both ends of the supported range. */
dialog { max-height: calc(90dvh / var(--ui-zoom, 1)); overflow: auto; max-width: calc(90vw / var(--ui-zoom, 1)); }
.zoom-settings { padding: 18px 0 12px; }
.zoom-settings label { display: block; }
.zoom-settings strong { font-size: 15px; font-weight: 500; }
.zoom-settings small { display: block; color: var(--tone-b5b5b5); font-size: 13px; margin-top: 7px; }
.zoom-controls { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.zoom-controls button { width: 30px; height: 30px; background: var(--tone-383838); font-size: 20px; flex-shrink: 0; }
.zoom-controls input { flex: 1; min-width: 50px; width: 100%; accent-color: var(--tone-d8d8d8); }
.zoom-controls output { min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
.zoom-details { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; color: var(--tone-b5b5b5); font-size: 12px; }
.zoom-details button { padding: 5px 7px; color: var(--tone-ededed); }
#zoom-status { display: block; color: var(--tone-b5b5b5); font-size: 12px; margin-top: 8px; }

.editor-toolbar { flex-wrap: wrap; gap: 8px; }
.toolbar-actions { flex-wrap: wrap; margin-left: auto; }
@media (max-width: 760px) { .toolbar-actions { width: 100%; justify-content: flex-end; } .grid-search { margin-right: auto; } }

.sidebar svg { stroke-width: 1.85; }

/* A generous invisible hit area; the grip appears on hover or keyboard focus. */
.sidebar-resize { position: absolute; left: calc(52px + var(--sidebar-size) - 4px); top: 0; bottom: 0; width: 8px; cursor: col-resize; touch-action: none; z-index: 6; }
.sidebar-resize::after { content: ''; position: absolute; width: 3px; height: 42px; left: 3px; top: calc(50% - 21px); border-radius: 3px; background: var(--tone-666); opacity: .35; }
.sidebar-resize:hover::after, .sidebar-resize:focus-visible::after, .resizing-sidebar .sidebar-resize::after { opacity: 1; background: var(--tone-b5b5b5); }
.sidebar-resize:focus-visible { outline: 1px solid var(--tone-aaa); outline-offset: -1px; }
.resizing-sidebar, .resizing-sidebar * { cursor: col-resize !important; user-select: none !important; }
.resizing-sidebar { transition: none; }

/* Reordering uses a temporary insertion marker, not permanent tab borders. */
.tab[draggable] > button:first-child { cursor: grab; }
.tab.tab-dragging { opacity: .45; }
.tab.drop-before::after, .tab.drop-after::after { content: ''; position: absolute; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--tone-eeeeee); pointer-events: none; z-index: 1; }
.tab.drop-before::after { left: 0; }
.tab.drop-after::after { right: 0; }

/* Shared neutral palette keeps every surface and control theme-aware. */
:root {
  --tone-0c0c0c: #0c0c0c;
  --tone-111111: #111111;
  --tone-171717: #171717;
  --tone-191919: #191919;
  --tone-1b1b1b: #1b1b1b;
  --tone-1d1d1d: #1d1d1d;
  --tone-1e1e1e: #1e1e1e;
  --tone-212121: #212121;
  --tone-242424: #242424;
  --tone-252525: #252525;
  --tone-272727: #272727;
  --tone-292929: #292929;
  --tone-2a2a2a: #2a2a2a;
  --tone-2e2e2e: #2e2e2e;
  --tone-2f2f2f: #2f2f2f;
  --tone-303030: #303030;
  --tone-313131: #313131;
  --tone-323232: #323232;
  --tone-343434: #343434;
  --tone-353535: #353535;
  --tone-383838: #383838;
  --tone-3a3a3a: #3a3a3a;
  --tone-3b3b3b: #3b3b3b;
  --tone-3c3c3c: #3c3c3c;
  --tone-414141: #414141;
  --tone-434343: #434343;
  --tone-444444: #444444;
  --tone-454545: #454545;
  --tone-484848: #484848;
  --tone-4b4b4b: #4b4b4b;
  --tone-575757: #575757;
  --tone-666: #666;
  --tone-696969: #696969;
  --tone-858585: #858585;
  --tone-8f8f8f: #8f8f8f;
  --tone-929292: #929292;
  --tone-939393: #939393;
  --tone-949494: #949494;
  --tone-999999: #999999;
  --tone-9b9b9b: #9b9b9b;
  --tone-a0a0a0: #a0a0a0;
  --tone-a4a4a4: #a4a4a4;
  --tone-a5a5a5: #a5a5a5;
  --tone-a6a6a6: #a6a6a6;
  --tone-a7a7a7: #a7a7a7;
  --tone-a8a8a8: #a8a8a8;
  --tone-a9a9a9: #a9a9a9;
  --tone-aaa: #aaa;
  --tone-aaaaaa: #aaaaaa;
  --tone-ababab: #ababab;
  --tone-adadad: #adadad;
  --tone-aeaeae: #aeaeae;
  --tone-afafaf: #afafaf;
  --tone-b0b0b0: #b0b0b0;
  --tone-b1b1b1: #b1b1b1;
  --tone-b5b5b5: #b5b5b5;
  --tone-b9b9b9: #b9b9b9;
  --tone-bcbcbc: #bcbcbc;
  --tone-bdbdbd: #bdbdbd;
  --tone-bebebe: #bebebe;
  --tone-bfbfbf: #bfbfbf;
  --tone-c0c0c0: #c0c0c0;
  --tone-c3c3c3: #c3c3c3;
  --tone-c6c6c6: #c6c6c6;
  --tone-c8c8c8: #c8c8c8;
  --tone-c9c9c9: #c9c9c9;
  --tone-cacaca: #cacaca;
  --tone-cbcbcb: #cbcbcb;
  --tone-cccccc: #cccccc;
  --tone-cecece: #cecece;
  --tone-cfcfcf: #cfcfcf;
  --tone-d1d1d1: #d1d1d1;
  --tone-d3d3d3: #d3d3d3;
  --tone-d5d5d5: #d5d5d5;
  --tone-d6d6d6: #d6d6d6;
  --tone-d8d8d8: #d8d8d8;
  --tone-d9d9d9: #d9d9d9;
  --tone-dadada: #dadada;
  --tone-dbdbdb: #dbdbdb;
  --tone-dcdcdc: #dcdcdc;
  --tone-dddddd: #dddddd;
  --tone-dedede: #dedede;
  --tone-dfdfdf: #dfdfdf;
  --tone-e3e3e3: #e3e3e3;
  --tone-e7e7e7: #e7e7e7;
  --tone-eaeaea: #eaeaea;
  --tone-ebebeb: #ebebeb;
  --tone-ececec: #ececec;
  --tone-ededed: #ededed;
  --tone-eeeeee: #eeeeee;
  --tone-f0f0f0: #f0f0f0;
  --tone-f2f2f2: #f2f2f2;
  --tone-f3f3f3: #f3f3f3;
  --tone-f5f5f5: #f5f5f5;
  --tone-f7f7f7: #f7f7f7;
  --tone-ffffff: #ffffff;
}
:root[data-theme="light"] {
  color-scheme: light;
  --tone-0c0c0c: #e9ebef;
  --tone-111111: #e9ebef;
  --tone-171717: #ffffff;
  --tone-191919: #ffffff;
  --tone-1b1b1b: #ffffff;
  --tone-1d1d1d: #ffffff;
  --tone-1e1e1e: #f4f5f7;
  --tone-212121: #f4f5f7;
  --tone-242424: #f4f5f7;
  --tone-252525: #f4f5f7;
  --tone-272727: #f4f5f7;
  --tone-292929: #f4f5f7;
  --tone-2a2a2a: #f4f5f7;
  --tone-2e2e2e: #e4e7ec;
  --tone-2f2f2f: #e4e7ec;
  --tone-303030: #e4e7ec;
  --tone-313131: #e4e7ec;
  --tone-323232: #e4e7ec;
  --tone-343434: #e4e7ec;
  --tone-353535: #e4e7ec;
  --tone-383838: #e4e7ec;
  --tone-3a3a3a: #e4e7ec;
  --tone-3b3b3b: #e4e7ec;
  --tone-3c3c3c: #d1d5dc;
  --tone-414141: #d1d5dc;
  --tone-434343: #d1d5dc;
  --tone-444444: #d1d5dc;
  --tone-454545: #d1d5dc;
  --tone-484848: #d1d5dc;
  --tone-4b4b4b: #d1d5dc;
  --tone-575757: #d1d5dc;
  --tone-666: #6e6e6e;
  --tone-696969: #6e6e6e;
  --tone-858585: #6e6e6e;
  --tone-8f8f8f: #6e6e6e;
  --tone-929292: #6e6e6e;
  --tone-939393: #6e6e6e;
  --tone-949494: #6e6e6e;
  --tone-999999: #6e6e6e;
  --tone-9b9b9b: #6e6e6e;
  --tone-a0a0a0: #6e6e6e;
  --tone-a4a4a4: #6e6e6e;
  --tone-a5a5a5: #6e6e6e;
  --tone-a6a6a6: #6e6e6e;
  --tone-a7a7a7: #6e6e6e;
  --tone-a8a8a8: #6e6e6e;
  --tone-a9a9a9: #6e6e6e;
  --tone-aaa: #6e6e6e;
  --tone-aaaaaa: #6e6e6e;
  --tone-ababab: #6d6d6d;
  --tone-adadad: #6b6b6b;
  --tone-aeaeae: #6a6a6a;
  --tone-afafaf: #696969;
  --tone-b0b0b0: #686868;
  --tone-b1b1b1: #676767;
  --tone-b5b5b5: #636363;
  --tone-b9b9b9: #5f5f5f;
  --tone-bcbcbc: #5c5c5c;
  --tone-bdbdbd: #5b5b5b;
  --tone-bebebe: #5a5a5a;
  --tone-bfbfbf: #595959;
  --tone-c0c0c0: #585858;
  --tone-c3c3c3: #555555;
  --tone-c6c6c6: #525252;
  --tone-c8c8c8: #505050;
  --tone-c9c9c9: #4f4f4f;
  --tone-cacaca: #4e4e4e;
  --tone-cbcbcb: #4d4d4d;
  --tone-cccccc: #4c4c4c;
  --tone-cecece: #4a4a4a;
  --tone-cfcfcf: #494949;
  --tone-d1d1d1: #474747;
  --tone-d3d3d3: #454545;
  --tone-d5d5d5: #434343;
  --tone-d6d6d6: #424242;
  --tone-d8d8d8: #404040;
  --tone-d9d9d9: #3f3f3f;
  --tone-dadada: #3e3e3e;
  --tone-dbdbdb: #3d3d3d;
  --tone-dcdcdc: #3c3c3c;
  --tone-dddddd: #3b3b3b;
  --tone-dedede: #3a3a3a;
  --tone-dfdfdf: #393939;
  --tone-e3e3e3: #353535;
  --tone-e7e7e7: #313131;
  --tone-eaeaea: #2e2e2e;
  --tone-ebebeb: #2d2d2d;
  --tone-ececec: #2c2c2c;
  --tone-ededed: #2b2b2b;
  --tone-eeeeee: #2a2a2a;
  --tone-f0f0f0: #282828;
  --tone-f2f2f2: #262626;
  --tone-f3f3f3: #252525;
  --tone-f5f5f5: #232323;
  --tone-f7f7f7: #212121;
  --tone-ffffff: #1c1c1c;
}
select { font: inherit; color: inherit; background: var(--tone-292929); border: 1px solid var(--tone-666); border-radius: 5px; padding: 7px 10px; }
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#theme-status { display: block; color: var(--tone-b5b5b5); font-size: 13px; }
.monaco-editor .json-connect-line { background: #80b7f326; }
.monaco-editor .json-connect-gutter { border-left: 3px solid #80b7f3; }
:root[data-theme="light"] .monaco-editor .json-connect-line { background: #367bc226; }
:root[data-theme="light"] .document-menu button[data-menu-action="delete"] { color: #b42318; }
:root[data-theme="light"] .jg { --jg-bg: #ffffff; --jg-row-alt: #f5f6f8; --jg-head: #e8ecf1; --jg-line: #d8dce3; --jg-text: #252a33; --jg-muted: #606977; --jg-selected: #aec7e4; }
:root[data-theme="light"] .jg { --jg-edit-bg: #f1f6fd; --jg-edit-shadow: inset 0 2px 5px #1a34552e, inset 0 0 0 1px #507eac88, inset 0 -2px 0 #507eac; --jg-edit-caret: #245a9b; }
:root[data-theme="light"] .jg .jg-filter { background: #fff; }
:root[data-theme="light"] .jg button:hover { background: #0000000c; }

.tabs-empty { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.tabs-empty h2 { margin: 0 0 8px; font-size: 25px; font-weight: 550; letter-spacing: -.5px; }
.empty-document-icon > svg { width: 42px; height: 42px; color: var(--tone-939393); stroke-width: 1.1; }
.empty-document-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.empty-document-actions button { min-height: 40px; padding: 10px 16px; margin: 0; font-size: 14px; }

.tabs-empty.grid-intake { width: 100%; flex: 1; margin: 0; }
.tabs-empty.grid-intake button { display: flex; margin: 0; }

.grid-search-navigation { display: flex; align-items: center; gap: 4px; margin-left: -6px; }
.grid-search-navigation[hidden] { display: none; }
.grid-search-navigation span { white-space: nowrap; font-size: 12px; color: var(--tone-afafaf); }
.grid-search-navigation button { width: 28px; height: 28px; padding: 2px; }
.grid-search #grid-search-clear { width: 22px; height: 22px; padding: 3px; border: 0; background: transparent; color: inherit; }
.grid-search #grid-search-clear[hidden] { display: none; }
.monaco-source .find-widget { display: none !important; }
.monaco-source .source-search-match { background: #ffe49a; color: #302000 !important; border-radius: 2px; }
.monaco-source .source-search-active { background: #a64b00; color: #fff !important; outline: 1px solid #e99a36; }

/* Explorer sidebar: compact file tree, shared tab palette, quiet chrome. */
.sidebar { border-right: 1px solid var(--tone-303030); }
.sidebar-brand { height: 52px; }
.sidebar-explorer { display: flex; align-items: center; justify-content: space-between; padding: 6px 14px 8px; gap: 8px; }
.sidebar-explorer > span { font-size: 15px; font-weight: 600; color: var(--tone-d6d6d6); }
.sidebar-explorer .sidebar-actions { display: flex; gap: 1px; padding: 0; }
.sidebar-explorer .sidebar-actions button { width: 27px; height: 28px; padding: 5px; background: transparent; color: var(--tone-a7a7a7); }
.sidebar-explorer .sidebar-actions button:hover { background: var(--tone-303030); color: var(--tone-f2f2f2); }
.sidebar-explorer .sidebar-actions button svg { width: 17px; height: 17px; }
.sidebar-search { margin: 2px 12px 8px; padding: 0 8px; gap: 7px; border: 1px solid var(--tone-393939); border-radius: 5px; background: var(--tone-1d1d1d); }
.sidebar-search:focus-within { border-color: var(--tone-858585); }
.sidebar-search input { font-size: 14px; padding: 7px 0; }
.sidebar-search kbd { font-size: 11px; opacity: .6; }
.sidebar-scroll { padding: 0 8px; }
.nav-section { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--tone-303030); }
.nav-section:first-child { margin-top: 0; border-top: 0; }
.nav-section h2 { justify-content: flex-start; gap: 5px; font-size: 11px; letter-spacing: .8px; min-height: 25px; padding: 0 5px; margin-bottom: 5px; }
.nav-section h2 > span { margin-left: auto; }
.nav-section h2 .section-toggle { width: 18px; height: 22px; padding: 2px; flex: 0 0 18px; }
.section-toggle svg { width: 12px; height: 12px; transform: rotate(90deg); }
.section-collapsed .section-toggle svg { transform: none; }
.section-collapsed > :not(h2) { display: none; }
.document-row { position: relative; min-height: 32px; border-radius: 5px; }
.document-row.selected { background: var(--tone-343434); box-shadow: inset 2px 0 var(--tone-858585); }
.document-row .document-link { min-height: 32px; padding: 5px 8px; font-size: 14px; gap: 8px; background: transparent; }
.document-link .sidebar-file-icon { flex: 0 0 19px; overflow: visible; font: 600 15px/1 var(--mono); color: light-dark(#796000, #e5c95c); }
.document-link .document-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-link .modified-dot { margin-left: auto; flex-shrink: 0; width: 6px; height: 6px; flex-basis: 6px; }
.document-more { flex-basis: 23px; height: 25px; font-size: 19px; margin-right: 3px; }
.folder { position: relative; margin-bottom: 2px; }
.folder[open]::before { content: ''; position: absolute; top: 32px; bottom: 4px; left: 15px; width: 1px; background: var(--tone-393939); pointer-events: none; }
.folder summary { min-height: 32px; padding: 4px 5px; font-size: 14px; gap: 7px; border-radius: 4px; }
.folder summary:hover { background: var(--tone-272727); }
.folder summary > span { overflow: hidden; text-overflow: ellipsis; }
.folder summary > svg:nth-child(2) { width: 18px; height: 18px; }
.folder summary small { font-size: 11px; opacity: .65; }
.folder .document-row { margin-left: 22px; }
.folder .document-link { padding-left: 8px; }
.nav-empty { font-size: 12px; padding: 0 12px; color: var(--tone-858585); }
.sidebar-bottom { padding: 9px 8px; border-top: 1px solid var(--tone-303030); background: var(--tone-191919); }
.sidebar-account { gap: 8px; padding: 8px 6px; }
.sidebar-account > span:not(.pro-badge) { font-size: 13px; }

.document-shared { display:inline-flex; align-items:center; justify-content:center; cursor:default; flex: 0 0 24px; width:24px; height:26px; padding:4px; color:var(--tone-b5b5b5); }
.document-shared svg { width:14px; height:14px; }

.rail-bottom .upgrade-hint { position: relative; }
.rail-bottom .upgrade-hint::after { content: ""; position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: #e9a23b; }

/* Compare is a separate workspace; Home retains the document layout. */
.app.compare-mode { grid-template-columns:52px minmax(0,1fr); }
.app.compare-mode > .workspace { grid-column:2; }
.compare-view-switch button { padding:7px 12px; font-size:14px; }
.compare-workspace[data-comparison-view="source"] .compare-grid-scroll { overflow:hidden; }
.compare-code { position:absolute; inset:0; overflow:hidden; background:var(--tone-1b1b1b); }
.compare-code-editor { position:absolute; inset:0; }
.compare-code-fallback { position:absolute; inset:0; margin:0; padding:14px; overflow:auto; color:var(--tone-f2f2f2); background:var(--tone-1b1b1b); font:15px/24px var(--mono); white-space:pre; tab-size:2; }
.compare-code-fallback { color:transparent; pointer-events:none; scrollbar-width:none; }
.compare-code-input { position:absolute; inset:0; width:100%; height:100%; resize:none; margin:0; padding:14px; border:0; background:transparent; color:var(--tone-f2f2f2); font:15px/24px var(--mono); white-space:pre; overflow:auto; tab-size:2; }
.compare-code-status { position:absolute; bottom:6px; right:10px; padding:4px 7px; border-radius:4px; background:var(--tone-212121); color:var(--muted); font-size:11px; pointer-events:none; }
.compare-code-change { background:color-mix(in srgb,var(--compare-side) 9%,transparent); }
.compare-code-value { background:color-mix(in srgb,var(--compare-side) 20%,transparent); }
.compare-code-gutter { border-left:3px solid var(--compare-side); margin-left:3px; }
.compare-code-active-line { background:color-mix(in srgb,var(--compare-focus) 9%,transparent); }
.compare-code-active { outline:2px solid var(--compare-focus); outline-offset:-1px; background:color-mix(in srgb,var(--compare-side) 20%,transparent); }
.compare-code-context { border-bottom:1px dashed var(--compare-focus); }
.compare-code-active-gutter { border-left:3px solid var(--compare-focus); margin-left:3px; }
.recovery-navigation { display:flex; gap:8px; padding:12px; }
.recovery-row { padding:14px 0; border-bottom:1px solid var(--border); display:grid; gap:6px; }
.recovery-row strong, .recovery-row p, .recovery-row small { overflow-wrap:anywhere; }
.recovery-row small { opacity:.7; }
.recovery-row label { display:grid; gap:4px; }
.recovery-row button { justify-self:start; }

.account-photo { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; object-fit: cover; }

.folder > .folder { margin-left: 22px; }
.nav-section h2 .section-new-folder { margin-left: auto; }
