* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

.theme-light {
    --bg: #f5f7fb;
    --text: #17233b;
    --surface: #ffffff;
    --border: #dbe3ef;
    --muted: #4a5875;
    --header-bg: #0a3d62;
    --header-fg: #ffffff;
    --link: #0a3d62;
    --btn-bg: rgba(255, 255, 255, 0.18);
    --btn-fg: #ffffff;
    --btn-border: rgba(255, 255, 255, 0.55);
    --sidebar-bg: #11253e;
    --sidebar-link: #d5e8ff;
}

.theme-dark {
    --bg: #212121;
    --text: #ececec;
    --surface: #2b2b2b;
    --border: #3f3f3f;
    --muted: #a9a9a9;
    --header-bg: #171717;
    --header-fg: #f5f5f5;
    --link: #19c37d;
    --btn-bg: #2a2a2a;
    --btn-fg: #ececec;
    --btn-border: #4a4a4a;
    --sidebar-bg: #171717;
    --sidebar-link: #ececec;
}

.site-body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--link);
}

.site-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--header-bg);
    color: var(--header-fg);
}

.app-header-content {
    min-width: 0;
}

.app-header h1 {
    margin: 0;
    font-size: 1.35rem;
}

.app-subtitle {
    margin: 0.25rem 0 0;
    opacity: 0.9;
}

.theme-form {
    margin: 0;
}

.theme-toggle {
    border: 1px solid var(--btn-border);
    background: var(--btn-bg);
    color: var(--btn-fg);
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.theme-toggle:hover {
    opacity: 0.92;
}

.site-main {
    padding: 1.25rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

.quick-links {
    margin-top: 1rem;
}

.quick-links a {
    margin-right: 1rem;
}

.app-footer {
    margin-top: auto;
    padding: 0.9rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
}

.growl-container {
    position: fixed;
    top: 0.9rem;
    right: 0.9rem;
    z-index: 2100;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    width: min(430px, calc(100vw - 1.8rem));
    pointer-events: none;
}

.growl-item {
    position: relative;
    border: 1px solid var(--border);
    border-left: 4px solid #ef7d00;
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    padding: 0.62rem 2rem 0.62rem 0.74rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.growl-item.is-closing {
    opacity: 0;
    transform: translateX(10px);
}

.growl-title {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.2;
}

.growl-text {
    margin-top: 0.28rem;
    font-size: 0.79rem;
    line-height: 1.35;
    color: var(--muted);
}

.growl-close {
    position: absolute;
    top: 0.38rem;
    right: 0.38rem;
    width: 1.2rem;
    height: 1.2rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.growl-close:hover {
    color: var(--text);
    border-color: var(--muted);
}

.client-layout {
    min-height: 100vh;
}

.client-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--header-bg);
    color: var(--header-fg);
}

.client-title {
    margin: 0;
    font-size: 1.25rem;
}

.client-subtitle {
    margin: 0.25rem 0 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.client-header-start {
    display: flex;
    align-items: center;
    gap: 0.72rem;
    min-width: 0;
}

.client-header-title {
    min-width: 0;
}

.client-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.client-menupanel-toggle {
    position: fixed;
    opacity: 0;
    pointer-events: none;
}

.client-menu-trigger {
    position: relative;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.client-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.24);
}

.client-menu-icon {
    position: relative;
    width: 1.1rem;
    height: 0.86rem;
    border-top: 2px solid var(--header-fg);
    border-bottom: 2px solid var(--header-fg);
}

.client-menu-icon::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0.31rem;
    height: 2px;
    background: var(--header-fg);
}

.client-menupanel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(340px, 88vw);
    background: var(--surface);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 1300;
    color: var(--text);
    display: flex;
    flex-direction: column;
}

.client-menupanel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem 1.25rem 1.2rem;
    border-bottom: 1px solid var(--border);
}

.client-menupanel-title {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.2;
    color: var(--text);
}

.client-menupanel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
}

.client-menupanel-close:hover {
    border-color: var(--border);
    background: var(--bg);
}

.client-menupanel-nav {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.9rem;
    overflow-y: auto;
}

.client-menupanel-item {
    display: block;
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    font-size: 0.84rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.client-menupanel-item:hover {
    border-color: var(--link);
}

.client-menupanel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 1200;
}

.client-menupanel-toggle:checked ~ .client-menupanel {
    transform: translateX(0);
}

.client-menupanel-toggle:checked ~ .client-menupanel-backdrop {
    opacity: 1;
    visibility: visible;
}

.client-userpanel-toggle {
    position: fixed;
    opacity: 0;
    pointer-events: none;
}

.client-user-trigger {
    position: relative;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.client-user-trigger:hover {
    background: rgba(255, 255, 255, 0.24);
}

.client-user-count {
    position: absolute;
    top: -0.22rem;
    right: -0.15rem;
    min-width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
    background: #ea4335;
    color: #ffffff;
    font-size: 0.68rem;
    line-height: 1.15rem;
    text-align: center;
    font-weight: 700;
}

.client-user-icon {
    position: relative;
    width: 1.2rem;
    height: 1.2rem;
    display: inline-block;
}

.client-user-icon::before {
    content: "";
    position: absolute;
    top: 0.02rem;
    left: 50%;
    width: 0.45rem;
    height: 0.45rem;
    border: 2px solid var(--header-fg);
    border-radius: 999px;
    transform: translateX(-50%);
}

.client-user-icon::after {
    content: "";
    position: absolute;
    top: 0.58rem;
    left: 50%;
    width: 0.9rem;
    height: 0.5rem;
    border: 2px solid var(--header-fg);
    border-top-left-radius: 0.55rem;
    border-top-right-radius: 0.55rem;
    border-bottom: 0;
    transform: translateX(-50%);
}

.client-userpanel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 88vw);
    background: var(--surface);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.22s ease;
    z-index: 1300;
    display: flex;
    flex-direction: column;
    color: var(--text);
}

.client-userpanel-form {
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.client-userpanel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem 1.25rem 0.72rem;
    border-bottom: 1px solid var(--border);
}

.client-profile-block {
    min-width: 0;
}

.client-user-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text);
    word-break: break-word;
}

.client-user-role {
    margin: 0.1rem 0 0;
    font-size: 0.76rem;
    line-height: 1.1;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.client-userpanel-exit-btn {
    display: inline-block;
    margin-top: 0.08rem;
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.05;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
}

.client-userpanel-exit-btn:hover {
    color: #19c37d;
    text-decoration: underline;
}

.client-userpanel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    border-radius: 8px;
    padding: 0;
    text-decoration: none;
    font-family: inherit;
    cursor: pointer;
}

.client-userpanel-close:hover {
    border-color: var(--border);
    background: var(--bg);
}

.client-userpanel-close-icon {
    position: relative;
    width: 1.15rem;
    height: 1.15rem;
    display: inline-block;
}

.client-userpanel-close-icon::before,
.client-userpanel-close-icon::after {
    content: "";
    position: absolute;
    top: 0.5rem;
    left: 0.09rem;
    width: 0.96rem;
    height: 0.14rem;
    border-radius: 999px;
    background: currentColor;
}

.client-userpanel-close-icon::before {
    transform: rotate(45deg);
}

.client-userpanel-close-icon::after {
    transform: rotate(-45deg);
}

.client-userpanel-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0.68rem 1rem 1rem;
    overflow: hidden;
}

.client-userpanel-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.9rem 1rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.client-panel-block {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem;
    background: var(--bg);
}

.client-panel-notices {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.client-notice-list {
    margin-top: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    overflow-y: auto;
    min-height: 0;
    flex: 1;
    padding-right: 0.2rem;
}

.client-notice-empty {
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 0.6rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.client-notice-item {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 0.55rem 4.2rem 0.55rem 0.7rem;
    cursor: default;
}

.client-notice-item.notice-unread {
    border-left: 4px solid #19c37d;
}

.client-notice-item.notice-read {
    border-left: 4px solid var(--border);
}

.client-notice-line {
    display: flex;
    align-items: center;
    min-width: 0;
}

.client-notice-title {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-notice-preview {
    margin: 0.26rem 0 0;
    font-size: 0.79rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-notice-remove {
    position: absolute;
    top: 0.35rem;
    right: 0.45rem;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--muted);
    border-radius: 999px;
    width: 1.3rem;
    height: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.client-notice-remove-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    transform: translateY(-1px);
}

.client-notice-remove:hover {
    border-color: #c94d45;
    color: #c94d45;
    background: var(--surface);
}

.client-notice-read {
    position: absolute;
    top: 2rem;
    right: 0.45rem;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: 999px;
    min-width: 2.65rem;
    height: 1.4rem;
    line-height: 1.25rem;
    padding: 0 0.55rem;
    font-size: 0.76rem;
    text-align: center;
    text-decoration: none;
}

.client-notice-read:hover {
    border-color: var(--link);
    color: var(--link);
}

.client-panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.client-panel-title-row h3 {
    margin: 0;
    font-size: 0.93rem;
    color: var(--text);
}

.client-panel-count,
.client-panel-tag {
    border-radius: 999px;
    font-size: 0.72rem;
    padding: 0.18rem 0.55rem;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.client-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text);
}

.client-switch {
    width: 1rem;
    height: 1rem;
}

.client-hint-text {
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: var(--muted);
}

.client-action-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.client-select {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    font-size: 0.82rem;
}

.client-action-button {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 8px;
    padding: 0.45rem 0.7rem;
    text-align: left;
    font-size: 0.82rem;
    cursor: pointer;
}

.client-action-button:hover {
    border-color: var(--link);
}

.client-theme-toggle {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
    font-weight: 600;
    text-align: center;
}

.client-userpanel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 1200;
}

.client-userpanel-toggle:checked ~ .client-userpanel {
    transform: translateX(0);
}

.client-userpanel-toggle:checked ~ .client-userpanel-backdrop {
    opacity: 1;
    visibility: visible;
}

.client-notice-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1400;
}

.client-notice-modal.is-open {
    display: flex;
}

.client-notice-modal-card {
    width: min(780px, 92vw);
    min-height: clamp(280px, 46vh, 420px);
    max-height: 86vh;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1rem 0.9rem;
    position: relative;
}

.client-notice-modal-close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    width: 1.4rem;
    height: 1.4rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.client-notice-modal-title {
    margin: 0 1.8rem 1.1rem 0;
    font-size: 1.22rem;
    line-height: 1.3;
    color: var(--text);
}

.client-notice-modal-text {
    margin: 0;
    color: var(--text);
    line-height: 1.45;
    white-space: pre-wrap;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.client-main {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.client-main-map {
    flex: 1;
    display: flex;
    min-height: 0;
    height: calc(100vh - 4.85rem);
    height: calc(100dvh - 4.85rem);
    max-height: calc(100vh - 4.85rem);
    max-height: calc(100dvh - 4.85rem);
    width: 100%;
    max-width: none;
    margin: 0;
    padding-top: 0;
    padding-right: 0;
    padding-bottom: 0;
    padding-left: 0;
    overflow: hidden;
}

.client-feature-card {
    margin-bottom: 1rem;
}

.client-feature-card h2 {
    margin-top: 0;
}

.map-full-layout {
    display: flex;
    flex: 1;
    height: calc(100vh - 4.85rem);
    height: calc(100dvh - 4.85rem);
    max-height: calc(100vh - 4.85rem);
    max-height: calc(100dvh - 4.85rem);
    min-height: 0;
    width: 100%;
    overflow: hidden;
}

.map-full-page {
    position: relative;
    flex: 1;
    height: 100%;
    width: auto;
    margin: 0;
    min-height: 0;
    overflow: hidden;
    background: #111111;
}

.map-full-canvas {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.map-device-panel {
    display: flex;
    flex-direction: column;
    flex: 0 0 400px;
    height: 100%;
    min-height: 0;
    width: auto;
    min-width: 400px;
    max-width: 400px;
    border-left: 1px solid var(--border);
    background: var(--surface);
    padding: 0.85rem;
    overflow: hidden;
    overscroll-behavior: contain;
}

.map-device-panel-title {
    margin: 0;
    font-size: 1rem;
    color: var(--text);
}

.map-device-summary {
    margin: 0.55rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.map-device-list {
    list-style: none;
    margin: 0.7rem 0 0;
    padding: 0;
    overflow-y: auto;
    min-height: 0;
    flex: 1;
    border-top: 1px solid var(--border);
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.map-device-list-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.56rem 0.12rem;
    border-bottom: 1px solid var(--border);
}

.map-device-list-item.is-active {
    background: rgba(25, 118, 210, 0.12);
}

.map-device-list-item-empty {
    color: var(--muted);
    font-size: 0.84rem;
}

.map-device-list-title {
    font-size: 0.86rem;
    color: var(--text);
}

.map-device-list-line {
    font-size: 0.78rem;
    color: var(--muted);
}

.map-iw-content {
    min-width: 210px;
    line-height: 1.35;
}

.map-iw-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.map-iw-line {
    margin-top: 0.18rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.theme-dark .map-device-panel {
    background: #1f1f1f;
    border-left-color: #3a3a3a;
}

.theme-dark .map-device-list {
    border-top-color: #3a3a3a;
}

.theme-dark .map-device-list-item {
    border-bottom-color: #3a3a3a;
}

.theme-dark .map-device-summary,
.theme-dark .map-device-list-line {
    color: #b8b8b8;
}

.theme-dark .map-device-list-item.is-active {
    background: rgba(25, 118, 210, 0.26);
}

/* Google Maps InfoWindow: enforce dark palette when app is in dark theme. */
.theme-dark .gm-style .gm-style-iw-c {
    background: #111315 !important;
    color: #eef1f4 !important;
    border: 1px solid #2f3338 !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45) !important;
}

.theme-dark .gm-style .gm-style-iw-d {
    background: #111315 !important;
    color: #eef1f4 !important;
    overflow: auto !important;
    scrollbar-color: #4a5563 #111315;
    scrollbar-width: thin;
}

.theme-dark .gm-style .gm-style-iw-chr,
.theme-dark .gm-style .gm-style-iw-ch {
    background: #111315 !important;
    color: #eef1f4 !important;
}

.theme-dark .gm-style .gm-style-iw-d::-webkit-scrollbar {
    width: 10px;
    height: 10px;
    background: #111315;
}

.theme-dark .gm-style .gm-style-iw-d::-webkit-scrollbar-track {
    background: #111315;
}

.theme-dark .gm-style .gm-style-iw-d::-webkit-scrollbar-thumb {
    background: #4a5563;
    border-radius: 8px;
    border: 2px solid #111315;
}

.theme-dark .gm-style .gm-style-iw-d::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.theme-dark .gm-style .gm-style-iw-c .map-iw-title {
    color: #eef1f4 !important;
}

.theme-dark .gm-style .gm-style-iw-c .map-iw-line {
    color: #b5bdc7 !important;
}

.theme-dark .gm-style .gm-ui-hover-effect > span {
    background-color: #eef1f4 !important;
}

.theme-dark .gm-style .gm-style-iw-tc::after {
    background: #111315 !important;
}

.landing-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: minmax(210px, 1fr) auto minmax(320px, 1fr);
    align-items: center;
    gap: 0.9rem;
    padding: 0.6rem 1rem;
    background: var(--header-bg);
    color: var(--header-fg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.landing-brand h1 {
    margin: 0;
    font-size: 1.1rem;
}

.landing-brand p {
    margin: 0.15rem 0 0;
    font-size: 0.82rem;
    opacity: 0.88;
}

.landing-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.landing-nav a {
    text-decoration: none;
    color: var(--header-fg);
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
}

.landing-nav a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.landing-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.45rem;
}

.header-login-form,
.header-logged-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}

.header-theme-form {
    margin: 0;
}

.header-input {
    width: 7.6rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.14);
    color: var(--header-fg);
    border-radius: 999px;
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
}

.header-input::placeholder {
    color: rgba(255, 255, 255, 0.86);
}

.header-btn {
    border: 1px solid rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.2);
    color: var(--header-fg);
    border-radius: 999px;
    padding: 0.35rem 0.72rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.header-btn:hover {
    opacity: 0.9;
}

.user-badge {
    font-size: 0.85rem;
    white-space: nowrap;
}

.landing-content {
    max-width: 1120px;
    margin: 0 auto;
    padding: 4.75rem 0 2rem;
}

.landing-messages {
    list-style: none;
    margin: 0 0 0.8rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid #e2b851;
    border-radius: 8px;
    background: #fff3cd;
    color: #5f4308;
}

.landing-section {
    margin-bottom: 1.1rem;
    scroll-margin-top: 5.5rem;
}

.landing-section > h2 {
    margin: 0 0 0.65rem;
}

.landing-hero {
    border-left: 4px solid var(--link);
}

.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8rem;
}

.feed-item h3 {
    margin: 0 0 0.55rem;
    font-size: 1rem;
}

.feed-item p {
    margin: 0;
    color: var(--muted);
}

.promo-item {
    border-top: 4px solid #ef7d00;
}

.user-state-card h3 {
    margin-top: 0;
}

.landing-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    margin: 0;
    padding: 0.35rem 1rem;
    text-align: center;
    font-size: 0.82rem;
    line-height: 1.3;
}

@media (max-width: 640px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .client-header {
        flex-direction: row;
        align-items: flex-start;
    }

    .client-actions {
        width: auto;
    }

    .landing-header {
        position: fixed;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .landing-nav {
        justify-content: flex-start;
    }

    .landing-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .header-input {
        width: 6.6rem;
    }

    .landing-content {
        padding-top: 11.4rem;
    }

    .client-main-map {
        height: calc(100vh - 5.7rem);
        height: calc(100dvh - 5.7rem);
        max-height: calc(100vh - 5.7rem);
        max-height: calc(100dvh - 5.7rem);
    }

    .map-full-layout {
        height: calc(100vh - 5.7rem);
        height: calc(100dvh - 5.7rem);
        max-height: calc(100vh - 5.7rem);
        max-height: calc(100dvh - 5.7rem);
    }

    .map-full-page {
        min-height: 0;
    }

    .map-device-panel {
        width: 400px;
        min-width: 400px;
        max-width: 400px;
    }
}
