@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/inter-variable.woff2") format("woff2");
}

* {
    box-sizing: border-box;
}

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

a:hover {
    text-decoration: underline;
    color: var(--link-hover);
}

/* Tabler icons: size up slightly vs. text and sit on the baseline. To keep a
   link's underline off the icon, underline only a text <span>, never the link
   element that holds the icon (the line is drawn across atomic inlines too). */
.ti {
    display: inline-block;
    font-size: 1.15em;
    vertical-align: -0.15em;
}

/* Layout */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: grid;
    /* minmax(0, 1fr): let the content column shrink below its min-content so a
       wide table scrolls inside main instead of widening the whole layout. */
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto auto 1fr;
    grid-template-areas:
        "header header"
        "info   info"
        "aside  crumbs"
        "aside  main";
    font-family: "Inter",system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,Segoe UI Emoji,Apple Color Emoji,Noto Color Emoji,sans-serif;
    font-weight: 400;
    text-rendering: optimizeLegibility;
    line-height: 1.4;
}

header {
    grid-area: header;
    height: 4rem;
    border-bottom: solid 1px var(--body-bg-border);
}

.info-bar {
    grid-area: info;
    position: relative; /* positioning context for the centered announcement */
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 2.75rem;
    padding: 0 1rem;
    background-color: var(--sidebar-bg);
    border-bottom: solid 1px var(--body-bg-border);
}

aside {
    grid-area: aside;
    width: 13rem;
    height: 100%;
    padding: 0.75rem;
    border-right: solid 1px var(--body-bg-border);
}

main {
    grid-area: main;
    width: 100%;
    max-width: 1140px;
    justify-self: center;
    margin: 20px auto;
    padding: 0 2rem;
}

/* Hidden for signed-out pages; no reserved space there. */
.breadcrumbs { display: none; }

/* Signed in: always occupy the row — even with no trail (the index) — so the
   layout doesn't shift when navigating to pages that do have a trail. */
.breadcrumbs-active {
    display: block;
    grid-area: crumbs;
    width: 100%;
    max-width: 1140px;
    min-height: 2.25rem;
    justify-self: center;
    padding: 1rem 2rem 0;
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumbs li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Separator before every crumb except the first. */
.breadcrumbs li + li::before {
    content: ">";
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.breadcrumbs [aria-current="page"] span {
    color: var(--font-color);
    font-weight: 500;
}
/* Layout end */

header, aside {
    background-color: var(--sidebar-bg);
}

body {
    background-color: var(--body-bg-light);
}

p, h1, h2, h3, h4, h5, h6 {
    color: var(--font-color);
}

#logo  {
    fill: var(--font-color);
    stroke: none;
    width: 57px;
    height: auto;
}

header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 1rem;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 400;
}

/* Left navigation */
aside a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.25rem;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    font-weight: 500;
}

aside a .ti {
    font-size: 1.25rem;
    color: var(--text-muted);
}

aside a:hover {
    background-color: var(--bg-secondary);
    color: var(--font-color);
    text-decoration: none;
}

aside a.active {
    background-color: var(--bg-secondary);
    border-color: var(--body-bg-border);
    color: var(--font-color);
}

aside a.active .ti {
    color: var(--link-color);
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Square icon buttons in the header (theme, sidebar collapse, mobile burger). */
.theme-toggle,
.sidebar-toggle,
.nav-burger {
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--body-bg-border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
}

.theme-toggle:hover, .theme-toggle:focus-visible,
.sidebar-toggle:hover, .sidebar-toggle:focus-visible,
.nav-burger:hover, .nav-burger:focus-visible {
    color: var(--font-color);
    border-color: var(--link-color);
}

/* Theme + sidebar toggles persist their state, which needs JS, so they only
   appear once theme.js/sidebar.js mark the document with .js. The theme itself
   still follows the OS without JS via colors.css. */
.theme-toggle,
.sidebar-toggle {
    display: none;
}

html.js .theme-toggle,
html.js .sidebar-toggle {
    display: inline-flex;
}

/* Show the icon for the active theme (OS preference or saved override). */
.theme-icon-light,
.theme-icon-dark {
    display: none;
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme]) .theme-icon-dark { display: inline-block; }
}

@media (prefers-color-scheme: light) {
    html:not([data-theme]) .theme-icon-light { display: inline-block; }
}

html[data-theme="dark"] .theme-icon-dark { display: inline-block; }
html[data-theme="light"] .theme-icon-light { display: inline-block; }

/* Mobile drawer: CSS-only, driven by the #nav-toggle checkbox + burger label. */
.nav-burger { display: none; } /* desktop hides the burger */

.nav-toggle-input,
.announcement-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.nav-backdrop { display: none; }

/* Desktop: collapsing hides the sidebar; its auto-sized column shrinks to 0. */
@media (min-width: 769px) {
    html[data-sidebar="collapsed"] aside { display: none; }
}

@media (max-width: 768px) {
    body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "header"
            "info"
            "crumbs"
            "main";
    }

    html.js .sidebar-toggle { display: none; } /* desktop-only control */
    .nav-burger { display: inline-flex; }

    /* Drawer sits below the header (4rem) + info bar (2.75rem). */
    aside {
        position: fixed;
        top: 6.75rem;
        left: 0;
        bottom: 0;
        z-index: 900;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    body:has(#nav-toggle:checked) aside {
        transform: translateX(0);
    }

    body:has(#nav-toggle:checked) .nav-backdrop {
        display: block;
        position: fixed;
        inset: 6.75rem 0 0 0;
        z-index: 800;
        background: rgba(0, 0, 0, 0.5);
    }

    main {
        padding: 0 1rem;
        overflow-x: auto; /* wide tables scroll here rather than the whole page */
    }

    /* Compact the header: drop the email label, keep the user icon + caret. */
    .user-menu-trigger span {
        display: none;
    }

    /* Stack the page header so the action gets its own row below the title. */
    .page-header {
        flex-direction: column;
        gap: 1rem;
    }
}

/* User menu (CSS-only dropdown: opens on hover or keyboard focus) */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--body-bg-border);
    border-radius: 8px;
    color: var(--font-color);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.user-menu-trigger:hover,
.user-menu:focus-within .user-menu-trigger {
    border-color: var(--link-color);
}

.user-menu-caret {
    color: var(--text-muted);
    transition: transform 0.15s ease;
}

.user-menu:hover .user-menu-caret,
.user-menu:focus-within .user-menu-caret {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    /* Transparent bridge so moving the cursor onto the menu keeps it open. */
    padding-top: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    z-index: 1000;
}

.user-menu:hover .user-menu-dropdown,
.user-menu:focus-within .user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-list {
    display: flex;
    flex-direction: column;
    min-width: 11rem;
    padding: 0.35rem;
    background-color: var(--body-bg-dark);
    border: 1px solid var(--body-bg-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.user-menu-list a,
.user-menu-list button {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: none;
    border-radius: 7px;
    background: none;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
}

.user-menu-list a:hover,
.user-menu-list button:hover {
    background-color: var(--bg-secondary);
    color: var(--font-color);
    text-decoration: none;
}

.user-menu-list .ti {
    color: var(--text-muted);
}

/* Page header (title + primary action) */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

/* Reset the heading's top margin so the action aligns with the title line. */
.page-header h1 {
    margin-top: 0;
}

.add-site-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    height: 40px;
    padding: 0 16px;

    border-radius: 10px;
    border: 1px solid #2563eb;
    background: #1d4ed8;
    color: #f8fafc;

    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.add-site-button:hover {
    background: #2563eb;
    border-color: #3b82f6;
    color: #f8fafc;
    text-decoration: none;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    background-color: var(--link-color);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--link-hover);
    color: #fff;
    text-decoration: none;
}

/* Forms (profile, new monitor) */
.form-card {
    max-width: 32rem;
}

.field {
    margin-bottom: 1.25rem;
}

.field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field input[type="password"],
.field select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--body-bg-border);
    border-radius: 8px;
    color: var(--font-color);
    font: inherit;
}

.field select {
    cursor: pointer;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--link-color);
}

.field input:disabled {
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 1;
}

.field-hint {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.field-error {
    color: #f87171;
}

.form-error {
    margin-bottom: 1rem;
    padding: 0.6rem 0.85rem;
    background-color: #3a1620;
    border: 1px solid #f87171;
    border-radius: 8px;
    color: #f87171;
    font-size: 0.85rem;
}

.form-divider {
    margin: 1.5rem 0 1rem;
    border: none;
    border-top: 1px solid var(--body-bg-border);
}

.form-aux {
    margin: 0.35rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Toasts */
.toasts {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 18rem;
    max-width: 24rem;
    padding: 0.75rem 1rem;
    background-color: var(--body-bg-dark);
    border: 1px solid var(--body-bg-border);
    border-radius: 10px;
    color: var(--font-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-hide {
    opacity: 0;
    transform: translateX(0.5rem);
}

.toast-icon {
    font-size: 1.2rem;
}

.toast-message {
    flex: 1 1 auto;
    font-size: 0.9rem;
}

.toast-close {
    display: inline-flex;
    padding: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.toast-close:hover {
    color: var(--font-color);
}

.toast-success {
    background-color: var(--success-bg);
    border-color: var(--success);
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error {
    border-color: #f87171;
}

.toast-error .toast-icon {
    color: #f87171;
}

.toast-warning {
    border-color: #fbbf24;
}

.toast-warning .toast-icon {
    color: #fbbf24;
}

.toast-info .toast-icon {
    color: var(--link-color);
}

/* Target listing */
.targets {
    width: 100%;
    /* "separate" (not "collapse") so the rounded corners clip the dividers. */
    border-collapse: separate;
    border-spacing: 0;
    background-color: var(--body-bg-dark);
    border-radius: 10px;
    overflow: hidden;
    /* Frame the table with a box-shadow ring, not a border: a 1px border plus
       overflow-clip leaves a faint doubled arc at the rounded corners in Chrome
       (clip radius vs. border radius differ by a subpixel). The ring follows the
       radius exactly and sits outside the clip, so the corners stay crisp. */
    box-shadow: 0 0 0 1px var(--body-bg-border);
}

.targets th {
    text-align: left;
    padding: 0.75rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--body-bg-border);
}

.targets td {
    padding: 0.85rem 1.25rem;
    color: var(--font-color);
    border-bottom: 1px solid var(--body-bg-border);
}

.targets tbody tr:last-child td {
    border-bottom: none;
}

.targets tbody tr:hover {
    background-color: var(--bg-secondary);
}

/* Right-align the metric columns; status sits left next to the site. */
.targets th.col-uptime, .targets td.col-uptime,
.targets th.col-latency, .targets td.col-latency {
    text-align: right;
}

/* Mobile: the targets table collapses into one separate card per monitor.
   Placed after the base .targets rules so these overrides win the cascade
   (equal specificity → later source wins); otherwise the table keeps its
   dark surface and fills the gaps between cards. */
@media (max-width: 768px) {
    .targets thead {
        display: none;
    }

    .targets,
    .targets tbody,
    .targets tr,
    .targets td {
        display: block;
    }

    /* Drop the shared table frame so the page background shows between cards. */
    .targets {
        background: none;
        border: none;
        border-radius: 0;
        overflow: visible;
        box-shadow: none;
    }

    .targets tr {
        margin-bottom: 0.75rem;
        padding: 1rem;
        background-color: var(--body-bg-dark);
        border: 1px solid var(--body-bg-border);
        border-radius: 12px;
    }

    .targets tbody tr:last-child {
        margin-bottom: 0;
    }

    .targets td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.25rem 0;
        border-bottom: none;
    }

    .targets td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    /* Site cell is the card title: full width, no label, truncates if long. */
    .targets td.col-site {
        padding-bottom: 0.5rem;
    }

    .targets td.col-site::before {
        content: none;
    }

    .targets td.col-site .target-url {
        min-width: 0;
    }

    .targets td.col-site .target-url span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.status {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-healthy { background-color: var(--success-bg); color: var(--success); }
.status-slow { background-color: #3a2e0f; color: #fbbf24; }
.status-down { background-color: #3a1620; color: #f87171; }
.status-unknown { background-color: #1f2530; color: var(--text-secondary); }

.target-url {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: var(--font-color);
}

a.target-url:hover {
    color: var(--link-hover);
    /* Underline only the text span, never the icon (see .ti note). */
    text-decoration: none;
}

a.target-url:hover span {
    text-decoration: underline;
}

/* Target detail */
.card {
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    background-color: var(--body-bg-dark);
    border: 1px solid var(--body-bg-border);
    border-radius: 12px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--font-color);
}

.card-link {
    font-size: 0.85rem;
}

.card-title-icon {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* Detail header */
.detail-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.back-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.back-link:hover {
    text-decoration: none;
}

.back-link:hover span {
    text-decoration: underline;
}

.detail-title {
    margin: 0;
    font-size: 1.75rem;
}

.detail-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.detail-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-form {
    display: inline-flex;
    align-items: center;
    height: 2.25rem;
    padding: 0 0.75rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--body-bg-border);
    border-radius: 8px;
    color: var(--font-color);
    gap: 0.5rem;
}

.range-form-icon {
    color: var(--text-muted);
}

.range-select {
    background: transparent;
    border: none;
    color: var(--font-color);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.range-select option {
    background-color: var(--body-bg-dark);
    color: var(--font-color);
}

/* Status banner */
.status-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    background-color: var(--body-bg-dark);
    border: 1px solid var(--body-bg-border);
    border-radius: 12px;
}

.banner-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.8rem;
}

.banner-icon .ti { font-size: 1.6rem; }

.banner-icon-healthy { background-color: var(--success); color: #fff; }
.banner-icon-slow { background-color: #d9a400; color: #fff; }
.banner-icon-down { background-color: #d12f3a; color: #fff; }
.banner-icon-unknown { background-color: var(--text-muted); color: #fff; }

.banner-text {
    flex: 1 1 auto;
}

.banner-status {
    font-size: 1.1rem;
    font-weight: 700;
}

.banner-status-healthy { color: var(--success); }
.banner-status-slow { color: #fbbf24; }
.banner-status-down { color: #f87171; }
.banner-status-unknown { color: var(--text-secondary); }

.banner-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.banner-meta {
    text-align: left;
    min-width: 7rem;
}

.banner-meta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.banner-meta-value {
    font-weight: 600;
    color: var(--font-color);
}

/* Metric cards */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    padding: 1rem 1.25rem;
    background-color: var(--body-bg-dark);
    border: 1px solid var(--body-bg-border);
    border-radius: 12px;
}

.metric-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.metric-icon, .target-url .ti {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background-color: var(--body-bg-border);
    color: var(--link-color);
    font-size: 1.35rem;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.metric-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--font-color);
}

.metric-sub {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.metric-sub-good {
    color: var(--success);
}

/* Chart range toggle */
.range-toggle {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.2rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--body-bg-border);
    border-radius: 8px;
}

.range-btn {
    padding: 0.25rem 0.7rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.range-btn:hover {
    text-decoration: none;
    color: var(--font-color);
}

.range-btn.active {
    background-color: var(--link-color);
    color: #fff;
}

.detail-chart {
    margin: 0;
}

/* Recent checks table */
.checks-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.checks-table th {
    text-align: left;
    padding: 0 0 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--body-bg-border);
}

.checks-table td {
    padding: 0.7rem 0;
    color: var(--font-color);
    border-bottom: 1px solid var(--body-bg-border);
}

.checks-table tbody tr:last-child td {
    border-bottom: none;
}

.checks-table .muted {
    color: var(--text-muted);
}

.dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    margin-right: 0.35rem;
}

.dot-up { background-color: var(--success); }
.dot-down { background-color: #f87171; }

/* Announcement: title pill centered in the info bar + CSS-only modal. */
.announcement-pill {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    max-width: min(28rem, 50vw);
    color: var(--link-color);
    font-size: 0.85rem;
    cursor: pointer;
}

.announcement-pill span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.announcement-pill:hover {
    color: var(--link-hover);
}

.announcement-pill:hover span {
    text-decoration: underline;
}

.announcement-pill .ti {
    color: var(--link-color);
    font-size: 1.25rem;
}

.announcement-backdrop,
.announcement-modal {
    display: none;
}

body:has(#announcement-toggle:checked) .announcement-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.5);
}

body:has(#announcement-toggle:checked) .announcement-modal {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 1101;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    pointer-events: none; /* clicks outside the box fall through to the backdrop */
}

.announcement-modal-box {
    pointer-events: auto;
    width: 100%;
    max-width: 32rem;
    max-height: 80vh;
    overflow-y: auto;
    padding: 1.5rem;
    background-color: var(--body-bg-dark);
    border: 1px solid var(--body-bg-border);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.announcement-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.announcement-modal-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.2rem;
}

.announcement-modal-title .ti {
    color: var(--link-color);
}

.announcement-close {
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.announcement-close:hover {
    color: var(--font-color);
}

.announcement-modal-body {
    color: var(--text-secondary);
    line-height: 1.6;
}

.announcement-actions {
    margin-top: 1.25rem;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--body-bg-border);
    border-radius: 8px;
    color: var(--font-color);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary:hover {
    border-color: var(--link-color);
}