/* Layover Risk Estimator — responsive styles */

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

:root {
    --color-bg: #faf9f7;
    --color-surface: #ffffff;
    --color-text: #1e1e1e;
    --color-text-soft: #5e5e5e;
    --color-accent: #0b6e4f;
    --color-accent-soft: #e6f4ec;
    --color-warning: #b85c00;
    --color-danger: #b91c1c;
    --color-border: #dcd9d4;
    --color-focus: #0b6e4f;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
    --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --max-width: 1100px;
}

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

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--color-text);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    z-index: 1000;
}

.skip-link:focus {
    top: 16px;
}

/* Header */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 650;
    font-size: 1.1rem;
}

.logo svg {
    flex-shrink: 0;
}

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.site-nav a {
    text-decoration: none;
    color: var(--color-text-soft);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.15s;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    border-bottom-color: var(--color-accent);
    color: var(--color-text);
}

/* Main layout */
main {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 28px 20px 48px;
    width: 100%;
}

.estimator-section {
    margin-bottom: 40px;
}

.estimator-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}

.estimator-panel {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 28px 28px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.estimator-panel h1 {
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.estimator-subtitle {
    color: var(--color-text-soft);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

/* Form */
.risk-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

fieldset {
    border: none;
    padding: 0;
}

legend {
    font-weight: 650;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--color-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-buttons button {
    background: var(--color-accent-soft);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--color-text);
    transition: background 0.15s, border-color 0.15s;
}

.preset-buttons button:hover,
.preset-buttons button:focus-visible {
    background: #d0ebdb;
    border-color: var(--color-accent);
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-group label {
    font-weight: 600;
    font-size: 0.95rem;
}

.slider-combo {
    display: flex;
    align-items: center;
    gap: 14px;
}

input[type="range"] {
    flex: 1;
    accent-color: var(--color-accent);
    height: 6px;
}

.number-output {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-weight: 650;
    font-size: 1.05rem;
    min-width: 60px;
    text-align: center;
}

.radio-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.radio-card {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.radio-card:has(input:checked) {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
}

.radio-card input {
    accent-color: var(--color-accent);
}

.card-label {
    font-weight: 650;
    font-size: 0.9rem;
}

.card-hint {
    font-size: 0.8rem;
    color: var(--color-text-soft);
}

.toggle-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

.toggle-item input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    width: 40px;
    height: 22px;
    background: var(--color-border);
    border-radius: 22px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.toggle-item input:checked + .toggle-track {
    background: var(--color-accent);
}

.toggle-item input:checked + .toggle-track::after {
    transform: translateX(18px);
}

.toggle-item input:focus-visible + .toggle-track {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

/* Result area */
.result-area {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.risk-meter {
    margin-bottom: 16px;
}

.meter-gauge {
    height: 10px;
    background: var(--color-border);
    border-radius: 10px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #0b6e4f 0%, #e6b422 60%, #b91c1c 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.meter-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--color-text-soft);
    margin-top: 4px;
}

.risk-summary {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.risk-label {
    font-size: 1.3rem;
    font-weight: 700;
}

.risk-score {
    font-size: 0.95rem;
    color: var(--color-text-soft);
}

.risk-advice {
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-secondary,
.btn-primary {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    transition: background 0.15s, border-color 0.15s;
}

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

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

.btn-primary:hover {
    background: #095a41;
}

/* Support panel */
.support-panel {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    font-size: 0.9rem;
    position: sticky;
    top: 80px;
}

.support-panel h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.support-panel h3 {
    font-size: 0.95rem;
    font-weight: 650;
    margin: 16px 0 6px;
}

.support-panel p,
.support-panel li {
    color: var(--color-text-soft);
    line-height: 1.5;
}

.support-panel ul {
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.walkthrough {
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
}

.walkthrough p {
    margin: 0;
}

/* Checklist section */
.checklist-section {
    margin-bottom: 40px;
}

.checklist-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.checklist-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.checklist-items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.checklist-items li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.95rem;
}

.checklist-items li::before {
    content: '☐';
    font-size: 1.1rem;
    color: var(--color-accent);
    flex-shrink: 0;
}

/* About section */
.about-section {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.about-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.about-section p {
    color: var(--color-text-soft);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

/* Footer */
.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 16px 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-soft);
}

.footer-inner a {
    color: var(--color-accent);
    text-decoration: none;
}

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

/* Responsive */
@media (max-width: 800px) {
    .estimator-layout {
        grid-template-columns: 1fr;
    }

    .support-panel {
        position: static;
    }

    .radio-cards {
        flex-direction: column;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .estimator-panel {
        padding: 20px 16px;
    }

    .estimator-panel h1 {
        font-size: 1.4rem;
    }
}

@media print {
    .site-header,
    .site-footer,
    .action-buttons,
    .support-panel,
    .about-section,
    .estimator-subtitle,
    .preset-buttons,
    .skip-link {
        display: none;
    }

    .estimator-layout {
        grid-template-columns: 1fr;
    }

    .estimator-panel {
        box-shadow: none;
        border: none;
        padding: 0;
    }

    .checklist-items li::before {
        content: '☐';
    }
}



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