/* =============================================
   Toolance – Global Styles
   Colors: primary #0A568E | secondary #002A4A
           black #000000 | white #ffffff
   ============================================= */

:root {
  --primary: #0A568E;
  --secondary: #002A4A;
  --black: #000000;
  --white: #ffffff;
  --surface: rgba(10, 86, 142, 0.05);
  --surface-strong: rgba(10, 86, 142, 0.08);
  --cta-bg: #f2f5f8;
  --border: rgba(10, 86, 142, 0.12);
  --header-height: 72px;
  --transition: 0.3s ease;
  --shadow: 0 4px 24px rgba(0, 42, 74, 0.1);
  --shadow-lg: 0 12px 40px rgba(0, 42, 74, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--black);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =============================================
   Header
   ============================================= */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--white);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 16px;
}

/* Logo */
.header-logo img {
  height: 38px;
  width: auto;
}

/* Desktop Navigation */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.nav-item {
  position: relative;
}

.nav-item.has-mega {
  position: relative;
}

.nav-item.has-mega--compact {
  position: relative;
}

.nav-item.has-mega:hover > .nav-link,
.nav-item.has-mega--compact:hover > .nav-link {
  background: var(--white);
  color: var(--primary);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.nav-item.has-mega:hover > .nav-link .chevron,
.nav-item.has-mega--compact:hover > .nav-link .chevron {
  transform: rotate(180deg);
}

/* Hover bridge so cursor can reach mega menu */
.nav-item.has-mega::after,
.nav-item.has-mega--compact::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 14px;
  z-index: 1002;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--secondary);
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  background: var(--white);
  color: var(--primary);
}

.nav-link .chevron {
  width: 14px;
  height: 14px;
  transition: transform var(--transition);
}

/* Mega Menu – shared */
.mega-menu {
  background: var(--white);
  border: none;
  box-shadow: 0 12px 40px rgba(0, 42, 74, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 1001;
}

/* Full-width calculators mega menu */
.mega-menu--full {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  width: 100%;
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 20px 0 22px;
  transform: translateY(-4px);
  border-radius: 0;
  border: none;
  background: var(--white);
  box-shadow: 0 8px 32px rgba(0, 42, 74, 0.12);
}

.mega-menu--full::before {
  content: '';
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  height: 16px;
}

.nav-item.has-mega:hover .mega-menu--full {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.mega-menu-inner {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 56px;
}

/* Mega menu body layout */
.mega-menu-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Section header (icon pill + title) */
.mega-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(10, 86, 142, 0.18);
}

.mega-head-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 7px;
  flex-shrink: 0;
}

.mega-head-icon svg {
  width: 14px;
  height: 14px;
  color: var(--white);
}

.mega-head-text {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height: 1.2;
  color: var(--secondary);
}

/* Core calculators block */
.mega-section--core {
  background: rgba(10, 86, 142, 0.05);
  border-radius: 10px;
  padding: 16px 22px 14px;
}

.mega-links {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Core: 5 equal columns, 3 neat rows */
.mega-links.mega-core-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px 18px;
}

/* Wide cards: 4-column link grid */
.mega-links--quad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px 14px;
}

/* Compact cards: links flow horizontally */
.mega-links--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.mega-links--inline a {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Category rows */
.mega-menu-categories {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mega-cat-row {
  display: grid;
  gap: 12px;
}

.mega-cat-row--wide {
  grid-template-columns: 1fr 1fr;
}

.mega-cat-row--compact {
  grid-template-columns: repeat(3, 1fr);
}

.mega-card {
  background: var(--white);
  border: 1px solid rgba(10, 86, 142, 0.12);
  border-radius: 10px;
  padding: 14px 16px;
}

.mega-card--wide {
  min-height: 0;
}

.mega-card--compact {
  padding: 12px 16px;
}

.mega-card .mega-section-head {
  margin-bottom: 10px;
  padding-bottom: 8px;
}

.mega-card .mega-head-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.mega-card .mega-head-icon svg {
  width: 12px;
  height: 12px;
}

.mega-card .mega-head-text {
  font-size: 10px;
  color: var(--primary);
}
.mega-menu--compact {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 240px;
  padding: 10px;
  border-radius: 12px;
  transform: translateY(6px);
  background: var(--white);
  box-shadow: 0 8px 28px rgba(0, 42, 74, 0.14);
}

.nav-item.has-mega--compact:hover .mega-menu--compact {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* Expense Tracker mega menu (rich card panel) */
.mega-menu--expense {
  width: 500px;
  max-width: calc(100vw - 40px);
  padding: 14px;
}

.expense-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.expense-menu-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color var(--transition), box-shadow var(--transition), transform 0.2s ease;
}

.expense-menu-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.expense-menu-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: 10px;
  color: var(--primary);
  transition: background var(--transition), color var(--transition);
}

.expense-menu-icon svg {
  width: 20px;
  height: 20px;
}

.expense-menu-card:hover .expense-menu-icon {
  background: var(--primary);
  color: var(--white);
}

.expense-menu-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 2px;
}

.expense-menu-text span {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  color: var(--primary);
}

.mega-menu-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mega-links a,
.mega-menu-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--secondary);
  border-radius: 6px;
  transition: background var(--transition), color var(--transition), transform 0.15s ease;
}

.mega-links a svg,
.mega-menu-list a svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--primary);
  opacity: 0.85;
}

/* Inline SVG menu icons (e.g. Expense Tracker items) */
.menu-icon-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mega-menu-list a .menu-icon-svg svg,
.drawer-submenu a .menu-icon-svg svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
  opacity: 1;
}

/* App tool icon images */
.tool-icon-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

/* Feature icons inside mega menu only */
.mega-links a .tool-icon-img,
.mega-menu-list a .tool-icon-img {
  width: 22px;
  height: 22px;
}

.tool-icon-img--head {
  width: 22px;
  height: 22px;
}

.tool-icon-img--card {
  width: 28px;
  height: 28px;
}

.tool-icon-img--chip {
  width: 16px;
  height: 16px;
}

.tool-icon-img--cat {
  width: 20px;
  height: 20px;
}

.tool-icon-img--pill {
  width: 14px;
  height: 14px;
}

.tool-icon-img--feature {
  width: 18px;
  height: 18px;
}

.tool-icon-img--expense {
  width: 32px;
  height: 32px;
  margin: 0 auto 10px;
}

.mega-head-icon--img {
  background: var(--surface);
  border: 1px solid var(--border);
}

.mega-card .mega-head-icon--img {
  background: var(--surface);
}

.tool-card-icon--img {
  background: var(--surface);
  border: 1px solid var(--border);
}

.home-cat-links--icons a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.drawer-submenu a .tool-icon-img {
  width: 14px;
  height: 14px;
}

.drawer-category-title .tool-icon-img {
  width: 14px;
  height: 14px;
}

.mega-links a:hover .tool-icon-img,
.mega-menu-list a:hover .tool-icon-img,
.drawer-submenu a:hover .tool-icon-img {
  opacity: 1;
}

.mega-links a:hover,
.mega-menu-list a:hover {
  background: var(--primary);
  color: var(--white);
}

.mega-links a:hover svg,
.mega-menu-list a:hover svg {
  color: var(--white);
  opacity: 1;
}

/* Play Store Button */
.header-play-store {
  flex-shrink: 0;
}

.header-play-store img {
  height: 34px;
  width: auto;
  transition: transform var(--transition), opacity var(--transition);
}

.header-play-store:hover img {
  transform: scale(1.05);
  opacity: 0.9;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =============================================
   Mobile Drawer
   ============================================= */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  background: var(--white);
  z-index: 1200;
  transform: translateX(-100%);
  transition: transform var(--transition);
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0, 42, 74, 0.2);
}

.mobile-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--secondary);
  border-bottom: 2px solid var(--primary);
}

.drawer-header img {
  height: 40px;
  width: auto;
}

.drawer-close {
  width: 36px;
  height: 36px;
  background: none;
  border: 2px solid var(--white);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-close svg {
  width: 18px;
  height: 18px;
  color: var(--white);
}

.drawer-nav {
  padding: 12px 0;
}

.drawer-item {
  border-bottom: 1px solid rgba(10, 86, 142, 0.15);
}

.drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--secondary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}

.drawer-link:hover,
.drawer-link.active {
  background: var(--surface);
  color: var(--primary);
}

.drawer-link .chevron {
  width: 16px;
  height: 16px;
  transition: transform var(--transition);
}

.drawer-item.open .drawer-link .chevron {
  transform: rotate(180deg);
}

.drawer-submenu {
  display: none;
  background: rgba(10, 86, 142, 0.05);
  padding: 8px 0;
}

.drawer-item.open .drawer-submenu {
  display: block;
}

.drawer-category {
  padding: 8px 20px 4px;
}

.drawer-category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  margin-bottom: 4px;
}

.drawer-category-title svg {
  width: 14px;
  height: 14px;
}

.drawer-submenu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px 8px 36px;
  font-size: 13px;
  color: var(--secondary);
  transition: background var(--transition), color var(--transition);
}

.drawer-submenu a svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
  flex-shrink: 0;
}

.drawer-submenu a:hover {
  background: var(--primary);
  color: var(--white);
}

.drawer-submenu a:hover svg {
  color: var(--white);
}

.drawer-play-store {
  padding: 20px;
  margin-top: 8px;
}

.drawer-play-store img {
  height: 38px;
  width: auto;
}

/* Header auth + actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-auth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.btn-auth--ghost {
  color: var(--secondary);
  border: 1px solid var(--border);
  background: var(--white);
}

.btn-auth--ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-auth--primary {
  background: var(--primary);
  color: var(--white);
  border: 1px solid var(--primary);
}

.btn-auth--primary:hover {
  background: var(--secondary);
  border-color: var(--secondary);
}

.drawer-auth {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.drawer-auth .btn-auth {
  flex: 1;
  padding: 10px 12px;
}

/* =============================================
   Shared UI Components
   ============================================= */

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 20px;
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.section-title--center {
  text-align: center;
}

.section-subtitle {
  color: var(--primary);
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 620px;
}

.section-subtitle--center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.section-header {
  margin-bottom: 40px;
}

.section-header--center {
  text-align: center;
}

.btn-play img {
  height: 40px;
  width: auto;
  transition: transform var(--transition), opacity var(--transition);
}

.btn-play:hover img {
  transform: scale(1.04);
  opacity: 0.92;
}

.btn-play--lg img {
  height: 44px;
}

/* =============================================
   Hero Section
   ============================================= */

.hero {
  margin-top: var(--header-height);
  background: linear-gradient(180deg, var(--surface) 0%, var(--white) 100%);
  padding: 56px 0 64px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero-content {
  max-width: 580px;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  color: var(--secondary);
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.hero h1 span {
  color: var(--primary);
}

.hero-lead {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--primary);
  line-height: 1.7;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  margin-bottom: 32px;
}

.hero-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 2px;
  transition: color var(--transition);
}

.hero-link:hover {
  color: var(--primary);
}

.hero-link--muted {
  border-bottom-color: var(--border);
  color: var(--primary);
  font-weight: 500;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 32px;
}

.hero-stat strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1.2;
}

.hero-stat span {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
}

.hero-visual {
  display: flex;
  justify-content: center;
  position: relative;
}

.hero-phone {
  width: 100%;
  max-width: 320px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.hero-phone-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.hero-phone-top img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.hero-phone-top strong {
  display: block;
  font-size: 14px;
  color: var(--secondary);
}

.hero-phone-top span {
  font-size: 11px;
  color: var(--primary);
}

.hero-phone-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.hero-tool-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
}

.hero-tool-chip svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex-shrink: 0;
}

.hero-float {
  position: absolute;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
  box-shadow: var(--shadow);
}

.hero-float--1 { top: 8%; right: 0; animation: floatY 4s ease-in-out infinite; }
.hero-float--2 { bottom: 12%; left: -8px; animation: floatY 4s ease-in-out 1.2s infinite; }

.hero-phone {
  animation: fadeInUp 0.7s ease both;
}

.hero-content > * {
  animation: fadeInUp 0.6s ease both;
}

.hero-content > *:nth-child(2) { animation-delay: 0.08s; }
.hero-content > *:nth-child(3) { animation-delay: 0.16s; }
.hero-content > *:nth-child(4) { animation-delay: 0.24s; }
.hero-content > *:nth-child(5) { animation-delay: 0.32s; }

/* Scroll animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-content > *,
  .hero-phone,
  .hero-float {
    animation: none;
  }
}

/* =============================================
   Trust Strip
   ============================================= */

.trust-strip {
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}

.trust-strip-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 40px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary);
}

.trust-item svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

/* =============================================
   Popular Tools
   ============================================= */

.popular-tools {
  padding: 72px 0;
  background: var(--white);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.tool-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.tool-card,
.feature-card,
.step-card,
.home-cat-card {
  transition: border-color var(--transition), box-shadow var(--transition), transform 0.25s ease;
}

.tool-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.tool-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-card-icon:not(.tool-card-icon--img) {
  background: var(--primary);
}

.tool-card-icon svg {
  width: 20px;
  height: 20px;
  color: var(--white);
}

.tool-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 4px;
}

.tool-card p {
  font-size: 12px;
  color: var(--primary);
  line-height: 1.45;
}

/* =============================================
   How It Works
   ============================================= */

.how-it-works {
  padding: 72px 0;
  background: var(--surface);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.step-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
}

.step-num {
  width: 36px;
  height: 36px;
  margin: 0 auto 16px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
}

.step-card h3 {
  font-size: 1.05rem;
  color: var(--secondary);
  margin-bottom: 8px;
}

.step-card p {
  font-size: 14px;
  color: var(--primary);
  line-height: 1.6;
}

/* =============================================
   Categories Preview
   ============================================= */

.categories {
  padding: 72px 0;
  background: var(--white);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.home-cat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.home-cat-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.home-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.home-cat-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-cat-title .mega-head-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.home-cat-title .mega-head-icon svg {
  width: 15px;
  height: 15px;
}

.home-cat-title span {
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary);
}

.home-cat-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--surface);
  padding: 4px 10px;
  border-radius: 20px;
}

.home-cat-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.home-cat-links a {
  font-size: 12px;
  font-weight: 500;
  color: var(--secondary);
  padding: 5px 10px;
  background: var(--surface);
  border-radius: 20px;
  transition: background var(--transition), color var(--transition);
}

.home-cat-links a:hover {
  background: var(--primary);
  color: var(--white);
}

/* =============================================
   Expense Promo
   ============================================= */

.expense-promo {
  padding: 72px 0;
  background: var(--surface);
}

.expense-promo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow);
}

.expense-promo h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 12px;
}

.expense-promo p {
  color: var(--primary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.expense-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.expense-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary);
}

.expense-feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.expense-feature svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.expense-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.expense-screenshot {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 42, 74, 0.12);
}

/* =============================================
   Features / Benefits
   ============================================= */

.features {
  padding: 72px 0;
  background: var(--white);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.feature-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  color: var(--white);
}

.feature-card h3 {
  font-size: 1rem;
  color: var(--secondary);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 13px;
  color: var(--primary);
  line-height: 1.55;
}

/* =============================================
   Download CTA
   ============================================= */

.download-cta {
  padding: 64px 0;
  background: var(--cta-bg);
  color: var(--secondary);
  margin: 0;
  border-top: 1px solid var(--border);
}

.download-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  text-align: left;
}

.download-cta-copy {
  flex: 1;
  min-width: 0;
}

.download-cta h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--secondary);
}

.download-cta p {
  font-size: 1.05rem;
  color: var(--primary);
  max-width: 520px;
  margin: 0 0 16px;
  line-height: 1.65;
}

.download-cta-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.download-cta-points li {
  font-size: 14px;
  color: var(--secondary);
  padding-left: 22px;
  position: relative;
  line-height: 1.5;
}

.download-cta-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.85;
}

.download-cta-action {
  flex-shrink: 0;
}

.download-cta .btn-play {
  display: inline-block;
}

/* Auth pages – fullscreen, no header/footer */
.auth-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(10, 86, 142, 0.12), transparent 42%),
    radial-gradient(circle at bottom right, rgba(0, 42, 74, 0.08), transparent 38%),
    #f5f8fb;
}

.auth-standalone {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  gap: 12px;
  overflow: hidden;
}

.auth-home-logo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  transition: opacity var(--transition), transform 0.2s ease;
}

.auth-home-logo img {
  height: 36px;
  width: auto;
}

.auth-home-logo:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.auth-shell {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 0;
  width: 100%;
  max-width: 920px;
  max-height: calc(100dvh - 72px);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 42, 74, 0.12);
}

.auth-promo {
  position: relative;
  padding: 32px 28px;
  color: var(--white);
  background:
    linear-gradient(160deg, rgba(10, 86, 142, 0.92), rgba(0, 42, 74, 0.96)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 45%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.auth-promo::after {
  content: '';
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  right: -30px;
  bottom: -30px;
  pointer-events: none;
}

.auth-promo-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 5px 10px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-promo h1 {
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 10px;
  letter-spacing: -0.03em;
}

.auth-promo > p {
  font-size: 0.9rem;
  line-height: 1.55;
  opacity: 0.92;
  max-width: 300px;
  margin-bottom: 16px;
}

.auth-benefits {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.auth-benefits li {
  position: relative;
  padding-left: 22px;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.95;
}

.auth-benefits li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.55);
}

.auth-card {
  max-width: none;
  margin: 0;
  background: var(--white);
  border: none;
  border-radius: 0;
  padding: 28px 32px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
  min-height: 0;
}

.auth-card-head {
  margin-bottom: 16px;
}

.auth-card-head h2 {
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.auth-card-head p {
  font-size: 13px;
  color: var(--primary);
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
}

.auth-form input {
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fbfcfe;
  color: var(--secondary);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.auth-submit {
  width: 100%;
  padding: 12px 14px;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  transition: transform 0.2s ease, box-shadow var(--transition), background var(--transition);
  box-shadow: 0 8px 20px rgba(10, 86, 142, 0.2);
}

.auth-switch {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--secondary);
}

.auth-hint {
  margin-top: 8px;
  font-size: 11px;
}

.auth-status {
  display: none;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
  border: 1px solid transparent;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form input::placeholder {
  color: rgba(0, 42, 74, 0.45);
}

.auth-form input:hover {
  border-color: rgba(10, 86, 142, 0.28);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(10, 86, 142, 0.12);
}

.auth-submit:hover {
  transform: translateY(-1px);
}

.auth-submit:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.auth-switch a {
  color: var(--primary);
  font-weight: 700;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-status--visible {
  display: block;
}

.auth-status--ok {
  color: #0f6b4c;
  background: rgba(15, 107, 76, 0.08);
  border-color: rgba(15, 107, 76, 0.16);
}

.auth-status--error {
  color: #b42318;
  background: rgba(180, 35, 24, 0.08);
  border-color: rgba(180, 35, 24, 0.16);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(0, 42, 74, 0.5);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  flex-shrink: 0;
  padding: 0;
  background: none;
}

.google-signin-wrap {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.google-signin-button {
  display: flex;
  justify-content: center;
  min-height: 40px;
}

@media (max-width: 768px) {
  .auth-promo {
    display: none;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 420px;
    max-height: calc(100dvh - 64px);
  }

  .auth-card {
    padding: 22px 20px 24px;
  }

  .auth-home-logo img {
    height: 32px;
  }
}

@media (max-height: 700px) {
  .auth-standalone {
    padding: 10px 16px;
    gap: 8px;
  }

  .auth-card {
    padding: 18px 18px 20px;
  }

  .auth-form {
    gap: 10px;
  }

  .auth-card-head {
    margin-bottom: 12px;
  }

  .auth-switch {
    margin-top: 10px;
  }
}

/* Account page */
.account-banner {
  display: none;
  max-width: 760px;
  margin: 0 auto 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(15, 107, 76, 0.08);
  border: 1px solid rgba(15, 107, 76, 0.16);
  color: #0f6b4c;
  font-size: 14px;
  line-height: 1.5;
}

.account-banner--visible {
  display: block;
}

.account-panel {
  max-width: 760px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.account-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.account-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  flex-shrink: 0;
}

.account-profile h2 {
  font-size: 1.2rem;
  color: var(--secondary);
  margin-bottom: 4px;
}

.account-email {
  font-size: 14px;
  color: var(--primary);
}

.account-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .account-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

.account-link-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.account-link-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.account-link-card strong {
  font-size: 14px;
  color: var(--secondary);
}

.account-link-card span {
  font-size: 12px;
  color: var(--primary);
  line-height: 1.45;
}

.account-footer-actions {
  display: flex;
  justify-content: flex-end;
}

.account-footer-actions .btn-auth {
  min-width: 140px;
  padding: 11px 20px;
  border: none;
  cursor: pointer;
}

#header-logout,
#drawer-logout {
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  font-family: inherit;
}

/* Header locale */
.header-locale {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-locale-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.header-locale-icon {
  display: flex;
  color: var(--primary);
}

.header-locale-icon svg {
  width: 14px;
  height: 14px;
}

.header-locale-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  padding: 6px 8px;
  max-width: 110px;
  cursor: pointer;
}

.header-locale-select:hover,
.header-locale-select:focus {
  border-color: var(--primary);
  outline: none;
}

/* Header user menu */
.header-user-menu {
  position: relative;
  flex-shrink: 0;
}

.header-user-menu-inner {
  position: relative;
}

.header-user-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--white);
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.header-user-btn:hover,
.header-user-menu.is-open .header-user-btn,
.header-user-menu:hover .header-user-btn {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.header-user-btn-icon {
  display: flex;
}

.header-user-btn-icon svg {
  width: 20px;
  height: 20px;
}

.header-user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.header-user-avatar--initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--white);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
}

.header-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 40px rgba(0, 42, 74, 0.15);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
  z-index: 1200;
}

.header-user-menu:hover .header-user-dropdown,
.header-user-menu.is-open .header-user-dropdown,
.header-user-menu-inner:focus-within .header-user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header-user-dropdown-head {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.header-user-dropdown-locale {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  display: grid;
  gap: 12px;
}

.header-user-dropdown-locale-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.header-user-dropdown-locale-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header-user-dropdown-locale-ico {
  display: inline-flex;
  color: var(--primary);
}

.header-user-dropdown-locale-ico svg {
  width: 14px;
  height: 14px;
}

.header-user-dropdown-locale-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
  color: var(--secondary);
}

.header-user-dropdown-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.header-user-dropdown-profile .header-user-avatar,
.header-user-dropdown-profile .header-user-avatar--initials {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.header-user-dropdown-profile .header-user-avatar--initials {
  font-size: 15px;
}

.header-user-dropdown-profile strong {
  display: block;
  font-size: 14px;
  color: var(--secondary);
  margin-bottom: 2px;
}

.header-user-dropdown-profile span {
  display: block;
  font-size: 12px;
  color: var(--primary);
  word-break: break-word;
}

.header-user-dropdown-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--secondary);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.header-user-dropdown-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.header-user-dropdown-link:hover {
  background: var(--surface);
  color: var(--primary);
}

.header-user-dropdown-link--primary span {
  color: var(--secondary);
}

.header-user-dropdown-link--logout {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  padding-top: 14px;
  color: #b42318;
}

.header-user-auth-links {
  display: flex;
  gap: 10px;
  padding: 6px 0 10px;
}

.header-user-auth-link {
  width: 50% !important;
  justify-content: center;
  position: relative;
}

.header-user-auth-link span {
  white-space: nowrap;
}

.header-user-auth-link:first-child::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -5px;
  width: 1px;
  height: 18px;
  background: var(--border);
  transform: translateY(-50%);
}

.drawer-locale {
  display: none;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.drawer-locale-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.drawer-locale-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
}

.drawer-auth {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.drawer-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.drawer-user-card .header-user-avatar,
.drawer-user-card .header-user-avatar--initials {
  width: 44px;
  height: 44px;
}

.drawer-user-card strong {
  font-size: 15px;
  color: var(--secondary);
}

.drawer-user-link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary);
  background: var(--surface);
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}

.drawer-user-link:hover {
  color: var(--primary);
}

.drawer-user-link--logout {
  color: #b42318;
  background: #fff5f5;
}

.account-avatar-img,
.profile-avatar-preview-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-form-grid,
.settings-form-grid {
  display: grid;
  gap: 16px;
}

.profile-form-grid label,
.settings-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
}

.profile-form-grid input,
.profile-form-grid select,
.settings-form-grid input,
.settings-form-grid select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

#profile-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
}

.profile-hint,
.settings-hint {
  font-size: 12px;
  color: var(--primary);
  line-height: 1.5;
  font-weight: 500;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .account-actions {
    grid-template-columns: 1fr;
  }

  .account-footer-actions {
    justify-content: stretch;
  }

  .account-footer-actions .btn-auth {
    width: 100%;
  }
}

/* =============================================
   Page Content (About, FAQs)
   ============================================= */

.page-content {
  margin-top: var(--header-height);
  padding: 0 0 64px;
}

.page-content:has(> .download-cta) {
  padding-bottom: 0;
}

.page-header .section-label {
  margin-bottom: 12px;
}

.page-header {
  background: linear-gradient(180deg, var(--surface) 0%, var(--white) 100%);
  color: var(--secondary);
  padding: 56px 0 48px;
  text-align: center;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--secondary);
}

.page-header p {
  margin-top: 10px;
  color: var(--primary);
  font-size: 1.05rem;
}

.content-block {
  max-width: 760px;
  margin: 0 auto 32px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
}

.content-block h2 {
  font-size: 1.2rem;
  color: var(--secondary);
  margin-bottom: 12px;
  padding-bottom: 0;
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.content-block h2::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
  flex-shrink: 0;
}

.content-block p {
  color: var(--black);
  margin-bottom: 12px;
  line-height: 1.7;
}

/* Coming soon (calculator / tracker placeholder pages) */
.coming-soon {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding-top: 8px;
  padding-bottom: 24px;
}

.coming-soon h2 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  color: var(--secondary);
  margin-bottom: 14px;
}

.coming-soon p {
  color: var(--primary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.coming-soon .play-store-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.coming-soon .play-store-link:hover {
  background: var(--secondary);
}

/* =============================================
   Calculator Tool (GST, VAT, etc.)
   ============================================= */

.calc-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 56px;
}

.calc-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.calc-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 20px;
}

/* Segmented toggle (Add / Remove) */
.calc-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
}

.calc-seg {
  flex: 1;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--primary);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.calc-seg.active {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow);
}

.calc-field {
  margin-bottom: 20px;
}

.calc-field:last-child {
  margin-bottom: 0;
}

.calc-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 8px;
}

.calc-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.calc-input-prefix {
  position: absolute;
  left: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  pointer-events: none;
}

.calc-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--secondary);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.calc-input--prefixed {
  padding-left: 30px;
}

.calc-input-suffix {
  position: absolute;
  right: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  pointer-events: none;
}

.calc-input-wrap .calc-input:not(.calc-input--prefixed) {
  padding-right: 36px;
}

.calc-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10, 86, 142, 0.12);
}

/* Rate presets */
.calc-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.calc-preset {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.calc-preset:hover {
  border-color: var(--primary);
}

.calc-preset.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* Results */
.calc-results {
  background: linear-gradient(160deg, var(--secondary) 0%, var(--primary) 100%);
  border: none;
  color: var(--white);
}

.calc-results .calc-card-title {
  color: rgba(255, 255, 255, 0.85);
}

.calc-result-total {
  margin-bottom: 20px;
}

.calc-result-total span {
  display: block;
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 4px;
}

.calc-result-total strong {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: var(--white);
}

.calc-result-sub {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.9);
}

/* Disclaimer / footnote on dark result panels — always use light text, never --primary */
.calc-results-note {
  font-size: 12px;
  line-height: 1.55;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.78);
}

.calc-breakdown {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.calc-break-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  font-size: 14px;
}

.calc-break-row span {
  opacity: 0.92;
  color: rgba(255, 255, 255, 0.92);
}

.calc-break-row strong {
  font-weight: 700;
  color: var(--white);
}

/* EMI schedule tables & export */
.calc-schedule-section {
  margin-top: 40px;
  margin-bottom: 48px;
}

.calc-schedule-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.calc-schedule-head h2 {
  font-size: 1.35rem;
  color: var(--secondary);
  margin: 0 0 4px;
}

.calc-schedule-head p {
  margin: 0;
  font-size: 14px;
  color: var(--primary);
}

.calc-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.calc-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.calc-export-btn:hover:not(:disabled) {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(10, 86, 142, 0.1);
}

.calc-export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.calc-export-btn--primary {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--white);
}

.calc-export-btn--primary:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
}

.calc-export-ico {
  display: inline-flex;
  width: 16px;
  height: 16px;
}

.calc-export-ico svg {
  width: 16px;
  height: 16px;
}

.calc-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.calc-tab {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.calc-tab.is-active {
  color: var(--secondary);
  border-bottom-color: var(--primary);
}

.calc-tab-panel {
  display: none;
}

.calc-tab-panel.is-active {
  display: block;
}

.calc-table-wrap {
  overflow: auto;
  max-height: 480px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
}

.calc-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.calc-data-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.calc-data-table th {
  background: var(--secondary);
  color: var(--white);
  text-align: left;
  padding: 12px 14px;
  font-weight: 700;
  white-space: nowrap;
}

.calc-data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--secondary);
  white-space: nowrap;
}

.calc-data-table tbody tr:nth-child(even) td {
  background: rgba(10, 86, 142, 0.04);
}

.calc-data-table tbody tr:hover td {
  background: rgba(10, 86, 142, 0.08);
}

.calc-table-empty {
  text-align: center;
  color: var(--primary);
  padding: 32px 16px !important;
}

@media (max-width: 600px) {
  .calc-schedule-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .calc-export-actions {
    width: 100%;
  }

  .calc-export-btn {
    flex: 1;
    justify-content: center;
  }

  .calc-table-wrap {
    max-height: 360px;
  }
}

.calc-break-row--sub {
  padding: 6px 0 6px 16px;
  font-size: 13px;
  opacity: 0.9;
}

.calc-break-row--sub span {
  opacity: 0.88;
  color: rgba(255, 255, 255, 0.88);
}

/* Info / content sections below the calculator */
.calc-section {
  max-width: 860px;
  margin: 0 auto 40px;
}

.calc-section h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 16px;
}

.calc-section h2 + p {
  color: var(--black);
  line-height: 1.7;
  margin-bottom: 16px;
}

.calc-formula {
  background: var(--surface);
  border: 1px dashed rgba(10, 86, 142, 0.3);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 14px 0;
  font-size: 14px;
  color: var(--secondary);
  line-height: 1.8;
}

.calc-formula code {
  font-family: 'Consolas', 'Courier New', monospace;
  font-weight: 700;
  color: var(--primary);
}

/* FAQ Accordion */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--white);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--secondary);
  background: var(--white);
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}

.faq-question:hover,
.faq-item.open .faq-question {
  background: var(--surface);
  color: var(--primary);
}

.faq-question svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding: 16px 20px 20px;
  background: var(--white);
  color: var(--black);
  font-size: 14px;
  line-height: 1.7;
  border-top: 1px solid var(--border);
}

.faq-item.open .faq-answer {
  display: block;
}

/* =============================================
   Footer
   ============================================= */

.site-footer {
  background: var(--secondary);
  color: var(--white);
  padding: 56px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 36px 32px;
  margin-bottom: 40px;
}

.footer-brand img {
  height: 44px;
  width: auto;
  margin-bottom: 16px;
}

.footer-brand p {
  font-size: 14px;
  opacity: 0.85;
  line-height: 1.7;
  max-width: 320px;
}

.footer-brand .btn-play--footer {
  display: inline-block;
  margin-top: 20px;
}

.btn-play--footer img {
  height: 48px;
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.footer-social-link {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  opacity: 0.85;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform 0.2s ease;
}

.footer-social-link svg {
  width: 18px;
  height: 18px;
}

.footer-social-link:hover {
  background: var(--white);
  color: var(--secondary);
  border-color: var(--white);
  opacity: 1;
  transform: translateY(-2px);
}

.footer-col {
  min-width: 0;
}

.footer-col-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  margin: 0 0 16px;
  border: none;
  background: none;
  color: var(--white);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  cursor: pointer;
}

.footer-col-toggle span:first-child {
  flex: 1;
}

.footer-col-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.footer-col-chevron svg {
  width: 14px;
  height: 14px;
}

.footer-col h4,
.footer-col-toggle {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  color: var(--white);
}

.footer-col-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-col a {
  display: block;
  font-size: 14px;
  padding: 5px 0;
  opacity: 0.85;
  transition: opacity var(--transition), color var(--transition);
}

.footer-col a:hover {
  opacity: 1;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  font-size: 13px;
  opacity: 0.85;
}

.footer-copy {
  margin: 0;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.footer-legal a {
  color: var(--white);
  opacity: 0.9;
  transition: opacity var(--transition);
}

.footer-legal a:hover {
  opacity: 1;
}

@media (min-width: 601px) {
  .footer-col-toggle {
    display: block;
    pointer-events: none;
    cursor: default;
    padding: 0;
    margin-bottom: 16px;
  }

  .footer-col-chevron {
    display: none;
  }

  .footer-col-links {
    display: flex !important;
    padding-bottom: 0;
  }
}

/* =============================================
   Responsive
   ============================================= */

/* --- Large desktop / wide laptop --- */
@media (max-width: 1400px) {
  .mega-menu-inner {
    padding: 0 32px;
  }

  .mega-links.mega-core-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .mega-links--quad {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- Laptop --- */
@media (max-width: 1200px) {
  .container {
    padding: 0 28px;
  }

  .mega-menu-inner {
    padding: 0 20px;
  }

  /* Compact the mega menu so it fits smaller laptop screens */
  .mega-menu--full {
    padding: 12px 0 14px;
  }

  .mega-menu-body {
    gap: 8px;
  }

  .mega-section-head {
    margin-bottom: 8px;
    padding-bottom: 6px;
  }

  .mega-card {
    padding: 10px 12px;
  }

  .mega-card--compact {
    padding: 8px 12px;
  }

  .mega-cat-row {
    gap: 8px;
  }

  .mega-links a,
  .mega-menu-list a {
    padding: 4px 6px;
  }

  .mega-links.mega-core-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 3px 14px;
  }

  .mega-section--core {
    padding: 12px 16px 10px;
  }

  .mega-cat-row--wide {
    grid-template-columns: 1fr 1fr;
  }

  .mega-cat-row--compact {
    grid-template-columns: repeat(3, 1fr);
  }

  .mega-links--quad {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-grid {
    gap: 32px;
  }
}

/* --- Small laptop (mega menu extra compaction) --- */
@media (max-width: 1080px) {
  /* Keep category rows side-by-side so the menu stays short, not tall */
  .mega-links.mega-core-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2px 12px;
  }

  .mega-links--quad {
    grid-template-columns: repeat(2, 1fr);
  }

  .mega-links a,
  .mega-menu-list a {
    font-size: 12px;
    gap: 6px;
  }

  .mega-links a .tool-icon-img,
  .mega-menu-list a .tool-icon-img {
    width: 18px;
    height: 18px;
  }
}

/* --- Short laptop screens: compact the mega menu vertically so it
   fits without scrolling (e.g. 1366x768 / 1280x800 laptops) --- */
@media (max-height: 860px) {
  .mega-menu--full {
    padding: 10px 0 12px;
  }

  .mega-menu-body {
    gap: 6px;
  }

  .mega-section-head {
    margin-bottom: 6px;
    padding-bottom: 5px;
  }

  .mega-head-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
  }

  .mega-head-icon svg {
    width: 12px;
    height: 12px;
  }

  .mega-section--core {
    padding: 10px 16px 8px;
  }

  .mega-links.mega-core-grid {
    gap: 0 16px;
  }

  .mega-card {
    padding: 10px 14px;
  }

  .mega-card--compact {
    padding: 8px 14px;
  }

  .mega-cat-row {
    gap: 10px;
  }

  .mega-links a,
  .mega-menu-list a {
    padding: 3px 6px;
    line-height: 1.15;
  }

  .mega-links--quad {
    gap: 0 12px;
  }

  .mega-links--inline {
    gap: 3px 8px;
  }
}

/* --- Very short screens: tighten further --- */
@media (max-height: 720px) {
  .mega-menu--full {
    padding: 8px 0 10px;
  }

  .mega-menu-body {
    gap: 4px;
  }

  .mega-section-head {
    margin-bottom: 4px;
    padding-bottom: 4px;
  }

  .mega-section--core {
    padding: 8px 16px 6px;
  }

  .mega-card,
  .mega-card--compact {
    padding: 7px 14px;
  }

  .mega-links a,
  .mega-menu-list a {
    padding: 2px 6px;
    font-size: 12px;
  }
}

/* --- Small laptop --- */
@media (max-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Tablet (nav collapses to drawer) --- */
@media (max-width: 992px) {
  .desktop-nav,
  .header-actions {
    display: none;
  }

  .drawer-locale {
    display: flex;
  }

  .header-user-menu {
    margin-left: auto;
  }

  .hamburger {
    display: flex;
    order: -1;
    z-index: 1;
  }

  .header-inner {
    justify-content: space-between;
  }

  .header-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .hero {
    padding: 48px 0 56px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }

  .hero-content {
    max-width: 640px;
    margin: 0 auto;
  }

  .hero-actions,
  .hero-stats {
    justify-content: center;
  }

  .hero-float {
    display: none;
  }

  .popular-tools,
  .how-it-works,
  .categories,
  .expense-promo,
  .features {
    padding: 60px 0;
  }

  .section-header {
    margin-bottom: 32px;
  }

  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .steps-grid,
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .expense-promo-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px;
    text-align: center;
  }

  .expense-features {
    align-items: center;
  }

  .expense-promo .btn-play {
    display: inline-block;
  }

  .expense-screenshot {
    margin: 0 auto;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-brand p {
    max-width: none;
  }
}

/* --- Tablet portrait --- */
@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }

  .calc-layout {
    grid-template-columns: 1fr;
  }

  .calc-card {
    padding: 22px;
  }

  .hero {
    padding: 40px 0 48px;
  }

  .popular-tools,
  .how-it-works,
  .categories,
  .expense-promo,
  .features,
  .download-cta {
    padding: 52px 0;
  }

  .download-cta-inner {
    flex-direction: column;
    text-align: center;
    gap: 28px;
  }

  .download-cta p {
    margin-left: auto;
    margin-right: auto;
  }

  .download-cta-points {
    align-items: center;
  }

  .download-cta-points li {
    text-align: left;
  }

  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps-grid {
    grid-template-columns: 1fr;
    max-width: 460px;
    margin: 0 auto;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .expense-screenshot {
    max-width: 300px;
  }

  .trust-strip-inner {
    gap: 12px 24px;
  }

  .content-block {
    padding: 22px 20px;
  }

  .page-header {
    padding: 44px 0 40px;
    margin-bottom: 36px;
  }
}

/* --- Large phone --- */
@media (max-width: 600px) {
  .hero-stats {
    gap: 16px 28px;
  }

  .hero-stat strong {
    font-size: 1.3rem;
  }

  .categories-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 26px 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .footer-brand {
    text-align: center;
    padding-bottom: 28px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }

  .footer-brand img {
    margin-left: auto;
    margin-right: auto;
  }

  .footer-brand p {
    margin-left: auto;
    margin-right: auto;
  }

  .footer-brand .btn-play--footer {
    margin-top: 16px;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-col {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .footer-col-toggle {
    display: flex;
    padding: 16px 0;
    margin-bottom: 0;
  }

  .footer-col-links {
    display: none;
    padding-bottom: 14px;
  }

  .footer-col.is-open .footer-col-links {
    display: flex;
  }

  .footer-col.is-open .footer-col-chevron {
    transform: rotate(180deg);
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    padding-top: 20px;
  }

  .footer-legal {
    justify-content: center;
  }
}

/* --- Phone --- */
@media (max-width: 480px) {
  :root {
    --header-height: 64px;
  }

  .container {
    padding: 0 16px;
  }

  .header-logo img {
    height: 34px;
  }

  .hero {
    padding: 32px 0 40px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }

  .popular-tools,
  .how-it-works,
  .categories,
  .expense-promo,
  .features,
  .download-cta {
    padding: 44px 0;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .expense-promo-grid {
    padding: 24px 20px;
  }

  .expense-screenshot {
    max-width: 260px;
  }

  .mobile-drawer {
    width: 288px;
  }

  .content-block {
    padding: 20px 16px;
  }

  .footer-col a {
    font-size: 13px;
  }
}

/* --- Small phone --- */
@media (max-width: 360px) {
  .container {
    padding: 0 14px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .hero-stats {
    justify-content: space-between;
    width: 100%;
    gap: 12px;
  }
}

/* =============================================
   Site Search
   ============================================= */

/* Header trigger */
.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.search-trigger:hover {
  border-color: var(--primary);
  background: var(--white);
}

.search-trigger-icon {
  display: flex;
}

.search-trigger-icon svg {
  width: 16px;
  height: 16px;
}

/* Mobile header search icon (icon only, borderless like the hamburger) */
.search-trigger--mobile {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 8px;
  gap: 0;
  background: none;
  border: none;
  border-radius: 8px;
  flex-shrink: 0;
}

.search-trigger--mobile .search-trigger-icon svg {
  width: 22px;
  height: 22px;
}

/* Modal */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 20px 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.search-modal.active {
  opacity: 1;
  visibility: visible;
}

.search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 42, 74, 0.55);
  backdrop-filter: blur(2px);
}

.search-modal-box {
  position: relative;
  width: 100%;
  max-width: 620px;
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 42, 74, 0.3);
  overflow: hidden;
  transform: translateY(-12px);
  transition: transform var(--transition);
}

.search-modal.active .search-modal-box {
  transform: translateY(0);
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.search-input-icon {
  display: flex;
  color: var(--primary);
}

.search-input-icon svg {
  width: 20px;
  height: 20px;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  font-family: inherit;
  color: var(--secondary);
  background: transparent;
}

.search-input::placeholder {
  color: rgba(10, 86, 142, 0.55);
}

.search-esc {
  flex-shrink: 0;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

.search-esc:hover {
  border-color: var(--primary);
}

.search-results {
  max-height: 56vh;
  overflow-y: auto;
  padding: 8px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.search-result.is-active,
.search-result:hover {
  background: var(--surface);
}

.search-result-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface);
}

.search-result.is-active .search-result-icon {
  background: var(--white);
}

.search-result-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.search-result-icon--page {
  background: var(--primary);
  color: var(--white);
}

.search-result-icon--page svg {
  width: 18px;
  height: 18px;
}

.search-result-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.search-result-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-name mark {
  background: rgba(10, 86, 142, 0.18);
  color: var(--primary);
  border-radius: 3px;
  padding: 0 1px;
}

.search-result-cat {
  font-size: 11.5px;
  color: var(--primary);
  opacity: 0.8;
}

.search-result-arrow {
  display: flex;
  color: var(--primary);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--transition), transform var(--transition);
}

.search-result-arrow svg {
  width: 16px;
  height: 16px;
}

.search-result.is-active .search-result-arrow,
.search-result:hover .search-result-arrow {
  opacity: 0.7;
  transform: translateX(0);
}

.search-hint,
.search-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--primary);
}

/* Icon-only trigger on tighter laptop headers to avoid crowding */
@media (max-width: 1200px) {
  .search-trigger {
    padding: 8px 10px;
  }

  .search-trigger-label {
    display: none;
  }
}

/* On mobile/tablet swap the desktop pill for the header search icon */
@media (max-width: 992px) {
  .search-trigger {
    display: none;
  }

  .search-trigger--mobile {
    display: inline-flex;
  }
}

@media (max-width: 480px) {
  .search-modal {
    padding: 0;
    align-items: stretch;
  }

  .search-modal-box {
    max-width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .search-results {
    max-height: calc(100vh - 70px);
  }
}

/* =============================================
   Expense Tracker App Landing Pages
   ============================================= */

.tracker-app-page {
  background: var(--white);
}

.tracker-hero {
  padding: 56px 0 72px;
  background:
    radial-gradient(circle at 12% 18%, rgba(10, 86, 142, 0.1), transparent 42%),
    radial-gradient(circle at 88% 72%, rgba(0, 42, 74, 0.08), transparent 38%),
    linear-gradient(180deg, #f7fafc 0%, var(--white) 100%);
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
}

.tracker-hero > .container {
  width: 100%;
}

.tracker-hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.tracker-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(10, 86, 142, 0.1);
  color: var(--secondary);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
}

.tracker-badge svg {
  width: 16px;
  height: 16px;
}

.tracker-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.12;
  color: var(--secondary);
  margin-bottom: 16px;
  font-weight: 800;
}

.tracker-hero h1 span {
  color: var(--primary);
}

.tracker-lead {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--primary);
  max-width: 520px;
  margin-bottom: 24px;
}

.tracker-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.tracker-hero-note {
  font-size: 13px;
  color: var(--primary);
  opacity: 0.85;
}

.tracker-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.tracker-stat {
  min-width: 110px;
}

.tracker-stat strong {
  display: block;
  font-size: 1.35rem;
  color: var(--secondary);
  line-height: 1.2;
}

.tracker-stat span {
  font-size: 13px;
  color: var(--primary);
}

.tracker-hero-shot {
  width: 100%;
  max-width: 400px;
  height: auto;
  margin: 0 auto;
  display: block;
  border-radius: 16px;
  box-shadow: 0 24px 56px rgba(0, 42, 74, 0.14);
  object-fit: contain;
}

.tracker-hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tracker-features {
  padding: 72px 0;
}

.tracker-features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.tracker-feature-card {
  padding: 24px 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--white);
  transition: box-shadow 0.2s, transform 0.2s;
}

.tracker-feature-card:hover {
  box-shadow: 0 12px 32px rgba(0, 42, 74, 0.08);
  transform: translateY(-2px);
}

.tracker-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 86, 142, 0.1);
  color: var(--primary);
  margin-bottom: 14px;
}

.tracker-feature-icon svg {
  width: 22px;
  height: 22px;
}

.tracker-feature-card h3 {
  font-size: 1.05rem;
  color: var(--secondary);
  margin-bottom: 8px;
}

.tracker-feature-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--primary);
  margin: 0;
}

.tracker-showcase {
  padding: 0 0 72px;
}

.tracker-showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 40px;
  border-radius: 24px;
  background: var(--cta-bg);
  border: 1px solid var(--border);
}

.tracker-showcase-copy h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--secondary);
  margin-bottom: 12px;
}

.tracker-showcase-copy p {
  color: var(--primary);
  line-height: 1.65;
  margin-bottom: 16px;
}

.tracker-checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tracker-checklist li {
  font-size: 14px;
  color: var(--secondary);
  padding-left: 26px;
  position: relative;
  line-height: 1.5;
}

.tracker-checklist li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tracker-screenshot {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: block;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 42, 74, 0.15);
}

.tracker-related {
  padding: 0 0 56px;
}

.tracker-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tracker-related-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--white);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tracker-related-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(10, 86, 142, 0.1);
}

.tracker-related-card.is-current {
  border-color: var(--primary);
  background: rgba(10, 86, 142, 0.05);
  pointer-events: none;
}

.tracker-related-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(10, 86, 142, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tracker-related-icon svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.tracker-related-card strong {
  display: block;
  font-size: 15px;
  color: var(--secondary);
  margin-bottom: 2px;
}

.tracker-related-card span {
  font-size: 13px;
  color: var(--primary);
}

/* Recommended next tools — calculator pages */
.calc-related {
  padding: 8px 0 48px;
  margin-bottom: 8px;
}

.calc-related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 768px) {
  .calc-related-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.calc-related-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--white);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  min-height: 76px;
}

.calc-related-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(10, 86, 142, 0.1);
  transform: translateY(-1px);
}

.calc-related-card.is-current {
  border-color: var(--primary);
  background: rgba(10, 86, 142, 0.05);
  pointer-events: none;
}

.calc-related-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(10, 86, 142, 0.08);
  object-fit: contain;
  padding: 6px;
  flex-shrink: 0;
}

.calc-related-card strong {
  display: block;
  font-size: 14px;
  line-height: 1.3;
  color: var(--secondary);
  margin-bottom: 3px;
}

.calc-related-card span {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  color: var(--primary);
}

.calc-related-all {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
}

.calc-related-all a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.calc-related-all a:hover {
  text-decoration: underline;
}

.section-sub--center {
  text-align: center;
  max-width: 520px;
  margin: 8px auto 24px;
  color: var(--text-muted, #5a6b7d);
  font-size: 14px;
  line-height: 1.55;
}

.tracker-cta-band {
  padding: 56px 0;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: var(--white);
  text-align: center;
}

.tracker-cta-band h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 10px;
  color: var(--white);
}

.tracker-cta-band p {
  max-width: 560px;
  margin: 0 auto 24px;
  opacity: 0.92;
  line-height: 1.65;
}

.tracker-cta-band .btn-play {
  display: inline-block;
}

.tracker-faq-section {
  padding: 64px 0 80px;
}

/* Laptop / desktop: hero fills viewport below header */
@media (min-width: 993px) {
  .tracker-hero {
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100dvh - var(--header-height));
    padding: 28px 0;
    display: flex;
    align-items: center;
  }

  .tracker-hero-grid {
    align-items: center;
    gap: 40px;
  }

  .tracker-hero-visual {
    align-self: center;
    justify-content: flex-end;
  }

  .tracker-hero-shot {
    max-width: min(400px, 40vw);
    max-height: calc(100dvh - var(--header-height) - 56px);
    width: auto;
  }
}

/* Shorter laptop screens — tighten spacing so content still fits */
@media (min-width: 993px) and (max-height: 820px) {
  .tracker-hero {
    padding: 20px 0;
  }

  .tracker-hero h1 {
    font-size: clamp(1.85rem, 3.2vw, 2.5rem);
    margin-bottom: 12px;
  }

  .tracker-lead {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 18px;
  }

  .tracker-badge {
    margin-bottom: 12px;
  }

  .tracker-hero-actions {
    margin-bottom: 20px;
  }

  .tracker-stat strong {
    font-size: 1.15rem;
  }

  .tracker-hero-shot {
    max-height: calc(100dvh - var(--header-height) - 40px);
    max-width: min(340px, 36vw);
  }
}

@media (max-width: 992px) {
  .tracker-hero-grid,
  .tracker-showcase-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .tracker-features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tracker-hero-shot,
  .tracker-screenshot {
    max-width: 340px;
  }
}

@media (max-width: 600px) {
  .tracker-hero {
    padding: 40px 0 56px;
  }

  .tracker-features-grid,
  .tracker-related-grid {
    grid-template-columns: 1fr;
  }

  .tracker-showcase-grid {
    padding: 24px 20px;
  }

  .tracker-hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}
