/* ==========================================================================
   iLoveCalc — Production Stylesheet (SEO, Responsive & AdSense Ready)
   ========================================================================== */
:root {
  --bg-base: #f1f5f9;
  --bg-surface: rgba(255, 255, 255, 0.94);
  --bg-surface-solid: #ffffff;
  --bg-elevated: #f8fafc;
  --bg-input: #f1f5f9;
  --bg-hover: #eef2ff;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --border-subtle: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.18);

  --accent-primary: #4f46e5;
  --accent-primary-hover: #4338ca;
  --accent-primary-soft: rgba(79, 70, 229, 0.1);
  --accent-secondary: #059669;
  --accent-danger: #dc2626;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.15);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg-base: #070a13;
  --bg-surface: rgba(15, 23, 42, 0.86);
  --bg-surface-solid: #0f172a;
  --bg-elevated: #1e293b;
  --bg-input: #0b1120;
  --bg-hover: rgba(99, 102, 241, 0.16);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);

  --accent-primary: #6366f1;
  --accent-primary-hover: #818cf8;
  --accent-primary-soft: rgba(99, 102, 241, 0.2);
  --accent-secondary: #10b981;
  --accent-danger: #f87171;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.7);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.tabular-nums {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none !important;
  color: var(--text-primary);
  flex-shrink: 0;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-title span {
  color: var(--accent-primary);
}

.top-nav-links {
  display: none;
  align-items: center;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .top-nav-links {
    display: flex;
  }
}

.top-nav-link {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none !important;
  transition: var(--transition);
}
.top-nav-link:hover, .top-nav-link.active {
  color: var(--accent-primary);
}

.header-search {
  flex: 1;
  max-width: 340px;
  position: relative;
  display: none;
}

@media (min-width: 768px) {
  .header-search {
    display: block;
  }
}

.search-input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-surface-solid);
  box-shadow: 0 0 0 3px var(--accent-primary-soft);
}

.search-icon-pos {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  color: var(--text-primary);
  transition: var(--transition);
  flex-shrink: 0;
}

.icon-btn:hover {
  border-color: var(--accent-primary);
  background: var(--bg-hover);
}

/* Mobile Drawer */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  max-width: 88vw;
  background: var(--bg-surface-solid);
  z-index: 110;
  box-shadow: var(--shadow-lg);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  gap: 0.9rem;
  overflow-y: auto;
}

.mobile-drawer-overlay.open .mobile-drawer {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-page-links a {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  text-decoration: none;
}

/* ==========================================================================
   ADSENSE CONTAINERS (CLS-SAFE / POLICY COMPLIANT)
   ========================================================================== */
.ad-slot-wrapper {
  width: 100%;
  max-width: 1400px;
  margin: 0.75rem auto 0;
  padding: 0 1rem;
}

.ad-container {
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  text-align: center;
  overflow: hidden;
}

.ad-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

/* ==========================================================================
   3-COLUMN BENTO WORKSPACE
   ========================================================================== */
.app-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

@media (min-width: 1200px) {
  .app-container {
    grid-template-columns: minmax(250px, 275px) minmax(0, 1fr) minmax(250px, 290px);
    padding: 1.25rem 1.5rem;
    gap: 1.25rem;
  }
}

@media (min-width: 1024px) and (max-width: 1199px) {
  .app-container {
    grid-template-columns: minmax(225px, 250px) minmax(0, 1fr);
    padding: 1.25rem;
    gap: 1rem;
  }
  .history-panel {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
  }
}

.bento-box {
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  width: 100%;
  margin-bottom: 0.75rem;
}

.cat-pill {
  width: 100%;
  min-height: 36px;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  transition: var(--transition);
}
.cat-pill:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.cat-pill.active { background: var(--accent-primary); color: #fff; border-color: var(--accent-primary); }

.desktop-sidebar {
  display: none;
}

.mobile-category-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

@media (min-width: 1024px) {
  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 4.8rem;
    max-height: calc(100vh - 5.5rem);
    overflow-y: auto;
    padding: 1rem;
    gap: 0.85rem;
  }
}

.sidebar-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calc-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.calc-btn {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  transition: var(--transition);
}

.calc-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
}

.calc-btn.active {
  background: var(--accent-primary-soft);
  border-color: rgba(99, 102, 241, 0.35);
}

.calc-btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--accent-primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.calc-btn.active .calc-btn-icon {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.calc-btn-text {
  flex: 1;
  min-width: 0;
}

.calc-btn-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calc-btn-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ==========================================================================
   WORKSPACE CARD & SEO CONTENT SECTIONS
   ========================================================================== */
.workspace-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.workspace-card {
  padding: 1.25rem;
}

@media (min-width: 640px) {
  .workspace-card {
    padding: 1.75rem;
  }
}

.breadcrumb-nav {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.ws-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.ws-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ws-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-primary-soft), rgba(16, 185, 129, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--accent-primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ws-cat {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-secondary);
  margin-bottom: 0.1rem;
}

.ws-name {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

@media (min-width: 640px) {
  .ws-name {
    font-size: 1.5rem;
  }
}

.ws-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.ws-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .ws-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.prefix, .suffix {
  position: absolute;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

.prefix { left: 0.85rem; }
.suffix { right: 0.85rem; }

.calc-input, .calc-select, .contact-textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-mono);
  transition: var(--transition);
}

.contact-textarea, .text-input {
  font-family: var(--font-sans);
  font-weight: 500;
}

.calc-input.has-prefix { padding-left: 2rem; }
.calc-input.has-suffix { padding-right: 2.5rem; }

.calc-input:focus, .calc-select:focus, .contact-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-surface-solid);
  box-shadow: 0 0 0 3px var(--accent-primary-soft);
}

.segmented-group {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--bg-input);
  padding: 0.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 0.2rem;
}

.seg-pill {
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  transition: var(--transition);
}

.seg-pill.active {
  background: var(--bg-surface-solid);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), #4338ca);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 6px 16px -4px rgba(99, 102, 241, 0.4);
  transition: var(--transition);
  margin-top: 0.5rem;
}

.btn-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -4px rgba(99, 102, 241, 0.5);
}

.result-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-lbl {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.metric-title {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.metric-value {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent-primary);
  line-height: 1.15;
  margin-top: 0.15rem;
  word-break: break-word;
}

.breakdown-table {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-strong);
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
}

.breakdown-row span:first-child { color: var(--text-secondary); }
.breakdown-row span:last-child { font-weight: 700; color: var(--text-primary); }

.seo-box {
  padding: 1.5rem;
}

.seo-box h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
}

.seo-box h3 {
  font-size: 0.98rem;
  font-weight: 700;
  margin: 1rem 0 0.4rem;
  color: var(--text-primary);
}

.seo-box p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.seo-box ul {
  margin-left: 1.25rem;
  margin-bottom: 0.85rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.seo-box li {
  margin-bottom: 0.35rem;
}

.formula-tag {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
  overflow-x: auto;
  margin: 0.75rem 0;
}

.faq-item {
  border-top: 1px solid var(--border-subtle);
  padding: 0.85rem 0;
}
.faq-q {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}
.faq-a {
  font-size: 0.86rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   HISTORY SIDEBAR
   ========================================================================== */
.history-panel {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

@media (min-width: 1024px) {
  .history-panel {
    position: sticky;
    top: 4.8rem;
    max-height: calc(100vh - 5.5rem);
    overflow-y: auto;
  }
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.history-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--accent-primary-soft);
  color: var(--accent-primary);
}

.btn-clear {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-danger);
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
}

.btn-clear:hover { background: rgba(239, 68, 68, 0.12); }

.history-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-card-item {
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
  transition: var(--transition);
}

.history-card-item:hover {
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.hc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hc-name {
  font-weight: 700;
  color: var(--accent-primary);
}

.hc-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hc-sum {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.history-empty-msg {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
}

/* ==========================================================================
   STANDALONE SEO CONTENT PAGES (ABOUT, CONTACT, PRIVACY, TERMS, DISCLAIMER)
   ========================================================================== */
.page-container {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  flex: 1;
}

.page-card {
  padding: 2rem;
}

.page-card h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.page-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.page-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.5rem 0 0.6rem;
  color: var(--text-primary);
}

.page-card p, .page-card li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
}

.page-card ul {
  margin-left: 1.4rem;
}

.info-banner {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--accent-primary-soft);
  border: 1px solid rgba(99, 102, 241, 0.25);
  margin: 1rem 0;
  font-size: 0.92rem;
}

/* ==========================================================================
   FOOTER & COOKIE CONSENT BANNER
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 2.25rem 1rem 1.75rem;
  margin-top: auto;
}

.footer-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
  }
}

.footer-col h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.65rem;
  color: var(--text-primary);
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer-col a {
  font-size: 0.84rem;
  color: var(--text-secondary);
  text-decoration: none;
}
.footer-col a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  max-width: 1400px;
  margin: 1.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.toast-popup {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 250;
  background: var(--text-primary);
  color: var(--bg-base);
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transform: translateY(150%);
  opacity: 0;
  transition: var(--transition);
}

.toast-popup.show {
  transform: translateY(0);
  opacity: 1;
}


/* Reserved ad spaces: visible placeholders only until an approved AdSense account and real unit IDs are available. */
.ad-placeholder { min-height: 118px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .5rem; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--bg-elevated); }
.ad-placeholder-inner { min-height: 72px; width: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .25rem; color: var(--text-muted); text-align: center; font-size: .82rem; }
.ad-placeholder-inner strong { color: var(--text-secondary); font-size: .9rem; }
.calculator-directory { margin: 1.25rem auto; max-width: 1400px; }
.calculator-link-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .45rem 1.2rem; padding-left: 1.2rem; margin: .5rem 0 1rem; }
.calculator-link-grid li { padding: .12rem 0; }
.calculator-link-grid a { font-weight: 600; }
@media (max-width: 640px) { .ad-placeholder { min-height: 100px; } .calculator-link-grid { grid-template-columns: 1fr; } }
