:root {
  --bg: #edf5fb;
  --surface: #ffffff;
  --surface-muted: #f7f9fb;
  --text: #132238;
  --text-soft: #53657c;
  --muted: #7b899b;
  --line: #dbe4ec;
  --line-strong: #c8d4df;
  --primary: #1769e0;
  --primary-hover: #0f57bf;
  --primary-soft: #eaf2ff;
  --teal: #078c86;
  --teal-soft: #e8f7f5;
  --amber: #a86608;
  --danger: #c83232;
  --danger-soft: #fff0f0;
  --shadow: 0 14px 32px rgba(37, 62, 89, 0.09);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--bg); font: 15px/1.7 var(--font); }
body.modal-open { overflow: hidden; }
body.image-lightbox-open { overflow: hidden; }
button, input, textarea, select { color: inherit; font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { position: sticky; z-index: 50; top: 0; height: 70px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(12px); }
.header-inner { width: min(1380px, calc(100% - 40px)); height: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; min-width: 0; align-items: center; gap: 11px; color: var(--text); font-size: 18px; font-weight: 750; text-decoration: none; }
.brand-mark, .login-mark { display: grid; place-items: center; color: #fff; background: var(--primary); font-weight: 800; }
.brand-mark { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 7px; }
.header-nav { display: flex; align-items: center; gap: 7px; }
.header-nav a { padding: 7px 10px; border-radius: 5px; color: var(--text-soft); text-decoration: none; }
.header-nav a:hover { color: var(--primary); background: var(--primary-soft); }

.eyebrow { margin: 0 0 8px; color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: 0; }
.btn { min-height: 38px; padding: 8px 15px; border: 1px solid transparent; border-radius: 5px; background: transparent; font-weight: 650; line-height: 1.2; }
.btn-primary { color: #fff; background: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { border-color: var(--line-strong); background: #fff; }
.btn-secondary:hover, .btn-quiet:hover { color: var(--primary); background: var(--primary-soft); }
.btn-quiet { color: var(--text-soft); }
.btn-wide { width: 100%; min-height: 44px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 650; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* Home */
.home-page { background: #f4f8fb; }
.home-shell { width: min(1380px, calc(100% - 40px)); margin: 0 auto; padding: 44px 0 72px; }
.home-intro { max-width: 900px; padding-left: 18px; border-left: 3px solid var(--primary); }
.home-intro h1 { margin: 0; font-size: 36px; line-height: 1.25; letter-spacing: 0; }
.home-intro > p:not(.eyebrow) { margin: 10px 0 0; color: var(--text-soft); font-size: 16px; }
.search-box { position: relative; display: block; max-width: 650px; margin-top: 24px; }
.search-box input, .sidebar-search input { width: 100%; border: 1px solid var(--line-strong); outline: 0; background: #fff; }
.search-box input { height: 46px; padding: 0 76px 0 43px; border-radius: 6px; box-shadow: 0 6px 18px rgba(37, 62, 89, 0.04); }
.search-box input:focus, .sidebar-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.12); }
.search-icon { position: absolute; z-index: 2; top: 50%; left: 16px; width: 14px; height: 14px; border: 2px solid #718196; border-radius: 50%; transform: translateY(-55%); }
.search-icon::after { position: absolute; right: -5px; bottom: -3px; width: 6px; height: 2px; content: ""; background: #718196; transform: rotate(45deg); }
.search-box kbd { position: absolute; top: 11px; right: 10px; padding: 2px 7px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; color: var(--muted); background: var(--surface-muted); font: 11px/1.5 var(--font); }
.filter-row { margin-top: 19px; display: flex; align-items: flex-start; gap: 13px; }
.filter-label { min-height: 34px; display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; color: #174f9c; font-size: 13px; font-weight: 800; line-height: 34px; }
.filter-label span { color: var(--teal); font-family: Consolas, monospace; font-size: 15px; }
.category-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-button { min-height: 34px; padding: 5px 13px; border: 1px solid color-mix(in srgb, var(--filter-accent) 36%, #d8e1ea); border-radius: 7px; color: var(--filter-accent); background: color-mix(in srgb, var(--filter-accent) 7%, #fff); font-size: 13px; font-weight: 750; box-shadow: 0 2px 7px rgba(37,62,89,.035); }
.filter-button:hover { border-color: var(--filter-accent); background: color-mix(in srgb, var(--filter-accent) 13%, #fff); }
.filter-button.active { border-color: var(--filter-accent); color: #fff; background: var(--filter-accent); box-shadow: 0 5px 13px color-mix(in srgb, var(--filter-accent) 20%, transparent); }
.filter-count { display: inline-grid; min-width: 19px; height: 19px; margin-left: 4px; place-items: center; border-radius: 10px; color: var(--filter-accent); background: color-mix(in srgb, var(--filter-accent) 11%, #fff); font-size: 10px; font-weight: 800; }
.filter-button.active .filter-count { color: var(--filter-accent); background: #fff; }
.result-count { height: 18px; margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.doc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.doc-card { position: relative; min-height: 126px; padding: 15px 16px 12px 18px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid #d3dee8; border-radius: 7px; background: var(--surface); text-decoration: none; box-shadow: 0 5px 16px rgba(37, 62, 89, 0.045); transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease; }
.doc-card::before { position: absolute; top: 0; bottom: 0; left: 0; width: 3px; content: ""; background: var(--category-accent, var(--primary)); }
.doc-card:hover { border-color: var(--category-accent, #adc7e7); box-shadow: var(--shadow); transform: translateY(-2px); }
.doc-card-meta { display: flex; align-items: center; gap: 7px; color: var(--category-accent, var(--teal)); font-size: 12px; font-weight: 700; }
.category-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.doc-card h2 { margin: 5px 0 3px; font-size: 16px; line-height: 1.4; letter-spacing: 0; }
.doc-card p { margin: 0; overflow: hidden; color: var(--text-soft); font-size: 12px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-link { margin-top: auto; padding-top: 5px; color: var(--primary); font-size: 12px; font-weight: 700; }
.empty-state { padding: 50px 0; color: var(--muted); text-align: center; }

/* Reader */
.reader-page { background: #f5f8fb; }
.reader-shell { width: min(1480px, calc(100% - 32px)); min-height: calc(100vh - 70px); margin: 16px auto 0; display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; align-items: start; border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; background: #fff; }
.standalone-reader-shell { width: min(1240px, calc(100% - 32px)); grid-template-columns: minmax(0, 1fr) 200px; }
.standalone-reader-shell .article-wrap { width: min(940px, 100%); justify-self: center; }
.doc-navigation { position: sticky; top: 86px; height: calc(100vh - 86px); padding: 24px 13px 40px; overflow-y: auto; border-right: 1px solid var(--line); background: #f9fbfd; }
.nav-heading { margin: 0 8px 17px; color: var(--text); font-weight: 750; }
.nav-group { margin: 0 0 5px; }
.nav-group-toggle { width: 100%; min-height: 34px; padding: 6px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; border-radius: 5px; color: var(--text); background: transparent; font-size: 13px; font-weight: 750; text-align: left; }
.nav-group-toggle:hover { color: var(--primary); background: #f0f5fb; }
.nav-chevron { color: var(--muted); font-size: 15px; line-height: 1; transition: transform 0.16s ease; }
.nav-group.open .nav-chevron { transform: rotate(180deg); }
.nav-group-items { display: none; padding: 1px 0 6px; }
.nav-group.open .nav-group-items { display: block; }
.nav-group a { display: block; margin: 2px 0; padding: 7px 9px 7px 22px; border-radius: 5px; color: var(--text-soft); font-size: 13px; line-height: 1.45; text-decoration: none; }
.nav-group a:hover { color: var(--primary); background: #f0f5fb; }
.nav-group a.active { color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.article-wrap { width: min(860px, 100%); min-width: 0; padding: 46px clamp(34px, 5vw, 76px) 100px; }
.article-utility-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.article-actions { display: flex; align-items: center; gap: 5px; }
.article-actions button { min-height: 30px; padding: 4px 8px; border: 1px solid transparent; border-radius: 4px; color: var(--text-soft); background: transparent; font-size: 12px; }
.article-actions button:hover { border-color: var(--line); color: var(--primary); background: var(--primary-soft); }
.breadcrumb { margin: 25px 0 7px; color: var(--muted); font-size: 13px; }
.article-wrap > h1 { margin: 0; font-size: 34px; line-height: 1.3; letter-spacing: 0; }
.article-summary { margin: 11px 0 0; color: var(--text-soft); font-size: 16px; }
.updated-time { margin: 8px 0 34px; color: var(--muted); font-size: 12px; }
.article-content { color: #223047; font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
.article-content h1, .article-content h2, .article-content h3, .article-content h4 { position: relative; scroll-margin-top: 90px; color: var(--text); letter-spacing: 0; }
.article-content h1 { margin: 42px 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 27px; }
.article-content h2 { margin: 38px 0 14px; padding-bottom: 9px; border-bottom: 1px solid var(--line); font-size: 23px; }
.article-content h3 { margin: 30px 0 10px; font-size: 19px; }
.article-content h4 { margin: 25px 0 8px; font-size: 16px; }
.article-content p { margin: 0 0 15px; }
.article-content ul, .article-content ol { margin: 0 0 18px; padding-left: 1.65em; }
.article-content li { margin: 4px 0; }
.article-content a { color: var(--primary); text-underline-offset: 3px; }
.article-content blockquote { margin: 20px 0; padding: 13px 17px; border-left: 3px solid var(--teal); color: #315e5b; background: var(--teal-soft); }
.article-content pre { margin: 20px 0; padding: 16px 18px; overflow: auto; border: 1px solid #dfe5ea; border-radius: 5px; color: #26384b; background: #f4f6f8; line-height: 1.65; }
.article-content pre.code-block-enhanced { position: relative; padding-top: 46px; }
.code-copy-button { position: absolute; top: 8px; right: 8px; min-width: 52px; height: 28px; padding: 0 9px; border: 1px solid #ccd7e2; border-radius: 4px; color: var(--text-soft); background: #fff; font: 12px/1 var(--font); }
.code-copy-button:hover { border-color: #9ebce2; color: var(--primary); background: var(--primary-soft); }
.article-content code { padding: 2px 6px; border: 1px solid #e0e2e5; border-radius: 4px; color: #8d3c15; background: #f7f5f2; font-family: Consolas, "Courier New", monospace; font-size: 0.9em; }
.article-content pre code { padding: 0; border: 0; color: inherit; background: transparent; }
.article-content img { display: block; max-width: 100%; height: auto; margin: 20px auto; border: 1px solid var(--line); border-radius: 5px; cursor: zoom-in; }
.article-content video { display: block; width: 100%; max-height: 560px; margin: 22px 0; border-radius: 5px; background: #10151b; }
.article-content > .media-sized:not(.media-grid-item) { display: block; margin-right: auto; margin-left: auto; }
.article-content > .media-grid-item { display: inline-block; max-width: 100%; margin: 6px 3px 14px; box-sizing: border-box; vertical-align: top; }
.article-content > video.media-grid-item { max-height: 430px; object-fit: contain; }
.media-row { width: 100%; margin: 20px 0; display: grid; align-items: start; gap: 14px; clear: both; }
.media-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.media-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.media-row.media-row-items-1 { grid-template-columns: minmax(0, 1fr); }
.media-row.media-row-items-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.media-row > img, .media-row > video { width: 100% !important; max-width: none; margin: 0 !important; box-sizing: border-box; }
.media-row > video { height: auto; min-height: 180px; object-fit: contain; }
.doc-columns { width: 100%; margin: 24px 0; display: grid; align-items: start; gap: 16px; clear: both; }
.doc-columns-equal { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.doc-columns-left-narrow { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.doc-columns-right-narrow { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.doc-column { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.doc-column > :first-child { margin-top: 0; }
.doc-column > :last-child { margin-bottom: 0; }
.doc-column img, .doc-column video { width: 100% !important; max-width: 100%; margin-right: 0; margin-left: 0; }
.article-content table { width: 100%; margin: 20px 0; border-collapse: collapse; font-size: 14px; }
.article-content th, .article-content td { padding: 9px 11px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.article-content th { background: var(--surface-muted); }
.article-content hr { margin: 32px 0; border: 0; border-top: 1px solid var(--line); }
.article-pagination { margin-top: 54px; padding-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; border-top: 1px solid var(--line); }
.article-pagination a { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--surface-muted); text-decoration: none; }
.article-pagination a:hover { border-color: #aac4e4; color: var(--primary); background: var(--primary-soft); }
.article-pagination a.next { text-align: right; }
.article-pagination small, .article-pagination span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article-pagination small { margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.reader-toast { position: fixed; z-index: 80; right: 24px; bottom: 24px; padding: 9px 13px; border: 1px solid #b8d8d5; border-radius: 5px; color: #205b57; background: #f0fbfa; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .16s ease, transform .16s ease; }
.reader-toast.show { opacity: 1; transform: translateY(0); }
.on-page-toc { position: sticky; top: 104px; max-height: calc(100vh - 130px); padding: 12px 22px 24px 0; overflow: auto; }
.on-page-toc > p { margin: 0 0 10px; color: var(--text); font-size: 12px; font-weight: 750; }
.on-page-toc a { display: block; margin: 2px 0; padding: 4px 7px 4px calc(7px + var(--toc-indent, 0px)); border-left: 2px solid transparent; color: var(--muted); font-size: 12px; line-height: 1.5; text-decoration: none; transition: padding-left .15s ease, color .15s ease; }
.on-page-toc a.level-1 { --toc-indent: 0px; color: var(--text-soft); font-weight: 700; }
.on-page-toc a.level-2 { --toc-indent: 14px; }
.on-page-toc a.level-3 { --toc-indent: 28px; font-size: 11.5px; }
.on-page-toc a.level-4 { --toc-indent: 42px; font-size: 11.5px; }
.on-page-toc a:hover, .on-page-toc a.active { border-left-color: var(--primary); color: var(--primary); }
.mobile-nav-toggle { display: none; }
.image-lightbox { position: fixed; z-index: 300; inset: 0; padding: 58px 28px 28px; display: grid; place-items: center; background: rgba(8, 17, 29, .9); }
.image-lightbox img { max-width: min(1500px, 96vw); max-height: calc(100vh - 90px); object-fit: contain; border-radius: 4px; box-shadow: 0 24px 70px rgba(0, 0, 0, .4); }
.image-lightbox-close { position: fixed; top: 16px; right: 20px; width: 38px; height: 38px; padding: 0; border: 1px solid rgba(255,255,255,.4); border-radius: 4px; color: #fff; background: rgba(0,0,0,.28); font-size: 27px; line-height: 34px; }
.image-lightbox-close:hover { border-color: #fff; background: rgba(0,0,0,.55); }

/* Login */
.login-page { min-height: 100vh; background: #f2f7fa; }
.login-shell { min-height: calc(100vh - 70px); padding: 60px 20px; display: grid; place-items: start center; }
.login-panel { width: min(420px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: var(--shadow); }
.login-mark { width: 42px; height: 42px; margin-bottom: 22px; border-radius: 7px; font-size: 20px; }
.login-panel h1 { margin: 0; font-size: 28px; }
.login-panel > p:not(.eyebrow) { margin: 8px 0 25px; color: var(--text-soft); }
.login-form { display: grid; gap: 17px; }
.login-form label, .settings-form label, .import-fields label, .summary-field, .inline-fields > label { display: grid; gap: 6px; color: var(--text-soft); font-size: 13px; font-weight: 650; }
.login-form input, .settings-form input, .import-fields input, .inline-fields input, .summary-field textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 5px; outline: 0; background: #fff; font-weight: 400; }
.login-form input, .settings-form input, .import-fields input, .inline-fields input { height: 41px; padding: 0 11px; }
.login-form input:focus, .settings-form input:focus, .import-fields input:focus, .inline-fields input:focus, .summary-field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.11); }
.login-back { margin-top: 24px; font-size: 13px; }
.alert { margin: 0 0 18px; padding: 10px 12px; border-radius: 5px; font-size: 13px; }
.alert-error { color: #922b2b; background: var(--danger-soft); }

/* Admin */
.admin-page { background: #f4f7fa; }
.admin-shell { width: min(1600px, calc(100% - 28px)); margin: 0 auto; padding: 22px 0 50px; }
.admin-toolbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-toolbar h1 { margin: 0; font-size: 24px; line-height: 1.2; }
.admin-toolbar .eyebrow { margin-bottom: 4px; }
.admin-actions { display: flex; align-items: center; gap: 8px; }
.settings-symbol { margin-right: 5px; }
.admin-layout { height: calc(100vh - 180px); min-height: 620px; display: grid; grid-template-columns: 290px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 8px 24px rgba(37, 62, 89, 0.055); }
.admin-sidebar { display: flex; min-width: 0; flex-direction: column; border-right: 1px solid var(--line); background: #fafbfd; }
.sidebar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 14px 12px 10px; }
.new-related-button { padding-right: 8px; padding-left: 8px; font-size: 12px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--text-soft); background: #fff; font-size: 21px; line-height: 1; }
.icon-button:hover { border-color: #aac3e3; color: var(--primary); background: var(--primary-soft); }
.sidebar-search { position: relative; display: block; padding: 0 12px 11px; }
.sidebar-search .search-icon { left: 25px; transform: translateY(-58%) scale(0.82); }
.sidebar-search input { height: 36px; padding: 0 10px 0 35px; border-radius: 5px; font-size: 13px; }
.admin-doc-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 7px 12px; }
.admin-category-group { margin: 0 0 5px; }
.admin-category-header { width: 100%; min-height: 36px; padding: 3px 4px; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 2px; border: 1px solid transparent; border-radius: 5px; color: var(--text); background: transparent; }
.admin-category-header:hover, .admin-category-header:focus-within { background: #f0f5fb; }
.admin-category-header[draggable="true"] { cursor: grab; }
.admin-category-header[draggable="true"]:active { cursor: grabbing; }
.admin-category-toggle { min-width: 0; min-height: 28px; padding: 3px; display: grid; grid-template-columns: 16px 16px minmax(0, 1fr) auto; align-items: center; gap: 5px; border: 0; color: inherit; background: transparent; text-align: left; }
.admin-category-toggle:hover { color: var(--primary); }
.admin-category-toggle strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.category-actions { display: flex; align-items: center; gap: 1px; }
.category-actions button { width: 24px; height: 26px; padding: 0; border: 0; border-radius: 3px; color: #7d8da1; background: transparent; font-size: 15px; line-height: 1; }
.category-actions button:hover { color: var(--primary); background: #fff; }
.category-actions .delete-category-button:hover { color: var(--danger); background: var(--danger-soft); }
.category-drag-handle { width: 22px; height: 28px; padding: 0; border: 0; color: #98a4b3; background: transparent; font-size: 15px; cursor: grab; }
.category-drag-handle:active, .drag-handle:active { cursor: grabbing; }
.category-chevron { color: var(--muted); font-size: 14px; line-height: 1; transition: transform .16s ease; }
.admin-category-group.collapsed .category-chevron { transform: rotate(-90deg); }
.category-folder { position: relative; width: 14px; height: 10px; border: 1px solid #91a4bb; border-radius: 2px; background: #edf3f9; }
.category-folder::before { position: absolute; top: -4px; left: 1px; width: 7px; height: 3px; content: ""; border: 1px solid #91a4bb; border-bottom: 0; border-radius: 2px 2px 0 0; background: #edf3f9; }
.category-count { min-width: 20px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 9px; color: var(--muted); background: #edf1f5; font-size: 10px; }
.admin-category-items { position: relative; margin-left: 14px; padding-left: 10px; }
.admin-category-items::before { position: absolute; top: 0; bottom: 4px; left: 4px; width: 1px; content: ""; background: #dfe6ee; }
.admin-category-group.collapsed .admin-category-items { display: none; }
.admin-doc-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) 42px; align-items: center; gap: 3px; margin: 2px 0; padding: 6px 4px; border: 1px solid transparent; border-radius: 5px; }
.admin-doc-item:hover { background: #f2f5f8; }
.admin-doc-item.active { border-color: #c7daf3; background: var(--primary-soft); }
.drag-handle { width: 24px; height: 30px; padding: 0; border: 0; color: #98a4b3; background: transparent; font-size: 16px; cursor: grab; }
.doc-item-main { min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; }
.doc-item-main strong, .doc-item-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-item-main strong { font-size: 13px; }
.doc-item-main small { color: var(--muted); font-size: 11px; }
.doc-status { width: 7px; height: 7px; display: inline-block; margin-right: 5px; border-radius: 50%; background: #aeb7c2; }
.doc-status.published { background: var(--teal); }
.move-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; }
.move-buttons button { width: 20px; height: 27px; padding: 0; border: 0; border-radius: 3px; color: #8593a5; background: transparent; line-height: 1; }
.move-buttons button:hover { color: var(--primary); background: #fff; }
.admin-doc-item.dragging { opacity: 0.42; }
.admin-category-group.dragging { opacity: 0.42; }
.admin-doc-item.drag-over { border-top-color: var(--primary); }
.admin-category-header.drag-over { border-color: #9bbce7; background: var(--primary-soft); }
.admin-category-group.drag-before { box-shadow: inset 0 2px 0 var(--primary); }
.admin-category-group.drag-after { box-shadow: inset 0 -2px 0 var(--primary); }
.editor-panel { min-width: 0; min-height: 0; overflow: auto; background: #fff; }
.editor-empty { height: 100%; display: grid; place-content: center; color: var(--muted); text-align: center; }
.editor-empty h2 { margin: 0; color: var(--text-soft); font-size: 19px; }
.editor-empty p { margin: 7px 0; }
#editorForm { min-height: 100%; }
.editor-top-row { padding: 21px 24px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.editor-title-block { min-width: 0; flex: 1; }
.title-field { display: grid; gap: 6px; color: var(--text-soft); font-size: 13px; font-weight: 700; }
.title-input { width: 100%; min-height: 49px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 5px; outline: 0; color: var(--text); background: #fff; font-size: 25px; font-weight: 760; line-height: 1.35; }
.title-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.11); }
.inline-fields { margin-top: 14px; display: grid; grid-template-columns: minmax(150px, 0.7fr) minmax(170px, 1fr) auto; align-items: end; gap: 12px; }
.inline-fields input { height: 35px; font-size: 13px; }
.slug-field { min-width: 0; }
.share-link-tools { min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; }
.share-link-tools code { min-width: 0; flex: 1; overflow: hidden; color: var(--muted); font-family: Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.share-link-tools button, .share-link-tools a { flex: 0 0 auto; padding: 1px 5px; border: 0; border-radius: 3px; color: var(--primary); background: var(--primary-soft); font-size: 11px; line-height: 20px; text-decoration: none; }
.share-link-tools button:hover, .share-link-tools a:hover { color: #fff; background: var(--primary); }
.share-link-tools a[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.publish-toggle { min-width: 104px; height: 35px; display: flex !important; align-items: center; grid-auto-flow: column; justify-content: start; gap: 8px !important; white-space: nowrap; }
.publish-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.publish-toggle span { position: relative; width: 34px; height: 19px; display: inline-block; border-radius: 12px; background: #bac3cf; transition: background 0.15s; }
.publish-toggle span::after { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; content: ""; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.publish-toggle input:checked + span { background: var(--teal); }
.publish-toggle input:checked + span::after { transform: translateX(15px); }
.save-group { display: flex; align-items: center; gap: 8px; }
.preview-button { display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.save-status { color: var(--muted); font-size: 12px; white-space: nowrap; }
.save-status.changed { color: var(--amber); }
.save-status.saved { color: var(--teal); }
.danger-button { color: var(--danger); }
.danger-button:hover { border-color: #edbcbc; color: var(--danger); background: var(--danger-soft); }
.summary-field { padding: 0 24px 14px; }
.summary-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.summary-generate { padding: 2px 7px; border: 0; border-radius: 4px; color: var(--primary); background: transparent; font-size: 12px; }
.summary-generate:hover { background: var(--primary-soft); }
.summary-field textarea { min-height: 58px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.rich-toolbar { position: sticky; z-index: 10; top: 0; min-height: 48px; padding: 7px 11px; display: flex; flex-wrap: wrap; align-items: center; gap: 3px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f8fafc; box-shadow: 0 3px 8px rgba(37,62,89,0.03); }
.tool-select, .format-button, .color-tool { height: 32px; border: 1px solid transparent; border-radius: 4px; background: transparent; }
.tool-select { max-width: 110px; padding: 0 22px 0 7px; color: var(--text-soft); font-size: 12px; }
.size-select { width: 62px; }
.format-button { min-width: 32px; padding: 0 7px; color: #405268; }
.format-button:hover, .tool-select:hover, .color-tool:hover { border-color: var(--line); background: #fff; }
.format-button.active { color: var(--primary); background: var(--primary-soft); }
.list-button { font-size: 15px; }
.code-button { font-family: Consolas, monospace; font-size: 11px; }
.media-button { color: var(--teal); font-weight: 700; }
.column-button { color: var(--primary); font-size: 16px; }
.tool-divider { width: 1px; height: 22px; margin: 0 4px; background: var(--line); }
.color-picker { position: relative; }
.color-tool { position: relative; width: 42px; display: flex; align-items: center; justify-content: center; gap: 5px; font-weight: 700; }
.color-tool::after { position: absolute; right: 16px; bottom: 4px; left: 8px; height: 3px; content: ""; background: #f4c430; }
.color-chevron { margin-top: 1px; color: var(--muted); font-size: 12px; font-weight: 400; }
.color-palette { position: absolute; z-index: 30; top: 37px; left: 0; width: 238px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 12px 34px rgba(28, 45, 68, .16); }
.color-palette p { margin: 0 0 6px; color: var(--text-soft); font-size: 11px; font-weight: 700; }
.color-palette p:not(:first-child) { margin-top: 11px; }
.color-swatches { display: grid; grid-template-columns: repeat(8, 24px); gap: 4px; }
.text-color-swatch, .background-color-swatch { width: 24px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 3px; background: #fff; }
.text-color-swatch { color: var(--swatch); font-size: 15px; font-weight: 750; line-height: 22px; }
.background-color-swatch { background: var(--swatch); }
.text-color-swatch:hover, .background-color-swatch:hover { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.background-color-swatch.no-color { position: relative; background: #fff; }
.background-color-swatch.no-color::after { position: absolute; top: 11px; left: 2px; width: 19px; height: 1px; content: ""; background: #dc2626; transform: rotate(-38deg); }
.btn-paste { min-height: 30px; margin-left: auto; padding: 6px 10px; border-color: #b8dad7; color: var(--teal); background: var(--teal-soft); font-size: 12px; }
.column-layout-panel { position: sticky; z-index: 9; top: 48px; min-height: 54px; padding: 8px 12px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #b9d5f4; background: #f0f6ff; box-shadow: 0 3px 8px rgba(37,62,89,.04); }
.column-layout-panel > strong { margin-right: 3px; color: var(--text-soft); font-size: 12px; }
.column-layout-panel > button:not(.column-panel-close) { min-width: 78px; height: 38px; padding: 4px 8px; display: flex; align-items: center; gap: 7px; border: 1px solid #b9cce2; border-radius: 5px; color: var(--text-soft); background: #fff; font-size: 12px; }
.column-layout-panel > button:not(.column-panel-close):hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.column-layout-preview { width: 37px; height: 24px; display: grid; gap: 3px; }
.column-layout-preview.equal { grid-template-columns: 1fr 1fr; }
.column-layout-preview.left-narrow { grid-template-columns: 1fr 2fr; }
.column-layout-preview.right-narrow { grid-template-columns: 2fr 1fr; }
.column-layout-preview i { display: block; border: 1px solid #94b8e7; border-radius: 2px; background: #dceaff; }
.column-panel-close { width: 30px; height: 34px; margin-left: auto; padding: 0; border: 0; border-radius: 4px; color: var(--muted); background: transparent; font-size: 22px; }
.column-panel-close:hover { color: var(--danger); background: var(--danger-soft); }
.media-url-panel { position: sticky; z-index: 9; top: 48px; padding: 9px 12px; display: grid; grid-template-columns: 32px minmax(220px, 1fr) auto auto 30px; align-items: end; gap: 8px; border-bottom: 1px solid #b9d5f4; background: #f0f6ff; box-shadow: 0 3px 8px rgba(37,62,89,.04); }
.media-url-panel label { display: grid; gap: 3px; color: var(--text-soft); font-size: 11px; font-weight: 700; }
.media-url-panel input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid #aabdd3; border-radius: 4px; outline: 0; background: #fff; font-size: 13px; font-weight: 400; }
.media-url-panel input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23,105,224,.1); }
.media-panel-icon { width: 32px; height: 34px; display: grid; place-items: center; border-radius: 4px; color: #fff; background: var(--teal); font-size: 13px; font-weight: 800; }
.media-insert-button, .media-upload-button { min-height: 34px; white-space: nowrap; }
.media-panel-close { width: 30px; height: 34px; padding: 0; border: 0; border-radius: 4px; color: var(--muted); background: transparent; font-size: 22px; }
.media-panel-close:hover { color: var(--danger); background: var(--danger-soft); }
.rich-editor { width: min(900px, calc(100% - 48px)); min-height: 660px; margin: 0 auto; padding: 36px 28px 100px; outline: 0; color: #26364a; font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
.rich-editor:empty::before, .import-paste:empty::before { color: #a0aab7; content: attr(data-placeholder); pointer-events: none; }
.rich-editor h1 { margin: 34px 0 14px; font-size: 28px; }
.rich-editor h2 { margin: 30px 0 12px; font-size: 23px; }
.rich-editor h3 { margin: 24px 0 9px; font-size: 19px; }
.rich-editor h4 { margin: 20px 0 7px; font-size: 16px; }
.rich-editor p { margin: 0 0 14px; }
.rich-editor blockquote { margin: 18px 0; padding: 11px 15px; border-left: 3px solid var(--teal); background: var(--teal-soft); }
.rich-editor pre { padding: 14px; border-radius: 5px; background: #f2f4f6; white-space: pre-wrap; }
.rich-editor img { display: block; max-width: 100%; height: auto; margin: 18px auto; border-radius: 5px; }
.rich-editor video { display: block; width: 100%; max-height: 520px; margin: 18px 0; border-radius: 5px; background: #111; }
.media-insertion-marker { width: 100%; min-height: 46px; margin: 12px 0; padding: 9px 12px; display: flex; align-items: center; justify-content: center; border: 1px dashed #3a8ee6; border-radius: 5px; color: #1769e0; background: #f0f6ff; font-size: 13px; font-weight: 700; line-height: 1.4; }
.media-insertion-marker::before { margin-right: 7px; content: "+"; font-size: 18px; font-weight: 500; }
.editor-media { position: relative; width: 100%; max-width: 100%; margin: 18px 0; display: block; border: 1px solid transparent; border-radius: 6px; line-height: 1; transition: border-color .15s, box-shadow .15s, opacity .15s; }
.editor-media.media-sized:not(.media-grid-item) { margin-right: auto; margin-left: auto; }
.editor-media.media-grid-item { margin: 6px 3px 14px; display: inline-block; box-sizing: border-box; vertical-align: top; }
.editor-media:hover, .editor-media.selected { border-color: #84b5e8; box-shadow: 0 0 0 3px rgba(23,105,224,.09); }
.editor-media.dragging { opacity: .48; }
.editor-media > img { width: 100% !important; max-width: 100%; margin: 0 auto; }
.editor-media > video { width: 100% !important; margin: 0; }
.rich-editor .media-row { margin: 18px 0; gap: 10px; }
.rich-editor .media-row > .editor-media { width: 100% !important; min-width: 0; margin: 0; display: block; }
.rich-editor .media-row > .editor-media > img, .rich-editor .media-row > .editor-media > video { width: 100% !important; height: auto; margin: 0; }
.rich-editor .media-row .media-resize-handle, .rich-editor .media-row .media-resize-label { display: none; }
.editor-media-toolbar { position: absolute; z-index: 4; top: 8px; right: 8px; height: 30px; padding: 2px; display: flex; align-items: center; gap: 1px; border: 1px solid #cbd7e5; border-radius: 5px; background: rgba(255,255,255,.96); box-shadow: 0 4px 14px rgba(31,53,78,.15); line-height: 1; }
.editor-media-toolbar button { width: 26px; height: 24px; padding: 0; border: 0; border-radius: 3px; color: #405268; background: transparent; font-size: 14px; line-height: 24px; }
.editor-media-toolbar button:hover { color: var(--primary); background: var(--primary-soft); }
.editor-media-toolbar .media-drag-handle { width: 30px; cursor: grab; font-size: 12px; letter-spacing: 0; }
.editor-media-toolbar .media-drag-handle:active { cursor: grabbing; }
.media-layout-select { width: 50px; height: 24px; padding: 0 3px; border: 0; border-radius: 3px; outline: 0; color: #405268; background: #f3f6f9; font-size: 11px; }
.media-layout-select:focus { box-shadow: 0 0 0 2px rgba(23,105,224,.16); }
.editor-media-toolbar .media-delete-button { color: var(--danger); font-size: 20px; }
.editor-media-toolbar .media-delete-button:hover { color: #fff; background: var(--danger); }
.media-resize-handle { position: absolute; z-index: 5; right: 5px; bottom: 5px; width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #b6c9df; border-radius: 4px; color: var(--primary); background: rgba(255,255,255,.96); box-shadow: 0 3px 10px rgba(31,53,78,.14); cursor: nwse-resize; font-size: 14px; line-height: 1; touch-action: none; }
.media-resize-handle:hover, .media-resize-handle:focus { border-color: var(--primary); outline: 0; background: var(--primary-soft); }
.media-resize-label { position: absolute; z-index: 5; right: 35px; bottom: 6px; min-width: 42px; padding: 5px 7px; border-radius: 4px; color: #fff; background: rgba(32,49,69,.84); font-size: 11px; line-height: 1; text-align: center; opacity: 0; pointer-events: none; }
.editor-media.resizing .media-resize-label { opacity: 1; }
.media-pointer-dragging, .media-pointer-dragging * { cursor: grabbing !important; user-select: none !important; }
.media-pointer-resizing, .media-pointer-resizing * { cursor: nwse-resize !important; user-select: none !important; }
.doc-columns-editor { position: relative; margin: 22px 0; padding: 8px; gap: 10px; border: 1px dashed #a9bfd8; border-radius: 6px; background: #f9fbfd; }
.doc-columns-editor > .column-layout-toolbar { grid-column: 1 / -1; min-height: 30px; padding: 2px 4px 5px; display: flex; align-items: center; justify-content: flex-end; gap: 5px; border-bottom: 1px solid #dde6ef; color: var(--primary); }
.column-layout-toolbar select { height: 25px; padding: 0 5px; border: 1px solid #c4d2e1; border-radius: 4px; color: var(--text-soft); background: #fff; font-size: 11px; }
.column-layout-toolbar button { width: 26px; height: 25px; padding: 0; border: 0; border-radius: 3px; color: var(--danger); background: transparent; font-size: 18px; }
.column-layout-toolbar button:hover { color: #fff; background: var(--danger); }
.doc-columns-editor > .doc-column { min-height: 110px; padding: 10px; border: 1px dashed #cad6e3; border-radius: 5px; background: #fff; }
.doc-column .editor-media { max-width: 100%; margin-top: 0; margin-bottom: 0; }
.doc-column .editor-media > img, .doc-column .editor-media > video { width: 100% !important; }
.media-drop-zone { position: relative; z-index: 12; width: 100%; height: 10px; margin: -5px 0; display: block; clear: both; pointer-events: none; }
.media-drop-zone i { position: absolute; top: 4px; right: 0; left: 0; border-top: 2px solid rgba(23,105,224,.28); opacity: 0; }
.media-drop-zone small { position: absolute; z-index: 2; top: 50%; left: 50%; padding: 3px 7px; border-radius: 3px; color: #fff; background: var(--primary); font-size: 10px; line-height: 1; white-space: nowrap; opacity: 0; transform: translate(-50%, -50%); }
.media-pointer-dragging .media-drop-zone i { opacity: .75; }
.media-pointer-dragging .media-drop-zone.active { height: 22px; margin: -11px 0; }
.media-pointer-dragging .media-drop-zone.active i { top: 10px; border-top-width: 3px; border-top-color: var(--primary); opacity: 1; }
.media-pointer-dragging .media-drop-zone.active small { opacity: 1; }
.media-pointer-dragging .doc-column { background: #f6faff; }
.media-pointer-dragging .doc-column > .media-drop-zone:last-child { min-height: 34px; margin: 0; }
.rich-editor table { width: 100%; border-collapse: collapse; }
.rich-editor th, .rich-editor td { padding: 8px; border: 1px solid var(--line); }

/* Modals and feedback */
.modal-backdrop { position: fixed; z-index: 100; inset: 0; padding: 24px; display: grid; place-items: center; background: rgba(18, 31, 47, 0.48); }
.modal { width: min(620px, 100%); max-height: calc(100vh - 48px); padding: 24px; overflow-y: auto; border-radius: 7px; background: #fff; box-shadow: 0 24px 70px rgba(13, 26, 42, 0.26); }
.import-modal { width: min(860px, 100%); }
.modal-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.modal-header h2 { margin: 0; font-size: 23px; }
.modal-close { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 4px; color: var(--text-soft); background: transparent; font-size: 25px; line-height: 1; }
.modal-close:hover { color: var(--danger); background: var(--danger-soft); }
.modal-copy { margin: 12px 0 18px; color: var(--text-soft); }
.import-fields { display: grid; grid-template-columns: 0.55fr 1fr; gap: 12px; }
.import-paste { min-height: 300px; max-height: 48vh; margin-top: 16px; padding: 20px; overflow-y: auto; border: 1px dashed #9fb8d1; border-radius: 5px; outline: 0; background: #fbfdff; line-height: 1.75; }
.import-paste:focus { border-style: solid; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23,105,224,0.1); }
.import-paste img { max-width: 100%; height: auto; }
.import-preview-note { margin-top: 8px; color: var(--muted); font-size: 12px; }
.modal-footer { margin-top: 22px; display: flex; justify-content: flex-end; gap: 8px; }
.settings-form { display: grid; gap: 15px; margin-top: 20px; }
.settings-form small { color: var(--muted); font-weight: 400; }
.toast-region { position: fixed; z-index: 200; right: 22px; bottom: 22px; display: grid; gap: 8px; }
.toast { min-width: 240px; max-width: 390px; padding: 11px 14px; border: 1px solid #b8d8d5; border-radius: 5px; color: #205b57; background: #f0fbfa; box-shadow: var(--shadow); }
.toast.error { border-color: #efc4c4; color: #8a2828; background: #fff4f4; }
.upload-progress { color: var(--primary); }

/* Errors */
.error-shell { min-height: calc(100vh - 70px); padding: 80px 20px; text-align: center; }
.error-code { margin: 0; color: var(--primary); font-size: 64px; font-weight: 800; line-height: 1; }
.error-shell h1 { margin: 16px 0 7px; }
.error-shell > p:not(.error-code) { margin: 0 0 24px; color: var(--text-soft); }

@media (max-width: 1120px) {
  .doc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .reader-shell { grid-template-columns: 230px minmax(0, 1fr); }
  .on-page-toc { display: none; }
  .standalone-reader-shell { grid-template-columns: minmax(0, 1fr) 185px; }
  .standalone-reader-shell .on-page-toc { display: block; }
  .admin-layout { grid-template-columns: 260px minmax(0, 1fr); }
  .editor-top-row { flex-direction: column; }
  .save-group { width: 100%; justify-content: flex-end; }
}

@media (max-width: 900px) {
  .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .standalone-reader-shell { display: block; }
  .standalone-reader-shell .on-page-toc { display: none; }
}

@media (max-width: 760px) {
  .site-header { height: 60px; }
  .header-inner { width: calc(100% - 28px); }
  .brand { font-size: 15px; }
  .brand-mark { width: 29px; height: 29px; }
  .header-nav a:first-child { display: none; }
  .header-nav a { padding: 6px 5px; font-size: 13px; }
  .home-shell { width: calc(100% - 28px); padding: 36px 0 60px; }
  .home-intro h1 { font-size: 29px; }
  .home-intro > p:not(.eyebrow) { font-size: 14px; }
  .filter-row { display: block; }
  .filter-label { margin-bottom: 6px; }
  .doc-grid { grid-template-columns: 1fr; gap: 10px; margin-top: 23px; }
  .doc-card { min-height: 132px; padding: 16px; }
  .search-box kbd { display: none; }
  .search-box input { padding-right: 12px; }

  .reader-shell { width: 100%; min-height: calc(100vh - 60px); margin: 0; display: block; border: 0; border-radius: 0; }
  .mobile-nav-toggle { position: sticky; z-index: 35; top: 60px; width: 100%; height: 42px; padding: 0 17px; display: flex; align-items: center; gap: 9px; border: 0; border-bottom: 1px solid var(--line); color: var(--text-soft); background: #f9fbfd; }
  .menu-lines, .menu-lines::before, .menu-lines::after { width: 15px; height: 2px; display: block; background: currentColor; }
  .menu-lines { position: relative; }
  .menu-lines::before, .menu-lines::after { position: absolute; left: 0; content: ""; }
  .menu-lines::before { top: -5px; }
  .menu-lines::after { top: 5px; }
  .doc-navigation { position: fixed; z-index: 40; top: 102px; bottom: 0; left: 0; width: min(310px, 86vw); height: auto; border-right: 1px solid var(--line); box-shadow: 14px 0 32px rgba(37, 62, 89, 0.15); transform: translateX(-105%); transition: transform 0.2s ease; }
  .doc-navigation.open { transform: translateX(0); }
  .article-wrap { padding: 27px 19px 70px; }
  .article-utility-row { align-items: flex-start; }
  .article-actions button { padding: 3px 5px; }
  .breadcrumb { margin-top: 20px; }
  .article-wrap > h1 { font-size: 27px; }
  .article-content { font-size: 15px; }
  .article-content h1 { font-size: 24px; }
  .article-content h2 { font-size: 21px; }
  .article-pagination { grid-template-columns: 1fr; margin-top: 38px; }
  .article-pagination > span:empty { display: none; }

  .login-shell { min-height: calc(100vh - 60px); padding: 28px 14px; }
  .login-panel { padding: 27px 22px; }

  .admin-shell { width: 100%; padding: 10px 0 0; }
  .admin-toolbar { padding: 0 13px 10px; }
  .admin-toolbar h1 { font-size: 20px; }
  .admin-actions .settings-symbol { margin: 0; }
  .admin-actions .btn-secondary { width: 38px; padding: 0; overflow: hidden; color: transparent; }
  .admin-actions .settings-symbol { color: var(--text-soft); }
  .admin-layout { height: auto; min-height: calc(100vh - 130px); display: block; border-right: 0; border-left: 0; border-radius: 0; }
  .admin-sidebar { height: 285px; border-right: 0; border-bottom: 1px solid var(--line); }
  .editor-panel { min-height: 650px; }
  .editor-top-row { padding: 18px 15px 12px; }
  .title-input { font-size: 23px; }
  .inline-fields { grid-template-columns: 1fr; }
  .save-group { flex-wrap: wrap; }
  .save-status { margin-right: auto; }
  .summary-field { padding: 0 15px 13px; }
  .rich-toolbar { top: 60px; padding: 6px; }
  .media-url-panel { position: relative; top: auto; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: end; }
  .column-layout-panel { position: relative; top: auto; flex-wrap: wrap; }
  .column-layout-panel > strong { width: 100%; }
  .media-url-panel label { grid-column: 2; }
  .media-panel-icon { grid-row: 1; grid-column: 1; }
  .media-panel-close { grid-row: 1; grid-column: 3; }
  .media-insert-button { grid-column: 1 / 3; }
  .media-upload-button { min-width: 70px; grid-column: 3; padding-right: 7px; padding-left: 7px; font-size: 12px; }
  .color-palette { position: fixed; top: 108px; left: 50%; transform: translateX(-50%); }
  .tool-select { max-width: 92px; }
  .btn-paste { margin-left: 0; }
  .rich-editor { width: 100%; min-height: 540px; padding: 27px 17px 70px; }
  .editor-media-toolbar { top: 6px; right: 6px; }
  .editor-media.media-sized, .editor-media.media-grid-item { width: 100% !important; margin: 14px 0; display: block; }
  .article-content > .media-sized, .article-content > .media-grid-item { width: 100% !important; margin: 16px 0; display: block; }
  .media-row, .media-row-2, .media-row-3, .media-row.media-row-items-2 { grid-template-columns: 1fr; gap: 12px; }
  .doc-columns, .doc-columns-equal, .doc-columns-left-narrow, .doc-columns-right-narrow { grid-template-columns: 1fr; gap: 14px; }
  .modal-backdrop { padding: 10px; align-items: end; }
  .modal { max-height: 92vh; padding: 20px 16px; border-radius: 7px 7px 0 0; }
  .import-fields { grid-template-columns: 1fr; }
  .import-paste { min-height: 250px; }
  .toast-region { right: 10px; bottom: 10px; left: 10px; }
  .toast { min-width: 0; max-width: none; }
}

@media print {
  .site-header, .doc-navigation, .on-page-toc, .mobile-nav-toggle, .article-utility-row, .article-pagination, .reader-toast, .code-copy-button, .image-lightbox { display: none !important; }
  body, .reader-page, .reader-shell { background: #fff !important; }
  .reader-shell { width: 100%; min-height: 0; margin: 0; display: block; border: 0; }
  .article-wrap { width: 100%; padding: 0; }
  .article-content a { color: #000; text-decoration: underline; }
}
