:root {
  color-scheme: light;
  --canvas: #f6f8fa;
  --surface: #ffffff;
  --border: #d1d9e0;
  --text: #1f2328;
  --muted: #59636e;
  --accent: #0969da;
  --control-hover: #eff2f5;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar { border-bottom: 1px solid var(--border); }
.topbar-inner, main {
  width: min(1012px, calc(100% - 64px));
  margin-inline: auto;
}
.topbar-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand, .access { display: flex; align-items: center; gap: 8px; }
.brand { font-size: 16px; font-weight: 600; }
.brand svg { width: 20px; height: 20px; }
.access { color: var(--muted); }
.access svg { width: 16px; height: 16px; }

main { padding-block: 48px 64px; }
h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.25;
  font-weight: 600;
}
.hint { color: var(--muted); margin: 8px 0 0; }

.files {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  padding: 0;
  margin: 24px 0 0;
  list-style: none;
}
.tile {
  display: flex;
  min-height: 136px;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
}

.archive, .download { display: grid; place-items: center; flex: none; }
.archive {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--canvas);
  color: var(--muted);
}
.archive svg { width: 24px; height: 24px; stroke-width: 2.8; }
.tile-info { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.file { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.file strong {
  color: var(--accent);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 600;
}
.detail { font-size: 12px; color: var(--muted); }
.download {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--canvas);
  transition: background-color .12s ease;
}
.download svg { width: 16px; height: 16px; }
.tile:hover .file strong, .tile:focus-visible .file strong { text-decoration: underline; }
.tile:hover .download, .tile:focus-visible .download { background: var(--control-hover); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 600px) {
  .topbar-inner, main { width: calc(100% - 32px); }
  .topbar-inner { min-height: 56px; }
  .access { font-size: 12px; }
  main { padding-top: 32px; }
  h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .download { transition: none; }
}


.login { max-width: 336px; padding-top: 64px; }
.login-symbol {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.login-symbol svg { width: 22px; height: 22px; }
.login h1 { margin: 0 0 24px; text-align: center; font-size: 24px; }
.login-form {
  display: grid;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}
.login-form label { margin-bottom: 6px; font-weight: 600; }
.login-form input:not([type="hidden"]) {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  margin-bottom: 16px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.login-form button, .logout button {
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--canvas);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.login-form button { border-color: #1a7f37; background: #1a7f37; color: white; }
.login-form button:hover { background: #116329; }
.logout button:hover { background: var(--control-hover); }
.login-form :is(input, button):focus-visible, .logout button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.login-error {
  margin: 0 0 16px;
  padding: 8px 12px;
  border: 1px solid #ff8182;
  border-radius: 6px;
  background: #ffebe9;
  color: #a40e26;
}
.access-group { display: flex; align-items: center; gap: 12px; }
.logout { margin: 0; }
.logout button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
}
.logout svg { width: 18px; height: 18px; }
@media (max-width: 600px) {
  .login { padding-top: 40px; }
  .login-form input:not([type="hidden"]) { font-size: 16px; }
  .access-group { gap: 8px; }
}
@media (max-width: 340px) {
  .access-group .access { display: none; }
}


.catalog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 5px 12px;
  border: 1px solid #1a7f37;
  border-radius: 6px;
  background: #1a7f37;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.upload-button svg { width: 16px; height: 16px; }
.upload-button:hover { background: #116329; }
.upload-button:disabled { opacity: .65; cursor: default; }
.upload-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.upload-feedback:has(#upload-status:empty) { display: none; }
.upload-feedback { margin-top: 16px; }
#upload-status { margin: 0 0 4px; overflow-wrap: anywhere; }
#upload-progress { width: min(100%, 300px); accent-color: #1a7f37; }
.upload-expired { width: min(480px, calc(100% - 32px)); margin: 64px auto 0; }
@media (max-width: 470px) {
  .catalog-heading { flex-direction: column; }
  .upload-button { min-height: 40px; }
}

