/* Public Incident Page Styles */

/* Prevent horizontal scroll at the highest levels */
html.public-incident-page,
body.public-incident-page {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

.public-incident-page {
    background: var(--background);
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

.public-incident-page * {
    box-sizing: border-box;
}

.public-incident-page main {
    padding: 0 !important;
    max-width: 100% !important;
    width: 100%;
    overflow-x: hidden;
}

.incident-main {
    padding-top: 90px;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.incident-layout {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 2rem;
    align-items: start;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
}

/* Ensure content areas don't overflow */
.incident-content {
    min-width: 0;
    overflow: hidden;
}

.incident-sidebar {
    min-width: 0;
    max-width: 340px;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb span:not(:last-child) {
    opacity: 0.5;
}

/* Incident Hero */
.incident-hero {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--discipline-color, var(--primary-color));
}

.incident-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.incident-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: color-mix(in srgb, var(--discipline-color) 10%, transparent);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--discipline-color);
    text-decoration: none;
    transition:
        background 0.2s,
        transform 0.2s;
}

a.incident-hero-badge:hover {
    background: color-mix(in srgb, var(--discipline-color) 20%, transparent);
    transform: translateY(-1px);
}

.incident-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 1rem;
    background: color-mix(in srgb, var(--type-color, #6b7280) 15%, transparent);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--type-color, #6b7280);
    text-decoration: none;
    transition:
        background 0.2s,
        transform 0.2s;
}

a.incident-type-badge:hover {
    background: color-mix(in srgb, var(--type-color, #6b7280) 25%, transparent);
    transform: translateY(-1px);
}

.incident-cancelled-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 1rem;
    background: rgba(107, 114, 128, 0.15);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
}

.incident-admin-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.incident-type-edit-form {
    background: var(--background);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.type-edit-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.type-edit-row label {
    font-size: 0.875rem;
    font-weight: 500;
}

.type-edit-row select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    min-width: 200px;
    background: white;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-inline input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary-color);
}

.incident-icon {
    font-size: 1.25rem;
}

.incident-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 1rem;
}

.incident-location {
    display: block;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.incident-original-message {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: baseline;
    padding: 0.75rem 1rem;
    background: color-mix(
        in srgb,
        var(--discipline-color, var(--primary-color)) 8%,
        transparent
    );
    border-radius: 8px;
    margin-bottom: 1rem;
    font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono", monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.original-message-label {
    font-weight: 600;
    color: var(--discipline-color, var(--primary-color));
    flex-shrink: 0;
}

.original-message-text {
    color: var(--text-primary);
    word-break: break-word;
}

.incident-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.incident-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

a.incident-meta-item {
    text-decoration: none;
    transition: color 0.2s;
}

a.incident-meta-item:hover {
    color: var(--primary-color);
}

.meta-icon {
    font-size: 1rem;
}

/* Incident Sections */
.incident-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    min-width: 0;
    overflow: hidden;
}

/* Summary Section - News Article Style */
.incident-summary-section {
    background: var(--card-background);
    border-left: 4px solid var(--primary-color);
}

.incident-article {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.incident-article p {
    margin: 0 0 1rem;
    color: var(--text-secondary);
}

.incident-article p:last-of-type {
    margin-bottom: 0;
}

.incident-article p:first-of-type {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.incident-article-headline {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
    line-height: 1.4;
}

.incident-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.incident-article-disclaimer {
    font-weight: 600;
    color: var(--text-secondary);
}

.incident-article-update {
    font-style: italic;
}

/* Legacy support */
.incident-summary {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin: 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

.section-icon {
    font-size: 1.25rem;
}

.section-count {
    margin-left: auto;
    padding: 0.2rem 0.6rem;
    background: var(--background);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Map Section */
.incident-map-section {
    padding: 0;
    overflow: hidden;
}

.incident-map {
    height: 300px;
    width: 100%;
}

.map-location-info {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-color);
}

.map-accuracy-badge {
    padding: 0.3rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.map-accuracy-badge.exact {
    background: #dcfce7;
    color: #166534;
}

.map-accuracy-badge.street {
    background: #fef3c7;
    color: #92400e;
}

.map-accuracy-badge.city {
    background: #fee2e2;
    color: #991b1b;
}

.map-address {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Map marker styles */
.custom-marker,
.station-marker-icon-wrapper,
.heli-marker {
    background: transparent !important;
    border: none !important;
}

/* Vehicles Grid */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.vehicle-card {
    background: var(--background);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.vehicle-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.vehicle-id {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: monospace;
}

.vehicle-type {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0.25rem 0;
}

.vehicle-station {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Disciplines Grid */
.disciplines-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.discipline-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: color-mix(in srgb, var(--disc-color) 10%, white);
    border: 1px solid color-mix(in srgb, var(--disc-color) 20%, transparent);
    border-radius: 12px;
    transition: transform 0.2s;
}

.discipline-card:hover {
    transform: translateY(-2px);
}

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

.discipline-name {
    font-weight: 600;
    color: var(--text-primary);
}

.discipline-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Blurred Sections */
.incident-blurred-section {
    position: relative;
}

.blurred-content {
    position: relative;
}

.blurred-items {
    position: relative;
}

.blurred-item,
.timeline-item {
    padding: 0.75rem 1rem;
    background: var(--background);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.blurred-item.blurred,
.timeline-item.blurred {
    filter: blur(4px);
    user-select: none;
    pointer-events: none;
}

.capcode-code {
    font-family: monospace;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 80px;
}

.capcode-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Messages Timeline */
.messages-timeline .timeline-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.timeline-time {
    font-family: monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
}

.timeline-content {
    width: 100%;
}

.timeline-message {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
    word-break: break-word;
}

.timeline-item-cancelled {
    background: rgba(107, 114, 128, 0.08);
    border-left: 3px solid #6b7280;
}

.timeline-cancelled-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    background: rgba(107, 114, 128, 0.15);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.25rem;
}

/* Blurred Overlay */
.blurred-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, transparent 0%, white 50%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1rem;
}

.blurred-cta {
    text-align: center;
}

.blurred-cta p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

/* Municipality Link */
.incident-municipality-link {
    margin-bottom: 1.5rem;
}

.incident-municipality-link a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 12px;
    color: var(--text-primary, #e2e8f0);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s;
}

.incident-municipality-link a:hover {
    background: var(--card-bg-hover, #263348);
    border-color: var(--accent-color, #3b82f6);
}

.incident-municipality-link .municipality-link-icon {
    font-size: 1.25rem;
}

.incident-municipality-link .municipality-link-text {
    flex: 1;
}

.incident-municipality-link svg {
    opacity: 0.5;
    flex-shrink: 0;
}

/* Incident CTA Section */
.incident-cta-section {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.incident-cta-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.75rem;
}

.incident-cta-content p {
    color: #94a3b8;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.incident-cta-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 2rem;
    margin-bottom: 1.5rem;
}

.incident-cta-features span {
    color: #22c55e;
    font-size: 0.9rem;
    font-weight: 500;
}

.incident-cta-responder {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

.incident-cta-responder .incident-cta-features span {
    color: #fecaca;
}

.incident-cta-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.btn-hero-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: #dc2626;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-hero-secondary:hover {
    background: #fef2f2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Sidebar */
.incident-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-section {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-incidents {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-incident {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-incident:hover {
    background: color-mix(in srgb, var(--primary-color) 10%, var(--background));
    transform: translateX(4px);
}

.sidebar-incident-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-incident-content {
    flex: 1;
    min-width: 0;
}

.sidebar-incident-type {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-incident-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.sidebar-relation-badge {
    display: inline-flex;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sidebar-relation-badge.location {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.sidebar-relation-badge.time {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.sidebar-empty {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: center;
    padding: 1rem;
}

.sidebar-more {
    display: block;
    text-align: center;
    padding: 0.75rem;
    margin-top: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.2s;
}

.sidebar-more:hover {
    background: var(--background);
}

/* Sidebar CTA */
.sidebar-cta {
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    color: white;
    text-align: center;
}

.sidebar-cta-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.sidebar-cta h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.sidebar-cta p {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.sidebar-cta .btn {
    background: white;
    color: var(--primary-color);
}

.sidebar-cta .btn:hover {
    background: #f1f5f9;
}

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

    .incident-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem;
    }

    .sidebar-section {
        margin-bottom: 0;
    }
}

@media (max-width: 640px) {
    .incident-layout {
        padding: 1rem;
    }

    .incident-hero {
        padding: 1.5rem;
    }

    .incident-title {
        font-size: 1.5rem;
    }

    .incident-location {
        font-size: 1rem;
    }

    .incident-meta-bar {
        gap: 1rem;
    }

    .vehicles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .incident-cta-section {
        padding: 1.5rem;
    }

    .incident-sidebar {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode */
[data-theme="dark"] .incident-hero,
[data-theme="dark"] .incident-section,
[data-theme="dark"] .sidebar-section:not(.sidebar-cta) {
    background: #1e293b;
}

[data-theme="dark"] .incident-title,
[data-theme="dark"] .section-title,
[data-theme="dark"] .sidebar-title,
[data-theme="dark"] .discipline-name,
[data-theme="dark"] .timeline-message,
[data-theme="dark"] .sidebar-incident-type {
    color: #f1f5f9;
}

[data-theme="dark"] .incident-location,
[data-theme="dark"] .incident-meta-item,
[data-theme="dark"] .map-address,
[data-theme="dark"] .vehicle-station,
[data-theme="dark"] .capcode-desc,
[data-theme="dark"] .sidebar-incident-time {
    color: #94a3b8;
}

[data-theme="dark"] .vehicle-card,
[data-theme="dark"] .blurred-item,
[data-theme="dark"] .timeline-item,
[data-theme="dark"] .sidebar-incident {
    background: #0f172a;
}

[data-theme="dark"] .section-count {
    background: #0f172a;
    color: #94a3b8;
}

[data-theme="dark"] .discipline-card {
    background: color-mix(in srgb, var(--disc-color) 15%, #1e293b);
    border-color: color-mix(in srgb, var(--disc-color) 30%, transparent);
}

[data-theme="dark"] .blurred-overlay {
    background: linear-gradient(to bottom, transparent 0%, #1e293b 50%);
}

[data-theme="dark"] .map-location-info {
    border-top-color: #334155;
}

[data-theme="dark"] .sidebar-title {
    border-bottom-color: #334155;
}

[data-theme="dark"] .breadcrumb a,
[data-theme="dark"] .breadcrumb span {
    color: #94a3b8;
}

/* Photos Gallery */
.photos-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.gallery-item {
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Gallery Lightbox */
.gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.gallery-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.gallery-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
}

.gallery-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.gallery-prev {
    left: 1rem;
}
.gallery-next {
    right: 1rem;
}

.gallery-content {
    max-width: 90%;
    max-height: 85%;
    text-align: center;
}

.gallery-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.gallery-info {
    margin-top: 1rem;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

#gallery-counter {
    font-size: 0.875rem;
    opacity: 0.7;
}

#gallery-caption {
    font-size: 1rem;
}

/* Links Section */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    overflow: hidden;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--background);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
    min-width: 0;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.link-item:hover {
    background: color-mix(in srgb, var(--primary-color) 10%, var(--background));
    transform: translateX(4px);
}

.link-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.link-content {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    width: 0;
    display: block;
}

.link-title {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100vw - 200px);
}

.link-type {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.link-arrow {
    color: var(--text-secondary);
    font-size: 1rem;
    flex-shrink: 0;
}

/* Upload Section */
.incident-upload-section {
    border: 2px dashed var(--border-color);
    background: var(--background);
}

.upload-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.upload-tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.upload-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.upload-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-dropzone:hover {
    border-color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 5%, transparent);
}

.upload-dropzone input {
    display: none;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.upload-text {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.upload-preview {
    display: none;
    max-width: 200px;
    margin: 1rem auto 0;
}

.upload-preview img {
    width: 100%;
    border-radius: 8px;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px
        color-mix(in srgb, var(--primary-color) 20%, transparent);
}

.upload-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0;
}

/* Compact Media Section */
.incident-media-section .links-list.has-photos {
    margin-top: 1.25rem;
}

.media-add-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.media-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s;
}

.media-add-btn:hover {
    border-color: var(--primary-color);
    border-style: solid;
    color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 5%, transparent);
}

.media-add-btn span {
    font-size: 1rem;
}

.media-form {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--background);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.compact-upload-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.compact-dropzone {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.compact-dropzone:hover {
    border-color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 5%, transparent);
}

.compact-dropzone input {
    display: none;
}

.dropzone-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropzone-icon {
    font-size: 1.25rem;
}

.dropzone-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.compact-dropzone .upload-preview {
    display: none;
    margin: 0;
    max-width: 60px;
    margin-left: auto;
}

.compact-dropzone .upload-preview img {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
}

.form-input-sm {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.8125rem;
}

.form-input-sm:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    cursor: pointer;
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

.media-empty-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Alert Messages */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background: color-mix(in srgb, #22c55e 15%, var(--background));
    border: 1px solid color-mix(in srgb, #22c55e 30%, transparent);
    color: #16a34a;
}

.alert-error {
    background: color-mix(in srgb, #ef4444 15%, var(--background));
    border: 1px solid color-mix(in srgb, #ef4444 30%, transparent);
    color: #dc2626;
}

/* Auto dark mode */
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] .incident-hero,
    [data-theme="auto"] .incident-section,
    [data-theme="auto"] .sidebar-section:not(.sidebar-cta) {
        background: #1e293b;
    }

    [data-theme="auto"] .incident-title,
    [data-theme="auto"] .section-title,
    [data-theme="auto"] .sidebar-title,
    [data-theme="auto"] .discipline-name,
    [data-theme="auto"] .timeline-message,
    [data-theme="auto"] .sidebar-incident-type {
        color: #f1f5f9;
    }

    [data-theme="auto"] .incident-location,
    [data-theme="auto"] .incident-meta-item,
    [data-theme="auto"] .map-address,
    [data-theme="auto"] .vehicle-station,
    [data-theme="auto"] .capcode-desc,
    [data-theme="auto"] .sidebar-incident-time {
        color: #94a3b8;
    }

    [data-theme="auto"] .vehicle-card,
    [data-theme="auto"] .blurred-item,
    [data-theme="auto"] .timeline-item,
    [data-theme="auto"] .sidebar-incident {
        background: #0f172a;
    }

    [data-theme="auto"] .section-count {
        background: #0f172a;
        color: #94a3b8;
    }

    [data-theme="auto"] .discipline-card {
        background: color-mix(in srgb, var(--disc-color) 15%, #1e293b);
        border-color: color-mix(in srgb, var(--disc-color) 30%, transparent);
    }

    [data-theme="auto"] .blurred-overlay {
        background: linear-gradient(to bottom, transparent 0%, #1e293b 50%);
    }

    [data-theme="auto"] .map-location-info {
        border-top-color: #334155;
    }

    [data-theme="auto"] .sidebar-title {
        border-bottom-color: #334155;
    }

    [data-theme="auto"] .breadcrumb a,
    [data-theme="auto"] .breadcrumb span {
        color: #94a3b8;
    }
}
