/* StructuraPro & BuildCost Design System - Inspired by buildcost.in */

:root {
  /* Tell the browser this theme is dark so native controls
     (select, checkbox, scrollbar, etc.) render with matching
     light-on-dark colors instead of guessing / auto-forcing. */
  color-scheme: dark;

  /* Color System - Blueprint Dark Default */
  --bg-main: #0F172A;
  --bg-sidebar: #0B0F19;
  --bg-card: rgba(30, 41, 59, 0.85);
  --bg-card-hover: rgba(51, 65, 85, 0.9);
  --bg-input: #1E293B;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-focus: #3B82F6;

  /* Typography Colors */
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-sub: #64748B;

  /* Brand Engineering Accents */
  --accent-cyan: #06B6D4;
  --accent-amber: #F59E0B;
  --accent-emerald: #10B981;
  --accent-purple: #8B5CF6;
  --accent-red: #EF4444;
  --accent-blue: #2563EB;
  --accent-green-hero: #22C55E;

  /* Fonts — system fallbacks ensure zero render-blocking on 3G/offline */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', Consolas, 'Courier New', Courier, monospace;

  /* Shadows & Glass */
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

[data-theme="light"] {
  /* Force native form controls (select dropdowns, checkboxes,
     scrollbars) to render with light colors. Without this, mobile
     browsers with system dark mode enabled auto-repaint <select>
     text/background using dark-mode guesses, which can make the
     text unreadable even though our own CSS sets dark text on a
     white box. */
  color-scheme: light;

  --bg-main: #FFFFFF;
  --bg-panel: #FFFFFF;
  --bg-input: #FFFFFF;
  --bg-sidebar: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --text-main: #1E293B;
  --text-sub: #475569;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  --border-focus: #8B5CF6;
  --accent-cyan: #6D28D9;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --accent-red: #EF4444;
  --accent-purple: #8B5CF6;
  --header-bg: #FFFFFF;
  --sidebar-bg: #FFFFFF;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  --glass-border: 1px solid #E2E8F0;
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  background-image: radial-gradient(rgba(139, 92, 246, 0.05) 1px, transparent 0);
  background-size: 24px 24px;
  overflow-x: hidden;
}

/* Any media (charts/diagrams/canvas/images) must never overflow its container on any device */
img, svg, canvas, video, iframe {
  max-width: 100%;
  height: auto;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar - Collapsible Icon-Only (70px) -> Hover Expand (280px) */
.sidebar {
  width: 70px;
  background: var(--bg-sidebar);
  border-right: var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.5rem;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  height: 100vh;
  z-index: 120;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
}

.sidebar:hover {
  width: 280px;
  box-shadow: 8px 0 35px rgba(0, 0, 0, 0.6);
}

.sidebar-header {
  padding-bottom: 1.25rem;
  border-bottom: var(--glass-border);
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 0.4rem;
}

/* Attractive Brand Logo Badge */
.brand-logo-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #06B6D4, #8B5CF6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  flex-shrink: 0;
}

.logo:hover .brand-logo-badge {
  transform: scale(1.06) rotate(-4deg);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.brand-logo-badge.sm {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.brand-logo-badge i {
  color: #FFFFFF !important;
  font-size: 1.2rem;
}

.brand-logo-badge.sm i {
  font-size: 1.05rem;
}

.logo-icon {
  font-size: 1.8rem;
  min-width: 32px;
  text-align: center;
  color: var(--accent-purple);
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
}

.logo-text {
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sidebar:hover .logo-text {
  opacity: 1;
  visibility: visible;
}

.brand-name {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.5px;
}

.brand-accent {
  color: var(--accent-purple);
}

.brand-subtitle {
  display: block;
  font-size: 0.65rem;
  color: var(--text-sub);
  font-weight: 700;
  letter-spacing: 1px;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-sub);
  margin-top: 1.25rem;
  margin-bottom: 0.25rem;
  padding-left: 0.75rem;
  letter-spacing: 1px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sidebar:hover .nav-section-label {
  opacity: 1;
  visibility: visible;
}

/* Nav Menu Buttons */
.nav-menu {
  padding: 0.75rem 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.75rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.nav-btn i {
  font-size: 1.2rem;
  min-width: 24px;
  text-align: center;
}

.nav-btn span {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sidebar:hover .nav-btn span {
  opacity: 1;
  visibility: visible;
}

.nav-btn .badge {
  margin-left: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sidebar:hover .nav-btn .badge {
  opacity: 1;
  visibility: visible;
}

.nav-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.nav-btn.active {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.25), transparent);
  color: var(--accent-purple);
  border-left: 3px solid var(--accent-purple);
}

.badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  font-weight: 700;
}

.badge-amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.badge-emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.badge-cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }

.sidebar-ad-box {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sidebar:hover .sidebar-ad-box {
  opacity: 1;
  visibility: visible;
}

.sidebar-footer {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sidebar:hover .sidebar-footer {
  opacity: 1;
  visibility: visible;
}

/* Main Wrapper - Takes advantage of collapsed 70px sidebar */
.main-wrapper {
  margin-left: 70px;
  flex-grow: 1;
  padding: 1.25rem 1.5rem;
  max-width: calc(100vw - 70px);
  width: calc(100vw - 70px);
  box-sizing: border-box;
  transition: margin-left 0.3s ease;
}

/* TOP HEADER BAR (STICKY, EDGE-TO-EDGE) */
.top-nav-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -1.25rem -1.5rem 1.5rem -1.5rem;
  width: calc(100% + 3rem);
  box-sizing: border-box;
  transition: all 0.3s ease;
}

[data-theme="dark"] .top-nav-bar {
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Tier 1 Left: CivilSolution Brand Logo */
.top-brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.3rem;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.top-brand-text {
  letter-spacing: -0.3px;
  font-weight: 800;
}

/* Tier 1 Right: Compact Search Bar */
.top-search-wrapper {
  position: relative;
  flex: 1;
  max-width: 450px;
  margin: 0 auto;
}

.top-search-input-box {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  gap: 0.4rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.top-search-input-box:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.3);
  background: var(--bg-card);
}

.top-search-input-box i {
  color: var(--accent-cyan);
  font-size: 0.85rem;
}

.top-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  width: 100%;
  padding: 0.1rem 0;
}

.top-search-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.top-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  max-height: 340px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  padding: 0.4rem 0;
  backdrop-filter: blur(16px);
  min-width: 260px;
}

.top-search-results.active {
  display: block;
  animation: dropdownSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-result-item:hover {
  background: rgba(6, 182, 212, 0.08);
  color: var(--accent-cyan);
  padding-left: 1.25rem;
}

.search-result-item i {
  width: 20px;
  text-align: center;
  font-size: 0.9rem;
}

.search-result-category {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-left: auto;
  font-weight: 700;
}

/* Header Actions (Buttons, Categories, Currency) */
.top-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-action-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-action-btn:hover {
  background: var(--bg-input);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-main);
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-icon-btn:hover {
  background: var(--bg-input);
  color: var(--accent-cyan);
}

/* Google Translate Custom CSS Fixes */
.goog-te-gadget {
  font-family: inherit !important;
  font-size: 0.78rem !important;
  color: var(--text-sub) !important;
  display: flex !important;
  align-items: center !important;
}

.goog-te-gadget .goog-te-combo {
  background: var(--bg-input) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 20px !important;
  padding: 0.35rem 0.8rem !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  outline: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

.goog-te-gadget .goog-te-combo:hover {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2) !important;
}

.goog-te-gadget > span,
.goog-te-gadget > div > span,
.goog-te-banner-frame {
  display: none !important;
}

body {
  top: 0px !important;
}

/* Tier 2: Centered, Equal-Spaced Dropdown Navigation Menu Bar */
.top-nav-menu {
  order: 3;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0 0 0;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.nav-dropdown {
  position: relative;
}

.nav-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 12px;
  white-space: nowrap;
  line-height: 1.2;
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  transform: translateY(-1px);
}

.dropdown-menu-card {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0.65rem;
  min-width: 300px;
  max-width: 380px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 1000;
  margin-top: 0.5rem;
  backdrop-filter: blur(20px);
}

.nav-dropdown:hover .dropdown-menu-card {
  display: flex;
  animation: dropdownSlideIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown-category-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--text-muted);
  padding: 0.5rem 0.85rem 0.25rem 0.85rem;
  margin-top: 0.25rem;
  letter-spacing: 0.5px;
}

.dropdown-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0.5rem 0;
}

.dropdown-menu-card a {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.dropdown-menu-card a:hover {
  background: var(--bg-input);
  color: var(--accent-cyan);
}

.dropdown-menu-card.right-aligned {
  left: auto;
  right: 0;
}

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

.dropdown-menu-card a {
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.dropdown-menu-card a:hover {
  background: var(--bg-card-hover);
  color: var(--accent-cyan);
  transform: translateX(4px);
}

/* Language Toggle Pill [ English | हिंदी ] matching buildcost.in image */
.top-nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lang-toggle-pill {
  display: none !important;
}

.lang-btn {
  padding: 0.4rem 1rem;
  border-radius: 25px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn.active {
  background: #6D28D9; /* Purple accent matching reference image */
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.4);
}

.btn-theme-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 0.45rem 1.1rem;
  border-radius: 30px;
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.25 ease;
}

.btn-theme-pill:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.12);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.35);
  transform: translateY(-1px);
}

.btn-theme-pill i {
  font-size: 1rem;
  color: #F59E0B;
}

/* LOCATION & DIMENSIONS CHIP BOX */
.buildcost-main-card {
  background: var(--bg-card);
  border-radius: 16px;
}

.location-chip-box {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(6, 182, 212, 0.1);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
}

.grid-3-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #FFF;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.btn-cyan { background: var(--accent-cyan); color: #0F172A; }
.btn-amber { background: var(--accent-amber); color: #0F172A; }
.btn-emerald { background: var(--accent-emerald); color: #0F172A; }
.btn-purple { background: var(--accent-purple); color: #FFF; }

.btn-outline-amber { background: transparent; border: 1px solid var(--accent-amber); color: var(--accent-amber); }
.btn-outline-cyan { background: transparent; border: 1px solid var(--accent-cyan); color: var(--accent-cyan); }
.btn-outline-purple { background: transparent; border: 1px solid var(--accent-purple); color: var(--accent-purple); }

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.w-100 { width: 100%; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

/* GOOGLE ADSENSE COMPLIANT AD SLOTS */
.adsense-unit-container {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  padding: 0.5rem;
  margin: 1rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.adsense-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.adsense-banner-box {
  background: var(--bg-input);
  border-radius: 6px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  color: var(--text-sub);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.75rem;
}

.adsense-banner-box.leaderboard { min-height: 90px; }
.adsense-banner-box.rectangle { min-height: 200px; }
.adsense-banner-box.in-feed { min-height: 110px; }

/* Article Content & Text Styling */
.article-content {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-muted);
}

.article-content h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.article-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.article-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 1rem;
  margin-bottom: 0.4rem;
}

.article-content p { margin-bottom: 0.85rem; }
.article-content ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.article-content li { margin-bottom: 0.4rem; }

.faq-item {
  background: var(--bg-input);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-cyan);
}

.faq-item p { margin-bottom: 0; margin-top: 0.3rem; }

/* Tile Calculator Form Styling */
.tile-calc-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: var(--glass-border);
}

.tile-calc-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  padding: 1rem 0.5rem;
}

.form-group-tile { margin-bottom: 1.25rem; }
.tile-label { font-size: 0.95rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.6rem; display: block; }
.tile-label small { color: var(--text-muted); font-weight: 400; }
.radio-options { display: flex; gap: 1.5rem; align-items: center; }
.radio-inline { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; cursor: pointer; color: var(--text-main); text-transform: none; }
.radio-inline input[type="radio"] { width: auto; cursor: pointer; }
.tile-size-inputs, .tile-area-inputs, .tile-price-inputs { display: flex; align-items: center; gap: 0.75rem; }
.tile-size-inputs select, .tile-area-inputs select, .tile-price-inputs select { max-width: 180px; }
.tile-input-with-label { display: flex; align-items: center; gap: 1rem; }
.tile-input-with-label input { max-width: 200px; }
.input-tag-text { font-size: 0.9rem; color: var(--text-main); }

.btn-tile-calculate {
  width: 100%;
  padding: 0.9rem 2rem;
  background: #1E1E1E;
  color: #FFFFFF;
  border: none;
  border-radius: 4px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  letter-spacing: 0.5px;
}

.btn-tile-calculate:hover { background: #333333; transform: translateY(-1px); }

/* High-End Mathematical Formula Display Box & KaTeX Styling */
.formula-card {
  margin-bottom: 0.85rem !important;
  border: var(--glass-border);
  transition: all 0.2s ease;
}

.formula-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.15);
}

.formula-latex-box {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-left: 4px solid var(--accent-cyan);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
  overflow-x: auto;
}

.rendered-math {
  font-size: 1.15rem;
  color: var(--text-main);
}

.rendered-math .katex {
  font-size: 1.2rem !important;
  color: #38BDF8 !important;
}

.katex-display {
  margin: 0.25rem 0 !important;
}

/* Simple Topic Name Header (Replaces old hero banner) */
.glass-hero-banner {
  width: 100%;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: transparent;
  border: none;
}

.glass-hero-overlay {
  display: none;
}

.glass-hero-content {
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
  width: 100%;
}

.glass-hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #6D28D9;
  letter-spacing: 0px;
  margin: 0;
}

.glass-hero-subtitle {
  font-size: 0.95rem;
  color: #475569;
  font-weight: 500;
  margin-top: 0.5rem;
}

/* Formula Engineering Reason & Step-by-Step Worked Example Boxes */
.formula-reason-box {
  background: rgba(6, 182, 212, 0.08);
  border-left: 3px solid var(--accent-cyan);
  padding: 0.6rem 0.85rem;
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.formula-example-box {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--accent-amber);
  padding: 0.6rem 0.85rem;
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  line-height: 1.5;
}

.formula-example-box code {
  color: var(--accent-amber);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

/* Visual Tile Gallery Showcase (Copyright-Free AI Generated) */
.tile-gallery-section {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.tile-gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.tile-gallery-header h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tile-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.tile-gallery-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.tile-gallery-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-amber);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25);
}

.tile-gallery-card.active {
  border: 2px solid var(--accent-amber);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
}

.tile-gallery-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.tile-gallery-card:hover img {
  transform: scale(1.04);
}

.tile-gallery-info {
  padding: 0.75rem 0.85rem;
}

.tile-gallery-info h5 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.tile-gallery-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.tile-price-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

.tile-results-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.75rem; }
.result-cards-grid { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.75rem; margin-top: 0.75rem; }
.result-card, .stat-card {
  background: var(--bg-input);
  border-radius: 10px;
  padding: 0.65rem 0.9rem !important;
  border-left: 4px solid var(--accent-cyan);
  min-width: 150px;
  flex: 1 1 160px !important;
  max-width: 100% !important;
  width: auto !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.result-card:hover, .stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); }
.result-card.highlight-amber { border-left-color: var(--accent-amber); }
.result-card.highlight-emerald { border-left-color: var(--accent-emerald); }
.result-label, .stat-label { font-size: 0.72rem; color: var(--text-sub); text-transform: uppercase; font-weight: 700; margin-bottom: 0.25rem; letter-spacing: 0.02em; word-break: break-word; }
.result-value { font-size: clamp(1.05rem, 4vw, 1.3rem); font-weight: 800; font-family: var(--font-mono); color: var(--text-main); word-break: break-word; }
.result-sub, .stat-sub { font-size: 0.7rem; color: var(--text-muted); word-break: break-word; }
.stat-value { word-break: break-word; }

/* Dashboard Hero */
.dashboard-hero {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9)), url('data:image/svg+xml;utf8,<svg width="40" height="40" xmlns="http://www.w3.org/2000/svg"><path d="0 0 L40 40 M40 0 L0 40" stroke="rgba(255,255,255,0.03)" stroke-width="1"/></svg>');
  border: var(--glass-border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.dashboard-hero h1 { font-size: 1.8rem; font-weight: 800; }
.dashboard-hero p { color: var(--text-muted); margin-top: 0.25rem; }

/* Metrics Grid & Summary Cards - Guaranteed 3-Column Fit Without Cutoff */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.metric-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.metric-card:hover { transform: translateY(-2px); }
.metric-icon { width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.metric-card.cyan .metric-icon { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.metric-card.amber .metric-icon { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.metric-card.emerald .metric-icon { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.metric-card.purple .metric-icon { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }

.metric-label {
  font-size: 0.62rem;
  color: var(--text-sub);
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-value {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.metric-sub {
  font-size: 0.64rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tools Module Grid */
.section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.4rem; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.85rem; }
.tool-card { background: var(--bg-card); border: var(--glass-border); border-radius: var(--radius); padding: 1rem; cursor: pointer; transition: all 0.2s ease; display: flex; flex-direction: column; }
.tool-card:hover { background: var(--bg-card-hover); transform: translateY(-3px); border-color: var(--accent-cyan); }
.tool-icon { width: 38px; height: 38px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; margin-bottom: 0.65rem; }
.tool-icon.cyan { background: rgba(6, 182, 212, 0.2); color: var(--accent-cyan); }
.tool-icon.amber { background: rgba(245, 158, 11, 0.2); color: var(--accent-amber); }
.tool-icon.emerald { background: rgba(16, 185, 129, 0.2); color: var(--accent-emerald); }
.tool-icon.purple { background: rgba(139, 92, 246, 0.2); color: var(--accent-purple); }
.tool-card h3 { font-size: 0.98rem; font-weight: 700; margin-bottom: 0.35rem; }
.tool-card p { font-size: 0.8rem; color: var(--text-muted); flex-grow: 1; margin-bottom: 0.85rem; line-height: 1.4; }
.tool-footer { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; font-weight: 700; color: var(--accent-cyan); }

/* Panel Box & 2-Column Grids */
.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.panel-box { background: var(--bg-card); border: var(--glass-border); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-lg); margin-bottom: 0.85rem; }
.panel-box.emerald-highlight { border: 1px solid var(--accent-emerald); }
.panel-header { padding: 0.65rem 0.85rem; border-bottom: var(--glass-border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.4rem; }
.panel-header h3 { font-size: 0.95rem; font-weight: 700; display: inline-flex; align-items: center; gap: 0.4rem; line-height: 1.25; margin: 0; word-break: break-word; }
.panel-body { padding: 0.85rem; }
.panel-body.p-0 { padding: 0; }
.panel-body.p-3 { padding: 0.65rem 0.85rem !important; }

/* Sub Navigation Pills - Spacious Margin & Sleek Active Glow */
.section-header { margin-bottom: 1.5rem; }
.section-header h2 { font-size: 1.45rem; font-weight: 800; margin-bottom: 0.35rem; }
.section-header p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.85rem; }
.sub-nav-pills { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.85rem; margin-bottom: 1.5rem; }
.pill-btn { padding: 0.55rem 1.25rem; border-radius: 30px; background: var(--bg-input); border: 1px solid var(--border-color); color: var(--text-muted); font-size: 0.88rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; transition: all 0.2s ease; }
.pill-btn:hover { background: var(--bg-card-hover); color: var(--text-main); border-color: var(--accent-purple); }
.pill-btn.active { background: var(--accent-amber); color: #0F172A; border-color: var(--accent-amber); font-weight: 800; box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35); }

/* Tab Contents & Standalone Content */
.standalone-content { display: block !important; width: 100%; animation: fadeIn 0.3s ease; }
.tab-content, .subtab-content, .mat-section, .rcc-section, .steel-section { display: none !important; }
.tab-content.active, .subtab-content.active, .mat-section.active, .rcc-section.active, .steel-section.active { display: block !important; animation: fadeIn 0.3s ease; }

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

/* RCC Step Cards */
.rcc-step-card { background: var(--bg-input); border-left: 4px solid var(--accent-cyan); border-radius: var(--radius-sm); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.rcc-step-card h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.rcc-step-card p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.highlight-box { background: rgba(6, 182, 212, 0.1); padding: 0.5rem 0.75rem; border-radius: 6px; margin-top: 0.5rem; }

/* AdSense Ad Unit Slots */
.ad-label { display: block; font-size: 0.65rem; font-weight: 800; letter-spacing: 1px; color: var(--text-sub); margin-bottom: 0.3rem; text-align: center; }
.adsense-slot { background: rgba(15, 23, 42, 0.6); border: 1px dashed rgba(255, 255, 255, 0.1); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; min-height: 90px; text-align: center; position: relative; overflow: hidden; }
.sidebar-ad-box { margin: 1.25rem 0; padding: 0.5rem; background: var(--bg-card); border-radius: var(--radius-sm); border: var(--glass-border); }
.top-ad-banner, .bottom-ad-banner, .infeed-ad-banner { background: var(--bg-card); border: var(--glass-border); padding: 0.75rem 1rem; border-radius: var(--radius); }

/* Legal Footer & Links */
.app-footer { border-top: var(--glass-border); padding-top: 1.5rem; text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 0.75rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; font-weight: 600; transition: color 0.2s ease; }
.footer-links a:hover { color: var(--accent-cyan); }
.copyright-text { font-size: 0.75rem; color: var(--text-sub); }

/* Cookie Consent Banner */
.cookie-banner { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px); border: 1px solid var(--accent-amber); border-radius: var(--radius); padding: 1rem 1.5rem; z-index: 2000; box-shadow: var(--shadow-lg); max-width: 700px; width: 90%; display: none; }
.cookie-banner.active { display: block; animation: slideUp 0.4s ease; }

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.cookie-content { display: flex; align-items: center; gap: 1rem; }
.cookie-content p { font-size: 0.82rem; color: var(--text-muted); flex-grow: 1; }
.cookie-content a { color: var(--accent-cyan); }

.legal-text { font-size: 0.9rem; line-height: 1.6; color: var(--text-muted); }
.legal-text h4 { color: var(--text-main); margin-top: 1rem; margin-bottom: 0.3rem; font-size: 0.95rem; }

/* Forms & Inputs - Compact Height, Responsive Wrapping & Tight Spacing */
.form-group { margin-bottom: 0.5rem; flex: 1; min-width: 0; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.5rem; align-items: end; width: 100%; box-sizing: border-box; }
label { display: block; font-size: 0.8rem; font-weight: 600; color: #475569; margin-bottom: 0.4rem; text-transform: capitalize; letter-spacing: 0px; white-space: normal; line-height: 1.3; word-break: break-word; }

input, select, textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.35rem 0.55rem;
  height: 34px;
  background: var(--bg-input) !important;
  border: var(--glass-border);
  border-radius: 6px;
  color: var(--text-main) !important;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  outline: none;
  box-sizing: border-box;
  text-overflow: ellipsis;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

/* Explicitly color dropdown option text so the popup list matches
   the theme instead of falling back to the OS/browser default,
   which is what causes barely-visible text on some mobile browsers. */
select option {
  background: var(--bg-input);
  color: var(--text-main);
}

/* ROOT-CAUSE FIX for "selected value doesn't appear in the box":
   Without appearance:none, many mobile/webview browsers (Android
   Chrome, Samsung Internet, some iOS Safari versions) draw <select>
   using the OS's own native control skin -- especially once
   color-scheme: dark is set on :root. That native skin ignores our
   background/color rules on the CLOSED box and paints it using system
   dark-theme placeholder assets, so the selected text never renders
   (it looks like faint dots/blank instead of the chosen option).
   Forcing appearance:none makes the browser render the closed box
   using OUR CSS (background, color, font) every time, and we draw
   our own arrow so it still looks like a dropdown. */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'><path d='M1 1l6 6 6-6' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 12px 8px;
  cursor: pointer;
}

input:focus, select:focus, textarea:focus { border-color: var(--border-focus); }

input::placeholder, textarea::placeholder { color: var(--text-sub); opacity: 1; }

/* Material List Rows */
.material-list { display: flex; flex-direction: column; gap: 0.5rem; }
.mat-row { display: flex; justify-content: space-between; align-items: center; padding: 0.65rem 0.85rem; background: var(--bg-input); border-radius: var(--radius-sm); }
.mat-details { display: flex; align-items: center; gap: 0.75rem; }
.mat-val { font-family: var(--font-mono); font-size: 1rem; }

.text-cyan { color: var(--accent-cyan) !important; }
.text-amber { color: var(--accent-amber) !important; }
.text-emerald { color: var(--accent-emerald) !important; }
.text-purple { color: var(--accent-purple) !important; }

/* Tables - Compact Height & Padding */
.table-responsive { width: 100%; overflow-x: auto; }
.boq-table, .wbs-table { width: 100%; border-collapse: collapse; text-align: left; }
.boq-table th, .wbs-table th { background: rgba(15, 23, 42, 0.9); padding: 0.55rem 0.85rem; font-size: 0.78rem; text-transform: uppercase; color: var(--text-sub); border-bottom: var(--glass-border); }
.boq-table td, .wbs-table td { padding: 0.5rem 0.85rem; border-bottom: var(--glass-border); font-size: 0.85rem; }
.boq-table tr:hover, .wbs-table tr:hover { background: var(--bg-card-hover); }

/* Modal */
.modal-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-backdrop.active { display: flex; }
.modal-card { background: var(--bg-sidebar); border: var(--glass-border); width: 100%; max-width: 600px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.modal-header { padding: 1.25rem 1.5rem; border-bottom: var(--glass-border); display: flex; justify-content: space-between; align-items: center; }
.close-btn { background: transparent; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }
.modal-body { padding: 1.5rem; }

/* Responsiveness */
@media (max-width: 1024px) {
  .grid-2-col, .grid-3-col, .tile-calc-form-grid, .buildcost-split-layout { grid-template-columns: 1fr; }
  .top-nav-menu { display: none; }
}

@media print {
  .sidebar, .top-nav-bar, .btn, .theme-toggle, .top-ad-banner, .bottom-ad-banner, .infeed-ad-banner, .cookie-banner, .app-footer { display: none !important; }
  .main-wrapper { margin-left: 0; padding: 0; }
  body { background: #FFF; color: #000; }
  .panel-box { border: 1px solid #CCC; box-shadow: none; }
}

/* Google Translate Widget Custom Styling - Perfectly Centered Height */
#google_translate_element {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.goog-te-gadget {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  color: var(--text-muted) !important;
  font-size: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1 !important;
}

.goog-te-gadget-simple {
  background-color: var(--bg-input) !important;
  border: 1px solid var(--border-color) !important;
  padding: 0 10px !important;
  height: 36px !important;
  border-radius: 20px !important;
  font-size: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.goog-te-gadget-simple:hover {
  border-color: var(--accent-cyan) !important;
  background-color: rgba(6, 182, 212, 0.12) !important;
}

.goog-te-menu-value {
  color: var(--text-main) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin: 0 !important;
  line-height: 1 !important;
}

.goog-te-menu-value span {
  color: var(--text-main) !important;
  vertical-align: middle !important;
}

/* BuildCost 2-Column Split Layout (Inputs Left | Results Right) */
.buildcost-split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}



.buildcost-left-col {
  position: sticky;
  top: 1rem;
}

.buildcost-left-col .panel-box {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: none;
  border-radius: 12px;
}

.buildcost-right-col .panel-box,
.result-box,
.result-panel {
  background: #F4F0FF;
  border: 1px solid #EDE9FE;
  box-shadow: none;
  border-radius: 12px;
}

.buildcost-right-col .panel-header {
  border-bottom: none;
}
.buildcost-right-col .panel-header h3 {
  color: #6D28D9;
  font-size: 0.95rem;
}

.buildcost-left-col .panel-header {
  border-bottom: none;
}
.buildcost-left-col .panel-header h3 {
  font-size: 0.95rem;
  color: #334155;
}

/* Mobile Specific Responsive Aesthetics */
.mobile-hamburger-btn {
  display: none;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1.1rem;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.mobile-hamburger-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

.mobile-drawer-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  z-index: 1000;
}

.mobile-drawer-overlay.active {
  display: block;
}

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  /* Transform fixed left sidebar into smooth off-canvas drawer */
  .sidebar {
    display: flex;
    position: fixed;
    top: 0;
    bottom: 0;
    left: -320px;
    width: 280px !important;
    z-index: 1001;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.7);
    background: var(--bg-sidebar);
  }

  .sidebar.mobile-open {
    left: 0 !important;
  }

  /* Force show all drawer text and section labels when drawer is open */
  .sidebar.mobile-open .logo-text {
    display: flex !important;
    flex-direction: column !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .sidebar.mobile-open .nav-section-label {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .sidebar.mobile-open .nav-btn span {
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
    color: var(--text-main) !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
  }

  .sidebar.mobile-open .nav-btn .badge {
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .sidebar.mobile-open .sidebar-ad-box,
  .sidebar.mobile-open .sidebar-footer,
  .sidebar.mobile-open .sidebar-footer span,
  .sidebar.mobile-open .sidebar-footer select {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .mobile-hamburger-btn {
    display: flex;
  }

  /* This class is used in the header markup to hide button text labels
     (e.g. "Categories", "Currency") on phones, but had no rule — the
     buttons were staying full-width and crowding the header. */
  .hide-mobile {
    display: none !important;
  }

  .nav-action-btn {
    padding: 0.5rem;
  }

  .top-brand-text {
    display: none;
  }

  .main-wrapper {
    margin-left: 0 !important;
    width: 100%;
    max-width: 100%;
    padding: 0.75rem;
    padding-bottom: 85px; /* Space for mobile bottom nav bar */
  }

  .glass-hero-title {
    font-size: 1.15rem; /* Make heading smaller on mobile */
    line-height: 1.3;
  }
  .glass-hero-subtitle {
    font-size: 0.75rem; /* Make subtitle smaller on mobile */
  }

  .top-nav-bar {
    border-radius: 20px;
    padding: 0.6rem 0.85rem;
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .top-nav-menu {
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .top-nav-menu::-webkit-scrollbar {
    display: none;
  }

  .top-brand-logo {
    gap: 0.5rem;
    font-size: 1.1rem;
  }

  .top-nav-actions {
    gap: 0.4rem;
    margin-left: auto;
  }

  .lang-toggle-pill {
    padding: 2px;
  }

  .lang-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.72rem;
  }

  .btn-theme-pill {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
  }

  .grid-2-col, .grid-3-col, .tile-calc-form-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .panel-body {
    padding: 1rem;
  }

  .panel-header {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .tile-size-inputs, .tile-area-inputs, .tile-price-inputs {
    flex-wrap: wrap;
  }

  /* Mobile Bottom Action Bar for Thumb Navigation */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    z-index: 999;
    justify-content: space-around;
    align-items: center;
    padding: 0 0.25rem;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.4);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    gap: 0.2rem;
    cursor: pointer;
    flex: 1;
    padding: 0.4rem 0;
    font-weight: 600;
  }

  .mobile-nav-item i {
    font-size: 1.25rem;
  }

  .mobile-nav-item.active, .mobile-nav-item:hover {
    color: var(--accent-purple);
  }
}

/* ================================================================
   PROFESSIONAL DISCLAIMER BANNER
   Prominent, unmissable liability notice on every calculator page
   ================================================================ */

/* --- Top Page Disclaimer Strip --- */
.disclaimer-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(234, 88, 12, 0.08) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  border-left: 4px solid #F59E0B;
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  margin: 0 0 1.25rem 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-main);
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.1);
  position: relative;
}

.disclaimer-banner .disc-icon {
  font-size: 1.1rem;
  color: #F59E0B;
  margin-top: 1px;
  flex-shrink: 0;
}

.disclaimer-banner .disc-body {
  flex: 1;
}

.disclaimer-banner .disc-title {
  font-weight: 700;
  font-size: 0.83rem;
  color: #F59E0B;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.disclaimer-banner .disc-text {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.disclaimer-banner .disc-text strong {
  color: var(--text-main);
  font-weight: 600;
}

/* --- Result Section Inline Disclaimer --- */
.disclaimer-result-note {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-top: 1rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-style: italic;
}

.disclaimer-result-note i {
  color: #F59E0B;
  font-size: 0.82rem;
  flex-shrink: 0;
}

/* --- Sticky Footer Disclaimer --- */
.disclaimer-sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.97);
  border-top: 2px solid rgba(245, 158, 11, 0.5);
  padding: 0.55rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.3s ease;
}

.disclaimer-sticky-footer.hidden {
  transform: translateY(100%);
}

.disclaimer-sticky-footer i {
  color: #F59E0B;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.disclaimer-sticky-footer strong {
  color: #F59E0B;
}

.disclaimer-sticky-footer .disc-close {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.25rem;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.disclaimer-sticky-footer .disc-close:hover {
  opacity: 1;
  color: var(--text-main);
}

@media (max-width: 768px) {
  .disclaimer-banner {
    font-size: 0.78rem;
    padding: 0.7rem 0.9rem;
  }
  .disclaimer-sticky-footer {
    font-size: 0.7rem;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    text-align: center;
  }
}

/* ---------------------------------------------------- */
/* MOBILE OVERRIDES FOR CALCULATOR SPLIT LAYOUT         */
/* ---------------------------------------------------- */
@media (max-width: 1024px) {
  .buildcost-split-layout {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
  }
  
  .buildcost-split-layout > div, 
  .buildcost-split-layout > .panel-box {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ---------------------------------------------------- */
/* CALCULATE BUTTON ACTIVATION & RESULT SIZING          */
/* ---------------------------------------------------- */
.stat-value {
  font-size: 1.25rem !important; /* Shrink the large result text */
}

/* Shrink buttons on mobile */
@media (max-width: 768px) {
  .btn, .btn-emerald, .btn-cyan, .btn-purple {
    font-size: 0.9rem !important;
    padding: 0.75rem 1.25rem !important;
  }
}

/* Hide results panel by default */
/* Removed per user request to always show results */

/* ---------------------------------------------------- */
/* DESKTOP FONT SIZES & SCROLLBAR FIX                   */
/* ---------------------------------------------------- */
html, body {
  overflow-y: scroll !important; /* Force scrollbar to always show */
}

/* Custom Scrollbar to ensure it is visible */
::-webkit-scrollbar {
  width: 12px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main); 
  border-left: var(--glass-border);
}
::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.4); 
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.7); 
}

@media (min-width: 1025px) {
  /* Increase font sizes for computer screens */
  .form-group label {
    font-size: 1.05rem !important;
  }
  .form-group input, .form-group select {
    font-size: 1rem !important;
    padding: 0.8rem 1rem !important;
    /* ROOT-CAUSE FIX: the base rule fixes height:34px + overflow:hidden.
       Bumping padding to 0.8rem (12.8px top+bottom = 25.6px) without
       growing the box left under 10px of vertical room for 16px text,
       so the selected value/typed text was clipped almost invisible
       on desktop (worked fine on mobile, which keeps small padding).
       height:auto lets the box grow to fit the bigger padding instead
       of clipping its own content. */
    height: auto !important;
    min-height: 48px;
  }
  .btn, .btn-emerald, .btn-cyan, .btn-purple {
    font-size: 1.15rem !important;
    padding: 1rem 1.5rem !important;
  }
  .stat-value {
    font-size: 1.6rem !important;
  }
  .panel-header h3 {
    font-size: 1.25rem !important;
  }
}


/* Show results panel when activated */
.buildcost-split-layout.show-results > div:nth-child(2),
.buildcost-split-layout.show-results > .panel-box:nth-child(2) {
  display: block !important;
}

@media (max-width: 1024px) {
  .buildcost-split-layout.show-results > div:nth-child(2),
  .buildcost-split-layout.show-results > .panel-box:nth-child(2) {
    display: block !important;
  }
}

/* ================================================================
   FULL-DEVICE RESPONSIVE + RESULT-DISPLAY POLISH PASS
   Applies across ALL calculator pages via shared classes, so it
   fixes every calculator without touching each HTML file.
   ================================================================ */

/* --- Prevent iOS Safari auto-zoom on input focus + bigger touch targets on touch devices --- */
@media (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important; /* must be >=16px to stop iOS zoom-on-focus */
    min-height: 42px;
    padding: 0.5rem 0.65rem;
  }
  .radio-inline input[type="radio"],
  .radio-inline input[type="checkbox"] {
    min-height: auto;
    width: 18px;
    height: 18px;
  }
  .btn, .btn-emerald, .btn-cyan, .btn-purple, .btn-primary, .btn-amber, .btn-outline-amber, .btn-outline-cyan, .btn-outline-purple {
    min-height: 44px; /* comfortable thumb target */
  }
}

/* --- Force result grids to a single, readable column on phones          --- */
/* (Many calculator pages hard-code an inline 2-column grid on the result
   cards; !important here safely overrides that inline style so results
   never get squeezed or clipped on narrow screens.) */
@media (max-width: 600px) {
  .result-cards-grid,
  .tile-results-grid,
  .tile-calc-form-grid,
  .rcc-step-card [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    display: grid !important;
  }
  .result-card, .stat-card {
    flex: 1 1 100% !important;
    min-width: 0;
  }
}

/* --- Tablet: ease the 3-column metrics grid to 2 columns so labels/values
   don't get cramped between phone and desktop sizes --- */
@media (min-width: 601px) and (max-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --- Small phones (<=480px): tighten spacing, keep everything legible --- */
@media (max-width: 480px) {
  .main-wrapper {
    padding: 0.6rem;
    padding-bottom: 85px;
  }
  .glass-hero-title { font-size: 1.05rem; }
  .glass-hero-subtitle { font-size: 0.72rem; }
  .panel-header h3 { font-size: 0.9rem !important; }
  .panel-body { padding: 0.75rem; }
  .result-value, .stat-value { font-size: 1.15rem !important; }
  .result-label, .stat-label { font-size: 0.68rem; }
  .btn, .btn-emerald, .btn-cyan, .btn-purple { font-size: 0.85rem !important; padding: 0.7rem 1rem !important; }
  .section-header h2 { font-size: 1.2rem; }
  .article-content h2 { font-size: 1.15rem; }
  .boq-table th, .wbs-table th, .boq-table td, .wbs-table td { font-size: 0.75rem; padding: 0.45rem 0.55rem; }
  .dashboard-hero { padding: 1.25rem; flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .dashboard-hero h1 { font-size: 1.35rem; }
}

/* --- Large / ultra-wide desktop monitors: keep calculators from
   stretching edge-to-edge so lines of text and input rows stay readable --- */
@media (min-width: 1600px) {
  .main-wrapper {
    padding-left: clamp(1.5rem, 4vw, 5rem);
    padding-right: clamp(1.5rem, 4vw, 5rem);
  }
}

/* --- Tables always scroll instead of breaking layout on any device --- */
.boq-table, .wbs-table { min-width: 480px; }

/* --- Long numeric/mono result values must wrap instead of overflowing
   their card on narrow screens --- */
.metric-value, .result-value, .stat-value, .mat-val {
  overflow-wrap: anywhere;
}
