.trmx-portal-shell {
    position: relative;
    width: 100%;
}

.trmx-portal-access-shell {
    width: 100%;
}

.trmx-portal-shell:fullscreen,
.trmx-portal-shell.is-fullscreen {
    width: 100%;
    height: 100%;
    background: #09131c;
}

.trmx-portal-shell:fullscreen .trmx-portal-layout,
.trmx-portal-shell.is-fullscreen .trmx-portal-layout {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
}

.trmx-portal-shell:fullscreen .trmx-portal-column--map,
.trmx-portal-shell.is-fullscreen .trmx-portal-column--map {
    width: 100%;
    height: 100%;
}

.trmx-portal-shell:fullscreen .trmx-portal-column--list,
.trmx-portal-shell.is-fullscreen .trmx-portal-column--list {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 8;
    width: min(360px, calc(100vw - 36px));
    max-width: calc(100vw - 36px);
}

.trmx-portal-shell:fullscreen .trmx-list-panel,
.trmx-portal-shell.is-fullscreen .trmx-list-panel {
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
}

.trmx-portal-shell:fullscreen .trmx-list-scroll,
.trmx-portal-shell.is-fullscreen .trmx-list-scroll {
    max-height: calc(100vh - 110px);
}


.trmx-portal-login-card {
    max-width: 460px;
    margin: 16px auto;
    padding: 22px;
    border: 1px solid #d7d7d7;
    border-radius: 16px;
    background: #fff;
}

.trmx-portal-title {
    margin: 0 0 10px;
    font-size: 18px;
}

.trmx-portal-subtitle {
    margin: 0 0 16px;
    color: #444;
}


.trmx-brand-title {
    margin: 0;
    font-size: clamp(26px, 4.6vw, 38px);
    line-height: 1.04;
    letter-spacing: -0.03em;
    font-weight: 800;
    color: #101820;
}

.trmx-brand-powered {
    margin: 6px 0 0;
    font-size: 14px;
    letter-spacing: 0.01em;
    color: #53606d;
}

.trmx-brand-powered span {
    font-weight: 800;
    color: #0f3f93;
}

.trmx-brand-powered sup {
    font-size: 10px;
    top: -0.35em;
}

.trmx-portal-login-form {
    display: grid;
    gap: 14px;
}

.trmx-hidden-decoy {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.trmx-form-actions {
    display: flex;
    justify-content: flex-start;
}

.trmx-portal-submit,
.trmx-map-logout {
    appearance: none;
    border: 0;
    border-radius: 10px;
    background: #1366d6;
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    cursor: pointer;
    font-weight: 600;
}

.trmx-portal-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.trmx-portal-column {
    min-width: 0;
}

.trmx-frontend-message {
    padding: 14px 16px;
    border: 1px solid #d7d7d7;
    border-radius: 12px;
    background: #fff;
    color: #444;
}

.trmx-frontend-message.trmx-portal-notice {
    max-width: 460px;
    margin: 0 auto 12px;
}

.trmx-list-panel {
    border: 1px solid #d7d7d7;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.trmx-list-toolbar {
    padding: 12px;
    border-bottom: 1px solid #e7e7e7;
    background: #fafafa;
}

.trmx-list-search {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 10px;
    box-sizing: border-box;
}

.trmx-list-scroll {
    max-height: 420px;
    overflow-y: auto;
}

.trmx-list-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    padding: 14px 16px;
    border: 0;
    border-bottom: 1px solid #efefef;
    background: #fff;
    cursor: pointer;
}

.trmx-list-item:hover,
.trmx-list-item.is-active,
.trmx-list-item:focus-visible {
    background: #f2f7ff;
    outline: none;
}

.trmx-item-title {
    font-weight: 600;
}

.trmx-item-meta,
.trmx-item-ref,
.trmx-item-time {
    font-size: 13px;
    color: #555;
}

.trmx-empty-state {
    padding: 18px 16px;
    color: #666;
}

.trmx-map-panel {
    position: relative;
    border: 1px solid #d7d7d7;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.trmx-map-overlay-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.trmx-map-fullscreen,
.trmx-map-logout {
    background: rgba(52, 58, 64, 0.92);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.trmx-map-fullscreen {
    appearance: none;
    border: 0;
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 14px;
    cursor: pointer;
    font-weight: 700;
}

.trmx-map-fullscreen:hover,
.trmx-map-fullscreen:focus-visible,
.trmx-map-logout:hover,
.trmx-map-logout:focus-visible {
    background: rgba(28, 34, 40, 0.96);
}

.trmx-map-fullscreen-icon {
    font-size: 16px;
    line-height: 1;
}

.trmx-map-fullscreen-label {
    font-size: 13px;
    line-height: 1;
}

.trmx-map-brand {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: min(180px, calc(100% - 120px));
    max-width: 180px;
}

.trmx-map-brand-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 58px;
    object-fit: contain;
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.28));
}

.trmx-map-canvas {
    width: 100%;
    min-height: 420px;
}

.trmx-portal-shell:fullscreen .trmx-map-panel,
.trmx-portal-shell.is-fullscreen .trmx-map-panel {
    border-radius: 0;
    border: 0;
    height: 100%;
    min-height: 100%;
}

.trmx-portal-shell:fullscreen .trmx-map-canvas,
.trmx-portal-shell.is-fullscreen .trmx-map-canvas {
    height: 100vh !important;
    min-height: 100vh;
}


.trmx-map-empty-state {
    padding: 14px 16px;
    border-top: 1px solid #e7e7e7;
    color: #666;
    background: #fafafa;
}

.trmx-map-warning {
    border-radius: 0;
    border: 0;
    border-top: 1px solid #e7e7e7;
}

.trmx-marker {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 14px;
    transform: translate(-50%, -50%);
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.trmx-marker-core {
    position: relative;
    z-index: 2;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    border: 3px solid #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
}

.trmx-marker-radar {
    position: absolute;
    top: 50%;
    left: 24px;
    width: 48px;
    height: 48px;
    margin-left: -24px;
    margin-top: -24px;
    border-radius: 999px;
    opacity: 0.45;
    animation: trmx-radar-wave 2.2s ease-out infinite;
}

.trmx-marker-label {
    position: relative;
    z-index: 2;
    min-width: 60px;
    padding: 8px 12px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
    background: var(--trmx-pin-color, #16a34a);
}

.trmx-marker-label::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -8px;
    width: 0;
    height: 0;
    margin-top: -6px;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid var(--trmx-pin-color, #16a34a);
    filter: brightness(0.96);
}

.trmx-marker--gps-enabled {
    --trmx-pin-color: #16a34a;
}

.trmx-marker--gps-enabled .trmx-marker-core,
.trmx-marker-label--gps-enabled {
    background: #16a34a;
}

.trmx-marker--gps-enabled .trmx-marker-radar {
    background: rgba(22, 163, 74, 0.32);
}

.trmx-marker--gps-alert {
    --trmx-pin-color: #dc2626;
}

.trmx-marker--gps-alert .trmx-marker-core,
.trmx-marker-label--gps-alert {
    background: #dc2626;
}

.trmx-marker--gps-alert .trmx-marker-radar {
    background: rgba(220, 38, 38, 0.32);
}

.trmx-marker--gps-inhibited {
    --trmx-pin-color: #dc2626;
}

.trmx-marker--gps-inhibited .trmx-marker-core,
.trmx-marker-label--gps-inhibited {
    background: #dc2626;
}

.trmx-marker--gps-inhibited .trmx-marker-radar {
    background: rgba(220, 38, 38, 0.28);
}

.trmx-marker--zello {
    --trmx-pin-color: #f59e0b;
}

.trmx-marker--zello .trmx-marker-core,
.trmx-marker-label--zello {
    background: #f59e0b;
}

.trmx-marker--zello .trmx-marker-radar {
    background: rgba(245, 158, 11, 0.3);
}

.trmx-marker.is-active .trmx-marker-core {
    transform: scale(1.08);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
}

.trmx-marker.is-active .trmx-marker-radar {
    animation-duration: 1.4s;
    opacity: 0.58;
}

.trmx-marker.is-active .trmx-marker-label {
    transform: scale(1.04);
}

@keyframes trmx-radar-wave {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    70% {
        transform: scale(2.35);
        opacity: 0;
    }

    100% {
        transform: scale(2.35);
        opacity: 0;
    }
}

@media (max-width: 980px) {
    .trmx-portal-layout {
        grid-template-columns: 1fr;
    }

    .trmx-list-scroll {
        max-height: 320px;
    }

    .trmx-map-brand {
        top: 56px;
        width: min(150px, calc(100% - 88px));
        max-width: 150px;
    }

    .trmx-marker-label {
        max-width: 120px;
        white-space: normal;
    }
}


@media (max-width: 980px) {
    .trmx-map-fullscreen-label {
        display: none;
    }

    .trmx-portal-shell:fullscreen .trmx-portal-column--list,
    .trmx-portal-shell.is-fullscreen .trmx-portal-column--list {
        top: 14px;
        left: 14px;
        width: min(320px, calc(100vw - 28px));
        max-width: calc(100vw - 28px);
    }
}

.trmx-track-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: #eef3fb;
    color: #234f84;
}

.trmx-track-pill--tech {
    background: #eef8f1;
    color: #245a3e;
}

.trmx-tech-shell {
    width: 100%;
}

.trmx-tech-login-card,
.trmx-tech-form-card,
.trmx-tech-header-card,
.trmx-tech-summary-card,
.trmx-tech-context-card {
    background: #fff;
    border: 1px solid #d7d7d7;
    border-radius: 16px;
}

.trmx-tech-header-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    margin-bottom: 16px;
}

.trmx-tech-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.trmx-tech-summary-grid--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.trmx-tech-search {
    margin: 0 0 8px;
}

.trmx-tech-gps-picker select {
    margin-top: 8px;
}

.trmx-tech-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.trmx-tech-actions .trmx-portal-submit[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.trmx-portal-submit--secondary {
    background: #eef4ff;
    color: #0f3f93;
    border-color: #c7d6fb;
}

.trmx-portal-submit--ghost {
    background: #fff;
    color: #1f2937;
    border-color: #d1d5db;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.trmx-tech-context-card--status {
    border: 1px dashed #c7d6fb;
}


.trmx-tech-summary-card {
    padding: 16px;
}

.trmx-tech-summary-card h3 {
    margin: 0 0 8px;
    font-size: 14px;
}

.trmx-tech-summary-card p {
    margin: 0;
    font-size: 22px;
}

.trmx-tech-help {
    margin: 8px 0 0;
    font-size: 13px;
    color: #555;
}

.trmx-tech-column {
    display: grid;
    gap: 16px;
}

.trmx-tech-form-card {
    padding: 20px;
}

.trmx-tech-form-card h3,
.trmx-tech-recent-panel .trmx-list-toolbar strong {
    margin: 0;
}

.trmx-tech-context-card {
    margin: 0 0 14px;
    padding: 14px 16px;
    background: #f9fbff;
}

.trmx-tech-context-card p {
    margin: 0 0 6px;
}

.trmx-tech-context-name {
    font-size: 18px;
    font-weight: 700;
}

.trmx-tech-form-grid {
    display: grid;
    gap: 14px;
}

.trmx-tech-form-grid label {
    display: block;
    margin-bottom: 6px;
}

.trmx-tech-form-grid input[type="search"],
.trmx-tech-form-grid select,
.trmx-tech-form-grid textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d0d0d0;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}

.trmx-tech-form-full {
    grid-column: 1 / -1;
}

.trmx-list-item--static {
    cursor: default;
}

.trmx-list-item--static:hover {
    background: #fff;
}

@media (max-width: 900px) {
    .trmx-tech-summary-grid,
    .trmx-portal-layout.trmx-tech-layout {
        grid-template-columns: 1fr;
    }

    .trmx-tech-header-card {
        flex-direction: column;
    }
}


.trmx-bridge-test-card {
    max-width: 760px;
}

.trmx-bridge-live-card {
    margin-top: 18px;
    border: 1px solid #d7d7d7;
    border-radius: 14px;
    padding: 18px;
    background: #fff;
}

.trmx-bridge-live-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.9fr);
    gap: 18px;
    align-items: start;
}

.trmx-bridge-live-metrics,
.trmx-bridge-live-state {
    display: grid;
    gap: 10px;
}

.trmx-bridge-metric {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fafafa;
    color: #24313f;
}

.trmx-bridge-state-pill {
    padding: 10px 12px;
    border-radius: 999px;
    background: #eef4ff;
    color: #0f3f93;
    font-weight: 600;
    text-align: center;
}

@media (max-width: 782px) {
    .trmx-bridge-live-grid {
        grid-template-columns: 1fr;
    }
}



.trmx-resource-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 8px;
}

.trmx-history-trigger,
.trmx-history-export,
.trmx-history-close {
    appearance: none;
    border: 1px solid #c9d5e6;
    background: #f5f9ff;
    color: #0f3f93;
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
}

.trmx-history-trigger:disabled,
.trmx-history-export:disabled {
    opacity: 0.55;
    cursor: default;
}

.trmx-history-panel {
    border-top: 1px solid #e7e7e7;
    background: #fbfcfe;
}

.trmx-history-toolbar {
    padding: 12px;
    border-bottom: 1px solid #e7e7e7;
    display: grid;
    gap: 10px;
}

.trmx-history-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.trmx-history-toolbar-row--filters label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: #475467;
    font-weight: 700;
}

.trmx-history-toolbar-row--filters select {
    min-width: 88px;
    padding: 8px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
}

.trmx-history-title {
    color: #101828;
}

.trmx-history-summary {
    padding: 10px 12px;
    font-size: 13px;
    color: #475467;
    border-bottom: 1px solid #e7e7e7;
}

.trmx-history-table-wrap {
    max-height: 280px;
    overflow: auto;
}

.trmx-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.trmx-history-table th,
.trmx-history-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #edf1f5;
    text-align: left;
    vertical-align: top;
}

.trmx-history-table thead th {
    position: sticky;
    top: 0;
    background: #f4f7fb;
    z-index: 1;
}

.trmx-item-time--event {
    color: #8a2f1c;
    font-weight: 600;
}

.trmx-signal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.trmx-signal-pill {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    min-height: 58px;
    padding: 10px 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    text-align: left;
    line-height: 1.15;
    box-sizing: border-box;
}

.trmx-signal-pill {
    appearance: none;
    width: 100%;
    background-clip: padding-box;
}

.trmx-signal-pill.is-actionable {
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.trmx-signal-pill.is-actionable:hover,
.trmx-signal-pill.is-actionable:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    outline: none;
}

.trmx-signal-pill:disabled {
    cursor: default;
    opacity: 1;
}

.trmx-signal-pill.is-loading {
    opacity: 0.72;
    pointer-events: none;
}

.trmx-signal-pill-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.trmx-signal-pill-status {
    font-size: 14px;
    font-weight: 700;
}

.trmx-signal-pill--safe {
    background: #edf8f0;
    border-color: #b8e0c2;
    color: #146c2e;
}

.trmx-signal-pill--danger {
    background: #fff0f0;
    border-color: #f0b6b6;
    color: #b42318;
}

.trmx-signal-pill--warn {
    background: #fff7e8;
    border-color: #f3d08a;
    color: #9a6700;
}

.trmx-signal-pill--neutral {
    background: #f5f7fa;
    border-color: #d6dde6;
    color: #475467;
}

.trmx-map-info-signals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.trmx-map-info .trmx-signal-pill {
    min-height: 52px;
}

.trmx-portal-feedback {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1200;
    max-width: min(420px, calc(100vw - 36px));
    padding: 12px 14px;
    border-radius: 12px;
    color: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.28);
    font-weight: 600;
}

.trmx-portal-feedback--success {
    background: rgba(22, 101, 52, 0.96);
}

.trmx-portal-feedback--error {
    background: rgba(185, 28, 28, 0.96);
}

.trmx-modal-open {
    overflow: hidden;
}

.trmx-portal-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
}

.trmx-portal-modal[hidden] {
    display: none;
}

.trmx-portal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 12, 24, 0.58);
    backdrop-filter: blur(3px);
}

.trmx-portal-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(460px, calc(100vw - 28px));
    margin: 10vh auto 0;
    padding: 18px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 54px rgba(2, 6, 23, 0.28);
}

.trmx-portal-modal-form {
    display: grid;
    gap: 14px;
}

.trmx-portal-modal-title {
    margin: 0;
    font-size: 20px;
    line-height: 1.1;
}

.trmx-portal-modal-message {
    margin: 0;
    color: #344054;
}

.trmx-portal-modal-key-row {
    display: grid;
    gap: 8px;
}

.trmx-portal-modal-key-label {
    font-size: 13px;
    font-weight: 700;
    color: #101828;
}

.trmx-portal-modal-key-input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    box-sizing: border-box;
}

.trmx-portal-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.trmx-portal-modal-cancel,
.trmx-portal-modal-confirm {
    appearance: none;
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 700;
}

.trmx-portal-modal-cancel {
    background: #e5e7eb;
    color: #111827;
}

.trmx-portal-modal-confirm {
    background: #b42318;
    color: #fff;
}

@media (max-width: 900px) {
    .trmx-signal-grid,
    .trmx-map-info-signals {
        grid-template-columns: 1fr;
    }
}
