* {
    font-family: Arial, sans-serif;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: inherit;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    text-align: center;
    padding: clamp(14px, 4vw, 20px);
    padding-bottom: 180px;
    font-size: 20px;
    line-height: 1.4;

    overflow-y: auto;
    overflow-x: hidden;

    min-height: 100vh;

    -webkit-overflow-scrolling: touch;
}

input,
select,
textarea {
    padding: 10px;
    width: 90%;
    max-width: 420px;
    margin-top: 10px;
    font-size: 16px;
    line-height: 1.3;
}


button,
.photo-picker-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: auto;
    max-width: 100%;
    gap: 6px;
    min-height: 44px;
    padding: 12px 16px;
    margin: 8px 4px 0;

    background: rgba(96, 165, 250, 0.75);
    backdrop-filter: blur(4px);

    color: white;
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.25;

    border: 1px solid rgba(255, 255, 255, 0.25);

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);

    cursor: pointer;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    vertical-align: top;
    appearance: none;
    -webkit-appearance: none;
}

.photo-picker-button {
    user-select: none;
    -webkit-user-select: none;
}

#result {
    margin: 18px auto 0;
    background: white;
    padding: 16px;
    border-radius: 10px;
    max-width: 760px;

    max-height: none;
    overflow-y: auto;
    padding-bottom: 112px;
}

.card {
    background: #ffffff;
    margin: 12px auto;
    padding: 14px;
    border-radius: 10px;
    width: 100%;
    max-width: 760px;
    text-align: left;
}

.journey-active-card,
.journey-saved-detail {
    text-align: left;
}

.journey-card-header {
    margin-bottom: 12px;
}

.journey-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 10px 0 12px;
}

.journey-summary-grid div,
.journey-panel,
.journey-compact-section {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.journey-summary-grid div {
    padding: 10px;
}

.journey-summary-grid span,
.journey-info-row span {
    display: block;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.25;
}

.journey-summary-grid strong,
.journey-info-row strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-size: 15px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.journey-primary-actions,
.journey-secondary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.journey-primary-actions button,
.journey-secondary-actions button {
    margin: 0;
}

.journey-panel {
    padding: 12px;
    margin: 12px 0;
}

.journey-panel h3 {
    margin: 0 0 10px;
    font-size: 17px;
    line-height: 1.25;
}

.journey-info-row + .journey-info-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.journey-compact-section {
    margin: 10px 0;
    overflow: hidden;
}

.journey-compact-section summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 0 12px;
    cursor: pointer;
    font-size: 16px;
    list-style: none;
}

.journey-compact-section summary::-webkit-details-marker {
    display: none;
}

.journey-compact-section summary::before {
    content: "▶";
    margin-right: 8px;
    color: #2563eb;
    font-size: 12px;
}

.journey-compact-section[open] summary::before {
    content: "▼";
}

.journey-compact-section summary span:first-child {
    flex: 1;
}

.journey-compact-section summary span:last-child {
    min-width: 28px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 13px;
    text-align: center;
}

.journey-compact-section ol {
    margin: 0;
    padding: 0 12px 12px;
    list-style: none;
}

.journey-compact-section li {
    display: flex;
    gap: 8px;
    padding: 10px 0;
    border-top: 1px solid #e5e7eb;
    font-size: 15px;
    line-height: 1.3;
}

.saved-journey-item {
    margin: 10px 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    overflow: hidden;
}

.saved-journey-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 54px;
    padding: 12px;
    cursor: pointer;
    list-style: none;
}

.saved-journey-summary-row::-webkit-details-marker {
    display: none;
}

.saved-journey-summary-row:hover,
.saved-journey-summary-row:focus-visible {
    background: #eff6ff;
}

.saved-journey-summary-row:active {
    background: #dbeafe;
}

.saved-journey-summary-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.saved-journey-summary-title {
    color: #111827;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
}

.saved-journey-summary-date {
    color: #374151;
    font-size: 14px;
    line-height: 1.25;
}

.saved-journey-summary-hint {
    color: #4b5563;
    font-size: 13px;
    line-height: 1.25;
}

.saved-journey-hint-expanded {
    display: none;
}

.saved-journey-item[open] .saved-journey-hint-collapsed {
    display: none;
}

.saved-journey-item[open] .saved-journey-hint-expanded {
    display: inline;
}

.saved-journey-chevron {
    min-width: 28px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 13px;
    text-align: center;
}

.saved-journey-chevron::before {
    content: "\25BC";
}

.saved-journey-item[open] .saved-journey-chevron::before {
    content: "\25B2";
}

.saved-journey-preview,
.saved-journey-detail-slot,
.saved-journey-controls {
    padding: 0 12px 12px;
}

.saved-journey-trip-title {
    margin-bottom: 10px;
    color: #111827;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.journey-photo-thumb {
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    border-radius: 8px;
    object-fit: cover;
}

.journey-section-highlight {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.08);
    transition: outline-color 0.3s ease, box-shadow 0.3s ease;
}

@media (max-width: 520px) {
    body {
        padding: 12px;
        padding-bottom: 150px;
    }

    #result {
        padding: 14px;
        padding-bottom: 96px;
    }

    .card {
        padding: 12px;
    }

    .journey-summary-grid {
        grid-template-columns: 1fr;
    }

    .journey-primary-actions,
    .journey-secondary-actions {
        flex-direction: column;
    }

    .journey-primary-actions button,
    .journey-secondary-actions button {
        width: 100%;
    }
}

.project-credit {
    font-size: 10px;
    color: #aaa;
    opacity: 0.75;
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
    font-weight: normal;
}
