:root {
    color-scheme: light;
    --bg: #f8fafc;
    --panel: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #dbe3ef;
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --ok: #15803d;
    --warn: #92400e;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    isolation: isolate;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 62px;
    padding: 12px 16px;
    background: #0f172a;
    color: #ffffff;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.18);
}

.app-header div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-header span {
    color: #bae6fd;
    font-size: 12px;
    font-weight: 700;
}

.app-update-notice {
    position: relative;
    z-index: 950;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    width: min(688px, calc(100% - 32px));
    margin: 12px auto 0;
    border: 1px solid #7dd3fc;
    border-radius: 8px;
    background: #f0f9ff;
    padding: 12px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
}

.app-update-notice > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.app-update-notice strong {
    color: #075985;
}

.app-update-notice span {
    color: #475569;
    font-size: 12px;
    line-height: 1.4;
}

.app-update-notice .primary-btn {
    width: auto;
    white-space: nowrap;
}

main {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    margin: 0 auto;
    padding: 16px 16px 96px;
}

.panel {
    position: relative;
    z-index: 1;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

h1 {
    margin: 0 0 8px;
    font-size: 24px;
    line-height: 1.15;
}

p {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.45;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 14px 0;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.login-option {
    flex-direction: row;
    align-items: center;
    gap: 9px;
}

.login-option input {
    width: 19px;
    height: 19px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    padding: 11px 12px;
}

textarea {
    min-height: 84px;
    resize: vertical;
}

button {
    font: inherit;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 850;
}

.primary-btn {
    width: 100%;
    background: var(--primary);
    color: #ffffff;
    padding: 12px 14px;
}

.primary-btn:active {
    background: var(--primary-dark);
}

.secondary-btn {
    background: #e0f2fe;
    color: #075985;
    padding: 10px 12px;
}

.ghost-btn {
    background: #eef2f7;
    color: #334155;
    padding: 10px 12px;
}

.danger-btn {
    width: 100%;
    padding: 12px 14px;
    background: #b91c1c;
    color: #ffffff;
}

.danger-btn:active {
    background: #991b1b;
}

.danger-btn:disabled {
    cursor: wait;
    opacity: 0.65;
}

.icon-btn {
    width: 38px;
    height: 38px;
    background: #38bdf8;
    color: #0f172a;
    font-size: 24px;
    line-height: 1;
}

.hint {
    margin-top: 12px;
    color: #64748b;
    font-size: 12px;
}

.privacy-note {
    margin-top: 14px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.privacy-note summary {
    color: #075985;
    cursor: pointer;
    font-size: 13px;
    font-weight: 850;
}

.privacy-note p {
    margin-top: 8px;
    font-size: 12px;
}

.section-title,
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.section-title h1 {
    margin: 0;
}

.section-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.trip-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trip-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    color: inherit;
    padding: 8px;
    text-align: left;
}

.trip-card-open {
    min-width: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 8px;
    text-align: left;
}

.trip-card-menu {
    white-space: nowrap;
}

.trip-card strong {
    display: block;
    margin-bottom: 5px;
    font-size: 17px;
}

.trip-card span {
    color: var(--muted);
    font-size: 13px;
}

.stop-card {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    padding: 0;
    scroll-margin-top: 250px;
}

.stop-card h2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 6px;
    font-size: 18px;
}

.stop-details > summary {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 72px;
    padding: 12px 42px 12px 12px;
    cursor: pointer;
    list-style: none;
    position: relative;
}

.stop-details > summary::-webkit-details-marker {
    display: none;
}

.stop-details > summary::after {
    content: "+";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 22px;
    font-weight: 500;
}

.stop-details[open] > summary::after {
    content: "−";
}

.stop-number {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
}

.stop-summary-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.stop-summary-copy strong {
    overflow-wrap: anywhere;
    line-height: 1.2;
}

.stop-summary-copy > span {
    color: var(--muted);
    font-size: 12px;
}

.stop-summary-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.stop-status {
    border-radius: 999px;
    padding: 4px 7px;
    background: #e2e8f0;
    color: #334155;
    font-size: 10px;
    font-weight: 900;
}

.stop-status.overnight {
    background: #dcfce7;
    color: #166534;
}

.stop-status.booked {
    background: #dbeafe;
    color: #1d4ed8;
}

.stop-detail-body {
    border-top: 1px solid var(--line);
    padding: 12px;
}

.stop-form-grid > label:last-child {
    margin-bottom: 0;
}

.group-badge {
    flex: 0 0 auto;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 900;
}

.stop-meta {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
}

.stop-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0;
}

.stop-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.stop-card-heading h2 {
    min-width: 0;
    margin: 0;
}

.stop-order-actions,
.sub-place-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.stop-order-actions .ghost-btn {
    width: 42px;
    min-height: 42px;
    padding: 6px;
}

.stop-order-actions .ghost-btn:disabled {
    opacity: 0.35;
}

.action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    text-align: center;
    text-decoration: none;
}

.action-link.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.trip-title {
    margin-bottom: 12px;
}

.map-panel {
    position: sticky;
    top: 62px;
    z-index: 20;
    isolation: isolate;
    margin-bottom: 12px;
    padding: 12px;
    transition: padding 0.18s ease, box-shadow 0.18s ease;
}

.map-panel.compact {
    padding: 4px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.2);
}

.map-panel.compact .map-title,
.map-panel.compact .view-switch,
.map-panel.compact .map-privacy,
.map-panel.compact .hint {
    display: none;
}

.map-panel.compact .mobile-map {
    height: 128px;
    min-height: 128px;
    border-radius: 6px;
}

.map-sticky-sentinel {
    display: block;
    width: 1px;
    height: 1px;
    margin-bottom: -1px;
    pointer-events: none;
}

.place-search-panel,
.trip-tips-panel {
    margin-bottom: 12px;
}

.place-search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.place-search-options {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 10px;
    margin-top: 10px;
}

.place-search-options label {
    margin: 0;
}

.place-search-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.place-search-chips button {
    border: 1px solid #bae6fd;
    border-radius: 999px;
    background: #f0f9ff;
    color: #075985;
    cursor: pointer;
    font-size: 12px;
    font-weight: 850;
    padding: 8px 10px;
}

.place-search-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 8px;
    margin-top: 10px;
}

.place-result {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.poi-media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #dbeafe;
}

.poi-media > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poi-image-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: #dbeafe;
}

.poi-image-placeholder span {
    width: 34%;
    height: 34%;
    border: 4px solid rgba(30, 64, 175, 0.38);
    border-radius: 999px 999px 999px 0;
    transform: rotate(-45deg);
}

.poi-category-badge,
.poi-rating {
    position: absolute;
    top: 8px;
    border-radius: 999px;
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 900;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.16);
}

.poi-category-badge {
    left: 8px;
    max-width: 65%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.94);
    color: #334155;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.poi-rating {
    right: 8px;
    background: #fef3c7;
    color: #92400e;
}

.poi-rating.neutral {
    background: #e0f2fe;
    color: #075985;
}

.poi-attribution {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(15, 23, 42, 0.78);
    color: #ffffff;
    padding: 4px 7px;
    font-size: 9px;
}

.poi-editorial-badge {
    position: absolute;
    left: 8px;
    bottom: 28px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 900;
}

.poi-editorial-badge.insider {
    background: #dcfce7;
    color: #166534;
}

.poi-route-context {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-top: 6px;
    border-left: 3px solid #f97316;
    background: #fff7ed;
    color: #9a3412;
    padding: 5px 7px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
}


.place-result-main {
    min-width: 0;
    flex: 1;
    padding: 12px 12px 4px;
}

.place-result-main strong,
.place-result-main span {
    display: block;
}

.place-result-main strong {
    overflow-wrap: anywhere;
    line-height: 1.22;
}

.place-result-main span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.place-info {
    margin: 8px 0 0;
    color: #334155;
    font-size: 12px;
}

.recommendation {
    margin-top: 5px;
    color: #15803d !important;
}

.place-result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px 12px 12px;
}

.place-result-actions button {
    min-height: 36px;
    padding: 8px 10px;
}

.place-result-actions .recommended {
    background: #dcfce7;
    color: #166534;
}

.map-title {
    margin-bottom: 10px;
}

.map-title span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.view-switch {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f1f5f9;
}

.view-switch button {
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #475569;
    cursor: pointer;
    font-size: 12px;
    font-weight: 850;
    padding: 7px 9px;
}

.view-switch button.active {
    background: #ffffff;
    color: #075985;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.mobile-map {
    position: relative;
    z-index: 0;
    width: 100%;
    height: min(46vh, 390px);
    min-height: 280px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background:
        linear-gradient(90deg, rgba(148, 163, 184, 0.16) 1px, transparent 1px),
        linear-gradient(rgba(148, 163, 184, 0.16) 1px, transparent 1px),
        radial-gradient(circle at 30% 20%, rgba(56, 189, 248, 0.18), transparent 28%),
        radial-gradient(circle at 70% 75%, rgba(249, 115, 22, 0.14), transparent 30%),
        #eef5f8;
    background-size: 42px 42px, 42px 42px, auto, auto, auto;
    transition: height 0.2s ease, min-height 0.2s ease;
}

.mobile-map .leaflet-pane,
.mobile-map .leaflet-top,
.mobile-map .leaflet-bottom {
    z-index: 1;
}

.mobile-map .leaflet-control-zoom a {
    color: #0f172a;
    text-decoration: none;
}

.mobile-map .leaflet-popup-close-button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #0f172a;
    font-size: 24px;
    font-weight: 900;
}

.mobile-map .leaflet-popup-content {
    min-width: 180px;
    margin: 16px 18px 14px;
    padding-top: 8px;
    line-height: 1.45;
}

.map-popup-close {
    display: block;
    width: 100%;
    min-height: 38px;
    margin-top: 10px;
    border: 0;
    border-radius: 6px;
    background: #e2e8f0;
    color: #0f172a;
    cursor: pointer;
    font-size: 12px;
    font-weight: 850;
}

.map-privacy {
    position: absolute;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 720;
    max-height: calc(100% - 20px);
    overflow-y: auto;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    background: rgba(240, 249, 255, 0.97);
    color: #075985;
    padding: 10px;
    font-size: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.map-privacy.status-loading {
    right: 50%;
    bottom: 50%;
    left: auto;
    width: min(260px, calc(100% - 28px));
    transform: translate(50%, 50%);
    text-align: center;
}

.map-privacy.status-warning {
    border-color: #fca5a5;
    background: rgba(254, 242, 242, 0.98);
    color: #991b1b;
}

.map-privacy.status-warning p {
    color: #991b1b;
}

.map-privacy strong {
    display: block;
    margin-bottom: 4px;
}

.map-privacy p {
    margin: 0 0 8px;
    color: #075985;
    font-size: 12px;
}

.map-privacy button {
    width: 100%;
}

.map-marker {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 3px solid #ffffff;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.28);
}

.map-marker.airport {
    background: #7c3aed;
}

.map-marker.hotel-booked {
    background: #16a34a;
}

.map-marker.grouped {
    background: #f59e0b;
}

.map-marker.overnight {
    width: 38px;
    height: 38px;
    border-width: 4px;
    background: #15803d;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2), 0 4px 14px rgba(15, 23, 42, 0.28);
}

.map-marker.focused {
    transform: scale(1.28);
    border-color: #fef08a;
    box-shadow: 0 0 0 5px rgba(250, 204, 21, 0.34), 0 6px 18px rgba(15, 23, 42, 0.34);
}

.sub-map-marker {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 950;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.22);
}

.sub-place-list {
    margin: 10px 0;
    border: 1px solid #fde68a;
    border-radius: 8px;
    background: #fffbeb;
    padding: 9px;
}

.sub-place-title {
    color: #92400e;
    font-size: 13px;
    font-weight: 850;
}

.sub-place-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px 0 0;
    color: #334155;
    font-size: 13px;
}

.sub-place-copy {
    display: grid;
    min-width: 0;
}

.sub-place-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.sub-place-actions .ghost-btn {
    padding: 8px 10px;
}

@media (max-width: 560px) {
    .sub-place-row {
        align-items: flex-start;
        grid-template-columns: 1fr;
    }

    .sub-place-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

.sub-place-row span {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 24px;
    border-radius: 999px;
    background: #f59e0b;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
}

.sub-place-row a {
    color: #075985;
    font-weight: 850;
    text-decoration: none;
}

.stop-document-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 10px 0;
    padding: 9px;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    background: #f0f9ff;
}

.stop-document-list > strong {
    flex: 0 0 100%;
    color: #075985;
    font-size: 12px;
}

.stop-document-list button {
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 7px 9px;
}

.popup-subplaces {
    display: inline-block;
    margin-top: 4px;
    color: #92400e;
    font-weight: 800;
}

.stop-card.highlighted {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.24);
}

.hotel-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    color: #334155;
    font-size: 14px;
    font-weight: 750;
}

.hotel-row input {
    width: 18px;
    height: 18px;
}

.overnight-row {
    padding: 10px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: #f0fdf4;
    color: #166534;
}

.overnight-plan-panel,
.stop-list-panel,
.checklist-panel {
    margin-bottom: 12px;
}

.checklist-progress {
    color: #075985;
    font-size: 12px;
    font-weight: 850;
}

.checklist-groups {
    display: grid;
    gap: 8px;
}

.checklist-group {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.checklist-group > summary {
    cursor: pointer;
    background: #f8fafc;
    padding: 11px 12px;
    font-size: 13px;
    font-weight: 850;
}

.checklist-group > div {
    padding: 4px 12px 8px;
}

.checklist-item {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin: 8px 0;
    font-size: 13px;
}

.checklist-item input {
    width: 18px;
    height: 18px;
}

.checklist-item.done span {
    color: var(--muted);
    text-decoration: line-through;
}

.checklist-add-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 12px;
}

@media (max-width: 560px) {
    .checklist-add-row {
        grid-template-columns: 1fr;
    }
}

.overnight-empty {
    margin: 0;
}

.overnight-plan-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.overnight-plan-item {
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: #f0fdf4;
    padding: 10px;
}

.overnight-plan-item strong,
.overnight-plan-item span {
    display: block;
}

.overnight-plan-item span {
    margin-top: 4px;
    color: #166534;
    font-size: 12px;
    font-weight: 750;
}

.overnight-plan-item p {
    margin: 7px 0 0;
    color: #475569;
    font-size: 12px;
}

.document-panel {
    margin-bottom: 12px;
}

.document-panel .section-title {
    flex-wrap: wrap;
    align-items: flex-start;
}

.document-panel .section-title .secondary-btn {
    width: auto;
    flex: 0 0 auto;
}

.document-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.document-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px;
}

.document-row div {
    min-width: 0;
}

.document-row strong,
.document-row span {
    display: block;
}

.document-row strong {
    overflow-wrap: anywhere;
    line-height: 1.22;
}

.document-row span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.document-row button {
    min-height: 36px;
    padding: 8px 10px;
}

.document-assignment {
    color: #075985 !important;
}

.document-upload-options {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: end;
    margin-bottom: 10px;
}

.document-upload-options label {
    margin: 0;
}

.message {
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    background: #e0f2fe;
    color: #075985;
    font-size: 13px;
    font-weight: 800;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
}

.bottom-navigation {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 4px;
    min-height: 66px;
    padding: 6px 10px max(6px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.bottom-navigation button {
    display: grid;
    justify-items: center;
    gap: 3px;
    width: 31%;
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 11px;
    font-weight: 850;
}

.bottom-navigation button.active {
    background: #e0f2fe;
    color: #075985;
}

.nav-symbol {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 2px solid currentColor;
    border-radius: 6px;
    font-size: 18px;
    line-height: 1;
}

.archive-symbol::before {
    content: "";
    width: 10px;
    height: 7px;
    border: 2px solid currentColor;
    border-top-width: 4px;
}

.profile-symbol {
    border-radius: 999px;
}

.profile-symbol::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 8px 0 3px currentColor;
}

.day-preview {
    margin-bottom: 14px;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    background: #f0f9ff;
    padding: 12px;
}

.day-preview-heading,
.profile-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.day-preview-heading > div,
.profile-status {
    min-width: 0;
}

.day-preview-heading span,
.day-preview-heading strong,
.profile-status strong,
.profile-status span {
    display: block;
}

.day-preview-heading span,
.profile-status span {
    color: #0369a1;
    font-size: 12px;
    font-weight: 800;
}

.day-preview-list {
    display: grid;
    gap: 7px;
    margin-top: 10px;
}

.day-preview-list > div {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 8px;
    font-size: 12px;
}

.day-preview-list span {
    color: #475569;
}

.profile-status {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 14px;
}

.profile-actions {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.profile-change-log {
    margin-top: 22px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.profile-change-log h2 {
    margin: 0 0 10px;
    font-size: 17px;
}

.change-log-item {
    display: grid;
    gap: 3px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.change-log-item strong {
    font-size: 13px;
}

.change-log-item span {
    color: var(--muted);
    font-size: 11px;
}

.app-toast {
    position: fixed;
    right: 16px;
    bottom: calc(62px + env(safe-area-inset-bottom));
    left: 16px;
    z-index: 1200;
    transform: translateY(16px);
    opacity: 0;
    pointer-events: none;
    border-radius: 10px;
    background: #0f172a;
    color: #ffffff;
    padding: 12px 14px;
    text-align: center;
    font-weight: 850;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.28);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-toast.visible {
    transform: translateY(0);
    opacity: 1;
}

.app-toast.error {
    background: #991b1b;
}

.footer-separator {
    color: #94a3b8;
    font-weight: 800;
}

.footer-link {
    border: 0;
    background: transparent;
    color: #075985;
    cursor: pointer;
    font-size: 13px;
    font-weight: 850;
}

.settings-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px;
}

.settings-danger-zone {
    padding: 16px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fff7f7;
}

.settings-danger-zone h2 {
    color: #991b1b;
}

.stop-list-heading-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.city-search-dialog {
    width: min(640px, calc(100% - 24px));
}

.city-search-results {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.city-search-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 11px;
}

.city-search-result > div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.city-search-result strong,
.city-search-result span {
    overflow-wrap: anywhere;
}

.city-search-result span {
    color: var(--muted);
    font-size: 12px;
}

.city-search-result .primary-btn {
    width: auto;
    white-space: nowrap;
}

@media (min-width: 480px) {
    .settings-actions {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .place-search-row,
    .place-search-options {
        grid-template-columns: 1fr;
    }

    .place-search-row button,
    .place-result-actions button {
        width: 100%;
    }

    .document-row {
        grid-template-columns: 1fr 1fr;
    }

    .document-row div {
        grid-column: 1 / -1;
    }

    .document-row button {
        width: 100%;
    }

    .document-upload-options {
        grid-template-columns: 1fr;
    }

    .trip-card {
        grid-template-columns: 1fr;
    }

    .trip-card-menu {
        width: 100%;
    }

    .stop-details > summary {
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .stop-summary-status {
        grid-column: 2;
        justify-content: flex-start;
    }
}

.privacy-dialog {
    position: relative;
    z-index: 1100;
    width: min(560px, calc(100vw - 32px));
    max-height: min(680px, calc(100vh - 48px));
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
    color: var(--text);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.privacy-dialog::backdrop {
    background: rgba(15, 23, 42, 0.36);
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dialog-header h1 {
    margin: 0;
}

.hidden {
    display: none !important;
}

@media (min-width: 680px) {
    main {
        padding: 24px 24px 80px;
    }
}

/* Reisedetail: klar getrennte Bereiche statt einer ueberlagernden Sticky-Karte. */
.trip-detail-navigation {
    position: sticky;
    top: 62px;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 4px;
    margin: 0 0 10px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef2f7;
    padding: 4px;
    scrollbar-width: none;
}

.trip-detail-navigation::-webkit-scrollbar {
    display: none;
}

.trip-detail-navigation button {
    min-height: 42px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #475569;
    cursor: pointer;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.trip-detail-navigation button.active {
    background: #ffffff;
    color: #075985;
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.14);
}

.trip-tab-content {
    display: grid;
    gap: 12px;
}

.route-workspace {
    display: grid;
    gap: 10px;
    min-height: 0;
}

.route-workspace .map-panel {
    position: relative;
    top: auto;
    z-index: 2;
    display: flex;
    height: clamp(300px, 39dvh, 420px);
    flex-direction: column;
    margin: 0;
    overflow: hidden;
    padding: 10px;
}

.route-workspace .mobile-map {
    height: 100%;
    min-height: 180px;
    border-radius: 7px;
}

.route-workspace .map-privacy.status-active {
    display: none;
}

.route-workspace .map-panel > .hint {
    margin: 5px 0 0;
    line-height: 1.25;
}

.route-stop-scroll {
    min-height: 0;
    max-height: none;
    overflow-x: hidden;
    overflow-y: visible;
    padding: 2px 3px 20px;
}

.route-stop-scroll .stop-card {
    scroll-margin-top: 8px;
}

.route-settings-panel {
    margin: 0 0 12px;
    padding: 0;
    overflow: hidden;
}

.route-settings-panel > summary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 14px 46px 14px 16px;
    cursor: pointer;
    list-style: none;
}

.route-settings-panel > summary::-webkit-details-marker {
    display: none;
}

.route-settings-panel > summary::after {
    content: "+";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #475569;
    font-size: 22px;
}

.route-settings-panel[open] > summary::after {
    content: "−";
}

.route-settings-panel summary span {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.route-settings-panel summary strong {
    font-size: 17px;
}

.route-settings-panel summary small {
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.route-settings-body {
    padding: 2px 16px 16px;
    border-top: 1px solid var(--line);
}

.route-settings-group {
    margin: 4px 0 14px;
    padding-top: 4px;
    border-top: 1px solid #eef2f7;
}

.route-settings-group:first-of-type {
    border-top: 0;
}

.toggle-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.toggle-row input {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.inline-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
}

.inline-search-row .secondary-btn {
    white-space: nowrap;
}

.airport-search-result {
    margin: 0 0 10px;
}

.airport-search-result label {
    margin-top: 6px;
}

.route-settings-status {
    min-height: 20px;
    margin: 4px 0 12px;
    color: #475569;
    font-size: 12px;
    font-weight: 750;
}

.route-settings-status.success {
    color: var(--ok);
}

.route-settings-status.error {
    color: #991b1b;
}

.map-fullscreen-btn {
    position: absolute;
    right: 18px;
    top: 96px;
    z-index: 700;
    display: none;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #0f172a;
    color: #ffffff;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.3);
}

.route-workspace.map-fullscreen {
    position: fixed;
    inset: 62px 0 66px;
    z-index: 950;
    min-height: 0;
    background: #ffffff;
    padding: 8px;
}

.route-workspace.map-fullscreen .map-panel {
    width: 100%;
    height: 100%;
    flex-basis: 100%;
    border: 0;
    padding: 0;
}

.map-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 180px;
}

.route-workspace:not(.map-fullscreen) .mobile-map {
    pointer-events: none;
}

.map-preview-launch {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 700;
    min-height: 40px;
    border: 2px solid #ffffff;
    border-radius: 7px;
    background: #0f172a;
    color: #ffffff;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 850;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.3);
}

.route-workspace.map-fullscreen .map-title,
.route-workspace.map-fullscreen .view-switch,
.route-workspace.map-fullscreen .map-panel > .hint,
.route-workspace.map-fullscreen .route-stop-scroll {
    display: none;
}

.route-workspace.map-fullscreen .mobile-map {
    height: 100%;
    min-height: 100%;
    border: 0;
    border-radius: 0;
}

.route-workspace.map-fullscreen .map-stage {
    height: 100%;
    min-height: 100%;
}

.route-workspace.map-fullscreen .map-preview-launch {
    display: none;
}

.route-workspace.map-fullscreen .map-fullscreen-btn {
    display: grid;
    top: 12px;
    right: 12px;
}

.poi-category-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    color: #ffffff;
}

.poi-category-fallback span {
    font-size: 34px;
    font-weight: 900;
}

.poi-category-fallback strong {
    max-width: 80%;
    font-size: 13px;
    text-align: center;
}

.poi-category-fallback.food { background: #9a3412; }
.poi-category-fallback.view { background: #0369a1; }
.poi-category-fallback.culture { background: #6d28d9; }
.poi-category-fallback.nature { background: #15803d; }
.poi-category-fallback.hotel { background: #0f766e; }
.poi-category-fallback.place { background: #475569; }

.place-result-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.place-result-actions .primary-btn,
.place-result-actions .secondary-btn,
.place-result-actions .ghost-btn {
    width: 100%;
    min-width: 0;
    font-size: 11px;
}

.place-result-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.poi-details-dialog {
    overflow-y: auto;
}

.poi-dialog-media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    background: #e2e8f0;
}

.poi-dialog-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poi-dialog-gallery {
    margin-top: 18px;
}

.poi-dialog-gallery h3 {
    margin: 0 0 9px;
    font-size: 16px;
}

.poi-gallery-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(190px, 72%);
    gap: 9px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    padding: 1px 1px 8px;
}

.poi-gallery-image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #e2e8f0;
    color: #ffffff;
    scroll-snap-align: start;
}

.poi-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poi-gallery-image span {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: 44%;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.82);
    padding: 6px 8px;
    font-size: 9px;
    font-weight: 750;
    line-height: 1.25;
}

.poi-gallery-image span strong {
    display: block;
    margin-bottom: 2px;
    color: #bae6fd;
    font-size: 10px;
}

.poi-details-dialog h2 {
    margin: 14px 0 6px;
}

.poi-dialog-attribution {
    font-size: 11px;
}

.checklist-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.checklist-presets button {
    padding: 7px 9px;
    font-size: 11px;
}

.checklist-item {
    grid-template-columns: 20px minmax(0, 1fr) auto auto;
}

.checklist-item button {
    border: 0;
    background: transparent;
    color: #0369a1;
    cursor: pointer;
    padding: 5px;
    font-size: 11px;
    font-weight: 800;
}

.checklist-item button:last-child {
    color: #b91c1c;
}

.travel-preparation-panel,
.travel-notes-panel {
    margin-bottom: 12px;
}

.travel-advice-list {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}

.travel-advice-list > div {
    border-left: 4px solid #38bdf8;
    background: #f0f9ff;
    padding: 9px 10px;
}

.travel-advice-list > div.is-pending {
    border-left-color: #cbd5e1;
    background: #f8fafc;
}

.travel-advice-list > div.is-pending dd {
    color: #64748b;
}

.advice-disclaimer {
    display: grid;
    gap: 4px;
    margin: 10px 0 12px;
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
    color: #78350f;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.4;
}

.travel-advice-load-state {
    margin-bottom: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.travel-advice-empty {
    display: grid;
    gap: 8px;
    margin: 10px 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    padding: 12px;
}

.travel-advice-empty p {
    margin: 0;
    font-size: 12px;
}

.travel-advice-empty a {
    color: #0369a1;
    font-size: 12px;
    font-weight: 850;
}

.pwa-install-help {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 12px;
}

.pwa-install-help summary {
    color: #075985;
    cursor: pointer;
    font-weight: 850;
}

.pwa-install-help ol {
    margin: 12px 0;
    padding-left: 22px;
    color: #334155;
    font-size: 12px;
    line-height: 1.55;
}

.travel-advice-list dt {
    color: #075985;
    font-size: 12px;
    font-weight: 900;
}

.travel-advice-list dd {
    margin: 3px 0 0;
    color: #334155;
    font-size: 13px;
}

@media (max-width: 560px) {
    .app-update-notice {
        grid-template-columns: 1fr 1fr;
    }

    .app-update-notice > div {
        grid-column: 1 / -1;
    }

    .app-update-notice .primary-btn,
    .app-update-notice .ghost-btn {
        width: 100%;
    }

    .city-search-result {
        grid-template-columns: 1fr;
    }

    .city-search-result .primary-btn {
        width: 100%;
    }

    .stop-list-panel > .section-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .stop-list-heading-actions {
        width: 100%;
        justify-content: stretch;
    }

    .stop-list-heading-actions > .secondary-btn,
    .stop-list-heading-actions > .view-switch {
        width: 100%;
    }

    .inline-search-row {
        grid-template-columns: 1fr;
    }

    .inline-search-row .secondary-btn {
        width: 100%;
    }

    .trip-detail-navigation {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        overflow: visible;
    }

    .trip-detail-navigation button {
        padding: 5px 3px;
        font-size: 10px;
        white-space: normal;
    }

    .route-workspace .map-panel {
        height: clamp(290px, 38dvh, 360px);
    }

    .place-result-actions {
        grid-template-columns: 1fr 1fr;
    }

    .place-result-actions .wiki-place-btn {
        grid-column: 1 / -1;
    }

    .checklist-item {
        grid-template-columns: 20px minmax(0, 1fr);
    }

    .checklist-item button {
        grid-column: auto;
    }
}
