:root {
  color-scheme: light;
  --bg: #f7f8fc;
  --panel: #ffffff;
  --soft: #f1f3fa;
  --text: #1c2440;
  --muted: #56627b;
  --line: #7b8498;
  --border: #dfe4ee;
  --accent: #4338ca;
  --accent-soft: #eef0ff;
  --buttontext: #ffffff;
  --danger: #b42318;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101629;
  --panel: #1b2340;
  --soft: #252e50;
  --text: #eef2ff;
  --muted: #afbdd8;
  --line: #8693b0;
  --border: #35415f;
  --accent: #a5b4fc;
  --accent-soft: #252e50;
  --buttontext: #22204c;
  --danger: #fda29b;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 "Segoe UI", system-ui, sans-serif;
}
a { color: var(--accent); text-underline-offset: 4px; }
button, input, textarea, select { font: inherit; }
button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button-link:hover { background: var(--soft); }
button:disabled {
  background: var(--soft);
  color: var(--muted);
  cursor: progress;
}
.primary, #submit {
  background: var(--accent);
  color: var(--buttontext);
  border-color: var(--accent);
}
.primary:hover, #submit:hover { background: var(--accent); }
:where(button, a, input, textarea, select, summary):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
.skip-link {
  position: absolute;
  left: 16px;
  top: 8px;
  z-index: 10;
  padding: 12px;
  background: var(--panel);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
.site-header { background: var(--panel); border-bottom: 1px solid var(--border); }
.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: 1248px;
  margin: auto;
  padding: 18px 32px;
}
.brand {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  color: var(--text);
  text-decoration: none;
  line-height: 1.5;
}
.brand-name { font-size: 1rem; font-weight: 700; }
.brand-caption { color: var(--muted); font-size: .8rem; }
.main-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.main-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 14px;
  color: var(--muted);
  border-radius: 7px;
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
}
.main-nav a:hover { background: var(--soft); color: var(--text); }
.main-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.theme-toggle { font-size: .875rem; flex-shrink: 0; }
main { max-width: 1248px; margin: 40px auto; padding: 0 32px 48px; }
h1, h2, h3 { overflow-wrap: anywhere; }
h1 { font-size: clamp(1.75rem, 3vw, 2.15rem); line-height: 1.25; letter-spacing: -.025em; margin: 0; }
h2 { font-size: 1.13rem; line-height: 1.4; margin: 0; }
h3 { font-size: 1rem; line-height: 1.5; margin: 0; }
p { color: var(--muted); margin: 8px 0 16px; overflow-wrap: anywhere; }
.page-heading { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading p { margin: 10px 0 0; }
.surface { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}
.panel-heading p { font-size: .9rem; margin: 5px 0 0; }
.panel-heading > div { min-width: 0; }
.panel-body { padding: 20px 24px; }
.folder-label {
  flex-shrink: 0;
  background: var(--soft);
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: .8rem;
  font-weight: 600;
}
form { margin: 0; }
label { display: block; margin: 20px 0 8px; font-size: .93rem; font-weight: 600; }
input, textarea, select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:disabled { color: var(--muted); background: var(--soft); }
input[type="file"] { border: 0; border-radius: 0; padding: 0; font-size: .92rem; }
input::file-selector-button {
  min-height: 44px;
  margin-right: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
.upload-layout { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 32px; align-items: start; }
.upload-workspace { display: grid; gap: 24px; min-width: 0; }
.upload-form { padding: 24px; }
.upload-form > label:first-child { margin-top: 0; }
#drop { padding: 28px 20px; border: 2px dashed var(--line); border-radius: 8px; background: var(--soft); }
#drop p { margin: 16px 0 0; font-size: .9rem; }
#drop.drag { background: var(--accent-soft); border-color: var(--accent); }
.formats { margin-top: 16px; font-size: .88rem; }
summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; }
summary::before { content: "+"; margin-right: 12px; font-size: 1.15em; }
details[open] > summary::before { content: "−"; }
#formats { margin: 8px 0 16px; overflow-wrap: anywhere; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.form-footer p { margin: 0; font-size: .85rem; }
.form-footer button { flex-shrink: 0; }
progress { width: 100%; height: 10px; accent-color: var(--accent); }
.upload-results #status { margin: 0; font-size: .93rem; }
#results article { padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--border); }
#results article h2 { margin-bottom: 12px; font-size: 1rem; }
#results article a { display: inline-flex; align-items: center; min-height: 44px; margin-right: 16px; font-size: .92rem; }
code { display: block; overflow-wrap: anywhere; font-size: .82rem; margin: 12px 0; color: var(--muted); }
.storage-aside { padding-top: 10px; min-width: 0; }
.storage-aside h2 { font-size: .98rem; }
.storage-aside p { font-size: .9rem; }
.storage-location { margin: 18px 0; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.storage-location span { display: block; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.storage-location strong { display: block; margin-top: 4px; font-size: 1rem; }
.aside-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.aside-section a { display: inline-flex; align-items: center; min-height: 44px; font-size: .9rem; font-weight: 600; }
.note { font-size: .85rem; }
.workspace-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 20px; }
.workspace-toolbar p { margin: 0; font-size: .9rem; }
.workspace-toolbar strong { display: block; color: var(--text); font-weight: 600; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.actions button, .actions a { font-size: .88rem; }
.actions a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 10px; }
.status-message:not(:empty) { margin: 0 0 24px; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--text); border-radius: 0 5px 5px 0; font-size: .93rem; }
#status:empty { display: none; }
.admin section + section { margin-top: 28px; }
.login-panel { max-width: 480px; padding: 28px; }
.login-panel > p { font-size: .93rem; }
.login-panel button { margin-top: 20px; width: 100%; }
.search-bar { padding: 18px 24px; border-bottom: 1px solid var(--border); }
.search-bar label { margin-top: 0; font-size: .85rem; }
.search-bar input { max-width: 560px; }
.panel-note { padding: 14px 24px; margin: 0; background: var(--soft); font-size: .85rem; border-bottom: 1px solid var(--border); }
.record-list > p { padding: 24px; margin: 0; }
.record-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 330px);
  column-gap: 28px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}
.record-list article:last-child { border-bottom: 0; }
.record-list article > :not(.actions) { grid-column: 1; min-width: 0; }
.record-list article p { font-size: .88rem; margin: 5px 0 0; }
.record-list article code { font-size: .78rem; margin: 8px 0 0; }
.record-list article > .actions { grid-column: 2; grid-row: 1 / span 6; align-self: center; justify-content: flex-end; }
#files .actions button:last-child { color: var(--danger); }
.pagination-button { margin: 18px 24px 24px; }
dialog {
  width: min(600px, calc(100% - 32px));
  max-height: 85vh;
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 18px 64px rgba(0, 0, 0, .2);
}
dialog::backdrop { background: rgba(10, 15, 35, .58); }
dialog h2 { font-size: 1.25rem; }
dialog .actions { margin-top: 24px; }
dialog p[role="alert"]:empty { display: none; }
dialog p[role="alert"]:not(:empty) { color: var(--danger); margin-top: 16px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.check input { width: 22px; min-height: 22px; height: 22px; flex-shrink: 0; accent-color: var(--accent); }
.preview-heading { display: flex; justify-content: space-between; align-items: start; gap: 24px; padding: 28px; }
.preview-heading > div:first-child { min-width: 0; }
.preview-heading .actions { flex-shrink: 0; }
.preview-heading h1 { font-size: clamp(1.5rem, 2vw, 1.8rem); }
.preview-heading #details { font-size: .9rem; margin-bottom: 0; }
.preview-status { padding: 0 28px; font-size: .9rem; }
#preview:empty { min-height: 80px; }
#preview iframe { display: block; width: 100%; min-height: 380px; height: 70vh; border: 0; border-block: 1px solid var(--border); background: var(--soft); }
#preview img, #preview video { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto; }
#preview audio { display: block; width: calc(100% - 48px); margin: 0 24px; }
.integrity { padding: 16px 28px; border-top: 1px solid var(--border); font-size: .85rem; }
.docs-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 40px; align-items: start; }
.docs-nav { display: grid; position: sticky; top: 24px; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.docs-nav p { margin: 0 0 12px; font-size: .85rem; font-weight: 600; color: var(--text); }
.docs-nav a { display: flex; align-items: center; min-height: 44px; padding: 8px 0; font-size: .9rem; color: var(--muted); text-decoration: none; }
.docs-nav a:hover { color: var(--accent); text-decoration: underline; }
.docs-content { min-width: 0; max-width: 820px; }
.doc-section { padding: 0 0 28px; margin: 0 0 28px; border-bottom: 1px solid var(--border); scroll-margin-top: 24px; }
.doc-section h2 { font-size: 1.25rem; margin-bottom: 12px; }
pre { padding: 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.7; }
code.inline { display: inline; margin: 0; color: var(--text); }
[hidden] { display: none !important; }
@media (max-width: 1050px) {
  .header-inner { gap: 16px; }
  .main-nav a { padding-inline: 10px; }
  .upload-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 24px; }
}
@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; margin-left: 0; }
  .theme-toggle { margin-left: auto; }
  .upload-layout { grid-template-columns: minmax(0, 1fr); }
  .storage-aside { padding: 24px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
  .storage-location { background: var(--soft); }
  .record-list article { grid-template-columns: minmax(0, 1fr); }
  .record-list article > .actions { grid-column: 1; grid-row: auto; justify-content: flex-start; margin-top: 18px; }
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .docs-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
  .docs-nav p { grid-column: 1 / -1; }
  .preview-heading { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .header-inner { padding: 16px; gap: 14px; }
  .brand { flex-shrink: 1; min-width: 0; }
  .brand-name { font-size: .95rem; overflow-wrap: anywhere; }
  .brand-caption { font-size: .75rem; }
  .theme-toggle { font-size: .8rem; padding-inline: 10px; }
  .main-nav { gap: 4px; }
  .main-nav a { padding: 9px 8px; font-size: .85rem; }
  main { margin-top: 28px; padding: 0 16px 32px; }
  .page-heading { margin-bottom: 22px; }
  .panel-heading { padding: 18px; align-items: flex-start; flex-wrap: wrap; gap: 16px; }
  .panel-heading p { font-size: .88rem; }
  .upload-form, .panel-body, .login-panel { padding: 18px; }
  #drop { padding: 22px 14px; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .form-footer button { width: 100%; }
  .storage-aside { padding: 18px; }
  .workspace-toolbar { align-items: flex-start; flex-direction: column; gap: 16px; }
  .search-bar, .record-list article { padding: 18px; }
  .panel-note { padding: 14px 18px; }
  .pagination-button { margin: 16px 18px 18px; max-width: calc(100% - 36px); }
  dialog { padding: 20px; }
  .preview-heading { padding: 20px; gap: 16px; }
  .preview-heading .actions { flex-shrink: 1; }
  .preview-status { padding-inline: 20px; }
  .integrity { padding: 14px 20px; }
  .docs-nav { grid-template-columns: minmax(0, 1fr); }
  pre { padding: 16px; font-size: .85rem; }
}

.docs-content li{overflow-wrap:anywhere;margin-block:8px}.docs-content ol,.docs-content ul{padding-inline-start:24px}
