:root {
  color-scheme: light;
  --canvas: #f4f6f4;
  --surface: #ffffff;
  --surface-muted: #f8faf8;
  --surface-hover: #f0f5f3;
  --surface-selected: #e7f3ee;
  --ink: #182521;
  --ink-soft: #53625d;
  --ink-faint: #86938e;
  --line: #dfe6e1;
  --line-strong: #cbd6d0;
  --brand: #0b765a;
  --brand-dark: #075b45;
  --brand-light: #dff1e9;
  --accent: #c47624;
  --accent-light: #fff0de;
  --danger: #bd3d38;
  --danger-light: #fae8e6;
  --warning: #a96617;
  --warning-light: #fff3df;
  --success: #167a50;
  --success-light: #e3f5ec;
  --sidebar: #183630;
  --sidebar-soft: #23443d;
  --sidebar-ink: #e7f0ec;
  --sidebar-muted: #a7bbb3;
  --shadow-sm: 0 1px 2px rgba(17, 37, 31, .05);
  --shadow-md: 0 10px 30px rgba(17, 37, 31, .11);
  --shadow-lg: 0 18px 50px rgba(17, 37, 31, .16);
  --radius: 7px;
  --radius-sm: 5px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow-x: hidden; background: var(--canvas); color: var(--ink); font: 14px/1.5 var(--font); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:not(:disabled), [role="button"] { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
input, select, textarea { color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--ink-faint); opacity: 1; }
a { color: inherit; }
svg { display: block; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.visually-hidden { position: absolute !important; overflow: hidden; width: 1px; height: 1px; padding: 0; border: 0; margin: -1px; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-soft); }
.subtle { color: var(--ink-faint); }
.nowrap { white-space: nowrap; }

/* Shared controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px; padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-weight: 650; line-height: 1.2; text-decoration: none; transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: #a9bbb3; background: var(--surface-hover); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible, .nav-item:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .folder-tile:focus-visible { outline: 3px solid rgba(11,118,90,.22); outline-offset: 2px; }
.btn--primary { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: 0 1px 1px rgba(1, 51, 37, .12); }
.btn--primary:hover:not(:disabled) { border-color: var(--brand-dark); background: var(--brand-dark); }
.btn--danger { border-color: var(--danger); background: var(--danger); color: #fff; }
.btn--danger:hover:not(:disabled) { border-color: #9f2c28; background: #9f2c28; }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover:not(:disabled) { border-color: transparent; background: var(--surface-hover); }
.btn--soft { border-color: transparent; background: var(--brand-light); color: var(--brand-dark); }
.btn--soft:hover:not(:disabled) { border-color: transparent; background: #cce9dc; }
.btn--small { min-height: 30px; padding: 5px 9px; font-size: 12px; }
.btn--large { min-height: 44px; padding: 10px 15px; }
.btn--full { width: 100%; }
.icon-btn { position: relative; display: inline-grid; width: 34px; height: 34px; place-items: center; padding: 0; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--ink-soft); transition: color .16s ease, background .16s ease, border-color .16s ease; }
.icon-btn:hover:not(:disabled) { border-color: var(--line); background: var(--surface-hover); color: var(--ink); }
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn--small { width: 28px; height: 28px; }
.icon-btn--small .icon { width: 16px; height: 16px; }
.button-stack { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.field { display: grid; gap: 6px; min-width: 0; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.field > input, .field > select, .field > textarea, .input-action-wrap > input, .control-input { width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); line-height: 1.35; outline: 0; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.field > textarea { min-height: 92px; resize: vertical; }
.field > input:focus, .field > select:focus, .field > textarea:focus, .input-action-wrap > input:focus, .control-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,118,90,.12); }
.field-error { min-height: 0; color: var(--danger); font-size: 11px; font-weight: 500; }
.field-help { color: var(--ink-faint); font-size: 11px; font-weight: 500; }
.field.invalid > input, .field.invalid > select, .field.invalid > textarea { border-color: var(--danger); }
.input-action-wrap { position: relative; display: block; }
.input-action-wrap > input { padding-right: 42px; }
.input-action { position: absolute; z-index: 1; top: 50%; right: 3px; display: grid; width: 32px; height: 32px; place-items: center; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-faint); transform: translateY(-50%); }
.input-action:hover { color: var(--ink); background: var(--surface-hover); }
.checkbox-row { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; cursor: pointer; user-select: none; }
input[type="checkbox"], input[type="radio"] { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); }
.form-alert { padding: 8px 10px; border: 1px solid #edc3bf; border-radius: var(--radius-sm); background: var(--danger-light); color: #942e2a; font-size: 12px; }

/* Boot / authentication */
.boot-screen { position: fixed; z-index: 1000; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--canvas); color: var(--ink-soft); transition: opacity .24s ease, visibility .24s ease; }
.boot-screen.is-leaving { visibility: hidden; opacity: 0; }
.boot-screen p { margin: 0; font-size: 13px; }
.boot-loader { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.brand-mark { display: grid; width: 33px; height: 33px; place-items: center; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.18); border-radius: 7px; background: var(--brand); color: #fff; font-family: Georgia, serif; font-size: 19px; font-weight: 700; line-height: 1; }
.brand-mark--large { width: 48px; height: 48px; border-radius: 8px; font-size: 27px; box-shadow: 0 7px 20px rgba(0,68,50,.18); }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.login-view { display: grid; min-height: 100vh; grid-template-columns: minmax(360px, 1.06fr) minmax(380px, .94fr); background: var(--surface); }
.login-brand-panel { display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: clamp(32px, 6vw, 80px) clamp(32px, 8vw, 80px); background: var(--sidebar); color: var(--sidebar-ink); }
.login-brand-lockup { display: flex; align-items: center; gap: 15px; }
.login-brand-lockup h1 { margin: 2px 0 0; font-size: 22px; font-weight: 720; letter-spacing: 0; }
.login-kicker { margin: 0; color: var(--sidebar-muted); font-size: 10px; font-weight: 750; letter-spacing: 0; }
.login-brand-panel blockquote { width: min(100%, 370px); max-width: 370px; margin: auto 0 7vh; padding: 0; border: 0; }
.login-brand-panel blockquote p { max-width: 370px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(17px, 1.9vw, 21px); font-weight: 500; line-height: 1.35; }
.login-form-panel { display: grid; place-items: center; padding: 40px; background: var(--surface); }
.login-form { width: min(100%, 390px); }
.login-heading { margin-bottom: 28px; }
.login-heading .eyebrow { margin: 0 0 8px; color: var(--brand); font-size: 11px; font-weight: 750; letter-spacing: 0; }
.login-heading h2 { margin: 0; font-size: 28px; line-height: 1.24; letter-spacing: 0; }
.login-heading > p:last-child { margin: 9px 0 0; color: var(--ink-soft); }
.login-form .field + .field { margin-top: 16px; }
.login-form .checkbox-row { margin: 16px 0 20px; }
.login-form .form-alert { margin: -7px 0 14px; }
.login-footnote { margin: 20px 0 0; color: var(--ink-faint); text-align: center; font-size: 12px; }
.login-auth-switch { margin: 18px 0 0; color: var(--ink-soft); text-align: center; font-size: 13px; }
.login-auth-link { margin: 0; padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 650; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.login-auth-link:hover { color: var(--brand-strong, var(--brand)); }

/* App shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; display: flex; width: 236px; flex-direction: column; background: var(--sidebar); color: var(--sidebar-ink); }
.sidebar-brand { position: relative; display: flex; align-items: center; height: 72px; gap: 10px; padding: 0 17px; border-bottom: 1px solid rgba(231,240,236,.09); }
.sidebar-brand-copy { display: grid; min-width: 0; gap: 1px; }
.sidebar-brand-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 680; }
.sidebar-brand-copy span { color: var(--sidebar-muted); font-size: 10px; }
.sidebar-collapse-toggle { order: 3; margin-left: auto; color: var(--sidebar-muted); }
.sidebar-collapse-toggle:hover { border-color: rgba(231,240,236,.16); background: rgba(255,255,255,.07); color: var(--sidebar-ink); }
.sidebar-close { display: none; margin-left: auto; color: var(--sidebar-muted); }
.main-nav { overflow-y: auto; padding: 17px 11px; }
.nav-group + .nav-group { margin-top: 24px; }
.nav-label { margin: 0 8px 8px; color: var(--sidebar-muted); font-size: 10px; font-weight: 720; letter-spacing: 0; text-transform: uppercase; }
.nav-item { display: flex; width: 100%; align-items: center; gap: 11px; min-height: 38px; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--sidebar-muted); font-weight: 570; text-align: left; transition: color .15s ease, background .15s ease; }
.nav-item .icon { width: 18px; height: 18px; }
.nav-item:hover { background: rgba(255,255,255,.07); color: var(--sidebar-ink); }
.nav-item.active { background: var(--sidebar-soft); color: #fff; font-weight: 680; }
.sidebar-footer { margin-top: auto; padding: 11px; border-top: 1px solid rgba(231,240,236,.09); }
.sidebar-user { display: flex; width: 100%; align-items: center; gap: 9px; padding: 7px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--sidebar-ink); text-align: left; }
.sidebar-user:hover { background: rgba(255,255,255,.06); }
.sidebar-user > .icon { width: 16px; margin-left: auto; color: var(--sidebar-muted); }
.avatar { display: grid; width: 30px; height: 30px; place-items: center; flex: 0 0 auto; overflow: hidden; border-radius: 50%; background: #d8b47d; color: #46351e; font-size: 12px; font-weight: 750; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-copy { display: grid; min-width: 0; }
.sidebar-user-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 650; }
.sidebar-user-copy small { overflow: hidden; color: var(--sidebar-muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.sidebar-backdrop { display: none; }
.app-main { width: calc(100% - 236px); min-height: 100vh; margin-left: 236px; }
.app-shell.is-sidebar-collapsed .sidebar { width: 68px; }
.app-shell.is-sidebar-collapsed .app-main { width: calc(100% - 68px); margin-left: 68px; }
.app-shell.is-sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0 10px; }
.app-shell.is-sidebar-collapsed .sidebar-collapse-toggle { position: absolute; top: 50%; right: 2px; display: inline-grid; width: 25px; height: 28px; margin: 0; border: 0; border-radius: 5px 0 0 5px; background: rgba(255,255,255,.035); transform: translateY(-50%); }
.app-shell.is-sidebar-collapsed .sidebar-collapse-toggle:hover { background: rgba(255,255,255,.1); }
.app-shell.is-sidebar-collapsed .sidebar-brand-copy,
.app-shell.is-sidebar-collapsed .nav-label,
.app-shell.is-sidebar-collapsed .nav-item span,
.app-shell.is-sidebar-collapsed .sidebar-user-copy,
.app-shell.is-sidebar-collapsed .sidebar-user > .icon { display: none; }
.app-shell.is-sidebar-collapsed .sidebar-collapse-toggle { margin-left: 0; }
.app-shell.is-sidebar-collapsed .main-nav { padding-right: 8px; padding-left: 8px; }
.app-shell.is-sidebar-collapsed .nav-group + .nav-group { margin-top: 16px; }
.app-shell.is-sidebar-collapsed .nav-item { justify-content: center; gap: 0; padding-right: 8px; padding-left: 8px; }
.app-shell.is-sidebar-collapsed .sidebar-footer { padding: 11px 8px; }
.app-shell.is-sidebar-collapsed .sidebar-user { justify-content: center; padding-right: 4px; padding-left: 4px; }
.quick-translate-button { position: fixed; z-index: 50; top: 50%; right: 0; display: flex; width: 46px; height: 112px; align-items: center; justify-content: center; gap: 5px; padding: 10px 8px; border: 1px solid var(--line-strong); border-right: 0; border-radius: 8px 0 0 8px; background: var(--surface); color: var(--ink); box-shadow: -4px 4px 14px rgba(18, 44, 36, .14); transform: translateY(-50%); transition: width .16s ease, background .16s ease, color .16s ease; writing-mode: vertical-rl; }
.quick-translate-button:hover { width: 50px; background: var(--brand); color: #fff; }
.quick-translate-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 28%, transparent); outline-offset: 3px; }
.quick-translate-button .icon { width: 18px; height: 18px; }
.quick-translate-button span { font-size: 12px; font-weight: 700; letter-spacing: 0; line-height: 1; }
.ai-assistant-button { position: fixed; z-index: 51; right: 20px; bottom: 22px; display: inline-flex; min-width: 58px; height: 58px; align-items: center; justify-content: center; gap: 5px; padding: 8px 11px; border: 0; border-radius: 50%; background: linear-gradient(145deg, #0d8064, #155f50); color: #fff; box-shadow: 0 10px 26px rgba(12, 86, 67, .28); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.ai-assistant-button:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(12, 86, 67, .35); }
.ai-assistant-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 30%, transparent); outline-offset: 4px; }
.ai-assistant-button .icon { width: 22px; height: 22px; }
.ai-assistant-button span { max-width: 0; overflow: hidden; font-size: 11px; font-weight: 700; white-space: nowrap; transition: max-width .18s ease; }
.ai-assistant-button:hover span { max-width: 48px; }
.ai-assistant-root { position: fixed; z-index: 75; inset: 0; pointer-events: none; }
.ai-assistant-root.is-open { pointer-events: auto; }
.ai-assistant-window { position: absolute; right: 20px; bottom: 92px; display: flex; width: min(900px, calc(100vw - 40px)); height: min(720px, calc(100vh - 125px)); flex-direction: column; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: 0 20px 60px rgba(10, 36, 28, .28); animation: modal-in .17s ease; }
.ai-assistant-header { display: flex; min-height: 64px; align-items: center; gap: 12px; padding: 0 17px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, var(--surface), var(--surface-muted)); }
.ai-assistant-header > div:first-child { margin-right: auto; }
.ai-assistant-header p { margin: 0 0 2px; color: var(--brand); font-size: 10px; font-weight: 700; }
.ai-assistant-header h2 { margin: 0; font-size: 17px; }
.ai-assistant-header-actions { display: flex; gap: 4px; }
.ai-assistant-body { display: grid; min-height: 0; flex: 1; grid-template-columns: 210px minmax(0, 1fr); }
.ai-conversation-list { min-width: 0; overflow-y: auto; border-right: 1px solid var(--line); background: var(--surface-muted); }
.ai-conversation-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 11px; border-bottom: 1px solid var(--line); }
.ai-conversation-toolbar strong { font-size: 12px; }
.ai-conversation-item { display: block; width: 100%; padding: 10px 11px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink-soft); text-align: left; cursor: pointer; }
.ai-conversation-item:hover, .ai-conversation-item.active { background: var(--brand-light); color: var(--brand-dark); }
.ai-conversation-item strong, .ai-conversation-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-conversation-item strong { font-size: 11px; }
.ai-conversation-item span { margin-top: 4px; color: var(--ink-faint); font-size: 10px; }
.ai-empty { padding: 14px 11px; color: var(--ink-faint); font-size: 11px; }
.ai-chat-panel { display: flex; min-width: 0; min-height: 0; flex-direction: column; }
.ai-message-list { min-height: 0; flex: 1; overflow-y: auto; padding: 18px; background: var(--surface); }
.ai-message { max-width: 86%; margin-bottom: 13px; }
.ai-message--user { margin-left: auto; }
.ai-message-label { margin-bottom: 4px; color: var(--ink-faint); font-size: 10px; font-weight: 700; }
.ai-message--user .ai-message-label { text-align: right; }
.ai-message-content { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-muted); color: var(--ink-soft); font-size: 12px; line-height: 1.75; white-space: normal; word-break: break-word; }
.ai-message--user .ai-message-content { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); background: var(--brand-light); color: var(--ink); }
.ai-citations { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 7px; }
.ai-citations > span { color: var(--ink-faint); font-size: 10px; }
.ai-citation { display: inline-flex; max-width: 220px; align-items: center; gap: 4px; padding: 4px 7px; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--brand-dark); font-size: 10px; cursor: pointer; }
.ai-citation span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-welcome { display: grid; height: 100%; place-content: center; justify-items: center; padding: 30px; color: var(--ink-soft); text-align: center; }
.ai-welcome-icon { display: grid; width: 45px; height: 45px; place-items: center; margin-bottom: 10px; border-radius: 14px; background: var(--brand-light); color: var(--brand); }
.ai-welcome-icon .icon { width: 24px; height: 24px; }
.ai-welcome strong { color: var(--ink); font-size: 15px; }
.ai-welcome p { max-width: 340px; margin: 7px 0 0; font-size: 11px; line-height: 1.7; }
.ai-reference-bar { display: grid; grid-template-columns: auto minmax(180px, 1fr); gap: 7px 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface-muted); }
.ai-reference-bar > div:first-child strong, .ai-reference-bar > div:first-child span { display: block; }
.ai-reference-bar > div:first-child strong { font-size: 11px; }
.ai-reference-bar > div:first-child span { margin-top: 2px; color: var(--ink-faint); font-size: 10px; }
.ai-reference-bar select { width: 100%; height: 30px; }
.ai-reference-tags { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 5px; }
.ai-reference-tags .tag { border: 0; cursor: pointer; }
.ai-chat-form { padding: 10px 14px 13px; border-top: 1px solid var(--line); background: var(--surface); }
.ai-chat-form textarea { display: block; width: 100%; min-height: 62px; resize: vertical; }
.ai-chat-form footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.ai-chat-form footer > span { min-width: 0; overflow: hidden; color: var(--ink-faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ai-error { color: var(--danger); font-style: normal; }
.topbar { position: sticky; z-index: 30; top: 0; display: flex; min-height: 72px; align-items: center; gap: 18px; padding: 10px clamp(18px, 3.2vw, 42px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--canvas) 92%, transparent); backdrop-filter: blur(12px); }
.topbar-title { min-width: 0; margin-right: auto; }
.topbar-title p { margin: 0 0 1px; color: var(--ink-faint); font-size: 10px; font-weight: 700; letter-spacing: 0; }
.topbar-title h1 { overflow: hidden; margin: 0; font-size: 20px; font-weight: 710; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.command-search { display: flex; width: min(260px, 23vw); min-width: 160px; height: 34px; align-items: center; gap: 7px; padding: 0 7px 0 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-faint); transition: border-color .16s ease, box-shadow .16s ease; }
.command-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,118,90,.12); }
.command-search .icon { width: 16px; height: 16px; }
.command-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; font-size: 12px; }
kbd { padding: 1px 4px; border: 1px solid var(--line); border-bottom-color: var(--line-strong); border-radius: 3px; background: var(--surface-muted); color: var(--ink-faint); font: 10px/1.35 var(--font); white-space: nowrap; }
.notification-dot { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border: 1px solid var(--canvas); border-radius: 50%; background: var(--accent); }
.mobile-menu { display: none; }
.page-content { max-width: 1600px; margin: 0 auto; padding: 28px clamp(18px, 3.2vw, 42px) 48px; outline: 0; }

/* Page infrastructure */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-heading { min-width: 0; }
.page-heading h2 { margin: 0; font-size: 22px; font-weight: 720; line-height: 1.25; }
.page-heading p { margin: 6px 0 0; color: var(--ink-soft); }
.page-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.eyebrow { margin: 0; color: var(--brand); font-size: 10px; font-weight: 750; letter-spacing: 0; text-transform: uppercase; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 13px; }
.section-heading h3 { margin: 0; font-size: 15px; font-weight: 710; }
.section-heading p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.content-surface { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.section-loader { display: grid; min-height: 200px; place-items: center; color: var(--ink-soft); }
.inline-loader { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; }
.inline-loader::before { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; content: ""; animation: spin .7s linear infinite; }
.empty-state { display: grid; min-height: 230px; place-items: center; padding: 28px; text-align: center; }
.empty-state > div { max-width: 310px; }
.empty-icon { display: grid; width: 42px; height: 42px; place-items: center; margin: 0 auto 13px; border-radius: 50%; background: var(--surface-hover); color: var(--brand); }
.empty-icon .icon { width: 21px; height: 21px; }
.empty-state h3 { margin: 0; font-size: 15px; font-weight: 690; }
.empty-state p { margin: 6px 0 16px; color: var(--ink-soft); font-size: 12px; }
.empty-state .button-stack { justify-content: center; }
.error-state { border-color: #ecc7c3; background: #fffafa; }
.error-state .empty-icon { background: var(--danger-light); color: var(--danger); }
.mark { padding: 0 1px; border-radius: 2px; background: #ffe5a8; color: inherit; }

/* Overview */
.overview-welcome { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 24px; }
.overview-welcome h2 { margin: 4px 0 0; font-size: 28px; font-weight: 720; line-height: 1.2; }
.overview-welcome p:not(.eyebrow) { margin: 8px 0 0; color: var(--ink-soft); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-card { position: relative; min-height: 128px; padding: 17px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.stat-card::after { position: absolute; right: 0; bottom: 0; width: 58px; height: 58px; border-radius: 58px 0 0; background: var(--stat-soft, var(--brand-light)); content: ""; opacity: .72; }
.stat-card--teal { --stat: var(--brand); --stat-soft: var(--brand-light); }
.stat-card--amber { --stat: var(--accent); --stat-soft: var(--accent-light); }
.stat-card--green { --stat: var(--success); --stat-soft: var(--success-light); }
.stat-card--rose { --stat: var(--danger); --stat-soft: var(--danger-light); }
.stat-card .stat-icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 5px; background: var(--stat-soft); color: var(--stat); }
.stat-card .stat-icon .icon { width: 16px; height: 16px; }
.stat-card p { position: relative; z-index: 1; margin: 13px 0 2px; color: var(--ink-soft); font-size: 12px; }
.stat-card strong { position: relative; z-index: 1; font-size: 26px; font-variant-numeric: tabular-nums; font-weight: 730; line-height: 1.15; }
.stat-card small { position: relative; z-index: 1; display: block; margin-top: 6px; color: var(--ink-faint); font-size: 11px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.56fr) minmax(280px, .8fr); gap: 16px; margin-top: 17px; }
.overview-panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-header { display: flex; min-height: 55px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.panel-header h3 { margin: 0; font-size: 14px; font-weight: 700; }
.panel-header a, .text-button { padding: 0; border: 0; background: transparent; color: var(--brand); font-size: 12px; font-weight: 650; text-decoration: none; }
.panel-header a:hover, .text-button:hover { color: var(--brand-dark); text-decoration: underline; }
.recent-list { margin: 0; padding: 0; list-style: none; }
.recent-item { display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s ease; }
.recent-item:last-child { border-bottom: 0; }
.recent-item:hover { background: var(--surface-hover); }
.file-badge { display: grid; width: 30px; height: 35px; place-items: center; border: 1px solid #d8e0dc; border-radius: 4px; background: var(--surface-muted); color: var(--brand); font-size: 9px; font-weight: 770; text-transform: uppercase; }
.recent-item-copy { min-width: 0; }
.recent-item-copy strong { display: block; overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.recent-item-copy span { display: block; overflow: hidden; margin-top: 2px; color: var(--ink-faint); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.recent-item time { color: var(--ink-faint); font-size: 11px; white-space: nowrap; }
.activity-list { margin: 0; padding: 5px 16px 9px; list-style: none; }
.activity-item { position: relative; display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 10px; padding: 11px 0; }
.activity-item:not(:last-child)::before { position: absolute; top: 23px; left: 3px; width: 1px; height: calc(100% - 4px); background: var(--line); content: ""; }
.activity-dot { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--brand); }
.activity-item:nth-child(2n) .activity-dot { background: var(--accent); }
.activity-item strong { display: block; overflow: hidden; font-size: 12px; font-weight: 640; text-overflow: ellipsis; white-space: nowrap; }
.activity-item span { display: block; margin-top: 2px; color: var(--ink-faint); font-size: 11px; }
.dashboard-empty { display: grid; min-height: 200px; place-items: center; padding: 20px; color: var(--ink-soft); text-align: center; font-size: 12px; }

/* Tables */
.table-shell { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.table-toolbar { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); }
.table-search-wrap { position: relative; z-index: 4; width: min(340px, 45vw); min-width: 150px; }
.table-search-wrap.is-options-open { z-index: 20; }
.table-search { display: flex; width: 100%; min-width: 0; height: 34px; align-items: center; gap: 7px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-faint); transition: border-color .16s ease, box-shadow .16s ease; }
.table-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,118,90,.11); }
.table-search .icon { width: 16px; height: 16px; }
.table-search input { width: auto; min-width: 0; flex: 1; padding: 0; border: 0; outline: 0; background: transparent; font-size: 12px; }
.table-search-options-toggle { display: inline-grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; margin-left: 1px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--ink-faint); cursor: pointer; }
.table-search-options-toggle:hover, .table-search-options-toggle[aria-expanded="true"] { background: var(--brand-light); color: var(--brand-dark); }
.table-search-options-toggle .icon { width: 15px; height: 15px; }
.table-search-options-panel { position: absolute; top: 40px; left: 0; width: 100%; max-height: min(520px, calc(100vh - 90px)); overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-lg); }
.table-search-options-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 7px 8px; border-bottom: 1px solid var(--line); }
.table-search-options-header > div { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.table-search-options-header strong { color: var(--ink); font-size: 12px; font-weight: 700; }
.table-search-options-header small { color: var(--ink-faint); font-size: 10px; }
.table-search-clear { flex: 0 0 auto; padding: 3px 0; border: 0; background: transparent; color: var(--brand); font-size: 10px; cursor: pointer; }
.table-search-clear:hover { color: var(--brand-dark); text-decoration: underline; }
.table-search-advanced-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 9px 1px 6px; }
.table-search-field { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.table-search-field > span:first-child { color: var(--ink-faint); font-size: 10px; font-weight: 700; }
.table-search-field input, .table-search-field select { width: 100%; min-width: 0; height: 31px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-size: 11px; }
.table-search-field input:focus, .table-search-field select:focus { border-color: var(--brand); outline: 0; box-shadow: 0 0 0 3px rgba(11,118,90,.10); }
.table-search-year-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 5px; }
.table-search-year-range i { color: var(--ink-faint); font-size: 10px; font-style: normal; }
.table-search-option--bottom { margin-top: 3px; border-top: 1px solid var(--line); border-radius: 0; }
.table-search-option { display: flex; min-height: 38px; align-items: center; gap: 9px; padding: 6px 7px; border-radius: 4px; color: var(--ink-soft); cursor: pointer; }
.table-search-option:hover { background: var(--surface-hover); color: var(--ink); }
.table-search-option > input { width: 14px; height: 14px; flex: 0 0 auto; margin: 0; accent-color: var(--brand); }
.table-search-option-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.table-search-option-copy strong { font-size: 12px; font-weight: 650; }
.table-search-option-copy small { color: var(--ink-faint); font-size: 11px; }
.table-shell:has(.table-search-options-panel) { overflow: visible; }
.table-shell[data-view-mode="reading"] > .table-scroll { display: none; }
.literature-reading-list { overflow: hidden; background: var(--surface-muted); }
.literature-reading-state { min-height: 250px; background: var(--surface); }
.literature-reading-list .literature-result { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 13px; padding: 15px 17px 13px; border-bottom: 1px solid var(--line); background: var(--surface); }
.literature-reading-list .literature-result:last-child { border-bottom: 0; }
.literature-result-gutter { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.literature-result-number { display: grid; width: 32px; height: 32px; place-items: center; background: var(--brand); color: #fff; font-size: 15px; font-weight: 750; line-height: 1; }
.literature-result-select { width: 15px !important; height: 15px !important; accent-color: var(--brand); cursor: pointer; }
.literature-result-content { min-width: 0; }
.literature-result-header { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 12px; }
.literature-result-title-block { min-width: 0; flex: 1 1 auto; }
.literature-result-title-line { min-width: 0; line-height: 1.35; }
.literature-result-title { display: inline; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 17px; font-weight: 720; line-height: 1.35; text-align: left; }
.literature-result-title:hover { color: var(--brand-dark); }
.literature-result-title mark, .literature-result-authors mark, .literature-result-keywords mark, .literature-result-abstract mark { border-radius: 2px; background: #fee8a7; color: inherit; }
.literature-result-header-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 3px; }
.literature-result-file { max-width: 150px; overflow: hidden; color: var(--ink-faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.literature-result-meta { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 8px; color: var(--brand-dark); font-size: 12px; line-height: 1.55; }
.literature-result-meta span { min-width: 0; }
.literature-result-meta-item { display: inline-flex; align-items: center; flex-wrap: wrap; }
.literature-result-meta-translation { flex-basis: 100%; color: var(--brand); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.literature-result-meta b, .literature-result-authors b { color: var(--ink-faint); font-weight: 650; }
.literature-result-authors { margin-top: 4px; overflow: hidden; color: var(--brand); font-size: 12px; line-height: 1.6; text-overflow: ellipsis; white-space: nowrap; }
.literature-result-keywords { display: flex; min-width: 0; gap: 4px; margin-top: 4px; color: var(--brand); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.literature-result-keywords b { flex: 0 0 auto; color: var(--ink-faint); font-weight: 650; }
.literature-result-keywords-copy { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.literature-result-keywords-translation { display: block; margin-top: 2px; color: var(--brand); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.literature-result-review-reference { margin-top: 9px; border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line)); background: color-mix(in srgb, var(--brand-light) 42%, var(--surface)); color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.literature-result-review-reference summary { display: flex; align-items: center; gap: 8px; padding: 7px 11px; color: var(--brand-dark); font-weight: 700; cursor: pointer; list-style-position: inside; }
.literature-result-review-reference summary small { color: var(--ink-faint); font-size: 10px; font-weight: 500; }
.literature-result-review-open { display: inline-flex; min-height: 25px; align-items: center; gap: 4px; margin-left: auto; padding: 0 7px; border-color: var(--line); color: var(--brand-dark); font-size: 10px; }
.literature-result-review-open .icon { width: 13px; height: 13px; }
.literature-result-review-reference-body { max-height: 360px; overflow: auto; padding: 0 12px 10px 28px; }
.literature-result-review-reference-body p { margin: 6px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.literature-result-review-reference-body mark { border-radius: 2px; background: #fee8a7; color: inherit; }
.literature-result-abstract { position: relative; display: flex; gap: 4px; max-height: 106px; overflow: hidden; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); background: var(--surface-muted); color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.literature-result-abstract-copy { min-width: 0; flex: 1; overflow-wrap: anywhere; word-break: break-word; }
.literature-result-abstract.has-translation-action .literature-result-abstract-copy { padding-right: 34px; }
.literature-result-abstract.is-collapsed::after { position: absolute; right: 0; bottom: 0; left: 0; height: 40px; background: linear-gradient(to bottom, color-mix(in srgb, var(--surface-muted) 0%, transparent), var(--surface-muted) 82%); content: ""; pointer-events: none; }
.literature-result-abstract.is-collapsed .literature-result-abstract-copy { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.literature-result-abstract.is-expanded { max-height: none; }
.literature-result-translate { position: absolute; z-index: 1; top: 6px; right: 7px; display: grid; width: 25px; height: 25px; place-items: center; padding: 0; border: 0; border-radius: 4px; background: color-mix(in srgb, var(--surface-muted) 82%, transparent); color: var(--brand); cursor: pointer; }
.literature-result-translate--inline { position: static; display: inline-grid; width: 20px; height: 20px; margin-left: 5px; vertical-align: middle; }
.literature-result-translate:hover { background: var(--brand-light); color: var(--brand-dark); }
.literature-result-translate:disabled { cursor: wait; opacity: .62; }
.literature-result-translate .icon { width: 15px; height: 15px; }
.literature-result-translate.is-loading .icon { animation: spin .8s linear infinite; }
.literature-result-expand { position: absolute; z-index: 1; right: 8px; bottom: 6px; padding: 2px 7px; border: 0; border-radius: 3px; background: color-mix(in srgb, var(--surface-muted) 76%, transparent); backdrop-filter: blur(5px); color: var(--brand); font-size: 11px; font-weight: 700; cursor: pointer; }
.literature-result-expand:hover { background: var(--brand-light); color: var(--brand-dark); }
.literature-result-abstract-label { flex: 0 0 auto; color: var(--ink-faint); font-weight: 650; }
.literature-result-placeholder { color: var(--ink-faint); }
.literature-result-translation { margin-top: 8px; padding: 9px 12px; border-left: 3px solid var(--brand); background: var(--brand-light); color: var(--brand-dark); font-size: 12px; line-height: 1.65; }
.literature-result-title-translation { display: block; max-width: 100%; margin-top: 4px; color: var(--brand); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.literature-result-translation span { font-weight: 700; }
.literature-result-translation p { display: inline; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.literature-result-footer { display: flex; min-width: 0; align-items: center; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.literature-result-footer .tag-list { min-width: 0; max-height: 24px; flex: 1 1 auto; }
.literature-result-footer .btn { min-height: 30px; }
.literature-result-stats { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; color: var(--ink-faint); font-size: 10px; white-space: nowrap; }
.literature-result-stats .icon { width: 13px; height: 13px; }
.literature-view-toggle { color: var(--brand-dark); }
.literature-view-toggle .icon { width: 15px; height: 15px; }
.table-search-mode { display: inline-flex; height: 30px; align-items: center; gap: 5px; padding: 0 7px; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--ink-faint); font-size: 11px; cursor: pointer; white-space: nowrap; }
.table-search-mode:hover { border-color: var(--line); background: var(--surface-muted); color: var(--ink-soft); }
.table-search-mode input { width: 14px; height: 14px; margin: 0; accent-color: var(--brand); }
.table-search-mode:has(input:checked) { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); background: var(--brand-light); color: var(--brand-dark); }
.table-folder-filter { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-faint); font-size: 11px; white-space: nowrap; }
.table-folder-trigger { display: inline-flex; min-width: 164px; max-width: 260px; height: 34px; align-items: center; gap: 7px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-size: 12px; text-align: left; cursor: pointer; }
.table-folder-trigger:hover, .table-folder-trigger[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,118,90,.11); }
.table-folder-trigger > .icon:first-child { width: 15px; flex: 0 0 auto; color: var(--brand); }
.table-folder-trigger > .icon:last-child { width: 13px; margin-left: auto; color: var(--ink-faint); }
.table-folder-trigger > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-match-summary { padding: 0 2px; border: 0; background: transparent; color: var(--brand); font-size: 12px; font-weight: 700; cursor: pointer; }
.online-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; color: var(--ink-faint); font-size: 11px; white-space: nowrap; }
.online-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.online-badge--online { color: #14845e; }
.online-badge--offline { color: var(--ink-faint); }
.table-match-summary:hover { color: var(--brand-dark); text-decoration: underline; }
.toolbar-separator { width: 1px; height: 20px; margin: 0 2px; background: var(--line); }
.toolbar-spacer { flex: 1; }
.table-toolbar-actions { display: flex; min-width: 0; align-items: center; flex: 0 0 auto; flex-wrap: wrap; gap: 7px; margin-left: auto; }
.table-scroll { width: 100%; overflow-x: auto; }
.data-table { min-width: 100%; border-collapse: collapse; table-layout: fixed; }
.data-table th { position: relative; height: 38px; padding: 0 11px; border-bottom: 1px solid var(--line); background: var(--surface-muted); color: var(--ink-soft); font-size: 11px; font-weight: 700; text-align: left; white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { padding-left: 15px; }
.data-table td { height: 54px; padding: 8px 11px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 12px; vertical-align: middle; }
.data-table th[data-table-column="actions"], .data-table .table-action-cell { position: sticky; right: 0; z-index: 3; background: var(--surface); box-shadow: -8px 0 12px -12px rgba(16, 46, 36, .48); }
.data-table th[data-table-column="actions"] { z-index: 5; background: var(--surface-muted); }
.data-table tbody tr:hover .table-action-cell { background: var(--surface-hover); }
.data-table tbody tr { transition: background .14s ease; }
.data-table tbody tr:hover { background: var(--surface-hover); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table th.table-selection-head, .data-table td:first-child:has(.table-row-checkbox) { width: 28px; min-width: 28px; max-width: 28px; box-sizing: border-box; padding-left: 2px !important; padding-right: 2px !important; text-align: center; }
input.table-header-checkbox[type="checkbox"], input.table-row-checkbox[type="checkbox"] { appearance: none; width: 10px; height: 10px; box-sizing: border-box; margin: 0; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--surface); cursor: pointer; vertical-align: middle; }
input.table-header-checkbox[type="checkbox"]:checked, input.table-row-checkbox[type="checkbox"]:checked { border-color: var(--brand); background-color: var(--brand); background-image: linear-gradient(45deg, transparent 45%, #fff 45%, #fff 58%, transparent 58%), linear-gradient(-45deg, transparent 55%, #fff 55%, #fff 68%, transparent 68%); background-position: 2px 4px, 5px 1px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.table-row-checkbox { cursor: pointer; }
.bulk-selection-count { color: var(--brand-dark); font-size: 11px; font-weight: 700; white-space: nowrap; }
.bulk-selection-hint { color: var(--ink-faint); font-size: 11px; white-space: nowrap; }
.sort-header { display: inline-flex; max-width: 100%; align-items: center; gap: 4px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; text-align: inherit; }
.sort-header:hover { color: var(--ink); }
.sort-header .icon { width: 13px; height: 13px; color: var(--ink-faint); }
.sort-header.is-active { color: var(--brand-dark); }
.column-filter { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; margin-left: 3px; padding: 0; border: 0; border-radius: 3px; background: transparent; color: var(--ink-faint); vertical-align: middle; }
.column-filter:hover, .column-filter.is-active { background: var(--brand-light); color: var(--brand-dark); }
.column-filter .icon { width: 12px; height: 12px; }
.column-resizer { position: absolute; top: 0; right: -4px; z-index: 2; width: 8px; height: 100%; cursor: col-resize; touch-action: none; }
.column-resizer::after { position: absolute; top: 9px; right: 3px; width: 1px; height: 20px; border-radius: 999px; background: transparent; content: ""; }
.column-resizer:hover::after, .column-resizer.is-dragging::after { background: var(--brand); }
.is-resizing-column, .is-resizing-column * { cursor: col-resize !important; user-select: none !important; }
.cell-primary { display: block; overflow: hidden; color: var(--ink); font-weight: 640; text-overflow: ellipsis; white-space: nowrap; }
.literature-category-select { -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 100%; min-width: 0; min-height: 30px; padding: 4px 21px 4px 5px; border: 1px solid transparent; border-radius: 4px; background-color: transparent; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3.25 4.75 2.75 2.5 2.75-2.5' fill='none' stroke='%23798580' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.25'/%3E%3C/svg%3E"); background-position: right 6px center; background-repeat: no-repeat; background-size: 12px 12px; color: var(--ink); font-size: 12px; font-weight: 540; cursor: pointer; }
.literature-category-select:hover { border-color: var(--line-strong); background: var(--surface); }
.literature-category-select:focus { border-color: var(--brand); outline: 0; box-shadow: 0 0 0 3px rgba(11,118,90,.12); }
.literature-category-select:disabled { cursor: wait; opacity: .62; }
.cell-secondary { display: block; overflow: hidden; margin-top: 2px; color: var(--ink-faint); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.cell-search-fragment { display: -webkit-box; overflow: hidden; color: var(--ink); line-height: 1.45; text-overflow: clip; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.cell-search-fragment mark { border-radius: 3px; background: #fee8a7; color: inherit; }
.cell-primary.is-truncated, .cell-secondary.is-truncated, .cell-muted.is-truncated, .tag.is-truncated, .filter-value-option span.is-truncated { outline: none; cursor: help; }
.cell-primary.has-full-value, .cell-secondary.has-full-value, .cell-muted.has-full-value, .tag.has-full-value, .filter-value-option span.has-full-value { cursor: pointer; }
.cell-primary.has-full-value:hover, .cell-secondary.has-full-value:hover, .cell-muted.has-full-value:hover, .tag.has-full-value:hover, .filter-value-option span.has-full-value:hover { color: var(--brand-dark); }
.full-value-popover { position: fixed; z-index: 360; max-width: min(720px, calc(100vw - 32px)); max-height: min(460px, calc(100vh - 32px)); overflow: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-lg); color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.full-value-popover.is-pinned { cursor: text; }
.full-value-translate { position: sticky; top: 0; float: right; display: inline-flex; align-items: center; gap: 4px; margin: -2px -2px 6px 8px; padding: 4px 7px; border: 1px solid color-mix(in srgb, var(--brand) 24%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--surface) 68%, transparent); backdrop-filter: blur(8px); color: var(--brand-dark); font-size: 11px; font-weight: 700; cursor: pointer; opacity: .72; }
.full-value-translate:hover { opacity: 1; background: var(--brand-light); }
.full-value-translate:disabled { cursor: wait; opacity: .62; }
.full-value-translate .icon { width: 13px; height: 13px; }
.full-value-translation { clear: both; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--brand-dark); font-size: 12px; font-weight: 650; line-height: 1.7; white-space: pre-wrap; }
.cell-link { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 650; text-align: left; }
.cell-link:hover { color: var(--brand); text-decoration: underline; }
.cell-muted { color: var(--ink-soft); }
.row-actions { display: flex; justify-content: flex-end; gap: 1px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; max-height: 39px; overflow: hidden; }
.tag { display: inline-flex; max-width: 112px; align-items: center; min-height: 19px; overflow: hidden; padding: 2px 6px; border-radius: 3px; background: var(--surface-hover); color: var(--ink-soft); font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.tag--teal { background: var(--brand-light); color: var(--brand-dark); }
.tag--amber { background: var(--accent-light); color: #93530c; }
.tag--rose { background: var(--danger-light); color: #9c3632; }
.tag--success { background: var(--success-light); color: #176445; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 20px; padding: 2px 7px; border-radius: 12px; background: var(--surface-hover); color: var(--ink-soft); font-size: 10px; font-weight: 680; white-space: nowrap; }
.status-badge::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status-badge--active, .status-badge--public, .status-badge--success, .status-badge--published { background: var(--success-light); color: #166143; }
.status-badge--pending, .status-badge--warning { background: var(--warning-light); color: #92580d; }
.status-badge--disabled, .status-badge--danger { background: var(--danger-light); color: #9e3732; }
.status-badge--private, .status-badge--draft, .status-badge--archived { background: var(--surface-hover); color: var(--ink-soft); }
.table-empty-row td { height: 238px; padding: 0; }
.table-empty-row .empty-state { position: sticky; left: 0; width: calc(100vw - 120px); min-height: 238px; box-sizing: border-box; }
.table-footer { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; }
.pagination { display: flex; align-items: center; gap: 3px; }
.pagination .control-input { width: auto; min-height: 30px; padding: 4px 7px; font-size: 11px; }
.page-indicator { min-width: 68px; color: var(--ink-soft); text-align: center; font-variant-numeric: tabular-nums; }
.column-menu, .filter-menu, .user-menu, .match-popover, .literature-folder-picker { position: fixed; z-index: 100; width: 220px; max-height: min(350px, calc(100vh - 24px)); overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); }
.user-menu .nav-item { color: var(--ink-soft); }
.user-menu .nav-item:hover { background: var(--surface-hover); color: var(--ink); }
.menu-title { display: block; padding: 7px 8px 5px; color: var(--ink-faint); font-size: 10px; font-weight: 750; letter-spacing: 0; text-transform: uppercase; }
.menu-group-title { display: block; margin-top: 5px; padding: 7px 8px 4px; border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 10px; font-weight: 700; }
.menu-title + .menu-group-title { margin-top: 0; border-top: 0; }
.menu-checkbox { display: flex; align-items: center; gap: 8px; min-height: 31px; padding: 4px 8px; border-radius: 4px; color: var(--ink-soft); font-size: 12px; cursor: pointer; }
.menu-checkbox:hover { background: var(--surface-hover); color: var(--ink); }
.filter-menu { width: 214px; padding: 10px; overflow: hidden; }
.filter-menu .field { gap: 4px; }
.filter-menu .field + .field { margin-top: 9px; }
.filter-menu .field > input, .filter-menu .field > select { min-height: 32px; font-size: 12px; }
.filter-menu-heading { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.filter-menu-heading strong { color: var(--ink); font-size: 13px; }
.filter-menu-heading small, .filter-select-all small { color: var(--ink-faint); font-size: 10px; font-weight: 500; }
.filter-menu-search { gap: 0 !important; }
.filter-select-all { display: flex; min-height: 34px; align-items: center; gap: 7px; padding: 4px 7px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 12px; font-weight: 650; cursor: pointer; }
.filter-select-all small { margin-left: auto; }
.filter-menu--values { display: flex; width: 260px; flex-direction: column; }
.filter-value-list { display: grid; min-height: 0; flex: 1; max-height: none; overflow: auto; gap: 4px; margin-top: 9px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted); }
.filter-value-option { display: grid; grid-template-columns: 16px minmax(0, 1fr); align-items: center; gap: 8px; padding: 6px 7px; border-radius: 7px; color: var(--ink-soft); font-size: 12px; cursor: pointer; }
.filter-value-option[hidden] { display: none !important; }
.filter-value-option:hover { background: var(--surface); color: var(--ink); }
.filter-value-option input { width: 14px; height: 14px; accent-color: var(--brand); }
.filter-value-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-value-empty { padding: 14px 8px; color: var(--ink-faint); font-size: 12px; text-align: center; }
.filter-menu-footer { display: flex; justify-content: flex-end; gap: 7px; margin-top: 11px; }
.literature-folder-picker { width: 320px; max-height: min(430px, calc(100vh - 24px)); overflow: hidden; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); }
.literature-folder-picker-current { display: flex; min-width: 0; align-items: center; gap: 7px; padding: 5px 7px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted); }
.literature-folder-picker-root { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; padding: 4px 6px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-soft); font-size: 11px; cursor: pointer; }
.literature-folder-picker-root:hover, .literature-folder-picker-root.is-selected { background: var(--brand-light); color: var(--brand-dark); }
.literature-folder-picker-root .icon { width: 14px; }
.literature-folder-picker-selection { min-width: 0; overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.literature-folder-picker-nav { display: flex; min-width: 0; align-items: center; gap: 5px; margin-top: 7px; }
.literature-folder-picker-path { display: flex; min-width: 0; align-items: center; gap: 2px; overflow: auto; color: var(--ink-faint); font-size: 11px; white-space: nowrap; }
.literature-folder-picker-path button { max-width: 135px; overflow: hidden; padding: 3px 4px; border: 0; border-radius: 3px; background: transparent; color: var(--ink-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.literature-folder-picker-path button:hover { background: var(--surface-hover); color: var(--ink); }
.literature-folder-picker-path .breadcrumb-separator { width: 12px; flex: 0 0 auto; }
.literature-folder-picker-list { max-height: 260px; overflow: auto; margin-top: 5px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted); }
.literature-folder-picker-row { display: flex; min-width: 0; align-items: center; gap: 2px; }
.literature-folder-picker-name { display: flex; min-width: 0; flex: 1; align-items: center; gap: 7px; min-height: 32px; padding: 5px 7px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-soft); font-size: 12px; text-align: left; cursor: pointer; }
.literature-folder-picker-name:hover, .literature-folder-picker-name.is-selected { background: var(--surface); color: var(--brand-dark); }
.literature-folder-picker-name .icon { width: 16px; flex: 0 0 auto; color: #cf8f28; fill: #f5d28b; }
.literature-folder-picker-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.literature-folder-picker-open { display: grid; width: 28px; height: 30px; place-items: center; border: 0; border-radius: 4px; background: transparent; color: var(--ink-faint); cursor: pointer; }
.literature-folder-picker-open:hover { background: var(--surface); color: var(--brand-dark); }
.literature-folder-picker-open .icon { width: 14px; }
.literature-folder-picker-empty, .literature-folder-picker-hint { padding: 10px 8px; color: var(--ink-faint); font-size: 11px; line-height: 1.5; }
.literature-folder-picker-hint { padding: 7px 4px 2px; }
.match-popover { width: 360px; max-height: 360px; overflow: auto; padding: 8px; }
.match-popover-title { padding: 4px 8px 8px; color: var(--ink-faint); font-size: 11px; font-weight: 750; }
.match-record { display: block; width: 100%; padding: 9px 10px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.match-record:hover { background: var(--surface-hover); }
.match-record strong { display: block; overflow: hidden; font-size: 12px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.match-record span { display: block; overflow: hidden; margin-top: 3px; color: var(--ink-faint); font-size: 11px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.match-record mark { border-radius: 3px; background: #fee8a7; color: inherit; }
.match-popover-empty, .match-popover-more { padding: 12px; color: var(--ink-faint); font-size: 12px; text-align: center; }

/* File manager */
.file-manager { min-width: 0; }
.file-manager-toolbar { display: flex; align-items: center; gap: 9px; min-height: 50px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.file-manager-search { display: flex; width: min(250px, 27vw); min-width: 150px; height: 32px; align-items: center; gap: 6px; padding: 0 3px 0 9px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-faint); }
.file-manager-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,118,90,.12); }
.file-manager-search > .icon { width: 16px; height: 16px; }
.file-manager-search input { min-width: 0; flex: 1; height: 29px; padding: 4px 0; border: 0; background: transparent; color: var(--ink); outline: 0; font-size: 12px; }
.file-manager-search .icon-btn { width: 25px; height: 25px; }
.file-action-menu { min-width: 170px; }
.file-action-menu .nav-item { gap: 9px; }
.breadcrumbs { display: flex; min-width: 0; align-items: center; gap: 2px; overflow: hidden; margin-right: auto; }
.breadcrumb-button { display: inline-flex; min-width: 0; align-items: center; gap: 3px; padding: 5px 4px; border: 0; border-radius: 3px; background: transparent; color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.breadcrumb-button > span { overflow: hidden; text-overflow: ellipsis; }
.breadcrumb-button:hover { background: var(--surface-hover); color: var(--ink); }
.breadcrumb-button.current { color: var(--ink); font-weight: 650; }
.breadcrumb-separator { width: 14px; color: var(--ink-faint); }
.view-switch { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-muted); }
.view-switch .icon-btn { width: 29px; height: 27px; border: 0; color: var(--ink-faint); }
.view-switch .icon-btn.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.folder-content { min-height: 330px; margin-top: 13px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(166px, 1fr)); gap: 9px; }
.folder-tile { position: relative; display: flex; min-width: 0; min-height: 145px; flex-direction: column; align-items: flex-start; padding: 14px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: inherit; text-align: left; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.folder-tile:hover { border-color: var(--line); background: var(--surface-hover); }
.folder-tile.is-selected { border-color: #a7d2c1; background: var(--surface-selected); }
.folder-tile .tile-menu { position: absolute; top: 8px; right: 8px; opacity: 0; }
.folder-tile:hover .tile-menu, .folder-tile:focus-within .tile-menu { opacity: 1; }
.file-tile .tile-menu { opacity: 1; }
.folder-graphic { display: grid; width: 46px; height: 39px; place-items: center; margin: 3px 0 14px; color: #d69a38; }
.folder-graphic .icon { width: 43px; height: 43px; fill: #f5d28b; stroke: #cf8f28; stroke-width: 1.25; }
.file-graphic { display: grid; width: 42px; height: 44px; place-items: center; margin: 2px 0 10px; border: 1px solid #d7e0db; border-radius: 4px; background: var(--surface-muted); color: var(--brand); font-size: 10px; font-weight: 760; text-transform: uppercase; }
.folder-tile strong { display: block; width: 100%; overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.folder-tile small { display: flex; align-items: center; gap: 4px; width: 100%; overflow: hidden; margin-top: 4px; color: var(--ink-faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.folder-tile small .icon { width: 11px; height: 11px; }
.folder-list { overflow: hidden; border-radius: 4px; }
.folder-list-row { display: grid; grid-template-columns: minmax(220px, 1.8fr) minmax(100px, .65fr) minmax(120px, .8fr) minmax(110px, .65fr) 46px; min-height: 47px; align-items: center; gap: 10px; padding: 0 8px; border-bottom: 1px solid var(--line); }
.folder-list-row:first-child { min-height: 34px; background: var(--surface-muted); color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.folder-list-row:not(:first-child) { cursor: pointer; }
.folder-list-row:not(:first-child):hover { background: var(--surface-hover); }
.folder-list-name { display: flex; min-width: 0; align-items: center; gap: 9px; }
.folder-list-name > .icon { width: 21px; height: 21px; color: #cf8f28; fill: #f5d28b; stroke-width: 1.25; }
.folder-list-name.file > .icon { color: var(--brand); fill: none; stroke-width: 1.7; }
.folder-list-name strong { overflow: hidden; font-size: 12px; font-weight: 640; text-overflow: ellipsis; white-space: nowrap; }
.folder-list-cell { overflow: hidden; color: var(--ink-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.folder-list-actions { display: flex; justify-content: flex-end; }
.folder-empty { min-height: 300px; }

/* Modals / drawer / popovers */
.modal-root, .drawer-root, .popover-root { position: fixed; z-index: 80; inset: 0; pointer-events: none; }
.modal-root.has-modal, .drawer-root.has-drawer, .popover-root.has-popover { pointer-events: auto; }
.modal-backdrop, .drawer-backdrop { position: absolute; inset: 0; background: rgba(11, 26, 22, .42); backdrop-filter: blur(2px); animation: fade-in .16s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal { position: relative; width: min(560px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-lg); animation: modal-in .17s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(9px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-wrap { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; }
.modal-header { display: flex; min-height: 55px; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.modal-header h2 { min-width: 0; margin: 0; font-size: 16px; font-weight: 710; }
.modal-header .icon-btn { margin-left: auto; }
.modal-body { padding: 17px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-muted); }
.quick-translation-root { position: fixed; z-index: 70; inset: 0; pointer-events: none; }
.quick-translation-root.is-open { pointer-events: none; }
.quick-translation-window { position: fixed; right: 66px; bottom: 28px; display: flex; width: min(760px, calc(100vw - 84px)); height: min(540px, calc(100vh - 56px)); flex-direction: column; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); box-shadow: 0 18px 48px rgba(11, 31, 25, .24); pointer-events: auto; animation: modal-in .17s ease; }
.quick-translation-drag-handle { cursor: move; user-select: none; touch-action: none; }
.quick-translation-window.is-dragging { box-shadow: 0 22px 54px rgba(11, 31, 25, .3); opacity: .97; }
.quick-translation-controls { display: grid; grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr); align-items: end; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface-muted); }
.quick-translation-controls .field { gap: 4px; }
.quick-translation-swap { margin-bottom: 3px; }
.quick-translation-editor { display: grid; min-height: 0; flex: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quick-translation-pane { display: flex; min-width: 0; min-height: 0; flex-direction: column; }
.quick-translation-pane + .quick-translation-pane { border-left: 1px solid var(--line); }
.quick-translation-pane header { display: flex; min-height: 43px; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--ink-faint); font-size: 11px; }
.quick-translation-pane header strong { color: var(--ink); font-size: 12px; }
.quick-translation-pane textarea, .quick-translation-result { min-height: 0; flex: 1; overflow-y: auto; padding: 15px; border: 0; border-radius: 0; background: var(--surface); color: var(--ink); font: 13px/1.75 var(--font); resize: none; white-space: pre-wrap; overflow-wrap: anywhere; }
.quick-translation-pane textarea:focus { outline: 0; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 34%, transparent); }
.quick-translation-result { color: var(--ink-soft); }
.quick-translation-window .modal-header, .quick-translation-window .modal-footer { flex: 0 0 auto; }
.confirm-copy { margin: 0; color: var(--ink-soft); }
.confirm-copy strong { color: var(--ink); }
.drawer { position: absolute; z-index: 1; top: 0; right: 0; display: flex; width: min(660px, 100vw); height: 100%; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-lg); animation: drawer-in .2s ease; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: .7; } to { transform: translateX(0); opacity: 1; } }
.drawer-header { display: flex; min-height: 65px; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.drawer-header-copy { min-width: 0; margin-right: auto; }
.drawer-header-copy p { margin: 0 0 2px; color: var(--ink-faint); font-size: 10px; font-weight: 700; letter-spacing: 0; }
.drawer-header-copy h2 { overflow: hidden; margin: 0; font-size: 16px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.drawer-content { overflow-y: auto; padding: 20px; }
.drawer-title { margin: 0 0 6px; font-size: 22px; font-weight: 720; line-height: 1.32; }
.drawer-subtitle { margin: 0; color: var(--ink-soft); }
.literature-detail-drawer { width: min(1420px, 100vw); }
.literature-detail-drawer .drawer-content { padding: 22px; background: var(--surface-muted); }
.literature-detail-drawer .drawer-content.detail-content-split { display: grid; min-height: 0; flex: 1; grid-template-columns: minmax(420px, .9fr) minmax(0, 1.1fr); gap: 16px; overflow: hidden; }
.detail-info-panel { min-width: 0; overflow-y: auto; padding-right: 2px; }
.detail-preview-panel { display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #e7ebe9; box-shadow: var(--shadow-sm); }
.detail-preview-panel .upload-preview-header { border-top: 0; }
.detail-preview-content { min-height: 0; flex: 1; }
.detail-preview-frame { width: 100%; min-height: 0; flex: 1; border: 0; background: #dfe4e1; }
.detail-preview-text { min-height: 0; flex: 1; overflow: auto; padding: 16px; }
.detail-preview-text pre { margin: 0; color: var(--ink); font: 12px/1.75 var(--font); white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-preview-docx { padding: 14px; background: #dfe4e1; }
.detail-preview-empty { display: grid; min-height: 280px; place-content: center; padding: 20px; color: var(--ink-faint); font-size: 12px; text-align: center; }
.detail-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 18px 0 23px; }
.detail-hero .detail-actions { flex: 0 0 auto; justify-content: flex-end; margin: 0; }
.detail-section { margin-top: 16px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.detail-section h3 { margin: 0 0 13px; font-size: 15px; font-weight: 740; }
.detail-info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.detail-info-item { min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted); }
.detail-info-item--wide { grid-column: 1 / -1; }
.detail-info-item dt { margin-bottom: 5px; color: var(--ink-faint); font-size: 10px; font-weight: 750; }
.detail-info-item dd { margin: 0; color: var(--ink); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.detail-inline-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 13px; }
.detail-inline-group h4, .detail-text-card h4 { margin: 0 0 9px; font-size: 12px; font-weight: 720; }
.detail-inline-group > div, .detail-text-card { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted); }
.detail-text-card { margin-top: 13px; }
.detail-text-card p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.8; white-space: pre-wrap; }
.detail-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.detail-meta > div { min-width: 0; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.detail-meta > div:nth-child(odd) { border-right: 1px solid var(--line); }
.detail-meta > div:nth-last-child(-n+2) { border-bottom: 0; }
.detail-meta dt { margin-bottom: 4px; color: var(--ink-faint); font-size: 10px; font-weight: 700; }
.detail-meta dd { overflow-wrap: anywhere; margin: 0; font-size: 12px; }
.detail-block { margin-top: 23px; }
.detail-block h3 { margin: 0 0 9px; font-size: 13px; font-weight: 700; }
.detail-block p { margin: 0; color: var(--ink-soft); line-height: 1.75; white-space: pre-wrap; }
.detail-fulltext { margin-top: 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted); }
.detail-fulltext summary { display: flex; min-height: 42px; align-items: center; padding: 0 13px; color: var(--ink); font-size: 12px; font-weight: 720; cursor: pointer; }
.detail-fulltext pre { max-height: 320px; overflow: auto; margin: 0; padding: 14px; border-top: 1px solid var(--line); color: var(--ink-soft); font: 12px/1.8 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.popover-root { z-index: 100; }

/* Upload wizard */
.upload-modal { width: min(810px, calc(100vw - 28px)); }
.upload-modal--review { display: flex; width: min(1480px, calc(100vw - 28px)); height: min(900px, calc(100vh - 28px)); max-height: calc(100vh - 28px); flex-direction: column; overflow: hidden; }
.upload-modal--review .modal-header, .upload-modal--review .wizard-steps { flex: 0 0 auto; }
.upload-review-form { min-height: 0; flex: 1; }
.upload-review-layout { display: grid; height: 100%; min-height: 0; grid-template-columns: minmax(420px, 1.08fr) minmax(500px, .92fr); }
.upload-preview-pane, .upload-review-editor { min-width: 0; min-height: 0; }
.upload-preview-pane { display: flex; flex-direction: column; background: #e7ebe9; }
.upload-preview-header { display: flex; min-height: 47px; align-items: center; padding: 8px 13px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-muted); }
.upload-preview-header div { min-width: 0; }
.upload-preview-header strong, .upload-preview-header span { display: block; }
.upload-preview-header strong { font-size: 12px; }
.upload-preview-header span { overflow: hidden; margin-top: 2px; color: var(--ink-faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.upload-preview-content { display: flex; min-height: 0; flex: 1; flex-direction: column; overflow: hidden; }
.upload-preview-toolbar { display: flex; min-height: 43px; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.upload-preview-toolbar-group { display: flex; align-items: center; gap: 4px; }
.upload-preview-toolbar .icon-btn { width: 30px; height: 30px; }
.upload-preview-toolbar .icon-btn:disabled { opacity: .35; pointer-events: none; }
.upload-preview-page, .upload-preview-zoom { min-width: 58px; color: var(--ink-soft); font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; }
.upload-preview-canvas-wrap { position: relative; min-height: 0; flex: 1; overflow: auto; padding: 16px; background: #dfe4e1; text-align: center; }
.upload-preview-page-surface { position: relative; margin: 0 auto; background: #fff; box-shadow: 0 2px 12px rgba(23, 39, 33, .2); }
.upload-preview-canvas-wrap canvas { display: block; max-width: none; margin: 0; background: #fff; opacity: 0; }
.upload-preview-canvas-wrap canvas.is-visible { opacity: 1; }
.upload-preview-text-layer { position: absolute; z-index: 2; inset: 0; overflow: hidden; line-height: 1; text-align: initial; transform-origin: 0 0; forced-color-adjust: none; }
.upload-preview-text-layer span, .upload-preview-text-layer br { position: absolute; color: transparent; white-space: pre; transform-origin: 0 0; cursor: text; }
.upload-preview-text-layer span::selection { background: rgba(38, 126, 229, .32); color: transparent; }
.upload-preview-text-layer .endOfContent { position: absolute; z-index: -1; inset: 100% 0 0; display: block; cursor: default; user-select: none; }
.file-preview-modal { display: flex; width: min(1180px, calc(100vw - 28px)); height: min(880px, calc(100vh - 28px)); max-height: calc(100vh - 28px); flex-direction: column; overflow: hidden; }
.file-preview-modal .modal-header { flex: 0 0 auto; justify-content: space-between; }
.file-preview-heading { min-width: 0; }
.file-preview-heading h2, .file-preview-heading span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview-heading span { margin-top: 2px; color: var(--ink-faint); font-size: 10px; }
.file-preview-header-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.file-preview-body { display: flex; min-height: 0; flex: 1; flex-direction: column; background: #dfe4e1; }
.literature-ai-analysis-modal { display: flex; width: min(920px, calc(100vw - 28px)); height: min(780px, calc(100vh - 28px)); max-height: calc(100vh - 28px); flex-direction: column; overflow: hidden; }
.literature-ai-analysis-heading { min-width: 0; }
.literature-ai-analysis-heading h2, .literature-ai-analysis-heading span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.literature-ai-analysis-heading span { margin-top: 2px; color: var(--ink-faint); font-size: 10px; }
.literature-ai-analysis-body { display: grid; min-height: 0; grid-template-columns: minmax(260px, .76fr) minmax(0, 1.24fr); gap: 18px; overflow: hidden; padding: 17px; }
.literature-ai-analysis-form { min-width: 0; }
.literature-ai-analysis-form textarea { min-height: 145px; resize: vertical; }
.literature-ai-analysis-form .field small { color: var(--ink-faint); font-size: 10px; line-height: 1.5; }
.literature-ai-analysis-form > footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.literature-ai-analysis-form > footer > span { min-width: 0; color: var(--ink-faint); font-size: 11px; }
.literature-ai-analysis-history { display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted); }
.literature-ai-analysis-history > header { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.literature-ai-analysis-history > header h3 { margin: 0; color: var(--ink); font-size: 13px; }
.literature-ai-analysis-history > header span { display: block; margin-top: 2px; color: var(--ink-faint); font-size: 10px; }
.literature-ai-analysis-count { color: var(--brand) !important; font-size: 11px !important; font-weight: 700; }
.literature-ai-analysis-list { min-height: 0; overflow: auto; padding: 10px; }
.literature-ai-analysis-record { padding: 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.literature-ai-analysis-record + .literature-ai-analysis-record { margin-top: 9px; }
.literature-ai-analysis-record > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.literature-ai-analysis-record > header strong { color: var(--brand-dark); font-size: 11px; }
.literature-ai-analysis-record > header time { color: var(--ink-faint); font-size: 10px; white-space: nowrap; }
.literature-ai-analysis-prompt { margin: 8px 0 10px; padding: 7px 8px; border-left: 2px solid var(--line-strong); background: var(--surface-muted); }
.literature-ai-analysis-prompt span { display: block; color: var(--ink-faint); font-size: 10px; font-weight: 700; }
.literature-ai-analysis-prompt p { margin: 3px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.literature-ai-analysis-result { color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.literature-ai-analysis-result p { margin: 0 0 7px; }
.literature-ai-analysis-result p:last-child { margin-bottom: 0; }
.literature-ai-analysis-result ul, .literature-ai-analysis-result ol { margin: 5px 0 8px; padding-left: 20px; }
.literature-ai-analysis-empty { display: grid; min-height: 170px; place-items: center; padding: 20px; color: var(--ink-faint); font-size: 12px; text-align: center; }
.file-preview-toolbar { display: flex; min-height: 44px; flex: 0 0 auto; align-items: center; justify-content: space-between; padding: 5px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.file-preview-toolbar [id$="Page"], .file-preview-toolbar [id$="Zoom"] { min-width: 64px; color: var(--ink-soft); font-size: 11px; text-align: center; }
.file-preview-stage { min-height: 0; flex: 1; overflow: auto; padding: 20px; }
.file-preview-page { position: relative; margin: 0 auto; background: #fff; box-shadow: 0 2px 14px rgba(23, 39, 33, .22); }
.file-preview-page canvas { display: block; }
.file-preview-loading { display: grid; height: 100%; place-content: center; justify-items: center; gap: 10px; color: var(--ink-soft); }
.file-preview-loading .icon { width: 28px; height: 28px; }
.file-preview-error { color: var(--danger); }
.file-preview-text { min-height: 0; flex: 1; overflow: auto; padding: 24px; background: var(--surface); }
.file-preview-text pre { max-width: 920px; margin: 0 auto; color: var(--ink); font: 13px/1.75 var(--font); white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.file-preview-text--docx { padding: 28px clamp(18px, 5vw, 70px); background: #dfe4e1; }
.docx-preview-document { box-sizing: border-box; width: min(850px, 100%); min-height: 100%; margin: 0 auto; padding: 56px 66px; background: #fff; color: #202624; box-shadow: 0 2px 14px rgba(23, 39, 33, .18); font-family: Georgia, 'Times New Roman', 'Noto Serif SC', serif; font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.docx-preview-document p { min-height: 1.75em; }
.docx-preview-document h1, .docx-preview-document h2, .docx-preview-document h3 { margin: 18px 0 12px; color: #18241f; font-family: var(--font); line-height: 1.35; }
.docx-preview-document h1 { font-size: 26px; }
.docx-preview-document h2 { font-size: 20px; }
.docx-preview-document h3 { font-size: 17px; }
.docx-preview-document span { white-space: pre-wrap; }
.docx-preview-document .docx-list-paragraph, .docx-editor-page .docx-list-paragraph { padding-left: 24px; text-indent: -24px; }
.docx-preview-document .docx-list-marker, .docx-editor-page .docx-list-marker { display: inline-block; width: 24px; margin-left: 0; color: #147b63; text-indent: 0; }
.docx-preview-document .docx-table { width: 100%; margin: 18px 0; border-collapse: collapse; font-family: var(--font); font-size: 12px; }
.docx-preview-document .docx-table td { padding: 7px 9px; border: 1px solid #b8c8c1; vertical-align: top; }
.docx-preview-document .docx-table p { min-height: 0; margin: 0 0 5px; }
.docx-preview-document .docx-page-break { display: block; height: 28px; margin: 28px -66px; border-top: 1px dashed #b8c8c1; background: #dfe4e1; }
.docx-preview-document .docx-image { display: block; max-width: 100%; margin: 12px auto; }
.docx-preview-actions { display: flex; justify-content: flex-end; max-width: 850px; margin: 0 auto 12px; }
.docx-editor-modal { display: flex; width: min(1180px, calc(100vw - 28px)); height: min(900px, calc(100vh - 28px)); max-height: calc(100vh - 28px); flex-direction: column; overflow: hidden; }
.docx-editor-toolbar { display: flex; flex: 0 0 auto; align-items: center; flex-wrap: wrap; gap: 5px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface-muted); }
.docx-editor-toolbar .icon-btn { width: 31px; height: 30px; border: 1px solid var(--line); border-radius: 5px; font-size: 12px; font-weight: 700; }
.docx-editor-toolbar .icon-btn:hover { border-color: var(--brand); background: var(--brand-weak); color: var(--brand); }
.docx-editor-toolbar--preview { flex: 0 0 auto; }
.docx-editor-toolbar--secondary { padding-top: 0; }
.docx-editor-font-size { height: 30px; margin-left: 6px; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); font-size: 12px; }
.docx-editor-format { height: 30px; margin-left: 6px; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); font-size: 12px; }
.docx-editor-font-family { height: 30px; margin-left: 3px; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); font-size: 12px; }
.docx-editor-color { display: flex; height: 30px; align-items: center; gap: 5px; margin-left: 3px; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-soft); font-size: 11px; }
.docx-editor-color input { width: 25px; height: 21px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.docx-editor-body { min-height: 0; flex: 1; overflow: auto; padding: 24px; background: #dfe4e1; }
.docx-editor-page { box-sizing: border-box; width: min(850px, 100%); min-height: 100%; margin: 0 auto; padding: 56px 66px; outline: 0; background: #fff; color: #202624; box-shadow: 0 2px 14px rgba(23, 39, 33, .18); font-family: Georgia, 'Times New Roman', 'Noto Serif SC', serif; font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.docx-editor-page:focus { box-shadow: 0 0 0 3px rgba(11,118,90,.22), 0 2px 14px rgba(23, 39, 33, .18); }
.docx-editor-page p { min-height: 1.75em; }
.docx-editor-page h1, .docx-editor-page h2, .docx-editor-page h3 { margin: 18px 0 12px; font-family: var(--font); line-height: 1.35; }
.docx-editor-page h1 { font-size: 26px; }
.docx-editor-page h2 { font-size: 20px; }
.docx-editor-page h3 { font-size: 17px; }
.docx-editor-page span { white-space: pre-wrap; }
.docx-editor-page .docx-table { width: 100%; margin: 18px 0; border-collapse: collapse; font-family: var(--font); font-size: 12px; }
.docx-editor-page .docx-table td { padding: 7px 9px; border: 1px solid #b8c8c1; vertical-align: top; }
.docx-editor-page .docx-table p { min-height: 0; margin: 0 0 5px; }
.docx-editor-hint { margin-right: auto; color: var(--ink-faint); font-size: 11px; }
.folder-document-modal { display: flex; width: min(1180px, calc(100vw - 28px)); height: min(900px, calc(100vh - 28px)); max-height: calc(100vh - 28px); flex-direction: column; overflow: hidden; }
.folder-document-header { flex: 0 0 auto; }
.folder-document-heading { min-width: 0; }
.folder-document-heading h2, .folder-document-heading span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-document-heading span { margin-top: 2px; color: var(--ink-faint); font-size: 10px; }
.folder-document-titlebar { flex: 0 0 auto; padding: 10px 14px 2px; background: var(--surface); }
.folder-document-titlebar .field { margin: 0; }
.folder-document-editor-body { padding: 24px; }
.folder-document-footer { flex: 0 0 auto; }
.folder-document-status { margin-right: auto; color: var(--ink-faint); font-size: 11px; }
.folder-document-status.is-dirty { color: #a86b16; }
.folder-document-status.is-saving { color: var(--brand); }
.folder-document-status.is-saved { color: var(--success, #19734e); }
.folder-document-status.is-error { color: var(--danger); }
.folder-document-status.is-locked { color: #8a6218; }
.folder-document-export-modal { width: min(720px, calc(100vw - 28px)); max-height: min(720px, calc(100vh - 28px)); }
.folder-document-export-body { display: flex; min-height: 0; flex-direction: column; gap: 12px; }
.folder-document-export-toolbar { display: flex; min-height: 34px; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 11px; }
.folder-document-export-all { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 650; cursor: pointer; user-select: none; }
.folder-document-export-all input, .folder-document-export-row input { width: 15px; height: 15px; flex: 0 0 auto; accent-color: var(--brand); }
.folder-document-export-count { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.folder-document-export-list { display: grid; max-height: min(54vh, 490px); overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted); }
.folder-document-export-row { display: flex; min-width: 0; align-items: flex-start; gap: 10px; padding: 12px 13px; border-bottom: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.folder-document-export-row:last-child { border-bottom: 0; }
.folder-document-export-row:hover { background: var(--surface-hover); }
.folder-document-export-copy { display: grid; min-width: 0; gap: 4px; }
.folder-document-export-copy strong { overflow: hidden; color: var(--ink); font-size: 12px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.folder-document-export-copy small { overflow: hidden; color: var(--ink-faint); font-size: 10px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.folder-document-export-hint { min-width: 0; margin-right: auto; overflow: hidden; color: var(--ink-faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.folder-properties-modal { width: min(720px, calc(100vw - 28px)); max-height: min(760px, calc(100vh - 28px)); }
.folder-properties-body { max-height: min(650px, calc(100vh - 150px)); overflow-y: auto; }
.folder-properties-summary { display: flex; min-width: 0; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.folder-properties-icon { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 8px; background: #fff3d9; color: #c8861c; }
.folder-properties-icon .icon { width: 25px; height: 25px; fill: #f5d28b; stroke: #c8861c; }
.folder-properties-summary > div { min-width: 0; }
.folder-properties-summary h3 { margin: 0; overflow: hidden; color: var(--ink); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.folder-properties-summary p { margin: 5px 0 0; overflow: hidden; color: var(--ink-faint); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.folder-properties-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 16px 0 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.folder-properties-row { display: grid; min-width: 0; grid-template-columns: minmax(70px, .7fr) minmax(0, 1.3fr); gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.folder-properties-row:nth-child(odd) { border-right: 1px solid var(--line); }
.folder-properties-row:nth-last-child(-n + 2) { border-bottom: 0; }
.folder-properties-row dt { overflow: hidden; color: var(--ink-faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.folder-properties-row dd { min-width: 0; margin: 0; overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.folder-properties-row dd code, .folder-properties-note code { overflow-wrap: anywhere; color: var(--ink-soft); font: 10px var(--font-mono, ui-monospace, monospace); }
.folder-properties-badge { display: inline-flex; width: fit-content; align-items: center; padding: 2px 6px; border-radius: 999px; font-size: 10px; font-weight: 650; }
.folder-properties-badge.is-public { background: var(--success-light); color: var(--success); }
.folder-properties-badge.is-private { background: var(--surface-muted); color: var(--ink-soft); }
.folder-properties-note { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; gap: 7px 10px; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink-faint); font-size: 10px; }
.folder-properties-note span:first-child { color: var(--ink-soft); font-weight: 650; }
.folder-properties-note strong { color: var(--ink); font-size: 11px; }
@media (max-width: 620px) {
  .folder-properties-list { grid-template-columns: minmax(0, 1fr); }
  .folder-properties-row, .folder-properties-row:nth-child(odd) { border-right: 0; border-bottom: 1px solid var(--line); }
  .folder-properties-row:nth-last-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .folder-properties-row:last-child { border-bottom: 0; }
  .folder-properties-summary p { white-space: normal; }
}
.modal-root:has(.folder-document-modal) .modal-wrap { padding: 0; }
.folder-document-modal { width: 100vw; height: 100vh; max-height: none; border: 0; border-radius: 0; box-shadow: none; background: #f7f9f8; }
.folder-document-header { min-height: 44px; padding: 0 12px; border-bottom-color: #e4e9e6; background: #fbfcfb; }
.folder-document-heading { display: flex; min-width: 0; flex: 1; flex-direction: column; justify-content: center; gap: 1px; }
.folder-document-heading span { margin: 0; font-size: 9px; line-height: 1.2; }
.folder-document-title { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 650 14px/1.2 var(--font); text-overflow: ellipsis; }
.folder-document-title:focus { color: var(--brand-dark); }
.folder-document-modal .docx-editor-toolbar { min-height: 29px; padding: 2px 10px; gap: 2px; border-bottom-color: #e7ebe9; background: #f7f9f8; }
.folder-document-modal .docx-editor-toolbar--secondary { padding-top: 2px; border-top: 0; }
.folder-document-modal .docx-editor-toolbar .icon-btn { width: 24px; height: 24px; padding: 0; border-color: transparent; border-radius: 3px; color: var(--ink-soft); font-size: 10px; }
.folder-document-modal .docx-editor-toolbar .icon-btn:hover { border-color: #c9ded6; background: #eaf4ef; color: var(--brand-dark); }
.folder-document-modal .docx-editor-font-size, .folder-document-modal .docx-editor-format, .folder-document-modal .docx-editor-font-family { height: 24px; margin-left: 3px; padding: 0 4px; border-color: #dce5e1; border-radius: 3px; font-size: 10px; }
.folder-document-modal .docx-editor-font-size { width: 50px; }
.folder-document-modal .docx-editor-format { width: 70px; }
.folder-document-modal .docx-editor-font-family { width: 112px; }
.folder-document-modal .docx-editor-color { height: 24px; gap: 3px; margin-left: 3px; padding: 0 4px; border-color: #dce5e1; border-radius: 3px; font-size: 9px; }
.folder-document-modal .docx-editor-color input { width: 17px; height: 17px; }
.folder-document-editor-body { padding: 12px; background: #e9eeec; }
.folder-document-editor-page { width: min(900px, 100%); min-height: 100%; padding: 48px 60px; border: 1px solid #d8e3df; box-shadow: 0 1px 8px rgba(29, 52, 44, .12); font-size: 13px; line-height: 1.8; }
.folder-document-editor-page:focus { box-shadow: 0 0 0 2px rgba(11, 118, 90, .16), 0 1px 8px rgba(29, 52, 44, .12); }
.folder-document-footer { min-height: 34px; padding: 3px 10px; gap: 3px; border-top-color: #e4e9e6; background: #fbfcfb; }
.folder-document-status { font-size: 10px; }
.folder-document-footer .icon-btn { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 3px; color: var(--ink-soft); }
.folder-document-footer .icon-btn:hover { background: #eaf4ef; color: var(--brand-dark); }
.folder-document-footer .folder-document-save-button:not(:disabled) { background: #eaf4ef; color: var(--brand-dark); }
.folder-document-footer .icon-btn .icon { width: 14px; height: 14px; }

/* Inline folder document workspace */
.file-manager-layout { min-width: 0; }
.file-manager-layout--document { display: grid; min-height: 0; grid-template-columns: minmax(0, 1fr) 8px minmax(292px, var(--folder-document-panel-width, 340px)); gap: 0; align-items: stretch; }
.file-manager-layout--document > .file-manager { min-width: 0; }
.literature-page-layout { min-width: 0; }
.literature-page-layout--document { display: grid; height: calc(100vh - 166px); min-width: 0; max-height: calc(100vh - 166px); grid-template-columns: minmax(0, 1fr) 8px minmax(292px, var(--folder-document-panel-width, 340px)); gap: 0; align-items: stretch; overflow: hidden; }
.literature-page-layout--document > #literatureTable { min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.literature-page-layout--document > #literatureTable > .table-shell { min-height: 100%; }
.literature-page-layout--document > .folder-document-panel { position: relative; height: 100%; min-height: 0; }
body.literature-inline-panel-open { overflow: hidden; }
.file-manager-layout--document .folder-content { min-height: calc(100vh - 230px); }
.file-manager-layout--document .folder-content--preview { box-sizing: border-box; height: calc(100vh - 230px); min-height: 0; padding: 0; overflow: hidden; }
.file-manager-layout--document .folder-content--preview > .folder-file-preview-panel { height: 100%; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
.file-manager--preview .file-manager-toolbar { display: none; }
.file-manager--preview .folder-content--preview { height: calc(100vh - 166px); margin-top: 0; }
.folder-document-resizer { position: relative; z-index: 2; min-height: 470px; cursor: col-resize; touch-action: none; user-select: none; }
.folder-document-resizer::before { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: transparent; content: ''; transition: width .12s ease, background .12s ease; transform: translateX(-50%); }
.folder-document-resizer:hover::before, .folder-document-resizer.is-dragging::before { width: 3px; background: var(--brand); }
body.is-resizing-folder-document { cursor: col-resize; user-select: none; }
body.is-resizing-folder-document iframe, body.is-resizing-folder-document canvas { pointer-events: none; }
.folder-document-trigger { flex: 0 0 auto; }
.folder-document-panel { display: flex; min-width: 0; height: calc(100vh - 166px); min-height: 470px; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.folder-document-panel-header { display: flex; min-height: 43px; flex: 0 0 auto; align-items: center; gap: 7px; padding: 0 8px 0 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.folder-document-panel-heading { display: flex; min-width: 0; flex: 1; flex-direction: column; justify-content: center; gap: 1px; }
.folder-document-panel-eyebrow { overflow: hidden; color: var(--ink-faint); font-size: 9px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.folder-document-panel .folder-document-title { font-size: 12px; line-height: 1.25; }
.folder-document-panel .docx-editor-toolbar { min-height: 27px; flex-wrap: nowrap; gap: 1px; overflow-x: auto; padding: 2px 6px; border-bottom-color: var(--line); background: var(--surface-muted); scrollbar-width: thin; }
.folder-document-panel .docx-editor-toolbar--secondary { border-top: 0; }
.folder-document-panel .docx-editor-toolbar .icon-btn { width: 22px; height: 22px; flex: 0 0 22px; border-color: transparent; border-radius: 3px; color: var(--ink-soft); font-size: 9px; }
.folder-document-panel .docx-editor-toolbar .icon-btn:hover { border-color: #c9ded6; background: #eaf4ef; color: var(--brand-dark); }
.folder-document-panel.is-locked .docx-editor-toolbar { opacity: .45; pointer-events: none; }
.folder-document-panel .docx-editor-font-size, .folder-document-panel .docx-editor-format, .folder-document-panel .docx-editor-font-family { height: 22px; flex: 0 0 auto; margin-left: 2px; padding: 0 3px; border-color: var(--line); border-radius: 3px; font-size: 9px; }
.folder-document-panel .docx-editor-font-size { width: 45px; }
.folder-document-panel .docx-editor-format { width: 62px; }
.folder-document-panel .docx-editor-font-family { width: 98px; }
.folder-document-panel .docx-editor-color { height: 22px; flex: 0 0 auto; gap: 2px; margin-left: 2px; padding: 0 3px; border-color: var(--line); border-radius: 3px; font-size: 8px; }
.folder-document-panel .docx-editor-color input { width: 15px; height: 15px; }
.folder-document-citation-tools { position: relative; z-index: 3; display: flex; min-height: 29px; align-items: center; padding: 2px 6px; border-bottom: 1px solid var(--line); background: var(--surface); }
.folder-document-citation-trigger { height: 24px; gap: 4px; padding: 0 7px; border-color: transparent; border-radius: 3px; font-size: 10px; }
.folder-document-citation-trigger .icon { width: 13px; height: 13px; }
.folder-document-citation-trigger[aria-expanded="true"] { border-color: #c9ded6; background: #eaf4ef; color: var(--brand-dark); }
.folder-document-image-tools { display: flex; min-height: 29px; align-items: center; padding: 2px 6px; border-bottom: 1px solid var(--line); background: var(--surface); }
.folder-document-image-trigger { height: 24px; gap: 4px; padding: 0 7px; border-color: transparent; border-radius: 3px; font-size: 10px; }
.folder-document-image-trigger .icon { width: 13px; height: 13px; }
.folder-document-insert-tools { position: relative; z-index: 3; display: flex; min-height: 29px; align-items: center; gap: 6px; padding: 2px 6px; border-bottom: 1px solid var(--line); background: var(--surface); }
.folder-document-insert-tools > .folder-document-image-tools, .folder-document-insert-tools > .folder-document-citation-tools { min-width: 0; flex: 1; min-height: 29px; padding: 0; border-bottom: 0; background: transparent; }
.folder-document-insert-tools > .folder-document-citation-tools { position: static; justify-content: flex-end; }
.folder-document-ai-hint { display: inline-flex; min-height: 23px; align-items: center; gap: 4px; margin-left: 3px; padding: 0 3px; color: var(--brand-dark); font-size: 9px; white-space: nowrap; }
.folder-document-ai-hint .icon { width: 12px; height: 12px; flex: 0 0 auto; }
.folder-document-citation-picker { position: absolute; z-index: 5; top: 100%; right: 6px; left: 6px; display: flex; max-height: 220px; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); box-shadow: 0 5px 16px rgba(29, 52, 44, .16); }
.folder-document-citation-picker[hidden] { display: none; }
.folder-document-citation-search { height: 27px; flex: 0 0 auto; margin: 5px; padding: 0 7px; border: 1px solid var(--line); border-radius: 3px; font-size: 10px; }
.folder-citation-options { min-height: 0; overflow-y: auto; padding: 0 4px 4px; }
.folder-citation-option { display: flex; width: 100%; min-height: 38px; align-items: flex-start; gap: 6px; padding: 5px; border: 0; border-radius: 3px; background: transparent; color: var(--ink); text-align: left; }
.folder-citation-option:hover { background: #eef6f2; }
.folder-citation-option .file-badge { width: 27px; height: 25px; flex: 0 0 27px; font-size: 7px; }
.folder-citation-option-copy { display: grid; min-width: 0; gap: 2px; }
.folder-citation-option-copy strong, .folder-citation-option-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-citation-option-copy strong { font-size: 10px; font-weight: 650; }
.folder-citation-option-copy small { color: var(--ink-faint); font-size: 9px; }
.folder-citation-empty { padding: 14px 8px; color: var(--ink-faint); font-size: 10px; text-align: center; }
.folder-document-panel .folder-document-editor-body { min-height: 0; flex: 1; padding: 8px; background: var(--canvas); }
.folder-document-panel .folder-document-editor-page { width: 100%; min-height: 100%; padding: 26px 18px; border: 1px solid #d8e3df; box-shadow: 0 1px 7px rgba(29, 52, 44, .12); font-size: 12px; line-height: 1.7; }
.folder-document-panel .folder-document-editor-page:focus { box-shadow: 0 0 0 2px rgba(11, 118, 90, .16), 0 1px 7px rgba(29, 52, 44, .12); }
.folder-document-panel .folder-document-editor-page.is-readonly { background: #fbfcfb; color: var(--ink-soft); cursor: default; }
.folder-document-lock-notice { display: flex; min-height: 30px; flex: 0 0 auto; align-items: center; gap: 5px; padding: 3px 6px; border-bottom: 1px solid #eadfca; background: #fffaf0; color: #7b5818; font-size: 9px; }
.folder-document-lock-notice > span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-document-lock-notice .icon { width: 12px; height: 12px; flex: 0 0 auto; }
.folder-document-lock-notice .btn { height: 22px; flex: 0 0 auto; padding: 0 6px; border-radius: 3px; font-size: 9px; }
.folder-document-panel .folder-document-editor-page h1 { font-size: 19px; }
.folder-document-panel .folder-document-editor-page h2 { font-size: 16px; }
.folder-document-panel .folder-document-editor-page h3 { font-size: 14px; }
.folder-document-panel .folder-document-editor-page .editor-image-block { margin: 10px 0; }
.folder-document-panel .folder-document-editor-page img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.folder-document-panel .folder-document-editor-page [data-citation-id] { padding: 0 1px; color: var(--brand-dark); font-weight: 700; white-space: nowrap; }
.folder-document-panel .folder-document-editor-page [data-citation-block-id] { margin: 0 0 14px; padding: 0; line-height: 1.65; }
.folder-document-panel .folder-document-editor-page [data-citation-block-id] [data-citation-id] { margin-right: 2px; }
.folder-document-panel .folder-document-editor-page [data-generated-references="true"] { margin-top: 24px; padding-top: 10px; border-top: 1px solid #d8e3df; }
.folder-document-panel .folder-document-editor-page [data-generated-references="true"] h2 { margin: 0 0 7px; font-size: 15px; }
.folder-document-panel .folder-document-editor-page [data-generated-references="true"] ol { margin: 0; padding-left: 20px; }
.folder-document-panel .folder-document-editor-page [data-generated-references="true"] li { margin: 0 0 5px; font-size: 10px; line-height: 1.55; }
.folder-document-panel .folder-document-editor-page [data-generated-references="true"] li br + br { display: block; content: ''; margin-top: 4px; }
.folder-document-panel .folder-document-editor-page [data-citation-reference-id] { white-space: normal; }
.folder-document-ai-status { display: inline-block; color: var(--brand-dark); font-weight: 700; white-space: nowrap; }
.folder-document-ai-status::before { display: inline-block; width: 6px; height: 6px; margin: 0 4px 1px 0; border-radius: 50%; background: currentColor; content: ''; animation: folder-document-ai-pulse 1s ease-in-out infinite; }
.folder-document-ai-status.is-error { color: var(--danger); }
.folder-document-ai-status.is-error::before { display: none; }
.folder-document-ai-result { white-space: pre-wrap; }
@keyframes folder-document-ai-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.citation-template-settings textarea { min-height: 220px; font-family: var(--font-mono); line-height: 1.65; resize: vertical; }
.citation-template-placeholders { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 10px; color: var(--ink-faint); font-size: 11px; }
.citation-template-placeholders strong { color: var(--ink); }
.folder-document-panel .folder-document-footer { min-height: 31px; flex: 0 0 auto; gap: 2px; padding: 2px 7px; border-top: 1px solid var(--line); background: var(--surface); }
.folder-document-panel .folder-document-status { min-width: 0; overflow: hidden; margin-right: auto; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.folder-document-panel .folder-document-footer .icon-btn { width: 23px; height: 23px; border: 0; border-radius: 3px; }
.folder-document-panel .folder-document-footer .icon-btn .icon { width: 13px; height: 13px; }
.folder-document-panel .folder-document-footer .folder-document-save-button:not(:disabled) { background: #eaf4ef; color: var(--brand-dark); }
.folder-document-panel--loading { min-height: 230px; }
.folder-document-panel-loading { display: grid; min-height: 170px; flex: 1; place-content: center; color: var(--ink-faint); font-size: 10px; }
.folder-file-preview-panel { display: flex; min-width: 0; height: calc(100vh - 166px); min-height: 470px; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.folder-file-preview-header { display: flex; min-height: 43px; flex: 0 0 auto; align-items: center; gap: 6px; padding: 0 7px 0 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.folder-file-preview-heading { display: grid; min-width: 0; flex: 1; gap: 1px; }
.folder-file-preview-heading strong, .folder-file-preview-heading span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-file-preview-heading strong { font-size: 11px; font-weight: 700; }
.folder-file-preview-heading span { color: var(--ink-faint); font-size: 9px; }
.folder-file-preview-actions { display: flex; flex: 0 0 auto; gap: 1px; }
.folder-file-preview-actions .icon-btn { width: 23px; height: 23px; border-radius: 3px; }
.folder-file-preview-actions .icon { width: 13px; height: 13px; }
.folder-file-preview-panel .file-preview-body { min-height: 0; flex: 1; }
.folder-file-preview-panel .file-preview-toolbar { min-height: 34px; padding: 3px 6px; }
.folder-file-preview-panel .file-preview-toolbar .icon-btn { width: 24px; height: 24px; }
.folder-file-preview-panel .file-preview-stage { padding: 10px; }
.folder-file-preview-pages { display: flex; min-width: max-content; flex-direction: column; align-items: center; gap: 12px; }
.folder-file-preview-page { flex: 0 0 auto; }
.folder-file-preview-page canvas { display: block; }
.folder-file-preview-panel .file-preview-text { padding: 12px 10px; }
.folder-file-preview-panel .file-preview-text pre { font-size: 11px; line-height: 1.7; }
.folder-file-preview-panel .file-preview-text--docx { padding: 10px 7px; }
.folder-file-preview-panel .docx-preview-actions { margin-bottom: 8px; }
.folder-file-preview-panel .docx-preview-document { padding: 28px 18px; font-size: 11px; line-height: 1.65; }
.folder-file-preview-panel .file-preview-loading { min-height: 180px; padding: 14px; font-size: 10px; }
.upload-preview-text--document { box-sizing: border-box; min-height: 0; flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 22px 24px 30px; background: #f7f9f8; -webkit-overflow-scrolling: touch; }
.upload-preview-pane .upload-preview-text--document { height: 0; }
.upload-preview-pane .upload-preview-text--document .docx-preview-document { min-height: max-content; }
.upload-preview-pane .upload-preview-text--document[contenteditable="true"] { outline: 0; cursor: text; }
.upload-preview-pane .upload-preview-text--document[contenteditable="true"]:focus { box-shadow: inset 0 0 0 2px rgba(11,118,90,.25); }
.docx-editing-note-copy { margin: 0; color: var(--ink-faint); font-size: 11px; line-height: 1.6; }
.upload-preview-document-note { display: flex; max-width: 920px; align-items: center; gap: 9px; margin: 0 auto 16px; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.upload-preview-document-note .file-badge { flex: 0 0 auto; }
.upload-preview-status { position: absolute; z-index: 1; inset: 0; display: grid; place-content: center; justify-items: center; gap: 9px; padding: 24px; background: #e7ebe9; color: var(--ink-soft); font-size: 11px; text-align: center; }
.upload-preview-status[hidden] { display: none; }
.upload-preview-status .boot-loader { width: 28px; height: 28px; }
.upload-preview-status strong { color: var(--ink); font-size: 13px; }
.upload-preview-status.is-error { color: var(--danger); }
.upload-preview-unavailable { display: grid; height: 100%; min-height: 340px; place-content: center; justify-items: center; gap: 8px; padding: 24px; color: var(--ink-soft); text-align: center; }
.upload-preview-unavailable strong { color: var(--ink); font-size: 13px; }
.upload-preview-unavailable > span:last-child { font-size: 11px; }
.upload-review-editor { display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface); }
.wizard-steps--review { height: 53px; flex: 0 0 auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.wizard-steps--review .wizard-steps { height: 100%; padding: 7px 12px; }
.wizard-steps--review .wizard-step { gap: 5px; font-size: 10px; }
.wizard-steps--review .wizard-step::after { margin: 0 6px; }
.upload-review-editor .modal-body { min-height: 0; flex: 1; overflow-y: auto; }
.upload-review-editor .modal-footer { flex: 0 0 auto; }
.wizard-steps { display: flex; align-items: center; padding: 15px 18px 0; }
.wizard-step { display: flex; min-width: 0; flex: 1; align-items: center; gap: 7px; color: var(--ink-faint); font-size: 11px; font-weight: 630; }
.wizard-step::after { width: 100%; height: 1px; margin: 0 10px; background: var(--line); content: ""; }
.wizard-step:last-child { flex: 0 1 auto; }
.wizard-step:last-child::after { display: none; }
.step-number { display: grid; width: 21px; height: 21px; place-items: center; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); font-size: 10px; }
.wizard-step.active, .wizard-step.done { color: var(--brand-dark); }
.wizard-step.active .step-number { border-color: var(--brand); background: var(--brand); color: #fff; }
.wizard-step.done .step-number { border-color: var(--brand); background: var(--brand-light); }
.wizard-step.done .step-number .icon { width: 12px; height: 12px; }
.upload-modal .modal-body { min-height: 340px; }
.drop-zone { display: grid; min-height: 260px; place-items: center; padding: 28px; border: 1.5px dashed #aac5ba; border-radius: var(--radius); background: var(--surface-muted); text-align: center; transition: background .16s ease, border-color .16s ease; }
.drop-zone.dragging { border-color: var(--brand); background: var(--brand-light); }
.drop-zone.is-disabled { border-color: var(--line); background: var(--surface-muted); color: var(--ink-faint); cursor: not-allowed; }
.drop-zone.is-disabled .drop-zone-icon { background: var(--surface); color: var(--ink-faint); }
.drop-zone-icon { display: grid; width: 48px; height: 48px; place-items: center; margin: 0 auto 13px; border-radius: 50%; background: var(--brand-light); color: var(--brand); }
.drop-zone-icon .icon { width: 23px; height: 23px; }
.drop-zone h3 { margin: 0; font-size: 15px; font-weight: 700; }
.drop-zone p { margin: 6px 0 15px; color: var(--ink-soft); font-size: 12px; }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-muted); }
.file-chip .file-badge { flex: 0 0 auto; }
.file-chip-copy { min-width: 0; margin-right: auto; }
.file-chip-copy strong, .file-chip-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip-copy strong { font-size: 12px; }
.file-chip-copy span { margin-top: 2px; color: var(--ink-faint); font-size: 11px; }
.recognition-state { display: grid; min-height: 230px; place-items: center; text-align: center; }
.recognition-state .boot-loader { width: 33px; height: 33px; margin-bottom: 12px; }
.recognition-state h3 { margin: 0; font-size: 15px; }
.recognition-state p { margin: 5px 0 0; color: var(--ink-soft); font-size: 12px; }
.recognized-note { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 16px; padding: 10px 11px; border: 1px solid #c7e2d6; border-radius: var(--radius-sm); background: var(--brand-light); color: var(--brand-dark); font-size: 12px; }
.recognized-note .icon { width: 16px; margin-top: 1px; }
.upload-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.upload-fields .field--wide { grid-column: 1 / -1; }
#literatureForm textarea[name="abstract"] { min-height: 220px; }
.duplicate-warning { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 15px; padding: 10px 11px; border: 1px solid #edd4a5; border-radius: var(--radius-sm); background: var(--warning-light); color: #79500e; font-size: 12px; }
.duplicate-warning .icon { flex: 0 0 auto; margin-top: 1px; }
.duplicate-warning strong { display: block; color: #714707; }
.duplicate-choice { display: flex; gap: 14px; margin-top: 9px; }
.upload-complete { display: grid; min-height: 250px; place-items: center; padding: 20px; text-align: center; }
.upload-complete .success-circle { display: grid; width: 51px; height: 51px; place-items: center; margin-bottom: 13px; border-radius: 50%; background: var(--success-light); color: var(--success); }
.upload-complete .success-circle .icon { width: 25px; height: 25px; }
.upload-complete h3 { margin: 0; font-size: 17px; }
.upload-complete p { margin: 6px 0 0; color: var(--ink-soft); font-size: 12px; }

@media (max-width: 1100px) {
  .upload-modal--review { display: block; height: auto; overflow-y: auto; }
  .upload-review-form { min-height: auto; }
  .upload-review-layout { height: auto; grid-template-columns: 1fr; }
  .upload-preview-content { height: min(52vh, 540px); flex: none; }
  .upload-review-editor { border-top: 1px solid var(--line); border-left: 0; }
  .upload-review-editor .modal-body { overflow: visible; }
}

/* Translation */
.translation-layout { display: grid; grid-template-columns: minmax(220px, .32fr) minmax(0, 1fr); gap: 16px; }
.translation-source-panel, .translation-workspace { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.translation-source-panel { display: flex; height: min(620px, calc(100vh - 180px)); max-height: calc(100vh - 180px); flex-direction: column; align-self: start; overflow: hidden; }
.translation-source-panel h3 { margin: 0; padding: 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.translation-source-list { display: none; }
.translation-source-item { display: flex; width: 100%; align-items: flex-start; gap: 9px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.translation-source-item:hover, .translation-source-item.active { background: var(--surface-hover); }
.translation-source-item.active { box-shadow: inset 3px 0 0 var(--brand); }
.translation-source-item .file-badge { width: 25px; height: 29px; flex: 0 0 auto; font-size: 8px; }
.translation-source-item strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 12px; font-weight: 650; line-height: 1.4; }
.translation-source-item span { display: block; margin-top: 3px; color: var(--ink-faint); font-size: 10px; }
.translation-workspace { display: flex; height: min(620px, calc(100vh - 140px)); flex-direction: column; overflow: hidden; }
.translation-controls { display: flex; align-items: center; gap: 10px; padding: 13px; border-bottom: 1px solid var(--line); }
.translation-controls .field { flex: 1; gap: 3px; }
.translation-controls .field > select { min-height: 33px; }
.translation-swap { width: 30px; height: 30px; margin-top: 16px; }
.translate-mode { display: flex; align-items: center; gap: 4px; padding: 10px 13px; border-bottom: 1px solid var(--line); }
.mode-button { min-height: 28px; padding: 4px 8px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.mode-button:hover { background: var(--surface-hover); }
.mode-button.active { background: var(--brand-light); color: var(--brand-dark); }
.translation-editor { display: grid; min-height: 0; flex: 1; grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr); overflow: hidden; }
.translation-pane { position: relative; display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; }
.translation-pane + .translation-pane { border-left: 1px solid var(--line); }
.translation-pane header { display: flex; min-height: 43px; align-items: center; justify-content: space-between; gap: 8px; padding: 0 13px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.translation-pane textarea, .translation-result { box-sizing: border-box; display: block; width: 100%; height: 100%; min-height: 0; flex: 1; padding: 14px; border: 0; outline: 0; background: transparent; color: var(--ink); font: 13px/1.8 var(--font); resize: none; overflow: auto; }
.translation-result { overflow-y: auto; color: var(--ink-soft); white-space: pre-wrap; }
.translation-reference-picker { position: absolute; z-index: 30; top: 82px; left: 14px; width: min(430px, calc(100% - 28px)); max-height: 285px; overflow: auto; padding: 7px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-lg); }
.translation-reference-picker header { min-height: 0; padding: 5px 7px 8px; border: 0; color: var(--ink-faint); font-size: 11px; }
.translation-reference-search { display: flex; align-items: center; gap: 6px; margin: 0 5px 6px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); color: var(--ink-faint); }
.translation-reference-search:focus-within { border-color: var(--brand); background: var(--surface); }
.translation-reference-search .icon { width: 13px; height: 13px; flex: 0 0 auto; }
.translation-reference-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 11px/1.5 var(--font); }
.translation-reference-search input::placeholder { color: var(--ink-faint); }
.translation-reference-picker button { display: block; width: 100%; padding: 8px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.translation-reference-picker button:hover { background: var(--brand-weak); }
.translation-reference-picker strong, .translation-reference-picker span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.translation-reference-picker strong { font-size: 12px; }
.translation-reference-picker span, .translation-reference-empty { color: var(--ink-faint); font-size: 11px; }
.translation-reference-empty { padding: 10px; }
.translation-reference-document { padding: 7px 7px 5px; border-top: 1px solid var(--line); }
.translation-reference-document:first-of-type { border-top: 0; }
.translation-reference-document > strong { padding: 0 2px 5px; }
.translation-reference-document button { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 6px 8px; }
.translation-reference-picker .translation-reference-field { color: var(--brand); font-weight: 700; }
.translation-reference-picker .translation-reference-preview { min-width: 0; color: var(--ink-soft); }
.translation-reference-picker small { color: var(--ink-faint); font-size: 10px; white-space: nowrap; }
.translation-arrow { position: relative; display: grid; place-items: center; color: var(--ink-faint); }
.translation-arrow::before { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--line); content: ''; }
.translation-arrow .icon { position: relative; z-index: 1; padding: 5px 0; background: var(--surface); }
.translation-arrow .icon { width: 19px; height: 19px; }
.translation-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 13px; border-top: 1px solid var(--line); background: var(--surface-muted); }
.translation-footer span { color: var(--ink-faint); font-size: 11px; }
.translation-footer > span { margin-right: auto; }
.translation-footer .btn + .btn { margin-left: 8px; }
.translation-history { display: flex; min-height: 0; flex-direction: column; border-top: 0; background: var(--surface); }
.translation-history--sidebar { flex: 1 1 auto; min-height: 0; height: 100%; }
.translation-history > header { display: block; min-height: 0; padding: 0; border-bottom: 1px solid var(--line); }
.translation-history > header > div:first-child { display: none; }
.translation-history > header > div:first-child span { display: block; color: var(--ink-faint); font-size: 10px; white-space: nowrap; }
.translation-history h3 { margin: 0; color: var(--ink); font-size: 12px; font-weight: 700; line-height: 1.3; }
.translation-history-tools { display: grid; grid-template-columns: minmax(0, 1fr) 70px 34px; align-items: center; gap: 8px; width: 100%; min-width: 0; padding: 13px; }
.translation-history-search { width: 100%; min-width: 0; }
.translation-history-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px; max-height: 260px; overflow: auto; padding: 10px 13px; }
.translation-history--sidebar .translation-history-search-wrap { padding: 0; }
.translation-history--sidebar .translation-history-search { width: 100%; min-width: 0; }
.translation-history--sidebar .translation-history-search .icon { display: none; }
.translation-history--sidebar .translation-history-search input { display: block; width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); font: 12px/1.4 var(--font); box-shadow: none; }
.translation-history--sidebar .translation-history-search input:focus { border-color: var(--brand); outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.translation-history--sidebar > header { min-height: 0; }
.translation-history--sidebar .translation-history-tools { display: grid; grid-template-columns: minmax(0, 1fr) 70px 34px; }
.translation-history--sidebar .translation-history-tools > * { min-width: 0; }
.translation-history--sidebar .translation-history-tools .translation-history-search { width: 100%; }
.translation-history--sidebar .translation-history-tools .btn { width: 70px; height: 34px; min-width: 0; justify-content: center; }
.translation-history--sidebar .translation-history-tools .icon-btn { width: 34px; height: 34px; }
.translation-history--sidebar .translation-history-list { grid-template-columns: 1fr; min-height: 0; max-height: none; flex: 1 1 auto; overflow-x: hidden; overflow-y: auto; }
.translation-history-group { display: grid; gap: 7px; }
.translation-history-group + .translation-history-group { margin-top: 4px; padding-top: 9px; border-top: 1px dashed var(--line); }
.translation-history-group > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.translation-history-group > header small { color: var(--ink-faint); font-size: 10px; font-weight: 500; }
.translation-history-group > div { display: grid; gap: 8px; }
.translation-history-more { width: 100%; padding: 7px 8px; border: 1px dashed var(--line-strong); border-radius: 6px; background: transparent; color: var(--brand); font-size: 11px; cursor: pointer; }
.translation-history-more:hover { background: var(--brand-weak); }
.translation-history-item { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); color: var(--ink); }
.translation-history-item:hover { border-color: var(--brand-soft); background: var(--surface-hover); }
.translation-history-item.active { border-color: var(--brand); border-left-width: 3px; background: var(--brand-weak); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 12%, transparent); }
.translation-history-item.active .translation-history-main strong { color: var(--brand); }
.translation-history-main { display: block; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.translation-history-main strong, .translation-history-main span, .translation-history-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.translation-history-item strong { font-size: 11px; font-weight: 700; }
.translation-history-item span { margin-top: 3px; color: var(--ink-faint); font-size: 10px; }
.translation-history-item small { margin-top: 5px; color: var(--ink-soft); font-size: 11px; }
.translation-history-actions { display: flex; align-items: center; gap: 3px; }
.translation-history-empty { padding: 16px 13px; color: var(--ink-faint); font-size: 12px; }
.translation-record-modal { width: min(760px, calc(100vw - 32px)); }
.translation-record-form textarea { min-height: 115px; resize: vertical; }
.translation-calibration-form textarea { min-height: 150px; }
.translation-calibration-form textarea[readonly] { min-height: 90px; color: var(--ink-faint); background: var(--surface-muted); }

/* Users */
.user-avatar-cell { display: flex; min-width: 0; align-items: center; gap: 8px; }
.user-avatar-cell .avatar { width: 27px; height: 27px; font-size: 10px; }
.user-avatar-cell > span { min-width: 0; }
.user-avatar-cell strong, .user-avatar-cell small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-avatar-cell strong { font-size: 12px; font-weight: 650; }
.user-avatar-cell small { color: var(--ink-faint); font-size: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid .field--wide { grid-column: 1 / -1; }
.announcement-recipient-picker { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.announcement-recipient-all, .announcement-recipient-option { display: flex; box-sizing: border-box; min-height: 48px; align-items: center; gap: 10px; padding: 9px 12px; color: var(--ink-soft); cursor: pointer; }
.announcement-recipient-all { border-bottom: 1px solid var(--line); background: var(--surface-muted); }
.announcement-recipient-all:hover, .announcement-recipient-option:hover { background: var(--surface-hover); }
.announcement-recipient-list { display: grid; max-height: 176px; overflow-y: auto; padding: 5px; scrollbar-width: thin; }
.announcement-recipient-option { min-height: 52px; border-radius: 6px; }
.announcement-recipient-option input, .announcement-recipient-all input { flex: 0 0 auto; margin: 0; }
.announcement-recipient-avatar { display: grid; width: 28px; height: 28px; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--brand-light); color: var(--brand-dark); font-size: 11px; font-weight: 750; }
.announcement-recipient-copy { display: grid; min-width: 0; gap: 2px; line-height: 1.25; }
.announcement-recipient-copy strong, .announcement-recipient-all strong { color: var(--ink); font-size: 12px; font-weight: 700; }
.announcement-recipient-copy small, .announcement-recipient-all small { color: var(--ink-faint); font-size: 11px; font-weight: 500; }
.announcement-recipient-all > span { display: grid; gap: 2px; line-height: 1.25; }
.announcement-recipient-option:has(input:checked) { background: var(--surface-selected); color: var(--brand-dark); }

/* Settings */
.settings-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-nav { position: sticky; top: 88px; padding: 7px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.settings-nav button { display: flex; width: 100%; align-items: center; gap: 8px; min-height: 35px; padding: 7px 8px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-soft); font-size: 12px; font-weight: 620; text-align: left; }
.settings-nav button:hover { background: var(--surface-hover); color: var(--ink); }
.settings-nav button.active { background: var(--brand-light); color: var(--brand-dark); font-weight: 680; }
.settings-nav .icon { width: 16px; height: 16px; }
.settings-panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.vocabulary-panel { max-width: 1180px; }
.settings-panel-header { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 14px; padding: 0 17px; border-bottom: 1px solid var(--line); }
.settings-panel-header h2 { margin: 0; font-size: 16px; font-weight: 710; }
.settings-panel-header p { margin: 3px 0 0; color: var(--ink-soft); font-size: 12px; }
.settings-body { padding: 18px; }
.settings-section + .settings-section { margin-top: 27px; padding-top: 23px; border-top: 1px solid var(--line); }
.settings-section h3 { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.settings-section > p { margin: 0 0 14px; color: var(--ink-soft); font-size: 12px; }
.logo-setting { display: flex; align-items: center; gap: 14px; padding-bottom: 17px; }
.logo-preview { display: grid; width: 52px; height: 52px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-muted); }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-preview .brand-mark { width: 38px; height: 38px; font-size: 22px; }
.setting-list { border-top: 1px solid var(--line); }
.setting-row { display: flex; min-height: 61px; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.setting-row-copy { min-width: 0; }
.setting-row-copy strong { display: block; font-size: 12px; font-weight: 660; }
.setting-row-copy span { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 11px; }
.switch { position: relative; display: inline-flex; width: 36px; height: 20px; flex: 0 0 auto; align-items: center; padding: 0; border: 0; border-radius: 20px; background: #aab8b1; transition: background .18s ease; }
.switch::after { width: 16px; height: 16px; margin-left: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); content: ""; transition: transform .18s ease; }
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.setting-input-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, .38fr); gap: 13px; align-items: end; }
.settings-save-bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 17px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); }
.cloud-api-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; }
.cloud-api-hint { color: var(--ink-faint); font-size: 11px; }
.ai-provider-list { display: grid; gap: 10px; }
.ai-provider-card { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted); }
.ai-provider-card > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ai-provider-card > header strong { font-size: 13px; font-weight: 700; }
.ai-provider-card > header span { color: var(--ink-faint); font-size: 11px; }
.ai-provider-card .setting-list { margin-top: 10px; }
.ai-provider-card .setting-row { min-height: 45px; }
.announcement-list { display: grid; gap: 10px; }
.announcement-card { padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius-sm); background: var(--surface-muted); }
.announcement-card--success { border-left-color: var(--success); }
.announcement-card--warning { border-left-color: var(--warning); }
.announcement-card--danger { border-left-color: var(--danger); }
.announcement-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.announcement-card time { color: var(--ink-faint); font-size: 11px; }
.announcement-card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 720; }
.announcement-card p { margin: 0; white-space: pre-wrap; color: var(--ink-soft); line-height: 1.7; }

/* Deployment */
.deployment-page-header { margin-bottom: 16px; }
.deployment-runtime-version { display: grid; min-width: 150px; gap: 3px; align-self: end; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); text-align: right; }
.deployment-runtime-version span { color: var(--ink-faint); font-size: 10px; font-weight: 650; }
.deployment-runtime-version strong { color: var(--brand); font: 700 16px/1.2 var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); }
.deployment-runtime-version small { overflow: hidden; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.deployment-panel { min-width: 0; margin-top: 14px; overflow: hidden; }
.deployment-panel .panel-header { min-height: 62px; }
.deployment-panel .panel-header > div { min-width: 0; }
.deployment-panel .panel-header p { margin: 3px 0 0; color: var(--ink-soft); font-size: 11px; }
.deployment-flow { margin: 0; overflow: auto; padding: 15px 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #17211e; color: #dce9e4; font: 12px/1.7 var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); }
.deployment-code { max-height: 440px; margin: 0; overflow: auto; padding: 17px; background: #17211e; color: #dce9e4; font: 12px/1.7 var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); tab-size: 2; }
.deployment-code code { font: inherit; }
.deployment-command-list { display: grid; gap: 12px; padding: 14px; }
.deployment-chain-list { padding-top: 0; }
.deployment-variable-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 14px; border-bottom: 1px solid var(--line); }
.deployment-variable-grid .field { min-width: 0; gap: 5px; }
.deployment-variable-grid .field--wide { grid-column: span 2; }
.deployment-variable-grid input { width: 100%; min-width: 0; }
.deployment-command { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-muted); }
.deployment-command-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 10px 14px; }
.deployment-command-header h4 { margin: 0; font-size: 13px; font-weight: 720; }
.deployment-command-header p { margin: 4px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.deployment-command .deployment-code { max-height: 320px; border-top: 1px solid var(--line); }
.deployment-recommendation { padding: 14px; border-top: 1px solid var(--line); background: var(--surface-muted); }
.deployment-recommendation strong { font-size: 12px; }
.deployment-recommendation p { margin: 4px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.search-term-toolbar { display: grid; grid-template-columns: auto minmax(220px, 360px) auto; align-items: center; gap: 10px; margin: -2px 0 10px; color: var(--ink-faint); font-size: 12px; }
.search-term-search { width: 100%; height: 32px; }
.search-term-list { display: grid; gap: 8px; }
.search-term-row { display: grid; grid-template-columns: minmax(130px, 220px) minmax(280px, 1fr) 32px; gap: 9px; align-items: end; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted); }
.search-term-row .field { gap: 4px; font-size: 11px; }
.search-term-row .field > input, .search-term-row .field > textarea { min-height: 34px; padding: 6px 9px; font-size: 12px; }
.search-term-row textarea { height: 34px; min-height: 34px; resize: vertical; }
.search-term-delete { align-self: end; width: 32px; height: 32px; margin-bottom: 1px; }
.vocabulary-panel .search-term-toolbar { grid-template-columns: auto 1fr; margin: 0 0 12px; }
.vocabulary-panel .search-term-toolbar > span { justify-self: start; }
.vocabulary-panel .category-term-row { display: flex; align-items: center; gap: 16px; min-height: 58px; padding: 10px 14px; }
.vocabulary-panel .category-term-row .field { width: min(420px, 100%); margin: 0; }
.vocabulary-panel .category-term-row .search-term-delete { align-self: center; width: 30px; height: 30px; margin: 0 0 0 auto; color: var(--ink-soft); }
.vocabulary-panel .category-term-row .search-term-delete:hover { color: var(--danger); background: var(--danger-light); }
.search-term-empty { min-height: 190px; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--surface-muted); }
.reserved-management { min-height: 360px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.reserved-management h2 { margin: 0; font-size: 18px; font-weight: 720; }
.reserved-management .muted { margin-top: -8px; color: var(--ink-faint); }

/* Toasts */
.toast-root { position: fixed; z-index: 300; top: 16px; right: 16px; display: grid; width: min(360px, calc(100vw - 32px)); gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-md); animation: toast-in .18s ease; pointer-events: auto; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-7px); } to { opacity: 1; transform: translateY(0); } }
.toast-icon { display: grid; width: 24px; height: 24px; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--brand-light); color: var(--brand); }
.toast-icon .icon { width: 14px; height: 14px; }
.toast--error .toast-icon { background: var(--danger-light); color: var(--danger); }
.toast--warning .toast-icon { background: var(--warning-light); color: var(--warning); }
.toast-copy { min-width: 0; padding-top: 1px; }
.toast-copy strong { display: block; font-size: 12px; font-weight: 700; }
.toast-copy span { display: block; margin-top: 1px; color: var(--ink-soft); font-size: 11px; }
.toast .icon-btn { width: 25px; height: 25px; margin-left: auto; }

.profile-page { max-width: 900px; margin: 0 auto; }
.profile-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, var(--surface), var(--surface-muted)); box-shadow: var(--shadow-sm); }
.profile-hero h2 { margin: 2px 0 0; font-size: 22px; }
.profile-hint { margin: 5px 0 0; color: var(--ink-faint); font-size: 12px; }
.profile-avatar-wrap { position: relative; flex: 0 0 auto; }
.profile-avatar { display: grid; width: 82px; height: 82px; place-items: center; overflow: hidden; border: 3px solid var(--surface); border-radius: 50%; background: var(--brand-light); color: var(--brand); font-size: 28px; font-weight: 750; box-shadow: 0 3px 12px rgba(18, 44, 36, .14); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-edit { position: absolute; right: -3px; bottom: -3px; width: 30px; height: 30px; border: 2px solid var(--surface); border-radius: 50%; background: var(--brand); color: #fff; }
.profile-avatar-edit .icon { width: 14px; height: 14px; }
.profile-form { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.profile-section { padding: 20px; border-bottom: 1px solid var(--line); }
.profile-section h3 { margin: 0 0 14px; font-size: 15px; }
.profile-actions { display: flex; justify-content: flex-end; padding: 14px 20px; }
@media (max-width: 620px) { .profile-hero { padding: 16px; } .profile-avatar { width: 68px; height: 68px; font-size: 23px; } .profile-section { padding: 16px; } }

/* Dark theme */
html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #15201d;
  --surface: #1b2924;
  --surface-muted: #202f29;
  --surface-hover: #293a33;
  --surface-selected: #183e32;
  --ink: #e7eeea;
  --ink-soft: #b8c7c0;
  --ink-faint: #859993;
  --line: #31443c;
  --line-strong: #43574f;
  --brand: #36a980;
  --brand-dark: #75cdb0;
  --brand-light: #1d493b;
  --accent: #e3a454;
  --accent-light: #44351f;
  --danger: #e4716b;
  --danger-light: #482827;
  --warning: #e9af59;
  --warning-light: #4a3920;
  --success: #52c793;
  --success-light: #1b4232;
  --sidebar: #112721;
  --sidebar-soft: #1d493d;
  --sidebar-ink: #e4eee9;
  --sidebar-muted: #9fb7ae;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.16);
  --shadow-md: 0 10px 30px rgba(0,0,0,.29);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.38);
}
html[data-theme="dark"] .topbar { background: color-mix(in srgb, var(--canvas) 87%, transparent); }
html[data-theme="dark"] .mark { background: #746029; }
html[data-theme="dark"] .folder-graphic .icon { fill: #79602d; stroke: #d5a149; }
html[data-theme="dark"] .folder-list-name > .icon { fill: #79602d; stroke: #d5a149; }
html[data-theme="dark"] .file-badge { border-color: #40584e; }
html[data-theme="dark"] .error-state { background: #2f1d1c; }
html[data-theme="dark"] .settings-save-bar { background: color-mix(in srgb, var(--surface) 90%, transparent); }

/* Responsive */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: minmax(0, 1.25fr) minmax(255px, .75fr); }
  .translation-layout { grid-template-columns: 235px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-close, .mobile-menu { display: inline-grid; }
  .sidebar-collapse-toggle { display: none; }
  .app-shell.is-sidebar-collapsed .sidebar { width: 236px; }
  .app-shell.is-sidebar-collapsed .app-main { width: 100%; margin-left: 0; }
  .app-shell.is-sidebar-collapsed .sidebar-brand { justify-content: initial; padding: 0 17px; }
  .app-shell.is-sidebar-collapsed .sidebar-brand-copy { display: grid; }
  .app-shell.is-sidebar-collapsed .nav-label { display: block; }
  .app-shell.is-sidebar-collapsed .nav-item span { display: inline; }
  .app-shell.is-sidebar-collapsed .sidebar-user-copy { display: grid; }
  .app-shell.is-sidebar-collapsed .sidebar-user > .icon { display: block; }
  .app-shell.is-sidebar-collapsed .main-nav { padding: 17px 11px; }
  .app-shell.is-sidebar-collapsed .nav-group + .nav-group { margin-top: 24px; }
  .app-shell.is-sidebar-collapsed .nav-item { justify-content: initial; gap: 11px; padding: 8px 10px; }
  .app-shell.is-sidebar-collapsed .sidebar-footer { padding: 11px; }
  .app-shell.is-sidebar-collapsed .sidebar-user { justify-content: initial; padding: 7px; }
  .sidebar-backdrop { position: fixed; z-index: 35; inset: 0; background: rgba(11,26,22,.4); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .sidebar-backdrop.is-visible { display: block; opacity: 1; pointer-events: auto; }
  .app-main { width: 100%; margin-left: 0; }
  .topbar { padding-right: 20px; padding-left: 16px; }
  .page-content { padding-right: 20px; padding-left: 20px; }
  .translation-layout { grid-template-columns: 1fr; }
  .translation-source-list { max-height: 210px; }
  .translation-source-panel { display: none; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; overflow-x: auto; padding: 4px; }
  .settings-nav button { width: auto; min-width: max-content; }
  .deployment-variable-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 670px) {
  body { font-size: 13px; }
  .login-view { display: block; }
  .login-brand-panel { min-height: auto; padding: 28px 24px; }
  .login-brand-panel blockquote { display: none; }
  .login-form-panel { min-height: calc(100vh - 104px); padding: 30px 24px; }
  .topbar { min-height: 62px; gap: 8px; }
  .topbar-title p { display: none; }
  .topbar-title h1 { font-size: 17px; }
  .command-search { display: none; }
  .topbar-actions > .icon-btn { display: none; }
  .topbar-actions .btn span { display: none; }
  .topbar-actions .btn { width: 34px; min-height: 34px; padding: 0; }
  .page-content { padding: 19px 14px 36px; }
  .page-header, .overview-welcome { align-items: flex-start; flex-direction: column; gap: 13px; margin-bottom: 17px; }
  .page-actions { justify-content: flex-start; }
  .stat-grid { gap: 9px; }
  .stat-card { min-height: 109px; padding: 13px; }
  .stat-card p { margin-top: 9px; }
  .stat-card strong { font-size: 22px; }
  .overview-grid { grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
  .deployment-variable-grid { grid-template-columns: 1fr; }
  .deployment-variable-grid .field--wide { grid-column: span 1; }
  .deployment-runtime-version { width: 100%; box-sizing: border-box; text-align: left; }
  .table-toolbar { align-items: center; flex-wrap: wrap; gap: 7px; }
  .table-search-wrap { width: 100%; }
  .table-search { width: 100%; }
  .table-search-advanced-grid { grid-template-columns: minmax(0, 1fr); }
  .table-folder-filter { flex: 1 1 180px; min-width: 0; }
  .table-folder-trigger { min-width: 0; max-width: none; flex: 1; }
  .toolbar-spacer { display: none; }
  .literature-ai-analysis-modal { width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .literature-ai-analysis-body { grid-template-columns: 1fr; overflow-y: auto; }
  .literature-ai-analysis-history { min-height: 300px; }
  .literature-ai-analysis-form > footer { align-items: flex-start; flex-direction: column; }
  .literature-reading-list .literature-result { grid-template-columns: 32px minmax(0, 1fr); gap: 9px; padding: 13px 11px; }
  .literature-result-number { width: 28px; height: 28px; font-size: 13px; }
  .literature-result-header { display: block; }
  .literature-result-title { display: inline; font-size: 15px; }
  .literature-result-header-actions { justify-content: flex-start; margin-top: 5px; }
  .literature-result-meta { gap: 3px 12px; font-size: 11px; }
  .literature-result-authors, .literature-result-keywords, .literature-result-abstract { font-size: 11px; }
  .literature-result-footer { align-items: flex-start; flex-wrap: wrap; }
  .literature-result-footer .tag-list { order: 1; width: 100%; flex-basis: 100%; }
  .literature-result-stats { order: 2; margin-left: auto; }
  .table-footer { align-items: flex-start; flex-direction: column; }
  .folder-content { padding: 8px; }
  .file-manager-toolbar { align-items: center; flex-wrap: wrap; padding: 7px; }
  .file-manager-search { order: 2; width: min(260px, calc(100% - 42px)); margin-left: auto; }
  .breadcrumbs { order: 3; width: 100%; }
  .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .folder-tile { min-height: 129px; padding: 10px; }
  .folder-tile .tile-menu { opacity: 1; }
  .folder-graphic { margin-bottom: 9px; transform: scale(.85); transform-origin: left top; }
  .folder-list-row { grid-template-columns: minmax(175px, 1fr) 40px; gap: 7px; }
  .folder-list-row > :not(.folder-list-name):not(.folder-list-actions) { display: none; }
  .folder-list-row:first-child > :not(.folder-list-name):not(.folder-list-actions) { display: none; }
  .ai-assistant-button { right: 12px; bottom: 16px; width: 52px; min-width: 52px; height: 52px; padding: 7px; }
  .ai-assistant-window { right: 8px; bottom: 78px; width: calc(100vw - 16px); height: calc(100vh - 96px); }
  .ai-assistant-body { grid-template-columns: 1fr; }
  .ai-conversation-list { display: flex; max-height: 108px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); }
  .ai-conversation-toolbar { min-width: 106px; flex-direction: column; align-items: flex-start; justify-content: center; }
  .ai-conversation-item { width: 150px; flex: 0 0 150px; border-right: 1px solid var(--line); border-bottom: 0; }
  .ai-message-list { padding: 13px; }
  .ai-message { max-width: 94%; }
  .drawer { width: 100%; }
  .drawer-content { padding: 16px; }
  .literature-detail-drawer .drawer-content { padding: 14px; }
  .literature-detail-drawer .drawer-content.detail-content-split { display: block; overflow-y: auto; }
  .detail-preview-panel { height: min(58vh, 520px); margin-bottom: 12px; }
  .detail-info-panel { overflow: visible; padding-right: 0; }
  .detail-hero { flex-direction: column; padding: 14px; }
  .detail-hero .detail-actions { justify-content: flex-start; }
  .detail-info-grid, .detail-inline-group { grid-template-columns: 1fr; }
  .detail-section { padding: 13px; }
  .detail-meta { grid-template-columns: 1fr; }
  .detail-meta > div, .detail-meta > div:nth-child(odd) { border-right: 0; }
  .detail-meta > div:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
  .detail-meta > div:last-child { border-bottom: 0; }
  .upload-fields, .form-grid { grid-template-columns: 1fr; }
  .upload-fields .field--wide, .form-grid .field--wide { grid-column: auto; }
  .upload-preview-content { height: 42vh; min-height: 300px; }
  .wizard-step { font-size: 0; }
  .wizard-step::after { margin: 0 4px; }
  .translation-editor { grid-template-columns: 1fr; min-height: 0; }
  .translation-arrow { height: 35px; transform: none; }
  .translation-arrow::before { top: 50%; right: 0; bottom: auto; left: 0; width: auto; height: 1px; }
  .translation-arrow .icon { transform: rotate(90deg); }
  .translation-pane { min-height: 280px; }
  .translation-pane + .translation-pane { border-top: 1px solid var(--line); border-left: 0; }
  .translation-controls { flex-wrap: wrap; }
  .translation-swap { margin-top: 0; }
  .quick-translate-button { top: auto; right: 0; bottom: 86px; width: 42px; height: 96px; transform: none; }
  .quick-translation-window { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: min(86vh, 700px); }
  .quick-translation-controls { grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr); gap: 7px; padding: 11px; }
  .quick-translation-editor { grid-template-columns: 1fr; overflow-y: auto; }
  .quick-translation-pane { min-height: 240px; }
  .quick-translation-pane + .quick-translation-pane { border-top: 1px solid var(--line); border-left: 0; }
  .setting-input-row { grid-template-columns: 1fr; }
  .cloud-api-actions { align-items: stretch; flex-direction: column; }
  .search-term-row { grid-template-columns: 1fr 32px; }
  .search-term-row .field--wide { grid-column: 1 / -1; }
  .search-term-delete { grid-column: 2; grid-row: 1; justify-self: end; }
  .search-term-toolbar { grid-template-columns: 1fr; align-items: stretch; }
  .audit-toolbar { grid-template-columns: 1fr; align-items: stretch; }
  .audit-count { justify-self: start; }
  .audit-log-card { grid-template-columns: 1fr; }
  .audit-log-meta { grid-template-columns: 1fr 1fr; }
  .audit-detail-grid { grid-template-columns: 1fr; }
  .settings-body { padding: 14px; }
  .modal-wrap { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: min(92vh, 760px); border-right: 0; border-bottom: 0; border-left: 0; border-radius: 8px 8px 0 0; }
  .toast-root { top: auto; right: 12px; bottom: 12px; width: calc(100vw - 24px); }
}
@media (max-width: 390px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar-actions { gap: 1px; }
  .page-actions .btn:not(.btn--primary) span { display: none; }
}
/* System audit logs */
.audit-panel { max-width: 1180px; }
.audit-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px auto;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.audit-search { width: 100%; }
.audit-toolbar select {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}
.audit-count { color: var(--muted); font-size: 12px; justify-self: end; }
.audit-log-list { display: grid; gap: 10px; padding: 14px 16px 18px; }
.audit-log-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
}
.audit-log-main { display: flex; min-width: 0; gap: 10px; align-items: flex-start; }
.audit-log-main > div { min-width: 0; }
.audit-log-main strong { display: block; color: var(--ink); }
.audit-log-main span:not(.audit-action) {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audit-action {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(15, 118, 110, .12);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 700;
}
.audit-action--delete { background: rgba(220, 38, 38, .12); color: #b91c1c; }
.audit-action--login, .audit-action--view, .audit-action--download { background: rgba(37, 99, 235, .12); color: #1d4ed8; }
.audit-duration { color: var(--ink-soft); font: 12px var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace); white-space: nowrap; }
.audit-log-meta {
  display: grid;
  grid-template-columns: repeat(3, auto) auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.audit-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.audit-detail-grid > div {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: var(--surface-subtle);
}
.audit-detail-grid span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.audit-detail-grid strong { word-break: break-all; }
.audit-detail-grid + .field textarea { min-height: 180px; font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace); }
.audit-change-section { margin: 4px 0 14px; }
.audit-change-section h3 { margin: 0 0 8px; font-size: 14px; }
.audit-change-table { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.audit-change-head, .audit-change-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr); }
.audit-change-head { background: var(--surface-subtle); color: var(--muted); font-size: 12px; font-weight: 700; }
.audit-change-head span, .audit-change-row > * { min-width: 0; padding: 9px 10px; border-right: 1px solid var(--line); }
.audit-change-head span:last-child, .audit-change-row > *:last-child { border-right: 0; }
.audit-change-row { border-top: 1px solid var(--line); }
.audit-change-row strong { color: var(--ink); font-size: 13px; }
.audit-change-row pre { max-height: 130px; margin: 0; overflow: auto; white-space: pre-wrap; word-break: break-word; color: var(--ink); font-family: inherit; font-size: 12px; line-height: 1.5; }
.muted-text { margin: 0; color: var(--muted); font-size: 13px; }

/* Audit detail surface */
.audit-detail-modal {
  display: flex;
  width: min(900px, calc(100vw - 32px));
  max-height: min(900px, calc(100vh - 32px));
  flex-direction: column;
  overflow: hidden;
}
.audit-detail-modal > .modal-header { flex: 0 0 auto; background: var(--surface); }
.audit-detail-body { min-height: 0; padding: 0; overflow: auto; background: var(--surface-muted); }
.audit-detail-scroll { padding-bottom: 6px; }
.audit-detail-hero {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 22px 22px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.audit-detail-hero-icon { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 14px; background: var(--brand-light); color: var(--brand-dark); }
.audit-detail-hero-icon .icon { width: 24px; height: 24px; }
.audit-detail-hero--danger .audit-detail-hero-icon { background: #fde8e7; color: var(--danger); }
.audit-detail-hero--info .audit-detail-hero-icon { background: #e6efff; color: #2458a6; }
.audit-detail-hero--muted .audit-detail-hero-icon { background: var(--surface-muted); color: var(--ink-soft); }
.audit-detail-hero-copy { min-width: 0; }
.audit-detail-hero-copy > span { display: block; color: var(--brand-dark); font-size: 11px; font-weight: 750; letter-spacing: 0; text-transform: uppercase; }
.audit-detail-hero-copy h3 { margin: 3px 0 2px; font-size: 21px; font-weight: 760; line-height: 1.25; }
.audit-detail-hero-copy p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.audit-detail-hero-mark { display: inline-flex; align-items: center; gap: 5px; align-self: start; padding: 5px 8px; border: 1px solid #bfe3d3; border-radius: 999px; background: #f0faf5; color: var(--brand-dark); font-size: 11px; font-weight: 700; white-space: nowrap; }
.audit-detail-hero-mark .icon { width: 13px; height: 13px; }
.audit-detail-section { padding: 20px 22px 0; }
.audit-detail-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.audit-detail-section-heading h3 { margin: 2px 0 0; font-size: 15px; font-weight: 750; }
.audit-detail-eyebrow { display: block; color: var(--ink-faint); font-size: 10px; font-weight: 780; letter-spacing: 0; line-height: 1.2; }
.audit-detail-section-count { color: var(--ink-faint); font-size: 11px; white-space: nowrap; }
.audit-detail-context { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.audit-detail-context-item { min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.audit-detail-context-item span { display: block; margin-bottom: 4px; color: var(--ink-faint); font-size: 11px; }
.audit-detail-context-item strong { display: block; overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.audit-detail-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(128px, 236px); gap: 8px; align-items: stretch; }
.audit-detail-field { display: flex; min-width: 0; min-height: 0; max-height: 236px; flex-direction: column; overflow: hidden; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.audit-detail-field > span { display: block; margin-bottom: 5px; color: var(--ink-faint); font-size: 11px; }
.audit-detail-field-value { display: flex; min-width: 0; min-height: 0; flex: 1; flex-direction: column; overflow: auto; color: var(--ink); }
.audit-detail-value-text { display: block; overflow-wrap: anywhere; font-size: 13px; font-weight: 650; line-height: 1.45; white-space: pre-wrap; }
.audit-detail-value-code, .audit-detail-value-block { max-height: 190px; margin: 0; overflow: auto; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); color: var(--ink-soft); font: 12px/1.55 var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace); white-space: pre-wrap; overflow-wrap: anywhere; }
.audit-detail-value-block { grid-column: 1 / -1; }
.audit-detail-diff-list { display: grid; gap: 9px; }
.audit-detail-diff-item { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.audit-detail-diff-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.audit-detail-diff-label span { color: var(--ink); font-size: 13px; font-weight: 720; }
.audit-detail-diff-label code { color: var(--ink-faint); font: 11px var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace); }
.audit-detail-diff-values { display: grid; grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr); gap: 8px; align-items: center; }
.audit-detail-diff-values > div:not(.audit-detail-diff-arrow) { min-width: 0; }
.audit-detail-diff-values span { display: block; margin-bottom: 4px; color: var(--ink-faint); font-size: 10px; font-weight: 700; }
.audit-detail-diff-values pre { min-height: 19px; max-height: 120px; margin: 0; overflow: auto; padding: 8px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-muted); color: var(--ink-soft); font: 12px/1.5 var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace); white-space: pre-wrap; overflow-wrap: anywhere; }
.audit-detail-diff-arrow { display: grid; place-items: center; color: var(--brand); }
.audit-detail-diff-arrow .icon { width: 17px; height: 17px; }
.audit-detail-empty { display: flex; align-items: center; gap: 11px; padding-bottom: 20px; }
.audit-detail-empty-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--surface); color: var(--ink-faint); }
.audit-detail-empty-icon .icon { width: 18px; height: 18px; }
.audit-detail-empty h3 { margin: 0 0 2px; font-size: 13px; }
.audit-detail-empty p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.audit-detail-raw { margin: 20px 22px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.audit-detail-raw summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 13px; cursor: pointer; list-style: none; }
.audit-detail-raw summary::-webkit-details-marker { display: none; }
.audit-detail-raw summary > span { display: flex; align-items: baseline; gap: 9px; }
.audit-detail-raw summary strong { font-size: 12px; }
.audit-detail-raw summary > .icon { width: 16px; height: 16px; color: var(--ink-faint); transition: transform .16s ease; }
.audit-detail-raw[open] summary > .icon { transform: rotate(180deg); }
.audit-detail-raw pre { max-height: 260px; margin: 0; overflow: auto; padding: 13px; border-top: 1px solid var(--line); background: var(--surface-muted); color: var(--ink-soft); font: 11px/1.55 var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace); white-space: pre-wrap; overflow-wrap: anywhere; }
.audit-detail-footer-note { margin-right: auto; color: var(--ink-faint); font-size: 11px; }

@media (max-width: 760px) {
  .audit-detail-modal { width: 100%; max-height: min(94vh, 900px); border-right: 0; border-bottom: 0; border-left: 0; border-radius: 8px 8px 0 0; }
  .audit-detail-hero { grid-template-columns: 44px minmax(0, 1fr); padding: 18px 16px; }
  .audit-detail-hero-icon { width: 44px; height: 44px; border-radius: 11px; }
  .audit-detail-hero-mark { grid-column: 2; justify-self: start; }
  .audit-detail-hero-copy h3 { font-size: 18px; }
  .audit-detail-section { padding: 17px 16px 0; }
  .audit-detail-context, .audit-detail-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-detail-diff-values { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .audit-detail-diff-arrow { justify-content: start; transform: rotate(90deg); }
  .audit-detail-raw { margin-right: 16px; margin-left: 16px; }
}

@media (max-width: 390px) {
  .audit-detail-context, .audit-detail-fields { grid-template-columns: 1fr; }
  .audit-detail-footer-note { display: none; }
}

/* Compact AI chat surface */
.quick-translate-button { top: calc(50% - 88px); right: 0; width: 40px; height: 88px; padding: 8px 6px; border-radius: 7px 0 0 0; border-bottom: 0; box-shadow: -3px 3px 10px rgba(18, 44, 36, .12); transform: none; }
.quick-translate-button:hover { width: 44px; }
.quick-translate-button .icon { width: 16px; height: 16px; }
.quick-translate-button span { font-size: 11px; }
.ai-assistant-button { right: 18px; bottom: 18px; width: 52px; min-width: 52px; height: 52px; border-radius: 50%; background: var(--brand); box-shadow: 0 10px 24px rgba(11, 118, 90, .24); }
.ai-assistant-button { top: 50%; right: 0; bottom: auto; display: flex; width: 40px; min-width: 40px; height: 88px; align-items: center; justify-content: center; gap: 4px; padding: 8px 6px; border: 1px solid var(--line-strong); border-top: 0; border-right: 0; border-radius: 0 0 0 7px; background: var(--surface); color: var(--ink); box-shadow: -3px 3px 10px rgba(18, 44, 36, .12); transform: none; transition: width .16s ease, background .16s ease, color .16s ease; writing-mode: vertical-rl; }
.ai-assistant-button:hover { width: 44px; background: var(--brand); color: #fff; transform: none; }
.ai-assistant-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 28%, transparent); outline-offset: 3px; }
.ai-assistant-button .icon { width: 16px; height: 16px; }
.ai-assistant-button span { max-width: none; overflow: visible; font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; }
.ai-assistant-button:hover span { max-width: none; }

@media (max-width: 760px) {
  .table-empty-row .empty-state { width: calc(100vw - 28px); }
  .quick-translate-button { top: auto; bottom: 72px; width: 38px; height: 72px; }
  .ai-assistant-button { top: auto; right: 0; bottom: 0; width: 38px; min-width: 38px; height: 72px; }
  .quick-translate-button:hover, .ai-assistant-button:hover { width: 42px; }
}
.ai-assistant-window { right: 10px; bottom: 10px; width: min(400px, calc(100vw - 20px)); height: min(700px, calc(100vh - 20px)); border: 1px solid rgba(225, 213, 205, .95); border-radius: 14px; background: #fffaf6; box-shadow: 0 18px 46px rgba(72, 49, 35, .2); }
.ai-assistant-header { position: relative; z-index: 3; display: flex; min-height: 84px; align-items: center; justify-content: center; padding: 12px 14px; border-bottom: 1px solid #f0e6de; background: #ffe9d3; }
.ai-assistant-close { position: absolute; top: 24px; left: 16px; display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #7b8994; }
.ai-assistant-close:hover { background: rgba(255, 255, 255, .42); color: #4b5d68; }
.ai-assistant-close .icon { width: 21px; height: 21px; stroke-width: 1.7; }
.ai-conversation-switch { display: flex; width: min(190px, calc(100% - 50px)); align-items: center; gap: 9px; padding: 6px 12px 6px 6px; border: 0; border-radius: 28px; background: rgba(255, 255, 255, .58); box-shadow: 0 6px 15px rgba(137, 87, 52, .08); text-align: left; }
.ai-conversation-switch:hover { background: rgba(255, 255, 255, .8); }
.ai-conversation-avatar { display: grid; width: 42px; height: 42px; place-items: center; flex: 0 0 auto; overflow: hidden; border-radius: 50%; background: transparent; color: #fff; box-shadow: none; }
.ai-conversation-avatar .icon { width: 25px; height: 25px; }
.ai-conversation-avatar img, .ai-message-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.ai-conversation-avatar > span:not(.ai-conversation-switch-copy), .ai-message-avatar > span { font-family: Georgia, serif; font-size: 18px; font-weight: 700; line-height: 1; }
.ai-conversation-switch-copy { display: grid; min-width: 0; gap: 1px; }
.ai-conversation-switch-copy strong, .ai-conversation-switch-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-conversation-switch-copy strong { color: #2a2729; font-size: 12px; line-height: 1.35; }
.ai-conversation-switch-copy small { color: #6b6670; font-size: 10px; }
.ai-conversation-switch-chevron { width: 14px; height: 14px; margin-left: auto; color: #8a7d7a; }
.ai-conversation-menu { position: absolute; top: 76px; left: 13px; right: 13px; overflow: hidden; border: 1px solid #eadfd7; border-radius: 12px; background: #fffdfa; box-shadow: 0 12px 28px rgba(72, 49, 35, .18); }
.ai-conversation-list { display: none; }
.ai-conversation-item { display: flex; width: 100%; min-height: 49px; align-items: center; gap: 8px; padding: 7px 11px; border: 0; border-bottom: 1px solid #f1e9e3; background: transparent; color: #5c5e63; text-align: left; }
.ai-conversation-item:hover, .ai-conversation-item.active { background: #fff0e4; color: #5c2432; }
.ai-conversation-item-icon { display: grid; width: 25px; height: 25px; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #f3e3da; color: #a06867; }
.ai-conversation-item-icon .icon { width: 14px; height: 14px; }
.ai-conversation-item-copy { display: grid; min-width: 0; gap: 1px; }
.ai-conversation-item strong, .ai-conversation-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-conversation-item strong { font-size: 12px; }
.ai-conversation-item small { color: #a19a98; font-size: 10px; }
.ai-conversation-item-check { width: 15px; height: 15px; margin-left: auto; color: #bd5b6c; }
.ai-conversation-new { display: flex; width: 100%; align-items: center; gap: 7px; min-height: 42px; padding: 8px 13px; border: 0; background: #fffdfa; color: #9b5061; font-size: 12px; font-weight: 650; text-align: left; }
.ai-conversation-new:hover { background: #fff0e4; }
.ai-conversation-new .icon { width: 16px; height: 16px; }
.ai-assistant-body { display: block; min-height: 0; flex: 1; }
.ai-chat-panel { height: 100%; }
.ai-message-list { padding: 13px 18px 16px; background: #fffdfb; scrollbar-color: #cfcac7 transparent; scrollbar-width: thin; }
.ai-message-list::-webkit-scrollbar { width: 7px; }
.ai-message-list::-webkit-scrollbar-thumb { border-radius: 8px; background: #d0cbc8; }
.ai-message { display: flex; max-width: 94%; align-items: flex-start; gap: 7px; margin: 0 0 15px; }
.ai-message--user { width: 100%; max-width: 100%; justify-content: flex-end; margin-left: 0; }
.ai-message--user .ai-message-stack { max-width: 94%; }
.ai-message-stack { min-width: 0; }
.ai-message-content { padding: 9px 11px; border: 1px solid #eee9e5; border-radius: 6px; background: #fff; box-shadow: 0 2px 6px rgba(76, 58, 45, .05); color: #323338; font-size: 13px; line-height: 1.55; }
.ai-message--streaming .ai-message-content { white-space: pre-wrap; }
.ai-message-content p { margin: 0 0 9px; }
.ai-message-content p:last-child { margin-bottom: 0; }
.ai-message-content h1, .ai-message-content h2, .ai-message-content h3, .ai-message-content h4, .ai-message-content h5, .ai-message-content h6 { margin: 0 0 8px; color: #29282b; font-size: 14px; line-height: 1.4; }
.ai-message-content ul, .ai-message-content ol { margin: 0 0 9px; padding-left: 22px; }
.ai-message-content li + li { margin-top: 4px; }
.ai-message-content blockquote { margin: 0 0 9px; padding: 5px 10px; border-left: 3px solid #e6b4a0; background: #fff7f1; color: #6f6664; }
.ai-message-content code { padding: 1px 4px; border-radius: 4px; background: #f3eee9; color: #744b45; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .92em; }
.ai-message-content pre { margin: 0 0 9px; padding: 9px 10px; overflow-x: auto; border-radius: 6px; background: #2f3034; color: #f8f2ef; white-space: pre-wrap; word-break: break-word; }
.ai-message-content pre code { padding: 0; background: transparent; color: inherit; font-size: 11px; }
.ai-message--user .ai-message-content { border-color: #f1d4df; background: #fff0f4; color: #3e3036; }
.ai-message-avatar { display: grid; width: 25px; height: 25px; place-items: center; flex: 0 0 auto; margin-top: 8px; border-radius: 50%; background: transparent; color: #fff; }
.ai-message-avatar .icon { width: 15px; height: 15px; }
.ai-message-meta { margin-top: 3px; color: #a5a1a0; font-size: 10px; line-height: 1.25; }
.ai-message--user .ai-message-meta { text-align: right; }
.ai-time-divider { display: flex; align-items: center; gap: 10px; margin: 10px 0 17px; color: #a1a5af; font-size: 11px; }
.ai-time-divider::before, .ai-time-divider::after { height: 1px; flex: 1; background: #e9e9eb; content: ''; }
.ai-citations { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 7px; }
.ai-citations > span { color: #9b9795; font-size: 10px; }
.ai-citation { display: inline-flex; max-width: 220px; align-items: center; gap: 4px; padding: 4px 7px; overflow: hidden; border: 1px solid #eaded8; border-radius: 5px; background: #fff; color: #9d5365; font-size: 10px; }
.ai-citation span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-welcome { display: grid; height: 100%; place-content: center; justify-items: center; padding: 30px; color: #787879; text-align: center; }
.ai-welcome-icon { width: 44px; height: 44px; margin-bottom: 10px; border-radius: 50%; background: #ffe9d3; color: #a95f48; }
.ai-welcome strong { color: #353437; font-size: 15px; }
.ai-welcome p { max-width: 280px; margin: 7px 0 0; font-size: 11px; line-height: 1.7; }
.ai-chat-form { position: relative; padding: 10px 14px 14px; border-top: 1px solid #f0e7e0; background: #fffaf6; }
.ai-composer-row { display: flex; min-height: 43px; align-items: center; gap: 2px; padding: 4px 5px 4px 7px; border: 1px solid #e5e9ee; border-radius: 23px; background: #fff; box-shadow: 0 4px 16px rgba(96, 95, 98, .07); }
.ai-composer-tool, .ai-send-button { display: grid; width: 32px; height: 32px; place-items: center; flex: 0 0 auto; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #6b7785; }
.ai-composer-tool:hover { background: #f3f4f6; color: #4b5a69; }
.ai-composer-tool .icon { width: 21px; height: 21px; stroke-width: 1.7; }
.ai-composer-row textarea { width: 100%; min-width: 0; height: 32px; min-height: 32px; max-height: 32px; padding: 6px 5px; border: 0; outline: 0; resize: none; overflow-y: hidden; background: transparent; color: #3b3e43; font-size: 13px; line-height: 20px; }
.ai-composer-row textarea.is-multiline { height: 112px; min-height: 112px; max-height: 112px; overflow-y: auto; }
.ai-composer-row textarea::placeholder { color: #adb6c0; }
.ai-send-button { background: #e6e9ed; color: #fff; transition: background .16s ease, box-shadow .16s ease, transform .16s ease; }
.ai-send-button:hover:not(:disabled) { background: #d1d7dd; }
.ai-send-button.is-ready { background: #bd5b6c; color: #fff; box-shadow: 0 4px 10px rgba(189, 91, 108, .24); }
.ai-send-button.is-ready:hover:not(:disabled) { background: #a84b5f; }
.ai-send-button.is-ready:active:not(:disabled) { transform: translateY(1px); }
.ai-send-button:disabled { opacity: .72; }
.ai-send-button .icon { width: 17px; height: 17px; stroke-width: 1.8; transform: rotate(-9deg); }
.ai-composer-status { padding: 5px 8px 0; color: #b4414d; font-size: 10px; }
.ai-reference-popover, .ai-emoji-popover { position: absolute; z-index: 4; bottom: 66px; border: 1px solid #eadfd8; border-radius: 12px; background: #fffdfa; box-shadow: 0 12px 28px rgba(72, 49, 35, .16); }
.ai-reference-popover { left: 12px; right: 12px; display: grid; grid-template-columns: auto 1fr; gap: 4px 9px; max-height: 290px; padding: 11px; overflow: hidden; }
.ai-reference-popover strong { font-size: 12px; }
.ai-reference-popover > span { color: #a09b99; font-size: 10px; text-align: right; }
.ai-reference-search { display: flex; grid-column: 1 / -1; align-items: center; gap: 6px; width: 100%; height: 32px; min-width: 0; padding: 5px 8px; border: 1px solid #e7ded8; border-radius: 6px; background: #fff; color: #a19a98; }
.ai-reference-search:focus-within { border-color: #c8898a; box-shadow: 0 0 0 3px rgba(193, 38, 95, .08); }
.ai-reference-search .icon { width: 14px; height: 14px; flex: 0 0 auto; }
.ai-reference-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: #4a4b50; font-size: 11px; }
.ai-reference-search input::placeholder { color: #b6ada8; }
.ai-reference-popover select { grid-column: 1 / -1; width: 100%; height: 33px; min-height: 33px; padding: 5px 8px; border: 1px solid #e7ded8; border-radius: 6px; background: #fff; font-size: 11px; }
.ai-reference-options { display: grid; grid-column: 1 / -1; max-height: 170px; overflow-y: auto; border: 1px solid #eee5de; border-radius: 8px; background: #fff; scrollbar-color: #d9d0ca transparent; scrollbar-width: thin; }
.ai-reference-options::-webkit-scrollbar { width: 6px; }
.ai-reference-options::-webkit-scrollbar-thumb { border-radius: 8px; background: #d9d0ca; }
.ai-reference-option { display: flex; width: 100%; min-height: 42px; align-items: center; gap: 8px; padding: 7px 9px; border: 0; border-bottom: 1px solid #f3ece7; background: #fff; color: #4a4b50; text-align: left; }
.ai-reference-option:last-child { border-bottom: 0; }
.ai-reference-option:hover, .ai-reference-option.is-selected { background: #fff3e9; color: #7b4350; }
.ai-reference-option-icon { display: grid; width: 25px; height: 25px; place-items: center; flex: 0 0 auto; border-radius: 6px; background: #f7e9df; color: #a26767; }
.ai-reference-option-icon .icon { width: 14px; height: 14px; }
.ai-reference-option-copy { min-width: 0; }
.ai-reference-option-copy strong { display: block; overflow: hidden; font-size: 11px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.ai-reference-option-check { width: 16px; height: 16px; margin-left: auto; color: #bb5b6c; }
.ai-reference-tags { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 5px; }
.ai-reference-tags .tag { border: 0; cursor: pointer; }
.ai-emoji-popover { left: 46px; display: grid; width: 183px; grid-template-columns: repeat(6, 1fr); gap: 3px; padding: 8px; }
.ai-emoji-popover button { display: grid; width: 26px; height: 26px; place-items: center; padding: 0; border: 0; border-radius: 5px; background: transparent; font-size: 17px; }
.ai-emoji-popover button:hover { background: #fff0e4; }
.ai-empty { margin: 0; padding: 14px; color: #a19a98; font-size: 11px; }

@media (max-width: 670px) {
  .ai-assistant-window { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100vh - 16px); }
  .ai-assistant-header { min-height: 78px; }
  .ai-message-list { padding-right: 13px; padding-left: 13px; }
  .ai-message { max-width: 96%; }
  .ai-message--user { max-width: 100%; }
}

@media (max-width: 760px) {
  .audit-change-head { display: none; }
  .audit-change-row { grid-template-columns: 1fr; }
  .audit-change-row > * { border-right: 0; }
}
/* User permission matrix */
.permission-editor {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line, #e6e8ec);
}

.permission-editor-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.permission-editor-heading span {
  color: var(--muted, #76808f);
  font-size: 12px;
}

.permission-group {
  min-width: 0;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--line, #e6e8ec);
  border-radius: 8px;
}

.permission-group legend {
  padding: 0 6px;
  color: var(--ink, #1f2937);
  font-size: 12px;
  font-weight: 700;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.permission-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  color: var(--ink, #1f2937);
  font-size: 13px;
  line-height: 1.4;
}

.permission-option input {
  flex: 0 0 auto;
  margin-top: 2px;
}

@media (max-width: 620px) {
  .permission-editor-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .permission-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .modal-root:has(.folder-document-modal) .modal-wrap { align-items: stretch; }
  .folder-document-modal { width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .folder-document-editor-body { padding: 12px; }
  .folder-document-editor-page { padding: 32px 24px; }
  .folder-document-footer { flex-wrap: wrap; }
  .folder-document-status { width: auto; margin-right: auto; margin-bottom: 0; }
}

@media (max-width: 980px) {
  .file-manager-layout--document, .literature-page-layout--document { grid-template-columns: minmax(0, 1fr) 8px minmax(292px, var(--folder-document-panel-width, 300px)); }
}

@media (max-width: 1100px) and (min-width: 701px) {
  .table-toolbar {
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
  }

  .table-search-wrap {
    width: auto;
    min-width: 190px;
    flex: 1 1 230px;
  }

  .table-folder-filter {
    min-width: 150px;
    flex: 1 1 180px;
  }

  .table-folder-trigger {
    min-width: 0;
    max-width: none;
    flex: 1 1 auto;
  }

  .toolbar-spacer {
    display: none;
  }

  .literature-result-header {
    display: block;
  }

  .literature-result-header-actions {
    justify-content: flex-start;
    margin-top: 6px;
  }
}

@media (max-width: 760px) {
  .file-manager-layout--document, .literature-page-layout--document { display: flex; flex-direction: column; }
  .file-manager-layout--document .folder-content { min-height: 300px; }
  .literature-page-layout--document { height: calc(100vh - 132px); max-height: calc(100vh - 132px); overflow-y: auto; }
  .literature-page-layout--document > #literatureTable { flex: 0 0 auto; overflow: visible; }
  .literature-page-layout--document > .folder-document-panel { flex: 0 0 auto; height: min(640px, 72vh); }
  .folder-document-resizer { display: none; }
  .folder-document-panel { height: min(640px, 72vh); min-height: 390px; }
  .folder-file-preview-panel { height: min(640px, 72vh); min-height: 390px; }
  .file-manager--preview .folder-content--preview { height: min(640px, 72vh); }
}

/* Operations monitoring */
.monitoring-page-header { align-items: end; margin-bottom: 16px; }
.monitoring-page-header .page-heading > p:not(.eyebrow) { margin-top: 5px; font-size: 12px; }
.monitoring-live-line { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 9px; color: var(--ink-faint); font-size: 11px; }
.monitoring-live-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-light); }
.monitoring-live-dot--error { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-light); }
.monitoring-inline-error { color: var(--danger); }
.monitoring-toolbar { display: flex; align-items: end; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.monitoring-select { display: grid; min-width: 126px; gap: 4px; color: var(--ink-faint); font-size: 10px; font-weight: 650; }
.monitoring-select select { min-width: 126px; height: 34px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-size: 12px; }
.monitoring-auto-refresh { display: inline-flex; min-height: 34px; align-items: center; gap: 6px; padding: 0 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-soft); font-size: 11px; cursor: pointer; }
.monitoring-auto-refresh input { width: 14px; height: 14px; accent-color: var(--brand); }
.monitoring-overview { display: grid; grid-template-columns: minmax(230px, .82fr) minmax(310px, 1.08fr) minmax(380px, 1.65fr); gap: 18px 22px; padding: 18px; }
.monitoring-health-block { display: flex; min-width: 0; align-items: center; gap: 15px; }
.monitoring-health-donut { --health-color: var(--success); position: relative; display: grid; width: 118px; height: 118px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: conic-gradient(var(--health-color) var(--monitor-health), var(--surface-hover) 0); }
.monitoring-health-donut::after { position: absolute; inset: 10px; border-radius: 50%; background: var(--surface); content: ""; }
.monitoring-health-donut > div { position: relative; z-index: 1; display: grid; place-items: center; }
.monitoring-health-donut strong { color: var(--health-color); font-size: 29px; font-variant-numeric: tabular-nums; line-height: 1; }
.monitoring-health-donut span { margin-top: 6px; color: var(--ink-faint); font-size: 10px; }
.monitoring-health-donut--warning { --health-color: var(--accent); }
.monitoring-health-donut--danger { --health-color: var(--danger); }
.monitoring-health-copy { min-width: 0; }
.monitoring-health-copy span, .monitoring-health-copy small { display: block; color: var(--ink-faint); font-size: 11px; }
.monitoring-health-copy strong { display: block; margin: 4px 0; color: var(--ink); font-size: 17px; font-weight: 730; }
.monitoring-health-copy small { line-height: 1.55; }
.monitoring-realtime { min-width: 0; padding-left: 20px; border-left: 1px solid var(--line); }
.monitoring-block-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.monitoring-block-title small { color: var(--ink-faint); font-size: 10px; font-weight: 500; }
.monitoring-title-dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: #3b82f6; box-shadow: 0 0 0 4px #e5efff; vertical-align: -1px; }
.monitoring-realtime-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 7px; margin: 19px 0 15px; }
.monitoring-realtime-main strong { color: var(--ink); font-size: 27px; font-variant-numeric: tabular-nums; line-height: 1; }
.monitoring-realtime-main strong:nth-of-type(2) { margin-left: 14px; }
.monitoring-realtime-main span { color: var(--ink-faint); font: 600 11px var(--font-mono, ui-monospace, monospace); }
.monitoring-realtime-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.monitoring-realtime-grid div { min-width: 0; }
.monitoring-realtime-grid span { display: block; color: var(--ink-faint); font-size: 10px; }
.monitoring-realtime-grid strong { display: block; margin-top: 3px; overflow: hidden; color: var(--ink); font: 650 12px var(--font-mono, ui-monospace, monospace); text-overflow: ellipsis; white-space: nowrap; }
.monitoring-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.monitoring-stat { min-width: 0; min-height: 82px; padding: 11px 12px; background: var(--surface-muted); }
.monitoring-stat > span { display: block; overflow: hidden; color: var(--ink-faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.monitoring-stat > strong { display: block; margin-top: 8px; overflow: hidden; color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; font-weight: 740; text-overflow: ellipsis; white-space: nowrap; }
.monitoring-stat > small { display: block; margin-top: 5px; overflow: hidden; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.monitoring-stat--blue > strong { color: #2774dd; }
.monitoring-stat--success > strong { color: var(--success); }
.monitoring-stat--warning > strong { color: #aa6a08; }
.monitoring-stat--danger > strong { color: var(--danger); }
.monitoring-stat--neutral > strong { color: var(--ink); }
.monitoring-runtime-grid { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.monitoring-runtime-grid .monitoring-stat { min-height: 76px; }
.monitoring-lower-grid { display: grid; grid-template-columns: minmax(285px, .8fr) minmax(0, 1.7fr); gap: 16px; margin-top: 16px; }
.monitoring-panel { min-width: 0; overflow: hidden; }
.monitoring-panel .panel-header { min-height: 62px; }
.monitoring-panel .panel-header > div { min-width: 0; }
.monitoring-panel .panel-header h3 { font-size: 14px; }
.monitoring-panel .panel-header p { margin: 4px 0 0; color: var(--ink-soft); font-size: 11px; }
.monitoring-panel-meta { flex: 0 0 auto; color: var(--ink-faint); font-size: 10px; }
.monitoring-endpoint-head, .monitoring-endpoint-row { display: grid; grid-template-columns: minmax(0, 1fr) 62px 75px 66px; align-items: center; gap: 8px; padding: 0 14px; }
.monitoring-endpoint-head { min-height: 34px; border-bottom: 1px solid var(--line); background: var(--surface-muted); color: var(--ink-faint); font-size: 10px; }
.monitoring-endpoint-head span:not(:first-child), .monitoring-endpoint-row > span { text-align: right; }
.monitoring-endpoint-list { display: grid; }
.monitoring-endpoint-row { min-height: 48px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font: 11px var(--font-mono, ui-monospace, monospace); }
.monitoring-endpoint-row:last-child { border-bottom: 0; }
.monitoring-endpoint-row strong { overflow: hidden; color: var(--ink); font: 600 11px var(--font-mono, ui-monospace, monospace); text-overflow: ellipsis; white-space: nowrap; }
.monitoring-endpoint-rate--success { color: var(--success); }
.monitoring-endpoint-rate--warning { color: #aa6a08; }
.monitoring-endpoint-rate--danger { color: var(--danger); }
.monitoring-empty { padding: 42px 16px; color: var(--ink-faint); font-size: 12px; text-align: center; }
.monitoring-chart-legend { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 10px; }
.monitoring-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.monitoring-legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.monitoring-legend-dot--blue { background: #3b82f6; }
.monitoring-legend-dot--green { background: #10b981; }
.monitoring-chart-wrap { min-height: 280px; padding: 14px 16px 9px; }
.monitoring-chart-svg { display: block; width: 100%; height: 250px; overflow: visible; }
.monitoring-chart-grid line { stroke: var(--line); stroke-width: 1; }
.monitoring-chart-axis text { fill: var(--ink-faint); font: 10px var(--font-mono, ui-monospace, monospace); }
.monitoring-chart-line { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.monitoring-chart-line--requests { stroke: #3b82f6; }
.monitoring-chart-line--latency { stroke: #10b981; }
.monitoring-footnote { margin: 10px 2px 0; color: var(--ink-faint); font-size: 10px; }

html[data-theme="dark"] .monitoring-title-dot { box-shadow: 0 0 0 4px rgba(59,130,246,.18); }
html[data-theme="dark"] .monitoring-stat--warning > strong { color: #eab354; }
html[data-theme="dark"] .monitoring-endpoint-rate--warning { color: #eab354; }

@media (max-width: 1250px) {
  .monitoring-overview { grid-template-columns: minmax(230px, .8fr) minmax(310px, 1.1fr); }
  .monitoring-stat-grid { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .monitoring-runtime-grid { grid-row: 3; }
}
@media (max-width: 980px) {
  .monitoring-lower-grid { grid-template-columns: 1fr; }
  .monitoring-runtime-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 670px) {
  .monitoring-page-header { align-items: flex-start; }
  .monitoring-toolbar { width: 100%; justify-content: flex-start; }
  .monitoring-select { flex: 1 1 130px; }
  .monitoring-select select { width: 100%; }
  .monitoring-overview { grid-template-columns: 1fr; gap: 14px; padding: 13px; }
  .monitoring-realtime { padding: 14px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .monitoring-stat-grid { grid-column: auto; grid-row: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitoring-runtime-grid { grid-column: auto; grid-row: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitoring-health-block { align-items: flex-start; }
  .monitoring-health-donut { width: 96px; height: 96px; }
  .monitoring-health-donut::after { inset: 8px; }
  .monitoring-health-donut strong { font-size: 24px; }
  .monitoring-endpoint-head, .monitoring-endpoint-row { grid-template-columns: minmax(0, 1fr) 54px 62px; }
  .monitoring-endpoint-head span:nth-child(3), .monitoring-endpoint-row > span:nth-child(3) { display: none; }
  .monitoring-chart-wrap { min-height: 230px; padding: 12px 8px 6px; }
  .monitoring-chart-svg { height: 205px; }
}
