*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f3;
  color: #1a1a1a;
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Layout ── */
.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1rem 5rem;
}

/* ── Logo (admin pages) ── */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2rem;
}
.logo-mark {
  width: 38px; height: 38px;
  background: #1a1a2e;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
}
.logo-text { font-size: 18px; font-weight: 600; letter-spacing: -0.3px; }
.logo-sub  { font-size: 12px; color: #888; margin-top: 1px; }

/* ── Page header (public) ── */
.page-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e5e5e3;
}
.header-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex-shrink: 0;
}
.header-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #1a1a2e;
  line-height: 1.1;
}
.header-sub {
  font-size: 13px;
  color: #888;
  margin-top: 4px;
}

/* ── Latest card ── */
.latest-card {
  background: #fff;
  border: 1px solid #e5e5e3;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2rem;
}
.latest-header {
  background: #1a1a2e;
  padding: 1.1rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.latest-version { color: #fff; font-size: 20px; font-weight: 600; }
.latest-date    { color: rgba(255,255,255,.55); font-size: 12px; margin-top: 3px; }
.latest-tag {
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.latest-body  { padding: 1.25rem 1.4rem; }
.latest-desc  { font-size: 14px; color: #444; line-height: 1.75; margin-bottom: 1.25rem; }

/* ── Download button ── */
.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1a1a2e;
  color: #fff;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: opacity .15s;
}
.dl-btn:hover { opacity: .82; }
.no-file { font-size: 13px; color: #aaa; }

/* ── No releases ── */
.no-release {
  text-align: center;
  padding: 3rem 1rem;
  color: #888;
  font-size: 14px;
  line-height: 1.8;
}
.no-release-icon { font-size: 36px; display: block; margin-bottom: 10px; }
.no-release-sub  { font-size: 12px; color: #bbb; }

/* ── History ── */
.history-section { margin-bottom: 2rem; }
.section-label {
  font-size: 11px;
  font-weight: 600;
  color: #aaa;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.history-item {
  background: #fff;
  border: 1px solid #e5e5e3;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 8px;
}
.hi-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hi-content { flex: 1; min-width: 0; }
.hi-title   { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.hi-changes { font-size: 13px; color: #666; line-height: 1.65; }
.hi-date    { font-size: 12px; color: #aaa; white-space: nowrap; padding-top: 2px; }

/* ── Admin fab ── */
.admin-bar {
  position: fixed;
  bottom: 1.2rem; right: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.admin-toggle {
  background: #1a1a2e;
  color: #fff;
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  text-decoration: none;
  box-shadow: 0 2px 14px rgba(0,0,0,.25);
  transition: opacity .15s;
}
.admin-toggle:hover { opacity: .82; }
.admin-logout {
  background: #fff;
  color: #888;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid #ddd;
  transition: background .15s;
}
.admin-logout:hover { background: #fef2f2; color: #c0392b; }

/* ── Login page ── */
body.login-page { display: flex; align-items: center; justify-content: center; }
.login-wrap { width: 100%; max-width: 400px; padding: 1rem; }
.login-card {
  background: #fff;
  border: 1px solid #e5e5e3;
  border-radius: 12px;
  padding: 2rem;
}
.back-link { font-size: 13px; color: #888; text-decoration: none; }
.back-link:hover { color: #1a1a2e; }

/* ── Alerts ── */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 1.25rem;
  border: 1px solid transparent;
}
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* ── Forms ── */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="password"],
.field input[type="file"],
.field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
  color: #1a1a1a;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: #1a1a2e;
  background: #fff;
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.65; }
.field input[type="file"] { padding: 7px 12px; cursor: pointer; }
.field-hint { font-size: 12px; color: #aaa; margin-top: 5px; }
.required { color: #e74c3c; }

/* ── Buttons ── */
.btn-primary {
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
}
.btn-primary:hover { opacity: .85; }
.btn-ghost {
  background: none;
  color: #666;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  text-decoration: none;
  transition: background .15s;
}
.btn-ghost:hover { background: #f5f5f3; }
.btn-delete {
  background: none;
  border: 1px solid #fecaca;
  color: #e74c3c;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
}
.btn-delete:hover { background: #fef2f2; }

/* ── Admin panel ── */
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
}
.admin-actions { display: flex; gap: 8px; }
.admin-card {
  background: #fff;
  border: 1px solid #e5e5e3;
  border-radius: 12px;
  padding: 1.4rem;
  margin-bottom: 1.5rem;
}
.admin-card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid #f0f0ee;
}

/* ── Release rows in admin ── */
.release-row {
  background: #fff;
  border: 1px solid #e5e5e3;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.release-latest { border-left: 3px solid #1a1a2e; }
.release-meta { flex: 1; min-width: 0; }
.release-title { font-size: 14px; font-weight: 600; margin: 4px 0 2px; }
.release-date  { font-size: 12px; color: #aaa; margin-bottom: 6px; }
.release-desc  { font-size: 13px; color: #666; line-height: 1.6; margin-bottom: 6px; }
.release-file  { font-size: 12px; color: #888; }
.release-file a { color: #1a1a2e; text-decoration: none; font-weight: 500; }
.release-file a:hover { text-decoration: underline; }
.no-file-admin { color: #ccc; }

.badge-latest {
  display: inline-block;
  background: #1a1a2e;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  letter-spacing: .5px;
  margin-bottom: 4px;
}
.empty-state {
  text-align: center;
  padding: 2rem;
  color: #aaa;
  font-size: 14px;
  background: #fff;
  border: 1px solid #e5e5e3;
  border-radius: 10px;
}

/* ── Responsive ── */
@media (max-width: 520px) {
  .latest-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .hi-row { flex-direction: column; gap: 4px; }
  .hi-date { padding-top: 0; }
  .admin-topbar { flex-direction: column; align-items: flex-start; gap: 12px; }
}