/* LohnCheck — Blue professional theme, mobile-first */

:root {
    --blue-600: #1a56db;
    --blue-700: #1e40af;
    --blue-800: #1e3a8a;
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --green-600: #16a34a;
    --red-600: #dc2626;
    --yellow-600: #ca8a04;
    --white: #ffffff;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--blue-600);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 200;
    font-size: 0.875rem;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--blue-700);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon {
    font-size: 1.5rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav a {
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.875rem;
}

.nav a:hover {
    color: var(--blue-600);
}

/* Hamburger menu */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-direction: column;
    gap: 4px;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 1px;
    transition: all 0.2s;
}
@media (max-width: 639px) {
    .nav-toggle {
        display: flex;
    }
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--gray-200);
        flex-direction: column;
        padding: 12px 16px;
        gap: 10px;
        box-shadow: var(--shadow-md);
        z-index: 50;
    }
    .nav.open {
        display: flex;
    }
    .header-inner {
        position: relative;
    }
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--blue-700), var(--blue-600));
    color: var(--white);
    padding: 40px 0 32px;
    text-align: center;
}

.hero h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.hero-sub {
    opacity: 0.9;
    font-size: 1rem;
    margin-bottom: 20px;
}

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius);
    padding: 8px 16px;
    font-size: 0.875rem;
}

.trust-icon {
    font-size: 1.1rem;
}

/* Form */
.calc-form {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
    margin: 24px auto;
    box-shadow: var(--shadow);
}

.form-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--red-600);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.875rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.form-section {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
}

.form-section legend {
    font-weight: 600;
    font-size: 1rem;
    color: var(--blue-700);
    padding: 0 8px;
}

.field {
    margin-top: 16px;
}

.field:first-of-type {
    margin-top: 12px;
}

.field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.field input,
.field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    color: var(--gray-900);
    background: var(--white);
    transition: border-color 0.15s;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.field-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 3px;
}
.field-error-msg {
    display: block;
    font-size: 0.75rem;
    color: var(--red-600);
    margin-top: 3px;
}
.field input.field-invalid,
.field select.field-invalid {
    border-color: var(--red-600);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1);
}

/* Midijob hint */
.midijob-hint {
    background: #fefce8;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Info tooltips */
.info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    font-size: 0.625rem;
    font-weight: 700;
    font-style: italic;
    cursor: help;
    vertical-align: middle;
    margin-left: 4px;
    position: relative;
}
.info-tip:hover::after,
.info-tip:focus::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: var(--white);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 400;
    line-height: 1.4;
    width: 260px;
    white-space: normal;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    pointer-events: none;
}

/* Calc counter */
.calc-counter {
    margin-top: 12px;
    font-size: 0.8125rem;
    opacity: 0.7;
}

/* Number animation */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.results-section:not([hidden]) {
    animation: fadeInUp 0.3s ease;
}

/* SK helper */
.sk-help-toggle {
    background: none;
    border: none;
    color: var(--blue-600);
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    margin-left: 4px;
}
.sk-helper {
    background: var(--blue-50);
    border: 1px solid var(--blue-100);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 0.8125rem;
}
.sk-helper-q {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sk-helper-q select {
    padding: 4px 8px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.8125rem;
}
.sk-helper-result {
    margin-top: 6px;
    font-weight: 500;
    color: var(--blue-700);
}

/* Krankenkassen dropdown */
.kk-search-wrap {
    position: relative;
}

.kk-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: var(--shadow-md);
}

.kk-dropdown.open {
    display: block;
}

.kk-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.875rem;
}

.kk-option:hover {
    background: var(--blue-50);
}

/* Buttons */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s;
}

.btn-primary {
    background: var(--blue-600);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--blue-700);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-small {
    padding: 4px 12px;
    font-size: 0.8125rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-email {
    font-size: 0.8125rem;
    color: var(--gray-500);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Results */
.results-section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
    margin: 0 auto 32px;
    box-shadow: var(--shadow);
}

.results-section h2 {
    font-size: 1.25rem;
    color: var(--blue-700);
    margin-bottom: 8px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.results-brutto {
    color: var(--gray-500);
    font-size: 0.9375rem;
}
.period-toggle {
    display: flex;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    overflow: hidden;
}
.period-btn {
    padding: 4px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    border: none;
    background: var(--white);
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.15s;
}
.period-btn.active {
    background: var(--blue-600);
    color: var(--white);
}
.period-btn:not(.active):hover {
    background: var(--gray-50);
}

.results-table-wrap {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.results-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
}

.results-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
}

.results-table .netto-row {
    background: var(--blue-50);
    border-top: 2px solid var(--blue-600);
}

.results-table .netto-val {
    color: var(--blue-700);
}

.text-right {
    text-align: right;
}

.text-mono {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
}

.text-muted {
    color: var(--gray-500);
}

/* Breakdown chart */
.breakdown-chart {
    margin-top: 20px;
    margin-bottom: 16px;
}
.breakdown-bar {
    display: flex;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--gray-100);
}
.bar-segment {
    transition: width 0.5s ease;
    min-width: 0;
}
.bar-netto { background: #22c55e; }
.bar-steuer { background: #ef4444; }
.bar-sv { background: #f59e0b; }
.breakdown-legend {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 0.8125rem;
    color: var(--gray-700);
    flex-wrap: wrap;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}
.dot-netto { background: #22c55e; }
.dot-steuer { background: #ef4444; }
.dot-sv { background: #f59e0b; }

/* Payslip comparison inputs */
.payslip-input {
    width: 100px;
    padding: 4px 8px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: 'SF Mono', 'Consolas', monospace;
    text-align: right;
    background: var(--gray-50);
    transition: border-color 0.2s;
}
.payslip-input:focus {
    outline: none;
    border-color: var(--blue-600);
    background: var(--white);
    box-shadow: 0 0 0 2px rgba(26, 86, 219, 0.15);
}
.payslip-input-netto {
    font-weight: 600;
}
.payslip-input::placeholder {
    color: var(--gray-300);
}

/* Diff cell colors */
.diff-match { color: var(--green-600); font-weight: 500; }
.diff-warn { color: var(--yellow-600); font-weight: 500; }
.diff-error { color: var(--red-600); font-weight: 600; }

/* Comparison hint */
.comparison-hint {
    margin-top: 12px;
    padding: 10px 14px;
    background: var(--blue-50);
    border-left: 3px solid var(--blue-600);
    font-size: 0.875rem;
    color: var(--gray-700);
    border-radius: 0 4px 4px 0;
}

/* Comparison summary */
.comparison-summary {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.5;
}
.summary-ok {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}
.summary-warning {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* KK savings suggestion */
.kk-savings {
    margin-top: 16px;
    padding: 14px 16px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.kk-savings-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}
.kk-savings-text {
    font-size: 0.9rem;
    color: #92400e;
    line-height: 1.5;
}

/* Steuerklasse comparison */
.sk-comparison {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}
.sk-comparison h3 {
    font-size: 1rem;
    color: var(--blue-700);
    margin-bottom: 4px;
}
.sk-hint {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}
.sk-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}
.sk-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 10px 8px;
    text-align: center;
    font-size: 0.8125rem;
    transition: border-color 0.15s;
}
.sk-card.sk-active {
    border-color: var(--blue-600);
    background: var(--blue-50);
}
.sk-card-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 4px;
}
.sk-card-netto {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 0.8125rem;
    color: var(--gray-900);
    font-weight: 600;
}
.sk-card-diff {
    font-size: 0.6875rem;
    margin-top: 2px;
}
.sk-card-diff.sk-diff-pos { color: var(--green-600); }
.sk-card-diff.sk-diff-neg { color: var(--red-600); }

/* Arbeitgeberkosten */
.ag-kosten {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}
.ag-kosten h3 {
    font-size: 1rem;
    color: var(--blue-700);
    margin-bottom: 10px;
}
.ag-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 16px;
    font-size: 0.875rem;
}
.ag-total {
    font-weight: 600;
    padding-top: 6px;
    border-top: 2px solid var(--gray-200);
}

/* Raise comparison */
.raise-calc {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}
.raise-calc h3 {
    font-size: 1rem;
    color: var(--blue-700);
    margin-bottom: 10px;
}
.raise-inputs {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.raise-inputs .field {
    margin-top: 0;
}
.raise-inputs input {
    width: 160px;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9375rem;
}
.raise-result-grid {
    display: grid;
    grid-template-columns: auto 1fr 1fr 1fr;
    gap: 4px 16px;
    margin-top: 14px;
    font-size: 0.875rem;
    align-items: center;
}
.raise-result-grid .raise-label { font-weight: 500; color: var(--gray-700); }
.raise-result-grid .raise-val { font-family: 'SF Mono','Consolas',monospace; text-align: right; }
.raise-result-grid .raise-header { font-weight: 600; font-size: 0.75rem; color: var(--gray-500); text-align: right; text-transform: uppercase; }
.raise-highlight {
    margin-top: 12px;
    padding: 10px 14px;
    background: var(--blue-50);
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Results actions */
.results-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
}

.disclaimer {
    margin-top: 16px;
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-style: italic;
}

/* SEO Content Section */
.seo-content {
    margin-top: 48px;
    padding: 48px 0;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}
.seo-content h2 {
    font-size: 1.5rem;
    color: var(--blue-700);
    margin-bottom: 24px;
    text-align: center;
}
.seo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 640px) {
    .seo-grid { grid-template-columns: 1fr; }
    .results-table th,
    .results-table td { padding: 8px 4px; font-size: 0.8rem; }
    .payslip-input { width: 75px; padding: 3px 4px; font-size: 0.8rem; }
    .tax-rates { grid-template-columns: 1fr; gap: 6px; }
    .tax-rate-card { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; }
    .tax-rate-label { margin-bottom: 0; }
    .breakdown-legend { gap: 8px; font-size: 0.75rem; }
    .sk-grid { grid-template-columns: repeat(3, 1fr); }
}
.seo-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 20px;
}
.seo-card h3 {
    font-size: 1rem;
    color: var(--gray-800);
    margin-bottom: 8px;
}
.seo-card p {
    font-size: 0.9rem;
    color: var(--gray-700);
    line-height: 1.6;
}

/* Footer */
.footer {
    margin-top: auto;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 16px 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.footer nav {
    display: flex;
    gap: 16px;
}

.footer a {
    color: var(--gray-500);
    text-decoration: none;
}

.footer a:hover {
    color: var(--blue-600);
}

/* Auth Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

.modal-content.auth-modal {
    background: var(--white);
    border-radius: 12px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-content.auth-modal h2 {
    color: var(--blue-700);
    margin-bottom: 8px;
}

.modal-content.auth-modal p {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 16px;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 16px;
}
.breadcrumb a {
    color: var(--blue-600);
    text-decoration: none;
}
.breadcrumb a:hover {
    text-decoration: underline;
}

/* SK cross-navigation */
.sk-nav {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}
.sk-nav h3 {
    font-size: 0.9rem;
    color: var(--gray-700);
    margin-bottom: 10px;
}
.sk-nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.sk-nav-links a {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--blue-600);
    text-decoration: none;
    transition: all 0.15s;
}
.sk-nav-links a:hover {
    background: var(--blue-50);
    border-color: var(--blue-600);
}
.sk-nav-current {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--blue-600);
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--white);
    background: var(--blue-600);
}

/* PWA Install banner */
.install-banner {
    background: linear-gradient(90deg, var(--blue-700), var(--blue-600));
    color: var(--white);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 60;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.install-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.875rem;
}
.install-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.install-banner .btn-primary {
    background: var(--white);
    color: var(--blue-700);
}
.install-banner .btn-secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: var(--white);
}

/* Jahresübersicht */
.annual-overview {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}
.annual-overview h3 {
    font-size: 1rem;
    color: var(--blue-700);
    margin-bottom: 4px;
}
.annual-hint {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}
.annual-table td {
    font-size: 0.8125rem;
    padding: 6px 10px;
}
.annual-table .month-highlight {
    background: var(--blue-50);
    font-weight: 600;
}

/* Keyboard shortcuts hint */
.kbd-hint {
    background: var(--gray-100);
    border-top: 1px solid var(--gray-200);
    padding: 8px 0;
    font-size: 0.75rem;
    color: var(--gray-500);
}
.kbd-hint .container {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}
.kbd-label {
    font-weight: 600;
    color: var(--gray-700);
}
kbd {
    display: inline-block;
    padding: 1px 6px;
    font-size: 0.6875rem;
    font-family: 'SF Mono', 'Consolas', monospace;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 3px;
    box-shadow: 0 1px 0 var(--gray-300);
    margin-right: 2px;
}

/* Tax rate summary cards */
.tax-rates {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 16px;
    margin-bottom: 12px;
}
.tax-rate-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}
.tax-rate-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 4px;
}
.tax-rate-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Consolas', monospace;
    color: var(--gray-900);
}
.tax-rate-green {
    color: var(--green-600);
}

/* Collapsible sections */
.collapsible-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.collapsible-toggle:hover {
    opacity: 0.8;
}
.toggle-icon {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--gray-500);
    transition: transform 0.2s;
}
.collapsible-body {
    display: none;
    padding-top: 8px;
}
.collapsible.open .collapsible-body {
    display: block;
}
.collapsible.open .toggle-icon {
    transform: rotate(45deg);
}

/* Share dropdown */
.share-dropdown-wrap {
    position: relative;
    display: inline-block;
}
.share-dropdown {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    z-index: 20;
    min-width: 140px;
    overflow: hidden;
}
.share-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 14px;
    border: none;
    background: none;
    font-size: 0.8125rem;
    color: var(--gray-700);
    cursor: pointer;
}
.share-option:hover {
    background: var(--blue-50);
    color: var(--blue-600);
}

/* Salary context gauge */
.salary-context {
    margin-top: 16px;
    margin-bottom: 8px;
}
.salary-gauge {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 14px 16px;
}
.gauge-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}
.gauge-bar {
    position: relative;
    height: 20px;
    background: var(--gray-200);
    border-radius: 10px;
    overflow: visible;
}
.gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, #86efac 0%, #22c55e 50%, #f59e0b 80%, #ef4444 100%);
    border-radius: 10px;
    width: 100%;
    opacity: 0.3;
}
.gauge-marker {
    position: absolute;
    top: -4px;
    width: 4px;
    height: 28px;
    background: var(--blue-600);
    border-radius: 2px;
    transition: left 0.4s ease;
    box-shadow: 0 0 0 2px var(--white);
}
.gauge-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: var(--gray-500);
    margin-top: 4px;
}
.gauge-median-label {
    position: relative;
}
.gauge-text {
    font-size: 0.8125rem;
    color: var(--gray-700);
    margin-top: 8px;
}

/* Tax bracket visualization */
.tax-brackets {
    margin-top: 12px;
    margin-bottom: 8px;
}
.bracket-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.bracket-bar {
    display: flex;
    height: 28px;
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--white);
}
.bracket-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
}
.bracket-zone-0 { background: #22c55e; }
.bracket-zone-1 { background: #84cc16; }
.bracket-zone-2 { background: #f59e0b; }
.bracket-zone-3 { background: #ef4444; }
.bracket-zone-4 { background: #991b1b; }
.bracket-marker {
    position: relative;
    height: 20px;
    margin-top: 2px;
}
.bracket-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 8px solid var(--blue-600);
    top: 0;
    transition: left 0.4s ease;
}
.bracket-you {
    position: absolute;
    top: 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--blue-600);
    white-space: nowrap;
    transition: left 0.4s ease;
}

/* Quick presets */
.quick-presets {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.preset-btn {
    padding: 2px 10px;
    font-size: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: var(--white);
    color: var(--gray-600, var(--gray-500));
    cursor: pointer;
    transition: all 0.15s;
}
.preset-btn:hover {
    border-color: var(--blue-600);
    color: var(--blue-600);
    background: var(--blue-50);
}

/* Teilzeit toggle */
.teilzeit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.8125rem;
    color: var(--gray-700);
    flex-wrap: wrap;
}
.teilzeit-toggle-label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-weight: 500;
}
.teilzeit-toggle-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}
.teilzeit-input {
    width: 56px;
    padding: 3px 6px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.8125rem;
    text-align: center;
}
.teilzeit-input:disabled {
    opacity: 0.4;
}
.teilzeit-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Year-over-year comparison */
.year-comparison {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}
.year-comparison h3 {
    font-size: 1rem;
    color: var(--blue-700);
    margin-bottom: 4px;
}
.year-bars {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    height: 120px;
    margin-top: 8px;
    padding-bottom: 20px;
    position: relative;
}
.year-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}
.year-bar-fill {
    width: 100%;
    max-width: 48px;
    border-radius: 4px 4px 0 0;
    transition: height 0.4s ease;
    min-height: 4px;
}
.year-bar-fill.current {
    background: var(--blue-600);
}
.year-bar-fill.past {
    background: var(--gray-300);
}
.year-bar-label {
    font-size: 0.625rem;
    color: var(--gray-500);
    margin-top: 4px;
    font-weight: 600;
}
.year-bar-value {
    font-size: 0.625rem;
    color: var(--gray-700);
    margin-bottom: 2px;
    font-family: 'SF Mono', 'Consolas', monospace;
}

/* Scroll to top */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--blue-600);
    color: var(--white);
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 40;
    transition: opacity 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.scroll-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Calculation history */
.history-panel {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 0 auto 16px;
    box-shadow: var(--shadow);
}
.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.history-header h3 {
    font-size: 0.9375rem;
    color: var(--blue-700);
    margin: 0;
}
.history-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.history-item {
    flex-shrink: 0;
    padding: 8px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 130px;
    background: var(--gray-50);
}
.history-item:hover {
    border-color: var(--blue-600);
    background: var(--blue-50);
}
.history-item-brutto {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-900);
    font-family: 'SF Mono', 'Consolas', monospace;
}
.history-item-netto {
    font-size: 0.75rem;
    color: var(--green-600);
    font-family: 'SF Mono', 'Consolas', monospace;
}
.history-item-meta {
    font-size: 0.625rem;
    color: var(--gray-500);
    margin-top: 2px;
}

/* Steuererklärung reminder */
.steuer-reminder {
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--blue-50);
    border: 1px solid var(--blue-100);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--gray-700);
    line-height: 1.5;
}
.steuer-reminder strong {
    color: var(--blue-700);
}

/* Netto trend sparkline */
.netto-trend {
    margin-top: 16px;
    margin-bottom: 8px;
}
.trend-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 4px;
}
.trend-svg {
    width: 100%;
    height: 60px;
    display: block;
}
.trend-axis {
    display: flex;
    justify-content: space-between;
    font-size: 0.625rem;
    color: var(--gray-500);
    font-family: 'SF Mono', 'Consolas', monospace;
}

/* High contrast toggle */
.contrast-toggle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
    font-weight: 800;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.contrast-toggle:hover {
    border-color: var(--blue-600);
    color: var(--blue-600);
}
.contrast-toggle.active {
    background: var(--gray-900);
    color: var(--white);
    border-color: var(--gray-900);
}

/* High contrast mode */
body.high-contrast {
    --gray-500: #4b5563;
    --gray-700: #111827;
    font-weight: 500;
}
body.high-contrast .field label {
    font-weight: 600;
    color: #000;
}
body.high-contrast .results-table td,
body.high-contrast .results-table th {
    border-bottom-width: 2px;
}
body.high-contrast .info-tip {
    font-weight: 900;
    border: 1px solid var(--gray-500);
}
body.high-contrast .text-mono {
    font-weight: 600;
}

/* Match celebration */
.match-celebration {
    margin-top: 12px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 2px solid #22c55e;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #166534;
    text-align: center;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s, transform 0.3s;
}
.match-celebration.show {
    opacity: 1;
    transform: scale(1);
}
.match-check {
    display: inline-block;
    font-size: 1.25rem;
    margin-right: 6px;
    animation: popIn 0.4s ease;
}
@keyframes popIn {
    0% { transform: scale(0); }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Loading button state */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Minijob notice */
.minijob-notice {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --blue-600: #3b82f6;
        --blue-700: #60a5fa;
        --blue-800: #93c5fd;
        --blue-50: #1e293b;
        --blue-100: #1e3a5f;
        --gray-50: #0f172a;
        --gray-100: #1e293b;
        --gray-200: #334155;
        --gray-300: #475569;
        --gray-500: #94a3b8;
        --gray-700: #cbd5e1;
        --gray-800: #e2e8f0;
        --gray-900: #f1f5f9;
        --white: #1e293b;
        --green-600: #4ade80;
        --red-600: #f87171;
        --yellow-600: #facc15;
    }
    body {
        background: #0f172a;
        color: #e2e8f0;
    }
    .hero {
        background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
    }
    .header, .footer {
        background: #1e293b;
        border-color: #334155;
    }
    .calc-form, .results-section, .seo-card, .modal-content.auth-modal {
        background: #1e293b;
        border-color: #334155;
    }
    .field input, .field select {
        background: #0f172a;
        border-color: #475569;
        color: #e2e8f0;
    }
    .payslip-input {
        background: #0f172a;
        border-color: #475569;
        color: #e2e8f0;
    }
    .payslip-input:focus {
        background: #1e293b;
    }
    .results-table th {
        background: #0f172a;
        border-color: #334155;
    }
    .results-table td {
        border-color: #1e293b;
    }
    .kk-dropdown {
        background: #1e293b;
        border-color: #475569;
    }
    .kk-option:hover {
        background: #334155;
    }
    .trust-badge {
        background: rgba(255,255,255,0.08);
        border-color: rgba(255,255,255,0.15);
    }
    .sk-card {
        background: #0f172a;
        border-color: #334155;
    }
    .sk-card.sk-active {
        background: #1e3a5f;
        border-color: #3b82f6;
    }
    .comparison-hint {
        background: #1e3a5f;
        border-color: #3b82f6;
    }
    .summary-ok {
        background: #052e16;
        border-color: #166534;
        color: #86efac;
    }
    .summary-warning {
        background: #450a0a;
        border-color: #991b1b;
        color: #fca5a5;
    }
    .kk-savings {
        background: #451a03;
        border-color: #92400e;
    }
    .midijob-hint {
        background: #451a03;
        border-color: #92400e;
    }
    .form-error {
        background: #450a0a;
        border-color: #991b1b;
    }
    .seo-content {
        background: #0f172a;
        border-color: #334155;
    }
    .breakdown-bar {
        background: #334155;
    }
    .info-tip {
        background: #475569;
        color: #94a3b8;
    }
    .info-tip:hover::after, .info-tip:focus::after {
        background: #e2e8f0;
        color: #0f172a;
    }
    .period-btn {
        background: #0f172a;
        color: #94a3b8;
        border-color: #475569;
    }
    .period-btn.active {
        background: #3b82f6;
        color: #fff;
    }
    .sk-nav-links a {
        border-color: #475569;
        color: #60a5fa;
    }
    .sk-nav-links a:hover {
        background: #334155;
    }
    .sk-nav-current {
        background: #3b82f6;
        border-color: #3b82f6;
    }
    .bar-netto { background: #22c55e; }
    .bar-steuer { background: #ef4444; }
    .bar-sv { background: #f59e0b; }
    .ag-grid { color: #cbd5e1; }
    .ag-total { border-color: #475569; }
    .sk-helper { background: #1e3a5f; border-color: #2d4a6f; }
    .sk-helper-q select { background: #0f172a; border-color: #475569; color: #e2e8f0; }
    .nav-toggle span { background: #cbd5e1; }
    .raise-inputs input { background: #0f172a; border-color: #475569; color: #e2e8f0; }
    .raise-highlight { background: #1e3a5f; }
    .raise-result-grid .raise-label { color: #cbd5e1; }
    .install-banner { background: linear-gradient(90deg, #1e3a8a, #1d4ed8); }
    .install-banner .btn-primary { background: #e2e8f0; color: #1e3a8a; }
    kbd { background: #0f172a; border-color: #475569; box-shadow: 0 1px 0 #475569; color: #94a3b8; }
    .kbd-hint { background: #1e293b; border-color: #334155; }
    .minijob-notice { background: #052e16; border-color: #166534; color: #86efac; }
    .tax-rate-card { background: #0f172a; border-color: #334155; }
    .salary-gauge { background: #0f172a; border-color: #334155; }
    .preset-btn { background: #0f172a; border-color: #475569; color: #94a3b8; }
    .preset-btn:hover { background: #1e3a5f; }
    .teilzeit-input { background: #0f172a; border-color: #475569; color: #e2e8f0; }
    .year-bar-fill.past { background: #475569; }
    .history-panel { background: #1e293b; border-color: #334155; }
    .history-item { background: #0f172a; border-color: #334155; }
    .history-item:hover { background: #1e3a5f; border-color: #3b82f6; }
    .steuer-reminder { background: #1e3a5f; border-color: #2d4a6f; }
    .match-celebration { background: linear-gradient(135deg, #052e16, #064e3b); border-color: #22c55e; color: #86efac; }
    .gauge-bar { background: #334155; }
    .gauge-marker { box-shadow: 0 0 0 2px #1e293b; }
    .share-dropdown { background: #1e293b; border-color: #475569; }
    .share-option:hover { background: #334155; }
}

/* Responsive */
@media (max-width: 639px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .calc-form {
        padding: 16px;
    }

    .form-section {
        padding: 16px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .footer-inner {
        flex-direction: column;
        gap: 8px;
    }
}

/* Print */
@media print {
    body { background: white; font-size: 12pt; }
    .header, .hero, .calc-form, .seo-content, .footer, .results-actions,
    .comparison-hint, .kk-savings, .ag-kosten, #signInBtn, #userMenu,
    .install-banner, .kbd-hint, .raise-calc, .scroll-top, .year-comparison, .history-panel { display: none !important; }
    .results-section {
        border: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
    }
    .results-section[hidden] { display: none !important; }
    .payslip-input {
        border: none;
        background: none;
        box-shadow: none;
        padding: 0;
        font-size: 10pt;
    }
    .breakdown-bar { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .bar-netto, .bar-steuer, .bar-sv { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .sk-card { break-inside: avoid; }
    .sk-card.sk-active { background: #eff6ff !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .diff-match, .diff-warn, .diff-error { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .netto-row { background: #eff6ff !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .container { max-width: 100%; }
    @page { margin: 1.5cm; }
}
