:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: #f2f4f7;
  --ink: #20242a;
  --ink-soft: #4d5560;
  --muted: #737b86;
  --line: #d9dee5;
  --line-strong: #b7c0cc;
  --brand: #c90b3f;
  --brand-deep: #8f082f;
  --brand-soft: #f9e8ee;
  --success: #2f6f5e;
  --warning: #a15c16;
  --shadow: 0 14px 38px rgba(25, 34, 45, 0.09);
  --radius: 8px;
  --topbar-height: 76px;
  --admin-text: 14px;
  --admin-small: 13px;
  --admin-title: 20px;
  --admin-section-title: 16px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", SimSun, "STSong", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

body.secure-reader,
body.secure-reader .markdown-body,
body.secure-reader .document-list,
body.secure-reader .outline {
  user-select: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

input {
  user-select: text;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(201, 11, 63, 0.16);
}

:focus-visible {
  outline: 3px solid rgba(201, 11, 63, 0.26);
  outline-offset: 2px;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 36px 22px;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 248, 250, 0.92)),
    var(--bg);
}

.locked-preview {
  position: absolute;
  inset: auto auto 6vh 50%;
  z-index: 1;
  width: min(880px, 82vw);
  min-height: 420px;
  transform: translateX(-50%);
  opacity: 0.28;
  pointer-events: none;
}

.preview-shell {
  display: grid;
  grid-template-columns: 260px 1fr 190px;
  gap: 14px;
  height: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  filter: blur(2px);
}

.preview-sidebar,
.preview-doc,
.preview-outline {
  min-height: 340px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.preview-doc {
  min-height: 390px;
}

.auth-panel,
.admin-login {
  position: relative;
  z-index: 2;
  width: min(560px, 100%);
  padding: 42px 44px 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-logo,
.admin-login img {
  display: block;
  width: min(260px, 62%);
  height: auto;
  margin-bottom: 30px;
}

.auth-kicker,
.auth-copy,
.brand p,
.top-meta,
.outline-head p,
.admin-login p,
.admin-head p,
.admin-upload p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.auth-kicker,
.brand p,
.admin-login p,
.admin-head p {
  color: var(--brand-deep);
  font-weight: 700;
}

.auth-panel h1,
.admin-login h1 {
  max-width: 390px;
  margin: 8px 0 12px;
  font-size: 36px;
  line-height: 1.2;
}

.auth-copy {
  max-width: 360px;
  margin-bottom: 24px;
  color: var(--ink-soft);
  font-size: 16px;
}

.auth-form,
.admin-form {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.auth-form label,
.admin-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.auth-row,
.admin-login-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.auth-row input,
.admin-login-row input {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-row input:focus,
.admin-login-row input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(201, 11, 63, 0.12);
}

.auth-row button,
.top-meta button,
.admin-login-row button,
.upload-form button,
.admin-logout,
.admin-doc-table a,
.admin-doc-table button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 160ms ease, transform 160ms ease;
}

.auth-row button,
.admin-login-row button,
.upload-form button {
  min-height: 46px;
  padding: 0 20px;
}

.auth-row button:hover,
.top-meta button:hover,
.admin-login-row button:hover,
.upload-form button:hover,
.admin-logout:hover,
.admin-doc-table a:hover,
.admin-doc-table button:hover {
  background: var(--brand-deep);
}

.auth-row button:active,
.top-meta button:active,
.admin-login-row button:active,
.upload-form button:active,
.admin-logout:active,
.admin-doc-table a:active,
.admin-doc-table button:active {
  transform: translateY(1px);
}

.auth-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--brand-deep);
  font-size: 14px;
  white-space: pre-line;
}

body.modal-open {
  overflow: hidden;
}

.admin-login-dialog {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
}

.admin-login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 36, 42, 0.42);
}

.admin-login-modal {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  padding: 30px 32px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-login-modal h2 {
  margin: 8px 0 18px;
  font-size: 26px;
  line-height: 1.25;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.modal-close:hover {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--topbar-height);
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand img {
  width: 170px;
  max-width: 34vw;
  height: auto;
  flex: 0 0 auto;
}

.brand h1 {
  margin: 2px 0 0;
  font-size: 21px;
  line-height: 1.25;
  white-space: nowrap;
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.top-meta button {
  min-height: 34px;
  padding: 0 13px;
}

.top-meta .nav-toggle {
  display: none;
}

.workspace {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 210px;
  gap: 0;
  height: calc(100vh - var(--topbar-height));
  min-height: 0;
}

.policy-nav,
.reader,
.outline {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.policy-nav,
.outline {
  background: var(--surface);
}

.policy-nav {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

.library {
  min-height: 0;
  padding: 14px 12px 18px;
  overflow: auto;
}

.document-list {
  display: grid;
  gap: 16px;
}

.home-nav-card {
  width: 100%;
  min-height: 72px;
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px 12px 13px;
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.home-nav-card span {
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.home-nav-card strong {
  font-size: 15px;
  line-height: 1.45;
}

.home-nav-card:hover,
.home-nav-card.is-active {
  border-color: var(--line);
  border-left-color: var(--brand);
  background: var(--surface-soft);
  color: var(--brand-deep);
}

.document-group {
  display: grid;
  gap: 6px;
}

.document-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 6px 7px;
  border-bottom: 1px solid var(--line);
}

.document-group-title h2 {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.4;
}

.document-group-title span {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.document-card {
  width: 100%;
  min-height: 72px;
  padding: 10px 10px 11px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.document-card:hover,
.document-card.is-active {
  border-color: var(--line);
  border-left-color: var(--brand);
  background: var(--surface-soft);
  color: var(--brand-deep);
}

.document-card h3 {
  margin: 0 0 7px;
  font-size: 14px;
  line-height: 1.45;
}

.doc-meta,
.admin-doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.doc-meta span,
.admin-doc-meta span {
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.reader {
  position: relative;
  overflow: auto;
  background: var(--bg);
}

.reader-empty {
  min-height: 420px;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--muted);
}

.reader-welcome {
  width: min(620px, 100%);
  padding-left: 28px;
  border-left: 4px solid var(--brand);
}

.reader-welcome p {
  margin: 0 0 8px;
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.reader-welcome h2 {
  margin: 0;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.25;
}

.reader-welcome span {
  display: block;
  max-width: 520px;
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.8;
}

.markdown-body {
  position: relative;
  max-width: 980px;
  margin: 28px auto 42px;
  padding: 36px 46px 78px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(25, 34, 45, 0.03);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.86;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  scroll-margin-top: 100px;
  color: var(--ink);
  line-height: 1.45;
}

.markdown-body h1 {
  margin: 0 0 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--ink);
  font-size: 28px;
}

.markdown-body h2 {
  margin: 34px 0 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 21px;
}

.markdown-body h3 {
  margin: 22px 0 9px;
  font-size: 18px;
}

.markdown-body h4 {
  margin: 16px 0 7px;
  font-size: 16px;
}

.markdown-body p {
  margin: 10px 0;
}

.markdown-body ul,
.markdown-body ol {
  margin: 10px 0 14px;
  padding-left: 1.5em;
}

.markdown-body li {
  margin: 5px 0;
}

.table-frame {
  max-width: 100%;
  margin: 18px 0 24px;
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  scrollbar-gutter: stable;
}

.policy-table {
  width: 100%;
  min-width: 100%;
  margin: 0;
  border-collapse: collapse;
  background: transparent;
  font-size: 14px;
  line-height: 1.72;
}

.policy-table th,
.policy-table td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  vertical-align: top;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}

.policy-table th {
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 700;
  text-align: left;
}

.policy-table--body tbody tr:nth-child(even) {
  background: #fafbfc;
}

.policy-table--body.policy-table--cols-2 th:first-child,
.policy-table--body.policy-table--cols-2 td:first-child {
  width: 28%;
  min-width: 170px;
}

.policy-table--wide {
  min-width: 860px;
}

.policy-table--cols-5 {
  min-width: 920px;
}

.policy-table--cols-7 {
  min-width: 1120px;
}

.policy-table--cols-12 {
  min-width: 1480px;
}

.policy-table--meta {
  table-layout: fixed;
  font-size: 13.5px;
  line-height: 1.62;
}

.policy-table--meta th,
.policy-table--meta td {
  padding: 8px 10px;
}

.policy-table--meta th:nth-child(1),
.policy-table--meta td:nth-child(1),
.policy-table--meta th:nth-child(3),
.policy-table--meta td:nth-child(3) {
  width: 92px;
  white-space: nowrap;
  overflow-wrap: normal;
}

.policy-table--meta th:nth-child(2),
.policy-table--meta td:nth-child(2),
.policy-table--meta th:nth-child(4),
.policy-table--meta td:nth-child(4) {
  width: calc((100% - 184px) / 2);
}

.markdown-body code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-family: var(--serif);
}

.markdown-body hr {
  height: 1px;
  border: 0;
  background: var(--line);
  margin: 28px 0;
}

.outline {
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  padding: 18px 12px;
  overflow: auto;
  border-right: 0;
}

.outline-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.outline-head p {
  color: var(--ink);
  font-weight: 700;
}

.outline nav,
#outlineNav {
  display: grid;
  gap: 4px;
  padding-top: 10px;
}

#outlineNav a {
  display: block;
  padding: 7px 7px 7px 9px;
  border-left: 3px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.45;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

#outlineNav a:hover {
  border-left-color: var(--brand);
  color: var(--brand-deep);
  background: var(--brand-soft);
}

#outlineNav a.level-3 {
  padding-left: 17px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 36px));
  padding: 10px 14px;
  border: 1px solid rgba(32, 36, 42, 0.12);
  border-radius: var(--radius);
  background: rgba(32, 36, 42, 0.92);
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  padding: 26px 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.admin-page {
  background: var(--bg);
  font-size: var(--admin-text);
}

.admin-shell {
  width: min(1220px, calc(100% - 36px));
  margin: 24px auto 40px;
}

.admin-login {
  margin: 84px auto 0;
}

.admin-panel {
  display: grid;
  gap: 12px;
}

.admin-head,
.admin-upload,
.admin-docs {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}

.admin-head h1,
.admin-upload h2,
.admin-section-head h2 {
  margin: 1px 0 0;
  font-size: var(--admin-title);
  line-height: 1.25;
}

.admin-title p {
  margin: 0;
  color: var(--brand-deep);
  font-size: var(--admin-small);
  font-weight: 700;
  line-height: 1.2;
}

.admin-logout {
  min-height: 34px;
  padding: 0 14px;
  background: #5b626d;
  font-size: var(--admin-text);
}

.admin-upload {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(420px, 0.9fr);
  grid-template-areas:
    "copy form"
    "copy result";
  gap: 6px 18px;
  align-items: center;
  padding: 10px 16px;
}

.admin-upload-copy {
  grid-area: copy;
}

.admin-upload h2 {
  font-size: var(--admin-section-title);
}

.admin-upload p {
  margin-top: 3px;
  line-height: 1.45;
}

.upload-form {
  grid-area: form;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.file-picker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  min-height: 38px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.file-picker:hover,
.file-picker:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(201, 11, 63, 0.08);
}

.file-picker-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  padding: 0 13px;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: var(--admin-text);
  font-weight: 700;
  white-space: nowrap;
}

.file-picker-name {
  min-width: 0;
  padding: 0 12px;
  color: var(--muted);
  font-size: var(--admin-text);
  line-height: 38px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-form button {
  min-height: 38px;
  padding: 0 16px;
  font-size: var(--admin-text);
}

.admin-result {
  grid-area: result;
  min-height: 0;
  color: var(--success);
  font-size: var(--admin-small);
  line-height: 1.35;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.admin-result.is-error {
  color: var(--brand-deep);
}

.admin-result:empty {
  display: none;
}

.admin-docs {
  overflow: hidden;
  padding: 0;
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--line);
}

.admin-section-head span {
  color: var(--muted);
  font-size: var(--admin-small);
  font-weight: 700;
}

.admin-doc-list {
  overflow-x: auto;
}

.admin-doc-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: var(--surface);
}

.admin-doc-table th,
.admin-doc-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-doc-table th {
  background: #f8fafc;
  color: var(--muted);
  font-size: var(--admin-small);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.admin-doc-table td {
  color: var(--ink-soft);
  font-size: var(--admin-small);
  line-height: 1.45;
}

.admin-doc-table tbody tr:hover {
  background: #fbfcfd;
}

.admin-doc-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-doc-table strong {
  display: block;
  color: var(--ink);
  font-size: var(--admin-text);
  font-weight: 700;
  line-height: 1.35;
}

.admin-file-cell {
  max-width: 270px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.admin-actions {
  white-space: nowrap;
}

.admin-actions a + button {
  margin-left: 8px;
}

.admin-doc-table a,
.admin-doc-table button {
  min-height: 30px;
  padding: 0 10px;
  background: #5b626d;
  font-size: var(--admin-small);
}

.admin-doc-table a:hover,
.admin-doc-table button:hover {
  background: var(--brand-deep);
}

.admin-error {
  display: block;
  margin-top: 4px;
  color: var(--brand-deep);
  font-size: var(--admin-small);
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .reader {
    border-right: 0;
  }

  .outline {
    display: none;
  }
}

@media (max-width: 980px) {
  .auth-gate {
    padding: 24px;
  }

  .locked-preview {
    display: none;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - var(--topbar-height));
  }

  .top-meta .nav-toggle {
    display: inline-flex;
    align-items: center;
  }

  .policy-nav {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    z-index: 6;
    width: min(320px, calc(100vw - 38px));
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  body.nav-open .policy-nav {
    transform: translateX(0);
  }

  .reader {
    border-right: 0;
    overflow: visible;
  }

  .markdown-body {
    margin-left: 18px;
    margin-right: 18px;
  }

  .admin-upload {
    grid-template-columns: 1fr minmax(0, auto);
    grid-template-areas:
      "copy form"
      "result result";
  }

  .admin-result {
    grid-column: 1 / -1;
  }

  .upload-form {
    grid-template-columns: minmax(320px, 1fr) auto;
  }
}

@media (max-width: 720px) {
  :root {
    --topbar-height: auto;
  }

  .auth-gate {
    display: block;
    padding: 18px;
  }

  .auth-panel,
  .admin-login {
    width: 100%;
    padding: 28px 20px 26px;
  }

  .admin-login-modal {
    width: 100%;
    padding: 26px 20px 24px;
  }

  .admin-login-modal h2 {
    font-size: 24px;
  }

  .auth-logo,
  .admin-login img {
    width: min(230px, 64%);
    margin-bottom: 24px;
  }

  .auth-panel h1,
  .admin-login h1 {
    max-width: 280px;
    font-size: 29px;
  }

  .auth-copy {
    max-width: 280px;
    font-size: 15px;
  }

  .auth-row,
  .admin-login-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding: 12px 16px;
  }

  .brand {
    width: 100%;
    align-items: flex-start;
  }

  .brand img {
    width: 145px;
    max-width: 48vw;
  }

  .brand h1 {
    white-space: normal;
    font-size: 20px;
  }

  .top-meta {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .policy-nav {
    top: 0;
  }

  .reader-empty {
    min-height: 360px;
    padding: 24px 18px;
  }

  .reader-welcome {
    padding-left: 18px;
  }

  .reader-welcome h2 {
    font-size: 28px;
  }

  .reader-welcome span {
    font-size: 15px;
  }

  .markdown-body {
    margin: 18px 14px 30px;
    padding: 24px 18px 56px;
    font-size: 15px;
  }

  .markdown-body h1 {
    font-size: 24px;
  }

  .table-frame {
    margin-right: -6px;
    margin-left: -6px;
  }

  .policy-table {
    font-size: 13.5px;
  }

  .policy-table th,
  .policy-table td {
    padding: 8px 10px;
  }

  .admin-shell {
    width: min(100% - 24px, 1220px);
    margin: 14px auto 28px;
  }

  .admin-head {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px;
  }

  .admin-logout {
    width: 100%;
  }

  .admin-upload {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .upload-form {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .file-picker {
    width: 100%;
  }

  .admin-section-head {
    padding: 12px;
  }

  .admin-doc-table {
    min-width: 900px;
  }

  .admin-doc-table th,
  .admin-doc-table td {
    padding: 9px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  body {
    display: none;
  }
}
