:root {
  --ink: #1B1E27;
  --bg: #F7F7FA;
  --surface: #FFFFFF;
  --surface-2: #F0F1F6;
  --border: #E3E4EC;
  --brand: #F2790C;
  --brand-strong: #D9640A;
  --brand-soft: #FFF1E2;
  --accent: #1E9463;
  --info: #2E7DD6;
  --warn: #B7791F;
  --danger: #D6483B;
  --muted: #666B80;
  --font-body: "Segoe UI", "Work Sans", system-ui, sans-serif;
  --font-mono: "SF Mono", "IBM Plex Mono", Menlo, monospace;
  --maxw: 1200px;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; font-weight: 700; }
p { margin: 0; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-whatsapp { background: #25D366; color: #fff; }
.btn-whatsapp:hover { background: #1FB958; }
.btn-block { width: 100%; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; }
.logo .mark { width: 32px; height: 32px; color: var(--brand); }

nav.primary-nav ul { display: flex; gap: 26px; }
nav.primary-nav a { font-size: 0.92rem; font-weight: 600; color: var(--muted); }
nav.primary-nav a:hover { color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.mobile-nav { display: none; }

.header-search {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 4px 4px 16px;
  transition: border-color 0.15s ease;
}
.header-search:focus-within { border-color: var(--brand); }
.header-search input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.88rem;
  width: 130px;
  max-width: 32vw;
  color: var(--ink);
  font-family: inherit;
}
.header-search input::placeholder { color: var(--muted); }
.header-search button {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}
.header-search button:hover { background: var(--brand-strong); }
.header-search svg { width: 16px; height: 16px; }

@media (max-width: 860px) {
  nav.primary-nav { display: none; }
  .header-actions .btn-ghost { display: none; }
  .header-search input { width: 100px; }
  .mobile-nav { display: block; }
  .mobile-nav summary {
    list-style: none;
    cursor: pointer;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
  }
  .mobile-nav summary::-webkit-details-marker { display: none; }
  .mobile-nav .sheet {
    position: absolute;
    right: 24px;
    top: 60px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 12px 30px -12px rgba(20,20,30,0.25);
    min-width: 200px;
  }
  .mobile-nav .sheet a { display: block; padding: 12px; border-radius: 8px; font-weight: 600; min-height: 48px; display: flex; align-items: center; }
  .mobile-nav .sheet a:hover { background: var(--surface-2); }
}

/* ---------- hero / search ---------- */
.hero {
  padding: 56px 0 40px;
  text-align: center;
}
.hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 700;
}
.hero h1 { font-size: clamp(1.8rem, 3vw + 0.6rem, 2.6rem); margin-top: 12px; }
.hero .sub { margin-top: 12px; color: var(--muted); max-width: 56ch; margin-inline: auto; font-size: 1.05rem; }

.search-box {
  margin: 32px auto 0;
  max-width: 640px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px 8px 6px 18px;
  box-shadow: 0 12px 30px -18px rgba(20,20,30,0.2);
}
.search-box svg { width: 22px; height: 22px; color: var(--muted); flex-shrink: 0; }
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  min-height: 48px;
  color: var(--ink);
  font-family: inherit;
}
.search-box .btn { flex-shrink: 0; }

.category-chips {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
}
.chip.is-active, .chip:hover { color: var(--brand); border-color: var(--brand); }

/* ---------- directory grid ---------- */
section.directory { padding: 48px 0 88px; }
.section-head { margin-bottom: 28px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.4rem; }
.section-head .count { color: var(--muted); font-size: 0.9rem; font-family: var(--font-mono); }

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media (max-width: 1080px) {
  .app-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .app-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .app-grid { grid-template-columns: 1fr; }
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.app-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.app-card-top { display: flex; align-items: center; gap: 12px; }
.app-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  color: var(--brand);
  flex-shrink: 0;
}
.app-card h3 { font-size: 1.02rem; }
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  width: fit-content;
}
.status-badge.working { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.status-badge.activated { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.status-badge.updated { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.status-badge.new { background: var(--brand); color: #fff; }
.status-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- download buttons ---------- */
.download-row {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.download-row .btn {
  flex: 1 1 200px;
}
.download-row .btn svg { width: 18px; height: 18px; }

.app-card p.desc { color: var(--muted); font-size: 0.88rem; flex-grow: 1; }
.app-card .meta { font-size: 0.78rem; color: var(--muted); font-family: var(--font-mono); }
.app-card .btn { margin-top: 4px; }

/* ---------- how it works ---------- */
section.flow { padding: 60px 0; background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.flow-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  margin-top: 32px;
}
@media (max-width: 860px) { .flow-steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .flow-steps { grid-template-columns: 1fr; } }
.flow-step { text-align: left; }
.flow-step .num { font-family: var(--font-mono); font-weight: 800; font-size: 1.6rem; color: var(--brand); }
.flow-step h4 { margin-top: 8px; font-size: 1rem; }
.flow-step p { margin-top: 6px; color: var(--muted); font-size: 0.88rem; }

/* ---------- compatibility ---------- */
section.compat { padding: 72px 0; }
.compat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 32px;
}
@media (max-width: 860px) { .compat-grid { grid-template-columns: 1fr; } }
.compat-card {
  border-radius: var(--radius);
  padding: 26px;
  border: 1px solid var(--border);
}
.compat-card.yes { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }
.compat-card.no { background: var(--surface-2); }
.compat-card h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.compat-card h3 svg { width: 20px; height: 20px; flex-shrink: 0; }
.compat-card.yes h3 svg { color: var(--accent); }
.compat-card.no h3 svg { color: var(--danger); }
.compat-card ul { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.compat-card li { font-size: 0.92rem; color: var(--ink); }
.compat-card.no p.note { margin-top: 14px; color: var(--muted); font-size: 0.88rem; }
.device-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border));
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---------- faq ---------- */
section.faq { padding: 72px 0; background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.faq-list { display: flex; flex-direction: column; gap: 10px; max-width: 820px; margin-top: 28px; }
details.faq-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 22px;
}
details.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-weight: 700;
  font-size: 0.98rem;
  min-height: 48px;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item .chev { width: 20px; height: 20px; color: var(--muted); transition: transform 0.2s ease; flex-shrink: 0; }
details.faq-item[open] .chev { transform: rotate(180deg); }
details.faq-item .a { padding: 0 0 18px; color: var(--muted); font-size: 0.92rem; max-width: 68ch; }
details.faq-item .a strong, details.faq-item .a em { color: var(--ink); }

/* ---------- footer ---------- */
footer.site-footer { padding: 48px 0 28px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-brand p { margin-top: 10px; color: var(--muted); font-size: 0.88rem; max-width: 32ch; }
.footer-col h5 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-family: var(--font-mono); }
.footer-col ul { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.footer-col a { font-size: 0.9rem; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom { padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 0.8rem; color: var(--muted); }

/* ================= APP DETAIL PAGE ================= */
.breadcrumb { font-size: 0.85rem; color: var(--muted); padding: 18px 0 0; }
.breadcrumb a:hover { color: var(--brand); }

.app-detail {
  padding: 24px 0 72px;
}
.app-detail .wrap {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 980px) {
  .app-detail .wrap { grid-template-columns: 1fr; }
}

.app-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.app-detail-header .app-icon { width: 56px; height: 56px; font-size: 1.3rem; border-radius: 14px; }
.app-detail-header h1 { font-size: 1.5rem; }
.verified-line { margin-top: 4px; font-size: 0.82rem; color: var(--muted); font-family: var(--font-mono); }

/* code panel — top priority on mobile */
.code-panel {
  background: var(--ink);
  color: #F4F5FA;
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.code-panel .code-label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: #A9AEC4; }
.code-panel .code-value { font-family: var(--font-mono); font-size: 2.1rem; font-weight: 700; letter-spacing: 0.1em; margin-top: 4px; color: #fff; }
.code-copy {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px;
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  transition: background 0.15s ease;
}
.code-copy:hover { background: var(--brand-strong); }
.code-copy.copied { background: var(--accent); }
.code-copy svg { width: 18px; height: 18px; }

.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
}
.content-card h2 { font-size: 1.15rem; }
.content-card > p.lead { margin-top: 8px; color: var(--muted); font-size: 0.92rem; }

.tutorial-steps { margin-top: 18px; display: flex; flex-direction: column; gap: 16px; }
.tutorial-steps li { display: flex; gap: 14px; align-items: flex-start; }
.tutorial-steps .t-num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.82rem;
}
.tutorial-steps strong { display: block; font-size: 0.95rem; }
.tutorial-steps span { color: var(--muted); font-size: 0.88rem; }

.info-list { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.info-list li { display: flex; justify-content: space-between; font-size: 0.9rem; border-bottom: 1px dashed var(--border); padding-bottom: 10px; }
.info-list li span:first-child { color: var(--muted); }
.info-list li span:last-child { font-weight: 600; }

/* sidebar — sticky, never covers content */
.app-sidebar {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.sidebar-card h3 { font-size: 1rem; }
.mini-plan { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.mini-plan:last-of-type { border-bottom: none; }
.mini-plan .plan-name { font-weight: 600; font-size: 0.92rem; }
.mini-plan .plan-price { font-family: var(--font-mono); font-weight: 700; color: var(--brand); font-size: 0.95rem; }
.sidebar-card .btn { margin-top: 14px; }

.help-list { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.help-list a { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--muted); min-height: 32px; }
.help-list a:hover { color: var(--brand); }
.help-list svg { width: 16px; height: 16px; flex-shrink: 0; }

.wa-card { background: color-mix(in srgb, #25D366 10%, var(--surface)); border-color: color-mix(in srgb, #25D366 30%, var(--border)); }
.wa-card p { margin-top: 6px; color: var(--muted); font-size: 0.88rem; }

.other-apps { margin-top: 20px; }
.other-apps ul { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.other-apps a { display: flex; align-items: center; justify-content: space-between; font-size: 0.9rem; padding: 8px 0; }
.other-apps a:hover { color: var(--brand); }

/* ---------- whatsapp float ---------- */
.whatsapp-float {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 70;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: #25D366;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 28px -10px rgba(0,0,0,0.35);
  transition: transform 0.15s ease;
}
.whatsapp-float:hover { transform: translateY(-3px); }
.whatsapp-float svg { width: 30px; height: 30px; color: #fff; }

/* bottom nav — mobile only, optional */
.bottom-nav {
  display: none;
}
@media (max-width: 640px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--muted);
    min-width: 48px;
    min-height: 48px;
    justify-content: center;
    border-radius: 8px;
  }
  .bottom-nav a.is-active { color: var(--brand); }
  .bottom-nav svg { width: 20px; height: 20px; }

  /* body needs bottom padding so bottom-nav never covers content */
  body.has-bottom-nav { padding-bottom: 62px; }
  /* whatsapp float must clear the bottom nav */
  body.has-bottom-nav .whatsapp-float { bottom: 76px; right: 16px; width: 52px; height: 52px; }
  body.has-bottom-nav .whatsapp-float svg { width: 26px; height: 26px; }
}

@media (max-width: 640px) {
  .hero { padding: 32px 0 28px; text-align: left; }
  .hero .sub { margin-inline: 0; }
  .search-box { margin-left: 0; margin-right: 0; }
  section.directory { padding: 32px 0 56px; }
  .code-panel { padding: 18px; }
  .code-panel .code-value { font-size: 1.7rem; }
  .app-detail { padding: 12px 0 40px; }
  .content-card { padding: 18px; }
  .header-search { padding-left: 10px; }
  .header-search input { width: 72px; font-size: 0.82rem; }
}
