/* =========================================================================
   Apple-grade design system for bestlatestapps.com
   Hand-authored, framework-free. Semantic classes + strong base typography.
   ========================================================================= */

/* ----------------------------------------------------------------- tokens */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";

  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --bg-3: #fafafc;
  --accent: #0066cc;
  --accent-hover: #0077ed;
  --border: #d2d2d7;
  --border-2: #e8e8ed;

  --ok: #1d7a3e;
  --bad: #c4283c;
  --star: #f5a623;

  --radius: 18px;
  --radius-lg: 22px;
  --radius-sm: 12px;
  --radius-pill: 980px;

  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);

  --maxw: 980px;
  --maxw-wide: 1120px;
  --nav-h: 48px;
}

/* --------------------------------------------------------------- reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------- base typography */
h1,
h2,
h3,
h4 {
  color: var(--text);
  letter-spacing: -0.022em;
  line-height: 1.08;
  margin: 0 0 0.5em;
  font-weight: 600;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.4rem, 6vw, 3.75rem);
  font-weight: 700;
}
h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.25rem);
}
h3 {
  font-size: 1.3rem;
}
h4 {
  font-size: 1.05rem;
}

p {
  margin: 0 0 1em;
  color: var(--text-2);
}

ul,
ol {
  margin: 0 0 1em;
  padding-inline-start: 1.25em;
  color: var(--text-2);
}
li {
  margin: 0.3em 0;
}

blockquote {
  margin: 0 0 1em;
  padding: 0.25em 0 0.25em 1.1em;
  border-inline-start: 3px solid var(--border);
  color: var(--text-2);
  font-style: normal;
}

hr {
  border: 0;
  border-top: 1px solid var(--border-2);
  margin: 2.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1em;
  font-size: 0.95rem;
}
th,
td {
  text-align: start;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-2);
  vertical-align: top;
}
th {
  color: var(--text-3);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

code,
pre {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

::selection {
  background: rgba(0, 102, 204, 0.18);
}

/* ------------------------------------------------------------- layout */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 22px;
}
.wrap-wide {
  max-width: var(--maxw-wide);
}

main {
  flex: 1 0 auto;
}

.section {
  margin: 2.5rem 0;
}
.muted {
  color: var(--text-3);
}
.center {
  text-align: center;
}

/* --------------------------------------------------------------- nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-2);
}
.nav-in {
  max-width: var(--maxw-wide);
  margin-inline: auto;
  padding-inline: 22px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text);
}
.nav-brand:hover {
  text-decoration: none;
  opacity: 0.75;
}
.nav-brand img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: contain;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.85rem;
}
.nav-links a {
  color: var(--text-2);
}
.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius-pill);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease;
}
.btn:hover {
  text-decoration: none;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
}
.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: transparent;
  padding-inline: 0.4rem;
}
.btn-secondary:hover {
  text-decoration: underline;
}
.btn-store {
  background: #000;
  color: #fff;
  padding: 0.7rem 1.4rem;
}
.btn-store:hover {
  background: #1a1a1a;
}
.btn-store svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.btn-lg {
  padding: 0.9rem 1.8rem;
  font-size: 1.05rem;
}

/* --------------------------------------------------------------- hero */
.hero {
  max-width: 820px;
  margin-inline: auto;
  padding: 4.5rem 22px 2.5rem;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.hero h1 {
  margin-bottom: 0.6rem;
}
.hero-sub {
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  color: var(--text-2);
  line-height: 1.4;
  max-width: 640px;
  margin: 0 auto 1.5rem;
  letter-spacing: -0.012em;
}
.hero-icon {
  width: 108px;
  height: 108px;
  border-radius: 24px;
  margin: 0 auto 1.5rem;
  box-shadow: var(--shadow);
  object-fit: contain;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

/* --------------------------------------------------------------- cards */
.card {
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.card > :last-child,
.section > :last-child {
  margin-bottom: 0;
}
.card-flat {
  background: var(--bg-2);
  border: none;
  box-shadow: none;
}

/* card grid layouts */
.grid {
  display: grid;
  gap: 1.25rem;
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* content + sidebar split */
.layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: start;
}
.layout > .side {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  display: grid;
  gap: 1.25rem;
}
.stack {
  display: grid;
  gap: 1.25rem;
}

/* --------------------------------------------------------- quick answer */
.quick {
  background: var(--bg-2);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.4rem;
  margin-bottom: 2rem;
}
.quick .label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-inline-end: 0.6rem;
}
.quick .meta {
  font-size: 0.72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.quick p {
  margin: 0.6rem 0 0;
  color: var(--text);
}

/* ------------------------------------------------------------- info list */
.info h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-bottom: 0.75rem;
}
.info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border-2);
  font-size: 0.92rem;
}
.info-row:last-child {
  border-bottom: 0;
}
.info-row .k {
  color: var(--text-3);
}
.info-row .v {
  color: var(--text);
  font-weight: 500;
  text-align: end;
}

/* --------------------------------------------------------- pros / cons */
.proscons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.proscons h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}
.proscons .pros h4 {
  color: var(--ok);
}
.proscons .cons h4 {
  color: var(--bad);
}
.proscons ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.92rem;
}
.proscons li {
  padding-inline-start: 1.4em;
  position: relative;
}
.proscons .pros li::before {
  content: "\2713";
  position: absolute;
  inset-inline-start: 0;
  color: var(--ok);
  font-weight: 600;
}
.proscons .cons li::before {
  content: "\2212";
  position: absolute;
  inset-inline-start: 0;
  color: var(--bad);
  font-weight: 600;
}

/* ranked app card */
.rankcard {
  display: grid;
  gap: 1.1rem;
}
.rankcard .head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.rankcard .rank {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--bg-2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  flex: none;
}
.rankcard.featured .rank {
  background: var(--accent);
  color: #fff;
}
.rankcard .head h2,
.rankcard .head h3 {
  margin: 0;
  font-size: 1.15rem;
}
.tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: rgba(0, 102, 204, 0.08);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.7rem;
}

/* --------------------------------------------------------------- chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--bg-2);
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.85rem;
}

/* --------------------------------------------------------------- stars */
.stars {
  color: var(--star);
  letter-spacing: 0.05em;
}

/* --------------------------------------------------------------- faq */
.faq {
  display: grid;
  gap: 0.75rem;
}
.faq-item {
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
}
.faq-item h3 {
  font-size: 1.02rem;
  margin-bottom: 0.4rem;
}
.faq-item p {
  margin: 0;
  font-size: 0.95rem;
}

/* --------------------------------------------------------------- table card */
.tablecard {
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.tablecard table {
  margin: 0;
}
.tablecard th,
.tablecard td {
  padding: 0.85rem 1.1rem;
}
.tablecard tbody tr:last-child td {
  border-bottom: 0;
}

/* --------------------------------------------------------------- cta */
.cta {
  text-align: center;
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  margin: 3.5rem 0 1rem;
}
.cta h2 {
  margin-bottom: 0.5rem;
}
.cta p {
  max-width: 460px;
  margin: 0 auto 1.5rem;
}

/* --------------------------------------------------------- gallery / phone */
.gallery {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.gallery::-webkit-scrollbar {
  height: 6px;
}
.gallery::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.phone {
  flex: none;
  width: 220px;
  border-radius: 26px;
  border: 1px solid var(--border-2);
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--bg-2);
  box-shadow: var(--shadow);
}
.phone.ipad {
  width: 320px;
  border-radius: 18px;
}

/* --------------------------------------------------------- rating banner */
.rating-banner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.rating-banner .score {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}
.rating-banner .stars {
  font-size: 1.3rem;
}

/* review blockquote */
.review {
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  background: var(--bg);
}
.review .stars {
  font-size: 0.95rem;
}
.review .who {
  color: var(--text-3);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* related links */
.related ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1.5rem;
}
.related a {
  font-weight: 500;
}

/* --------------------------------------------------------- app grid (home) */
.appgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.appgrid .app {
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  background: var(--bg);
  transition: box-shadow 0.2s ease, transform 0.1s ease;
}
.appgrid .app:hover {
  box-shadow: var(--shadow);
}
.appgrid .app .top {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.75rem;
}
.appgrid .app img {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  object-fit: contain;
  flex: none;
}
.appgrid .app h3 {
  margin: 0;
  font-size: 1.05rem;
}
.appgrid details summary {
  cursor: pointer;
  color: var(--text-3);
  font-size: 0.85rem;
  list-style: none;
}
.appgrid details summary::-webkit-details-marker {
  display: none;
}
.appgrid details ul {
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}

/* --------------------------------------------------------- breadcrumb */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--text-3);
  padding: 1rem 0 0;
}
.breadcrumb a {
  color: var(--text-2);
}
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin: 0;
}
.breadcrumb li:not(:last-child)::after {
  content: "\203a";
  margin-inline-start: 0.4rem;
  color: var(--border);
}

/* --------------------------------------------------------------- footer */
.footer {
  border-top: 1px solid var(--border-2);
  background: var(--bg-2);
  color: var(--text-3);
  padding: 2.5rem 0;
  font-size: 0.82rem;
  margin-top: 3rem;
}
.footer-in {
  max-width: var(--maxw-wide);
  margin-inline: auto;
  padding-inline: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}
.footer nav a {
  color: var(--text-2);
}
.footer .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-2);
}
.footer .brand img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.7;
}

/* --------------------------------------------------- feature/step lists */
.numbered {
  display: grid;
  gap: 1rem;
  counter-reset: step;
}
.numbered .item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
}
.numbered .item::before {
  counter-increment: step;
  content: counter(step);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-pill);
  background: var(--bg-2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}
.numbered .item h3 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}
.numbered .item p {
  margin: 0;
  font-size: 0.95rem;
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .layout > .side {
    position: static;
  }
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .proscons {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .related ul {
    grid-template-columns: 1fr;
  }
  .nav-links {
    gap: 1rem;
  }
  .hero {
    padding-top: 3rem;
  }
}

/* --------------------------------------------------------------- rtl */
[dir="rtl"] body {
  letter-spacing: 0;
}
[dir="rtl"] .quick {
  border-inline-start: 3px solid var(--accent);
}

/* imported-content safety: neutralize leftover decorative utilities that may
   survive class-stripping on re-shelled pages. */
.blur-3xl,
.bg-gradient-to-b,
.bg-gradient-to-r {
  background: none !important;
  filter: none !important;
}
