:root {
    --discord-light: #2b2d31;
    --discord-dark: #202225;
    --discord-blue: #7289da;
    --discord-grey: #99aab5;
    --background-color: #36393f;
}

body {
    background-color: var(--background-color);
    color: var(--discord-grey);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container {
    display: flex;
    flex-direction: column; /* Explicitly set if needed, though default is row */
    justify-content: flex-start; /* Aligns children to the start along the main axis */
    align-items: center; /* Centers items along the cross axis */
    padding-top: 20px;
}

.table-container {
    max-width: 1200px; /* Sets a maximum width for the table container */
    margin: auto; /* Centers the table container horizontally */
    width: 100%; /* Ensures the container takes up the full width up to its max-width */
    align-self: flex-start; /* Aligns this child to the top */
    margin-top: 0; /* Adjust as needed */
}

.table-responsive {
    width: 100%;
    overflow-x: auto; /* Ensure table is scrollable on small devices */
}

.table {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Add shadow for depth */
    border-radius: 8px; /* Rounded corners */
    width: 100%; /* Ensure table uses full container width */
    min-width: 600px; /* Minimum width before allowing table to be scrollable */
}

.table-container .table thead {
    background-color: var(--discord-dark) !important;
    color: white !important;
}

/* Tables: set Bootstrap's own table colours rather than fighting them.
   Bootstrap paints each cell, so a background on the row never shows. */
.table-container .table.table-dark {
    --bs-table-bg: var(--discord-dark);
    --bs-table-striped-bg: var(--discord-light);
    --bs-table-striped-color: var(--discord-grey);
    --bs-table-hover-bg: rgba(114, 137, 218, 0.14);
    --bs-table-hover-color: #ffffff;
    border-color: var(--discord-light);
    color: var(--discord-grey);
}

.table-container .table.table-dark thead th {
    color: white;
    border-color: var(--discord-light);
}

.table td, .table th {
    text-align: left;
    padding: 12px 15px;
    vertical-align: top;
}


.centered-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 20px;
}
.info-panel {
    max-width: 800px;
    width: 100%;
    padding: 15px;
    background-color: var(--discord-dark);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.info-panel p {
    font-size: 0.9em;
    color: var(--discord-grey);
    line-height: 1.4;
    margin: 0;
    text-align: center;
}

.info-panel p + p {
    margin-top: 8px;
}

/* Donate Link Styling */
.donate-container {
    text-align: right;
    margin-top: 20px;
    padding-right: 20px;
}

.donate-link {
    text-decoration: none;
    color: var(--discord-blue);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.donate-link:hover, .donate-link:focus {
    color: var(--discord-grey);
    text-decoration: none;
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
        display: block;
    }

    .table td, .table th {
        font-size: 14px;
        padding: 8px 10px;
    }

    /* Tables marked stack-on-mobile turn each row into a card, with each
       cell's data-label as its caption. */
    .stack-on-mobile {
        min-width: 0;
    }

    .stack-on-mobile thead {
        display: none;
    }

    .stack-on-mobile, .stack-on-mobile tbody, .stack-on-mobile tr, .stack-on-mobile td {
        display: block;
        max-width: 100%;
    }

    .stack-on-mobile tr {
        margin-bottom: 10px;
    }

    .stack-on-mobile td[data-label] {
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    .stack-on-mobile td[data-label]::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 50%;
        padding-left: 10px;
        font-weight: bold;
        text-align: left;
    }
}

.highlight-text {
    color: #dbcf6e;
}

/* Donation page styles */
body.donate {
    color: #FFFFFF;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body.donate .row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center the cards within the container */
    margin-right: -15px; /* Adjust according to your layout needs */
    margin-left: -15px; /* Adjust according to your layout needs */
}

body.donate .donation-content-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 20px;
    min-height: 100vh; /* Full viewport height */
    width: 90%; /* Responsive width */
    max-width: 1200px; /* Max width to ensure content does not stretch too far on wider screens */
    margin: 0 auto; /* Center the container */
}

body.donate .col-md-6 {
    flex: 0 0 50%; /* Sets the base width to 50% for desktop */
    max-width: 50%; /* Ensures that the element doesn't exceed 50% width */
    padding-right: 15px; /* Adjust padding to ensure spacing between cards */
    padding-left: 15px; /* Adjust padding to ensure spacing between cards */
    box-sizing: border-box; /* Ensures padding does not affect the overall width */
}

body.donate .card {
    background-color: var(--discord-dark);
    color: #FFFFFF;
    margin-bottom: 2rem; /* Space between cards */
    width: 100%; /* Full width of the container */
    border: none; /* Remove any default border */
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2); /* Enhanced shadow for depth */
    text-align: center;
}

body.donate .centered-title {
    text-align: center;
}

body.donate .limited-img {
    max-width: 100px; /* Adjust this value as needed */
    height: auto;
}

body.donate .limited-img-button {
    max-width: 200px; /* Adjust this value as needed */
    height: auto;
}


body.donate .card .card-body {
    padding: 20px; /* More padding for better spacing */
}

body.donate .qr-code {
    width: 150px; /* Slightly larger QR code for better scanning */
    height: 150px;
    margin-top: 15px; /* Space above the QR code */
}

body.donate .donate-link {
    display: inline-block;
    background-color: var(--discord-blue);
    color: #FFFFFF;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

body.donate .donate-link:hover, body.donate .donate-link:focus {
    background-color: var(--discord-grey);
    color: #FFFFFF;
}

@media (max-width: 768px) {
    body.donate .container {
        flex-direction: column;
        padding-top: 15px;
    }

    body.donate .col-md-6 {
        flex: 0 0 100%; /* Sets the base width to 100% for mobile */
        max-width: 100%; /* Ensures that the element doesn't exceed 100% width on smaller screens */
    }

    body.donate .card {
        margin-bottom: 1.5rem;
    }

    body.donate .qr-code {
        width: 120px; /* Adjust size for smaller screens */
        height: 120px;
    }
}

.ko-fi-container {
    display: flex;
    justify-content: center; /* This will center the button */
    padding: 20px 0; /* Add some vertical padding */
}

.ko-fi-button {
    background-color: var(--discord-blue); /* Using the CSS variable for Discord blue */
    color: white; /* Text color */
    padding: 10px 20px; /* Button padding */
    border-radius: 4px; /* Rounded borders */
    text-decoration: none; /* Removes underline */
    transition: background-color 0.3s ease; /* Smooth background transition for hover effect */
    font-size: 16px; /* Font size */
    border: none; /* Removes border */
}

.ko-fi-button:hover, .ko-fi-button:focus {
    background-color: darken(var(--discord-blue), 10%); /* Darkens the button color slightly on hover */
    color: white; /* Ensures text color remains white on hover */
    text-decoration: none; /* Maintains no underline on hover */
}


/* Loading styles */
.loader {
    border: 5px solid #f3f3f3; /* Light grey */
    border-top: 5px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Shared bits */
.page-heading {
    color: white;
}

.button-primary {
    display: inline-block;
    background-color: var(--discord-blue);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.button-primary:hover,
.button-primary:focus {
    background-color: #677bc4;
    color: #ffffff;
}

.button-large {
    font-size: 1.1rem;
    padding: 12px 28px;
}

/* Flashed messages */
.flash-messages {
    max-width: 800px;
    margin: 0 auto 20px;
    padding: 0 16px;
}

.flash-message {
    background-color: var(--discord-dark);
    color: #ffffff;
    border-left: 4px solid var(--discord-blue);
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 10px;
}

.flash-error {
    border-left-color: #ed4245;
}

.flash-warning {
    border-left-color: #fee75c;
}

/* Error page */
.error-container {
    text-align: center;
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
    background-color: var(--discord-light);
    border: 2px solid var(--discord-blue);
    border-radius: 8px;
}

.error-container h1 {
    color: var(--discord-blue);
}

.error-container p {
    margin: 20px 0;
}

/* Logged-out homepage */
.home-hero {
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 16px;
    text-align: center;
}

.home-logo {
    max-width: 160px;
    width: 40%;
    height: auto;
    margin-bottom: 16px;
}

.home-hero h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.home-tagline {
    color: white;
    font-size: 1.2rem;
    line-height: 1.5;
    margin-bottom: 28px;
}

.home-note {
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 20px auto 28px;
    max-width: 480px;
}

.home-join {
    margin-bottom: 12px;
}

.home-secondary-link {
    color: var(--discord-blue);
    text-decoration: none;
}

.home-secondary-link:hover,
.home-secondary-link:focus {
    color: white;
    text-decoration: underline;
}

/* My games */
.loading-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.games-message {
    margin: 0 auto 20px;
    max-width: 800px;
    text-align: center;
}

.games-message a {
    color: var(--discord-blue);
}

.last-updated {
    font-size: 0.85em;
}

/* Sortable tables */
.sortable-table th[data-sort] {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sortable-table th[data-sort]:hover {
    color: var(--discord-blue);
}

.sortable-table th[data-sort]:focus-visible {
    outline: 2px solid var(--discord-blue);
    outline-offset: -2px;
}

.sortable-table th[aria-sort="ascending"]::after {
    content: " \25B2";
    font-size: 0.75em;
}

.sortable-table th[aria-sort="descending"]::after {
    content: " \25BC";
    font-size: 0.75em;
}

/* Donate: let long wallet addresses wrap instead of widening the page on phones */
.wallet-address {
    font-family: Consolas, Menlo, monospace;
    font-size: 0.9em;
    overflow-wrap: anywhere;
    word-break: break-all;
}

/* Page layout: the footer sits at the bottom even on short pages */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1 0 auto;
    padding: 20px 0;
}

/* Top bar */
.modern-nav {
    background-color: var(--discord-dark);
    padding: 10px 0;
}

.nav-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.modern-nav .nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    text-transform: none;
    letter-spacing: normal;
    margin-right: auto;
}

.nav-brand:hover,
.nav-brand:focus {
    color: white;
}

.nav-brand img {
    border-radius: 50%;
}

.modern-nav-links,
.nav-account {
    display: flex;
    align-items: center;
    gap: 20px;
}

.modern-nav a,
.nav-logout button {
    color: var(--discord-grey);
    text-decoration: none;
    text-transform: lowercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

.modern-nav-links a,
.nav-account a {
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}

.modern-nav-links a:hover,
.nav-account a:hover,
.nav-logout button:hover,
.nav-logout button:focus {
    color: var(--discord-blue);
}

.modern-nav-links a[aria-current="page"] {
    color: white;
    border-bottom-color: var(--discord-blue);
}

.modern-nav-links a.nav-discord {
    display: flex;
    color: var(--discord-blue);
}

.modern-nav-links a.nav-discord:hover,
.modern-nav-links a.nav-discord:focus {
    color: white;
}

.nav-discord .discord-icon {
    width: 22px;
    height: 22px;
}

.nav-account {
    gap: 12px;
    padding-left: 20px;
    border-left: 1px solid var(--discord-light);
}

.nav-user {
    color: white;
    font-size: 0.9rem;
}

.nav-logout {
    margin: 0;
}

.nav-logout button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

@media (max-width: 576px) {
    /* Tight enough to keep the bar on one line on a 360px-wide phone. */
    .nav-inner {
        gap: 8px 10px;
    }

    .nav-brand span,
    .nav-user {
        display: none;
    }

    .modern-nav-links,
    .nav-account {
        gap: 10px;
    }

    .nav-account {
        padding-left: 10px;
    }

    .nav-discord .discord-icon {
        width: 20px;
        height: 20px;
    }

    .modern-nav a,
    .nav-logout button {
        font-size: 0.85rem;
        letter-spacing: 0;
    }
}

/* Footer */
.site-footer {
    flex-shrink: 0;
    background-color: var(--discord-dark);
    padding: 20px 16px;
    text-align: center;
    font-size: 0.85rem;
}

.site-footer p {
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 20px;
    margin-top: 8px !important;
}

.site-footer a {
    color: var(--discord-blue);
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus {
    color: white;
    text-decoration: underline;
}

.site-footer .footer-discord {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Discord's logo, beside links to the server */
.discord-icon {
    display: inline-block;
    flex-shrink: 0;
    width: 1.2em;
    height: 1.2em;
}

/* Buttons that look like links */
.link-button {
    background: none;
    border: none;
    padding: 0;
    color: var(--discord-blue);
    font-size: inherit;
    cursor: pointer;
}

.link-button:hover,
.link-button:focus-visible {
    color: white;
    text-decoration: underline;
}

/* My games */
.turn-summary {
    color: white;
    margin-bottom: 20px;
}

.turn-summary:empty {
    display: none;
}

.games-table tbody tr.needs-turn > td:first-child {
    box-shadow: inset 4px 0 0 #ed4245;
}

.game-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
}

.game-title a {
    color: var(--discord-blue);
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.game-title a:hover,
.game-title a:focus {
    color: white;
    text-decoration: underline;
}

.turn-badge {
    background-color: #ed4245;
    color: white;
    border-radius: 10px;
    padding: 1px 9px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 14px;
    margin-top: 4px;
    font-size: 0.85rem;
}

.your-nation {
    color: white;
}

.nation-list {
    list-style: none;
    margin: 10px 0 2px;
    padding: 8px 10px;
    background-color: rgba(0, 0, 0, 0.18);
    border-radius: 6px;
    font-size: 0.85rem;
}

.nation-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 8px;
    padding: 2px 0;
}

.nation-list .nation-name {
    color: white;
}

.nation-list li:not(.to-play) .nation-name {
    color: var(--discord-grey);
}

.nation-list .nation-status {
    opacity: 0.8;
}

.nation-list .yours .nation-name {
    font-weight: 600;
}

.you-tag {
    background-color: var(--discord-blue);
    color: white;
    border-radius: 8px;
    padding: 0 7px;
    font-size: 0.75rem;
}

.countdown {
    color: white;
    white-space: nowrap;
}

.countdown.muted {
    color: var(--discord-grey);
}

.deadline {
    font-size: 0.85em;
    white-space: nowrap;
}

.status-key {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 18px;
    list-style: none;
    padding: 0;
    margin: 4px 0 12px;
    font-size: 0.8rem;
}

/* The bot's status emojis, drawn at the size of the text around them. */
.status-icon {
    display: inline-block;
    flex-shrink: 0;
    width: 1.2em;
    height: 1.2em;
    vertical-align: -0.25em;
}

.status-icon.no-icon {
    border: 2px solid var(--discord-grey);
    border-radius: 50%;
}

.game-title .status-icon {
    width: 1.35em;
    height: 1.35em;
}

@media (max-width: 768px) {
    /* Each game is a card: the game across the top, then turn, time left
       and ready side by side, each with a small caption. */
    .games-table tbody tr {
        display: grid;
        grid-template-columns: 1fr 2fr 1fr;
        border-left: 4px solid var(--discord-dark);
    }

    .games-table tbody tr.needs-turn {
        border-left-color: #ed4245;
    }

    .games-table tbody tr.needs-turn > td:first-child {
        box-shadow: none;
    }

    .games-table td.game-cell {
        grid-column: 1 / -1;
        padding: 10px;
    }

    .games-table td[data-label] {
        padding: 6px 10px 10px;
        text-align: left;
    }

    .games-table td[data-label]::before {
        position: static;
        display: block;
        width: auto;
        padding: 0;
        font-size: 0.75rem;
        font-weight: normal;
    }
}

/* Nation winrates */
.era-tabs {
    justify-content: center;
    gap: 6px;
    border-bottom: 1px solid var(--discord-light);
}

.era-tabs .nav-link {
    color: var(--discord-grey);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 8px 16px;
    margin-bottom: -1px;
}

.era-tabs .nav-link:hover,
.era-tabs .nav-link:focus-visible {
    color: white;
}

.era-tabs .nav-link.active {
    color: white;
    border-bottom-color: var(--discord-blue);
}

/* Specific enough to beat Bootstrap's colour for striped rows. */
.stats-table > tbody > tr > td:first-child {
    color: white;
}

.nation-epithet {
    color: var(--discord-grey);
}

.stats-table tr.small-sample td {
    opacity: 0.5;
}

/* Wins against the fair share: a bar either side of a line at the fair
   share, on a doubling scale, then the ratio in plain text. The bar's
   side says more or fewer; its colour repeats that, so colour is never
   the only cue. */
.fair-example {
    text-align: center;
    font-size: 0.9rem;
    font-style: italic;
}

.vs-fair {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.fair-bar {
    position: relative;
    display: inline-block;
    /* Shrinks with the window so the table never needs to scroll. */
    width: clamp(56px, 10vw, 120px);
    height: 8px;
    margin-right: 8px;
    vertical-align: middle;
}

/* The fair-share line */
.fair-bar::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -4px;
    bottom: -4px;
    width: 1px;
    background-color: rgba(255, 255, 255, 0.4);
}

.fair-fill {
    position: absolute;
    top: 0;
    bottom: 0;
}

/* Square where the bar leaves the line, rounded at its far end. */
.fair-more {
    left: 50%;
    border-radius: 0 4px 4px 0;
}

.fair-less {
    right: 50%;
    border-radius: 4px 0 0 4px;
}

.fair-above {
    background-color: #3987e5;
}

.fair-below {
    background-color: #e66767;
}

.fair-level {
    background-color: #7a7975;
}

@media (max-width: 768px) {
    /* One line per nation: keep the table layout, drop the epithet. */
    .stats-table {
        min-width: 0;
    }

    .nation-epithet {
        display: none;
    }
}

/* Below Bootstrap's small breakpoint the container is the full window, and
   the wins and fair-share columns would make the table scroll sideways. */
@media (max-width: 575.98px) {
    .hide-narrow {
        display: none;
    }
}

@media (max-width: 480px) {
    .fair-bar {
        margin-right: 6px;
    }

    .stats-table td, .stats-table th {
        padding: 7px 6px;
        font-size: 13px;
    }
}

@media (max-width: 359.98px) {
    .stats-table td, .stats-table th {
        padding: 6px 3px;
    }
}

/* Join a game on Envoy's server */
.join-title {
    word-break: break-word;
}

.join-steps {
    display: inline-block;
    max-width: 34em;
    margin: 0 auto 16px;
    padding-left: 1.4em;
    text-align: left;
}

.join-steps li + li {
    margin-top: 6px;
}

.join-manual {
    margin-top: 28px;
    font-size: 0.95rem;
}

.join-manual h2 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.join-manual p {
    margin-bottom: 8px;
}

.join-address {
    display: inline-block;
    padding: 4px 10px;
    font-size: 1rem;
    word-break: break-all;
}

.join-copy {
    margin-left: 6px;
    padding: 2px 10px;
    font-size: 0.85rem;
    vertical-align: middle;
}

/* Envoy's servers */
.capacity-panel .capacity-headline {
    font-size: 1.15em;
    font-weight: 600;
}

/* How many of the cap's games are in use: a track filled from the left,
   with the count written above it, so the bar is never the only cue. */
.capacity-bar {
    display: block;
    height: 10px;
    max-width: 360px;
    margin: 8px auto 12px;
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.capacity-fill {
    display: block;
    height: 100%;
    background-color: var(--discord-blue);
}

.capacity-full {
    background-color: #e66767;
}

.servers-table .server-game {
    overflow-wrap: anywhere;
}

.servers-empty {
    font-style: italic;
}

/* My games: a game on Envoy's server, and its Launch link */
.server-tag {
    color: var(--discord-grey);
    font-style: italic;
}

.launch-link {
    font-weight: 600;
    white-space: nowrap;
}

/* One game on Envoy's servers */
.server-game-heading {
    overflow-wrap: anywhere;
}

.server-game-facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 28px;
    margin: 0;
}

.server-game-facts + .server-game-facts {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(87, 72, 51, .35);
}

.server-game-facts dt {
    font-size: 0.8rem;
    font-weight: normal;
    opacity: 0.8;
}

.server-game-facts dd {
    margin: 0;
    font-weight: 600;
}

.server-game-section {
    margin: 26px 0 10px;
}

.server-nation,
.host-log-table td {
    overflow-wrap: anywhere;
}

.host-log-when {
    white-space: nowrap;
}

.host-log-tag {
    border-radius: 2px;
    padding: 0 6px;
    font-size: 0.75rem;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .host-log-when {
        white-space: normal;
    }
}

/* Help pages: a contents list beside the text. The text comes from the
   Envoy API as plain paragraphs, lists and headings. */
.help-container {
    max-width: 1100px;
}

.help-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.help-contents {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 14px 16px;
    background-color: var(--discord-dark);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    font-size: 0.9rem;
}

.help-contents ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.help-contents li + li {
    margin-top: 6px;
}

.help-contents a {
    color: var(--discord-grey);
    text-decoration: none;
}

.help-contents a:hover,
.help-contents a:focus {
    color: var(--discord-blue);
    text-decoration: underline;
}

.help-back {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

.help-contents-label {
    margin: 14px 0 6px;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--discord-grey);
    opacity: 0.75;
}

.help-article,
.help-card {
    padding: 22px 28px;
    background-color: var(--discord-dark);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: #e6e1d6;
    line-height: 1.6;
}

.help-article {
    max-width: 78ch;
}

.help-article h2 {
    margin: 0 0 12px;
    font-size: 1.45rem;
}

.help-article h3 {
    margin: 22px 0 8px;
    font-size: 1.08rem;
    color: #ffffff;
}

.help-section + .help-section,
.help-intro + .help-section {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* A linked section lands below the top edge, not under it. */
.help-section,
.help-article h3 {
    scroll-margin-top: 16px;
}

.help-anchor {
    color: var(--discord-blue);
    text-decoration: none;
}

.help-anchor:hover::after,
.help-anchor:focus::after {
    content: " #";
    opacity: 0.6;
}

.help-article a:not(.help-anchor),
.help-card a,
.help-ask a {
    color: var(--discord-blue);
}

.help-article ul,
.help-article ol {
    padding-left: 1.4em;
}

.help-article li + li {
    margin-top: 5px;
}

.help-article code {
    padding: 1px 5px;
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.08);
    color: #f3ead3;
    font-size: 0.9em;
    overflow-wrap: anywhere;
}

.help-note {
    font-size: 0.88rem;
    color: var(--discord-grey);
}

.help-cards {
    /* The container centres its children; the grid takes the full width. */
    align-self: stretch;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.help-card h3 {
    margin: 0 0 6px;
    font-size: 1.2rem;
}

.help-card h3 a {
    text-decoration: none;
}

.help-card p {
    color: var(--discord-grey);
    font-size: 0.92rem;
}

.help-card ul {
    margin: 0;
    padding-left: 1.2em;
    font-size: 0.92rem;
}

.help-ask {
    margin-top: 22px;
    text-align: center;
    color: var(--discord-grey);
}

@media (max-width: 768px) {
    .help-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .help-contents {
        position: static;
        max-height: none;
    }

    .help-article,
    .help-card {
        padding: 16px 16px;
    }
}

/* The notice in the corner of every page (templates/base.html, announcement.js) */
.site-toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1040;
    width: min(360px, calc(100vw - 32px));
    padding: 14px 40px 12px 16px;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
    font-size: .95rem;
    line-height: 1.4;
}

.site-toast[hidden] {
    display: none;
}

.site-toast p {
    margin: 0 0 8px;
}

.site-toast-title {
    font-weight: 700;
}

.site-toast-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-bottom: 0;
}

.site-toast-close {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 32px;
    height: 32px;
    border: 0;
    background: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

/* The donate page's cost panel: each monthly cost and the total. */
/* The page centres its rows, which would shrink this one to its table. */
body.donate .funding-row {
    align-self: stretch;
}

body.donate .funding-panel .capacity-bar {
    max-width: 420px;
}

body.donate .funding-costs {
    width: 100%;
    max-width: 420px;
    margin: 4px auto 16px;
    text-align: left;
    border-collapse: collapse;
}

body.donate .funding-costs th,
body.donate .funding-costs td {
    padding: 6px 4px;
    font-weight: normal;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.donate .funding-costs td {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

body.donate .funding-costs tfoot th,
body.donate .funding-costs tfoot td {
    font-weight: bold;
    border-bottom: none;
}

body.donate .funding-detail {
    display: block;
    font-size: 0.85em;
    opacity: 0.7;
}
