:root {
    --navy-primary: #0F2C59;
    --navy-dark: #071938;
    --navy-light: #1E40AF;
    --bg-light: #F8FAFC;
    --white: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --accent-green: #16A34A;
    --accent-green-bg: #DCFCE7;
    --accent-blue-bg: #EFF6FF;
    --warning-bg: #FEF3C7;
    --warning-text: #92400E;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
}

header {
    background-color: var(--navy-primary);
    color: var(--white);
    padding: 1rem 0;
    border-bottom: 4px solid var(--accent-green);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Logo link & image classes for layout refactoring */
.logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 38px;
    width: 38px;
    vertical-align: middle;
    margin-right: 10px;
    object-fit: contain;
}

.logo-badge {
    background: #334155;
    color: #E2E8F0;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

nav a {
    color: #CBD5E1;
    text-decoration: none;
    margin-left: 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
}
nav a:hover, nav a.active { color: var(--white); }

.finder-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    margin: 2rem 0;
}
.finder-title {
    font-size: 1.2rem;
    color: var(--navy-primary);
    margin-bottom: 1rem;
    font-weight: 700;
}
.search-container {
    position: relative;
    margin-bottom: 1.25rem;
}
.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.search-input {
    width: 100%;
    padding: 0.85rem 1.15rem;
    font-size: 1.05rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
    background: var(--white);
}
.search-input:focus { border-color: var(--navy-light); }
.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 0 0 6px 6px;
    box-shadow: var(--shadow-md);
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}
.suggestion-item {
    padding: 0.75rem 1.15rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.suggestion-item:hover { background-color: var(--accent-blue-bg); }
.suggestion-state-tag {
    font-size: 0.8rem;
    padding: 0.1rem 0.4rem;
    background: var(--navy-primary);
    color: white;
    border-radius: 3px;
}

.cascading-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}
@media(max-width: 768px) {
    .cascading-row { grid-template-columns: 1fr; }

    /* Main homepage heading — mobile only */
    .main-home-h1 {
        font-size: 1.4rem !important;
        line-height: 1.3 !important;
    }
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media(min-width: 850px) {
    .main-layout { grid-template-columns: 1.1fr 0.9fr; }
}

.card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    color: var(--navy-primary);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.badge-verified {
    background: var(--accent-green-bg);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    color: var(--text-main);
}
.form-group input, .form-group select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--white);
}
.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn {
    padding: 0.65rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: opacity 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.btn-primary { background: var(--navy-primary); color: white; }
.btn-secondary { background: #E2E8F0; color: var(--text-main); }
.btn:hover { opacity: 0.9; }

.summary-box {
    background: var(--navy-primary);
    color: white;
    padding: 1.25rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 1.25rem;
}
.summary-val {
    font-size: 2.2rem;
    font-weight: 700;
    color: #4ADE80;
}
.summary-sub {
    font-size: 0.9rem;
    color: #94A3B8;
}
.summary-metrics {
    font-size: 0.85rem;
    color: #CBD5E1;
    margin-top: 0.5rem;
    border-top: 1px solid #1E3A8A;
    padding-top: 0.5rem;
    text-align: left;
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.breakdown-table th, .breakdown-table td {
    padding: 0.6rem 0.4rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}
.breakdown-table th { color: var(--text-muted); font-weight: 600; }
.breakdown-table td.num { text-align: right; font-weight: 600; }

.split-card {
    background: var(--accent-blue-bg);
    border-left: 4px solid var(--navy-light);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}
.split-box {
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.info-section { margin-top: 2rem; }
.info-section h2 { color: var(--navy-primary); font-size: 1.4rem; margin-bottom: 0.75rem; margin-top: 1.5rem; }
.info-section h3 { color: var(--navy-primary); font-size: 1.1rem; margin-bottom: 0.5rem; margin-top: 1.2rem; }
.info-section p, .info-section ul { margin-bottom: 0.85rem; font-size: 0.95rem; }
.info-section ul { padding-left: 1.25rem; }

/* Footer & Layout Component Styles */
footer {
    background: var(--navy-dark);
    color: #94A3B8;
    padding: 3rem 0 1.5rem 0;
    margin-top: 4rem;
    border-top: 1px solid #334155;
    font-size: 0.85rem;
}
footer a { color: #CBD5E1; text-decoration: none; }
footer a:hover { color: white; }

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: left;
    margin-bottom: 2rem;
}

.footer-title { color: white; font-weight: 600; margin-bottom: 0.75rem; }
.footer-heading {
    color: #FFF;
    margin-bottom: 0.75rem;
}

.footer-text {
    font-size: 0.85rem;
    color: #94A3B8;
}

.footer-list {
    list-style: none;
    padding: 0;
    font-size: 0.85rem;
}

.footer-list-item {
    margin-bottom: 0.4rem;
}

.footer-link {
    color: #94A3B8;
    text-decoration: none;
}

.footer-link:hover {
    color: #FFFFFF;
}

.footer-bottom {
    text-align: center;
    font-size: 0.8rem;
    color: #64748B;
    border-top: 1px solid #334155;
    padding-top: 1rem;
}

.source-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--navy-light);
    text-decoration: underline;
    margin-top: 0.25rem;
}

.disclaimer-box {
    background: var(--warning-bg);
    border-left: 4px solid #D97706;
    color: var(--warning-text);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.excluded-costs-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: #F1F5F9;
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 1rem;
    border: 1px dashed var(--border-color);
}

/* Badge Styles */
.badge, 
.badge-verified, 
.badge-unverified {
    white-space: nowrap;        /* Prevents text from breaking onto a second line */
    display: inline-block;      /* Ensures proper padding and shape rendering */
    flex-shrink: 0;             /* Prevents flexbox containers from squeezing the badge */
}
/* Two equal-width buttons spanning the summary card */
.estimate-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: end;
  gap: 10px;
  margin-top: 12px;
margin-bottom: 0;
position: relative;
  top: 0;
}

.estimate-action-btn {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.estimate-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 9px 12px;
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: 7px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.share-estimate-btn {
  color: #ffffff;
  background: #2878d0;
  border-color: #2878d0;
}

.share-estimate-btn:hover {
  background: #1e65b4;
  border-color: #1e65b4;
}

.save-estimate-btn {
  color: #18385e;
  background: #eef4fa;
  border-color: #d4e1ef;
}

.save-estimate-btn:hover {
  background: #e1ebf6;
  border-color: #b9cde2;
}

.estimate-action-btn:focus-visible {
  outline: 3px solid #80b7f3;
  outline-offset: 2px;
}

.estimate-action-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

@media (max-width: 600px) {
  .estimate-actions {
    gap: 8px;
  }

  .estimate-action-btn {
    min-height: 42px;
    padding: 8px 6px;
    font-size: 12px;
  }
}

/* Stack calculator panels on mobile; preserve the existing desktop layout. */
@media (max-width: 849px) {
    .calculator-panels {
        grid-template-columns: 1fr !important;
    }
}
/* Calculator action buttons */
.calculator-action-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 0.5rem;
}

.calculator-action-buttons .action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex: 1 1 0;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.65rem 0.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
}

.calculator-action-buttons .calculate-btn {
    background: #0F172A;
    color: #FFFFFF;
}

.calculator-action-buttons .secondary-btn {
    background: #E2E8F0;
    color: #334155;
}

.calculator-action-buttons .action-btn svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.calculator-action-buttons .action-btn:hover {
    filter: brightness(0.94);
}

/* Smaller screens: retain all four buttons in one row */
@media (max-width: 767px) {
    .calculator-action-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        width: 100%;
    }

    .calculator-action-buttons .action-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding: 0.7rem 0.4rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .calculator-action-buttons .action-btn svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }
}
.calculator-action-buttons .calculate-btn span {
    transform: translateX(-3px);
}

/* Desktop navigation */
.mobile-menu-toggle,
#mobile-navigation {
    display: none;
}
.desktop-navigation {
    display: flex;
}

.desktop-navigation {
    display: flex;
    align-items: center;
}

/* Mobile navigation */
@media (max-width: 767px) {

    .nav-inner {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        gap: 6px;
        position: relative;
    }

    .desktop-navigation {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
        flex-shrink: 0;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: #FFFFFF;;
        font-size: 1.7rem;
        line-height: 1;
        cursor: pointer;
        padding: 0;
        margin: 0;
        width: 36px;
        height: 36px;
        order: -1;
    }

    .logo-link {
        min-width: 0;
        flex: 1;
        white-space: nowrap;
        font-size: 17px;
        margin-left: 10px;
    }

    .logo-img {
        width: 30px;
        height: 30px;
        margin-right: 5px;
        flex-shrink: 0;
    }

    .logo-badge {
        font-size: 0.70rem;
        padding: 0.12rem 0.3rem;
        margin-left: auto;
        white-space: nowrap;
        flex-shrink: 0;
    }

    #mobile-navigation {
    position: absolute;
    display: none;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    background: #FFFFFF;
    opacity: 1;
    padding: 8px 16px;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

    #mobile-navigation.is-open {
        display: flex;
    }

    #mobile-navigation a {
        margin: 0;
        padding: 0.75rem 0;
        border-top: 1px solid #E2E8F0;
        color: #0F172A;
    }
}