:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f9faf6;
  --ink: #17202a;
  --muted: #667085;
  --line: #dce3ea;
  --green: #19785c;
  --green-dark: #105c46;
  --coral: #df6b4f;
  --blue: #2d6cdf;
  --amber: #9b6a12;
  --shadow: 0 16px 36px rgba(24, 39, 75, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(25, 120, 92, 0.08), transparent 360px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

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

.topbar,
.hero,
.layout,
.release-toolbar,
.card-head,
.card-actions,
.version-item,
.top-actions,
.download-button,
.primary-button,
.icon-button,
.type-badge {
  display: flex;
}

.topbar {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 850;
}

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

.brand strong {
  font-size: 1.04rem;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
}

.top-actions {
  align-items: center;
  gap: 10px;
}

.count-pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.count-pill span {
  color: var(--ink);
  font-weight: 800;
}

.icon-button {
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--green);
  color: var(--green);
}

.hero {
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: 28px;
  border: 1px solid rgba(25, 120, 92, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(249, 250, 246, 0.92)),
    #fff;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1,
.section-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 620px;
  font-size: 3.6rem;
  line-height: 1;
}

.hero p:not(.eyebrow) {
  max-width: 610px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.hero-stat {
  display: grid;
  place-items: center;
  min-width: 150px;
  padding: 24px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  text-align: center;
}

.hero-stat span {
  font-size: 3.4rem;
  font-weight: 900;
  line-height: 1;
}

.hero-stat small {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.74);
  text-transform: uppercase;
  letter-spacing: 0;
}

.layout {
  align-items: flex-start;
  gap: 20px;
}

.upload-panel,
.release-panel,
.release-card,
.empty-state,
.error-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(24, 39, 75, 0.08);
}

.upload-panel {
  position: sticky;
  top: 18px;
  flex: 0 0 330px;
  padding: 20px;
}

.section-head h2 {
  font-size: 1.22rem;
}

.section-head p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.upload-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.file-picker {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 78px;
  padding: 14px;
  border: 1px dashed rgba(25, 120, 92, 0.48);
  border-radius: 8px;
  background: var(--panel-soft);
  cursor: pointer;
}

.file-picker input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: rgba(25, 120, 92, 0.1);
  color: var(--green);
}

.file-picker strong,
.file-picker small {
  display: block;
}

.file-picker small {
  margin-top: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.sort-field span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.field input,
.field textarea,
.sort-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.field input,
.sort-field select {
  height: 44px;
  padding: 0 12px;
}

.field textarea {
  resize: vertical;
  min-height: 104px;
  padding: 11px 12px;
}

.field input:focus,
.field textarea:focus,
.sort-field select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(25, 120, 92, 0.13);
}

.primary-button,
.download-button {
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 850;
}

.primary-button {
  background: var(--green);
  color: #fff;
  cursor: pointer;
}

.primary-button:hover {
  background: var(--green-dark);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.form-message.success {
  color: var(--green);
}

.form-message.error {
  color: #b42318;
}

.release-panel {
  flex: 1;
  min-width: 0;
  padding: 20px;
}

.release-toolbar {
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.sort-field {
  display: grid;
  gap: 7px;
  min-width: 150px;
}

.release-grid {
  display: grid;
  gap: 14px;
}

.release-card {
  padding: 18px;
}

.card-head {
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.title-wrap {
  min-width: 0;
}

.title-wrap h3 {
  margin: 0;
  font-size: 1.22rem;
  overflow-wrap: anywhere;
}

.title-wrap p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.type-badge {
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 850;
  font-size: 0.8rem;
  white-space: nowrap;
}

.type-badge.apk {
  background: rgba(25, 120, 92, 0.11);
  color: var(--green);
}

.type-badge.exe {
  background: rgba(45, 108, 223, 0.12);
  color: var(--blue);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.meta-grid dt,
.meta-grid dd {
  margin: 0;
}

.meta-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.meta-grid dd {
  margin-top: 4px;
  font-weight: 780;
  overflow-wrap: anywhere;
}

.card-actions {
  justify-content: flex-start;
  margin-bottom: 16px;
}

.download-button {
  min-width: 160px;
  padding: 0 14px;
  background: var(--ink);
  color: #fff;
}

.download-button:hover {
  background: #2a3542;
}

.download-button.compact {
  min-width: 118px;
  min-height: 38px;
  padding: 0 11px;
  font-size: 0.9rem;
}

.download-button.is-disabled {
  background: #e7ebef;
  color: var(--muted);
}

.versions {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.versions h4 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.version-list {
  display: grid;
  gap: 8px;
}

.version-item {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid #e7edf2;
  border-radius: 8px;
  background: #fbfcfd;
}

.version-item strong,
.version-item span {
  display: block;
}

.version-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.empty-state,
.error-box {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
  color: var(--ink);
}

.empty-state p,
.error-box {
  margin: 0;
}

@media (max-width: 900px) {
  .layout {
    display: grid;
  }

  .upload-panel {
    position: static;
    width: 100%;
  }

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

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .topbar,
  .hero,
  .release-toolbar,
  .card-head,
  .version-item {
    display: grid;
  }

  .topbar {
    gap: 12px;
  }

  .top-actions {
    justify-content: space-between;
  }

  .hero {
    padding: 20px;
  }

  .hero h1 {
    font-size: 2.18rem;
  }

  .hero-stat {
    min-width: 0;
    min-height: 118px;
  }

  .upload-panel,
  .release-panel,
  .release-card {
    padding: 14px;
  }

  .release-toolbar {
    gap: 12px;
  }

  .sort-field {
    min-width: 0;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .download-button,
  .download-button.compact,
  .primary-button {
    width: 100%;
  }

  .version-item {
    align-items: stretch;
  }
}
