:root {
  --blue-900: #0f3555;
  --blue-700: #155581;
  --blue-600: #1c74ad;
  --blue-400: #5aa3d6;
  --blue-100: #e4f0fa;
  --orange-600: #e07d12;
  --orange-500: #f0921e;
  --orange-300: #f7b768;
  --orange-100: #fdf0dd;
  --page-bg: #e7ecf1;
  --paper: #eef2f6;
  --card: #ffffff;
  --ink: #182b3a;
  --ink-soft: #5b7186;
  --line: #d6e0e8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page-bg: #0b1620;
    --paper: #0e1b26;
    --card: #122230;
    --ink: #e9f1f7;
    --ink-soft: #93a8b8;
    --line: #1e3140;
    --blue-100: #173349;
    --orange-100: #2a1f10;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(900px 420px at 15% -10%, color-mix(in srgb, var(--blue-600) 12%, transparent), transparent),
    radial-gradient(700px 420px at 100% 0%, color-mix(in srgb, var(--orange-500) 10%, transparent), transparent),
    var(--page-bg);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--paper);
  box-shadow: 0 0 60px rgba(15, 53, 85, 0.12);
  padding: max(20px, env(safe-area-inset-top)) 20px max(40px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* ---- brand header ---- */
.brand-header {
  background: #fff;
  margin: -20px -20px 18px;
  padding: 10px 16px;
  display: flex;
  justify-content: center;
  border-radius: 0 0 18px 18px;
}
.brand-header img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 360px;
  object-fit: contain;
}

.screen-title {
  margin: 18px 0 2px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--ink);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.screen-sub {
  margin: 0 0 18px;
  font-size: 11.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- category bands ---- */
.cat-list {
  display: flex;
  flex-direction: column;
  margin: 4px -20px 0;
}

.cat-band {
  padding: 20px 20px 22px;
}
.cat-band--a { background: #dbe8f2; }
.cat-band--b { background: #eef1f3; }
.cat-band--c { background: #e3f3ea; }

.cat-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.cat-apps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-btn {
  display: block;
  width: 100%;
  background: var(--blue-900);
  color: #fff;
  text-decoration: none;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: 0 4px 10px -4px rgba(15, 53, 85, 0.5);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  min-height: 48px;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.app-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 14px -6px rgba(15, 53, 85, 0.55); }
.app-btn:active { transform: translateY(0); }
.app-btn:focus-visible { outline: 2px solid var(--orange-300); outline-offset: 2px; }
.app-btn--opening {
  opacity: 0.72;
  pointer-events: none;
}

@media (max-width: 360px) {
  .app-shell { padding-left: 16px; padding-right: 16px; }
  .brand-header { margin-left: -16px; margin-right: -16px; }
  .cat-list { margin-left: -16px; margin-right: -16px; }
  .cat-band { padding-left: 16px; padding-right: 16px; }
  .screen-title { font-size: 17px; }
  .screen-sub { white-space: normal; line-height: 1.4; }
}

@media (min-width: 700px) {
  .app-shell { max-width: 760px; }
  .cat-apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.cat-empty {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

/* ---- detail pages ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  color: var(--blue-700);
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
  margin-bottom: 20px;
}
.back-link svg { stroke: var(--blue-700); }

.detail-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 8px 0 6px;
}
.detail-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--blue-600);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px -10px rgba(15, 53, 85, 0.55);
}
.detail-icon svg { width: 34px; height: 34px; stroke: #fff; }
.detail-hero h1 {
  margin: 0;
  font-size: 21px;
  color: var(--ink);
}

.detail-placeholder {
  margin: 26px 0 0;
  padding: 20px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  background: var(--card);
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}
.detail-placeholder .tag {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange-600);
  background: var(--orange-100);
  border-radius: 999px;
  padding: 3px 10px;
}

.footer-note {
  margin-top: auto;
  padding-top: 30px;
  text-align: center;
  font-size: 11px;
  color: var(--ink-soft);
}
