:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #202a28;
  --muted: #53625d;
  --quiet: #626c68;
  --line: #dfe5e1;
  --soft: #f3f5f3;
  --selected: #e4ece6;
  --accent: #285343;
  --hover: #eef2ef;
  --danger: #9a362e;
  --font: system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font: 14px/1.55 var(--font);
  color: var(--ink);
  background: var(--paper);
  accent-color: var(--accent);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
a,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
button {
  border: 0;
  background: none;
  padding: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #45836a;
  outline-offset: 3px;
}
::selection {
  background: #c7ddcd;
  color: #193624;
}
[hidden] {
  display: none !important;
}
.ic {
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
#shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}
#rail {
  height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: #f4f6f4;
  padding: 0 16px;
}
.brand,
.gate-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.035em;
}
.brand {
  height: 70px;
  padding: 0 9px;
  flex: none;
}
.brand img,
.gate-brand img {
  object-fit: contain;
}
.library-nav {
  overflow: auto;
  overscroll-behavior: contain;
  flex: 1;
  padding: 18px 0;
}
.nav-link,
.tree-row {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
  width: 100%;
  font-size: 13px;
}
.nav-link {
  padding: 9px 11px;
  text-align: left;
  font-weight: 530;
  border-radius: 7px;
  margin: 2px 0;
}
.nav-link .ic {
  width: 17px;
  height: 17px;
}
.nav-link[aria-current='page'],
.nav-link[aria-pressed='true'],
.tree-row.current {
  background: var(--selected);
  color: #1d4434;
  font-weight: 650;
}
.library-switch {
  padding-bottom: 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.tree-more {
  margin: 5px 0 8px;
  padding: 6px 10px 6px calc(24px + var(--depth, 0px));
  color: var(--accent);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.library-notice {
  margin: -8px 0 18px;
  color: var(--muted);
  font-size: 13px;
}
.index-coverage {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.search-scope {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
.search-scope select {
  min-height: 34px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
}
@media (max-width: 700px) {
  .search-scope select { font-size: 16px; }
}
.nav-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 9px 8px;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 600;
}
.nav-tree-empty {
  color: var(--quiet);
  font-size: 12px;
  margin: 6px 12px;
}
.tree-row {
  gap: 0;
  border-radius: 6px;
  padding-left: var(--depth, 0px);
}
.tree-toggle,
.tree-pad {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  min-height: 32px;
  color: var(--quiet);
}
.tree-toggle .ic {
  height: 13px;
  width: 13px;
}
.tree-name {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 5px 6px 0;
  text-align: left;
  min-width: 0;
  flex: 1;
}
.tree-name .ic {
  width: 16px;
  height: 16px;
}
.tree-name span,
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-footer {
  padding: 15px 10px 21px;
  border-top: 1px solid var(--line);
}
.quota-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.quota-title .ic {
  width: 15px;
  height: 15px;
}
.meter {
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 5px;
  background: #dce3de;
  margin: 10px 0 6px;
}
.meter i {
  display: block;
  background: #53766a;
  height: 100%;
  border-radius: inherit;
}
.quota-copy {
  font-size: 11px;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}
.main {
  min-width: 0;
}
.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 clamp(22px, 3.5vw, 60px);
  border-bottom: 1px solid var(--line);
}
.chat-back {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.chat-back .ic {
  width: 16px;
  height: 16px;
}
#search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 370px;
  min-width: 125px;
  width: 40%;
  height: 37px;
  background: #f4f6f4;
  border: 1px solid #e2e7e3;
  border-radius: 8px;
  padding: 0 10px;
  margin-left: auto;
  color: var(--quiet);
}
#query {
  min-width: 0;
  width: 100%;
  background: transparent;
  border: 0;
  outline: none;
  font-size: 13px;
}
#query::placeholder {
  color: #626f68;
}
#search-form:focus-within {
  border-color: #669681;
}
kbd {
  flex: none;
  font: 11px var(--font);
  color: var(--quiet);
  border: 1px solid #d8dfd9;
  padding: 1px 5px;
  border-radius: 4px;
  background: #fff;
}
.account {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
}
#account-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: #385643;
  background: #e2eadd;
  border-radius: 50%;
  font-weight: 700;
}
#workspace {
  max-width: 1490px;
  padding: 25px clamp(22px, 3.5vw, 60px) 56px;
  margin-inline: auto;
}
.location-bar, .folder-controls, .folder-controls button {
  display: flex;
  align-items: center;
}
.location-bar { flex-wrap: wrap; gap: 8px 16px; }
.folder-controls {
  flex: none;
  border: 1px solid #cad4cd;
  border-radius: 8px;
  padding: 2px;
  background: var(--soft);
}
.folder-controls button {
  justify-content: center;
  min-width: 36px;
  min-height: 34px;
  border-radius: 5px;
}
.folder-controls svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.folder-controls #folder-up {
  gap: 5px; margin-left: 3px; border-left: 1px solid var(--line);
  padding-inline: 10px; color: var(--accent); font-weight: 650;
}
.folder-controls button:not(:disabled):hover { background: var(--selected); }
.folder-controls button:disabled { opacity: .4; }
@media (pointer: coarse) {
  .folder-controls button { min-width: 42px; min-height: 42px; }
}
#breadcrumbs {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--quiet);
  min-height: 22px;
}
#breadcrumbs button {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#breadcrumbs .ic {
  width: 12px;
  height: 12px;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 28px;
}
.heading h1 {
  font-size: clamp(23px, 2.2vw, 32px);
  line-height: 1.32;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
  font-weight: 690;
}
.heading p {
  color: var(--muted);
  margin-top: 5px;
  font-size: 13px;
}
.heading-actions,
#detail-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.heading-actions {
  flex: none;
}
.button,
.sort {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  background: #fff;
  border: 1px solid #ccd5ce;
  border-radius: 7px;
  padding: 6px 12px;
  font-weight: 530;
  white-space: nowrap;
}
.button .ic,
.sort .ic {
  width: 16px;
  height: 16px;
}
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.button.destructive {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}
.iconbtn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  flex: none;
}
.mobile-only {
  display: none;
}
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}
.filters button {
  padding: 5px 11px;
  font-size: 13px;
  color: var(--muted);
  border-radius: 6px;
}
.filters button[aria-pressed='true'] {
  color: #244b39;
  background: #e9efea;
  font-weight: 650;
}
.sort {
  color: var(--muted);
  font-size: 12px;
  min-height: 32px;
  padding: 3px 8px;
}
.sort select {
  background: transparent;
  border: 0;
  color: inherit;
  max-width: 150px;
}
.table-head,
.row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(100px, 15%) minmax(65px, 9%) 33px;
  align-items: center;
  gap: 16px;
}
.table-head {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px 11px;
  background: #f7f8f7;
  color: var(--quiet);
  font-size: 12px;
}
.row {
  border-bottom: 1px solid #e7ebe8;
  min-height: 65px;
  padding: 6px 11px;
}
.row-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  padding: 4px 0;
}
.row-copy {
  display: block;
  min-width: 0;
}
.row-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-sub,
.dim {
  color: var(--quiet);
  font-size: 12px;
}
.row-sub {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dim {
  font-variant-numeric: tabular-nums;
}
.snippet {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #44534c;
  font-size: 12px;
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.glyph {
  display: grid;
  place-items: center;
  width: 36px;
  height: 40px;
  flex: none;
  color: #596b77;
}
.glyph .ic {
  width: 29px;
  height: 29px;
  stroke-width: 1.45;
}
.glyph.folder {
  color: #a77b32;
}
.glyph.folder .ic {
  fill: #f8e9c8;
}
.glyph.sheet {
  color: #397354;
}
.glyph.sheet .ic {
  fill: #e6f0e8;
}
.glyph.pdf {
  color: #a45045;
}
.glyph.pdf .ic {
  fill: #f7e8e4;
}
.glyph.word {
  color: #426b94;
}
.glyph.word .ic {
  fill: #e7eff6;
}
.glyph.note {
  color: #807296;
}
.glyph.note .ic {
  fill: #f0ecf4;
}
mark {
  background: #f9e7ac;
  color: #4c3b11;
  border-radius: 2px;
}
.row .iconbtn {
  color: var(--quiet);
}
#more {
  margin-top: 15px;
}
#drop-hint {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 20px;
  padding: 13px;
  border: 1px dashed #bbcbbf;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
}
#empty {
  padding: 49px 12px 44px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
#empty .ic {
  width: 35px;
  height: 35px;
  color: #829286;
  margin: 0 auto 5px;
}
#empty strong {
  display: block;
  font-size: 16px;
}
#empty p {
  margin: 5px auto 0;
  max-width: 50ch;
  color: var(--quiet);
  font-size: 13px;
}
.message {
  margin: 12px 0 0;
  min-height: 1.4em;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.error,
#form-error {
  color: var(--danger);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  padding: 0;
  background: var(--paper);
  max-width: calc(100% - 24px);
  max-height: 90dvh;
}
dialog::backdrop {
  background: #17291f42;
}
dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
}
dialog header :is(h2, span) {
  font-weight: 650;
  font-size: 16px;
}
#detail {
  margin: 0 0 0 auto;
  width: 510px;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
  max-width: 100vw;
  border-width: 0 0 0 1px;
}
#detail[open],
#mobile-nav[open] {
  display: flex;
  flex-direction: column;
}
#detail header {
  flex: none;
}
.detail-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 22px 23px 32px;
}
.detail-body h2 {
  font-size: 22px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.detail-body h3 {
  font-size: 15px;
  margin: 17px 0 3px;
}
#detail-glyph .glyph {
  background: var(--soft);
  border-radius: 9px;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
}
#detail-path,
#position {
  font-size: 12px;
  color: var(--quiet);
  overflow-wrap: anywhere;
}
#detail-path {
  margin: 4px 0 16px;
}
#metadata {
  display: grid;
  grid-template-columns: 75px 1fr;
  gap: 6px 12px;
  border-block: 1px solid var(--line);
  padding: 14px 0;
  margin: 17px 0;
  font-size: 13px;
}
#metadata dt {
  color: var(--quiet);
}
#metadata dd {
  margin: 0;
  overflow-wrap: anywhere;
}
#warnings {
  background: #fbf3df;
  color: #72561d;
  padding: 8px 11px;
  border-radius: 6px;
  font-size: 13px;
}
#preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.75;
  padding: 12px;
  background: var(--soft);
  margin: 7px 0;
  max-height: 36dvh;
  overflow: auto;
  overscroll-behavior: contain;
}
#paging {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
#segment {
  width: 4.8em;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
#editor {
  width: 420px;
}
#editor-fields {
  padding: 16px 20px 4px;
}
#editor-fields label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
#editor-fields :is(input, textarea, select) {
  width: 100%;
  border: 1px solid #bbc9c0;
  border-radius: 6px;
  min-height: 37px;
  padding: 6px 9px;
  background: #fff;
}
#editor-fields textarea {
  resize: vertical;
}
#editor-fields p {
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
#edit-form footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 13px 20px 18px;
}
#form-error {
  font-size: 12px;
  padding: 0 20px;
}
#context {
  position: fixed;
  z-index: 12;
  min-width: 145px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 5px 18px #1f322216;
}
#context button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  text-align: left;
  border-radius: 5px;
}
#context .ic {
  width: 16px;
  height: 16px;
}
#context .danger {
  color: var(--danger);
}
#transfer:empty {
  display: none;
}
#transfer {
  background: #f5f8f5;
  border: 1px solid #d7e4d9;
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
}
#transfer .transfer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 3px 0;
}
.transfer-label {
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.transfer-note {
  font-size: 12px;
  color: var(--quiet);
}
#transfer button {
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-left: 7px;
}
#transfer progress {
  width: 100%;
  height: 6px;
  accent-color: var(--accent);
}
.row[draggable='true'] .row-main {
  cursor: grab;
}
.row.drag-source {
  opacity: 0.58;
}
[data-drop-action] {
  outline: 2px solid #387356;
  outline-offset: -2px;
  background-color: #e4f2e8 !important;
  border-radius: 6px;
}
[data-drop-action='已在此处'] {
  outline-style: dashed;
  background-color: var(--soft) !important;
}
.row[data-drop-action] {
  position: relative;
}
.row[data-drop-action] > .iconbtn {
  visibility: hidden;
}
.row[data-drop-action]::after {
  content: attr(data-drop-action);
  position: absolute;
  right: 10px;
  color: #27563c;
  background: #e4f2e8;
  padding: 3px 5px;
  font-size: 12px;
  pointer-events: none;
}
.glyph.archive {
  color: #8d6641;
}
.glyph.archive .ic {
  fill: #f6edde;
}
#zip-view {
  border-block: 1px solid var(--line);
  padding: 12px 0;
  margin: 16px 0;
}
#zip-view h3 {
  margin: 0 0 3px;
}
#zip-view h3 small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.zip-intro,
#zip-status,
.zip-empty,
.zip-member-head small {
  font-size: 12px;
  color: var(--quiet);
}
#zip-status {
  margin: 6px 0 0;
}
#zip-status.error {
  color: var(--danger);
}
#zip-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
  font-size: 13px;
}
#zip-crumbs .ic,
.zip-row > .ic:last-child {
  width: 13px;
  height: 13px;
}
#zip-crumbs :is(button, span) {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.zip-up {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 8px;
  margin-right: 4px;
}
.zip-link {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.zip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 3px;
  text-align: left;
  border-top: 1px solid var(--line);
}
.zip-row-copy {
  flex: 1;
  min-width: 0;
}
.zip-row-copy strong,
.zip-row-copy small,
.zip-member-head small {
  display: block;
  overflow-wrap: anywhere;
}
.zip-row-copy small,
.zip-size,
.zip-pager {
  color: var(--quiet);
  font-size: 12px;
}
.zip-row:disabled {
  opacity: 1;
  color: var(--muted);
}
.zip-more,
.zip-pager {
  margin-top: 8px;
}
.zip-pager {
  display: flex;
  align-items: center;
  gap: 8px;
}
.zip-member-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 42dvh;
  overflow: auto;
  overscroll-behavior: contain;
  line-height: 1.75;
  padding: 9px;
  border-radius: 6px;
  margin-top: 5px;
  background: var(--soft);
}
.zip-warning {
  background: #fbf3df;
  color: #72561d;
  border-radius: 5px;
  padding: 6px;
  font-size: 12px;
}
@media (hover: hover) and (pointer: fine) {
  .zip-row:not(:disabled):hover,
  .zip-up:hover {
    background: var(--hover);
  }
}
#gate {
  max-width: 450px;
  margin: 15vh auto 0;
  padding: 24px;
}
#gate h1 {
  font-size: 25px;
  margin: 32px 0 4px;
}
#gate p {
  color: var(--muted);
}
#gate-login {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
  padding: 7px 14px;
  margin-top: 18px;
}
#mobile-nav {
  margin: 0 auto 0 0;
  width: 265px;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
  background: #f4f6f4;
}
#mobile-nav .library-nav {
  padding: 12px;
}
#mobile-nav .rail-footer {
  margin: 0 12px;
}
@media (hover: hover) and (pointer: fine) {
  .button:not(.primary):not(:disabled):hover,
  .iconbtn:not(:disabled):hover,
  .filters button:not([aria-pressed='true']):hover,
  #context button:hover,
  .nav-link:not([aria-current]):hover,
  .tree-row:not(.current):hover {
    background: var(--hover);
  }
  .button.primary:hover {
    background: #1e4537;
  }
  .row:has(.row-main:hover) {
    background: #f7f9f7;
  }
  .chat-back:hover,
  #breadcrumbs button:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}
@media (max-width: 900px) {
  #shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  #rail {
    padding: 0 10px;
  }
  .topbar {
    gap: 14px;
  }
  #account-name {
    display: none;
  }
  .table-head,
  .row {
    grid-template-columns: minmax(125px, 1fr) 88px 62px 30px;
    gap: 9px;
  }
}
@media (max-width: 690px) {
  #shell {
    display: block;
  }
  #rail {
    display: none;
  }
  .mobile-only {
    display: grid;
  }
  .topbar {
    height: 54px;
    gap: 6px;
    padding: 0 12px;
  }
  .chat-back {
    font-size: 0;
    gap: 0;
    width: 33px;
    height: 36px;
    justify-content: center;
  }
  .chat-back .ic {
    width: 18px;
    height: 18px;
  }
  #search-form {
    height: 36px;
    width: auto;
    flex: 1;
    margin: 0 4px;
    max-width: none;
  }
  #query {
    font-size: 16px;
  }
  #search-form kbd {
    display: none;
  }
  .account {
    gap: 0;
  }
  #avatar {
    width: 28px;
    height: 28px;
  }
  #workspace {
    padding: 15px 14px calc(35px + env(safe-area-inset-bottom, 0px));
  }
  .heading {
    margin: 17px 0 19px;
    display: block;
  }
  .heading-actions {
    margin-top: 12px;
  }
  .heading h1 {
    font-size: 25px;
  }
  .button,
  .filters button,
  .sort {
    min-height: 39px;
  }
  .controls {
    gap: 5px;
    align-items: stretch;
    flex-wrap: wrap;
    margin-bottom: 8px;
  }
  .filters {
    gap: 0;
  }
  .filters button {
    padding: 4px 8px;
  }
  .sort {
    padding: 2px 5px;
    gap: 2px;
  }
  .sort select {
    max-width: 115px;
    font-size: 13px;
  }
  .table-head,
  .row {
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 5px;
    padding-inline: 5px;
  }
  .row {
    min-height: 60px;
  }
  .table-head span:nth-child(2),
  .table-head span:nth-child(3),
  .row .dim {
    display: none;
  }
  .row-main {
    gap: 7px;
  }
  .row .glyph {
    width: 28px;
  }
  .row .iconbtn {
    height: 40px;
    width: 36px;
  }
  .detail-body {
    padding: 15px;
  }
  .detail-body input,
  #editor-fields :is(input, textarea, select),
  #segment {
    font-size: 16px;
  }
  #detail {
    width: min(100vw, 510px);
  }
  .tree-toggle,
  .tree-pad,
  .tree-name {
    min-height: 40px;
  }
  #context button {
    min-height: 40px;
  }
  .nav-link {
    min-height: 40px;
  }
}
/* Finance versions and recovery use the existing library surface. */
#finance-edit { width: min(760px, calc(100vw - 24px)); }
#finance-edit-fields { padding: 18px 20px 4px; }
#finance-edit-fields label { display: block; font-weight: 600; margin: 16px 0 6px; }
#finance-edit-fields :is(input, textarea) {
  width: 100%; min-height: 42px; border: 1px solid #bbc9c0;
  border-radius: 6px; padding: 9px 11px; background: var(--paper); caret-color: var(--accent);
}
#finance-edit-fields textarea { min-height: 260px; max-height: 52dvh; resize: vertical; tab-size: 4; }
#finance-edit-fields input[type=file] { padding: 12px; }
.finance-selected-path { font-weight: 600; overflow-wrap: anywhere; }
.finance-operation-note { margin-top: 14px; color: var(--muted); max-width: 68ch; }
#finance-edit-error { padding: 8px 20px 0; color: var(--danger); overflow-wrap: anywhere; }
#finance-edit-form footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px 20px; }
#finance-records { width: min(720px, calc(100vw - 24px)); }
.finance-records-body { padding: 18px 20px 22px; }
#finance-records-note { color: var(--muted); margin-bottom: 16px; overflow-wrap: anywhere; }
.finance-record { display: flex; align-items: center; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.finance-record-info { flex: 1; min-width: 0; }
.finance-record h3 { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.finance-record p { margin-top: 4px; overflow-wrap: anywhere; }
.finance-record-meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.finance-record .button { flex-shrink: 0; }
.finance-empty { color: var(--muted); padding: 20px 0; }
#finance-records-more { margin-top: 16px; }
@media (max-width: 600px) {
  #finance-edit-fields, .finance-records-body { padding: 16px; }
  #finance-edit-fields :is(input, textarea) { font-size: 16px; }
  #finance-edit-form footer { padding: 14px 16px 18px; }
  .finance-record { gap: 10px; align-items: flex-start; }
  .finance-record .button { min-height: 44px; }
}

/* Embedded side-pane mode (?embed=1): compact header & adaptive rail */
html.is-embedded .chat-back,
html.is-embedded #rail .brand,
html.is-embedded .topbar #account {
  display: none !important;
}
html.is-embedded #rail .library-nav {
  padding-top: 12px;
}
html.is-embedded .topbar {
  height: 50px;
  padding: 0 14px;
  gap: 8px;
}
html.is-embedded #search-form {
  margin: 0;
  max-width: none;
  flex: 1;
}
@media (min-width: 691px) and (max-width: 960px) {
  html.is-embedded #shell {
    grid-template-columns: 186px minmax(0, 1fr);
  }
  html.is-embedded #rail {
    padding: 0 10px;
  }
  html.is-embedded #workspace {
    padding: 16px 18px 36px;
  }
  html.is-embedded .heading {
    margin: 14px 0 16px;
  }
  html.is-embedded .heading h1 {
    font-size: 22px;
  }
}
