/* Reset und Basis */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #16a34a;
    --success-hover: #15803d;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --error-color: #dc2626;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
}

/* API-Key Overlay */
.api-key-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.api-key-overlay.hidden {
    display: none;
}

.api-key-modal {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.api-key-modal h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.api-key-modal p {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.api-key-modal .form-row {
    margin-bottom: 1rem;
}

.api-key-modal input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    font-family: monospace;
}

.api-key-modal input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.api-key-modal .btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
}

.api-key-hint {
    margin-top: 1.25rem !important;
    font-size: 0.8rem !important;
}

.api-key-hint a {
    color: var(--primary-color);
    text-decoration: none;
}

.api-key-hint a:hover {
    text-decoration: underline;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), #1e40af);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.header-center-logo {
    height: 36px;
    width: auto;
    border-radius: 4px;
}

.header-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.9;
    flex: 1;
    justify-content: flex-end;
}

.stat-item {
    white-space: nowrap;
}

.stat-item span {
    font-weight: 600;
}

.stat-divider {
    opacity: 0.5;
}

.header-logo {
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.header-text {
    text-align: left;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    line-height: 1.1;
}

.header .subtitle {
    font-size: 0.75rem;
    opacity: 0.85;
    margin-top: 0.1rem;
    letter-spacing: 0.02em;
}

/* Main Container - Mobile First */
.main-container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 120px);
}

/* Route Info Bar (Sticky) */
.route-info-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.route-info-content {
    display: flex;
    gap: 1.5rem;
}

.route-info-item {
    display: flex;
    flex-direction: column;
}

.route-info-item .label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.route-info-item .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.map-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-color);
    transition: all 0.2s;
}

.map-toggle:hover {
    background: var(--border-color);
}

.map-toggle.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.map-toggle-icon {
    font-size: 1rem;
}

/* Karten-Bereich */
.map-section {
    position: relative;
    background: #e5e7eb;
    height: 300px;
    transition: height 0.3s ease;
    overflow: hidden;
}

.map-section.collapsed {
    height: 0;
}

#map {
    width: 100%;
    height: 100%;
}

.map-collapse-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-top: 1px solid var(--border-color);
    padding: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: background 0.2s;
}

.map-collapse-btn:hover {
    background: white;
    color: var(--text-color);
}

/* Formular-Bereich */
.form-section {
    background: white;
    padding: 1rem;
    flex: 1;
}

/* Accordion Sections */
.accordion-section {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.accordion-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
    transition: background 0.2s;
    border: none;
    width: 100%;
}

.accordion-header:hover {
    background: var(--border-color);
}

.accordion-section.active .accordion-header {
    background: var(--primary-color);
    color: white;
}

.accordion-icon {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.accordion-section.active .accordion-icon {
    transform: rotate(0deg);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background: white;
    color: var(--primary-color);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

.accordion-section.active .step-number {
    background: white;
    color: var(--primary-color);
}

.optional-badge {
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.7;
    margin-left: auto;
}

.accordion-content {
    padding: 1rem;
}

/* Subsections */
.subsection {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.subsection:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.subsection-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

/* Form Rows */
.form-row {
    margin-bottom: 0.75rem;
    position: relative;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-row label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-row input,
.form-row select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row input[type="number"] {
    text-align: right;
}

.form-row .hint {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.optional-label {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Island Hint */
.island-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: #e0f2fe;
    border: 1px solid #0ea5e9;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: #0369a1;
}

.island-hint .hint-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

/* Form Row Grid (2 columns on larger screens) */
.form-row-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

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

.form-row-grid:last-child {
    margin-bottom: 0;
}

.form-row-grid .form-row {
    margin-bottom: 0;
}

/* Checkbox Row */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-row input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

.checkbox-row label {
    margin-bottom: 0;
    cursor: pointer;
}

/* Routing Options */
.routing-options {
    background: var(--bg-light);
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.routing-options .form-row {
    margin-bottom: 0.5rem;
}

.routing-options .form-row:last-child {
    margin-bottom: 0;
}

/* Route Warnings */
.route-warnings {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
}

.route-warnings .warning-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #92400e;
}

.route-warnings .warning-item:last-child {
    margin-bottom: 0;
}

.route-warnings .warning-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

.route-warnings.error {
    background: #fee2e2;
    border-color: #dc2626;
}

.route-warnings.error .warning-item {
    color: #991b1b;
}

.route-warnings.info {
    background: #dbeafe;
    border-color: #3b82f6;
}

.route-warnings.info .warning-item {
    color: #1e40af;
}

/* Route Required Badges */
.route-required-badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Highlighted form row when route requires input */
.form-row.route-required {
    background: #fffbeb;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #f59e0b;
    margin-bottom: 0.75rem;
}

.form-row.route-required input,
.form-row.route-required select {
    border-color: #f59e0b;
}

.form-row.route-required input:focus,
.form-row.route-required select:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

/* Autocomplete */
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    list-style: none;
    max-height: 180px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-list.active {
    display: block;
}

.autocomplete-list li {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

.autocomplete-list li:last-child {
    border-bottom: none;
}

.autocomplete-list li:hover {
    background-color: var(--bg-light);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
}

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

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: var(--success-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

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

.btn-large {
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-link {
    background: none;
    color: var(--text-muted);
    padding: 0.5rem;
    font-size: 0.85rem;
    width: 100%;
    margin-top: 0.5rem;
}

.btn-link:hover {
    color: var(--text-color);
    transform: none;
}

/* Form Actions */
.form-actions {
    background: var(--bg-light);
    margin: 0 -1rem -1rem -1rem;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.form-actions .checkbox-row {
    margin-bottom: 0.75rem;
}

/* Crossing Modal */
.crossing-modal {
    max-width: 360px;
}

.crossing-modal h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 1.1rem;
}

.crossing-modal p {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.crossing-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.crossing-options .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Results Section */
.results-section {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.results-section h2 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.results-table td {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-color);
}

.results-table td.amount {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.results-table .total-row td {
    font-weight: 600;
    font-size: 1rem;
    border-top: 2px solid var(--text-color);
    border-bottom: none;
    padding-top: 0.6rem;
}

.results-table .total-row td.amount {
    color: var(--success-color);
}

.export-buttons {
    display: flex;
    gap: 0.5rem;
}

.export-buttons .btn {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.5rem;
}

/* Multi-Route Results */
.multi-route-results {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.multi-route-results .route-section-header {
    background: var(--bg-light);
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

.multi-route-results .route-segment {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.multi-route-results .route-segment:last-child {
    border-bottom: none;
}

.multi-route-results .segment-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.multi-route-results .segment-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
}

.multi-route-results .segment-info {
    text-align: right;
    color: var(--text-color);
}

.multi-route-results .transit-segment {
    background: #dbeafe;
    border-bottom: 1px solid #93c5fd;
}

.multi-route-results .transit-segment .segment-label {
    color: #1d4ed8;
}

.multi-route-results .transit-segment .segment-info {
    color: #1d4ed8;
    font-weight: 500;
}

/* Footer */
.footer {
    background: var(--text-color);
    color: white;
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.75rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    max-width: 360px;
    width: 100%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-close:hover {
    color: var(--text-color);
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error State */
.error-input {
    border-color: var(--error-color) !important;
}

.error-message {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ===================== */
/* TABLET (768px+) */
/* ===================== */
@media (min-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .route-info-bar {
        padding: 1rem 1.5rem;
    }

    .route-info-item .value {
        font-size: 1.25rem;
    }

    .map-section {
        height: 350px;
    }

    .form-section {
        padding: 1.5rem;
        max-width: 700px;
        margin: 0 auto;
    }

    .accordion-content {
        padding: 1.25rem;
    }

    .results-section {
        padding: 1.25rem;
    }
}

/* ===================== */
/* DESKTOP (1024px+) */
/* ===================== */
@media (min-width: 1024px) {
    .main-container {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
    }

    .main-container.map-visible {
        grid-template-columns: 1fr 500px;
        grid-template-rows: auto 1fr;
    }

    .main-container.map-visible .route-info-bar {
        grid-column: 1 / -1;
    }

    .main-container.map-visible .map-section {
        grid-row: 2;
        height: 100%;
        min-height: calc(100vh - 180px);
    }

    .main-container.map-visible .form-section {
        grid-row: 2;
        max-width: none;
        max-height: calc(100vh - 180px);
        overflow-y: auto;
        border-left: 1px solid var(--border-color);
    }

    .map-section {
        height: 300px;
    }

    .form-section {
        max-width: 600px;
    }

    .form-actions {
        position: sticky;
        bottom: 0;
    }
}

/* ===================== */
/* LARGE DESKTOP (1280px+) */
/* ===================== */
@media (min-width: 1280px) {
    .main-container.map-visible {
        grid-template-columns: 1fr 550px;
    }

    .form-section {
        max-width: 650px;
    }
}

/* ===================== */
/* MULTI-ROUTE MODE */
/* ===================== */

/* Mode Toggle */
.route-mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    background: var(--bg-light);
    padding: 0.25rem;
    border-radius: 8px;
}

.route-mode-btn {
    flex: 1;
    padding: 0.6rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.route-mode-btn:hover {
    color: var(--text-color);
}

.route-mode-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Segments Container */
.segments-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Segment Card */
.segment-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.segment-card + .segment-connector + .segment-card,
.segment-card + .transit-card + .segment-connector + .segment-card {
    margin-top: 0;
}

.segment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.segment-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

.segment-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
}

.segment-actions {
    display: flex;
    gap: 0.25rem;
}

.segment-action-btn {
    padding: 0.3rem 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.segment-action-btn:hover {
    background: var(--border-color);
    color: var(--text-color);
}

.segment-action-btn.delete:hover {
    background: #fee2e2;
    color: var(--error-color);
}

.segment-body {
    padding: 0.75rem;
}

.segment-body .form-row {
    margin-bottom: 0.6rem;
}

.segment-body .form-row:last-child {
    margin-bottom: 0;
}

.segment-body input {
    font-size: 0.9rem;
    padding: 0.5rem 0.6rem;
}

/* Segment Results */
.segment-results {
    display: none;
    padding: 0.6rem 0.75rem;
    background: #ecfdf5;
    border-top: 1px solid #a7f3d0;
}

.segment-results.visible {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.segment-result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.segment-result-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #059669;
    letter-spacing: 0.3px;
}

.segment-result-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #047857;
}

.segment-calculate-btn {
    width: 100%;
    margin-top: 0.5rem;
}

/* Segment Connector */
.segment-connector {
    display: flex;
    justify-content: center;
    padding: 0.25rem 0;
    position: relative;
}

.segment-connector::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
    transform: translateX(-50%);
}

.connector-icon {
    position: relative;
    z-index: 1;
    background: white;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Inline Transit Button (zwischen Segmenten) */
.add-transit-inline-btn {
    position: relative;
    z-index: 1;
    background: white;
    border: 2px dashed #3b82f6;
    color: #3b82f6;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-transit-inline-btn:hover {
    background: #dbeafe;
    border-style: solid;
}

/* Transit Card (Ferry/Tunnel between segments) */
.transit-card {
    background: #dbeafe;
    border: 2px dashed #3b82f6;
    border-radius: 8px;
    padding: 0.75rem;
    position: relative;
}

.transit-card::before,
.transit-card::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 2px;
    height: 0.5rem;
    background: var(--border-color);
    transform: translateX(-50%);
}

.transit-card::before {
    top: -0.5rem;
}

.transit-card::after {
    bottom: -0.5rem;
}

.transit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.transit-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: #1d4ed8;
}

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

.transit-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.transit-body .form-row {
    margin-bottom: 0;
}

.transit-body label {
    font-size: 0.75rem;
    color: #1e40af;
}

.transit-body input {
    background: white;
    border-color: #93c5fd;
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
}

.transit-body input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.transit-delete-btn {
    padding: 0.2rem 0.4rem;
    border: none;
    background: transparent;
    color: #3b82f6;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.75rem;
}

.transit-delete-btn:hover {
    background: #bfdbfe;
    color: #1d4ed8;
}

/* Add Segment Button */
.add-segment-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.75rem;
    border: 2px dashed var(--border-color);
    background: transparent;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.add-segment-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f0f9ff;
}

.add-transit-btn {
    border-color: #93c5fd;
    color: #3b82f6;
}

.add-transit-btn:hover {
    border-color: #3b82f6;
    background: #dbeafe;
}

/* Multi-Route Summary */
.multi-route-summary {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 1rem;
    overflow: hidden;
}

.summary-header {
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

.summary-body {
    padding: 0.75rem 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.segment-row {
    color: var(--text-muted);
}

.summary-row.transit-row {
    color: #3b82f6;
    background: #f0f9ff;
    margin: 0 -1rem;
    padding: 0.4rem 1rem;
}

.summary-row.total-row {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
    padding-top: 0.6rem;
    border-top: 2px solid var(--text-color);
    margin-top: 0.25rem;
}

.summary-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-values {
    display: flex;
    gap: 1.5rem;
    text-align: right;
}

.summary-value {
    min-width: 70px;
}

/* Calculate All Button */
.calculate-all-btn {
    margin-top: 0.75rem;
}

/* Responsive adjustments */
@media (max-width: 400px) {
    .transit-body {
        grid-template-columns: 1fr;
    }

    .summary-values {
        flex-direction: column;
        gap: 0.25rem;
        align-items: flex-end;
    }
}
