/* 50Calculators — Premium APK-style UI + Dark/Light */
:root,
[data-theme="light"] {
  --ac-blue: #1565c0;
  --ac-blue-dark: #0d47a1;
  --ac-blue-light: #42a5f5;
  --ac-green: #2e7d32;
  --ac-green-btn: #43a047;
  --ac-orange: #ff9800;
  --ac-bg: #eef2f7;
  --ac-surface: #ffffff;
  --ac-surface-2: #f5f7fa;
  --ac-border: #dde3ec;
  --ac-text: #1a1f2e;
  --ac-text-soft: #5a6478;
  --ac-header: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
  --ac-shadow: 0 4px 20px rgba(13, 71, 161, 0.1);
  --ac-shadow-lg: 0 12px 40px rgba(13, 71, 161, 0.14);
  --ac-radius: 12px;
  --ac-font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --header-h: 58px;
  --mint: #43a047;
  --mint-dark: #2e7d32;
  --mint-light: #66bb6a;
  --smoke: #eef2f7;
  --smoke-dark: #dde3ec;
  --ink: #1a1f2e;
  --ink-soft: #5a6478;
  --white: #ffffff;
  --shadow: var(--ac-shadow);
  --shadow-lg: var(--ac-shadow-lg);
  --radius: var(--ac-radius);
  --radius-sm: 8px;
  --font: var(--ac-font);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --ac-blue: #64b5f6;
  --ac-blue-dark: #42a5f5;
  --ac-bg: #0d1117;
  --ac-surface: #161b22;
  --ac-surface-2: #1c2330;
  --ac-border: #30363d;
  --ac-text: #e6edf3;
  --ac-text-soft: #9aa5b5;
  --ac-header: linear-gradient(135deg, #1a2332 0%, #0d1117 100%);
  --ac-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  --ac-shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.55);
  --smoke: #161b22;
  --smoke-dark: #30363d;
  --ink: #e6edf3;
  --ink-soft: #9aa5b5;
  --white: #161b22;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ac-font);
  background: var(--ac-bg);
  color: var(--ac-text);
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--ac-blue); text-decoration: none; }
a:hover { color: var(--ac-blue-light); }

/* ─── Top bar (APK style) ─── */
.ac-topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--ac-header);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
.ac-topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
}
.ac-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff !important;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.ac-brand:hover { color: #fff !important; opacity: 0.92; }
.ac-brand-logo { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }

.ac-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 1rem;
  flex: 1;
}
.ac-nav > a,
.ac-nav-drop-btn {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.ac-nav > a:hover,
.ac-nav-drop-btn:hover,
.ac-nav > a.active { background: rgba(255, 255, 255, 0.15); color: #fff; }
.ac-nav-drop { position: relative; }
.ac-nav-drop-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  box-shadow: var(--ac-shadow-lg);
  padding: 0.5rem;
  z-index: 300;
}
.ac-nav-drop:hover .ac-nav-drop-menu { display: block; }
.ac-nav-drop-menu a {
  display: block;
  padding: 0.55rem 0.75rem;
  color: var(--ac-text);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
}
.ac-nav-drop-menu a:hover { background: var(--ac-surface-2); color: var(--ac-blue); }

.ac-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}
.ac-icon-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ac-icon-btn:hover { background: rgba(255, 255, 255, 0.22); }

.ac-lang-wrap { position: relative; }
.ac-lang-btn {
  height: 38px;
  padding: 0 0.65rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.ac-lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 280px;
  background: var(--ac-blue);
  border-radius: var(--ac-radius);
  padding: 0.65rem;
  box-shadow: var(--ac-shadow-lg);
  z-index: 400;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
}
.ac-lang-wrap.open .ac-lang-menu { display: grid; }
.ac-lang-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.55rem;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  text-align: left;
  font-family: inherit;
}
.ac-lang-item:hover { background: rgba(255, 255, 255, 0.15); }
.ac-lang-item.active { background: rgba(255, 255, 255, 0.28); font-weight: 800; }

/* Inline APK-style search in topbar */
.ac-search-top {
  display: flex;
  align-items: center;
  position: relative;
}
.ac-search-expand {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: width 0.28s ease, opacity 0.2s ease;
}
.ac-topbar.search-open .ac-search-expand {
  width: min(260px, 42vw);
  opacity: 1;
  pointer-events: auto;
}
.ac-topbar.search-open .ac-search-toggle { display: none; }
.ac-search-expand input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 0.65rem;
  border: none;
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: inherit;
  background: #fff;
  color: #222;
}
.ac-search-x {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
}
.ac-search-x:hover { background: rgba(255, 255, 255, 0.32); }

.ac-search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(360px, 92vw);
  max-height: min(420px, 60vh);
  overflow-y: auto;
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: 14px;
  box-shadow: var(--ac-shadow-lg);
  z-index: 200;
  padding: 0.35rem;
}
.ac-search-results.hidden { display: none; }
.ac-search-empty {
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  color: var(--ac-text-soft);
  text-align: center;
}
.ac-search-hit {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  color: var(--ac-text);
  text-decoration: none;
  transition: background 0.15s;
}
.ac-search-hit:hover,
.ac-search-hit:focus {
  background: var(--ac-surface-2);
  color: var(--ac-blue);
}
.ac-search-hit-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--ac-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
  overflow: hidden;
}
.ac-search-hit-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ac-search-hit-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.ac-search-hit-body strong {
  font-size: 0.84rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-search-hit-body span {
  font-size: 0.7rem;
  color: var(--ac-text-soft);
}
.ac-search-hit-go {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ac-blue);
  flex-shrink: 0;
}

/* APK banner strip below header */
.ac-banner-wrap {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
}
[data-theme="dark"] .ac-banner-wrap {
  background: var(--ac-surface);
  border-color: var(--ac-border);
}
.ac-banner-strip {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.55rem 1rem;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  color: #1a1a1a;
  text-transform: uppercase;
}
[data-theme="dark"] .ac-banner-strip { color: var(--ac-text); }

.ac-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 9px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
}
.ac-hamburger span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* ─── Main layout ─── */
.ac-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}
.ac-content-box {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  box-shadow: var(--ac-shadow);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.ac-section-head {
  background: var(--ac-surface-2);
  border-bottom: 1px solid var(--ac-border);
  padding: 0.75rem 1.15rem;
  font-weight: 800;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ac-text);
}
.ac-section-sub {
  padding: 0.65rem 1.15rem 0;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ac-text);
}

/* APK grid cards */
.ac-apk-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  padding: 1.15rem;
}
.ac-apk-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem;
  border-radius: var(--ac-radius);
  color: var(--ac-text);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
  animation: cardIn 0.45s var(--ease) backwards;
}
.ac-apk-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ac-shadow);
  color: var(--ac-text);
}
.ac-apk-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: var(--ac-surface-2);
  border: 1px solid var(--ac-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 0.55rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.ac-apk-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  min-height: 2.2em;
}
.ac-apk-rating {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0.35rem 0;
}
.ac-star { color: var(--ac-border); font-size: 0.72rem; }
.ac-star.on { color: var(--ac-orange); }
.ac-apk-score { font-size: 0.72rem; color: var(--ac-text-soft); margin-left: 0.15rem; }
.ac-apk-cta {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ac-blue);
  margin-top: 0.15rem;
}
.ac-see-more {
  display: block;
  text-align: center;
  padding: 0.85rem;
  background: var(--ac-blue);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}
.ac-see-more:hover { background: var(--ac-blue-dark); color: #fff !important; }

/* Category premium row */
.ac-cat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 1.15rem;
}
.ac-cat-tile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--ac-surface-2);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  color: var(--ac-text);
  transition: border-color 0.2s, transform 0.2s;
}
.ac-cat-tile:hover {
  border-color: var(--ac-blue);
  transform: translateY(-2px);
  color: var(--ac-text);
}
.ac-cat-tile-icon { font-size: 1.75rem; }
.ac-cat-tile strong { display: block; font-size: 0.88rem; }
.ac-cat-tile span { font-size: 0.72rem; color: var(--ac-text-soft); }

/* Tool detail page (APK layout) */
.ac-breadcrumb {
  font-size: 0.78rem;
  color: var(--ac-text-soft);
  margin-bottom: 1rem;
}
.ac-breadcrumb a { color: var(--ac-blue); }
.ac-detail-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.25rem;
  align-items: start;
}
.ac-detail-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.ac-detail-icon {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  background: var(--ac-surface-2);
  border: 1px solid var(--ac-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.75rem;
  flex-shrink: 0;
}
.ac-detail-title h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  line-height: 1.3;
}
.ac-detail-meta { font-size: 0.82rem; color: var(--ac-text-soft); }
.ac-detail-meta .ac-star.on { font-size: 0.85rem; }
.ac-btn-green {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, var(--ac-green-btn), var(--ac-green));
  color: #fff !important;
  font-weight: 800;
  font-size: 0.92rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(46, 125, 50, 0.35);
  text-decoration: none;
  margin-left: auto;
  align-self: center;
}
.ac-btn-green:hover { transform: translateY(-2px); color: #fff !important; }

.ac-info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.ac-info-table tr:nth-child(odd) { background: var(--ac-surface-2); }
.ac-info-table th,
.ac-info-table td {
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--ac-border);
}
.ac-info-table th {
  width: 38%;
  font-weight: 700;
  color: var(--ac-text-soft);
}

.ac-sidebar h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--ac-blue);
}
.ac-side-item {
  display: flex;
  gap: 0.65rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--ac-border);
  color: var(--ac-text);
}
.ac-side-item:hover { color: var(--ac-blue); }
.ac-side-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--ac-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.ac-side-body strong { display: block; font-size: 0.82rem; line-height: 1.3; }
.ac-side-meta { font-size: 0.7rem; color: var(--ac-text-soft); }
.ac-side-rating { font-size: 0.72rem; color: var(--ac-orange); }

.ac-toc {
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  background: var(--ac-surface-2);
}
.ac-toc h4 { margin: 0 0 0.65rem; text-align: center; font-size: 0.95rem; }
.ac-toc ol { margin: 0; padding-left: 1.25rem; }
.ac-toc a { font-size: 0.85rem; font-weight: 600; }

.ac-rec-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 1rem;
}
.ac-rec-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  color: var(--ac-text);
}
.ac-rec-item:hover { border-color: var(--ac-blue); }
.ac-rec-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--ac-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.ac-rec-body strong { display: block; font-size: 0.78rem; }

/* Legal / static pages */
.ac-legal-page .ac-content-box { padding: 1.5rem 1.75rem; }
.ac-legal-page h1 { margin: 0 0 1rem; font-size: 1.65rem; }
.ac-legal-page h2 { margin: 1.5rem 0 0.65rem; font-size: 1.1rem; color: var(--ac-blue); }
.ac-legal-page p,
.ac-legal-page li { color: var(--ac-text-soft); line-height: 1.75; font-size: 0.92rem; }
.ac-legal-page ul { padding-left: 1.25rem; }

/* Footer */
.ac-footer { margin-top: 2rem; }
.ac-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: center;
  padding: 1rem;
  background: var(--ac-blue);
}
.ac-footer-links a { color: #fff !important; font-size: 0.82rem; font-weight: 600; text-decoration: underline; }
.ac-footer-about {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  padding: 1.5rem;
  margin: 0;
}
.ac-footer-about h3 { margin: 0 0 0.65rem; font-size: 1rem; }
.ac-footer-about p { margin: 0; color: var(--ac-text-soft); font-size: 0.88rem; line-height: 1.65; }
.ac-footer-copy {
  text-align: center;
  padding: 0.85rem;
  background: var(--ac-blue-dark);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.78rem;
}

.ac-top-btn {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 8px;
  background: var(--ac-blue);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: var(--ac-shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 150;
}
.ac-top-btn.visible { opacity: 1; pointer-events: auto; }

.ac-lang-notice {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 9999;
  max-width: min(92vw, 420px);
  padding: 0.65rem 1rem;
  background: #b71c1c;
  color: #fff;
  border-radius: 10px;
  font-size: 0.85rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease;
  pointer-events: none;
}
.ac-lang-notice.show { transform: translateX(-50%) translateY(0); }

/* Calculator form (keep working) */
.sc-main { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem 2rem; }
.sc-calc-wrap { max-width: 100%; margin: 0 auto; }
.ac-calc-premium {
  background: linear-gradient(145deg, rgba(21, 101, 192, 0.06), rgba(46, 125, 50, 0.05));
  border: 2px solid var(--ac-blue);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 32px rgba(21, 101, 192, 0.12);
}
[data-theme="dark"] .ac-calc-premium {
  background: linear-gradient(145deg, rgba(21, 101, 192, 0.15), rgba(13, 27, 42, 0.9));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.ac-calc-premium-label {
  text-align: center;
  margin-bottom: 0.75rem;
}
.ac-calc-premium-label span {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: linear-gradient(135deg, #1565c0, #0d47a1);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
}
.ac-calc-panel {
  background: #fff !important;
  border: 1px solid rgba(21, 101, 192, 0.2) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
}
[data-theme="dark"] .ac-calc-panel {
  background: var(--ac-surface) !important;
  border-color: var(--ac-border) !important;
}
.ac-toc-below {
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  background: var(--ac-surface-2);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
}
.ac-toc-below h4 { margin: 0 0 0.65rem; font-size: 0.9rem; }
.ac-toc-below ol { margin: 0; padding-left: 1.25rem; }
.ac-toc-below a { font-size: 0.85rem; font-weight: 600; }
.ac-detail-img, .ac-rec-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.ac-apk-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}
.ac-side-icon img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.ac-rec-icon img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }

/* Sleep calculator premium */
.sc-sleep-modes { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.sc-sleep-mode {
  flex: 1;
  padding: 0.65rem;
  border: 2px solid var(--ac-border);
  border-radius: 10px;
  background: var(--ac-surface-2);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--ac-text);
}
.sc-sleep-mode.active {
  border-color: var(--ac-blue);
  background: rgba(21, 101, 192, 0.1);
  color: var(--ac-blue);
}
.sc-sleep-results { margin-top: 1rem; }
.sc-sleep-rec {
  padding: 1rem;
  border-radius: 12px;
  border: 2px solid var(--ac-green);
  background: rgba(46, 125, 50, 0.08);
  margin-bottom: 0.75rem;
}
.sc-sleep-rec strong { font-size: 1.35rem; color: var(--ac-green); }
.sc-sleep-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border: 1px solid var(--ac-border);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  background: var(--ac-surface-2);
}
.sc-sleep-card.best { border-color: var(--ac-blue); background: rgba(21, 101, 192, 0.06); }

.sc-panel {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  padding: 1.5rem;
  box-shadow: var(--ac-shadow);
}
.sc-field { margin-bottom: 1rem; }
.sc-field label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: var(--ac-text-soft);
}
.sc-field input,
.sc-field select,
.sc-field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 2px solid var(--ac-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  background: var(--ac-surface-2);
  color: var(--ac-text);
}
.sc-field input:focus,
.sc-field select:focus {
  outline: none;
  border-color: var(--ac-blue);
  background: var(--ac-surface);
}
.sc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.sc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
}
.sc-btn-primary {
  background: linear-gradient(135deg, var(--ac-green-btn), var(--ac-green));
  color: #fff;
  box-shadow: 0 4px 16px rgba(46, 125, 50, 0.3);
}
.sc-btn-ghost { background: var(--ac-surface-2); color: var(--ac-text); }
.sc-result {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: var(--ac-surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--ac-border);
  text-align: center;
}
.sc-result-val { font-size: 1.75rem; font-weight: 800; color: var(--ac-green); }
.sc-result-sub { font-size: 0.85rem; color: var(--ac-text-soft); margin-top: 0.35rem; }

.sc-calc-display {
  width: 100%;
  padding: 1rem;
  font-size: 1.75rem;
  font-weight: 700;
  text-align: right;
  background: #1a2332;
  color: #e6edf3;
  border: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-family: monospace;
}
.sc-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 6px;
  background: #1a2332;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.sc-key {
  padding: 1rem;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  background: #2a3544;
  color: #fff;
  font-family: inherit;
}
.sc-key-fn { background: var(--ac-green); }
.sc-key-op { background: var(--ac-blue); }
.sc-key-wide { grid-column: span 2; }

.sc-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 1.15rem 0.75rem;
}
.sc-cat-btn {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--ac-border);
  border-radius: 999px;
  background: var(--ac-surface);
  color: var(--ac-text-soft);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
}
.sc-cat-btn.active {
  background: var(--ac-blue);
  color: #fff;
  border-color: var(--ac-blue);
}

.sc-empty { text-align: center; padding: 2rem; color: var(--ac-text-soft); }
.hidden { display: none !important; }
.sc-back { font-weight: 600; font-size: 0.88rem; margin-bottom: 1rem; display: inline-block; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* APK-style sidebar drawer (3-dot menu) */
.ac-menu-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
}
.ac-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 280;
}
.ac-drawer-overlay.open { display: block; }
.ac-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(300px, 88vw);
  background: var(--ac-surface);
  z-index: 300;
  transform: translateX(-105%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.ac-drawer.open { transform: translateX(0); }
.ac-drawer-head { padding: 0.75rem; border-bottom: 1px solid var(--ac-border); }
.ac-drawer-close {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: var(--ac-blue);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
}
.ac-drawer-home {
  display: block;
  padding: 0.85rem 1rem;
  font-weight: 800;
  color: var(--ac-text);
  border-bottom: 1px solid var(--ac-border);
}
.ac-drawer-section { padding: 0.5rem 0; }
.ac-drawer-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.ac-drawer-label {
  padding: 0.5rem 1rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ac-text-soft);
}
.ac-drawer-cats, .ac-drawer-tools { display: flex; flex-direction: column; }
.ac-drawer-cat, .ac-drawer-tool {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1rem;
  color: var(--ac-text);
  font-size: 0.88rem;
  font-weight: 600;
  border-bottom: 1px solid var(--ac-border);
}
.ac-drawer-cat:hover, .ac-drawer-tool:hover { background: var(--ac-surface-2); color: var(--ac-blue); }
.ac-drawer-cat-ico { font-size: 1.15rem; width: 28px; text-align: center; }
.ac-drawer-tool-img { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; }
.ac-drawer-foot {
  margin-top: auto;
  padding: 0.75rem 1rem;
  border-top: 2px solid var(--ac-blue);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--ac-surface-2);
}
.ac-drawer-foot a { font-size: 0.85rem; font-weight: 700; color: var(--ac-blue); }
body.ac-drawer-open { overflow: hidden; }

/* Premium About page */
.ac-about-page { padding: 0.5rem 0; }
.ac-about-hero h1 { margin: 0 0 0.75rem; color: var(--ac-blue); font-size: 1.75rem; }
.ac-about-lead { font-size: 1rem; line-height: 1.7; color: var(--ac-text-soft); }
.ac-about-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 1.25rem 0;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(21, 101, 192, 0.08), rgba(46, 125, 50, 0.06));
  border-radius: 12px;
  border: 1px solid var(--ac-border);
}
.ac-about-stats strong { display: block; font-size: 1.5rem; color: var(--ac-blue); }
.ac-about-stats span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ac-text-soft); }
.ac-about-list { line-height: 1.9; padding-left: 1.25rem; }
.ac-about-custom { margin: 1.25rem 0; padding-top: 0.5rem; border-top: 1px solid var(--ac-border); }
.ac-about-custom h2 { margin-top: 1rem; }
.ac-about-cat-head { margin: 1.5rem 0 0.75rem; font-size: 1.05rem; }
.ac-about-calc-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.ac-about-foot { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--ac-border); font-size: 0.85rem; color: var(--ac-text-soft); }

@media (max-width: 1024px) {
  .ac-about-calc-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
  .ac-about-calc-grid { grid-template-columns: repeat(3, 1fr); }
  .ac-nav { display: none !important; }
}
/* Legacy compat */
.sc-header { display: none; }
.sc-footer { display: none; }

@media (max-width: 1024px) {
  .ac-apk-grid { grid-template-columns: repeat(4, 1fr); }
  .ac-detail-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .ac-hamburger { display: flex; }
  .ac-topbar.search-open .ac-lang-wrap,
  .ac-topbar.search-open .ac-theme-btn { display: none; }
  .ac-topbar.search-open .ac-search-expand { width: min(210px, 58vw); }
  .ac-nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    width: min(280px, 88vw);
    flex-direction: column;
    align-items: stretch;
    background: var(--ac-surface);
    border-left: 1px solid var(--ac-border);
    padding: 1rem;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    margin: 0;
    z-index: 250;
  }
  .ac-nav.sc-nav-open { transform: translateX(0); }
  .ac-nav > a,
  .ac-nav-drop-btn { color: var(--ac-text); }
  .ac-nav-drop-menu {
    position: static;
    display: block;
    box-shadow: none;
    border: none;
    padding: 0 0 0 0.5rem;
  }
  .ac-apk-grid { grid-template-columns: repeat(3, 1fr); gap: 0.65rem; }
  .ac-cat-row { grid-template-columns: 1fr; }
  .ac-rec-row { grid-template-columns: 1fr; }
  .ac-detail-head { flex-direction: column; }
  .ac-btn-green { margin-left: 0; width: 100%; }
}
@media (max-width: 480px) {
  .ac-apk-grid { grid-template-columns: repeat(2, 1fr); }
  .ac-lang-menu { width: 240px; grid-template-columns: 1fr; }
  .sc-row { grid-template-columns: 1fr; }
}

body.sc-menu-open::before {
  content: '';
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
}
