:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --bg2: #e9f0ff;
  --text: #121826;
  --muted: #697386;
  --line: #dbe3ef;
  --panel: rgba(255, 255, 255, 0.92);
  --primary: #246bfe;
  --primary-dark: #154fc2;
  --primary-soft: #eaf1ff;
  --danger: #d22f3a;
  --danger-dark: #a8202a;
  --ok: #12805c;
  --off: #8a5a00;
  --shadow: 0 18px 50px rgba(36, 62, 112, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at top left, rgba(36, 107, 254, 0.18), transparent 34rem),
    radial-gradient(circle at top right, rgba(18, 128, 92, 0.10), transparent 28rem),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

.shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 46px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding: 12px;
  border: 1px solid rgba(219, 227, 239, 0.76);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 35px rgba(29, 50, 90, 0.08);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
  background: linear-gradient(135deg, var(--primary), #55a1ff);
  box-shadow: 0 12px 26px rgba(36, 107, 254, 0.28);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
}

.header-nav,
.share-buttons,
.section-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.header-nav a,
.section-tabs a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 750;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.header-nav a:hover,
.section-tabs a:hover,
.header-nav a.active {
  color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.hero,
.admin-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.hero-copy,
.hero-panel,
.panel,
.admin-hero {
  border: 1px solid rgba(219, 227, 239, 0.86);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-panel,
.panel {
  padding: 22px;
}

.hero-copy h1,
.admin-hero h1,
.login-panel h1,
.share-panel h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.admin-hero {
  padding: 22px;
}

.hero-copy p,
.admin-hero p {
  max-width: 680px;
  color: var(--muted);
}

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

.mini-card,
.stat-card,
.file-card,
.share-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.mini-card {
  padding: 16px;
}

.mini-icon,
.file-icon {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 900;
}

.mini-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
}

.file-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  font-size: 0.72rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  padding: 16px;
}

.stat-card span,
.eyebrow,
.hint,
.empty,
.file-meta span,
.share-main p {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.55rem;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel {
  margin-bottom: 18px;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.panel:hover {
  border-color: rgba(36, 107, 254, 0.22);
}

.login-panel,
.share-panel {
  max-width: 640px;
  margin: 10vh auto 0;
}

.section-title,
.topbar,
.share-main,
.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-title h2,
h2,
p {
  margin-top: 0;
}

.section-title h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

.pill,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 850;
  background: var(--primary-soft);
  color: var(--primary);
}

.status.ok {
  color: var(--ok);
  background: #e7f7f1;
}

.status.off {
  color: var(--off);
  background: #fff5dc;
}

.section-tabs {
  position: sticky;
  top: 92px;
  z-index: 8;
  margin-bottom: 18px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 30px rgba(29, 50, 90, 0.06);
  backdrop-filter: blur(12px);
}

.stack,
.upload-form,
.folder-share,
.share-options {
  display: grid;
  gap: 12px;
}

.folder-share {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(36, 107, 254, 0.12);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #4f8cff);
  box-shadow: 0 12px 26px rgba(36, 107, 254, 0.20);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(36, 107, 254, 0.26);
}

.compact {
  min-height: 38px;
  padding: 8px 12px;
}

.secondary,
.ghost {
  color: var(--text);
  background: #edf2fb;
  box-shadow: none;
}

.secondary:hover,
.ghost:hover {
  background: #dfe8f7;
  box-shadow: none;
}

.danger {
  background: linear-gradient(135deg, var(--danger), #ec5a62);
  box-shadow: 0 12px 26px rgba(210, 47, 58, 0.18);
}

.danger:hover {
  background: linear-gradient(135deg, var(--danger-dark), var(--danger));
}

.messages {
  margin-bottom: 16px;
}

.message {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #eaf3ff;
  border: 1px solid #d6e6ff;
}

.message.error {
  background: #fff0f1;
  border-color: #ffd1d5;
}

.message.success {
  background: #eaf8f0;
  border-color: #cfeedd;
}

.drop-zone {
  min-height: 142px;
  place-items: center;
  text-align: center;
  padding: 22px;
  border: 1.5px dashed #b8c8e1;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff, #f4f8ff);
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.drop-zone:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  background: #f6f9ff;
}

.drop-zone input {
  max-width: 440px;
  background: #fff;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #fff;
  background: var(--primary);
  font-size: 1.5rem;
  font-weight: 900;
}

.file-list,
.share-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.file-card,
.share-card {
  padding: 14px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.file-card:hover,
.share-card:hover {
  transform: translateY(-1px);
  border-color: rgba(36, 107, 254, 0.28);
  box-shadow: 0 14px 34px rgba(29, 50, 90, 0.08);
}

.file-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.file-meta strong,
.share-url {
  display: block;
  overflow-wrap: anywhere;
}

.actions-column {
  display: grid;
  gap: 8px;
  justify-items: end;
  min-width: 260px;
}

.share-form {
  width: 100%;
}

summary {
  cursor: pointer;
  font-weight: 850;
  color: var(--primary);
}

.share-options {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfe;
}

.share-buttons form {
  margin: 0;
}

.share-main {
  align-items: flex-start;
}

.qr {
  width: 118px;
  height: 118px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 7px;
  background: #fff;
}

.muted-card {
  opacity: 0.66;
}

.progress-wrap {
  margin-top: 14px;
}

.progress-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
}

progress {
  width: 100%;
  height: 18px;
  accent-color: var(--primary);
}

.public-file {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

code {
  padding: 2px 6px;
  border-radius: 8px;
  background: #edf2fb;
  color: #24466d;
}

.reveal {
  animation: reveal 360ms ease both;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 840px) {
  .shell {
    width: min(100% - 18px, 1180px);
    padding-top: 10px;
  }

  .site-header,
  .hero,
  .admin-hero,
  .section-title,
  .share-main,
  .file-list li {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .header-nav,
  .section-tabs {
    width: 100%;
  }

  .section-tabs {
    top: 126px;
    border-radius: 18px;
  }

  .stats-grid,
  .folder-share {
    grid-template-columns: 1fr;
  }

  .actions-column {
    justify-items: stretch;
    min-width: 0;
  }

  button,
  .button {
    width: 100%;
  }

  .qr {
    width: 170px;
    height: 170px;
    align-self: center;
  }
}
