:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --text: #1c1c1e;
  --text-muted: #6b6b70;
  --accent: #3d6bf0;
  --accent-hover: #2f56cc;
  --btn: #5b5f66;
  --btn-hover: #454850;
  --border: #e2e3e8;
  --hero-bg: linear-gradient(135deg, #f5f5f7 0%, #d6d8dd 20%, #999da5 45%, #c7c9cf 70%, #f0f0f2 100%);
  --hero-border: rgba(255, 255, 255, 0.6);
  --hero-text: #2b2c30;
  --hero-shine-hi: rgba(255, 255, 255, 0.75);
  --hero-shine-lo: rgba(0, 0, 0, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --surface: #1c1c1f;
    --text: #f0f0f2;
    --text-muted: #a0a0a6;
    --accent: #6d92ff;
    --accent-hover: #8aa5ff;
    --btn: #82868f;
    --btn-hover: #9a9ea6;
    --border: #2e2e33;
    --hero-bg: linear-gradient(135deg, #6c6e74 0%, #46484d 20%, #222327 45%, #3b3d42 70%, #6c6e74 100%);
    --hero-border: rgba(255, 255, 255, 0.18);
    --hero-text: #f0f0f2;
    --hero-shine-hi: rgba(255, 255, 255, 0.2);
    --hero-shine-lo: rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  --bg: #121214;
  --surface: #1c1c1f;
  --text: #f0f0f2;
  --text-muted: #a0a0a6;
  --accent: #6d92ff;
  --accent-hover: #8aa5ff;
  --btn: #82868f;
  --btn-hover: #9a9ea6;
  --border: #2e2e33;
  --hero-bg: linear-gradient(135deg, #6c6e74 0%, #46484d 20%, #222327 45%, #3b3d42 70%, #6c6e74 100%);
  --hero-border: rgba(255, 255, 255, 0.18);
  --hero-text: #f0f0f2;
  --hero-shine-hi: rgba(255, 255, 255, 0.2);
  --hero-shine-lo: rgba(0, 0, 0, 0.5);
}

:root[data-theme="light"] {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --text: #1c1c1e;
  --text-muted: #6b6b70;
  --accent: #3d6bf0;
  --accent-hover: #2f56cc;
  --btn: #5b5f66;
  --btn-hover: #454850;
  --border: #e2e3e8;
  --hero-bg: linear-gradient(135deg, #f5f5f7 0%, #d6d8dd 20%, #999da5 45%, #c7c9cf 70%, #f0f0f2 100%);
  --hero-border: rgba(255, 255, 255, 0.6);
  --hero-text: #2b2c30;
  --hero-shine-hi: rgba(255, 255, 255, 0.75);
  --hero-shine-lo: rgba(0, 0, 0, 0.18);
}

* { box-sizing: border-box; }

img { max-width: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.topbar-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  cursor: pointer;
}

.brand-name {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  margin-right: auto;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.theme-toggle {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.lang-menu {
  position: relative;
}

.lang-toggle {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.lang-toggle:hover {
  border-color: var(--accent);
}

.lang-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  list-style: none;
  margin: 0;
  padding: 6px;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.lang-option:hover {
  background: var(--bg);
}

.lang-flag {
  font-size: 1.1rem;
}

.hamburger-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.hamburger-toggle:hover {
  border-color: var(--accent);
}

.hamburger-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger-toggle.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.hamburger-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.hamburger-toggle.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.hamburger-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 30;
}

.hamburger-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 31;
  width: min(280px, 80vw);
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  padding: 70px 0 20px;
}

.hamburger-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hamburger-menu a {
  display: block;
  padding: 14px 24px;
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.hamburger-menu a:hover {
  background: var(--bg);
  color: var(--accent);
}

.hero-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 20px;
}

.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 48px 24px;
  margin-bottom: 40px;
  border-radius: 24px;
  background: var(--hero-bg);
  border: 1px solid var(--hero-border);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    inset 0 -3px 6px rgba(0, 0, 0, 0.25),
    0 6px 16px rgba(0, 0, 0, 0.18);
}

.hero::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -25%;
  width: 55%;
  height: 220%;
  background: linear-gradient(75deg, transparent 40%, var(--hero-shine-hi) 48%, transparent 62%);
  pointer-events: none;
}

.hero h1 {
  position: relative;
  z-index: 1;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  color: var(--hero-text);
  text-shadow: 0 1px 0 var(--hero-shine-hi), 0 -1px 1px var(--hero-shine-lo);
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.3rem;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.apps-section {
  margin-bottom: 48px;
}

.apps-note {
  font-size: 1rem;
  color: var(--text-muted);
  margin: -4px 0 16px;
}

.apps-note a {
  color: var(--accent);
  text-decoration: underline;
}

.apps-note a:hover {
  color: var(--accent-hover);
}

.apps-search {
  display: block;
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  margin-bottom: 16px;
}

.apps-search:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.apps-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  border-color: var(--accent);
}

.app-card-skeleton {
  height: 112px;
  background: linear-gradient(90deg, var(--surface) 25%, var(--bg) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.app-card-skeleton:hover {
  transform: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  border-color: var(--border);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.app-card-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.app-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
}

.app-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-card-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-status-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  padding: 3px 9px;
  border-radius: 999px;
  line-height: 1.4;
}

.app-status-dev {
  background: #8a8f98;
}

.app-status-test {
  background: #e0a030;
}

.app-status-prod {
  background: #2fa84f;
}

.play-link {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--hero-bg);
  border: 1px solid var(--hero-border);
  color: var(--hero-text);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-shadow: 0 1px 0 var(--hero-shine-hi), 0 -1px 1px var(--hero-shine-lo);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    inset 0 -2px 4px rgba(0, 0, 0, 0.25),
    0 3px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.play-link::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -25%;
  width: 55%;
  height: 220%;
  background: linear-gradient(75deg, transparent 40%, var(--hero-shine-hi) 48%, transparent 62%);
  pointer-events: none;
}

.play-link:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    inset 0 -2px 4px rgba(0, 0, 0, 0.25),
    0 5px 12px rgba(0, 0, 0, 0.2);
}

.play-link svg {
  position: relative;
  z-index: 1;
  width: 15px;
  height: 15px;
}

.play-link span {
  position: relative;
  z-index: 1;
}

.apk-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.apk-link:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.apk-link svg {
  width: 15px;
  height: 15px;
}

.app-card-desc {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.apps-empty {
  color: var(--text-muted);
  font-style: italic;
}

.apk-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.apk-warning {
  background: rgba(240, 180, 20, 0.12);
  border: 1px solid rgba(240, 180, 20, 0.4);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.9rem;
  margin: 0 0 20px;
}

.apk-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.apk-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.apk-row .app-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.apk-row-name {
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.apk-variants {
  margin: -6px 0 0;
  padding: 0 12px 12px;
  font-size: 0.85rem;
}

.apk-variants summary {
  cursor: pointer;
  color: var(--text-muted);
}

.apk-variants ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0 0 0 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.apk-variants a {
  color: var(--accent, inherit);
  word-break: break-all;
}

.apk-variant-meta {
  color: var(--text-muted);
}

.tester-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 48px;
}

.tester-section > p {
  color: var(--text-muted);
  margin-top: 0;
}

.tester-steps {
  list-style: none;
  margin: 20px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tester-steps li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.tester-step-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tester-steps h3 {
  margin: 2px 0 4px;
  font-size: 1rem;
}

.tester-steps p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.tester-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.tester-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tester-btn-primary {
  background: var(--btn);
  color: #fff;
}

.tester-btn-primary:hover {
  background: var(--btn-hover);
}

.tester-btn-secondary {
  background: transparent;
  color: var(--btn);
  border: 1px solid var(--btn);
}

.tester-btn-secondary:hover {
  background: var(--btn);
  color: #fff;
}

footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 20px;
}

footer p {
  margin: 4px 0;
}

.footer-link {
  color: var(--accent);
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

.back-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.back-link:hover {
  text-decoration: underline;
}

.policy h2 {
  margin-top: 32px;
  font-size: 1.1rem;
}

.policy h2:first-of-type {
  margin-top: 0;
}

.policy p, .policy li {
  color: var(--text);
}

.policy ul {
  padding-left: 20px;
}

.policy .updated {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: -8px;
}
