* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 16px;
  background: #0f1115;
  color: #e8e8e8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.card {
  width: 100%;
  max-width: 560px;
  background: #181b22;
  border: 1px solid #262b35;
  border-radius: 12px;
  padding: 32px;
}

h1 {
  margin: 0 0 4px;
  font-size: 24px;
}

.subtitle {
  margin: 0 0 24px;
  color: #9aa3b2;
  font-size: 14px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 13px;
  color: #9aa3b2;
}

input[type="url"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #2c323e;
  background: #11141a;
  color: #e8e8e8;
  font-size: 14px;
}

input[type="url"]:focus {
  outline: none;
  border-color: #4f7cff;
}

button {
  margin-top: 8px;
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  background: #4f7cff;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: #3d68f0;
}

#refresh-btn {
  margin-top: 0;
  background: #262b35;
  color: #cfd4dd;
  padding: 8px 12px;
  font-size: 13px;
}

#refresh-btn:hover {
  background: #2f3543;
}

.status {
  min-height: 18px;
  font-size: 13px;
  margin: 12px 0 0;
}

.status.ok {
  color: #4fdc8f;
}

.status.error {
  color: #ff6b6b;
}

.preview, .info {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #262b35;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h2 {
  font-size: 16px;
  margin: 0;
}

.muted {
  color: #6b7280;
  font-size: 13px;
}

#channel-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#channel-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #11141a;
  border-radius: 6px;
  font-size: 13px;
}

#channel-list img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
  background: #262b35;
}

#channel-list .group {
  margin-left: auto;
  color: #6b7280;
  font-size: 11px;
}

code {
  display: block;
  margin-top: 10px;
  padding: 10px 12px;
  background: #11141a;
  border-radius: 6px;
  font-size: 13px;
  color: #4fdc8f;
  word-break: break-all;
}

.download-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #262b35;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 20px;
  background: #4f7cff;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s;
}

.download-btn:hover {
  background: #3d68f0;
}

.download-btn.unavailable {
  background: #262b35;
  color: #9aa3b2;
  pointer-events: none;
}

.apk-meta {
  margin-top: 8px;
  font-size: 12px;
}
