* {
    box-sizing: border-box;
}

html {
    background: #111;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;

    background:
        linear-gradient(
            180deg,
            #161616 0%,
            #0d0d0d 100%
        );

    color: #fff;
}

button,
input {
    font-family: inherit;
}

.app {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;

    padding:
        max(24px, env(safe-area-inset-top))
        16px
        max(40px, env(safe-area-inset-bottom));
}

.hero {
    text-align: center;
    padding: 15px 0 24px;
}

.truck-icon {
    font-size: 54px;
    margin-bottom: 8px;
}

h1 {
    margin: 0;
    font-size: clamp(29px, 7vw, 42px);
    line-height: 1.05;
    letter-spacing: -1px;
}

.subtitle {
    margin: 12px auto 0;
    max-width: 480px;
    color: #aaa;
    font-size: 16px;
    line-height: 1.4;
}

.action-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.main-button {
    width: 100%;
    padding: 19px 18px;

    border: 1px solid #333;
    border-radius: 14px;

    background: #242424;
    color: #fff;

    font-size: 18px;
    font-weight: 800;

    cursor: pointer;
}

.main-button:active {
    transform: scale(0.985);
}

.main-button.accent {
    background: #fff;
    color: #111;
    border-color: #fff;
}

.main-button.secondary {
    background: #1b1b1b;
    color: #bbb;
}

.inline-panel {
    margin-top: -3px;
    margin-bottom: 2px;
}

.status-card {
    padding: 14px;

    border: 1px solid #333;
    border-radius: 12px;

    background: #1a1a1a;

    text-align: center;

    font-size: 14px;
    color: #ccc;
    line-height: 1.45;
}

.status-card strong {
    color: #fff;
}

.manual-panel,
.adventure-panel,
.parking-panel {
    padding: 18px;

    border: 1px solid #3b3b3b;
    border-radius: 14px;

    background: #191919;
}

.manual-panel h2,
.parking-panel h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.manual-help {
    margin: 0 0 14px;
    color: #999;
    font-size: 14px;
}

.autocomplete-wrap {
    position: relative;
}

.manual-panel input {
    width: 100%;

    padding: 17px 15px;

    border: 1px solid #444;
    border-radius: 12px;

    background: #0f0f0f;
    color: #fff;

    font-size: 17px;
    outline: none;
}

.manual-panel input:focus {
    border-color: #fff;
}

.manual-panel input::placeholder {
    color: #666;
}

.autocomplete-results {
    width: 100%;

    margin-top: 6px;

    border: 1px solid #3c3c3c;
    border-radius: 12px;

    background: #111;

    overflow: hidden;
}

.autocomplete-item {
    width: 100%;

    padding: 14px 13px;

    border: 0;
    border-bottom: 1px solid #292929;

    background: #151515;
    color: #fff;

    text-align: left;

    font-size: 15px;
    line-height: 1.35;

    cursor: pointer;
}

.autocomplete-item:last-child {
    border-bottom: 0;
}

.autocomplete-item:active {
    background: #282828;
}

.small-cancel-button {
    width: 100%;

    margin-top: 10px;
    padding: 11px;

    border: none;

    background: transparent;
    color: #888;

    font-size: 13px;
    font-weight: 800;

    cursor: pointer;
}

.question-block {
    margin-top: 26px;
}

.question-block:first-child {
    margin-top: 0;
}

.question-block h2 {
    margin: 0 0 13px;
    font-size: 18px;
}

.choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.choices button {
    min-height: 60px;

    padding: 15px 10px;

    border: 1px solid #343434;
    border-radius: 12px;

    background: #222;
    color: #fff;

    font-size: 15px;
    font-weight: 750;

    cursor: pointer;
}

.choices button.selected {
    background: #fff;
    color: #111;
    border-color: #fff;
}

.generate-button {
    margin-top: 28px;
}

.parking-item {
    padding: 13px 0;
    border-bottom: 1px solid #303030;
}

.parking-item:last-child {
    border-bottom: 0;
}

.parking-name {
    font-size: 16px;
    font-weight: 800;
}

.parking-address {
    margin-top: 4px;
    color: #aaa;
    font-size: 13px;
    line-height: 1.35;
}

.parking-distance {
    margin-top: 5px;
    color: #ddd;
    font-size: 13px;
}

.parking-warning {
    margin: 14px 0 0;
    padding-top: 12px;

    border-top: 1px solid #303030;

    color: #888;
    font-size: 12px;
    line-height: 1.4;
}

.result-card {
    margin-top: 24px;

    padding: 18px;

    border: 1px solid #333;
    border-radius: 16px;

    background: #191919;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;

    margin-bottom: 14px;
}

.result-header h2 {
    margin: 0;
    font-size: 20px;
}

.small-button {
    padding: 9px 12px;

    border: 1px solid #444;
    border-radius: 9px;

    background: #272727;
    color: #fff;

    font-size: 12px;
    font-weight: 800;

    cursor: pointer;
}

/* MARKDOWN / AI RESULT */

#resultText {
    white-space: normal;
    word-wrap: break-word;

    font-family: inherit;
    font-size: 16px;
    line-height: 1.55;

    color: #f3f3f3;
}

#resultText p {
    margin: 0 0 12px;
}

#resultText p:last-child {
    margin-bottom: 0;
}

#resultText strong {
    color: #fff;
}

#resultText a {
    color: #7db7ff;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    font-weight: 750;
}

#resultText a:active {
    opacity: 0.65;
}

#resultText ul,
#resultText ol {
    margin: 8px 0 14px;
    padding-left: 22px;
}

#resultText li {
    margin: 4px 0;
}

#resultText h1,
#resultText h2,
#resultText h3,
#resultText h4 {
    color: #fff;
    line-height: 1.25;
}

#resultText h1 {
    font-size: 22px;
}

#resultText h2 {
    font-size: 20px;
}

#resultText h3 {
    font-size: 18px;
}

/* LOADING */

.loading-overlay {
    position: fixed;
    inset: 0;

    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 22px;

    background: rgba(0, 0, 0, 0.93);

    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.loading-card {
    width: 100%;
    max-width: 430px;

    padding: 34px 24px;

    border: 1px solid #3a3a3a;
    border-radius: 20px;

    background: #191919;

    text-align: center;

    box-shadow:
        0 22px 70px rgba(0, 0, 0, 0.7);
}

.spinner {
    width: 62px;
    height: 62px;

    margin: 0 auto 22px;

    border: 7px solid rgba(255, 255, 255, 0.16);
    border-top-color: #fff;
    border-radius: 50%;

    animation: spin 0.85s linear infinite;
}

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

.loading-card h2 {
    margin: 0 0 12px;
    font-size: 23px;
}

#loadingMessage {
    min-height: 48px;
    color: #ddd;
    font-size: 16px;
}

.fake-progress {
    width: 100%;
    height: 9px;

    margin: 24px 0 17px;

    overflow: hidden;

    border-radius: 999px;

    background: #333;
}

.progress-bar {
    width: 10%;
    height: 100%;

    border-radius: 999px;

    background: #fff;

    transition: width 0.7s ease;
}

.loading-warning {
    color: #888;
    font-size: 13px;
}

button:disabled,
input:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.hidden {
    display: none !important;
}

@media (max-width: 360px) {

    .choices {
        grid-template-columns: 1fr;
    }
}