/* Docx · quiet, readable, keyboard-friendly. All colors follow the system. */
:root {
  color-scheme: light dark;
  --bg: #fff;
  --sidebar: #f7f8fa;
  --surface: #fff;
  --surface-2: #f8f9fb;
  --surface-3: #f0f2f5;
  --text: #24272e;
  --text-secondary: #626977;
  --muted: #8b929e;
  --border: #e7e9ee;
  --border-strong: #d7dbe3;
  --accent: #4264e8;
  --accent-hover: #3153d8;
  --accent-soft: #eef2ff;
  --accent-text: #3556ce;
  --success: #26835c;
  --success-soft: #edf8f2;
  --warning: #a4751c;
  --warning-soft: #fff8e9;
  --danger: #c64250;
  --danger-soft: #fdf0f1;
  --shadow: 0 14px 45px #20294216, 0 3px 10px #20294208;
  --modal-shadow: 0 30px 100px #101a3330;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --space: 4px;
  --duration: 160ms;
  --duration-slow: 240ms;
  --sidebar-width: 260px;
  --header-height: 64px;
  --code-bg: #f6f7fa;
  --selection: #dee7ff;
  --scrollbar: #c9ced8;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  font-size: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171b;
    --sidebar: #111317;
    --surface: #191c21;
    --surface-2: #1d2026;
    --surface-3: #262a32;
    --text: #e0e3eb;
    --text-secondary: #a0a7b5;
    --muted: #737d8e;
    --border: #2a2f38;
    --border-strong: #3a4250;
    --accent: #8aa2ff;
    --accent-hover: #a2b5ff;
    --accent-soft: #222c48;
    --accent-text: #a2b5ff;
    --success: #75c9a1;
    --success-soft: #1c3229;
    --warning: #e2bc70;
    --warning-soft: #342d20;
    --danger: #f38e96;
    --danger-soft: #3c252c;
    --shadow: 0 14px 45px #0004, 0 3px 10px #0003;
    --modal-shadow: 0 30px 100px #0007;
    --code-bg: #1c2028;
    --selection: #32456b;
    --scrollbar: #414957;
  }
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}
body {
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  border: 0;
  background: none;
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
a {
  color: var(--accent-text);
  text-decoration: none;
}
button,
a {
  touch-action: manipulation;
}
input,
textarea,
select {
  outline: none;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}
input::-webkit-inner-spin-button,
input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}
input::-webkit-search-cancel-button {
  appearance: none;
}
input:autofill {
  box-shadow: 0 0 0 1000px var(--surface) inset;
  -webkit-text-fill-color: var(--text);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 3px;
}
::selection {
  background: var(--selection);
}
[hidden] {
  display: none !important;
}
svg {
  display: block;
  flex-shrink: 0;
}
.icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.65;
  flex-shrink: 0;
}
img {
  max-width: 100%;
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}
*::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
*::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border: 2px solid transparent;
  border-radius: 8px;
  background-clip: padding-box;
}
.sr-only,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.muted,
.text-muted {
  color: var(--muted);
}
.secondary-text {
  color: var(--text-secondary);
}
.truncate {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.danger-text {
  color: var(--danger);
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.app,
.app-shell {
  height: 100dvh;
  display: flex;
  width: 100%;
  overflow: hidden;
}
.sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 12px;
  z-index: 30;
  transition:
    width var(--duration-slow),
    transform var(--duration-slow);
}
.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  flex-shrink: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.7px;
  white-space: nowrap;
}
.brand-mark,
.logo-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--text);
  color: var(--bg);
  border-radius: 9px;
  position: relative;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -1px;
}
.brand-mark::after,
.logo-mark::after {
  content: "";
  position: absolute;
  right: 5px;
  top: 6px;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 1px;
}
.brand-subtitle {
  font-size: 10px;
  letter-spacing: 1.3px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
}
.sidebar-header > :is(.icon-btn, .icon-button):last-child {
  margin-left: auto;
}
.workspace-badge,
.private-badge,
.badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 10px;
  color: var(--text-secondary);
  background: var(--surface);
  line-height: 1.3;
  white-space: nowrap;
}
.workspace-badge .icon,
.private-badge .icon {
  width: 11px;
  height: 11px;
}
.sidebar-search {
  height: 35px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 9px 0 18px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 9px;
  color: var(--muted);
  width: 100%;
  text-align: left;
}
.sidebar-search .icon {
  width: 16px;
  height: 16px;
}
.sidebar-search span {
  flex: 1;
}
.sidebar-search kbd,
.shortcut {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 4px;
  font-family: inherit;
  font-size: 10px;
  color: var(--muted);
  line-height: 18px;
}
.nav-section {
  padding: 8px 0;
}
.nav-link,
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  line-height: 20px;
  text-align: left;
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
  transition:
    background var(--duration),
    color var(--duration);
}
.nav-link.active,
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 550;
}
.nav-link .nav-count,
.nav-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}
.sidebar-section-label,
.section-label,
.tree-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  color: var(--muted);
  padding: 24px 10px 9px;
}
.sidebar-section-label :is(.icon-btn, .icon-button),
.tree-heading :is(.icon-btn, .icon-button) {
  width: 24px;
  height: 24px;
}
.sidebar-section-label .icon,
.tree-heading .icon {
  width: 14px;
  height: 14px;
}
.tree-container,
.tree-scroll,
.sidebar-tree {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding-bottom: 16px;
}
.tree,
.tree-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tree-item {
  min-width: 0;
}
.tree-row {
  display: flex;
  align-items: center;
  min-height: 34px;
  gap: 5px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  position: relative;
}
.tree-row.active {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.tree-row .tree-link,
.tree-row > a,
.tree-node {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: inherit;
  text-align: left;
  padding: 7px 6px;
}
.tree-row .icon {
  width: 15px;
  height: 15px;
}
.tree-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.tree-toggle {
  width: 20px;
  height: 28px;
  flex-shrink: 0;
  padding: 4px;
  color: var(--muted);
}
.tree-toggle .icon {
  width: 12px;
  height: 12px;
  transition: transform var(--duration);
}
.tree-toggle[aria-expanded="true"] .icon {
  transform: rotate(90deg);
}
.tree-children {
  margin-left: 14px;
  padding-left: 5px;
  border-left: 1px solid var(--border);
}
.tree-spacer {
  width: 20px;
  flex-shrink: 0;
}
.tree-empty {
  font-size: 12px;
  line-height: 1.7;
  padding: 10px;
  color: var(--muted);
}
.sidebar-footer {
  padding: 12px 0 15px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.session-status,
.session-info {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 10px 4px;
  color: var(--muted);
  font-size: 10px;
}
.status-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--success);
}
.main,
.main-shell,
.main-area {
  flex: 1;
  min-width: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar,
.app-header {
  height: var(--header-height);
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  background: var(--bg);
  z-index: 12;
}
.topbar-left,
.topbar-right,
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.breadcrumbs,
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}
.breadcrumbs a,
.breadcrumb a {
  color: var(--text-secondary);
}
.breadcrumbs > span:last-child,
.breadcrumb > span:last-child {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}
.breadcrumb-separator {
  color: var(--muted);
}
.breadcrumbs .icon,
.breadcrumb .icon {
  width: 14px;
  height: 14px;
}
.content,
.content-scroll,
.main-content {
  flex: 1;
  overflow: auto;
  min-height: 0;
  position: relative;
  scroll-behavior: smooth;
}
.page {
  padding: 38px 44px 60px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}
.page-head,
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.page-title {
  font-size: 27px;
  line-height: 1.4;
  letter-spacing: -0.8px;
  font-weight: 620;
  margin: 0 0 8px;
}
.page-subtitle,
.page-description {
  color: var(--text-secondary);
  font-size: 12px;
  margin: 0;
  line-height: 1.7;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: var(--accent-text);
  font-weight: 650;
  margin: 0 0 10px;
  text-transform: uppercase;
}
.page-actions,
.button-group,
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.page-head .page-actions {
  padding-top: 4px;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}
.toolbar-label {
  font-size: 12px;
  color: var(--text-secondary);
}
:is(.btn, .button),
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
  color: var(--text);
  transition:
    background var(--duration),
    border-color var(--duration),
    transform var(--duration);
  text-decoration: none;
}
:is(.btn, .button) .icon,
.button .icon {
  width: 15px;
  height: 15px;
}
:is(.btn, .button).primary,
.btn-primary,
.button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
:is(.btn, .button).secondary,
.btn-secondary {
  background: var(--surface);
}
:is(.btn, .button).ghost,
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
:is(.btn, .button).danger,
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
:is(.btn, .button).danger-outline {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
  color: var(--danger);
  background: transparent;
}
:is(.btn, .button).small,
.btn-sm {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 11px;
}
:is(.btn, .button).wide,
.btn-block {
  width: 100%;
}
:is(.btn, .button):active:not(:disabled),
:is(.icon-btn, .icon-button):active:not(:disabled),
.nav-link:active {
  transform: scale(0.98);
}
:is(.btn, .button).loading {
  pointer-events: none;
}
:is(.btn, .button).loading::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
:is(.icon-btn, .icon-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  color: var(--text-secondary);
  padding: 6px;
  flex-shrink: 0;
  transition:
    background var(--duration),
    color var(--duration),
    transform var(--duration);
}
:is(.icon-btn, .icon-button).small {
  width: 26px;
  height: 26px;
}
:is(.icon-btn, .icon-button).danger {
  color: var(--danger);
}
:is(.icon-btn, .icon-button) .icon {
  width: 17px;
  height: 17px;
}
.mobile-menu,
.mobile-only {
  display: none;
}
.file-list,
.document-list {
  border-top: 1px solid var(--border);
}
.list-header,
.file-list-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 130px 40px;
  align-items: center;
  gap: 16px;
  padding: 11px 14px;
  font-size: 10px;
  letter-spacing: 0.6px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}
.file-row,
.document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 130px 40px;
  align-items: center;
  gap: 16px;
  min-height: 65px;
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  transition: background var(--duration);
  position: relative;
}
.file-main,
.file-name-link,
.document-link {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  color: var(--text);
  text-align: left;
  border: 0;
  background: none;
  padding: 0;
  width: 100%;
}
.file-icon,
.document-icon {
  height: 34px;
  width: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}
.file-icon.folder {
  color: var(--accent-text);
  background: var(--accent-soft);
  border-color: transparent;
}
.file-icon .icon {
  width: 18px;
  height: 18px;
}
.file-info,
.file-details {
  min-width: 0;
}
.file-name,
.document-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-path,
.file-subtitle {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-size,
.file-date,
.file-meta {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.file-row .row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.file-type {
  font-size: 10px;
  color: var(--muted);
}
.folder-hint {
  padding: 14px 0;
  font-size: 11px;
  color: var(--muted);
}
.empty-state {
  padding: 75px 24px;
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  color: var(--accent-text);
  background: var(--accent-soft);
  margin-bottom: 20px;
}
.empty-icon .icon {
  width: 27px;
  height: 27px;
  stroke-width: 1.3;
}
.empty-state h2,
.empty-state h3 {
  font-weight: 550;
  font-size: 18px;
  margin: 0 0 9px;
  letter-spacing: -0.4px;
}
.empty-state p {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.8;
  margin: 0 0 23px;
  max-width: 340px;
}
.empty-state .actions {
  justify-content: center;
}
.empty-state.compact {
  padding: 36px 18px;
}
.inline-notice,
.notice,
.warning-box {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 12px 15px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.75;
  margin-bottom: 20px;
}
.notice.warning,
.warning-box {
  border-color: color-mix(in srgb, var(--warning) 20%, var(--border));
  background: var(--warning-soft);
  color: var(--warning);
}
.notice.error,
.error-message,
.form-error {
  color: var(--danger);
  font-size: 12px;
  line-height: 1.7;
}
.form-error:not(:empty) {
  padding: 10px 12px;
  background: var(--danger-soft);
  border-radius: 7px;
  margin-top: 12px;
}
.notice .icon {
  margin-top: 2px;
  width: 16px;
  height: 16px;
}
.reader-layout,
.document-layout {
  display: grid;
  grid-template-columns: minmax(0, 820px) 180px;
  gap: 56px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 42px 40px 90px;
}
.reader,
.document-reader {
  min-width: 0;
}
.document-header,
.reader-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 23px;
  margin-bottom: 32px;
}
.document-title {
  font-size: 31px;
  line-height: 1.4;
  letter-spacing: -1px;
  font-weight: 650;
  word-break: break-word;
  margin: 0 0 15px;
}
.document-meta {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 10px;
}
.document-meta .icon {
  width: 12px;
  height: 12px;
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.document-type {
  display: inline-block;
  font-size: 10px;
  line-height: 20px;
  letter-spacing: 0.5px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  background: var(--surface-2);
}
.toc,
.article-toc {
  position: sticky;
  top: 32px;
  align-self: start;
  max-height: calc(100dvh - 130px);
  overflow: auto;
  padding: 5px 0 20px;
  border-left: 1px solid var(--border);
  font-size: 11px;
}
.toc-title {
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 13px;
  padding: 0 18px;
}
.toc a,
.toc-link {
  display: block;
  color: var(--text-secondary);
  padding: 5px 18px;
  line-height: 1.65;
  text-overflow: ellipsis;
  overflow: hidden;
  border-left: 2px solid transparent;
  margin-left: -1px;
}
.toc a.active,
.toc-link.active {
  border-left-color: var(--accent);
  color: var(--accent-text);
  background: linear-gradient(90deg, var(--accent-soft), transparent);
}
.toc .toc-level-2 {
  padding-left: 27px;
}
.toc .toc-level-3 {
  padding-left: 36px;
}
.toc-toggle {
  display: none;
}
.markdown,
:is(.markdown-body, .prose),
.prose {
  font-size: 14px;
  line-height: 1.95;
  color: var(--text);
  overflow-wrap: anywhere;
  min-width: 0;
}
.markdown > :first-child,
:is(.markdown-body, .prose) > :first-child {
  margin-top: 0;
}
.markdown p,
:is(.markdown-body, .prose) p,
.prose p {
  margin: 0 0 20px;
}
.markdown h1,
:is(.markdown-body, .prose) h1,
.prose h1 {
  font-size: 29px;
  line-height: 1.5;
  font-weight: 650;
  letter-spacing: -0.8px;
  margin: 38px 0 20px;
}
.markdown h2,
:is(.markdown-body, .prose) h2,
.prose h2 {
  font-size: 21px;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin: 36px 0 17px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.markdown h3,
:is(.markdown-body, .prose) h3,
.prose h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.6;
  margin: 28px 0 13px;
}
.markdown h4,
:is(.markdown-body, .prose) h4,
.prose h4 {
  font-size: 14px;
  font-weight: 650;
  margin: 24px 0 12px;
}
.markdown :is(h1, h2, h3, h4, h5, h6),
:is(.markdown-body, .prose) :is(h1, h2, h3, h4, h5, h6) {
  scroll-margin-top: 22px;
}
.markdown strong,
:is(.markdown-body, .prose) strong {
  font-weight: 650;
}
.markdown a,
:is(.markdown-body, .prose) a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
}
.markdown ul,
.markdown ol,
:is(.markdown-body, .prose) ul,
:is(.markdown-body, .prose) ol {
  padding-left: 23px;
  margin: 0 0 20px;
}
.markdown li,
:is(.markdown-body, .prose) li {
  margin: 6px 0;
}
.markdown li > p,
:is(.markdown-body, .prose) li > p {
  margin-bottom: 8px;
}
.markdown blockquote,
:is(.markdown-body, .prose) blockquote {
  margin: 22px 0;
  padding: 13px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 6px 6px 0;
  color: var(--text-secondary);
}
.markdown blockquote > :last-child,
:is(.markdown-body, .prose) blockquote > :last-child {
  margin-bottom: 0;
}
.markdown hr,
:is(.markdown-body, .prose) hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}
.markdown img,
:is(.markdown-body, .prose) img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 22px auto;
}
.markdown code,
:is(.markdown-body, .prose) code {
  font-family:
    ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;
  font-size: 0.87em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 2px 5px;
  border-radius: 4px;
}
.markdown pre,
:is(.markdown-body, .prose) pre {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 20px;
  overflow: auto;
  margin: 22px 0;
  line-height: 1.7;
  font-size: 12px;
  tab-size: 4;
}
.markdown pre code,
:is(.markdown-body, .prose) pre code {
  background: none;
  padding: 0;
  border: 0;
  font-size: inherit;
  border-radius: 0;
  white-space: pre;
  overflow-wrap: normal;
}
.code-wrap,
.highlight {
  position: relative;
}
.copy-code,
.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  padding: 4px 7px;
  line-height: 16px;
  z-index: 2;
}
.markdown .table-wrap,
:is(.markdown-body, .prose) .table-wrap {
  overflow: auto;
  margin: 22px 0;
}
.markdown table,
:is(.markdown-body, .prose) table {
  border-collapse: separate;
  border-spacing: 0;
  display: block;
  overflow: auto;
  width: max-content;
  max-width: 100%;
  margin: 22px 0;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.markdown th,
.markdown td,
:is(.markdown-body, .prose) th,
:is(.markdown-body, .prose) td {
  padding: 11px 15px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  min-width: 100px;
  vertical-align: top;
  text-align: left;
}
.markdown th,
:is(.markdown-body, .prose) th {
  font-weight: 550;
  background: var(--surface-2);
  white-space: nowrap;
}
.markdown tr:last-child td,
:is(.markdown-body, .prose) tr:last-child td {
  border-bottom: 0;
}
.markdown td:last-child,
.markdown th:last-child,
:is(.markdown-body, .prose) td:last-child,
:is(.markdown-body, .prose) th:last-child {
  border-right: 0;
}
.markdown .task-list-item,
:is(.markdown-body, .prose) .task-list-item {
  list-style: none;
}
.markdown input[type="checkbox"],
:is(.markdown-body, .prose) input[type="checkbox"] {
  accent-color: var(--accent);
  margin-left: -20px;
  margin-right: 6px;
}
.markdown details,
:is(.markdown-body, .prose) details {
  margin: 20px 0;
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 7px;
}
.markdown summary,
:is(.markdown-body, .prose) summary {
  cursor: pointer;
  font-weight: 500;
}
.markdown .mermaid,
:is(.markdown-body, .prose) .mermaid {
  background: var(--surface-2);
  text-align: center;
  max-width: 100%;
  overflow: auto;
  min-height: 90px;
}
.mermaid svg {
  max-width: 100%;
  height: auto;
  margin: auto;
}
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 7px 0;
}
.markdown .external-image,
.external-image-blocked,
.blocked-image {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}
.markdown .footnote,
:is(.markdown-body, .prose) .footnote {
  font-size: 12px;
  color: var(--text-secondary);
}
/* Local Pygments colors stay legible in both palettes. */
.highlight .c,
.highlight .c1,
.highlight .cm,
.highlight .cp,
.highlight .cs {
  color: #7f8b9c;
  font-style: italic;
}
.highlight .k,
.highlight .kn,
.highlight .kd,
.highlight .kc,
.highlight .ow {
  color: #9b5cca;
}
.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sa,
.highlight .sb,
.highlight .si {
  color: #418060;
}
.highlight .nf,
.highlight .nc,
.highlight .na {
  color: #426ac0;
}
.highlight .mi,
.highlight .mf,
.highlight .mh,
.highlight .il {
  color: #b5753e;
}
.highlight .o,
.highlight .p {
  color: var(--text-secondary);
}
.highlight .err {
  color: var(--danger);
}
@media (prefers-color-scheme: dark) {
  .highlight .k,
  .highlight .kn,
  .highlight .kd,
  .highlight .kc,
  .highlight .ow {
    color: #c29be4;
  }
  .highlight .s,
  .highlight .s1,
  .highlight .s2,
  .highlight .sa,
  .highlight .sb,
  .highlight .si {
    color: #8cc5a5;
  }
  .highlight .nf,
  .highlight .nc,
  .highlight .na {
    color: #8eaef3;
  }
  .highlight .mi,
  .highlight .mf,
  .highlight .mh,
  .highlight .il {
    color: #e0b47e;
  }
  :is(.btn, .button).primary,
  .btn-primary,
  .button.primary {
    color: #15224d;
  }
  :is(.btn, .button).danger,
  .btn-danger {
    color: #32151c;
  }
}
.editor-layout {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.editor-title {
  min-width: 0;
  font-weight: 550;
  font-size: 13px;
}
.editor-status {
  font-size: 10px;
  color: var(--muted);
}
.editor-status.dirty {
  color: var(--warning);
}
.editor-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 0;
}
.editor-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.editor-pane:first-child {
  border-right: 1px solid var(--border);
}
.pane-label {
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 22px;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  letter-spacing: 0.6px;
}
.source-editor,
.markdown-editor {
  display: block;
  width: 100%;
  height: 100%;
  resize: none;
  border: 0;
  background: var(--bg);
  padding: 24px;
  font:
    12px/1.85 ui-monospace,
    SFMono-Regular,
    Consolas,
    "Microsoft YaHei",
    monospace;
  outline: none;
  border-radius: 0;
  tab-size: 2;
  flex: 1;
  min-height: 300px;
}
.source-editor:focus-visible,
.markdown-editor:focus-visible {
  outline: none;
}
.editor-preview {
  padding: 24px 30px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.editor-footer {
  display: flex;
  justify-content: space-between;
  padding: 7px 22px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--muted);
}
.editor-tabs,
.segmented {
  display: flex;
  gap: 2px;
  background: var(--surface-3);
  padding: 3px;
  border-radius: 7px;
}
.segmented button,
.editor-tabs button {
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 11px;
  color: var(--text-secondary);
}
.segmented .active,
.editor-tabs .active {
  background: var(--surface);
  color: var(--text);
}
.dialog,
.modal,
dialog {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--modal-shadow);
  width: calc(100% - 32px);
  max-width: 480px;
  max-height: calc(100dvh - 64px);
  overflow: auto;
  margin: auto;
}
.dialog[open],
dialog[open] {
  animation: dialog-in var(--duration-slow) ease-out;
}
.dialog::backdrop,
dialog::backdrop {
  background: #131a2d50;
  backdrop-filter: blur(3px);
}
.dialog.wide,
.modal.wide,
dialog.wide {
  max-width: 800px;
}
.dialog.large {
  max-width: 1000px;
}
.dialog-header,
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 23px 24px 17px;
}
.dialog-title,
.modal-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin: 0;
}
.dialog-body,
.modal-body {
  padding: 0 24px 24px;
}
.dialog-description {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0 0 22px;
}
.dialog-footer,
.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.field,
.form-field {
  margin-bottom: 19px;
}
.field:last-child {
  margin-bottom: 0;
}
.field label,
.form-field label,
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 7px;
}
.field input:not([type="checkbox"]),
.field textarea,
.field select,
.form-field input:not([type="checkbox"]),
.form-field select,
.input,
.select {
  width: 100%;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  border-radius: 7px;
  padding: 9px 11px;
  min-height: 38px;
  font-size: 13px;
  line-height: 20px;
  transition:
    border-color var(--duration),
    box-shadow var(--duration);
}
.field input:focus,
.field textarea:focus,
.field select:focus,
.input:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: 0;
}
.field textarea {
  min-height: 100px;
  resize: vertical;
}
.field select,
.select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%23818a99' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.field-hint,
.form-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  margin: 7px 0 0;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 22px;
}
.field input[type="checkbox"] {
  accent-color: var(--accent);
}
.input-with-unit {
  position: relative;
}
.input-with-unit input {
  padding-right: 40px;
}
.input-unit {
  position: absolute;
  right: 12px;
  top: 10px;
  color: var(--muted);
  font-size: 12px;
}
.confirm-object {
  font-weight: 550;
  overflow-wrap: anywhere;
  color: var(--text);
}
.dropzone,
.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 175px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  text-align: center;
  padding: 22px;
  cursor: pointer;
  transition:
    background var(--duration),
    border-color var(--duration);
}
.dropzone.dragover,
.upload-dropzone.dragover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.dropzone > .icon,
.upload-dropzone > .icon {
  width: 28px;
  height: 28px;
  color: var(--accent-text);
  margin-bottom: 12px;
  stroke-width: 1.5;
}
.dropzone strong {
  font-size: 13px;
  font-weight: 500;
}
.dropzone p {
  font-size: 11px;
  color: var(--muted);
  margin: 7px 0 0;
  line-height: 1.7;
}
.upload-files {
  max-height: 160px;
  overflow: auto;
  margin: 14px 0;
}
.upload-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.upload-file .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-file .size {
  color: var(--muted);
}
.upload-summary {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 12px 0;
}
.upload-progress {
  height: 4px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
}
.upload-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width var(--duration);
}
.search-dialog {
  max-width: 640px !important;
}
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 23px;
  border-bottom: 1px solid var(--border);
}
.search-input-wrap > .icon {
  color: var(--accent-text);
}
.search-input {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 15px;
  line-height: 26px;
}
.search-input:focus-visible {
  outline: none;
}
.search-results {
  max-height: 60dvh;
  overflow: auto;
  padding: 8px;
}
.search-result {
  display: block;
  padding: 13px 15px;
  border-radius: 7px;
  color: var(--text);
  text-align: left;
  width: 100%;
}
.search-result-title {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 13px;
  font-weight: 550;
}
.search-result-path {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin: 5px 0;
}
.search-result-snippet {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result mark {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-radius: 2px;
}
.search-footer {
  font-size: 10px;
  color: var(--muted);
  padding: 11px 23px;
  border-top: 1px solid var(--border);
}
.settings-page {
  max-width: 1050px;
}
.settings-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 24px;
  overflow: hidden;
}
.settings-section-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.settings-section-title {
  font-size: 14px;
  font-weight: 550;
  margin: 0 0 5px;
}
.settings-section-description {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.8;
}
.settings-section-body {
  padding: 24px;
}
.settings-section-footer {
  padding: 16px 24px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.settings-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}
.usage-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 17px;
}
.usage-total strong {
  font-size: 28px;
  letter-spacing: -0.8px;
  font-weight: 600;
}
.usage-total span {
  font-size: 12px;
  color: var(--muted);
}
.usage-bar {
  height: 9px;
  background: var(--surface-3);
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
}
.usage-segment {
  height: 100%;
  min-width: 2px;
}
.usage-legend {
  display: flex;
  gap: 14px 24px;
  flex-wrap: wrap;
}
.usage-item {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 11px;
  color: var(--text-secondary);
}
.usage-item strong {
  font-weight: 500;
  color: var(--text);
}
.usage-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex-shrink: 0;
}
.cleanup-summary {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 16px;
}
.cleanup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.cleanup-row:last-child {
  border-bottom: 0;
}
.cleanup-row.total {
  background: var(--surface-2);
  font-weight: 550;
}
.cleanup-row small {
  font-size: 11px;
  color: var(--muted);
}
.cleanup-total {
  padding: 16px;
  background: var(--accent-soft);
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--accent-text);
}
.orphan-list {
  max-height: 190px;
  overflow: auto;
}
.orphan-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}
.history-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 360px;
  max-height: 65dvh;
}
.history-list {
  border-right: 1px solid var(--border);
  overflow: auto;
  padding: 8px;
}
.history-item {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 7px;
  color: var(--text-secondary);
  text-align: left;
  font-size: 11px;
}
.history-item.active {
  color: var(--accent-text);
  background: var(--accent-soft);
}
.history-item strong {
  font-size: 12px;
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
}
.history-preview {
  padding: 24px;
  overflow: auto;
  min-width: 0;
}
.version-badge {
  display: inline-block;
  padding: 1px 5px;
  background: var(--surface-3);
  border-radius: 4px;
  font-size: 10px;
}
.trash-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px auto;
  align-items: center;
  gap: 16px;
  padding: 15px 14px;
  border-bottom: 1px solid var(--border);
}
.popover,
.context-menu,
.dropdown-menu {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px;
  border-radius: 9px;
  min-width: 175px;
  box-shadow: var(--shadow);
  z-index: 80;
  animation: fade-in var(--duration);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  min-height: 34px;
  border-radius: 5px;
  text-align: left;
  color: var(--text-secondary);
  font-size: 12px;
}
.menu-item .icon {
  width: 15px;
  height: 15px;
}
.menu-item.danger {
  color: var(--danger);
}
.menu-separator {
  height: 1px;
  background: var(--border);
  margin: 5px 3px;
}
.toast-container,
.toasts {
  position: fixed;
  right: 26px;
  bottom: 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 150;
  pointer-events: none;
  width: min(390px, calc(100% - 32px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 9px;
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.65;
  pointer-events: auto;
  animation: toast-in var(--duration-slow);
}
.toast > .icon {
  color: var(--success);
  width: 17px;
  height: 17px;
}
.toast.error > .icon {
  color: var(--danger);
}
.toast > span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.toast button {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-text);
  white-space: nowrap;
}
.toast :is(.icon-btn, .icon-button) {
  width: 24px;
  height: 24px;
  color: var(--muted);
}
.loading-indicator {
  display: inline-block;
  width: 17px;
  height: 17px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 280px;
  color: var(--muted);
  font-size: 12px;
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2),
    var(--surface-3),
    var(--surface-2)
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: 5px;
}
.skeleton-line {
  height: 12px;
  margin-bottom: 15px;
}
.skeleton-title {
  height: 28px;
  width: 45%;
  margin-bottom: 25px;
}
.login-page,
.auth-page {
  overflow: auto;
  min-height: 100dvh;
  background: var(--sidebar);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}
.login-shell {
  width: 100%;
  max-width: 400px;
  position: relative;
}
.login-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 36px;
}
.login-card,
.auth-card {
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 4px 25px #20294204;
}
.login-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0 auto 23px;
  color: var(--accent-text);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 15%, var(--border));
  border-radius: 11px;
}
.login-icon .icon {
  width: 21px;
  height: 21px;
}
.login-card h1,
.auth-card h1 {
  font-size: 23px;
  letter-spacing: -0.7px;
  line-height: 1.4;
  text-align: center;
  margin: 0 0 11px;
  font-weight: 600;
}
.login-description,
.auth-description {
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-secondary);
  text-align: center;
  margin: 0 0 28px;
}
.login-form .field {
  margin-bottom: 17px;
}
.otp-input {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace !important;
  letter-spacing: 10px !important;
  font-size: 24px !important;
  text-align: center;
  height: 53px;
  padding-left: 22px !important;
  font-variant-numeric: tabular-nums;
}
.login-form :is(.btn, .button) {
  min-height: 42px;
  font-size: 13px;
}
.login-note {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  line-height: 1.8;
  margin: 20px 0 0;
}
.login-note .icon {
  width: 12px;
  height: 12px;
  display: inline;
  vertical-align: -2px;
  margin-right: 3px;
}
.login-footer {
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
  margin-top: 25px;
}
.login-footer span {
  margin: 0 7px;
  color: var(--border-strong);
}
.login-footer a {
  color: var(--text-secondary);
}
.auth-message {
  margin: 0 0 19px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--danger) 20%, var(--border));
  border-radius: 7px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
  line-height: 1.7;
}
.error-page {
  min-height: 100dvh;
  overflow: auto;
  display: grid;
  place-items: center;
  background: var(--sidebar);
  padding: 30px;
}
.error-card {
  max-width: 440px;
  text-align: center;
}
.error-code {
  font-size: 72px;
  letter-spacing: -5px;
  font-weight: 650;
  color: var(--border-strong);
  line-height: 1.1;
  margin-bottom: 20px;
}
.error-card h1 {
  font-size: 23px;
  letter-spacing: -0.5px;
  font-weight: 600;
}
.error-card p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 25px;
}
.drawer-backdrop {
  display: none;
}
.skip-link {
  position: fixed;
  top: -60px;
  left: 20px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  z-index: 200;
}
.skip-link:focus {
  top: 12px;
}
@media (hover: hover) {
  :is(.btn, .button):hover:not(:disabled) {
    background: var(--surface-2);
    border-color: var(--border-strong);
  }
  :is(.btn, .button).primary:hover:not(:disabled),
  .btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
  }
  :is(.btn, .button).danger:hover:not(:disabled),
  .btn-danger:hover:not(:disabled) {
    filter: brightness(0.94);
    background: var(--danger);
  }
  :is(.btn, .button).ghost:hover:not(:disabled),
  .btn-ghost:hover:not(:disabled) {
    background: var(--surface-3);
  }
  :is(.icon-btn, .icon-button):hover:not(:disabled) {
    background: var(--surface-3);
    color: var(--text);
  }
  :is(.icon-btn, .icon-button).danger:hover {
    color: var(--danger);
    background: var(--danger-soft);
  }
  .nav-link:hover,
  .nav-item:hover,
  .tree-row:hover {
    background: var(--surface-3);
    color: var(--text);
  }
  .nav-link.active:hover,
  .nav-item.active:hover,
  .tree-row.active:hover {
    background: var(--accent-soft);
    color: var(--accent-text);
  }
  .file-row:hover,
  .document-row:hover,
  .trash-row:hover {
    background: var(--surface-2);
  }
  .menu-item:hover,
  .search-result:hover,
  .history-item:hover {
    background: var(--surface-2);
    color: var(--text);
  }
  .menu-item.danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
  }
  .toc a:hover {
    color: var(--accent-text);
  }
  .sidebar-search:hover {
    border-color: var(--muted);
  }
  .breadcrumbs a:hover {
    text-decoration: underline;
  }
  .copy-code:hover {
    color: var(--text);
    border-color: var(--border-strong);
  }
}
@media (min-width: 1101px) {
  .sidebar-collapsed .sidebar {
    width: 64px;
    flex-basis: 64px;
    padding: 0 7px;
  }
  .sidebar-collapsed .sidebar-header {
    padding: 0;
    justify-content: center;
  }
  .sidebar-collapsed .brand-text,
  .sidebar-collapsed .sidebar-search span,
  .sidebar-collapsed .sidebar-search kbd,
  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .nav-count,
  .sidebar-collapsed .sidebar-section-label,
  .sidebar-collapsed .tree-heading,
  .sidebar-collapsed .tree-container,
  .sidebar-collapsed .session-status,
  .sidebar-collapsed .brand-subtitle {
    display: none;
  }
  .sidebar-collapsed .sidebar-search {
    padding: 0;
    justify-content: center;
  }
  .sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 10px;
  }
  .sidebar-collapsed .sidebar-footer {
    margin-top: auto;
  }
  .sidebar-collapsed .sidebar-header > :is(.icon-btn, .icon-button):last-child {
    display: none;
  }
}
@media (max-width: 1200px) {
  :root {
    --sidebar-width: 235px;
  }
  .reader-layout,
  .document-layout {
    gap: 30px;
    padding: 36px 32px 70px;
    grid-template-columns: minmax(0, 1fr) 150px;
  }
  .page {
    padding: 32px;
  }
  .topbar,
  .app-header {
    padding: 0 25px;
  }
  .toc a,
  .toc-link {
    font-size: 10px;
    padding-left: 14px;
  }
  .toc-title {
    padding-left: 14px;
  }
}
@media (max-width: 1000px) {
  :root {
    --sidebar-width: 220px;
  }
  .reader-layout,
  .document-layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 32px;
  }
  .toc,
  .article-toc {
    display: none;
  }
  .toc-toggle {
    display: inline-flex;
  }
  .page {
    padding: 28px;
  }
  .list-header,
  .file-row,
  .document-row {
    grid-template-columns: minmax(0, 1fr) 95px 40px;
    gap: 12px;
  }
  .file-size,
  .list-header .size-column {
    display: none;
  }
  .topbar,
  .app-header {
    padding: 0 22px;
  }
  .form-grid {
    gap: 0 16px;
  }
}
@media (max-width: 800px) {
  :root {
    --sidebar-width: 250px;
    --header-height: 57px;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow);
  }
  .sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-open .drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: #10152260;
    backdrop-filter: blur(2px);
    z-index: 25;
  }
  .mobile-menu,
  .mobile-only {
    display: inline-flex;
  }
  .desktop-only {
    display: none !important;
  }
  .topbar,
  .app-header {
    padding: 0 17px;
    gap: 10px;
  }
  .topbar-left,
  .topbar-right {
    gap: 7px;
  }
  .topbar .private-badge,
  .topbar .workspace-badge {
    display: none;
  }
  .page {
    padding: 26px 22px 50px;
  }
  .page-head,
  .page-heading {
    gap: 12px;
    margin-bottom: 23px;
  }
  .page-title {
    font-size: 24px;
  }
  .reader-layout,
  .document-layout {
    padding: 30px 26px 70px;
    max-width: 780px;
  }
  .document-title {
    font-size: 28px;
  }
  .editor-toolbar {
    padding: 12px 16px;
  }
  .editor-panes {
    grid-template-columns: 1fr;
  }
  .editor-pane:first-child {
    border-right: 0;
  }
  .editor-panes[data-mode="source"] .preview-pane,
  .editor-panes[data-mode="edit"] .preview-pane {
    display: none;
  }
  .editor-panes[data-mode="preview"] .source-pane {
    display: none;
  }
  .editor-panes:not([data-mode]) .editor-pane:last-child {
    display: none;
  }
  .source-editor,
  .markdown-editor {
    padding: 20px;
    min-height: 280px;
  }
  .editor-preview {
    padding: 22px;
  }
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dialog,
  .modal,
  dialog {
    max-height: calc(100dvh - 32px);
  }
  input,
  select,
  textarea,
  .field input:not([type="checkbox"]),
  .field select,
  .input,
  .select {
    font-size: 16px;
  }
  .sidebar-search {
    font-size: 13px;
  }
  .search-input {
    font-size: 16px;
  }
  .settings-section-body {
    padding: 20px;
  }
  .settings-section-header,
  .settings-section-footer {
    padding: 18px 20px;
  }
}
@media (max-width: 540px) {
  .topbar,
  .app-header {
    padding: 0 12px;
  }
  .topbar :is(.btn, .button):not(.primary):not(.btn-primary) {
    padding: 6px 8px;
  }
  .topbar .header-secondary,
  .topbar .btn-label,
  .topbar .breadcrumb-home {
    display: none;
  }
  .topbar :is(.btn, .button).primary,
  .topbar .btn-primary {
    padding: 6px 10px;
    min-height: 33px;
    font-size: 11px;
  }
  .breadcrumbs,
  .breadcrumb {
    font-size: 11px;
    gap: 6px;
  }
  .page {
    padding: 23px 18px 44px;
  }
  .page-title {
    font-size: 22px;
    margin-bottom: 5px;
  }
  .page-subtitle,
  .page-description {
    font-size: 11px;
    line-height: 1.7;
  }
  .page-head {
    margin-bottom: 21px;
  }
  .page-head .page-actions {
    gap: 5px;
  }
  .page-head .page-actions :is(.btn, .button) {
    padding: 6px 8px;
    font-size: 11px;
  }
  .page-head .page-actions :is(.btn, .button) .icon {
    width: 14px;
    height: 14px;
  }
  .list-header,
  .file-list-header {
    display: none;
  }
  .file-list,
  .document-list {
    border-top: 1px solid var(--border);
  }
  .file-row,
  .document-row {
    display: flex;
    gap: 10px;
    padding: 13px 0;
    min-height: 70px;
  }
  .file-main,
  .file-name-link {
    flex: 1;
    min-width: 0;
    gap: 10px;
  }
  .file-icon {
    width: 33px;
    height: 36px;
    border-radius: 7px;
  }
  .file-name {
    font-size: 12px;
  }
  .file-date {
    display: none;
  }
  .file-subtitle {
    font-size: 10px;
  }
  .file-row .row-actions {
    margin-left: auto;
  }
  .empty-state {
    padding: 54px 14px;
  }
  .empty-state h2,
  .empty-state h3 {
    font-size: 17px;
  }
  .empty-state p {
    font-size: 11px;
  }
  .empty-state .actions {
    gap: 7px;
  }
  .reader-layout,
  .document-layout {
    padding: 26px 21px 65px;
  }
  .document-title {
    font-size: 25px;
    letter-spacing: -0.6px;
  }
  .document-header,
  .reader-header {
    padding-bottom: 19px;
    margin-bottom: 25px;
  }
  .document-meta {
    gap: 9px;
    font-size: 9px;
  }
  .markdown,
  :is(.markdown-body, .prose),
  .prose {
    font-size: 14px;
    line-height: 1.9;
  }
  .markdown h1,
  :is(.markdown-body, .prose) h1 {
    font-size: 25px;
  }
  .markdown h2,
  :is(.markdown-body, .prose) h2 {
    font-size: 20px;
    margin-top: 29px;
  }
  .markdown h3,
  :is(.markdown-body, .prose) h3 {
    font-size: 16px;
  }
  .markdown pre,
  :is(.markdown-body, .prose) pre {
    padding: 17px;
    font-size: 11px;
    border-radius: 7px;
  }
  .markdown table,
  :is(.markdown-body, .prose) table {
    font-size: 11px;
  }
  .markdown th,
  .markdown td,
  :is(.markdown-body, .prose) th,
  :is(.markdown-body, .prose) td {
    padding: 9px 12px;
  }
  .dialog,
  .modal,
  dialog {
    width: 100%;
    max-width: 100% !important;
    margin: auto 0 0;
    max-height: 92dvh;
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .dialog-header,
  .modal-header {
    padding: 20px 20px 16px;
  }
  .dialog-body,
  .modal-body {
    padding: 0 20px 22px;
  }
  .dialog-footer,
  .modal-footer {
    padding: 14px 20px;
  }
  .dialog-title {
    font-size: 16px;
  }
  .dialog-description {
    font-size: 12px;
  }
  .search-dialog {
    max-height: 85dvh;
  }
  .search-input-wrap {
    padding: 17px 20px;
  }
  .search-results {
    max-height: 65dvh;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field {
    margin-bottom: 18px;
  }
  .settings-section {
    border-radius: 9px;
    margin-bottom: 18px;
  }
  .settings-section-header,
  .settings-section-body,
  .settings-section-footer {
    padding: 18px;
  }
  .settings-section-footer {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .settings-note {
    font-size: 10px;
  }
  .usage-total strong {
    font-size: 25px;
  }
  .usage-legend {
    gap: 11px 17px;
  }
  .usage-item {
    font-size: 10px;
  }
  .history-layout {
    grid-template-columns: 1fr;
    max-height: 70dvh;
  }
  .history-list {
    display: flex;
    gap: 5px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: 85px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .history-item {
    width: 155px;
    flex-shrink: 0;
    padding: 9px;
  }
  .history-preview {
    padding: 20px;
    min-height: 200px;
  }
  .trash-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 13px 0;
  }
  .trash-row .file-date {
    display: none;
  }
  .trash-row .actions {
    gap: 3px;
  }
  .trash-row .actions :is(.btn, .button) {
    padding: 5px 7px;
    min-height: 29px;
    font-size: 10px;
  }
  .toast-container,
  .toasts {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: calc(100% - 32px);
  }
  .toast {
    font-size: 11px;
    padding: 12px 13px;
  }
  .editor-toolbar {
    padding: 11px 13px;
    gap: 8px;
  }
  .editor-toolbar :is(.btn, .button) {
    padding: 6px 9px;
    font-size: 11px;
  }
  .editor-title {
    font-size: 12px;
    max-width: 140px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .editor-footer {
    padding: 7px 14px;
    font-size: 9px;
  }
  .editor-footer .secondary-hint {
    display: none;
  }
  .login-page,
  .auth-page {
    padding: 24px 20px;
    align-items: center;
  }
  .login-brand {
    margin-bottom: 28px;
  }
  .login-card,
  .auth-card {
    padding: 28px 24px;
  }
  .login-card h1 {
    font-size: 22px;
  }
  .login-footer {
    font-size: 9px;
  }
  .login-shell {
    max-width: 380px;
  }
  :is(.btn, .button) {
    min-height: 36px;
  }
  :is(.icon-btn, .icon-button) {
    min-width: 32px;
    min-height: 34px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
@media print {
  body,
  .content,
  .main-content {
    overflow: visible;
    height: auto;
  }
  .sidebar,
  .topbar,
  .article-toc,
  .toc,
  .page-actions,
  .toast-container,
  .toasts,
  .copy-code {
    display: none !important;
  }
  .app,
  .app-shell,
  .main,
  .main-shell {
    display: block;
    height: auto;
    overflow: visible;
  }
  .reader-layout,
  .document-layout {
    display: block;
    padding: 0;
    max-width: none;
  }
  .markdown,
  :is(.markdown-body, .prose) {
    font-size: 11pt;
  }
  .markdown pre,
  :is(.markdown-body, .prose) pre {
    white-space: pre-wrap;
    break-inside: avoid;
  }
  .markdown img,
  :is(.markdown-body, .prose) img {
    max-height: 600px;
  }
  a {
    color: inherit;
  }
  body {
    background: #fff;
    color: #111;
  }
}
/* Application-specific structure and component vocabulary. */
.sidebar > .brand {
  height: 78px;
  min-height: 78px;
  padding: 0 9px;
  gap: 9px;
  letter-spacing: 0;
}
.brand-mark > span {
  display: none;
}
.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.35;
  min-width: 0;
}
.brand-copy strong {
  font-size: 19px;
  letter-spacing: -0.6px;
  font-weight: 650;
}
.brand-copy > span {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.35px;
  font-weight: 400;
}
.brand-badge {
  margin-left: auto;
  align-self: center;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.7px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  line-height: 17px;
  padding: 0 5px;
}
.search-trigger {
  height: 35px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 9px;
  color: var(--muted);
  width: 100%;
  text-align: left;
  font-size: 12px;
}
.search-trigger > span:nth-child(2) {
  flex: 1;
}
.search-trigger .icon {
  width: 15px;
  height: 15px;
}
.search-trigger kbd {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 4px;
  font-family: inherit;
  font-size: 9px;
  color: var(--muted);
  line-height: 17px;
}
.directory-tree {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding-bottom: 16px;
}
.tree-loading {
  font-size: 11px;
  color: var(--muted);
  padding: 12px 10px;
}
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  height: 100dvh;
}
.topbar {
  justify-content: flex-start;
  gap: 14px;
  padding: 0 27px;
}
.topbar-spacer {
  flex: 1;
}
.topbar > .icon-button {
  margin-left: -6px;
}
.private-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.private-label .icon {
  width: 12px;
  height: 12px;
}
.workspace-status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 17px 10px 2px;
  border-top: 1px solid var(--border);
  margin-top: 13px;
}
.status-indicator {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}
.workspace-status > div {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.workspace-status strong {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
}
.workspace-status div > span {
  font-size: 9px;
  color: var(--muted);
}
.workspace-status > .icon-button {
  width: 25px;
  height: 28px;
}
.workspace-status > .icon-button .icon {
  width: 14px;
  height: 14px;
}
.mobile-search {
  display: none;
}
.sidebar-backdrop {
  display: none;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 29px;
}
.page-heading {
  display: block;
  margin: 0;
  min-width: 0;
}
.page-header .page-actions {
  padding-top: 6px;
}
.file-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.file-time {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.file-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}
.file-meta {
  display: block;
  font-size: 10px;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-icon.document {
  color: var(--text-secondary);
}
.file-icon.asset {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: transparent;
}
.empty-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.reader-main {
  min-width: 0;
  width: 100%;
}
.document-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-text);
  font-size: 10px;
  letter-spacing: 1.2px;
  margin-bottom: 13px;
  text-transform: uppercase;
}
.document-kicker .icon {
  width: 13px;
  height: 13px;
}
.document-header h1 {
  font-size: 31px;
  line-height: 1.4;
  letter-spacing: -0.8px;
  font-weight: 650;
  margin: 0 0 16px;
  overflow-wrap: anywhere;
}
.document-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
}
.article-toc a {
  display: block;
  color: var(--text-secondary);
  padding: 5px 18px;
  line-height: 1.65;
  text-overflow: ellipsis;
  overflow: hidden;
  border-left: 2px solid transparent;
  margin-left: -1px;
}
.article-toc a.active {
  border-left-color: var(--accent);
  color: var(--accent-text);
  background: linear-gradient(90deg, var(--accent-soft), transparent);
}
.article-toc .toc-title {
  padding-left: 18px;
}
.button.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
.button.small {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 11px;
}
.button.loading {
  pointer-events: none;
}
.button.loading::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.page-loading {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}
.spinner {
  display: inline-block;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.editor-input {
  display: block;
  width: 100%;
  height: 100%;
  resize: none;
  border: 0;
  background: var(--bg);
  padding: 24px;
  font:
    12px/1.85 ui-monospace,
    SFMono-Regular,
    Consolas,
    "Microsoft YaHei",
    monospace;
  outline: none;
  border-radius: 0;
  tab-size: 2;
  flex: 1;
  min-height: 300px;
}
.editor-input:focus-visible {
  outline: none;
}
.unsaved-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--warning);
  margin-right: 5px;
  vertical-align: 1px;
}
.field-help {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  margin: 7px 0 0;
}
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.form-stack .field {
  margin-bottom: 0;
}
.settings-layout {
  max-width: 1000px;
}
.section-heading {
  font-size: 14px;
  font-weight: 550;
  margin: 0 0 18px;
  line-height: 1.5;
}
.section-heading p {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 400;
  margin: 6px 0 0;
  line-height: 1.8;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 28px;
}
.settings-grid .field {
  margin-bottom: 0;
}
.storage-bar {
  height: 9px;
  background: var(--surface-3);
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  gap: 2px;
  margin: 19px 0 22px;
}
.storage-bar > span {
  height: 100%;
  min-width: 2px;
}
.storage-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px 24px;
}
.usage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}
.usage-row > span:last-child,
.usage-row > strong:last-child {
  margin-left: auto;
  color: var(--text);
  font-weight: 500;
}
.usage-row i,
.usage-row .dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 2px;
}
.settings-section > .section-heading {
  padding: 22px 24px 0;
}
.settings-section > .settings-grid,
.settings-section > .storage-legend,
.settings-section > .settings-note,
.settings-section > .cleanup-summary {
  margin: 0 24px 24px;
}
.settings-section > .storage-bar {
  margin: 18px 24px;
}
.file-selection {
  max-height: 170px;
  overflow: auto;
  margin: 13px 0 20px;
}
.upload-file > span:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-file > span:last-child {
  color: var(--muted);
}
.version-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 350px;
  overflow: auto;
}
.version-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
}
.version-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.version-item small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}
.version-preview {
  margin-top: 20px;
  padding: 20px;
  max-height: 45dvh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.modal.compact {
  max-width: 420px;
}
.modal.search-modal {
  max-width: 650px;
}
.search-snippet {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-top: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.toast-region {
  position: fixed;
  right: 26px;
  bottom: 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 150;
  pointer-events: none;
  width: min(390px, calc(100% - 32px));
}
.toast-action {
  font-size: 11px;
  font-weight: 550;
  color: var(--accent-text);
  padding: 4px;
  white-space: nowrap;
}
.login-page {
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 0;
}
.login-topbar {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  flex-shrink: 0;
}
.login-topbar .brand {
  font-size: 21px;
  gap: 10px;
}
.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  padding: 32px 20px 48px;
}
.login-card {
  width: 100%;
  max-width: 405px;
  padding: 37px 34px 29px;
}
.login-symbol {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 15%, var(--border));
  background: var(--accent-soft);
  color: var(--accent-text);
  margin: 0 auto 25px;
}
.login-symbol svg {
  width: 23px;
  height: 23px;
}
.login-card > .eyebrow {
  display: block;
  text-align: center;
  font-size: 9px;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}
.login-card h1 {
  font-size: 22px;
  letter-spacing: -0.65px;
  margin-bottom: 11px;
}
.login-card .field-label {
  font-size: 11px;
  margin-bottom: 8px;
}
.login-card .otp-input {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg);
  width: 100%;
  height: 52px;
  padding: 9px 11px;
}
.login-card .otp-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.login-submit {
  width: 100%;
  height: 41px;
  justify-content: center;
  margin-top: 20px;
  font-size: 12px;
}
.login-submit svg {
  width: 16px;
  height: 16px;
}
.login-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 23px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 9px;
}
.login-security svg {
  width: 13px;
  height: 13px;
}
.login-page > .login-footer {
  padding: 0 20px 30px;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 10px;
}
.login-page > .login-footer span {
  margin: 0;
  color: var(--muted);
}
.login-footer span + span {
  padding-left: 20px;
  border-left: 1px solid var(--border-strong);
}
@media (hover: hover) {
  .search-trigger:hover {
    border-color: var(--muted);
  }
  .button.quiet:hover {
    background: var(--surface-3);
    color: var(--text);
  }
  .article-toc a:hover {
    color: var(--accent-text);
  }
}
@media (min-width: 801px) {
  .sidebar-collapsed .sidebar {
    width: 66px;
    flex-basis: 66px;
    padding: 0 8px;
  }
  .sidebar-collapsed .sidebar > .brand {
    padding: 0;
    justify-content: center;
  }
  .sidebar-collapsed .brand-copy,
  .sidebar-collapsed .brand-badge,
  .sidebar-collapsed .search-trigger > span:nth-child(2),
  .sidebar-collapsed .search-trigger kbd,
  .sidebar-collapsed .nav-item > span:not(:first-child),
  .sidebar-collapsed .sidebar-section-label,
  .sidebar-collapsed .directory-tree,
  .sidebar-collapsed .workspace-status > div,
  .sidebar-collapsed .workspace-status > .status-indicator {
    display: none;
  }
  .sidebar-collapsed .search-trigger {
    justify-content: center;
    padding: 0;
  }
  .sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 10px;
  }
  .sidebar-collapsed .sidebar-footer {
    margin-top: auto;
  }
  .sidebar-collapsed .workspace-status {
    padding: 12px 0 0;
    justify-content: center;
  }
  .sidebar-collapsed .workspace-status .icon-button {
    width: 32px;
    height: 32px;
  }
}
@media (max-width: 1000px) {
  .file-time {
    font-size: 10px;
  }
  .reader-layout {
    gap: 30px;
  }
  .document-header h1 {
    font-size: 29px;
  }
  .settings-grid {
    gap: 18px 20px;
  }
}
@media (max-width: 800px) {
  .sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: #10152260;
    backdrop-filter: blur(2px);
    z-index: 25;
    width: 100%;
    height: 100%;
    border: 0;
  }
  .mobile-search {
    display: inline-flex;
  }
  .topbar {
    padding: 0 19px;
    gap: 10px;
  }
  .topbar .private-label {
    display: none;
  }
  .page-header {
    gap: 12px;
    margin-bottom: 24px;
  }
  .editor-input {
    padding: 20px;
    font-size: 14px;
  }
  .editor-layout > .editor-pane {
    min-height: 300px;
  }
  .settings-layout {
    max-width: 100%;
  }
  .toast-region {
    right: 20px;
    bottom: 20px;
  }
  .article-toc {
    display: none;
  }
}
@media (max-width: 540px) {
  .topbar {
    padding: 0 15px;
    gap: 7px;
  }
  .page-header {
    gap: 10px;
    align-items: flex-start;
  }
  .page-header .page-actions {
    padding-top: 2px;
    gap: 5px;
  }
  .page-header .page-actions .button {
    padding: 6px 8px;
    font-size: 11px;
  }
  .page-header .page-actions .button .icon {
    width: 14px;
    height: 14px;
  }
  .file-time {
    display: none;
  }
  .file-row-actions {
    margin-left: auto;
  }
  .file-main {
    flex: 1;
  }
  .file-meta {
    font-size: 10px;
  }
  .file-toolbar {
    margin-bottom: 10px;
  }
  .file-toolbar .toolbar-label {
    font-size: 10px;
  }
  .document-header h1 {
    font-size: 25px;
  }
  .document-actions {
    gap: 5px;
    flex-wrap: wrap;
  }
  .document-actions .button {
    padding: 6px 9px;
    font-size: 11px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .settings-section > .section-heading {
    padding: 19px 18px 0;
  }
  .settings-section > .settings-grid,
  .settings-section > .storage-legend,
  .settings-section > .settings-note,
  .settings-section > .cleanup-summary {
    margin-left: 18px;
    margin-right: 18px;
  }
  .settings-section > .storage-bar {
    margin-left: 18px;
    margin-right: 18px;
  }
  .storage-legend {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .toast-region {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: calc(100% - 32px);
  }
  .login-topbar {
    height: 78px;
    padding: 0 25px;
  }
  .login-topbar .private-label {
    font-size: 9px;
  }
  .login-main {
    padding: 20px 20px 36px;
  }
  .login-card {
    max-width: 375px;
    padding: 29px 25px 26px;
  }
  .login-symbol {
    margin-bottom: 21px;
  }
  .login-page > .login-footer {
    font-size: 9px;
    padding-bottom: 25px;
  }
  .login-card h1 {
    font-size: 21px;
  }
  .login-card .otp-input {
    font-size: 25px !important;
  }
  .login-card .field-label {
    font-size: 12px;
  }
  .login-security {
    font-size: 9px;
  }
  .version-item {
    padding: 11px;
    font-size: 11px;
    gap: 8px;
  }
  .version-item .button {
    font-size: 10px;
    padding: 4px 7px;
    min-height: 29px;
  }
  .version-preview {
    padding: 15px;
  }
  .empty-actions {
    gap: 7px;
  }
  .empty-actions .button {
    font-size: 11px;
    padding: 7px 10px;
  }
}
/* Dynamic view layouts. */
.folder-page {
  padding: 38px 44px 60px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}
.file-toolbar .toolbar-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
}
.file-toolbar .toolbar-label .icon {
  width: 14px;
  height: 14px;
}
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.select.small {
  font-size: 11px;
  min-height: 31px;
  width: auto;
  max-width: 170px;
  padding: 5px 30px 5px 10px;
}
.tree-label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
  text-align: left;
  padding: 6px 4px;
  color: inherit;
  font-size: 12px;
  line-height: 22px;
}
.tree-label > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-toggle-placeholder {
  width: 20px;
  flex-shrink: 0;
}
.tree-toggle.expanded .icon {
  transform: rotate(90deg);
}
.breadcrumbs > button {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 3px 0;
  min-width: 0;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breadcrumbs > button:last-child {
  color: var(--text);
}
.breadcrumbs > .icon {
  width: 11px;
  height: 11px;
  color: var(--muted);
}
.document-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.document-title-row > h1 {
  min-width: 0;
  flex: 1;
}
.document-title-row > .document-actions {
  flex-shrink: 0;
  margin-top: 2px;
  gap: 6px;
}
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-size: inherit;
  padding: 0;
}
.text-button .icon {
  width: 12px;
  height: 12px;
}
.document-end {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.document-end .icon {
  width: 13px;
  height: 13px;
}
.toc-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  font-weight: 500;
}
.toc-title > .icon-button {
  width: 24px;
  height: 24px;
  min-height: 24px;
  margin-top: -3px;
  margin-bottom: -3px;
}
.toc-title > .icon-button .icon {
  width: 13px;
  height: 13px;
}
.toc-link {
  padding-left: calc(18px + min(var(--level, 0), 3) * 8px) !important;
}
.toc-empty {
  display: block;
  font-size: 10px;
  color: var(--muted);
  padding: 0 18px;
}
.toc-footer {
  font-size: 9px;
  color: var(--muted);
  display: flex;
  gap: 5px;
  align-items: center;
  margin: 24px 18px 0;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  line-height: 1.7;
}
.toc-footer .icon {
  width: 11px;
  height: 11px;
}
.reader-layout.toc-hidden {
  grid-template-columns: minmax(0, 820px);
  max-width: 900px;
}
.toc-hidden .article-toc {
  display: none;
}
.copy-code {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.copy-code .icon {
  width: 12px;
  height: 12px;
}
.render-warnings {
  border: 1px solid color-mix(in srgb, var(--warning) 20%, var(--border));
  background: var(--warning-soft);
  color: var(--warning);
  border-radius: 8px;
  margin: 0 0 25px;
  font-size: 11px;
  line-height: 1.8;
  padding: 12px 14px;
}
.render-warnings summary {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  list-style: none;
}
.render-warnings summary::-webkit-details-marker {
  display: none;
}
.render-warnings summary .icon {
  width: 14px;
  height: 14px;
}
.render-warnings ul {
  padding-left: 20px;
  margin: 10px 0 0;
}
.asset-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 30px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.asset-preview img {
  max-width: 100%;
  height: auto;
  max-height: 70dvh;
  object-fit: contain;
}
.editor-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.editor-heading > .icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}
.editor-heading > strong {
  font-size: 12px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editor-heading .editor-status {
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  padding-left: 11px;
  margin-left: 2px;
}
.editor-status.unsaved {
  color: var(--warning);
}
.editor-status.unsaved::before {
  content: "";
  display: inline-block;
  vertical-align: 1px;
  margin-right: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--warning);
}
.editor-toolbar kbd {
  font: 9px/1.5 inherit;
  opacity: 0.7;
  margin-left: 3px;
}
.editor-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.editor-panels > .editor-pane,
.editor-panels > .preview-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.editor-panels > .editor-pane {
  border-right: 1px solid var(--border);
}
.editor-panels .pane-label {
  flex-shrink: 0;
  gap: 6px;
}
.pane-label > .icon {
  width: 12px;
  height: 12px;
}
.editor-panels .editor-input {
  min-height: 0;
  flex: 1;
}
.editor-panels #editor-preview {
  padding: 24px 30px;
  min-height: 0;
  overflow: auto;
  flex: 1;
}
.version-source {
  width: 100%;
  min-height: 260px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--code-bg);
  padding: 16px;
  font:
    12px/1.8 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  resize: vertical;
  margin-top: 10px;
}
.inline-footer {
  margin: 7px -24px -24px;
  padding: 16px 24px;
}
.action-menu .menu-item {
  min-height: 40px;
}
.action-menu .menu-item > .icon:last-child {
  margin-left: auto;
  width: 12px;
  height: 12px;
  color: var(--muted);
}
.reauth-description {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0 0 22px;
}
.modal .otp-input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg);
  padding: 9px 11px;
  min-height: 50px;
}
.session-locked .workspace,
.session-locked .sidebar {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
}
@media (hover: hover) {
  .breadcrumbs > button:hover,
  .text-button:hover {
    color: var(--accent-text);
  }
  .action-menu .menu-item.danger-text:hover {
    color: var(--danger);
    background: var(--danger-soft);
  }
}
@media (max-width: 1200px) {
  .folder-page {
    padding: 32px;
  }
  .document-title-row {
    gap: 12px;
  }
}
@media (max-width: 1000px) {
  .folder-page {
    padding: 28px;
  }
  .reader-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .document-title-row .document-actions .secondary {
    display: none;
  }
}
@media (max-width: 800px) {
  .folder-page {
    padding: 26px 22px 50px;
  }
  .document-title-row {
    flex-wrap: wrap;
    gap: 0;
  }
  .document-title-row > h1 {
    min-width: 60%;
  }
  .document-title-row > .document-actions {
    margin: 0 0 15px;
  }
  .editor-panels {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(200px, 1fr) minmax(170px, 0.8fr);
    overflow: hidden;
  }
  .editor-panels > .editor-pane {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .editor-panels > .preview-pane {
    display: flex;
  }
  .editor-panels #editor-preview {
    padding: 20px 24px;
  }
  .editor-panels .editor-input {
    font-size: 14px;
  }
  .editor-heading {
    gap: 7px;
  }
  .editor-heading .editor-status {
    display: none;
  }
  .editor-toolbar kbd {
    display: none;
  }
  .breadcrumbs > button {
    font-size: 11px;
    max-width: 160px;
  }
}
@media (max-width: 540px) {
  .folder-page {
    padding: 23px 18px 44px;
  }
  .page-header {
    flex-wrap: wrap;
  }
  .page-header > .page-actions {
    width: 100%;
    padding-top: 8px;
    gap: 7px;
  }
  .page-header > .page-actions .button {
    min-height: 33px;
  }
  .page-header > .page-actions .button.primary {
    margin-left: auto;
  }
  .file-toolbar .select.small {
    font-size: 11px;
    min-height: 30px;
    max-width: 130px;
  }
  .file-toolbar .toolbar-right {
    gap: 5px;
  }
  .tree-label {
    font-size: 13px;
    min-height: 37px;
  }
  .tree-row {
    min-height: 37px;
  }
  .tree-toggle {
    height: 34px;
  }
  .breadcrumbs > button {
    max-width: 110px;
  }
  .breadcrumbs > button:not(:last-child) {
    display: none;
  }
  .breadcrumbs > .icon {
    display: none;
  }
  .breadcrumbs > button:last-child {
    display: block;
  }
  .document-title-row > h1 {
    min-width: 100%;
    font-size: 25px;
  }
  .document-title-row > .document-actions {
    margin-bottom: 15px;
  }
  .document-title-row .document-actions .secondary {
    display: inline-flex;
  }
  .document-meta {
    font-size: 10px;
  }
  .editor-heading > strong {
    max-width: 130px;
    font-size: 11px;
  }
  .editor-heading > .icon {
    display: none;
  }
  .editor-toolbar .page-actions {
    gap: 5px;
  }
  .editor-toolbar .button.small {
    font-size: 10px;
    padding: 5px 7px;
    min-height: 30px;
  }
  .editor-panels {
    grid-template-rows: minmax(190px, 1fr) minmax(150px, 0.8fr);
  }
  .editor-panels .editor-input {
    font-size: 16px;
    padding: 17px;
  }
  .editor-panels #editor-preview {
    padding: 19px 21px;
  }
  .editor-footer > span:last-child {
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .inline-footer {
    margin-left: -20px;
    margin-right: -20px;
    margin-bottom: -22px;
    padding: 14px 20px;
  }
  .version-source {
    font-size: 13px;
    min-height: 240px;
  }
  .asset-preview {
    padding: 15px;
    min-height: 240px;
  }
  .modal .form-stack {
    gap: 12px;
  }
  .modal .otp-input {
    font-size: 25px !important;
  }
  .page-actions .button.small {
    font-size: 11px;
  }
}
/* Settings and maintenance views use the same quiet page rhythm. */
.settings-layout {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 38px 44px 60px;
}
.settings-section > .section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 21px;
}
.section-heading h2 {
  font-size: 14px;
  font-weight: 550;
  line-height: 1.5;
  margin: 0;
}
.section-heading p {
  font-size: 11px;
  line-height: 1.75;
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-weight: 400;
}
.storage-total {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.7px;
  white-space: nowrap;
}
.storage-legend > .usage-row > span:first-child {
  display: flex;
  gap: 8px;
  align-items: center;
}
.legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 2px;
}
.segment-0 {
  background: #6788eb;
}
.segment-1 {
  background: #88b9a5;
}
.segment-2 {
  background: #b49aca;
}
.segment-3 {
  background: #dcac78;
}
.segment-4 {
  background: #9ba6b9;
}
.segment-5 {
  background: #7f9eaa;
}
.segment-6 {
  background: #bdc5d2;
}
.settings-grid .input-unit {
  position: relative;
  right: auto;
  top: auto;
  font-size: inherit;
  color: inherit;
  display: block;
}
.settings-grid .input-unit > input {
  padding-right: 47px;
}
.settings-grid .input-unit > span {
  position: absolute;
  right: 12px;
  top: 10px;
  font-size: 11px;
  color: var(--muted);
  pointer-events: none;
}
.settings-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--surface-2);
  padding: 12px 14px;
  border-radius: 7px;
  line-height: 1.75;
}
.settings-note > .icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--text-secondary);
}
.section-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.section-footer > span {
  font-size: 10px;
  color: var(--muted);
}
.settings-section > .field-help {
  margin: 0 24px 20px;
  font-size: 11px;
  line-height: 1.8;
}
.settings-section > .orphan-list {
  margin: 0 24px 20px;
}
.orphan-item {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 9px;
  font-size: 11px;
  text-align: left;
  color: var(--text-secondary);
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.orphan-item > .icon {
  width: 14px;
  height: 14px;
}
.orphan-item > span:nth-child(2) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.orphan-item > span:nth-child(3) {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.cleanup-summary > .usage-row {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  justify-content: space-between;
  gap: 15px;
}
.cleanup-summary > .usage-row:last-child {
  border: 0;
}
.dropzone > span {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.dropzone.dragging {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.upload-file > span:nth-child(2) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-file > span:nth-child(3) {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.upload-file > .icon {
  width: 15px;
  height: 15px;
  color: var(--text-secondary);
}
.upload-file > .icon-button {
  width: 25px;
  height: 27px;
  min-height: 27px;
}
.upload-file > .icon-button .icon {
  width: 13px;
  height: 13px;
}
.history-layout > .version-list {
  padding: 8px;
  border-right: 1px solid var(--border);
  max-height: none;
}
.history-layout .version-item {
  justify-content: flex-start;
  border-color: transparent;
  gap: 8px;
  padding: 10px 8px;
  text-align: left;
  font-size: 11px;
}
.history-layout .version-item.active {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.history-layout .version-item > .icon {
  width: 14px;
  height: 14px;
}
.history-layout .version-item strong {
  font-weight: 500;
  font-size: 11px;
}
.history-layout .version-item small {
  font-size: 9px;
  line-height: 1.6;
}
.history-layout > .version-preview {
  margin: 0;
  border: 0;
  border-radius: 0;
  max-height: none;
  min-height: 0;
  padding: 22px;
}
.file-list-header,
.file-row {
  grid-template-columns: minmax(0, 1fr) 130px 90px 80px;
}
.file-row.trash-row {
  grid-template-columns: minmax(0, 1fr) 130px 90px 80px;
}
.trash-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
}
.trash-actions .button {
  padding: 4px 7px;
}
.trash-actions .icon-button {
  width: 29px;
  height: 29px;
  min-height: 29px;
}
.trash-actions .icon-button .icon {
  width: 14px;
  height: 14px;
}
@media (max-width: 1200px) {
  .settings-layout {
    padding: 32px;
  }
  .file-list-header,
  .file-row,
  .file-row.trash-row {
    grid-template-columns: minmax(0, 1fr) 100px 75px 80px;
  }
}
@media (max-width: 1000px) {
  .settings-layout {
    padding: 28px;
  }
  .file-list-header,
  .file-row,
  .file-row.trash-row {
    grid-template-columns: minmax(0, 1fr) 100px 80px;
  }
  .file-size {
    display: none;
  }
}
@media (max-width: 800px) {
  .settings-layout {
    padding: 26px 22px 50px;
  }
  .settings-section > .section-heading {
    gap: 13px;
  }
  .storage-total {
    font-size: 21px;
  }
}
@media (max-width: 540px) {
  .settings-layout {
    padding: 23px 18px 44px;
  }
  .settings-section > .section-heading {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
  }
  .section-heading h2 {
    font-size: 13px;
  }
  .section-heading p {
    font-size: 10px;
  }
  .storage-total {
    font-size: 20px;
  }
  .section-heading > .button {
    font-size: 10px;
    padding: 5px 7px;
    min-height: 30px;
  }
  .section-heading > .button .icon {
    width: 12px;
    height: 12px;
  }
  .section-heading > .badge {
    font-size: 9px;
  }
  .section-footer {
    padding: 14px 18px;
    gap: 10px;
  }
  .section-footer > span {
    font-size: 9px;
  }
  .section-footer > .button {
    font-size: 11px;
    min-height: 33px;
  }
  .settings-section > .field-help,
  .settings-section > .orphan-list {
    margin-left: 18px;
    margin-right: 18px;
  }
  .settings-grid .input-unit > span {
    top: 11px;
    font-size: 12px;
  }
  .file-row.trash-row {
    display: flex;
    gap: 10px;
  }
  .trash-actions {
    flex-shrink: 0;
  }
  .trash-actions .button {
    font-size: 10px;
  }
  .history-layout > .version-list {
    display: flex;
    flex-direction: row;
    border-right: 0;
    max-height: 85px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
  }
  .history-layout .version-item {
    width: 155px;
    flex-shrink: 0;
  }
  .history-layout > .version-preview {
    min-height: 180px;
    padding: 18px;
  }
  .settings-note {
    font-size: 10px;
  }
  .cleanup-summary > .usage-row {
    font-size: 10px;
    padding: 10px 12px;
  }
  .dropzone {
    min-height: 155px;
    padding: 19px;
  }
  .dropzone > span {
    font-size: 10px;
  }
}

/* The select button and its popup share the same theme on every platform. */
.select-control {
  min-width: 0;
  width: 100%;
}
.select-control.small {
  width: auto;
  max-width: 170px;
}
.select-trigger,
.select-trigger.small {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding-right: 11px;
  text-align: left;
  background-image: none;
}
.select-trigger:hover:not(:disabled) {
  border-color: var(--accent);
}
.select-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.select-value {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.select-chevron {
  width: 15px;
  height: 15px;
  color: var(--muted);
  transition: transform var(--duration), color var(--duration);
}
.select-trigger[aria-expanded="true"] .select-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}
.select-menu {
  position: fixed;
  inset: auto;
  z-index: 1000;
  margin: 0;
  padding: 5px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: auto;
  overscroll-behavior: contain;
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
  max-height: 288px;
  scrollbar-gutter: stable;
}
.select-menu::backdrop {
  background: transparent;
}
.select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}
.select-option > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.select-option[aria-selected="true"] {
  color: var(--accent-text);
  font-weight: 500;
}
.select-option.is-active {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.select-check {
  width: 16px;
  height: 16px;
  color: var(--accent);
  visibility: hidden;
}
.select-option[aria-selected="true"] .select-check {
  visibility: visible;
}
.select-option[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
/* Without Popover support the list expands inside the form, so a dialog can
   scroll to every option instead of clipping an absolutely positioned menu. */
.select-menu-inline {
  position: static;
  width: 100%;
  margin-top: 6px;
}
@media (max-width: 540px) {
  .select-control.small {
    max-width: 130px;
  }
  .select-option {
    min-height: 44px;
  }
}
@media (forced-colors: active) {
  .select-option.is-active {
    outline: 1px solid Highlight;
    outline-offset: -2px;
  }
  .select-option[aria-selected="true"] {
    color: Highlight;
  }
}
