:root {
    --app-bg: #eef4f8;
    --app-panel: #ffffff;
    --app-primary: #0b5ed7;
    --app-primary-dark: #083b88;
    --app-accent: #dcecff;
    --app-line: #d7e4f0;
    --app-icon: #6e87a7;
    --app-text: #1e293b;
    --app-text-soft: #64748b;
    --app-card-border: #dbe5f0;
    --app-navbar-text: #dbeafe;
    --app-map-bg: #d8e7f2;
}

body[data-theme="dark"] {
    --app-bg: #101923;
    --app-panel: #18232f;
    --app-primary: #4f8df7;
    --app-primary-dark: #204b90;
    --app-accent: #233449;
    --app-line: #2b3d50;
    --app-icon: #9eb6d3;
    --app-text: #e2e8f0;
    --app-text-soft: #9fb0c5;
    --app-card-border: #314559;
    --app-navbar-text: #d9e7ff;
    --app-map-bg: #26394a;
}

body[data-theme="gray"] {
    --app-bg: #e7eaee;
    --app-panel: #f7f8fa;
    --app-primary: #5b6776;
    --app-primary-dark: #3d4753;
    --app-accent: #dde2e8;
    --app-line: #cdd4dc;
    --app-icon: #6b7280;
    --app-text: #222b36;
    --app-text-soft: #667181;
    --app-card-border: #cfd6de;
    --app-navbar-text: #ecf0f3;
    --app-map-bg: #d9dee4;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--app-text);
    background:
        radial-gradient(circle at top left, rgba(11, 94, 215, 0.16), transparent 28%),
        linear-gradient(180deg, #f6fbff 0%, var(--app-bg) 100%);
}

body[data-theme="dark"] {
    background:
        radial-gradient(circle at top left, rgba(79, 141, 247, 0.18), transparent 28%),
        linear-gradient(180deg, #0b1118 0%, var(--app-bg) 100%);
}

body[data-theme="gray"] {
    background:
        radial-gradient(circle at top left, rgba(91, 103, 118, 0.12), transparent 28%),
        linear-gradient(180deg, #f1f3f6 0%, var(--app-bg) 100%);
}

.app-navbar {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, var(--app-primary-dark), var(--app-primary));
}

.app-brand {
    display: inline-flex;
    align-items: flex-end;
    gap: 0.5rem;
    color: #ffffff;
}

.app-brand__icon {
    width: 2.15rem;
    height: 2.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-brand__icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.app-brand__text {
    font-size: 1.45rem;
    line-height: 1;
    font-weight: 600;
    letter-spacing: -0.01em;
}

body[data-theme="dark"] .app-navbar {
    background: linear-gradient(135deg, #111a24 0%, #1a2531 100%);
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.28);
}

body[data-theme="dark"] .modules-switcher__ghost,
body[data-theme="dark"] .modules-switcher__toggle,
body[data-theme="dark"] .theme-switcher__toggle,
body[data-theme="dark"] .auth-switcher__toggle,
body[data-theme="dark"] .language-switcher__toggle {
    border-color: rgba(159, 176, 197, 0.22);
    background: rgba(159, 176, 197, 0.12);
}

body[data-theme="dark"] .modules-switcher__ghost:hover,
body[data-theme="dark"] .modules-switcher__ghost:focus-visible,
body[data-theme="dark"] .modules-switcher__toggle:hover,
body[data-theme="dark"] .modules-switcher__toggle:focus-visible,
body[data-theme="dark"] .theme-switcher__toggle:hover,
body[data-theme="dark"] .theme-switcher__toggle:focus-visible,
body[data-theme="dark"] .auth-switcher__toggle:hover,
body[data-theme="dark"] .auth-switcher__toggle:focus-visible,
body[data-theme="dark"] .language-switcher__toggle:hover,
body[data-theme="dark"] .language-switcher__toggle:focus-visible {
    background: rgba(159, 176, 197, 0.18);
    border-color: rgba(159, 176, 197, 0.3);
}

.modules-switcher {
    position: relative;
}

.modules-switcher__controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modules-switcher__ghost,
.modules-switcher__toggle {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.modules-switcher__toggle {
    background: transparent;
    box-shadow: none;
}

.modules-switcher__ghost:hover,
.modules-switcher__ghost:focus-visible,
.modules-switcher__toggle:hover,
.modules-switcher__toggle:focus-visible {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.28);
    outline: none;
    transform: translateY(-1px);
}

.modules-switcher__menu {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    width: min(26rem, calc(100vw - 1rem));
    max-width: calc(100vw - 1rem);
    border: 1px solid #d7e4f0;
    border-radius: 1.2rem;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    z-index: 24;
}

.modules-switcher__header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e6edf5;
    background: #ffffff;
}

.modules-switcher__tabs {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.modules-switcher__tab {
    font-size: 0.92rem;
    font-weight: 500;
    color: #9aa9bb;
}

.modules-switcher__tab.is-active {
    color: #1f2937;
    font-weight: 700;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem 0.8rem;
    padding: 1.25rem;
}

.module-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    border: 0;
    background: transparent;
    color: #334155;
    text-align: center;
    padding: 0.25rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.module-card:hover,
.module-card:focus-visible {
    outline: none;
    transform: translateY(-2px);
}

.module-card__icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.15rem;
}

.module-card__icon--blue {
    background: #e8efff;
    color: #5b85e8;
}

.module-card__icon--cyan {
    background: #e7f8fb;
    color: #2aa7bf;
}

.module-card__icon--green {
    background: #e7f5ef;
    color: #1f8a52;
}

.module-card__icon--yellow {
    background: #fbf6e5;
    color: #d1a514;
}

.module-card__icon--red {
    background: #fdecec;
    color: #ea5a5a;
}

.module-card__icon--purple {
    background: #efeafe;
    color: #7c5ce0;
}

.module-card__icon--pink {
    background: #fde9f4;
    color: #df5f9a;
}

.module-card__icon--slate {
    background: #eef2f7;
    color: #475569;
}

.module-card__label {
    font-size: 0.82rem;
    line-height: 1.25;
    word-break: break-word;
}

@media (max-width: 640px) {
    .modules-switcher__menu {
        width: min(23rem, calc(100vw - 1rem));
    }

    .modules-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.theme-switcher {
    position: relative;
}

.theme-switcher__toggle {
    position: relative;
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: #ffffff;
    padding: 0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.theme-switcher__toggle:hover,
.theme-switcher__toggle:focus-visible {
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.24);
}

.theme-switcher__icon-shell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    background: transparent;
    box-shadow: none;
    color: #ffffff;
    font-size: 1.2rem;
    line-height: 1;
    pointer-events: none;
}

.theme-switcher__select {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
    padding: 0;
    margin: -1px;
    white-space: nowrap;
}

.theme-switcher__select option {
    color: #111827;
}

.theme-switcher__menu {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: 288px;
    border: 1px solid #d7e4f0;
    border-radius: 1.35rem;
    background: linear-gradient(180deg, #f9fbff 0%, #f4f8fd 100%);
    box-shadow: 0 28px 56px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    z-index: 20;
}

.theme-switcher__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.2rem;
    color: #1f2937;
    font-size: 1.05rem;
    font-weight: 600;
}

.theme-switcher__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.65rem;
    height: 1.65rem;
    border-radius: 9999px;
    background: #5b85e8;
    color: #ffffff;
    font-size: 0.82rem;
}

.theme-option {
    width: 100%;
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 0.9rem;
    border: 0;
    border-top: 1px solid #dbe5f0;
    background: #ffffff;
    padding: 1rem 1.2rem;
    color: #1f2937;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.theme-option:hover,
.theme-option:focus-visible {
    background: rgba(91, 133, 232, 0.06);
    outline: none;
}

.theme-option__icon-shell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    background: #edf2f8;
    color: #5f6b79;
    font-size: 1.1rem;
}

.theme-option__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: transparent;
}

.theme-option.is-active .theme-option__dot {
    background: #5b85e8;
}

.auth-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.auth-actions__primary,
.auth-actions__secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    padding: 0.72rem 1rem;
    border-radius: 9999px;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    backdrop-filter: blur(16px);
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-actions__primary {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 245, 251, 0.94));
    color: #334155;
    border: 1px solid rgba(255, 255, 255, 0.58);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.14);
}

.auth-actions__secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.auth-actions__primary:hover,
.auth-actions__secondary:hover {
    transform: translateY(-1px);
}

.auth-switcher {
    position: relative;
}

.auth-switcher__toggle {
    position: relative;
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(93, 132, 232, 0.96);
    border-radius: 9999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.16));
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.94), 0 12px 30px rgba(15, 23, 42, 0.2);
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.auth-switcher__toggle:hover,
.auth-switcher__toggle:focus-visible {
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.94), 0 16px 36px rgba(15, 23, 42, 0.24);
}

.auth-switcher__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    background: linear-gradient(180deg, rgba(137, 148, 161, 0.98), rgba(95, 108, 124, 0.96));
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9);
    font-size: 1.8rem;
    line-height: 1;
}

.auth-switcher__status,
.auth-switcher__header-status {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 11px;
    height: 11px;
    border-radius: 9999px;
    background: #22c55e;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18);
}

.auth-switcher__status--offline,
.auth-switcher__header-status--offline {
    background: #94a3b8;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.18);
}

.auth-switcher__menu {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: min(18.5rem, calc(100vw - 1rem));
    border: 1px solid #d9e4ef;
    border-radius: 1.35rem;
    background: linear-gradient(180deg, #f9fbff 0%, #f4f8fd 100%);
    box-shadow: 0 28px 56px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    z-index: 26;
}

.auth-switcher__header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.15rem 1.2rem;
    border-bottom: 1px solid #dde7f1;
    background: rgba(255, 255, 255, 0.42);
}

.auth-switcher__header-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 9999px;
    background: linear-gradient(180deg, #7f91a8, #596a7e);
    color: #ffffff;
    font-size: 2.35rem;
    line-height: 1;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.92);
}

.auth-switcher__header-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.auth-switcher__name {
    color: #1f2937;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-switcher__role {
    margin-top: 0.25rem;
    color: #7b8da6;
    font-size: 0.88rem;
    font-weight: 500;
}

.auth-option {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.2rem;
    border-top: 1px solid #e3ebf4;
    color: #475569;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.auth-option:hover {
    background: rgba(91, 133, 232, 0.08);
}

.auth-option__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #64748b;
    flex: 0 0 auto;
}

.auth-option--danger {
    color: #ef4444;
}

.auth-option--danger .auth-option__icon {
    background: #fff1f2;
    color: #ef4444;
}

.auth-profile-tab {
    color: #475569;
    background: #fff;
    border: 0;
    font-weight: 600;
    transition: all 0.2s ease;
}

.auth-profile-tab.is-active {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
}

.auth-profile-tab:not(.is-active):hover {
    background: #f8fafc;
    color: #0f172a;
}

.auth-profile-pane {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem;
    background: #fff;
}

#authProfileModal .rounded-3xl {
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}

#authProfileModal input[type="text"],
#authProfileModal input[type="email"],
#authProfileModal input[type="password"],
#authProfileModal input[type="file"] {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#authProfileModal input[type="text"]:focus,
#authProfileModal input[type="email"]:focus,
#authProfileModal input[type="password"]:focus,
#authProfileModal input[type="file"]:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    outline: none;
}

.language-switcher {
  position: relative;
}

.topbar-actions > .language-switcher {
  order: 1;
}

.topbar-actions {
  gap: 0.45rem !important;
}

.topbar-actions > .theme-switcher {
  order: 2;
}

.topbar-actions > .auth-switcher {
  order: 3;
  margin-left: 0.45rem;
}

.topbar-quickaccess__icon-shell i {
    color: #ffffff;
    font-size: 0.875rem;
}

.fieldwork-shortcut__icon-shell i {
    color: var(--app-navbar-text);
    font-size: 0.875rem;
}

.language-switcher__toggle {
    position: relative;
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.language-switcher__toggle:hover,
.language-switcher__toggle:focus-visible {
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.24);
}

.language-switcher__icon-shell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

.language-switcher__icon-image {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.language-switcher__menu {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: 288px;
    border: 1px solid #d7e4f0;
    border-radius: 1.35rem;
    background: linear-gradient(180deg, #f9fbff 0%, #f4f8fd 100%);
    box-shadow: 0 28px 56px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    z-index: 20;
}

.language-switcher__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.2rem;
    color: #1f2937;
    font-size: 1.05rem;
    font-weight: 600;
}

.language-switcher__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.65rem;
    height: 1.65rem;
    border-radius: 9999px;
    background: #5b85e8;
    color: #ffffff;
    font-size: 0.82rem;
}

.language-option {
    width: 100%;
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 0.9rem;
    border: 0;
    border-top: 1px solid #dbe5f0;
    background: #ffffff;
    padding: 1rem 1.2rem;
    color: #1f2937;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.language-option:hover,
.language-option:focus-visible {
    background: rgba(91, 133, 232, 0.06);
    outline: none;
}

.language-option__flag-shell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
}

.language-option__flag-image {
    width: 2.25rem;
    height: 2.25rem;
    object-fit: contain;
}

.language-option__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: transparent;
}

.language-option.is-active .language-option__dot {
    background: #5b85e8;
}

body[data-theme="dark"] .theme-switcher__menu,
body[data-theme="dark"] .language-switcher__menu {
    border-color: #314559;
    background: linear-gradient(180deg, #172430 0%, #182734 100%);
    box-shadow: 0 18px 45px rgba(2, 6, 23, 0.45);
}

body[data-theme="dark"] .auth-actions__primary {
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
}

body[data-theme="dark"] .auth-actions__secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #e2e8f0;
}

body[data-theme="dark"] .auth-switcher__menu {
    border-color: #314559;
    background: linear-gradient(180deg, #172430 0%, #182734 100%);
    box-shadow: 0 18px 45px rgba(2, 6, 23, 0.45);
}

body[data-theme="dark"] .auth-switcher__header {
    border-bottom-color: #314559;
    background: rgba(255, 255, 255, 0.03);
}

body[data-theme="dark"] .auth-switcher__name {
    color: #e2e8f0;
}

body[data-theme="dark"] .auth-switcher__role {
    color: #9fb0c5;
}

body[data-theme="dark"] .auth-option {
    border-top-color: #314559;
    color: #d7e0ea;
}

body[data-theme="dark"] .auth-option:hover {
    background: #1c2a38;
}

body[data-theme="dark"] .auth-option__icon {
    background: #223244;
    color: #c7d4e3;
}

body[data-theme="dark"] .theme-switcher__header,
body[data-theme="dark"] .language-switcher__header {
    color: #e2e8f0;
}

body[data-theme="dark"] .theme-option,
body[data-theme="dark"] .language-option {
    border-top-color: #314559;
    background: #18232f;
    color: #e2e8f0;
}

body[data-theme="dark"] .theme-option:hover,
body[data-theme="dark"] .theme-option:focus-visible,
body[data-theme="dark"] .language-option:hover,
body[data-theme="dark"] .language-option:focus-visible {
    background: #223244;
    outline: none;
}

body[data-theme="dark"] .theme-option__icon-shell {
    background: #223244;
    color: #d7e0ea;
}

body[data-theme="gray"] .theme-switcher__menu,
body[data-theme="gray"] .language-switcher__menu {
    border-color: #cfd6de;
    background: linear-gradient(180deg, #f7f8fa 0%, #eef2f5 100%);
}

body[data-theme="gray"] .auth-actions__primary {
    background: linear-gradient(180deg, #ffffff 0%, #f1f4f7 100%);
    color: #334155;
    border-color: #d7dee6;
}

body[data-theme="gray"] .auth-actions__secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f8fafc;
}

body[data-theme="gray"] .auth-switcher__menu {
    border-color: #cfd6de;
    background: linear-gradient(180deg, #f7f8fa 0%, #eef2f5 100%);
}

body[data-theme="gray"] .auth-switcher__header {
    border-bottom-color: #d7dee6;
    background: rgba(255, 255, 255, 0.46);
}

body[data-theme="gray"] .auth-switcher__name {
    color: #222b36;
}

body[data-theme="gray"] .auth-switcher__role {
    color: #708093;
}

body[data-theme="gray"] .auth-option {
    border-top-color: #d7dee6;
    color: #475569;
}

body[data-theme="gray"] .auth-option:hover {
    background: #e9eef3;
}

body[data-theme="gray"] .auth-option__icon {
    background: #e8edf2;
    color: #5f6b79;
}

body[data-theme="gray"] .theme-switcher__header,
body[data-theme="gray"] .language-switcher__header {
    color: #222b36;
}

body[data-theme="gray"] .theme-option,
body[data-theme="gray"] .language-option {
    border-top-color: #d7dee6;
    background: #f7f8fa;
    color: #222b36;
}

body[data-theme="gray"] .theme-option:hover,
body[data-theme="gray"] .theme-option:focus-visible,
body[data-theme="gray"] .language-option:hover,
body[data-theme="gray"] .language-option:focus-visible {
    background: #e9edf2;
    outline: none;
}

body[data-theme="gray"] .theme-option__icon-shell {
    background: #e8edf2;
    color: #5f6b79;
}

body[data-theme="dark"] .modules-switcher__menu {
    border-color: #314559;
    background: #18232f;
    box-shadow: 0 18px 45px rgba(2, 6, 23, 0.45);
}

body[data-theme="dark"] .modules-switcher__header {
    border-bottom-color: #314559;
    background: #18232f;
}

body[data-theme="dark"] .modules-switcher__tab {
    color: #8fa2b8;
}

body[data-theme="dark"] .modules-switcher__tab.is-active {
    color: #e2e8f0;
}

body[data-theme="dark"] .module-card {
    color: #d7e0ea;
}

body[data-theme="gray"] .modules-switcher__menu {
    border-color: #cfd6de;
    background: #f7f8fa;
}

body[data-theme="gray"] .modules-switcher__header {
    border-bottom-color: #d7dee6;
    background: #f7f8fa;
}

.app-main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.app-shell {
    display: grid;
    grid-template-columns: 82px 320px minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
    height: 100%;
    min-height: 0;
}

.app-shell.tool-panel-hidden {
    grid-template-columns: 82px minmax(0, 1fr);
}

.map-container {
    width: 100%;
    height: 100%;
    min-height: 0;
    background: var(--app-map-bg);
}

.map-wrapper {
    position: relative;
    height: 100%;
    min-height: 0;
}

.map-zoom-badge {
    position: absolute;
    left: 1rem;
    bottom: 4.15rem;
    z-index: 14;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.86);
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 22px rgba(2, 6, 23, 0.35);
    color: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.38rem 0.72rem;
    line-height: 1;
    pointer-events: none;
}

.map-legend {
    position: absolute;
    left: 0.9rem;
    bottom: 1rem;
    z-index: 15;
    width: min(280px, calc(100% - 1.8rem));
    max-height: 44vh;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
    padding: 10px 12px;
}



.map-legend__title {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #475569;
}

.map-legend__empty {
    margin: 0;
    font-size: 12px;
    color: #64748b;
}

.map-legend__list {
    display: grid;
    gap: 7px;
}

.map-legend__item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #334155;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 3px 4px;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
}

.map-legend__item:hover {
    background: rgba(148, 163, 184, 0.16);
}

.map-legend__item.is-muted {
    opacity: 0.45;
}


.map-legend__swatch {
    width: 16px;
    height: 16px;
    border-radius: 5px;
    border: 2px solid #334155;
    flex: 0 0 auto;
}

.map-three-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 16;
}

.map-deck-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 17;
}

.map-ol3d-toggle {
    position: absolute;
    top: 0.9rem;
    left: 0.9rem;
    z-index: 41;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.72rem;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(8px);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.map-ol3d-toggle:hover,
.map-ol3d-toggle:focus-visible {
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.2);
}

.map-ol3d-toggle.is-active {
    background: #0f172a;
    color: #f8fafc;
    border-color: rgba(15, 23, 42, 0.45);
}

.streetview-control {
    position: absolute;
    top: 4.8em;
    left: 0.5rem;
    z-index: 40;
    pointer-events: auto;
}

.streetview-control.ol-control {
    margin: 0;
}

.streetview-control__button {
    width: 3rem;
    height: 3rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    position: relative;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(12px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.streetview-control__glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.streetview-control__glyph i {
    line-height: 1;
}

.streetview-control__button:hover,
.streetview-control__button:focus-visible {
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.18);
    color: #0b5ed7;
}

.streetview-control__button.is-active {
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.18);
    background: #2563eb;
    color: #ffffff;
    border-color: rgba(37, 99, 235, 0.22);
}

.streetview-hint {
    position: absolute;
    top: 1rem;
    right: 4.75rem;
    z-index: 12;
    max-width: 18rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.96);
    color: #334155;
    padding: 0.75rem 0.9rem;
    font-size: 0.82rem;
    line-height: 1.45;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.streetview-hint.hidden,
.streetview-coverage.hidden,
.streetview-drag-avatar.hidden,
.streetview-drawer.hidden {
    display: none;
}

.streetview-coverage {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    opacity: 0.92;
}

.streetview-drag-avatar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 32;
    width: 2.5rem;
    height: 2.5rem;
    margin-left: -1.25rem;
    margin-top: -2rem;
    border-radius: 9999px 9999px 9999px 0.85rem;
    background: linear-gradient(180deg, #ffd85a 0%, #f2b600 100%);
    color: #5b4300;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
    pointer-events: none;
}

.basemap-toggle {
    position: absolute;
    left: 0.5rem;
    top: 12.4rem;
    z-index: 12;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 3rem;
    height: 3rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.96);
    padding: 0;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(12px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.locate-user-button {
    position: absolute;
    left: 0.5rem;
    top: 8.6rem;
    z-index: 12;
    width: 3rem;
    height: 3rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(12px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.photo360-toggle {
    position: absolute;
    left: 1rem;
    bottom: 10.4rem;
    z-index: 12;
    width: 3rem;
    height: 3rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(12px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.photo360-toggle:hover,
.photo360-toggle:focus-visible {
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.18);
}

.photo360-toggle.is-active {
    background: #2563eb;
    color: #ffffff;
    border-color: rgba(37, 99, 235, 0.22);
}

.locate-user-button:hover,
.locate-user-button:focus-visible {
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.18);
    color: #0b5ed7;
}

#photo360Toggle {
    top: 16.2rem;
}

#videoTrackToggle {
    top: 20rem;
}

#mapHoverMagnifyToggle {
    top: 23.8rem;
}

.basemap-toggle:hover,
.basemap-toggle:focus-visible {
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.18);
}

.photo360-modal.hidden {
    display: none;
}

.photo360-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
}

.photo360-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(6px);
}

.photo360-modal__shell {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.photo360-modal__dialog {
    position: relative;
    width: min(100%, 78rem);
    height: min(100%, 52rem);
    border-radius: 1.35rem;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.32);
    display: flex;
    flex-direction: column;
}

.photo360-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem 0.95rem;
    border-bottom: 1px solid #e2e8f0;
}

.photo360-modal__header-main {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-width: 0;
}

.photo360-modal__header-text {
    display: grid;
    gap: 0.25rem;
}

.photo360-modal__thumb {
    width: 5.5rem;
    height: 5.5rem;
    flex: 0 0 5.5rem;
    object-fit: cover;
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #e2e8f0;
}

.photo360-modal__title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.photo360-modal__subtitle {
    font-size: 0.84rem;
    color: #64748b;
}

.photo360-modal__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.35rem;
}

.photo360-modal__meta-chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    border: 1px solid #dbe5f0;
    border-radius: 9999px;
    background: #f8fafc;
    color: #475569;
    padding: 0.2rem 0.7rem;
    font-size: 0.74rem;
    line-height: 1.2;
}

.photo360-modal__close {
    width: 2.4rem;
    height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbe5f0;
    border-radius: 9999px;
    background: #f8fafc;
    color: #334155;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.photo360-modal__close:hover,
.photo360-modal__close:focus-visible {
    outline: none;
    transform: translateY(-1px);
    background: #eef2f7;
    color: #0f172a;
}

.photo360-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    background: #0b1118;
}

.photo360-modal__viewer {
    width: 100%;
    height: 100%;
    min-height: 22rem;
    position: relative;
}

.photo360-nav {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 12;
}

.photo360-nav__btn {
    position: absolute;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    transition: all 0.15s ease;
}

.photo360-nav__btn:hover,
.photo360-nav__btn:focus-visible {
    background: rgba(15, 23, 42, 0.8);
    transform: scale(1.04);
    outline: none;
}

.photo360-nav__btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.photo360-nav__btn--left { left: 14px; top: 50%; transform: translateY(-50%); }
.photo360-nav__btn--right { right: 14px; top: 50%; transform: translateY(-50%); }
.photo360-nav__btn--forward { top: 14px; left: 50%; transform: translateX(-50%); }
.photo360-nav__btn--back { bottom: 14px; left: 50%; transform: translateX(-50%); }

.photo360-nav__btn--left:hover,
.photo360-nav__btn--left:focus-visible,
.photo360-nav__btn--right:hover,
.photo360-nav__btn--right:focus-visible { transform: translateY(-50%) scale(1.04); }

.photo360-nav__btn--forward:hover,
.photo360-nav__btn--forward:focus-visible,
.photo360-nav__btn--back:hover,
.photo360-nav__btn--back:focus-visible { transform: translateX(-50%) scale(1.04); }

body[data-theme="dark"] .photo360-nav__btn {
    background: rgba(2, 6, 23, 0.72);
    border-color: rgba(148, 163, 184, 0.6);
}

.video-track-toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    align-items: stretch;
    justify-content: stretch;
    margin-bottom: 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #1e293b;
    font-size: 13px;
    box-shadow: none;
}

.video-track-toolbar--sliders {
    justify-content: flex-start;
}

.video-track-toolbar__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.video-track-toolbar__inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 0.9rem;
    background: #fff;
}

.video-track-toolbar__input {
    width: 92px;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    padding: 5px 8px;
    background: #fff;
}

.video-track-toolbar__btn {
    border: 1px solid #cbd5e1;
    border-radius: 0.9rem;
    min-width: 36px;
    width: auto;
    min-height: 36px;
    height: auto;
    padding: 0.4rem 0.62rem;
    background: #fff;
    color: #1e293b;
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.1;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.video-track-toolbar__btn i {
    margin-right: 0;
    font-size: 1rem;
}

#videoTrackModal .photo360-modal__dialog,
#videoTrackModal .photo360-modal__body {
    background: #ffffff;
}

#videoTrackModal .photo360-modal__body {
    padding-bottom: 10px;
}

#videoTrackViewport {
    background: #000000 !important;
    width: min(100%, 72vh);
    aspect-ratio: 1 / 1;
    height: auto !important;
    margin: 0 auto;
}

.video-track-toolbar__btn:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.video-track-toolbar input[type="range"] {
    accent-color: #2563eb;
}

.video-track-toolbar__value {
    min-width: 46px;
    text-align: right;
    color: #475569;
    font-weight: 600;
}

.video-track-toolbar__group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 1rem;
    background: #f8fafc;
    min-height: 72px;
}

.video-track-toolbar__group-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #334155;
    font-weight: 700;
}

.video-track-bind-badge {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #93c5fd;
    border-radius: 9999px;
    background: rgba(239, 246, 255, 0.96);
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    pointer-events: none;
}

.basemap-toggle__preview {
    width: 2.1rem;
    height: 2.1rem;
    flex: 0 0 2.1rem;
    border-radius: 9999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 4px 10px rgba(15, 23, 42, 0.14);
}

.basemap-toggle__preview--satellite {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 40%),
        linear-gradient(180deg, #6d8c55 0%, #496940 38%, #9c7a52 38%, #8a6844 70%, #d9c5a5 100%);
}

.basemap-toggle__preview--map {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.45), transparent 46%),
        linear-gradient(180deg, #d8efe0 0%, #d8efe0 100%);
    position: relative;
}

.basemap-toggle__preview--map::before,
.basemap-toggle__preview--map::after {
    content: "";
    position: absolute;
    inset: 0;
}

.basemap-toggle__preview--map::before {
    background:
        linear-gradient(90deg, transparent 0 18%, rgba(77, 149, 219, 0.8) 18% 22%, transparent 22% 100%),
        linear-gradient(0deg, transparent 0 48%, rgba(255, 184, 77, 0.9) 48% 54%, transparent 54% 100%);
    opacity: 0.92;
}

.basemap-toggle__preview--map::after {
    background:
        radial-gradient(circle at 72% 28%, rgba(104, 179, 87, 0.9) 0 20%, transparent 22%),
        radial-gradient(circle at 28% 72%, rgba(104, 179, 87, 0.9) 0 18%, transparent 20%);
}

.basemap-toggle__text {
    display: none;
}

.basemap-toggle__text strong {
    font-size: 0.84rem;
    line-height: 1.2;
    color: #0f172a;
}

.basemap-toggle__text small {
    font-size: 0.72rem;
    color: #64748b;
}

.streetview-control,
.streetview-hint,
.streetview-drag-avatar {
    user-select: none;
}

.streetview-drawer {
    position: absolute;
    inset: 0;
    z-index: 15;
    pointer-events: none;
}

.streetview-drawer__shell {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: flex-end;
    padding-left: 3rem;
    overflow: hidden;
    pointer-events: none;
}

.streetview-drawer__panel {
    position: relative;
    width: min(100%, 38rem);
    height: 100%;
    background: #ffffff;
    box-shadow: -18px 0 40px rgba(15, 23, 42, 0.22);
    transform: translateX(100%);
    transition: transform 0.45s ease;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.streetview-drawer.is-open .streetview-drawer__panel {
    transform: translateX(0);
}

.streetview-drawer__close-wrap {
    position: absolute;
    top: 0;
    left: 0;
    margin-left: -3rem;
    display: flex;
    padding-top: 1rem;
    padding-right: 0.5rem;
}

.streetview-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.52);
    color: #ffffff;
    backdrop-filter: blur(10px);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.streetview-drawer__close:hover,
.streetview-drawer__close:focus-visible {
    outline: none;
    background: rgba(15, 23, 42, 0.72);
    transform: scale(1.03);
}

.streetview-drawer__content {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
}

.streetview-drawer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 1.25rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.streetview-drawer__header-text {
    display: grid;
    gap: 0.25rem;
}

.streetview-drawer__title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.streetview-drawer__subtitle {
    font-size: 0.82rem;
    line-height: 1.45;
    color: #64748b;
}

.streetview-drawer__body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem 1.25rem;
    gap: 1rem;
}

.streetview-message {
    border: 1px solid #dbe5f0;
    border-radius: 1rem;
    background: #f8fafc;
    color: #475569;
    padding: 0.95rem 1rem;
    font-size: 0.88rem;
    line-height: 1.5;
}

.streetview-message--error {
    border-color: #fecdd3;
    background: #fff1f2;
    color: #be123c;
}

.streetview-message--success {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.streetview-panorama {
    flex: 1 1 auto;
    min-height: 20rem;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid #dbe5f0;
    background: #0f172a;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.tool-sidebar,
.tool-panel,
.map-stage {
    min-height: 0;
    height: 100%;
}

.tool-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    overflow: hidden;
}

.tool-sidebar__brand {
    width: 100%;
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--app-line);
    display: flex;
    justify-content: center;
}

.tool-sidebar__crest {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, var(--app-accent) 100%);
    color: var(--app-primary-dark);
    font-size: 1.5rem;
    box-shadow: inset 0 0 0 1px rgba(11, 94, 215, 0.12);
}

.tool-sidebar__menu {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 0;
    width: 100%;
    align-items: center;
}

.tool-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--app-icon);
    font-size: 1.5rem;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.tool-button:hover,
.tool-button:focus-visible {
    background: color-mix(in srgb, var(--app-accent) 70%, white 30%);
    color: var(--app-primary);
    transform: translateY(-1px);
    outline: none;
}

.tool-button.is-active {
    background: linear-gradient(180deg, color-mix(in srgb, var(--app-accent) 55%, white 45%) 0%, var(--app-accent) 100%);
    color: var(--app-primary-dark);
    box-shadow: inset 0 0 0 1px rgba(11, 94, 215, 0.12);
}

.tool-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.tool-panel__section {
    display: none;
    height: 100%;
    min-height: 0;
}

.tool-panel__section.is-active {
    display: flex;
    flex-direction: column;
}

.panel-scroll {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
}

.panel-scroll--layers {
    height: 100%;
    overflow: hidden;
}

.panel-scroll__header {
    flex: 0 0 auto;
    border-bottom: 1px solid #e2e8f0;
    background: var(--app-panel);
}

.panel-scroll__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.layer-groups {
    display: block;
    padding: 1.5rem;
    background: linear-gradient(180deg, color-mix(in srgb, var(--app-panel) 92%, white 8%) 0%, color-mix(in srgb, var(--app-accent) 45%, var(--app-panel) 55%) 100%);
    min-height: 0;
}

.layer-group {
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--app-card-border);
    border-radius: 0.9rem;
    background: var(--app-panel);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.layer-group + .layer-group {
    margin-top: 0.6rem;
}

.layer-group__header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.35rem;
    background: var(--app-panel);
    color: #133760;
    border: 0;
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    outline: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.layer-group.is-open .layer-group__header {
    background: color-mix(in srgb, var(--app-accent) 70%, var(--app-panel) 30%);
    color: #5b85e8;
}

.layer-group__chevron {
    color: #133760;
    transition: transform 0.2s ease;
}

.layer-group.is-open .layer-group__chevron {
    transform: rotate(0deg);
}

.layer-group__content {
    padding: 0.55rem 1rem 0.4rem;
    background: var(--app-panel);
}

.layer-item {
    padding: 0.0em 0rem 0.3rem;
    border-bottom: 1px solid #eef2f7;
    margin-bottom: 0.3rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "toggle actions"
        "opacity opacity";
    align-items: center;
    column-gap: 0.5rem;
    row-gap: 0.25rem;
}

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

.layer-item__toggle {
    grid-area: toggle;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0;
    cursor: pointer;
}

.layer-item__actions {
    grid-area: actions;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
}

.layer-3d-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    color: #64748b;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.18s ease, transform 0.18s ease;
}

.layer-legend-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    color: #64748b;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.18s ease, transform 0.18s ease;
}

.layer-legend-toggle.is-active {
    color: #2563eb;
}

.layer-legend-toggle.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.layer-3d-toggle.is-active {
    color: #2563eb;
}

.layer-3d-toggle.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.layer-item__name {
    color: #183153;
    font-size: 0.875rem !important;
    line-height: 1.25;
    line-height: 1.3;
}

.layer-toggle__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.layer-toggle__slider {
    position: relative;
    width: 38px;
    height: 22px;
    flex: 0 0 38px;
    border-radius: 9999px;
    background: #ffffff;
    border: 1px solid #d6dee8;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.layer-toggle__slider::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #64748b;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.layer-toggle__input:checked + .layer-toggle__slider {
    background: #edf4ff;
    border-color: #7ea1f4;
    box-shadow: inset 0 0 0 1px rgba(91, 133, 232, 0.12);
}

.layer-toggle__input:checked + .layer-toggle__slider::after {
    transform: translateX(18px);
    background: #5b85e8;
}

.marker-visibility-toggle {
    position: relative;
    display: inline-flex;
    width: 44px;
    height: 24px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.marker-visibility-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.marker-visibility-toggle__track {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid #b7c3d7;
    background: #e2e8f0;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.marker-visibility-toggle__track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.22);
    transition: transform 0.2s ease;
}

.marker-visibility-toggle input:checked + .marker-visibility-toggle__track {
    background: #7ea4ef;
    border-color: #628ddf;
}

.marker-visibility-toggle input:checked + .marker-visibility-toggle__track::after {
    transform: translateX(20px);
}

.layer-opacity {
    grid-area: opacity;
    width: 100%;
    max-width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
}

.layer-opacity::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 9999px;
    background: linear-gradient(90deg, #e8edf4 0%, #eef2f7 100%);
}

.layer-opacity::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -5px;
    border: 0;
    border-radius: 50%;
    background: #1f6fe5;
    box-shadow: 0 2px 8px rgba(31, 111, 229, 0.35);
}

.layer-opacity::-moz-range-track {
    height: 8px;
    border: 0;
    border-radius: 9999px;
    background: linear-gradient(90deg, #e8edf4 0%, #eef2f7 100%);
}

.layer-opacity::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 50%;
    background: #1f6fe5;
    box-shadow: 0 2px 8px rgba(31, 111, 229, 0.35);
}

.compare-layers-list {
    display: grid;
    gap: 0.85rem;
    max-height: 19rem;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.compare-layers-group {
    border: 1px solid var(--app-card-border);
    border-radius: 1rem;
    background: var(--app-panel);
    overflow: hidden;
}

.compare-layers-group__title {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--app-line);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--app-text-soft);
    background: color-mix(in srgb, var(--app-panel) 82%, var(--app-accent) 18%);
}

.compare-layer-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem 1rem;
    font-size: 0.94rem;
    color: var(--app-text);
    cursor: pointer;
    border-bottom: 1px solid var(--app-line);
}

/* Theme consistency for panel cards across tabs */
.tool-panel__section[data-panel-content="comparacao"] .rounded-3xl,
.tool-panel__section[data-panel-content="cartografia"] .rounded-3xl,
.tool-panel__section[data-panel-content="externas"] .rounded-3xl,
.tool-panel__section[data-panel-content="buffer"] .rounded-3xl,
.tool-panel__section[data-panel-content="impressao"] .rounded-3xl,
.tool-panel__section[data-panel-content="anexos"] .rounded-3xl,
.tool-panel__section[data-panel-content="consulta"] .rounded-3xl,
.tool-panel__section[data-panel-content="medicao"] .rounded-3xl,
.tool-panel__section[data-panel-content="perfil"] .rounded-3xl,
.tool-panel__section[data-panel-content="rotacao"] .rounded-3xl {
    background: var(--app-panel) !important;
    border-color: var(--app-card-border) !important;
    color: var(--app-text);
}

.tool-panel__section[data-panel-content="comparacao"] .text-slate-800,
.tool-panel__section[data-panel-content="cartografia"] .text-slate-800,
.tool-panel__section[data-panel-content="externas"] .text-slate-800,
.tool-panel__section[data-panel-content="buffer"] .text-slate-800,
.tool-panel__section[data-panel-content="impressao"] .text-slate-800,
.tool-panel__section[data-panel-content="anexos"] .text-slate-800,
.tool-panel__section[data-panel-content="consulta"] .text-slate-800,
.tool-panel__section[data-panel-content="medicao"] .text-slate-800,
.tool-panel__section[data-panel-content="perfil"] .text-slate-800,
.tool-panel__section[data-panel-content="rotacao"] .text-slate-800 {
    color: var(--app-text) !important;
}

.tool-panel__section[data-panel-content="comparacao"] .text-slate-500,
.tool-panel__section[data-panel-content="cartografia"] .text-slate-500,
.tool-panel__section[data-panel-content="externas"] .text-slate-500,
.tool-panel__section[data-panel-content="buffer"] .text-slate-500,
.tool-panel__section[data-panel-content="impressao"] .text-slate-500,
.tool-panel__section[data-panel-content="anexos"] .text-slate-500,
.tool-panel__section[data-panel-content="consulta"] .text-slate-500,
.tool-panel__section[data-panel-content="medicao"] .text-slate-500,
.tool-panel__section[data-panel-content="perfil"] .text-slate-500,
.tool-panel__section[data-panel-content="rotacao"] .text-slate-500,
.tool-panel__section[data-panel-content="comparacao"] .text-slate-600,
.tool-panel__section[data-panel-content="cartografia"] .text-slate-600,
.tool-panel__section[data-panel-content="externas"] .text-slate-600,
.tool-panel__section[data-panel-content="buffer"] .text-slate-600,
.tool-panel__section[data-panel-content="impressao"] .text-slate-600,
.tool-panel__section[data-panel-content="anexos"] .text-slate-600,
.tool-panel__section[data-panel-content="consulta"] .text-slate-600,
.tool-panel__section[data-panel-content="medicao"] .text-slate-600,
.tool-panel__section[data-panel-content="perfil"] .text-slate-600,
.tool-panel__section[data-panel-content="rotacao"] .text-slate-600 {
    color: var(--app-text-soft) !important;
}

/* Medição / Perfil / Rotação: remover degradê azul e manter padrão cinza */
.tool-panel__section[data-panel-content="medicao"] .measure-card,
.tool-panel__section[data-panel-content="perfil"] .profile-card,
.tool-panel__section[data-panel-content="rotacao"] .rotation-card {
    background: linear-gradient(180deg, #f7f8fa 0%, #eef2f5 100%) !important;
    border-color: var(--app-card-border) !important;
}

.tool-panel__section[data-panel-content="medicao"] .measure-hint,
.tool-panel__section[data-panel-content="perfil"] .measure-hint,
.tool-panel__section[data-panel-content="rotacao"] .measure-hint {
    background: #eef2f5 !important;
    color: #475569 !important;
    border: 1px solid var(--app-card-border) !important;
}

/* Padronização: ícones em preto nos painéis laterais */
.tool-panel__section i.bi,
.tool-panel__section .measure-card__header i,
.tool-panel__section .profile-card__header i,
.tool-panel__section .rotation-card__header i {
    color: var(--app-text) !important;
}

/* Em botões/abas, o ícone deve seguir a cor do texto do próprio botão */
.tool-panel__section button i.bi,
.tool-panel__section [role="button"] i.bi {
    color: currentColor !important;
}

.tools-tabs {
    margin: 0 0 1rem;
    padding: .45rem;
    border: 1px solid var(--app-card-border);
    border-radius: 1rem;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.tools-tabs__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
}

.tools-tabs__button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: .55rem;
    min-height: 3rem;
    width: 100%;
    padding: .7rem .8rem;
    border: 1px solid transparent;
    border-radius: .85rem;
    color: var(--app-text-soft);
    background: rgba(255, 255, 255, .54);
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: left;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.tools-tabs__button i {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: .7rem;
    background: rgba(15, 23, 42, .07);
    font-size: 1rem;
}

.tools-tabs__button span {
    min-width: 0;
    white-space: normal;
}

.tools-tabs__button:hover,
.tools-tabs__button:focus-visible {
    color: var(--app-text);
    background: #fff;
    border-color: rgba(148, 163, 184, .5);
    box-shadow: 0 .6rem 1.2rem rgba(15, 23, 42, .08);
}

.tools-tabs__button.is-active {
    color: #fff;
    background: linear-gradient(135deg, #08142f 0%, #0f234d 100%);
    border-color: rgba(15, 23, 42, .9);
    box-shadow: 0 .75rem 1.4rem rgba(8, 20, 47, .22);
}

.tools-tabs__button.is-active i {
    background: rgba(255, 255, 255, .16);
}

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

.compare-layer-item input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--app-primary);
}

.compare-layer-item--disabled {
    cursor: not-allowed;
}

.feature-placeholder {
    min-height: 180px;
    border: 1px dashed var(--app-line);
    border-radius: 1rem;
    background: linear-gradient(180deg, #fbfdff 0%, #f1f7fc 100%);
    display: grid;
    place-items: center;
    text-align: center;
    color: #627995;
    padding: 1.5rem;
    gap: 0.75rem;
}

.feature-placeholder i {
    font-size: 2rem;
    color: var(--app-primary);
}

.measure-card {
    border: 1px solid var(--app-card-border);
    border-radius: 1rem;
    background: linear-gradient(180deg, #fcfdff 0%, #f5f9ff 100%);
    padding: 1.1rem;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

/* Unified panel style (reference: Ferramentas) */
.tool-panel__section .panel-scroll > h2,
.tool-panel__section .panel-scroll > h1 {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.tool-panel__section .panel-scroll > p {
    color: var(--app-text-soft) !important;
}

.tool-panel__section .rounded-3xl {
    border: 1px solid var(--app-card-border) !important;
    border-radius: 1rem !important;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--app-panel) 96%, #ffffff 4%) 0%,
        color-mix(in srgb, var(--app-panel) 90%, var(--app-accent) 10%) 100%
    ) !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.tool-panel__section .rounded-2xl {
    border-color: var(--app-card-border) !important;
}

.tool-panel__section .text-slate-700 {
    color: var(--app-text) !important;
}

.tool-panel__section .text-slate-500,
.tool-panel__section .text-slate-600 {
    color: var(--app-text-soft) !important;
}

/* Print tab: checkbox layout fix */
.tool-panel__section[data-panel-content="impressao"] #printIncludeLegend,
.tool-panel__section[data-panel-content="impressao"] #printIncludeOrientation,
.tool-panel__section[data-panel-content="impressao"] #printIncludeStamp,
.tool-panel__section[data-panel-content="impressao"] #printIncludeScale {
    flex: 0 0 auto;
    margin-top: 0.1rem;
}

.tool-panel__section[data-panel-content="impressao"] #printIncludeLegend,
.tool-panel__section[data-panel-content="impressao"] #printIncludeOrientation,
.tool-panel__section[data-panel-content="impressao"] #printIncludeStamp,
.tool-panel__section[data-panel-content="impressao"] #printIncludeScale {
    width: 1rem;
    height: 1rem;
}

.tool-panel__section[data-panel-content="impressao"] #printIncludeLegend,
.tool-panel__section[data-panel-content="impressao"] #printIncludeOrientation,
.tool-panel__section[data-panel-content="impressao"] #printIncludeStamp,
.tool-panel__section[data-panel-content="impressao"] #printIncludeScale {
    accent-color: var(--app-primary);
}

.tool-panel__section[data-panel-content="impressao"] #printIncludeLegend,
.tool-panel__section[data-panel-content="impressao"] #printIncludeOrientation,
.tool-panel__section[data-panel-content="impressao"] #printIncludeStamp,
.tool-panel__section[data-panel-content="impressao"] #printIncludeScale {
    position: relative;
    z-index: 1;
}

.tool-panel__section[data-panel-content="impressao"] #printIncludeLegend,
.tool-panel__section[data-panel-content="impressao"] #printIncludeOrientation,
.tool-panel__section[data-panel-content="impressao"] #printIncludeStamp,
.tool-panel__section[data-panel-content="impressao"] #printIncludeScale {
    display: inline-block;
}

.tool-panel__section[data-panel-content="impressao"] #printIncludeLegend,
.tool-panel__section[data-panel-content="impressao"] #printIncludeOrientation,
.tool-panel__section[data-panel-content="impressao"] #printIncludeStamp,
.tool-panel__section[data-panel-content="impressao"] #printIncludeScale {
    min-width: 1rem;
}

.tool-panel__section[data-panel-content="impressao"] label:has(#printIncludeLegend),
.tool-panel__section[data-panel-content="impressao"] label:has(#printIncludeOrientation),
.tool-panel__section[data-panel-content="impressao"] label:has(#printIncludeStamp),
.tool-panel__section[data-panel-content="impressao"] label:has(#printIncludeScale) {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.55rem !important;
    min-height: 64px;
    padding: 0.75rem 0.85rem !important;
    line-height: 1.3;
}

.tool-panel__section[data-panel-content="impressao"] label:has(#printIncludeLegend) span,
.tool-panel__section[data-panel-content="impressao"] label:has(#printIncludeOrientation) span,
.tool-panel__section[data-panel-content="impressao"] label:has(#printIncludeStamp) span,
.tool-panel__section[data-panel-content="impressao"] label:has(#printIncludeScale) span {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: anywhere;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    display: block;
}

.tool-panel__section[data-panel-content="impressao"] .print-check-option {
    display: flex !important;
    align-items: center !important;
    gap: 0.6rem !important;
    min-height: 0 !important;
    height: auto !important;
}

.tool-panel__section[data-panel-content="impressao"] .print-check-option span {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    white-space: normal !important;
    word-break: normal !important;
    line-height: 1.25 !important;
}

.tool-panel__section select,
.tool-panel__section input[type="text"],
.tool-panel__section input[type="number"],
.tool-panel__section input[type="date"],
.tool-panel__section input[type="url"],
.tool-panel__section textarea {
    border-color: var(--app-card-border) !important;
    background: var(--app-panel) !important;
    color: var(--app-text) !important;
}

/* Cartografia: alinhar visual com a aba Ferramentas */
.tool-panel__section[data-panel-content="cartografia"] .panel-scroll > p {
    margin-bottom: 1rem !important;
}

.tool-panel__section[data-panel-content="cartografia"] section:first-of-type {
    background: linear-gradient(180deg, #f7f8fa 0%, #eef2f5 100%) !important;
    padding: 1.1rem !important;
}

.tool-panel__section[data-panel-content="cartografia"] #btnCartographyLoad {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    border: 1px solid #cfe0fb !important;
    border-radius: 0.9rem !important;
    background: #ffffff !important;
    color: #19406f !important;
    padding: 0.8rem 1rem !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tool-panel__section[data-panel-content="cartografia"] #btnCartographyLoad:hover,
.tool-panel__section[data-panel-content="cartografia"] #btnCartographyLoad:focus-visible {
    background: #eff5ff !important;
    border-color: #7ea1f4 !important;
    color: #0b5ed7 !important;
    outline: none;
    transform: translateY(-1px);
}

/* Perfil altimétrico: resultados exibidos no drawer */
#profilePanelChartWrap,
#profilePanelMetrics,
#profilePanelLegend {
    display: none !important;
}

/* Fontes externas: mesmo padrão visual da aba Ferramentas */
.tool-panel__section[data-panel-content="externas"] section.rounded-3xl {
    background: linear-gradient(180deg, #f7f8fa 0%, #eef2f5 100%) !important;
    border: 1px solid var(--app-card-border) !important;
    border-radius: 1rem !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.tool-panel__section[data-panel-content="externas"] section.rounded-3xl h3 {
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #173761 !important;
    line-height: 1.3;
}

.tool-panel__section[data-panel-content="externas"] section.rounded-3xl .bi {
    color: #2563eb !important;
}

/* Filtro dinamico */
#dynamicFilterPanel {
    overflow-x: hidden;
}

#dynamicFilterPanel .rounded-xl,
#dynamicFilterPanel .rounded-2xl {
    max-width: 100%;
}

.dynamic-filter-condition-row {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    border: 1px solid var(--app-card-border);
    border-radius: 0.85rem;
    background: #f8fafc;
    padding: 0.65rem;
    min-width: 0;
}

.dynamic-filter-condition-row > div {
    min-width: 0;
    width: 100%;
}

.dynamic-filter-condition-row select,
.dynamic-filter-condition-row input[type="text"] {
    width: 100%;
    min-width: 0;
}

.dynamic-filter-condition-row > div:last-child {
    display: flex;
    justify-content: flex-end;
}

.smart-review-fields .smart-review-field {
    display: flex;
    flex-direction: column;
}

.smart-review-fields .smart-review-field > span {
    min-height: 2.6rem;
    display: block;
}

.smart-review-fields .smart-review-field > input {
    margin-top: auto;
}

.smart-review-info-panel {
    max-width: min(980px, 96vw);
}

.smart-review-info-body {
    line-height: 1.6;
}

.smart-review-info-body p {
    margin-bottom: 0.75rem;
}

.smart-review-info-body ul,
.smart-review-info-body ol {
    margin: 0 0 0.9rem 1.1rem;
}

.measure-card__header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
    color: #173761;
    font-size: 1rem;
    font-weight: 600;
}

.measure-card__header i {
    color: #2563eb;
    font-size: 1.15rem;
}

.measure-actions {
    display: grid;
    gap: 0.7rem;
}

.measure-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    border: 1px solid #cfe0fb;
    border-radius: 0.9rem;
    background: #ffffff;
    color: #19406f;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.measure-button:hover,
.measure-button:focus-visible {
    background: #eff5ff;
    border-color: #7ea1f4;
    color: #0b5ed7;
    outline: none;
    transform: translateY(-1px);
}

.measure-button.is-active {
    background: linear-gradient(180deg, #edf4ff 0%, #dbeafe 100%);
    border-color: #7ea1f4;
    color: #0b5ed7;
}

.measure-button--ghost {
    border-color: #d7e0ea;
    color: #475569;
}

.measure-status {
    margin-top: 1rem;
    border: 1px solid #dbe5f0;
    border-radius: 0.9rem;
    background: #ffffff;
    overflow: hidden;
}

.measure-status__row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
}

.measure-status__row + .measure-status__row {
    border-top: 1px solid #edf2f7;
}

.measure-status__label {
    color: #64748b;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.cartography-status--processing {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.cartography-status__spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 9999px;
    animation: cartography-status-spin 0.8s linear infinite;
    flex: 0 0 auto;
    opacity: 0.8;
}

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

.measure-hint {
    margin-top: 1rem;
    border-radius: 0.9rem;
    background: #eef4ff;
    color: #33537d;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.profile-card {
    border: 1px solid var(--app-card-border);
    border-radius: 1rem;
    background: linear-gradient(180deg, #fcfdff 0%, #f6faff 100%);
    padding: 1.1rem;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.profile-card__header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
    color: #173761;
    font-size: 1rem;
    font-weight: 600;
}

.profile-card__header i {
    color: #2563eb;
    font-size: 1.15rem;
}

.profile-toolbar {
    display: grid;
    gap: 0.7rem;
}

.profile-toolbar--compact {
    grid-template-columns: 1fr 1fr;
    margin-top: 0.9rem;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: #475569;
    font-size: 0.84rem;
    font-weight: 500;
}

.profile-select {
    width: 100%;
    border: 1px solid #d1dbe8;
    border-radius: 0.85rem;
    background: #ffffff;
    color: #1e293b;
    padding: 0.7rem 0.8rem;
    font-size: 0.92rem;
    outline: none;
}

.profile-select:focus {
    border-color: #7ea1f4;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.profile-chart-wrap {
    margin-top: 1rem;
    border: 1px solid #dbe5f0;
    border-radius: 1rem;
    background: #ffffff;
    padding: 0.75rem;
}

.profile-chart {
    width: 100%;
    height: 260px;
    display: block;
}

.profile-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.profile-metric {
    border: 1px solid #dbe5f0;
    border-radius: 0.95rem;
    background: #fafcff;
    padding: 0.85rem 0.9rem;
}

.profile-metric__label {
    display: block;
    margin-bottom: 0.35rem;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.profile-metric__value {
    color: #0f172a;
    font-size: 1.1rem;
    font-weight: 700;
}

.profile-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.9rem;
    color: #475569;
    font-size: 0.9rem;
}

.profile-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.profile-legend__line {
    display: inline-block;
    width: 22px;
    height: 3px;
    border-radius: 9999px;
}

.profile-legend__line--terrain {
    background: #16a34a;
}

.profile-legend__line--surface {
    background: #2563eb;
}

.rotation-card {
    border: 1px solid var(--app-card-border);
    border-radius: 1rem;
    background: linear-gradient(180deg, #fcfdff 0%, #f6faff 100%);
    padding: 1.1rem;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.rotation-card__header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
    color: #173761;
    font-size: 1rem;
    font-weight: 600;
}

.rotation-card__header i {
    color: #2563eb;
    font-size: 1.15rem;
}

.rotation-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.7rem;
}

.rotation-actions .measure-button {
    min-height: 58px;
    padding: 0.8rem;
    font-size: 1.15rem;
}

.rotation-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.rotation-metric {
    border: 1px solid #dbe5f0;
    border-radius: 0.95rem;
    background: #fafcff;
    padding: 0.85rem 0.9rem;
}

.rotation-metric__label {
    display: block;
    margin-bottom: 0.35rem;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.rotation-metric__value {
    color: #0f172a;
    font-size: 1.1rem;
    font-weight: 700;
}

.rotation-metric__value--small {
    font-size: 0.95rem;
    line-height: 1.5;
}

.rotation-kbd {
    display: inline-block;
    min-width: 24px;
    padding: 2px 6px;
    border: 1px solid #d1d5db;
    border-bottom-width: 2px;
    border-radius: 6px;
    background: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    color: #334155;
}

.rotation-compass-panel {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.rotation-compass-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.rotation-compass-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #dbe5f0;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    padding: 12px;
    backdrop-filter: blur(6px);
    user-select: none;
}

.rotation-compass {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at center, #ffffff 0%, #f8fafc 56%, #eef2f7 100%);
    border: 2px solid #dbe2ea;
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rotation-compass:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.rotation-compass.is-dragging {
    cursor: grabbing;
    transform: scale(1.04);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14);
}

.rotation-compass__ring {
    position: absolute;
    inset: 8px;
    border: 1px dashed #cbd5e1;
    border-radius: 50%;
}

.rotation-compass__cross-v,
.rotation-compass__cross-h {
    position: absolute;
    background: #d1d5db;
}

.rotation-compass__cross-v {
    width: 2px;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.rotation-compass__cross-h {
    height: 2px;
    width: 100%;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.rotation-compass__label {
    position: absolute;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.5px;
}

.rotation-compass__label--n {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.rotation-compass__label--s {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.rotation-compass__label--e {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.rotation-compass__label--w {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.rotation-compass__needle-wrap {
    position: absolute;
    inset: 0;
    transition: transform 0.12s linear;
}

.rotation-compass__needle-north {
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-bottom: 34px solid #dc2626;
    filter: drop-shadow(0 3px 4px rgba(220, 38, 38, 0.18));
}

.rotation-compass__needle-south {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-top: 34px solid #1e293b;
    filter: drop-shadow(0 3px 4px rgba(15, 23, 42, 0.12));
}

.rotation-compass__center {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 14px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #111827;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 1px #d1d5db;
}

.rotation-compass__help {
    max-width: 180px;
    text-align: center;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
    margin-top: 8px;
}

.ol-popup {
    min-width: 220px;
}

.measure-tooltip {
    position: relative;
    border-radius: 9999px;
    background: rgba(11, 94, 215, 0.92);
    color: #ffffff;
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(11, 94, 215, 0.28);
}

.measure-tooltip--area {
    border-radius: 0.75rem;
}

.measure-tooltip--edge {
    background: rgba(15, 23, 42, 0.9);
    padding: 0.25rem 0.55rem;
    font-size: 0.76rem;
}

.measure-tooltip__stack {
    display: grid;
    gap: 0.15rem;
    white-space: normal;
    min-width: 150px;
}

.measure-tooltip__stack strong {
    display: inline-block;
    margin-right: 0.2rem;
}

.app-popup {
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(8, 59, 136, 0.08);
}

.app-hover-tooltip {
    min-width: 160px;
    max-width: 240px;
    border-radius: 0.9rem;
    background: rgba(15, 23, 42, 0.94);
    color: #ffffff;
    padding: 0.55rem 0.75rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
}

.app-hover-tooltip__title {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
}

.app-hover-tooltip__meta {
    margin-top: 0.18rem;
    font-size: 0.72rem;
    color: rgba(226, 232, 240, 0.82);
    white-space: pre-line;
}

.app-feature-popup {
    min-width: 260px;
    max-width: 360px;
}

.app-feature-popup__header {
    display: grid;
    gap: 0.2rem;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.9rem 1rem 0.75rem;
}

.app-feature-popup__header strong {
    font-size: 0.92rem;
    color: #0f172a;
}

.app-feature-popup__header span {
    font-size: 0.75rem;
    color: #64748b;
}

.app-feature-popup__body {
    display: grid;
    gap: 0.55rem;
    max-height: 280px;
    overflow-y: auto;
    padding: 0.9rem 1rem 1rem;
}

.app-feature-popup__row {
    display: grid;
    gap: 0.18rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid #f1f5f9;
}

.app-feature-popup__row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.app-feature-popup__key {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.app-feature-popup__value {
    font-size: 0.82rem;
    line-height: 1.45;
    color: #1e293b;
    word-break: break-word;
}

.app-feature-popup__empty {
    font-size: 0.82rem;
    color: #64748b;
}

.feature-drawer {
    position: absolute;
    inset: 0;
    z-index: 14;
    pointer-events: none;
}

.feature-drawer.hidden {
    display: none;
}

.feature-drawer__backdrop {
    position: absolute;
    inset: 0;
    display: none;
}

.feature-drawer__shell {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: flex-end;
    padding-left: 2.5rem;
    pointer-events: none;
    overflow: hidden;
}

.feature-drawer__panel {
    position: relative;
    width: min(100%, 28rem);
    height: 100%;
    background: #ffffff;
    box-shadow: -18px 0 40px rgba(15, 23, 42, 0.22);
    transform: translateX(100%);
    transition: transform 0.45s ease;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.feature-drawer__panel.feature-drawer__panel--wide {
    width: min(100%, 38rem);
}

.feature-drawer.is-open .feature-drawer__backdrop {
    opacity: 1;
}

.feature-drawer.is-open .feature-drawer__panel {
    transform: translateX(0);
}

.feature-drawer__close-wrap {
    position: absolute;
    top: 0;
    left: 0;
    margin-left: -3rem;
    display: flex;
    padding-top: 1rem;
    padding-right: 0.5rem;
    transition: opacity 0.3s ease;
}

.feature-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    backdrop-filter: blur(10px);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.feature-drawer__close:hover,
.feature-drawer__close:focus-visible {
    background: rgba(255, 255, 255, 0.24);
    transform: scale(1.03);
    outline: none;
}

.feature-drawer__content {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    background: #ffffff;
}

.feature-drawer__header {
    padding: 1.4rem 1.25rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
}

.feature-drawer__header-main {
    min-width: 0;
    display: grid;
    gap: 0.3rem;
}

.feature-drawer__header-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-shrink: 0;
}

.feature-drawer__header-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid #dbe5f0;
    border-radius: 0.75rem;
    background: #f8fafc;
    color: #475569;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.feature-drawer__header-close:hover,
.feature-drawer__header-close:focus-visible {
    border-color: #94a3b8;
    background: #e2e8f0;
    color: #0f172a;
    transform: scale(1.03);
    outline: none;
}

.feature-drawer__title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.feature-drawer__subtitle {
    font-size: 0.82rem;
    line-height: 1.45;
    color: #64748b;
}

.feature-drawer__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem 1.25rem 1.25rem;
}

.feature-drawer__body .app-feature-popup {
    min-width: 0;
    max-width: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.feature-drawer__body .app-feature-popup__header {
    padding: 0 0 0.9rem;
}

.feature-drawer__body .app-feature-popup__body {
    max-height: none;
    padding: 0;
}

.status-badge {
    display: inline-flex;
    margin-left: 0.5rem;
    border-radius: 9999px;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge--neutral {
    background: #e2e8f0;
    color: #334155;
}

.status-badge--success {
    background: #d1fae5;
    color: #047857;
}

.status-badge--error {
    background: #ffe4e6;
    color: #be123c;
}

.map-stage > div {
    height: 100%;
}

.app-map-scale {
    left: 1rem !important;
    bottom: 1rem !important;
    top: auto !important;
    background: rgba(255, 255, 255, 0.94) !important;
    border-radius: 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
    padding: 0.22rem 0.48rem;
    backdrop-filter: blur(6px);
}

.app-map-scale .ol-scale-line-inner {
    border-color: #1e293b !important;
    color: #0f172a !important;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.01em;
    border-top: 0 !important;
}

.app-map-elevation {
    position: absolute;
    left: 11.2rem;
    bottom: 1rem;
    z-index: 13;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
    padding: 0.35rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
    pointer-events: none;
}

.swipe-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 18px;
    margin-left: -9px;
    background: transparent;
    cursor: ew-resize;
    touch-action: none;
    z-index: 8;
}

.swipe-divider::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 0 0 1px rgba(8, 59, 136, 0.22);
}

.swipe-divider::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 24px;
    height: 24px;
    border-radius: 9999px;
    border: 2px solid rgba(255, 255, 255, 0.96);
    background: rgba(8, 59, 136, 0.88);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
    transform: translate(-50%, -50%);
}

.swipe-divider.is-dragging::after,
.swipe-divider.is-active:hover::after {
    background: rgba(11, 94, 215, 0.96);
}

body[data-theme="dark"] .swipe-divider::before {
    background: rgba(226, 232, 240, 0.96);
    box-shadow: 0 0 0 1px rgba(79, 141, 247, 0.3);
}

body[data-theme="dark"] .swipe-divider::after {
    border-color: rgba(226, 232, 240, 0.96);
    background: rgba(32, 75, 144, 0.92);
}

body[data-theme="dark"] .app-shell {
    color: var(--app-text);
}

body[data-theme="dark"] .tool-sidebar,
body[data-theme="dark"] .tool-panel {
    border-color: var(--app-card-border) !important;
    background: var(--app-panel) !important;
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.28);
}

body[data-theme="dark"] .map-container {
    background: var(--app-map-bg);
}

body[data-theme="dark"] .streetview-hint {
    background: rgba(24, 35, 47, 0.96);
    color: var(--app-text);
}

body[data-theme="dark"] .basemap-toggle {
    border-color: rgba(159, 176, 197, 0.18);
    background: rgba(24, 35, 47, 0.94);
    box-shadow: 0 16px 30px rgba(2, 6, 23, 0.26);
}

body[data-theme="dark"] .locate-user-button {
    border-color: rgba(159, 176, 197, 0.18);
    background: rgba(24, 35, 47, 0.94);
    color: var(--app-text);
    box-shadow: 0 16px 30px rgba(2, 6, 23, 0.26);
}

body[data-theme="dark"] .photo360-toggle {
    border-color: rgba(159, 176, 197, 0.18);
    background: rgba(24, 35, 47, 0.94);
    color: var(--app-text);
    box-shadow: 0 16px 30px rgba(2, 6, 23, 0.26);
}

body[data-theme="dark"] .streetview-control__button {
    border-color: rgba(159, 176, 197, 0.18);
    background: rgba(24, 35, 47, 0.94);
    color: var(--app-text);
    box-shadow: 0 16px 30px rgba(2, 6, 23, 0.26);
}

body[data-theme="dark"] .streetview-control__button.is-active {
    background: #2563eb;
    color: #ffffff;
}

body[data-theme="dark"] .photo360-toggle.is-active {
    background: #2563eb;
    color: #ffffff;
}

body[data-theme="dark"] .photo360-modal__dialog {
    background: #18232f;
}

body[data-theme="dark"] .photo360-modal__header {
    border-bottom-color: var(--app-card-border);
}

body[data-theme="dark"] .photo360-modal__title {
    color: var(--app-text);
}

body[data-theme="dark"] .photo360-modal__subtitle {
    color: var(--app-text-soft);
}

body[data-theme="dark"] .photo360-modal__thumb {
    border-color: rgba(159, 176, 197, 0.14);
    background: #223244;
}

body[data-theme="dark"] .photo360-modal__meta-chip {
    border-color: var(--app-card-border);
    background: #223244;
    color: var(--app-text-soft);
}

body[data-theme="dark"] .photo360-modal__close {
    border-color: var(--app-card-border);
    background: #223244;
    color: var(--app-text);
}

body[data-theme="dark"] .basemap-toggle__preview {
    border-color: rgba(159, 176, 197, 0.14);
}

body[data-theme="dark"] .basemap-toggle__text strong {
    color: var(--app-text);
}

body[data-theme="dark"] .basemap-toggle__text small {
    color: var(--app-text-soft);
}

body[data-theme="dark"] .streetview-drawer__panel,
body[data-theme="dark"] .streetview-drawer__content {
    background: #18232f;
    box-shadow: -18px 0 40px rgba(2, 6, 23, 0.36);
}

body[data-theme="dark"] .streetview-drawer__header {
    border-bottom-color: var(--app-card-border);
}

body[data-theme="dark"] .streetview-drawer__title {
    color: var(--app-text);
}

body[data-theme="dark"] .streetview-drawer__subtitle {
    color: var(--app-text-soft);
}

body[data-theme="dark"] .streetview-message {
    border-color: var(--app-card-border);
    background: #1b2835;
    color: var(--app-text-soft);
}

body[data-theme="dark"] .streetview-message--error {
    border-color: rgba(244, 63, 94, 0.24);
    background: rgba(127, 29, 29, 0.22);
    color: #fda4af;
}

body[data-theme="dark"] .streetview-message--success {
    border-color: rgba(59, 130, 246, 0.24);
    background: rgba(30, 64, 175, 0.2);
    color: #bfdbfe;
}

body[data-theme="dark"] .streetview-panorama {
    border-color: var(--app-card-border);
}

body[data-theme="gray"] .streetview-hint,
body[data-theme="gray"] .streetview-drawer__panel,
body[data-theme="gray"] .streetview-drawer__content {
    background: #f7f8fa;
}

body[data-theme="gray"] .basemap-toggle {
    background: rgba(247, 248, 250, 0.96);
    border-color: rgba(107, 114, 128, 0.12);
}

body[data-theme="gray"] .locate-user-button {
    background: rgba(247, 248, 250, 0.96);
    border-color: rgba(107, 114, 128, 0.12);
}

body[data-theme="gray"] .photo360-toggle {
    background: rgba(247, 248, 250, 0.96);
    border-color: rgba(107, 114, 128, 0.12);
}

body[data-theme="gray"] .streetview-control__button {
    background: rgba(247, 248, 250, 0.96);
    border-color: rgba(107, 114, 128, 0.12);
}

body[data-theme="gray"] .photo360-modal__dialog {
    background: #f7f8fa;
}

body[data-theme="gray"] .streetview-drawer__header,
body[data-theme="gray"] .streetview-message,
body[data-theme="gray"] .streetview-panorama {
    border-color: #d7dee6;
}

body[data-theme="dark"] .panel-scroll__header {
    border-bottom-color: var(--app-card-border);
    background: var(--app-panel);
}

body[data-theme="dark"] .tool-panel .text-slate-800,
body[data-theme="dark"] .tool-panel .text-slate-700,
body[data-theme="dark"] .tool-panel .text-slate-600 {
    color: var(--app-text) !important;
}

body[data-theme="dark"] .tool-panel .text-slate-500,
body[data-theme="dark"] .tool-panel .text-slate-400 {
    color: var(--app-text-soft) !important;
}

body[data-theme="dark"] .tool-panel .border-slate-200,
body[data-theme="dark"] .tool-panel .border-slate-300,
body[data-theme="dark"] .tool-panel .border-slate-100 {
    border-color: var(--app-card-border) !important;
}

body[data-theme="dark"] .tool-panel .bg-white,
body[data-theme="dark"] .tool-panel .bg-slate-50,
body[data-theme="dark"] .tool-panel .bg-slate-100 {
    background: #1b2835 !important;
}

body[data-theme="dark"] .tool-sidebar__brand {
    border-bottom-color: var(--app-card-border);
}

body[data-theme="dark"] .tool-sidebar__crest {
    background: linear-gradient(180deg, #31465f 0%, #223244 100%);
    color: #dce8f8;
    box-shadow: inset 0 0 0 1px rgba(159, 176, 197, 0.18);
}

body[data-theme="dark"] .tool-button:hover,
body[data-theme="dark"] .tool-button:focus-visible {
    background: #223244;
    color: #dce8f8;
}

body[data-theme="dark"] .tool-button.is-active {
    background: linear-gradient(180deg, #31465f 0%, #223244 100%);
    color: #f8fbff;
    box-shadow: inset 0 0 0 1px rgba(159, 176, 197, 0.2);
}

body[data-theme="dark"] .layer-groups {
    background: linear-gradient(180deg, #17222d 0%, #13202b 100%);
}

body[data-theme="dark"] .layer-group {
    border-color: var(--app-card-border);
    background: #1a2734;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.2);
}

body[data-theme="dark"] .layer-group__header,
body[data-theme="dark"] .layer-group__content {
    background: #1a2734;
}

body[data-theme="dark"] .layer-group__header {
    color: #dce8f8;
}

body[data-theme="dark"] .layer-group.is-open .layer-group__header {
    background: #243445;
    color: #78a7ff;
}

body[data-theme="dark"] .layer-group__chevron,
body[data-theme="dark"] .layer-item__name {
    color: #d6e2f1;
}

body[data-theme="dark"] .layer-item {
    border-bottom-color: rgba(159, 176, 197, 0.16);
}

body[data-theme="dark"] .compare-layers-group {
    border-color: var(--app-card-border);
    background: #1a2734;
}

body[data-theme="dark"] .compare-layers-group__title {
    border-bottom-color: rgba(159, 176, 197, 0.16);
    background: #223244;
    color: #9fb0c5;
}

body[data-theme="dark"] .compare-layer-item {
    border-bottom-color: rgba(159, 176, 197, 0.16);
    color: #d6e2f1;
}

body[data-theme="dark"] .layer-toggle__slider {
    background: #eef2f7;
    border-color: #4b5d73;
}

body[data-theme="dark"] .layer-toggle__slider::after {
    background: #64748b;
}

body[data-theme="dark"] .layer-toggle__input:checked + .layer-toggle__slider {
    background: #dce9ff;
    border-color: #7ea1f4;
}

body[data-theme="dark"] .layer-toggle__input:checked + .layer-toggle__slider::after {
    background: #4f8df7;
}

body[data-theme="dark"] .layer-opacity::-webkit-slider-runnable-track,
body[data-theme="dark"] .layer-opacity::-moz-range-track {
    background: linear-gradient(90deg, #304356 0%, #3b4e61 100%);
}

body[data-theme="dark"] .feature-placeholder,
body[data-theme="dark"] .measure-card,
body[data-theme="dark"] .profile-card,
body[data-theme="dark"] .rotation-card {
    border-color: var(--app-card-border);
    background: linear-gradient(180deg, #1c2936 0%, #16212c 100%);
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.22);
}

body[data-theme="dark"] .feature-placeholder {
    color: var(--app-text-soft);
}

body[data-theme="dark"] .measure-card__header,
body[data-theme="dark"] .profile-card__header,
body[data-theme="dark"] .rotation-card__header,
body[data-theme="dark"] .measure-status__value,
body[data-theme="dark"] .profile-metric__value,
body[data-theme="dark"] .rotation-metric__value {
    color: var(--app-text);
}

body[data-theme="dark"] .measure-button {
    border-color: #41556a;
    background: #20303f;
    color: #d6e2f1;
}

body[data-theme="dark"] .measure-button:hover,
body[data-theme="dark"] .measure-button:focus-visible {
    background: #26394b;
    border-color: #6f93ce;
    color: #ffffff;
}

body[data-theme="dark"] .measure-button.is-active {
    background: linear-gradient(180deg, #27415d 0%, #1f3550 100%);
    border-color: #79a2ea;
    color: #ffffff;
}

body[data-theme="dark"] .measure-button--ghost {
    border-color: #41556a;
    color: #b8c8da;
}

body[data-theme="dark"] .measure-status,
body[data-theme="dark"] .profile-chart-wrap,
body[data-theme="dark"] .profile-metric,
body[data-theme="dark"] .rotation-metric {
    border-color: var(--app-card-border);
    background: #1b2835;
}

body[data-theme="dark"] .measure-status__row + .measure-status__row,
body[data-theme="dark"] .app-feature-popup__header,
body[data-theme="dark"] .app-feature-popup__row {
    border-top-color: rgba(159, 176, 197, 0.14);
    border-bottom-color: rgba(159, 176, 197, 0.14);
}

body[data-theme="dark"] .measure-status__label,
body[data-theme="dark"] .measure-hint,
body[data-theme="dark"] .profile-field,
body[data-theme="dark"] .profile-legend,
body[data-theme="dark"] .profile-metric__label,
body[data-theme="dark"] .rotation-metric__label,
body[data-theme="dark"] .rotation-compass__help {
    color: var(--app-text-soft);
}

body[data-theme="dark"] .measure-hint {
    background: #223244;
}

body[data-theme="dark"] .profile-select {
    border-color: #41556a;
    background: #20303f;
    color: var(--app-text);
}

body[data-theme="dark"] .profile-select:focus {
    border-color: #79a2ea;
    box-shadow: 0 0 0 3px rgba(79, 141, 247, 0.16);
}

body[data-theme="dark"] .rotation-kbd {
    border-color: #41556a;
    background: #223244;
    color: #dce8f8;
}

body[data-theme="dark"] .rotation-compass-card {
    background: rgba(24, 35, 47, 0.96);
    border-color: var(--app-card-border);
    box-shadow: 0 16px 30px rgba(2, 6, 23, 0.3);
}

body[data-theme="dark"] .rotation-compass {
    background: radial-gradient(circle at center, #26394a 0%, #1b2835 56%, #13202b 100%);
    border-color: #41556a;
}

body[data-theme="dark"] .rotation-compass__ring {
    border-color: #53667c;
}

body[data-theme="dark"] .rotation-compass__cross-v,
body[data-theme="dark"] .rotation-compass__cross-h {
    background: #53667c;
}

body[data-theme="dark"] .rotation-compass__label {
    color: #d6e2f1;
}

body[data-theme="dark"] .rotation-compass__needle-south {
    border-top-color: #d6e2f1;
}

body[data-theme="dark"] .rotation-compass__center {
    background: #d6e2f1;
    border-color: #223244;
    box-shadow: 0 0 0 1px #53667c;
}

body[data-theme="dark"] .app-popup {
    border-color: var(--app-card-border);
    background: #18232f;
    box-shadow: 0 16px 32px rgba(2, 6, 23, 0.3);
}

body[data-theme="dark"] .feature-drawer__backdrop {
    background: rgba(2, 6, 23, 0.42);
}

body[data-theme="dark"] .feature-drawer__panel,
body[data-theme="dark"] .feature-drawer__content {
    background: #18232f;
    box-shadow: -18px 0 40px rgba(2, 6, 23, 0.36);
}

body[data-theme="dark"] .feature-drawer__header {
    border-bottom-color: var(--app-card-border);
}

body[data-theme="dark"] .feature-drawer__title {
    color: var(--app-text);
}

body[data-theme="dark"] .feature-drawer__subtitle {
    color: var(--app-text-soft);
}

body[data-theme="dark"] .feature-drawer__close {
    background: rgba(24, 35, 47, 0.7);
    color: #dce8f8;
}

body[data-theme="dark"] .feature-drawer__header-close {
    border-color: #314559;
    background: #233449;
    color: #dce8f8;
}

body[data-theme="dark"] .feature-drawer__header-close:hover,
body[data-theme="dark"] .feature-drawer__header-close:focus-visible {
    border-color: #53667c;
    background: #314559;
    color: #ffffff;
}

body[data-theme="gray"] .feature-drawer__panel,
body[data-theme="gray"] .feature-drawer__content {
    background: #f7f8fa;
}

body[data-theme="gray"] .feature-drawer__header {
    border-bottom-color: #d7dee6;
}

body[data-theme="dark"] .app-feature-popup__header strong,
body[data-theme="dark"] .app-feature-popup__value {
    color: var(--app-text);
}

body[data-theme="dark"] .app-feature-popup__header span,
body[data-theme="dark"] .app-feature-popup__key,
body[data-theme="dark"] .app-feature-popup__empty {
    color: var(--app-text-soft);
}

body[data-theme="dark"] .status-badge--neutral {
    background: #2b3d50;
    color: #d6e2f1;
}

body[data-theme="dark"] .status-badge--success {
    background: rgba(16, 185, 129, 0.16);
    color: #6ee7b7;
}

body[data-theme="dark"] .status-badge--error {
    background: rgba(244, 63, 94, 0.16);
    color: #fda4af;
}

@media (max-width: 991.98px) {
    html,
    body {
        overflow: auto;
    }

    .app-shell {
        grid-template-columns: 1fr;
        height: auto;
    }

    .tool-sidebar,
    .tool-panel,
    .map-stage {
        min-height: auto;
        height: auto;
    }

    .tool-sidebar {
        flex-direction: row;
        justify-content: space-between;
        padding: 0.5rem 0.75rem;
    }

    .tool-sidebar__brand {
        width: auto;
        padding: 0;
        border-bottom: 0;
    }

    .tool-sidebar__menu {
        width: auto;
        flex-direction: row;
        padding: 0;
    }

    .layer-group__header {
        padding-inline: 1rem;
    }

    .layer-group__content {
        padding-inline: 0.85rem;
    }

    .layer-groups {
        padding: 1.5rem;
    }

    .panel-scroll,
    .panel-scroll__body {
        overflow: visible;
    }

    .profile-toolbar--compact,
    .profile-metrics,
    .rotation-metrics {
        grid-template-columns: 1fr;
    }

    .map-container {
        height: 65vh;
        min-height: 420px;
    }

    .feature-drawer__shell {
        padding-left: 0.75rem;
    }

    .feature-drawer__close-wrap {
        margin-left: -2.65rem;
    }

    .feature-drawer__panel.feature-drawer__panel--wide {
        width: min(100%, 100%);
    }

    .streetview-hint {
        top: 4.75rem;
        right: 1rem;
        max-width: 14rem;
    }

    .streetview-drawer__shell {
        padding-left: 0.75rem;
    }

    .streetview-drawer__close-wrap {
        margin-left: -2.65rem;
    }

    .streetview-drawer__panel {
        width: min(100%, 100%);
    }

    .streetview-panorama {
        min-height: 16rem;
    }

    .basemap-toggle {
        left: 0.75rem;
        bottom: 0.75rem;
        width: 3.25rem;
        height: 3.25rem;
        min-width: 3.25rem;
        padding: 0;
        border-radius: 9999px;
        justify-content: center;
    }

    .locate-user-button {
        left: 0.75rem;
        bottom: 5.4rem;
    }

    .photo360-toggle {
        left: 0.75rem;
        bottom: 10.05rem;
    }

    .photo360-modal__dialog {
        width: 100%;
        height: 100%;
        border-radius: 1rem;
    }

    .photo360-modal__header-main {
        gap: 0.8rem;
    }

    .photo360-modal__thumb {
        width: 4.5rem;
        height: 4.5rem;
        flex-basis: 4.5rem;
    }
}
.search-cadastro-fields {
    grid-template-columns: minmax(0, 1fr);
}

.search-cadastro-form label > span {
    color: var(--app-text);
    font-size: .78rem;
    letter-spacing: .01em;
}

.search-cadastro-form input {
    min-height: 2.75rem;
}

.search-cadastro-results-head {
    background: linear-gradient(180deg, rgba(248,250,252,.9), rgba(255,255,255,.7));
}

@media (min-width: 1180px) {
    .search-cadastro-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
