/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    background: #f8fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === Skip Link === */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: #0f766e;
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 1000;
}
.skip-link:focus { top: 0; }

/* === Header === */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #0f172a;
    font-weight: 700;
    font-size: 1.1rem;
}
.logo-text { white-space: nowrap; }
.site-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}
.site-nav a {
    text-decoration: none;
    color: #475569;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}
.site-nav a:hover, .site-nav a[aria-current="page"] {
    color: #0f766e;
    border-bottom-color: #0f766e;
}

/* === Main Layout === */
main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
    width: 100%;
}

/* === Calculator Section === */
.calc-section {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    margin-bottom: 2rem;
}
.calc-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}
@media (max-width: 860px) {
    .calc-layout { grid-template-columns: 1fr; }
}
.calc-inputs h1 {
    font-size: 1.75rem;
    color: #0f172a;
    margin-bottom: 0.25rem;
}
.calc-subtitle {
    color: #64748b;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* === Form Fields === */
.field-group {
    margin-bottom: 1.25rem;
}
.field-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    color: #334155;
}
.field-group input[type="number"] {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f8fafc;
}
.field-group input[type="number"]:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15,118,110,0.15);
    background: #fff;
}
.field-group input[type="range"] {
    width: 100%;
    accent-color: #0f766e;
    margin-top: 0.25rem;
}
.field-note {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
}
.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* === Buttons === */
.button-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
.btn {
    padding: 0.6rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn-secondary {
    background: #e2e8f0;
    color: #334155;
    border-color: #cbd5e1;
}
.btn-secondary:hover { background: #cbd5e1; }
.btn-ghost {
    background: transparent;
    color: #475569;
    border-color: #cbd5e1;
}
.btn-ghost:hover { background: #f1f5f9; }

/* === Presets === */
.preset-scenarios {
    margin-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
}
.preset-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
}
.preset-chip {
    display: inline-block;
    margin: 0.25rem 0.5rem 0.25rem 0;
    padding: 0.4rem 0.85rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 2rem;
    font-size: 0.82rem;
    color: #166534;
    cursor: pointer;
    transition: background 0.2s;
}
.preset-chip:hover { background: #dcfce7; }

/* === Results === */
.calc-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.result-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
}
.result-card h2 {
    font-size: 1rem;
    color: #475569;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.result-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: #0f766e;
    letter-spacing: -0.02em;
}
.result-value-sm {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f766e;
}
.result-sub {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
}
.result-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.result-card-sm {
    padding: 1rem;
    text-align: center;
}
.result-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.25rem;
}
.result-detail {
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
    padding: 0 0.5rem;
}

/* === Comparison Section === */
.comparison-section {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 2rem;
}
.comparison-section h2 {
    font-size: 1.35rem;
    color: #0f172a;
    margin-bottom: 1rem;
}
#empty-comparison-msg {
    color: #94a3b8;
    font-style: italic;
}
.comparison-table-wrap {
    overflow-x: auto;
}
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.comparison-table th {
    background: #f1f5f9;
    padding: 0.65rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #334155;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.comparison-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
}
.comparison-table .remove-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}
.comparison-table .remove-btn:hover { text-decoration: underline; }
#clear-comparisons-btn {
    margin-top: 1rem;
}

/* === Supporting Section === */
.supporting-section {
    margin-bottom: 2rem;
}
.supporting-section h2 {
    font-size: 1.35rem;
    color: #0f172a;
    margin-bottom: 1.25rem;
}
.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}
.support-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
}
.support-card h3 {
    font-size: 1.05rem;
    color: #0f766e;
    margin-bottom: 0.75rem;
}
.support-card p, .support-card li {
    font-size: 0.92rem;
    color: #475569;
    margin-bottom: 0.5rem;
}
.support-card ul {
    padding-left: 1.25rem;
    margin-bottom: 0;
}
.support-card li { margin-bottom: 0.35rem; }

/* === Walkthrough Section === */
.walkthrough-section {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 0.75rem;
    padding: 1.75rem;
    margin-bottom: 2rem;
}
.walkthrough-section h2 {
    font-size: 1.25rem;
    color: #854d0e;
    margin-bottom: 0.75rem;
}
.walkthrough-content p {
    font-size: 0.95rem;
    color: #713f12;
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

/* === Footer === */
.site-footer {
    background: #1e293b;
    color: #cbd5e1;
    padding: 1.5rem 1.25rem;
    margin-top: auto;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    font-size: 0.85rem;
}
.footer-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 0.75rem 0;
    flex-wrap: wrap;
}
.footer-nav a {
    color: #94a3b8;
    text-decoration: none;
}
.footer-nav a:hover { color: #fff; text-decoration: underline; }
.footer-version {
    color: #64748b;
    font-size: 0.78rem;
}

/* === Responsive === */
@media (max-width: 600px) {
    .calc-section, .comparison-section, .support-card, .walkthrough-section {
        padding: 1.25rem;
    }
    .result-value { font-size: 1.75rem; }
    .result-value-sm { font-size: 1.25rem; }
    .result-row { grid-template-columns: 1fr; }
    .header-inner { flex-wrap: wrap; }
    .site-nav ul { gap: 1rem; }
}

/* === Print === */
@media print {
    .site-header, .site-footer, .button-row, .preset-scenarios, #comparison-container button,
    .comparison-table .remove-btn, .skip-link { display: none; }
    body { background: #fff; color: #000; }
    .calc-section, .comparison-section, .supporting-section, .walkthrough-section {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
