:root {
    --page-bg: #f5efe7;
    --page-bg-alt: #efe6d7;
    --surface: rgba(255, 252, 247, 0.82);
    --surface-strong: rgba(255, 249, 242, 0.96);
    --surface-muted: rgba(255, 244, 233, 0.75);
    --surface-border: rgba(121, 76, 31, 0.12);
    --text-primary: #221a14;
    --text-secondary: #6b5b4f;
    --text-faint: #9f8e82;
    --accent: #ea6c2f;
    --accent-strong: #c44d17;
    --accent-soft: rgba(234, 108, 47, 0.14);
    --accent-cool: #176b73;
    --accent-cool-soft: rgba(23, 107, 115, 0.14);
    --success: #1f7a4d;
    --success-soft: rgba(31, 122, 77, 0.14);
    --warning: #ad5d14;
    --warning-soft: rgba(173, 93, 20, 0.15);
    --danger: #be3d33;
    --danger-soft: rgba(190, 61, 51, 0.16);
    --shadow-lg: 0 24px 80px rgba(65, 36, 11, 0.16);
    --shadow-md: 0 16px 32px rgba(65, 36, 11, 0.12);
    --shadow-sm: 0 8px 18px rgba(65, 36, 11, 0.1);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --border-hairline: 1px solid var(--surface-border);
}

body.dark-mode {
    --page-bg: #141b20;
    --page-bg-alt: #0e1317;
    --surface: rgba(21, 30, 35, 0.82);
    --surface-strong: rgba(20, 29, 34, 0.96);
    --surface-muted: rgba(28, 39, 45, 0.88);
    --surface-border: rgba(255, 255, 255, 0.09);
    --text-primary: #f2ede7;
    --text-secondary: #b9afa4;
    --text-faint: #8f8a82;
    --accent: #ff8f4a;
    --accent-strong: #ff7330;
    --accent-soft: rgba(255, 143, 74, 0.18);
    --accent-cool: #5eb8c5;
    --accent-cool-soft: rgba(94, 184, 197, 0.18);
    --success: #55c38d;
    --success-soft: rgba(85, 195, 141, 0.18);
    --warning: #f6b15f;
    --warning-soft: rgba(246, 177, 95, 0.18);
    --danger: #ff7b6d;
    --danger-soft: rgba(255, 123, 109, 0.18);
    --shadow-lg: 0 30px 100px rgba(0, 0, 0, 0.34);
    --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.24);
    --shadow-sm: 0 10px 22px rgba(0, 0, 0, 0.18);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--text-primary);
    background:
        radial-gradient(circle at top left, rgba(255, 180, 133, 0.35), transparent 28%),
        radial-gradient(circle at bottom right, rgba(43, 130, 136, 0.18), transparent 28%),
        linear-gradient(180deg, var(--page-bg) 0%, var(--page-bg-alt) 100%);
    transition: background 220ms ease, color 220ms ease;
}

img {
    display: block;
    max-width: 100%;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        background-color 180ms ease,
        color 180ms ease,
        border-color 180ms ease,
        opacity 180ms ease;
}

button:hover {
    transform: translateY(-1px);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
    box-shadow: none;
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
}

body.reduce-motion button:hover,
body.reduce-motion .history-card:hover,
body.reduce-motion .history-item.is-selected .history-card {
    transform: none;
}

input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
}

input::placeholder {
    color: var(--text-faint);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0 1000px transparent inset;
    transition: background-color 9999s ease-in-out 0s;
}

a {
    color: var(--accent-strong);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    line-height: 1.05;
}

p {
    margin: 0;
}

[hidden] {
    display: none !important;
}

.ambient-orb {
    position: fixed;
    z-index: 0;
    border-radius: 999px;
    filter: blur(16px);
    pointer-events: none;
    opacity: 0.7;
}

.ambient-orb--warm {
    top: 72px;
    right: 72px;
    width: 260px;
    height: 260px;
    background: rgba(243, 133, 73, 0.22);
}

.ambient-orb--cool {
    bottom: 48px;
    left: 24px;
    width: 320px;
    height: 320px;
    background: rgba(54, 135, 140, 0.16);
}

.app-shell {
    position: relative;
    z-index: 1;
    width: min(1560px, calc(100% - 32px));
    margin: 16px auto 28px;
}

.surface-card {
    border: var(--border-hairline);
    background: var(--surface);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-md);
}

.section-kicker {
    margin-bottom: 10px;
    color: var(--accent-strong);
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 22px;
    border-radius: var(--radius-xl);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    padding: 8px;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(234, 108, 47, 0.18), rgba(23, 107, 115, 0.14));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-copy h1 {
    font-size: clamp(1.8rem, 4vw, 2.7rem);
    letter-spacing: -0.05em;
}

.brand-subtitle {
    margin-top: 10px;
    max-width: 36ch;
    color: var(--text-secondary);
    font-size: 0.98rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(280px, 0.72fr);
    gap: 18px;
    margin-top: 18px;
    align-items: start;
}

.map-stage {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    padding: 18px;
}

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

.map-stage__topbar h2 {
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    letter-spacing: -0.05em;
}

.map-stage__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.status-pill,
.connection-pill,
.micro-stat,
.insight-chip,
.segmented-control,
.input-shell,
.tracking-card,
.tips-panel,
.stat-card,
.history-card,
.status-banner,
.cookie-popup,
.auth-feedback,
.auth-static-message,
.detail-panel {
    border: var(--border-hairline);
}

.status-pill,
.connection-pill,
.micro-stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.status-pill {
    color: var(--accent-strong);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.46), var(--surface-strong));
}

.connection-pill {
    color: var(--warning);
}

.connection-pill.connection-pill--active {
    color: var(--success);
}

.segmented-control {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
    background: var(--surface-strong);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}

.map-type-button {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 700;
}

.map-type-button.is-active {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff7f1;
    box-shadow: 0 10px 18px rgba(196, 77, 23, 0.2);
}

.map-frame {
    position: relative;
    overflow: hidden;
    min-height: clamp(560px, 76vh, 920px);
    border-radius: 26px;
    background: rgba(18, 23, 29, 0.08);
}

#map {
    width: 100%;
    height: 100%;
    min-height: inherit;
}

.floating-rail {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 700;
}

.status-banner {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 700;
    max-width: min(420px, calc(100% - 36px));
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(255, 249, 242, 0.88);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-md);
}

body.dark-mode .status-banner {
    background: rgba(15, 22, 27, 0.9);
}

.status-banner[data-tone="success"] {
    border-color: rgba(31, 122, 77, 0.34);
    background: linear-gradient(180deg, rgba(31, 122, 77, 0.15), var(--surface-strong));
}

.status-banner[data-tone="warning"] {
    border-color: rgba(173, 93, 20, 0.3);
    background: linear-gradient(180deg, rgba(173, 93, 20, 0.15), var(--surface-strong));
}

.status-banner[data-tone="danger"] {
    border-color: rgba(190, 61, 51, 0.3);
    background: linear-gradient(180deg, rgba(190, 61, 51, 0.14), var(--surface-strong));
}

.status-banner__title {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
}

.status-banner__body {
    margin-top: 6px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.control-column {
    display: grid;
    gap: 14px;
}

.composer-panel {
    border-radius: var(--radius-xl);
    padding: 20px;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-heading h3 {
    font-size: 1.35rem;
    letter-spacing: -0.04em;
}

.detail-panel {
    border-radius: var(--radius-xl);
    background: var(--surface);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-md);
}

.detail-panel__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
}

.detail-panel__summary::-webkit-details-marker {
    display: none;
}

.detail-panel__summary::after {
    content: "+";
    flex: none;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 800;
}

.detail-panel[open] .detail-panel__summary::after {
    content: "−";
}

.detail-panel__body {
    padding: 0 20px 20px;
}

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

.stat-card {
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), var(--surface-strong));
    box-shadow: var(--shadow-sm);
}

body.dark-mode .stat-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), var(--surface-strong));
}

.stat-card__label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
}

.stat-card__value {
    display: block;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.35rem;
    letter-spacing: -0.05em;
}

.insight-strip {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.insight-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--surface-muted);
}

.insight-chip__label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
}

.insight-chip__value {
    font-size: 0.92rem;
    text-align: right;
}

.field-label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 700;
}

.input-shell {
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 0 16px;
    border-radius: 18px;
    background: var(--surface-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.input-shell:focus-within {
    border-color: rgba(234, 108, 47, 0.3);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 0 0 3px rgba(234, 108, 47, 0.12);
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.tracking-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    padding: 14px;
    border-radius: 18px;
    background: var(--surface-muted);
}

.tracking-card--compact p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
}

.tips-panel {
    margin-top: 16px;
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--surface-muted);
    color: var(--text-secondary);
    line-height: 1.55;
}

.tips-panel__title {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.98rem;
    font-weight: 700;
}

.history-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 460px;
    overflow: auto;
}

.history-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), var(--surface-strong));
    box-shadow: var(--shadow-sm);
    transition:
        border-color 180ms ease,
        transform 180ms ease,
        box-shadow 180ms ease;
}

.history-item.is-selected .history-card,
.history-card:hover {
    transform: translateY(-1px);
    border-color: rgba(234, 108, 47, 0.34);
    box-shadow: var(--shadow-md);
}

.history-artwork {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    object-fit: cover;
    background: #d9cec3;
}

.history-artwork--fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, var(--accent-soft), var(--accent-cool-soft));
    color: var(--text-primary);
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.history-card__body {
    min-width: 0;
}

.history-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.history-card__title {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
    font-weight: 700;
}

.history-card__subtitle {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.history-card__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.history-metric {
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.history-card__actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
}

.history-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 800;
}

.history-action--danger {
    color: var(--danger);
}

.empty-state {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 220px;
    padding: 32px 20px;
    border: 1px dashed rgba(121, 76, 31, 0.25);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent);
    color: var(--text-secondary);
    text-align: center;
}

.empty-state strong {
    color: var(--text-primary);
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.08rem;
}

.primary-button,
.secondary-button,
.tracking-button,
.ghost-danger-button,
.icon-button,
.map-options-menu > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 16px;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.primary-button {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff7f1;
    box-shadow: 0 14px 22px rgba(196, 77, 23, 0.24);
}

.secondary-button,
.icon-button,
.history-action {
    background: var(--surface-strong);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.tracking-button {
    background: linear-gradient(135deg, var(--accent-cool), #1e8c97);
    color: #effefe;
    box-shadow: 0 14px 22px rgba(23, 107, 115, 0.22);
}

.tracking-button.is-active {
    background: linear-gradient(135deg, #0c5057, #176b73);
}

.ghost-danger-button {
    background: var(--danger-soft);
    color: var(--danger);
}

.icon-button {
    min-width: 48px;
}

.icon-button__glyph {
    font-size: 1.1rem;
}

.icon-button__glyph--undo {
    color: var(--accent-strong);
    font-size: 1.5rem;
    line-height: 1;
}

.icon-button--stacked {
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 16px;
}

.icon-button__label {
    font-size: 0.8rem;
}

.floating-rail .icon-button--stacked {
    border: var(--border-hairline);
    background: rgba(255, 249, 242, 0.94);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.floating-rail .icon-button--stacked:disabled {
    opacity: 0.88;
    background: rgba(255, 249, 242, 0.9);
}

body.dark-mode .floating-rail .icon-button--stacked {
    background: rgba(20, 29, 34, 0.92);
}

.icon-button--stacked .icon-button__label {
    display: none;
}

.map-options-menu {
    position: relative;
}

.map-options-menu > summary {
    list-style: none;
}

.map-options-menu > summary::-webkit-details-marker {
    display: none;
}

.map-options-menu__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 750;
    display: grid;
    gap: 12px;
    min-width: min(360px, calc(100vw - 48px));
    padding: 16px;
    border: var(--border-hairline);
    border-radius: 22px;
    background: var(--surface-strong);
    box-shadow: var(--shadow-lg);
}

.map-options-menu:not([open]) .map-options-menu__panel {
    display: none;
}

.map-options-menu__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(8, 11, 13, 0.42);
    backdrop-filter: blur(6px);
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1000;
    display: none;
    width: min(520px, calc(100% - 32px));
    padding: 28px;
    border-radius: 28px;
    transform: translate(-50%, -50%);
    background: var(--surface-strong);
    box-shadow: var(--shadow-lg);
}

.settings-wrapper {
    flex-direction: column;
    gap: 18px;
    width: min(760px, calc(100% - 32px));
    max-height: min(760px, calc(100vh - 32px));
    overflow: hidden;
}

.settings-hero {
    padding-right: 48px;
}

.settings-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.settings-stat,
.settings-section {
    border: var(--border-hairline);
    background: var(--surface-muted);
}

.settings-stat {
    display: grid;
    gap: 8px;
    min-height: 86px;
    padding: 14px;
    border-radius: 18px;
}

.settings-stat span {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.settings-stat strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.24rem;
    letter-spacing: -0.03em;
}

.settings-scroll {
    display: grid;
    gap: 12px;
    overflow: auto;
    padding-right: 4px;
}

.settings-section {
    display: grid;
    gap: 16px;
    padding: 18px;
    border-radius: 22px;
}

.settings-section__heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.settings-section__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: var(--surface-strong);
    color: var(--accent-strong);
    font-size: 1.05rem;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

.settings-section h3 {
    font-size: 1.12rem;
    letter-spacing: -0.03em;
}

.settings-section__heading p,
.settings-switch small {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.45;
}

.settings-control {
    display: grid;
    gap: 8px;
}

.settings-segmented {
    width: 100%;
}

.settings-segmented button {
    flex: 1 1 0;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 800;
}

.settings-segmented button.is-active {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff7f1;
    box-shadow: 0 10px 18px rgba(196, 77, 23, 0.2);
}

.settings-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: var(--border-hairline);
    border-radius: 18px;
    background: var(--surface-strong);
}

.settings-switch strong {
    display: block;
    font-size: 0.94rem;
}

.settings-switch input {
    flex: none;
    width: 48px;
    height: 28px;
    border-radius: 999px;
    appearance: none;
    background: var(--surface-muted);
    border: var(--border-hairline);
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease;
}

.settings-switch input::before {
    content: "";
    display: block;
    width: 22px;
    height: 22px;
    margin: 2px;
    border-radius: 999px;
    background: var(--text-faint);
    transition: transform 180ms ease, background-color 180ms ease;
}

.settings-switch input:checked {
    border-color: rgba(31, 122, 77, 0.24);
    background: var(--success-soft);
}

.settings-switch input:checked::before {
    transform: translateX(20px);
    background: var(--success);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text-primary);
    font-size: 1.5rem;
}

.modal-copy {
    margin-top: 12px;
    color: var(--text-secondary);
    line-height: 1.55;
}

.settings-actions {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.settings-actions--split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
}

.settings-actions--split button {
    min-width: 0;
    width: 100%;
}

.auth-modal {
    display: none;
    flex-direction: column;
    gap: 14px;
}

.auth-actions,
.auth-form {
    display: grid;
    gap: 10px;
}

.auth-form label {
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 700;
}

.auth-toggle {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.45;
}

.auth-feedback,
.auth-static-message {
    padding: 14px 16px;
    border-radius: 18px;
    line-height: 1.5;
}

.auth-feedback {
    background: var(--danger-soft);
    color: var(--danger);
}

.auth-static-message {
    background: var(--warning-soft);
    color: var(--warning);
}

.auth-modal.auth-modal--local-only .auth-actions,
.auth-modal.auth-modal--local-only .auth-form,
.auth-modal.auth-modal--local-only .auth-toggle {
    display: none;
}

.cookie-popup {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1100;
    display: none;
    width: min(380px, calc(100% - 36px));
    padding: 18px;
    border-radius: 22px;
    background: rgba(21, 29, 34, 0.96);
    box-shadow: var(--shadow-lg);
    color: #efe7df;
}

.cookie-popup p {
    line-height: 1.55;
}

.cookie-popup a {
    color: #ffd2bc;
}

.cookie-popup button {
    margin-top: 14px;
    width: 100%;
}

.leaflet-container {
    background: #d9e5ed;
    border-radius: inherit;
    font-family: "Manrope", sans-serif;
}

.leaflet-top.leaflet-right {
    margin-top: 18px;
    margin-right: 18px;
}

.leaflet-control-zoom {
    border: 0 !important;
    box-shadow: none !important;
}

.leaflet-control-zoom a {
    display: grid !important;
    place-items: center;
    width: 38px !important;
    height: 38px !important;
    border: var(--border-hairline) !important;
    border-radius: 14px !important;
    background: rgba(255, 249, 242, 0.92) !important;
    color: var(--text-primary) !important;
    font-size: 24px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-align: center !important;
    text-indent: 0 !important;
    box-shadow: var(--shadow-sm);
}

.leaflet-control-zoom a + a {
    margin-top: 8px;
}

.leaflet-control-zoom a:hover {
    background: var(--surface-strong) !important;
}

body.dark-mode .leaflet-control-zoom a {
    background: rgba(20, 29, 34, 0.92) !important;
    color: var(--text-primary) !important;
}

.leaflet-tooltip {
    border: 0;
    border-radius: 16px;
    padding: 10px 12px;
    background: rgba(20, 29, 34, 0.9);
    box-shadow: var(--shadow-md);
    color: #fff8f3;
}

.leaflet-tooltip img {
    border-radius: 12px;
}

.privacy-container {
    width: min(860px, calc(100% - 32px));
    margin: 36px auto;
    padding: 32px;
    border: var(--border-hairline);
    border-radius: var(--radius-xl);
    background: var(--surface-strong);
    box-shadow: var(--shadow-lg);
}

.privacy-container h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -0.05em;
}

.privacy-container h2 {
    margin-top: 28px;
    margin-bottom: 12px;
    font-size: 1.35rem;
    letter-spacing: -0.04em;
}

.privacy-container h3 {
    margin-top: 18px;
    margin-bottom: 8px;
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.privacy-container p,
.privacy-container li {
    color: var(--text-secondary);
    line-height: 1.65;
}

.privacy-container ul {
    padding-left: 20px;
}

@media (max-width: 1180px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .map-stage__topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 820px) {
    .app-shell {
        width: min(100%, calc(100% - 20px));
        margin-top: 10px;
        margin-bottom: 20px;
    }

    .app-header,
    .map-stage,
    .composer-panel,
    .detail-panel,
    .privacy-container {
        padding: 18px;
        border-radius: 24px;
    }

    .app-header,
    .panel-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .brand-block {
        align-items: flex-start;
    }

    .brand-mark {
        width: 64px;
        height: 64px;
        border-radius: 20px;
    }

    .header-actions,
    .map-stage__actions {
        width: 100%;
    }

    .header-actions {
        justify-content: space-between;
    }

    .map-stage__actions {
        flex-wrap: wrap;
    }

    .map-options-menu {
        width: 100%;
    }

    .map-options-menu > summary,
    .segmented-control {
        width: 100%;
    }

    .action-grid,
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .map-frame {
        min-height: 500px;
    }

    .status-banner {
        left: 12px;
        bottom: 12px;
        max-width: calc(100% - 24px);
        padding: 14px 16px;
    }

    .detail-panel {
        padding: 0;
    }

    .detail-panel__summary {
        padding: 16px 18px;
    }

    .detail-panel__body {
        padding: 0 18px 18px;
    }

    .settings-wrapper {
        width: min(100%, calc(100% - 20px));
        max-height: calc(100vh - 20px);
        padding: 22px 18px;
    }

    .settings-summary-grid,
    .settings-actions--split {
        grid-template-columns: 1fr;
    }

    .settings-section {
        padding: 16px;
        border-radius: 20px;
    }

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

    .history-artwork {
        width: 100%;
        height: 160px;
    }

    .history-card__actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 560px) {
    body {
        background:
            radial-gradient(circle at top left, rgba(255, 180, 133, 0.32), transparent 36%),
            linear-gradient(180deg, var(--page-bg) 0%, var(--page-bg-alt) 100%);
    }

    .ambient-orb {
        display: none;
    }

    .map-stage__topbar h2 {
        font-size: 1.7rem;
    }

    .status-pill,
    .connection-pill,
    .micro-stat {
        min-height: 38px;
        padding: 0 12px;
        font-size: 0.8rem;
    }

    .floating-rail {
        top: 12px;
        left: 12px;
    }

    .icon-button--stacked {
        width: 52px;
        height: 52px;
    }

    .map-options-menu__panel {
        left: 0;
        right: 0;
        min-width: 0;
    }

    .modal {
        padding: 22px 18px;
    }
}
