:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0c111d;
  color: #f7f8fa;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  padding: clamp(1rem, 3vw, 2rem);
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.16), transparent 42rem),
    #0c111d;
}

button,
input {
  font: inherit;
}

button,
.button-link,
.button-faux {
  min-height: 2.75rem;
  border: 0;
  border-radius: 0.7rem;
  padding: 0.65rem 1rem;
  background: #38bdf8;
  color: #06202c;
  font-weight: 750;
  cursor: pointer;
}

button:hover,
.button-link:hover {
  background: #7dd3fc;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button:focus-visible,
input:focus-visible,
.button-link:focus-visible,
[data-drop-zone]:focus-visible,
dialog:focus-visible {
  outline: 3px solid rgba(125, 211, 252, 0.75);
  outline-offset: 3px;
}

.shell {
  width: min(100%, 76rem);
  margin: 0 auto;
}

.brand {
  margin-bottom: 1.25rem;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.75rem, 4vw, 2.4rem);
}

h2 {
  margin: 0;
  font-size: 1.35rem;
}

h3 {
  margin: 0;
  font-size: 1rem;
}

p {
  color: #c4ccda;
  line-height: 1.55;
}

.lede {
  max-width: 50rem;
  margin: 0;
}

[data-message] {
  min-height: 1.5rem;
  margin: 0 0 1rem;
}

[data-message][data-kind=error],
.upload-item[data-kind=error] .upload-status {
  color: #fecdd3;
}

.auth-card,
.card {
  border: 1px solid #344158;
  border-radius: 1.1rem;
  background: rgba(17, 24, 39, 0.96);
  box-shadow: 0 1.2rem 4rem rgba(0, 0, 0, 0.25);
}

.reauthentication-dialog {
  width: min(calc(100% - 2rem), 32rem);
  border: 1px solid #526078;
  border-radius: 1rem;
  padding: 0;
  background: #111827;
  color: #f7f8fa;
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.55);
}

.reauthentication-dialog::backdrop {
  background: rgba(3, 7, 18, 0.78);
}

.dialog-content {
  display: grid;
  gap: 1rem;
  padding: clamp(1.2rem, 4vw, 2rem);
}

.dialog-content > p {
  margin: 0;
}

.dialog-cancel {
  justify-self: start;
}

.auth-card {
  width: min(100%, 30rem);
  padding: clamp(1.25rem, 4vw, 2rem);
}

.card {
  padding: clamp(1rem, 3vw, 1.5rem);
}

form {
  display: grid;
  gap: 1rem;
}

label {
  color: #e2e8f0;
  font-weight: 650;
}

.field-label {
  display: grid;
  gap: 0.45rem;
}

input[type=password],
input[type=search],
input[name=code] {
  width: 100%;
  min-height: 2.9rem;
  border: 1px solid #526078;
  border-radius: 0.7rem;
  padding: 0 0.85rem;
  background: #080f1d;
  color: #fff;
}

.session-header,
.section-heading,
.upload-heading,
.upload-footer,
.file-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.session-header {
  margin-bottom: 1rem;
}

.session-header p,
.section-heading p {
  margin: 0.25rem 0 0;
}

.dashboard {
  display: grid;
  gap: 1rem;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 10rem;
  margin-top: 1rem;
  border: 2px dashed #526078;
  border-radius: 0.9rem;
  padding: 1.25rem;
  text-align: center;
  background: #0a1221;
  transition: border-color 120ms ease, background 120ms ease;
  cursor: pointer;
}

.drop-zone[data-dragging=true] {
  border-color: #38bdf8;
  background: #0c2233;
}

.drop-zone p {
  margin: 0 0 0.8rem;
}

.upload-options {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-top: 1rem;
}

.upload-options input {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.15rem;
  accent-color: #38bdf8;
}

.upload-options span {
  display: grid;
  gap: 0.2rem;
}

.upload-options small,
.field-help {
  color: #9da9bb;
  font-weight: 400;
}

.upload-list,
.file-list {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.storage-progress {
  width: 100%;
  height: 1rem;
  margin-top: 0.5rem;
  accent-color: #38bdf8;
}

.storage-details,
.storage-status {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.integrity-scrub-help,
.integrity-scrub-status {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

.integrity-scrub-help {
  color: #aeb8c8;
}

.integrity-scrub-status[data-kind=idle],
.integrity-scrub-status[data-kind=active] {
  color: #a7f3d0;
}

.integrity-scrub-status[data-kind=warning] {
  color: #fde68a;
}

.integrity-scrub-status[data-kind=unavailable],
.integrity-scrub-status[data-kind=error] {
  color: #fecdd3;
  font-weight: 700;
}

.storage-status[data-kind=available] {
  color: #a7f3d0;
}

.storage-status[data-kind=full] {
  color: #fecdd3;
  font-weight: 700;
}

.upload-item,
.file-card {
  border: 1px solid #344158;
  border-radius: 0.85rem;
  background: #0a1221;
}

.upload-item {
  padding: 0.9rem;
}

.upload-size,
.upload-status {
  color: #aeb8c8;
  font-size: 0.9rem;
}

.upload-progress {
  width: 100%;
  height: 0.8rem;
  margin: 0.8rem 0;
  accent-color: #38bdf8;
}

.button-secondary,
.button-quiet,
.button-danger,
.button-link {
  width: auto;
  background: #263449;
  color: #f7f8fa;
}

.button-danger {
  background: #7f1d1d;
}

.button-danger:hover {
  background: #991b1b;
}

.button-link {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.button-faux {
  display: inline-grid;
  place-items: center;
}

.button-quiet {
  min-height: 2.25rem;
  padding: 0.35rem 0.7rem;
}

.library-tools {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) auto;
  align-items: end;
  gap: 0.75rem;
  margin-top: 1rem;
}

.file-summary {
  margin: 0.8rem 0 0;
  font-size: 0.9rem;
}

.file-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1rem;
}

.file-name {
  min-width: 0;
}

.state-badge {
  flex: 0 0 auto;
  border: 1px solid #38617a;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  color: #bae6fd;
  font-size: 0.78rem;
  font-weight: 700;
}

.file-metadata,
.file-identifier,
.file-url,
.file-retention {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.file-identifier code,
.file-url code {
  color: #d9e8f4;
  word-break: break-all;
}

.trash-card .state-badge {
  border-color: #7c5d37;
  color: #fde68a;
}

.unavailable-card .state-badge {
  border-color: #9f3f52;
  color: #fecdd3;
}

.file-retention {
  color: #fcd34d;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  justify-content: flex-end;
  gap: 0.55rem;
}

.empty-state {
  margin: 1rem 0 0;
  border: 1px dashed #526078;
  border-radius: 0.85rem;
  padding: 1rem;
  text-align: center;
}

.load-more {
  display: block;
  margin: 1rem auto 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 44rem) {
  body {
    padding: 0.8rem;
  }

  .session-header,
  .section-heading,
  .upload-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .session-header button,
  .section-heading button,
  .upload-footer button {
    width: 100%;
  }

  .library-tools,
  .file-card {
    grid-template-columns: 1fr;
  }

  .file-heading {
    align-items: flex-start;
  }

  .file-actions {
    justify-content: stretch;
  }

  .file-actions > * {
    flex: 1 1 8rem;
  }
}

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