:root {
  color-scheme: light;
  --canvas: #edf1f5;
  --shell: #152331;
  --shell-rule: #314354;
  --shell-text: #f1f5fa;
  --shell-muted: #b9cbd6;
  --cyan: #62e0d3;
  --cyan-soft: #ddf3f0;
  --teal: #0c706b;
  --teal-dark: #075752;
  --teal-line: #98d4ca;
  --paper: #fff;
  --explorer: #f8fafc;
  --text: #172a39;
  --body: #364b5a;
  --muted: #596c7b;
  --line: #cdd7df;
  --line-soft: #dce3e9;
  --field: #e9eef3;
  --selected: #e3f1f1;
  --dark: #111923;
  --dark-rule: #32404e;
  --editor: #1b222c;
  --dark-ink: #e0e9ee;
  --dark-muted: #b0bfca;
  --dark-active: #233444;
  --danger: #a93539;
  --danger-dark: #8b2931;
  --danger-bg: #fdebed;
  --focus: #137d89;
  --overlay: rgb(16 26 37 / .56);
  --shadow: 0 4px 18px rgb(28 48 65 / .08);
  --dialog-shadow: 0 20px 65px rgb(13 31 44 / .25);
  --clear: transparent;
  --body-font: "Inter", "Microsoft YaHei UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --gutter: 30px;
  --header: 63px;
  --shell-width: 1280px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: clip; }
body { background: var(--canvas); color: var(--text); font: 400 15px/1.55 var(--body-font); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { min-width: 0; overflow-wrap: break-word; }
button, input, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
select, summary { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .6; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.document :focus-visible, .masthead :focus-visible { outline-color: var(--cyan); }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: absolute; z-index: 3; left: 8px; top: 8px; padding: 8px 14px; border-radius: 4px; background: var(--paper); color: var(--text); }
.icon { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.shell { width: min(var(--shell-width), calc(100% - var(--gutter) * 2)); margin-inline: auto; }
.masthead { color: var(--shell-text); background: var(--shell); border-bottom: 1px solid var(--shell-rule); }
.masthead-inner { display: flex; justify-content: space-between; align-items: center; height: var(--header); gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; background: var(--cyan); border-radius: 7px; color: var(--shell); }
.brand-mark .icon { width: 23px; height: 23px; stroke-width: 2; }
h1 { font-weight: 720; font-size: 23px; letter-spacing: -.04em; line-height: 1.2; }
.button, .icon-button, .toolbar-button, .explorer-toggle {
  display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; flex: none;
  padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper);
  color: var(--body); white-space: nowrap; font-size: 13px; font-weight: 600; line-height: 1.3;
}
.button.primary, .button.add { border-color: var(--teal); background: var(--teal); color: var(--paper); }
.button.danger { border-color: var(--danger); color: var(--paper); background: var(--danger); }
.button.admin-toggle { border-color: var(--shell-rule); background: var(--shell); color: var(--shell-text); }
.admin-toggle .icon { color: var(--shell-muted); width: 15px; }
.main-shell { padding-block: 20px; }
.workbench {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); width: 100%; height: calc(100vh - var(--header) - 41px);
  height: calc(100dvh - var(--header) - 41px); min-height: 410px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 9px; background: var(--explorer); box-shadow: var(--shadow);
}
.explorer { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--explorer); border-right: 1px solid var(--line); }
.explorer-head { display: flex; flex: none; align-items: center; justify-content: space-between; height: 54px; padding-inline: 17px; border-bottom: 1px solid var(--line-soft); }
.explorer-head h2 { display: inline-flex; align-items: center; gap: 9px; font-size: 16px; line-height: 1.4; font-weight: 700; }
.explorer-head .icon { color: var(--muted); }
.explorer-toggle { display: none; }
#explorer-body { display: flex; flex-direction: column; min-height: 0; flex: 1 1 0; }
.tabs { display: grid; flex: none; grid-template-columns: 1fr 1fr; gap: 3px; margin: 15px 14px 12px; padding: 3px; border: 1px solid var(--line-soft); border-radius: 6px; background: var(--field); }
.tabs button { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-width: 0; height: 31px; padding: 0 6px; border: 1px solid var(--clear); border-radius: 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.tabs button[aria-selected="true"] { border-color: var(--line); color: var(--text); background: var(--paper); }
.tabs .icon { width: 15px; height: 15px; }
.tab-panel { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; }
.filters { padding: 0 14px 14px; }
.search-control, .select-control { display: flex; align-items: center; min-width: 0; height: 36px; position: relative; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); }
.search-control > .icon { width: 15px; height: 15px; color: var(--muted); margin-inline: 10px 7px; }
.search-control input, .select-control select { flex: 1; height: 100%; width: 100%; min-width: 0; border: 0; border-radius: 4px; background: var(--clear); font-size: 13px; }
.search-control input { padding: 0 8px 0 0; }
.search-control input::placeholder, form input::placeholder { color: var(--muted); opacity: 1; }
.search-control:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.search-control input:focus-visible { outline: 0; }
.selects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 7px; }
.select-control { height: 32px; }
.select-control select { appearance: none; padding: 0 17px 0 7px; color: var(--body); font-size: 12px; text-overflow: ellipsis; }
.select-control > .icon { width: 12px; height: 12px; position: absolute; right: 4px; color: var(--muted); pointer-events: none; }
.list-heading { display: flex; justify-content: space-between; align-items: center; padding: 9px 18px; border-block: 1px solid var(--line-soft); color: var(--muted); font-size: 12px; font-weight: 550; line-height: 1.5; }
.list-heading b { font: 600 12px/1 var(--mono); }
.files { min-height: 0; overflow-y: auto; scrollbar-width: thin; padding-block: 4px; }
.file-row { display: flex; align-items: center; min-width: 0; padding-right: 6px; }
.file-row:has(.file-entry[aria-current="true"]) { background: var(--selected); }
.quick-copy { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; height: 34px; padding: 0; border-radius: 5px; color: var(--muted); }
.quick-copy .icon { width: 15px; height: 15px; }
.quick-copy .check-icon, .quick-copy.is-copied .copy-icon { display: none; }
.quick-copy.is-copied .check-icon { display: block; color: var(--teal); }
.file-entry { display: flex; align-items: center; gap: 11px; width: 100%; min-width: 0; min-height: 49px; padding: 9px 16px; border-left: 3px solid var(--clear); text-align: left; }
.file-entry:focus-visible { outline-offset: -3px; }
.file-icon { color: var(--teal); width: 17px; }
.file-info { min-width: 0; display: grid; gap: 2px; }
.file-info strong, .file-info > span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file-info strong { color: var(--text); font: 600 14px/1.45 var(--mono); }
.file-info > span { color: var(--muted); font: 400 11px/1.45 var(--mono); }
.file-entry.active, .file-entry[aria-current="true"], .catalog-button.active, .catalog-button[aria-current="true"] { border-left-color: var(--teal); background: var(--selected); }
.ranked .file-icon { display: none; }
.rank-position { flex: none; min-width: 21px; color: var(--teal); font: 600 13px/1.4 var(--mono); }
.file-copies { margin-left: auto; padding-left: 6px; color: var(--muted); font: 500 13px/1.4 var(--mono); }
.file-copies::after { content: " 次"; font: 400 11px/1.4 var(--body-font); }
.explorer-footer { flex: none; margin-top: auto; border-top: 1px solid var(--line-soft); }
.catalog-button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 5px 16px; border-left: 3px solid var(--clear); color: var(--body); text-align: left; }
.catalog-button .icon { color: var(--teal); }
.catalog-button strong { font: 600 13px/1.5 var(--mono); }
.catalog-button span { margin-left: auto; font-size: 12px; color: var(--muted); }
.admin-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px 14px 12px; }
.admin-tools:has(> [hidden]):not(:has(> :not([hidden]))) { display: none; }
.admin-tools .button { flex: 1; min-height: 34px; padding-inline: 6px; }
.empty-state { margin: 14px; padding: 8px 4px; color: var(--muted); font-size: 13px; }
.empty-state h3 { color: var(--body); font-size: 15px; }
.empty-state p { margin-top: 5px; }
.empty-state .button { margin-top: 10px; }
.document { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--editor); color: var(--dark-ink); }
.document:focus-visible { outline-offset: -3px; }
.document-empty { margin: auto; padding: 20px; color: var(--dark-muted); font-size: 14px; text-align: center; }
#editor-content { display: flex; flex-direction: column; width: 100%; min-width: 0; min-height: 0; flex: 1; }
.document-header { display: flex; align-items: stretch; justify-content: space-between; flex: none; min-height: 54px; background: var(--dark); border-bottom: 1px solid var(--dark-rule); }
.document-tab { display: inline-flex; align-items: center; gap: 9px; min-width: 0; padding: 0 20px; border-top: 2px solid var(--cyan); border-right: 1px solid var(--dark-rule); background: var(--editor); }
.document-tab .icon { color: var(--cyan); width: 17px; }
.document-tab h2 { line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dark-ink); font: 500 14px/1.5 var(--mono); }
.doc-actions { display: flex; align-items: center; justify-content: flex-end; flex: none; gap: 5px; padding: 7px 11px; }
.toolbar-button { color: var(--dark-muted); background: var(--clear); border-color: var(--clear); min-height: 34px; padding-inline: 9px; gap: 5px; }
.toolbar-button .icon { width: 15px; height: 15px; }
.toolbar-button.main-action { color: var(--shell); background: var(--cyan); border-color: var(--cyan); }
.toolbar-button > .check-icon, .toolbar-button.is-copied > .copy-icon { display: none; }
.toolbar-button.is-copied > .check-icon { display: block; }
.doc-summary { display: flex; flex: none; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; max-height: 80px; overflow-y: auto; min-width: 0; padding: 7px 15px; border-bottom: 1px solid var(--dark-rule); background: var(--editor); }
#doc-name { color: var(--dark-ink); font-size: 13px; overflow-wrap: anywhere; }
#doc-group { color: var(--dark-muted); font-size: 12px; overflow-wrap: anywhere; }
#doc-group:empty, #doc-name:empty { display: none; }
.doc-tags { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.doc-tags:empty { display: none; }
.doc-tags .tag { color: var(--cyan); background: var(--dark-active); }
.editor-area { position: relative; flex: 1 1 0; min-height: 0; min-width: 0; }
#editor { position: absolute; inset: 0; width: 100%; height: 100%; }
.doc-error { flex: none; padding: 8px 14px; color: var(--danger-dark); background: var(--danger-bg); font-size: 13px; overflow-wrap: anywhere; }
.doc-error:empty { display: none; }
.status-bar { display: flex; flex: none; align-items: center; flex-wrap: wrap; gap: 4px 14px; padding: 7px 13px; border-top: 1px solid var(--dark-rule); color: var(--dark-muted); background: var(--dark); font-size: 11px; line-height: 1.6; }
.status-bar > span { display: inline-flex; align-items: center; gap: 4px; }
.status-bar .icon { width: 13px; height: 13px; }
.state { color: var(--cyan); font-family: var(--mono); font-weight: 600; }
.access-state { padding-left: 11px; border-left: 1px solid var(--dark-rule); }
#cursor-position { font-variant-numeric: tabular-nums; }
.doc-time { margin-left: auto; }
.doc-count b { font: 500 12px/1 var(--mono); }
dialog { width: min(455px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow-y: auto; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: var(--dialog-shadow); color: var(--text); }
dialog::backdrop { background: var(--overlay); }
body:has(dialog[open]) { overflow-y: hidden; }
.dialog-head, .actions, .inline-field, .tags, .tag-options { display: flex; align-items: center; gap: 8px; }
.dialog-head { justify-content: space-between; }
.dialog-head h2 { font-size: 21px; line-height: 1.4; }
.icon-button { width: 38px; padding: 0; border-color: var(--clear); }
.dialog-intro { margin: 12px 0 17px; color: var(--muted); font-size: 14px; }
.form-field { display: flex; flex-direction: column; gap: 5px; margin-top: 14px; }
.form-field, .tag-field legend, .tag-collection h3 { font-size: 14px; font-weight: 600; }
form input:not([type="checkbox"]), form select { width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--text); font-size: 14px; font-weight: 400; }
.code-input { font-family: var(--mono); }
.field-tip { margin-top: 4px; color: var(--muted); font-size: 12px; }
.catalog-picker { margin: 14px 0 4px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 5px; background: var(--explorer); }
.catalog-picker summary { font-size: 13px; font-weight: 600; color: var(--teal-dark); }
.picker-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.picker-fields .form-field { margin-block: 8px 3px; font-size: 12px; }
.tag-field { padding: 0; margin: 16px 0 0; border: 0; min-width: 0; }
.tag-field legend { margin-bottom: 5px; padding: 0; }
.tag-options, .tags { flex-wrap: wrap; }
.tag-options:not(:empty) { margin-bottom: 8px; }
.tag, .tag-options label { font-size: 12px; color: var(--teal-dark); background: var(--cyan-soft); border-radius: 4px; padding: 2px 7px; overflow-wrap: anywhere; }
.tag-options label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--body); background: var(--field); }
.tag-options label:has(input:checked) { color: var(--teal-dark); background: var(--cyan-soft); }
input[type="checkbox"] { accent-color: var(--teal); }
.inline-field input { flex: 1 1 0; }
.inline-field .button { min-height: 42px; }
.form-field + .inline-field { margin-top: 6px; }
.tag-collection { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.tag-collection h3 { margin-bottom: 6px; }
.tag-collection .tags:empty::after { content: "暂无标签"; font-size: 13px; color: var(--muted); }
.form-error { margin-top: 8px; color: var(--danger); font-size: 13px; }
.form-error:empty { display: none; }
.actions { justify-content: flex-end; margin-top: 20px; }
#edit-json { margin-right: auto; }
#import-dialog { width: min(790px, calc(100% - 28px)); }
#import-text { width: 100%; min-height: 108px; max-height: 36dvh; resize: vertical; margin-top: 6px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--text); font: 14px/1.55 var(--mono); }
#import-text::placeholder { color: var(--muted); opacity: 1; }
.import-summary { margin-top: 14px; color: var(--body); font-size: 13px; }
.import-preview { width: 100%; max-height: 32dvh; overflow: auto; margin-top: 7px; border: 1px solid var(--line-soft); border-radius: 5px; }
.import-summary:empty, .import-preview:empty { display: none; }
.import-preview table { width: 100%; border-collapse: collapse; font-size: 13px; }
.import-preview th, .import-preview td { min-width: 52px; padding: 7px 8px; text-align: left; vertical-align: top; }
.import-preview th { position: sticky; top: 0; background: var(--field); color: var(--body); white-space: nowrap; }
.import-preview td { border-top: 1px solid var(--line-soft); }
.import-preview td:first-child { min-width: 36px; color: var(--muted); }
.import-preview td:nth-child(3) { font-family: var(--mono); }
.import-preview .tag { display: inline-block; margin: 1px 2px; }
.toast { position: fixed; z-index: 10; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); max-width: calc(100% - 30px); width: max-content; padding: 10px 16px; border: 1px solid var(--shell-rule); border-radius: 6px; color: var(--shell-text); background: var(--shell); font-size: 14px; line-height: 1.5; pointer-events: none; overflow-wrap: anywhere; box-shadow: var(--shadow); }
.toast:empty { display: none; }
@media (hover: hover) {
  .button:hover, .icon-button:hover, .tabs button:not([aria-selected="true"]):hover, .catalog-button:hover { color: var(--text); background: var(--field); }
  .button.primary:hover, .button.add:hover { background: var(--teal-dark); color: var(--paper); }
  .button.danger:hover { background: var(--danger-dark); color: var(--paper); }
  .button.admin-toggle:hover, .toolbar-button:hover { background: var(--dark-active); color: var(--shell-text); }
  .toolbar-button.main-action:hover { background: var(--cyan-soft); color: var(--shell); }
  .file-entry:not([aria-current="true"]):not(.active):hover { background: var(--field); }
  .quick-copy:hover { background: var(--cyan-soft); color: var(--teal-dark); }
  .explorer-toggle:hover { background: var(--field); }
}
button:active:not(:disabled) { transform: translateY(1px); }
@media (min-width: 1650px) {
  :root { --gutter: 40px; }
  .workbench { grid-template-columns: 320px minmax(0, 1fr); }
}
@media (max-width: 1040px) {
  :root { --gutter: 18px; }
  .workbench { grid-template-columns: 279px minmax(0, 1fr); }
  .doc-actions { gap: 2px; padding-inline: 7px; }
  .status-bar { column-gap: 9px; }
  .document-tab { padding-inline: 13px; }
}
@media (max-width: 760px) {
  :root { --gutter: 12px; --header: 52px; }
  .masthead-inner { padding-inline: 2px; }
  h1 { font-size: 20px; }
  .brand-mark { width: 29px; height: 29px; }
  .brand-mark .icon { width: 20px; height: 20px; }
  .brand { gap: 9px; }
  .main-shell { padding-block: 10px; }
  .workbench { height: calc(100vh - var(--header) - 21px); height: calc(100dvh - var(--header) - 21px); min-height: 435px; display: flex; flex-direction: column; border-radius: 7px; }
  .explorer { flex: none; border: 0; }
  .explorer-head { height: 43px; padding-inline: 12px 4px; }
  .explorer-head h2 { font-size: 14px; gap: 7px; }
  .explorer-toggle { display: inline-flex; min-height: 42px; border: 0; color: var(--teal-dark); background: var(--clear); font-size: 12px; }
  .explorer-toggle .icon { width: 14px; color: var(--teal); }
  #explorer-body { display: none; }
  #workspace[data-explorer-open="true"] #explorer-body { display: flex; flex: 0 1 auto; max-height: min(52dvh, 370px); overflow-y: auto; border-bottom: 1px solid var(--line); }
  #workspace[data-explorer-open="true"] .explorer-toggle .icon { transform: rotate(180deg); }
  .tab-panel { flex: 0 1 auto; }
  .files { max-height: 185px; min-height: 52px; }
  .files:empty { min-height: 0; }
  .explorer-footer { flex: none; }
  .tabs { margin: 9px 12px; }
  .filters { padding: 0 12px 8px; }
  .select-control, .search-control { height: 36px; }
  .list-heading { padding-block: 6px; }
  .document { flex: 1 1 0; }
  .document-header { min-height: 48px; }
  .document-tab { gap: 6px; padding-inline: 10px; }
  .document-tab h2 { font-size: 13px; }
  .document-tab .icon { width: 14px; }
  .doc-actions { padding: 3px 5px; gap: 0; }
  .toolbar-button { min-height: 40px; padding-inline: 6px; font-size: 12px; }
  .toolbar-button .icon { width: 13px; height: 13px; }
  .toolbar-button.main-action { padding-inline: 8px; }
  .status-bar { padding: 6px 8px; gap: 3px 9px; }
  .admin-toggle, .catalog-button, .actions .button, .admin-tools .button { min-height: 44px; }
  .doc-time { margin-left: 0; }
  .quick-copy { flex-basis: 42px; height: 44px; }
  .doc-summary { padding-inline: 10px; }
}
@media (max-width: 480px) {
  :root { --gutter: 8px; }
  .status-bar { font-size: 10px; }
  .toolbar-button:not(.main-action) .icon { display: none; }
  .button.admin-toggle { border-color: var(--clear); }
  .dialog-head h2 { font-size: 19px; }
  dialog { padding: 16px; }
  #editor .ace_search.right { width: 100%; max-width: 100%; }
  #editor .ace_search_form, #editor .ace_replace_form { display: flex; }
  #editor .ace_search_field { width: 0; min-width: 0; flex: 1 1 auto; }
  #editor .ace_searchbtn { flex: none; }
}
@media (prefers-reduced-motion: reduce) {
  button:active:not(:disabled) { transform: none; }
}
.workbench {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
}
.workspace-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--explorer);
}
.view-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.workspace-controls .tabs { margin: 0; }
#explorer-body { flex: 1 1 500px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.workspace-controls .filters {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) minmax(240px, 1.2fr);
  gap: 8px;
  flex: 1 1 400px;
  min-width: 0;
  padding: 0;
}
.workspace-controls .selects { margin-top: 0; }
.workspace-controls .select-control { height: 36px; }
.workspace-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.workspace-controls .catalog-button { width: auto; min-height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); }
.workspace-controls .admin-tools { display: flex; flex-wrap: wrap; padding: 0; }
.workspace-controls .admin-tools:has(> button):not(:has(> button:not([hidden]))) { display: none; }
.workspace-controls .admin-tools .button { flex: none; }
.record-results .list-heading { border-top: 0; }
.document-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 28%) minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}
.record-results {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--paper);
}
.record-results .list-heading { gap: 8px; }
.result-sort select {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px;
  background: var(--paper);
}
.record-group h3 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--explorer);
  font-size: 13px;
}
.record-group h3 span { flex: none; color: var(--muted); font-size: 11px; }
.record-group + .record-group { margin-top: 8px; }
.record-results .file-entry { padding-inline: 10px 4px; gap: 7px; }
.record-results .file-info { flex: 1; }
.record-results .file-info [data-field="mode"] { color: var(--text); }
.record-results .file-info .row-tags { display: flex; flex-wrap: wrap; gap: 3px; white-space: normal; }
.record-results .row-tags .tag { font-family: var(--body-font); }
.record-results .file-copies { white-space: nowrap; }
@media (max-width: 760px) {
  .document-workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(230px, 1fr); }
  .record-results { border-right: 0; border-bottom: 1px solid var(--line); }
  .record-results .files { max-height: 158px; }
}
@media (max-width: 760px) {
  .workspace-controls { align-items: stretch; gap: 8px; padding: 7px 9px; }
  .view-controls { width: 100%; }
  #workspace[data-explorer-open="true"] #explorer-body {
    flex: 1 1 100%;
    max-height: none;
    overflow: visible;
    border: 0;
  }
  .workspace-controls .filters { grid-template-columns: minmax(0, 1fr); flex-basis: 100%; }
  .workspace-tools { width: 100%; }
  .document-workspace { flex: 1 1 auto; grid-template-rows: auto minmax(280px, 1fr); }
  .workbench { height: auto; min-height: calc(100dvh - var(--header) - 21px); overflow: visible; }
  .document { border-radius: 0 0 7px 7px; }
}
