/* Reset and 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: #2c2416;
    background-color: #fdfaf3;
    background-image: radial-gradient(circle at 20% 30%, rgba(212, 160, 23, 0.04) 0%, transparent 50%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: #2c2416;
    color: #fdfaf3;
    padding: 0.5rem 1rem;
    z-index: 1000;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

/* Header */
.site-header {
    background: #2c2416;
    color: #fdfaf3;
    padding: 0.75rem 1.5rem;
    border-bottom: 3px solid #D4A017;
}

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

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #fdfaf3;
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-text {
    letter-spacing: 0.02em;
}

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.site-nav a {
    color: #D4A017;
    text-decoration: none;
    font-weight: 500;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

.site-nav a:hover,
.site-nav a:focus {
    border-bottom-color: #D4A017;
}

/* Main */
main {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

/* Hero */
.hero-panel {
    margin-bottom: 2.5rem;
}

.hero-content h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c2416;
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #5c4a2a;
    max-width: 650px;
}

/* Section headings */
.section-heading {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c2416;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e8d9b5;
}

/* Calculator worksheet */
.calculator-worksheet {
    margin-bottom: 3rem;
}

.worksheet-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: #fff;
    border: 1px solid #e8d9b5;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(44, 36, 22, 0.06);
}

@media (max-width: 750px) {
    .worksheet-layout {
        grid-template-columns: 1fr;
    }
}

.calc-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #2c2416;
}

.form-group select,
.form-group input[type="number"] {
    padding: 0.6rem 0.75rem;
    border: 1px solid #c4b38a;
    border-radius: 6px;
    font-size: 1rem;
    background: #fff;
    color: #2c2416;
    font-family: inherit;
}

.form-group select:focus,
.form-group input:focus {
    outline: 2px solid #D4A017;
    outline-offset: 1px;
    border-color: #D4A017;
}

input[type="range"] {
    width: 100%;
    accent-color: #D4A017;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #5c4a2a;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.btn-primary {
    padding: 0.7rem 1.5rem;
    background: #D4A017;
    color: #2c2416;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-primary:hover {
    background: #b8860b;
}

.btn-secondary {
    padding: 0.7rem 1.5rem;
    background: transparent;
    color: #2c2416;
    border: 1px solid #c4b38a;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-secondary:hover {
    background: #f5eedb;
}

.btn-small {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    background: #f5eedb;
    color: #2c2416;
    border: 1px solid #c4b38a;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-small:hover {
    background: #e8d9b5;
}

.btn-danger {
    background: #fff;
    border-color: #c44;
    color: #c44;
}

.btn-danger:hover {
    background: #fef0f0;
}

/* Results panel */
.results-panel {
    background: #fdfaf3;
    border: 1px solid #e8d9b5;
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 200px;
}

.results-empty {
    color: #5c4a2a;
    font-style: italic;
    padding: 1rem 0;
}

.results-content h3 {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    color: #2c2416;
}

.results-list {
    display: grid;
    gap: 0.75rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.5rem 0;
    border-bottom: 1px dotted #c4b38a;
}

.result-item dt {
    font-weight: 600;
    font-size: 0.9rem;
    color: #5c4a2a;
}

.result-item dd {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c2416;
}

.result-notes {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #5c4a2a;
    line-height: 1.5;
}

.result-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

/* Saved presets */
.saved-presets {
    margin-bottom: 2.5rem;
    background: #fff;
    border: 1px solid #e8d9b5;
    border-radius: 12px;
    padding: 1.5rem 2rem;
}

.presets-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.presets-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #fdfaf3;
    border-radius: 6px;
    font-size: 0.9rem;
}

.presets-list button {
    background: transparent;
    border: none;
    color: #c44;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.2rem 0.5rem;
}

/* Support content */
.support-content {
    margin-bottom: 2.5rem;
}

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

@media (max-width: 700px) {
    .support-grid {
        grid-template-columns: 1fr;
    }
}

.support-card {
    background: #fff;
    border: 1px solid #e8d9b5;
    border-radius: 10px;
    padding: 1.5rem;
}

.support-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #2c2416;
}

.support-card p {
    margin-bottom: 0.75rem;
    color: #3a2e1a;
}

.support-card ul {
    padding-left: 1.25rem;
    color: #3a2e1a;
}

.support-card li {
    margin-bottom: 0.5rem;
}

.reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.reference-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: #f5eedb;
    color: #2c2416;
    font-weight: 600;
    border-bottom: 2px solid #c4b38a;
}

.reference-table td {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #e8d9b5;
    color: #3a2e1a;
}

/* Scenario walkthrough */
.scenario-walkthrough {
    margin-bottom: 2rem;
}

.scenario-steps {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    background: #D4A017;
    color: #2c2416;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.step-content h3 {
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
    color: #2c2416;
}

.step-content p {
    color: #3a2e1a;
}

/* Footer */
.site-footer {
    background: #2c2416;
    color: #c4b38a;
    padding: 1.5rem;
    margin-top: auto;
    border-top: 3px solid #D4A017;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #D4A017;
    text-decoration: none;
    font-weight: 500;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-tagline {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.footer-tagline a {
    color: #D4A017;
}

.footer-version {
    font-size: 0.75rem;
    color: #8a7a5a;
}

/* About page (shared styles) */
.about-page {
    max-width: 700px;
}

.about-page h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.about-page p {
    margin-bottom: 1rem;
    color: #3a2e1a;
}

/* Legal pages */
.legal-page {
    max-width: 700px;
}

.legal-page h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

/* Responsive fine-tuning */
@media (max-width: 600px) {
    .hero-content h1 {
        font-size: 1.6rem;
    }
    .worksheet-layout {
        padding: 1.25rem;
    }
    .section-heading {
        font-size: 1.3rem;
    }
}



/* 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;
}
