html, body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f6f9;
}

h1:focus { outline: none; }

a, .btn-link { color: #1d6fb8; }

.btn-primary {
    --bs-btn-bg: #1d6fb8;
    --bs-btn-border-color: #1d6fb8;
    --bs-btn-hover-bg: #17588f;
    --bs-btn-hover-border-color: #17588f;
    --bs-btn-active-bg: #17588f;
}

/* ---- Home hero ---- */
.tt-hero {
    background: linear-gradient(135deg, #0f2740 0%, #1d6fb8 100%);
    color: #fff;
    border-radius: 14px;
    padding: 2rem 2.25rem;
}
.tt-hero .lead { color: #e6eef6; }

/* ---- Live map ---- */
.tt-map {
    width: 100%;
    height: 560px;
    border-radius: 10px;
    overflow: hidden;
    background: #dde5ec;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.tt-map-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
    color: #5b6b7b;
    font-size: .95rem;
}

.tt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    font-size: .8rem;
    color: #556;
}
.tt-legend-item { display: inline-flex; align-items: center; gap: .3rem; }
.tt-legend-dot { width: .8rem; height: .8rem; border-radius: 50%; display: inline-block; }

.tt-grid { font-size: .9rem; }

/* ---- LIVE WINDOW toggle + pinning ---- */
.tt-live-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .8rem;
    border: 2px solid #c3ced9;
    border-radius: 999px;
    background: #fff;
    color: #55636f;
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: .06em;
}
.tt-live-btn:hover { border-color: #9aa8b6; color: #33414d; }
.tt-live-btn .tt-live-dot {
    width: .6rem;
    height: .6rem;
    border-radius: 50%;
    background: #c3ced9;
}
.tt-live-btn .tt-live-sub {
    font-weight: 600;
    font-size: .72rem;
    letter-spacing: normal;
    opacity: .75;
}
.tt-live-btn.on {
    border-color: #c81e1e;
    background: #c81e1e;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(200, 30, 30, .16);
}
.tt-live-btn.on .tt-live-dot { background: #fff; animation: tt-pulse 1s ease-in-out infinite; }

@keyframes tt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

@media (prefers-reduced-motion: reduce) {
    .tt-live-btn.on .tt-live-dot { animation: none; }
}

.tt-live-status {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .75rem;
    margin-bottom: .4rem;
    font-size: .82rem;
    color: #55636f;
}

.tt-pin {
    border: 0;
    background: transparent;
    padding: .1rem .2rem;
    line-height: 1;
    filter: grayscale(1);
    opacity: .35;
}
.tt-pin:hover { opacity: .75; }
.tt-pin.on { filter: none; opacity: 1; }

/* Radzen renders the row <tr>; the background needs to win over its own striping. */
.tt-grid tr.tt-pinned-row td { background: #fff6e0 !important; }

/* ---- Location type-ahead (sighting form) ---- */
.tt-suggest { position: relative; }
.tt-suggest-menu {
    position: absolute;
    z-index: 1070;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    max-height: 17rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d6dde5;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(15, 39, 64, .14);
}
.tt-suggest-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: .4rem .6rem;
    border: 0;
    border-bottom: 1px solid #f0f3f7;
    background: transparent;
    line-height: 1.25;
}
.tt-suggest-item:last-child { border-bottom: 0; }
.tt-suggest-item:hover, .tt-suggest-item.active { background: #eaf3fb; }
.tt-suggest-name { display: block; font-size: .92rem; }
.tt-suggest-kind {
    margin-left: .35rem;
    padding: 0 .3rem;
    border-radius: 4px;
    background: #eef2f7;
    color: #5b6b7b;
    font-size: .7rem;
    text-transform: lowercase;
}
.tt-suggest-context { display: block; font-size: .78rem; color: #6b7885; }
.tt-suggest-note { padding: .5rem .6rem; font-size: .82rem; color: #6b7885; }

/* ---- Chat ---- */
.tt-chat-scroll {
    height: 460px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    background: #fbfcfe;
}
.tt-msg {
    max-width: 85%;
    padding: .4rem .6rem;
    border-radius: 10px;
    background: #eef2f7;
    align-self: flex-start;
}
.tt-msg.mine {
    align-self: flex-end;
    background: #d7ecff;
}
.tt-msg-head { font-size: .78rem; margin-bottom: .1rem; }

/* ---- Quoting a chat message ----
   The quote block inside a reply is a button (it jumps to the original), so it has to be stripped
   back to looking like a quote rather than a control. */
.tt-quote {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    border-left: 3px solid #7aa7d4;
    background: rgba(255,255,255,.65);
    border-radius: 4px;
    padding: .2rem .45rem;
    margin-bottom: .25rem;
    font-size: .8rem;
    line-height: 1.25;
    cursor: pointer;
}

    .tt-quote:hover { background: #fff; }

.tt-quote-who {
    display: block;
    font-weight: 600;
    color: #2c5d8f;
}

.tt-quote-text {
    display: block;
    color: #4a5568;
    /* Two lines is plenty for a taste of the original. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* The "Replying to …" strip above the compose box. */
.tt-reply-bar {
    display: flex;
    align-items: baseline;
    gap: .4rem;
    border-left: 3px solid #7aa7d4;
    background: #f4f8fc;
    border-radius: 4px;
    padding: .3rem .5rem;
    margin-bottom: .5rem;
    font-size: .8rem;
}

    .tt-reply-bar .tt-quote-who,
    .tt-reply-bar .tt-quote-text { display: inline; }

    .tt-reply-bar .tt-quote-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.tt-reply-label { color: #6b7280; }

/* Brief highlight on the message a quote points at. */
.tt-flash { animation: tt-flash-fade 1.6s ease-out; }

@keyframes tt-flash-fade {
    0% { background: #ffe9a8; }
    100% { background: inherit; }
}

/* ---- Modal overlay (admin actions, etc.) ---- */
.tt-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1080;
}

/* ---- Admin news popup ----
   The body is rich HTML an admin wrote in the editor, so it has to survive arbitrary content:
   images and tables are clamped to the card width and the body scrolls rather than the page. */
.tt-news-card {
    max-width: 720px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

/* Long or wide content scrolls inside the card instead of stretching the page. */
.tt-news-body {
    overflow: auto;
}

.tt-news-body img {
    max-width: 100%;
    height: auto;
}

.tt-news-body table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

    .tt-news-body table th,
    .tt-news-body table td {
        border: 1px solid #dee2e6;
        padding: .4rem .6rem;
    }

.tt-news-body > :last-child {
    margin-bottom: 0;
}

/* ---- Password rule ticks on the auth forms ---- */
.pw-rules { list-style: none; padding-left: 0; margin-top: .4rem; }
.pw-rules li { position: relative; padding-left: 1.3rem; color: #8a8f96; }
.pw-rules li::before { content: "○"; position: absolute; left: 0; }
.pw-rules li.ok { color: #198754; }
.pw-rules li.ok::before { content: "✓"; }

/* ---- Blazor error UI ---- */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1090;
}
    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}
