:root {
  color-scheme: dark;
  --ink: #080908;
  --paper: #f4f5ee;
  --acid: #B7FF39;
  --muted: #9b9d93;
  --line: rgba(244, 245, 238, 0.18);
  --panel: rgba(18, 20, 18, 0.92);
  --danger: #ff705d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--ink);
  color: var(--paper);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--ink); }
body { margin: 0; min-height: 100vh; background: var(--ink); color: var(--paper); }
a { color: inherit; text-underline-offset: 0.24em; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--acid); outline-offset: 4px; }
.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;
}

.site-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.13;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}
.shell { position: relative; width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.site-header,
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-block: 28px;
  border-bottom: 1px solid var(--line);
  font: 700 0.75rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
}
.site-header nav { display: flex; gap: 28px; }
.site-header nav a, .site-footer a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover, .site-footer a:hover { color: var(--acid); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  background: var(--acid);
  color: var(--ink);
  font-size: 0.68rem;
}
.site-footer { margin-top: 72px; border-top: 1px solid var(--line); border-bottom: 0; color: var(--muted); }

.hero { padding: clamp(70px, 7vw, 96px) 0 60px; }
.eyebrow, .index-label {
  margin: 0 0 22px;
  color: var(--acid);
  font: 700 0.72rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.14em;
}
.hero h1, .policy h1, .result-card h1, .download-card h1, .system-state h1 {
  max-width: 980px;
  margin: 0;
  font-size: clamp(3.4rem, 9vw, 7.6rem);
  line-height: 0.88;
  letter-spacing: -0.075em;
}
.hero h1 span { color: var(--acid); }
.hero-copy, .lead {
  max-width: 660px;
  margin: 34px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.upload-panel, .result-card, .download-card, .system-state, .policy {
  position: relative;
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 14px 14px 0 rgba(183, 255, 57, 0.08);
}
.panel-heading, .selection-title, .status-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
}
.panel-heading h2, .selection h3, .result-card h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  letter-spacing: -0.04em;
}
.quota-block { display: grid; min-width: 230px; gap: 5px; text-align: right; }
.quota-block span, .quota-block small { color: var(--muted); }
.quota-block strong { color: var(--acid); font: 700 1.8rem/1 ui-monospace, monospace; }

.drop-zone {
  display: grid;
  min-height: 310px;
  margin-top: 42px;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed rgba(183, 255, 57, 0.55);
  background: rgba(183, 255, 57, 0.025);
  text-align: center;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.drop-zone.is-dragging { border-color: var(--acid); background: rgba(183, 255, 57, 0.09); }
.drop-zone strong { font-size: clamp(1.5rem, 3vw, 2.5rem); }
.drop-zone > span:not(.drop-icon), .drop-zone small { color: var(--muted); }
.drop-icon {
  display: grid;
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
  place-items: center;
  border: 1px solid var(--acid);
  border-radius: 50%;
  color: var(--acid);
  font-size: 2.3rem;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 13px 20px;
  border: 1px solid var(--paper);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
}
.button:hover { border-color: var(--acid); color: var(--acid); }
.button:disabled { cursor: not-allowed; opacity: 0.35; }
.button-primary { border-color: var(--acid); background: var(--acid); color: var(--ink); }
.button-primary:hover { background: transparent; color: var(--acid); }
.button-secondary { border-color: var(--acid); color: var(--acid); }
.button-quiet { border-color: transparent; color: var(--muted); }

.selection, .upload-status { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }
.file-list, .file-progress-list { display: grid; margin: 22px 0 0; padding: 0; list-style: none; }
.file-list li, .file-progress-list li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  border-top: 1px solid var(--line);
}
.file-list li:last-child, .file-progress-list li:last-child { border-bottom: 1px solid var(--line); }
.file-index, .file-size, .file-state {
  color: var(--muted);
  font: 600 0.72rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.file-name { min-width: 0; overflow-wrap: anywhere; }
.remove-button, .retry-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.remove-button:hover, .retry-button:hover { color: var(--acid); }
.progress {
  width: 100%;
  height: 7px;
  margin-top: 16px;
  border: 0;
  appearance: none;
  background: rgba(244, 245, 238, 0.12);
  overflow: hidden;
}
.progress::-webkit-progress-bar { background: rgba(244, 245, 238, 0.12); }
.progress::-webkit-progress-value { background: var(--acid); transition: width 100ms linear; }
.progress::-moz-progress-bar { background: var(--acid); }
.status-note { color: var(--muted); }
.rules-consent {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 14px;
  margin-top: 30px;
  padding: 22px;
  border: 1px solid var(--line);
  line-height: 1.5;
}
.rules-consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--acid); }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.live-message, .error-message { min-height: 1.5em; margin: 18px 0 0; }
.live-message { color: var(--acid); }
.error-message { color: var(--danger); }

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 64px;
  border: 1px solid var(--line);
}
.facts article { min-height: 210px; padding: 30px; border-right: 1px solid var(--line); }
.facts article:last-child { border-right: 0; }
.facts span { display: block; color: var(--acid); font: 700 0.72rem/1 monospace; }
.facts strong { display: block; margin-top: 42px; font-size: clamp(1.5rem, 3vw, 2.35rem); }
.facts p { color: var(--muted); line-height: 1.5; }

.policy, .result-card, .download-card, .system-state { margin-top: clamp(60px, 9vw, 110px); }
.policy { max-width: 920px; }
.policy h1, .result-card h1, .download-card h1, .system-state h1 {
  font-size: clamp(2.7rem, 6vw, 5.6rem);
  line-height: 0.96;
}
.policy h2 { margin: 58px 0 16px; font-size: 1.65rem; }
.policy p, .policy li, .download-card > p, .result-card > p, .system-state > p {
  color: #c7c9c0;
  line-height: 1.7;
}
.policy li + li { margin-top: 10px; }
.rules-content { margin-top: 34px; color: #c7c9c0; line-height: 1.75; white-space: pre-line; }
.table-wrap { margin-top: 30px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { color: var(--acid); font: 700 0.72rem/1.4 ui-monospace, monospace; text-transform: uppercase; }
tbody th { min-width: 230px; }

.link-box { display: flex; gap: 12px; margin-top: 34px; }
.result-link {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  color: var(--acid);
  font: 700 clamp(0.82rem, 2vw, 1.15rem)/1.2 ui-monospace, monospace;
  overflow-wrap: anywhere;
}
.expiry { margin-top: 20px; }
.result-card h2 { margin-top: 52px; }
.warning { margin-top: 34px; padding: 22px; border-left: 4px solid var(--acid); background: rgba(183, 255, 57, 0.06); }
.warning p { margin-bottom: 0; color: var(--muted); line-height: 1.5; }

.admin-page { overflow-x: hidden; }
.admin-header { position: relative; border-bottom: 1px solid var(--line); }
.admin-header__inner {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 20px;
  font: 700 0.75rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
}
.admin-nav { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 16px; }
.admin-nav form { margin: 0; }
.admin-nav__context { color: var(--acid); white-space: nowrap; }
.admin-logout { min-height: 38px; padding: 8px 0; font: inherit; letter-spacing: inherit; }
.admin-main { padding-block: clamp(42px, 7vw, 84px); }
.admin-section + .admin-section { margin-top: clamp(58px, 9vw, 100px); }
.admin-section__heading { margin-bottom: 24px; }
.admin-section__heading .eyebrow { margin-bottom: 12px; }
.admin-section h1, .admin-section h2, .admin-login h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.35rem, 6vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}
.admin-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); }
.admin-card { min-width: 0; min-height: 190px; padding: clamp(22px, 3vw, 32px); border-right: 1px solid var(--line); background: var(--panel); }
.admin-card:last-child { border-right: 0; }
.admin-card__label, .admin-package__facts dt, .admin-setting__action > p {
  margin: 0;
  color: var(--muted);
  font: 700 0.7rem/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.admin-card__value { margin: 32px 0 0; font-size: clamp(1.5rem, 3vw, 2.35rem); font-weight: 750; overflow-wrap: anywhere; }
.admin-card__value--acid { color: var(--acid); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.admin-card__copy { margin: 18px 0 0; color: var(--muted); line-height: 1.5; }
.admin-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid currentColor;
  font: 700 0.72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
}
.admin-status--ok { color: var(--acid); background: rgba(183, 255, 57, 0.08); }
.admin-status--warning { color: #ffd166; background: rgba(255, 209, 102, 0.08); }
.admin-status--off { color: var(--muted); }
.admin-status--danger { color: var(--danger); background: rgba(255, 112, 93, 0.08); }
.admin-settings, .admin-packages { display: grid; gap: 14px; }
.admin-setting, .admin-package, .admin-empty, .admin-login {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 10px 10px 0 rgba(183, 255, 57, 0.05);
}
.admin-setting { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; padding: clamp(22px, 3vw, 32px); }
.admin-setting h3 { margin: 0; font-size: clamp(1.15rem, 2vw, 1.45rem); }
.admin-setting p { margin: 10px 0 0; color: var(--muted); line-height: 1.5; }
.admin-setting__action { display: grid; justify-items: end; gap: 12px; }
.admin-setting__action > p { color: var(--muted); }
.admin-setting__action strong { color: var(--paper); font: inherit; }
.admin-setting__action form { margin: 0; }
.admin-package { padding: clamp(22px, 3vw, 32px); }
.admin-package__header { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 24px; }
.admin-package__title { margin: 0; }
.admin-package__link { display: inline-block; margin-top: 11px; color: var(--acid); font: 700 clamp(1rem, 2vw, 1.3rem)/1.25 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.admin-package__facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 30px 0 0; }
.admin-package__facts div { min-width: 0; }
.admin-package__facts dd { margin: 8px 0 0; line-height: 1.45; overflow-wrap: anywhere; }
.admin-package__details { margin-top: 26px; border-top: 1px solid var(--line); }
.admin-package__details summary { padding-top: 18px; color: var(--muted); cursor: pointer; font: 700 0.72rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; }
.admin-package__facts--technical { padding-top: 8px; }
.admin-package__delete { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.admin-delete { border-color: var(--danger); color: var(--danger); }
.admin-delete:hover { border-color: var(--danger); background: var(--danger); color: var(--ink); }
.admin-empty { margin: 0; padding: 32px; color: var(--muted); }
.admin-login-main { display: grid; min-height: calc(100vh - 79px); place-items: center; padding-block: clamp(42px, 10vw, 96px); }
.admin-login { width: min(100%, 600px); padding: clamp(28px, 6vw, 56px); }
.admin-login__copy { margin: 24px 0 0; color: var(--muted); line-height: 1.55; }
.admin-login__form { display: grid; gap: 20px; margin-top: 32px; }
.admin-login__form label { display: block; margin-bottom: 8px; color: var(--muted); font: 700 0.72rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.1em; text-transform: uppercase; }
.admin-login__form input { width: 100%; min-width: 0; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 0; background: var(--ink); color: var(--paper); }
.admin-login__form input:focus-visible { border-color: var(--acid); }
.admin-login__form .button { justify-self: start; margin-top: 4px; }

@media (max-width: 720px) {
  .admin-header__inner { align-items: flex-start; gap: 16px; }
  .admin-nav { flex-wrap: wrap; gap: 8px 14px; }
  .admin-nav__context { white-space: normal; text-align: right; }
  .admin-overview { grid-template-columns: 1fr; }
  .admin-card { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-card:last-child { border-bottom: 0; }
  .admin-card__value { margin-top: 20px; }
  .admin-setting { grid-template-columns: 1fr; gap: 20px; }
  .admin-setting__action { justify-items: start; }
  .admin-package__header { display: grid; gap: 18px; }
  .admin-package__facts { grid-template-columns: 1fr; gap: 16px; }
  .admin-login-main { min-height: calc(100vh - 79px); place-items: start stretch; }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 1180px); }
  .site-header { align-items: flex-start; }
  .site-header nav { flex-direction: column; gap: 8px; align-items: flex-end; }
  .hero { padding-top: 56px; }
  .hero h1 { font-size: clamp(3rem, 17vw, 5rem); }
  .panel-heading { display: grid; }
  .quota-block { min-width: 0; text-align: left; }
  .drop-zone { min-height: 260px; }
  .facts { grid-template-columns: 1fr; }
  .facts article { min-height: 160px; border-right: 0; border-bottom: 1px solid var(--line); }
  .facts article:last-child { border-bottom: 0; }
  .facts strong { margin-top: 28px; }
  .file-list li, .file-progress-list li { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .file-list .button, .file-progress-list .button, .retry-button { grid-column: 2 / -1; justify-self: start; margin-bottom: 12px; }
  .link-box { flex-direction: column; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

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