:root {
  color-scheme: dark;
  --canvas: #16223d;
  --surface: #2a3651;
  --card: #202d49;
  --input: #1a2842;
  --ink: #f7f9ff;
  --muted: #b4c4e0;
  --border: #3b4963;
  --accent: #800020;
  --accent-hover: #a00028;
  --link: #a8d7ff;
  font-family: "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #214f83 48px, #1c365b 245px, #16223d 560px);
  background-attachment: fixed;
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--link); }
.container { width: min(1100px, calc(100% - 64px)); margin: 0 auto; }
.download-page .container { width: min(1824px, calc(100% - clamp(32px, 5vw, 96px))); }
.site-header {
  min-height: 48px;
  display: flex;
  align-items: center;
  background: #181818;
  border-bottom: 1px solid #303030;
  position: relative;
  z-index: 5;
}
.head-inner { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; color: #fff; text-decoration: none; flex-shrink: 0; }
.brand-copy strong { font-size: 15px; font-weight: 700; }
.head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.nav-link, .button, button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 22px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.nav-link { min-height: 32px; padding: 7px 14px; background: #2d2d2d; color: #eef2fa; font-size: 13px; font-weight: 400; }
.nav-link:hover { background: #414141; }
.nav-link.logout-link { background: transparent; border-color: #454545; color: #c3cee2; }
.button:hover, button:hover { background: var(--accent-hover); }
.button.secondary, button.secondary, .button.ghost, button.ghost { background: var(--card); border-color: var(--border); color: var(--ink); }
.button.secondary:hover, button.secondary:hover, .button.ghost:hover, button.ghost:hover { background: #354567; }
button.danger, .button.danger { background: #3c2e42; border-color: #795063; color: #ffb7c4; }
button.danger:hover, .button.danger:hover { background: #58354b; }
button:disabled { opacity: .58; cursor: wait; }
:focus-visible { outline: 2px solid #f7f9ff; outline-offset: 4px; }
.auth-page { background: linear-gradient(180deg, #0d2035 48px, #214c7f 165px, #16223d 570px); background-attachment: fixed; }
.page-wrap { min-height: calc(100vh - 48px); display: grid; place-items: center; padding: 48px 24px 72px; }
.login-card { width: min(460px, 100%); padding: 34px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 18px 50px #08142540; }
.eyebrow { margin: 0 0 9px; padding: 4px 10px; width: fit-content; border-radius: 12px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
h1, h2, h3 { color: var(--ink); }
h1 { margin: 0; font-size: 30px; line-height: 1.2; font-weight: 600; }
h2 { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 600; }
h3 { margin: 0; font-size: 16px; font-weight: 600; }
.lead { margin: 9px 0 0; color: var(--muted); }
.login-form, .admin-form-grid { display: grid; gap: 14px; margin-top: 26px; }
label { color: #e4ebf9; font-size: 13px; font-weight: 600; }
input[type='password'], input[type='text'], input[type='email'], input[type='tel'], input[type='search'], input[type='file'], textarea {
  width: 100%; min-height: 46px; padding: 11px 13px;
  border: 1px solid #52617a; border-radius: 9px;
  background: var(--input); color: var(--ink); font: inherit;
}
input::placeholder, textarea::placeholder { color: #9caecb; opacity: 1; }
input[type='file'] { padding: 7px; }
textarea { min-height: 100px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--accent); outline: 2px solid #f7f9ff80; }
.login-form button { margin-top: 7px; min-height: 46px; }
.error, .success { margin: 16px 0 0; padding: 12px 14px; border-radius: 9px; font-weight: 500; }
.error { background: #492d40; color: #ffc5ce; border: 1px solid #764357; }
.success { background: #213f42; color: #b5ecd5; border: 1px solid #426c66; }
.page-heading { padding: 35px 0 29px; background: #0d2035; border-bottom: 1px solid #31517a; }
.page-heading .lead { color: #b9cae3; }
.content-grid { padding: 26px 0 48px; display: grid; gap: 22px; }
.panel { padding: 24px; background: var(--surface); border: 1px solid #3a4861; border-radius: 16px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 21px; }
.section-head .lead { margin-top: 5px; font-size: 13px; }
.inline-form { margin: 0; }
.upload-form { grid-template-columns: minmax(200px, 1fr) minmax(220px, 1fr) auto; align-items: end; gap: 16px; }
.upload-form > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.upload-form label { display: block; line-height: 1.2; }
.upload-form input[type='file'], .upload-form textarea { height: 58px; min-height: 58px; margin: 0; }
.upload-form input[type='file'] { padding: 10px; }
input[type='file']::file-selector-button { margin-right: 10px; padding: 8px 12px; border: 1px solid #52617a; border-radius: 16px; background: #344460; color: var(--ink); font: inherit; cursor: pointer; }
input[type='file']::file-selector-button:hover { background: #415475; }
.upload-form > button { min-height: 48px; margin-bottom: 5px; }
.file-note { white-space: pre-line; color: var(--muted); }
.file-note-form { display: flex; align-items: flex-start; gap: 8px; min-width: 280px; }
.file-note-form textarea { min-width: 150px; min-height: 60px; }
.file-note-form button { flex: 0 0 auto; padding-inline: 12px; font-size: 13px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--card); font-size: 14px; }
.admin-table th, .admin-table td { padding: 15px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; max-width: 380px; overflow-wrap: anywhere; }
.admin-table th { background: #34415d; color: #c5d4ec; font-size: 12px; font-weight: 600; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #283754; }
.file-list { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; list-style: none; }
.file-list li { display: grid; align-content: start; gap: 14px; min-height: 150px; padding: 22px; border: 1px solid transparent; border-radius: 14px; background: var(--card); transition: background .15s, border-color .15s; }
.file-list li:hover { background: #293c5c; border-color: #557399; }
.file-list a { display: flex; align-items: flex-start; gap: 12px; color: #fff; font-size: 24px; line-height: 1.35; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; min-width: 0; }
.file-list a::before { content: '\2193'; display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 27px; font-weight: 400; line-height: 1; }
.file-list a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--accent-hover); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.file-list .file-note { margin: 0 0 0 52px; color: #c8d5eb; font-size: 20px; line-height: 1.5; overflow-wrap: anywhere; }
.empty-state { color: var(--muted); }
@media (max-width: 760px) {
  .container { width: calc(100% - 32px); }
  .download-page .container { width: calc(100% - 32px); }
  .head-inner { padding: 8px 0; }
  .head-actions { gap: 5px; }
  .nav-link { font-size: 12px; padding-inline: 11px; }
  .page-heading { padding: 28px 0 24px; }
  h1 { font-size: 26px; }
  .panel { padding: 18px; }
  .file-list { grid-template-columns: 1fr; }
  .file-list li { min-height: 100px; }
  .upload-form { grid-template-columns: 1fr; }
  .upload-form > button { width: 100%; margin-bottom: 0; }
  .file-note-form { min-width: 260px; }
  .page-wrap { padding: 32px 16px 48px; }
  .login-card { padding: 28px 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
