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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
}

.breadcrumb {
    background: #fff;
    padding: 12px 24px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.breadcrumb a { color: #1a73e8; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 6px; color: #999; }

main { max-width: 1200px; margin: 0 auto; padding: 24px; }
h1 { margin-bottom: 24px; font-size: 24px; }

.search-box { margin-bottom: 24px; }
.search-box input {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}
.search-box input:focus { border-color: #1a73e8; }
.no-results { margin-top: 16px; color: #777; font-size: 15px; }

.grid { display: grid; gap: 16px; }
.baustellen-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.datum-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.photo-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.15); transform: translateY(-2px); }

.card-icon {
    padding: 24px 16px 8px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #1a73e8;
}
.card-strasse {
    padding: 4px 16px 20px;
    text-align: center;
    font-size: 12px;
    color: #555;
}
.card-strasse-missing {
    color: #bbb;
    font-style: italic;
}
.strasse-label {
    font-size: 16px;
    font-weight: 400;
    color: #777;
}

.card-thumb { aspect-ratio: 4/3; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-info { padding: 12px 16px; }
.card-info strong { display: block; font-size: 15px; }
.photo-count { font-size: 13px; color: #777; }

.photo-card {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s, transform 0.2s;
}
.photo-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.15); transform: translateY(-2px); }
.photo-card img { width: 100%; height: 100%; object-fit: cover; }

.datum-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.datum-header h1 { margin-bottom: 0; }

.btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #d32f2f;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}
.btn-pdf:hover { background: #b71c1c; }
.btn-pdf::before { content: "\1F4C4"; }

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.lightbox.active { display: flex; }
.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}
.lightbox-close {
    position: absolute;
    top: 16px;
    right: 24px;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    z-index: 1001;
}

.btn-edit {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1a73e8;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 50;
    transition: background 0.2s;
}
.btn-edit:hover { background: #1557b0; }

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 16px;
    overflow-y: auto;
}
.modal.active { display: flex; }
.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    max-width: 600px;
    width: 100%;
    position: relative;
}
.modal-content h2 { margin-bottom: 20px; }
.modal-content h3 { margin: 20px 0 12px; font-size: 16px; }
.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}
.edit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.edit-nr {
    font-weight: 700;
    min-width: 80px;
    color: #1a73e8;
}
.edit-strasse {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}
.edit-row button, .modal-add-row button {
    padding: 8px 16px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}
.edit-row button:hover, .modal-add-row button:hover { background: #1557b0; }
.modal-add-row {
    display: flex;
    gap: 8px;
}
.modal-add-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.anleitung { max-width: 700px; }
.anleitung .intro { margin-bottom: 32px; color: #555; font-size: 15px; line-height: 1.6; }
.step { margin-bottom: 32px; }
.step h2 { font-size: 18px; margin-bottom: 12px; color: #1a73e8; }
.step p, .step li { font-size: 15px; line-height: 1.6; color: #444; }
.step ol, .step ul { padding-left: 24px; margin: 8px 0; }
.step li { margin-bottom: 6px; }
.code-box {
    background: #f0f4f8;
    border: 1px solid #d0d8e0;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 12px 0;
    cursor: pointer;
    position: relative;
    overflow-x: auto;
}
.code-box code {
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 13px;
    word-break: break-all;
    white-space: pre-wrap;
}
.copy-hint {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #999;
}
.warning {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 0 6px 6px 0;
    font-size: 14px;
    color: #e65100;
}
.status-green { color: #4caf50; }
.help-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 14px;
}
.help-table th, .help-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
}
.help-table th { background: #f5f5f5; font-weight: 600; }

@media (max-width: 600px) {
    main { padding: 16px; }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
    .baustellen-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .datum-grid { grid-template-columns: 1fr; }
    .edit-row { flex-wrap: wrap; }
    .modal-add-row { flex-wrap: wrap; }
}
