:root {
    /* Matches the amber/cream/ink theme in static/css/map.css */
    --amber: #f59e0b;
    --amber-deep: #d97706;
    --amber-soft: #fef3c7;
    --ink: #251a12;
    --ink-soft: #7c6f64;
    --cream: #fdfaf4;
    --line: #ece3d5;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, var(--amber) 0%, var(--amber-deep) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: var(--cream);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(37, 26, 18, 0.2);
    max-width: 800px;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px); /* viewport minus top+bottom body padding */
}

.header {
    background: linear-gradient(135deg, var(--amber) 0%, var(--amber-deep) 100%);
    color: black;
    padding: 40px 20px;
    text-align: center;
    flex-shrink: 0;
    position: relative;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.header h1 .brand-link {
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

/* Plain "back to map" link near the left edge of the header. Hidden in the native
   shell (see bottom-nav.css) where the bottom tab bar handles navigation. */
.back-to-map {
    position: absolute;
    top: 50%;
    left: 24px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.back-to-map:hover {
    text-decoration: underline;
}

.header-icon {
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}

.section h2 {
    color: var(--amber-deep);
    margin-bottom: 15px;
    font-size: 1.5em;
    border-bottom: 2px solid var(--amber-deep);
    padding-bottom: 10px;
}

.section p {
    color: var(--ink-soft);
    line-height: 1.8;
    margin-bottom: 10px;
}

.button {
    display: inline-block;
    background: linear-gradient(135deg, var(--amber) 0%, var(--amber-deep) 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1em;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(217, 119, 6, 0.4);
}

.footer-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border-top: 1px solid var(--line);
    background: var(--amber-soft);
    flex-shrink: 0;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-nav a {
    text-decoration: none;
    color: var(--amber-deep);
    font-weight: 600;
    transition: color 0.3s;
}

.footer-nav a:hover {
    color: var(--ink);
}

.footer-meta {
    color: #999;
    font-size: 0.7em;
}

/* ================= Flat list rows (Settings / Profile pages) ================= */
.settings-list {
    list-style: none;
    margin: 10px 0 30px;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 4px;
    text-decoration: none;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    font-size: 1.05em;
}

.settings-row:hover {
    background: var(--amber-soft);
}

.settings-row.disabled {
    color: var(--ink-soft);
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
}

.settings-row .settings-row-hint {
    margin-left: auto;
    font-size: 0.8em;
    color: var(--ink-soft);
}

.settings-row svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--ink-soft);
}

.settings-meta {
    color: var(--ink-soft);
    font-size: 0.85em;
    line-height: 1.6;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 4px;
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fcd34d;
    flex-shrink: 0;
}

.profile-username {
    font-weight: 700;
    font-size: 1.2em;
    margin-bottom: 4px;
}

.profile-guest {
    color: var(--ink-soft);
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    body {
        padding: 0;
        align-items: flex-start;
    }

    .container {
        border-radius: 0;
        box-shadow: none;
        height: 100dvh;
        /* Keep content clear of notches / rounded corners in landscape */
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
    }

    .content {
        padding: 20px 16px;
    }

    .header {
        padding: 12px;
        /* Keep the title clear of the notch / status bar (viewport-fit=cover) */
        padding-top: calc(12px + env(safe-area-inset-top, 0px));
    }

    .header h1 {
        font-size: 1.8em;
        margin-bottom: 4px;
    }

    .header p {
        font-size: 0.95em;
    }

    .footer-nav {
        padding: 12px;
        /* Keep links clear of the home indicator / gesture bar */
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
}
