main > .container {
    padding: 60px 15px 0;
}

/* The banner of a non-production stage, e.g. the dev site (templates/_/_stage_banner.html.twig):
   fixed above the fixed navbar, which moves down by its height, as does the page. */
:root {
    --stage-banner-height: 1.75rem;
}

.stage-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1031; /* above Bootstrap's .fixed-top (1030) */
    height: var(--stage-banner-height);
    line-height: var(--stage-banner-height);
    background-color: #D32F2F;
    color: #fff;
    letter-spacing: .03em;
}

.has-stage-banner .fixed-top {
    top: var(--stage-banner-height);
}

.has-stage-banner main > .container {
    padding-top: calc(60px + var(--stage-banner-height));
}

/* Orange instead of Bootstrap's blue as the primary color, as in the documentation: links,
   primary buttons, form controls and active menu items */
:root,
[data-bs-theme=light] {
    --bs-primary: #c2410c;
    --bs-primary-rgb: 194, 65, 12;
    --bs-primary-text-emphasis: #7c2d12;
    --bs-primary-bg-subtle: #ffedd5;
    --bs-primary-border-subtle: #fdba74;
    --bs-link-color: #9a3412;
    --bs-link-color-rgb: 154, 52, 18;
    --bs-link-hover-color: #7c2d12;
    --bs-link-hover-color-rgb: 124, 45, 18;
    --bs-focus-ring-color: rgba(194, 65, 12, .25);
}

[data-bs-theme=dark] {
    --bs-primary-text-emphasis: #fdba74;
    --bs-primary-bg-subtle: #431407;
    --bs-primary-border-subtle: #7c2d12;
    --bs-link-color: #f97316;
    --bs-link-color-rgb: 249, 115, 22;
    --bs-link-hover-color: #fb923c;
    --bs-link-hover-color-rgb: 251, 146, 60;
}

.btn-primary {
    --bs-btn-bg: #c2410c;
    --bs-btn-border-color: #c2410c;
    --bs-btn-hover-bg: #9a3412;
    --bs-btn-hover-border-color: #9a3412;
    --bs-btn-active-bg: #7c2d12;
    --bs-btn-active-border-color: #7c2d12;
    --bs-btn-disabled-bg: #c2410c;
    --bs-btn-disabled-border-color: #c2410c;
    --bs-btn-focus-shadow-rgb: 194, 65, 12;
}

.btn-outline-primary {
    --bs-btn-color: #9a3412;
    --bs-btn-border-color: #c2410c;
    --bs-btn-hover-bg: #c2410c;
    --bs-btn-hover-border-color: #c2410c;
    --bs-btn-active-bg: #9a3412;
    --bs-btn-active-border-color: #9a3412;
    --bs-btn-disabled-color: #9a3412;
    --bs-btn-disabled-border-color: #c2410c;
    --bs-btn-focus-shadow-rgb: 194, 65, 12;
}

[data-bs-theme=dark] .btn-outline-primary {
    --bs-btn-color: #f97316;
    --bs-btn-border-color: #f97316;
    --bs-btn-disabled-color: #f97316;
    --bs-btn-disabled-border-color: #f97316;
}

.dropdown-menu {
    --bs-dropdown-link-active-bg: #c2410c;
}

.nav-pills {
    --bs-nav-pills-link-active-bg: #c2410c;
}

.pagination {
    --bs-pagination-active-bg: #c2410c;
    --bs-pagination-active-border-color: #c2410c;
    --bs-pagination-focus-box-shadow: 0 0 0 .25rem rgba(194, 65, 12, .25);
}

.form-check-input:checked,
.form-check-input[type=checkbox]:indeterminate {
    background-color: #c2410c;
    border-color: #c2410c;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: #fdba74;
    box-shadow: 0 0 0 .25rem rgba(194, 65, 12, .25);
}

.form-switch .form-check-input:focus:not(:checked) {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fdba74'/%3e%3c/svg%3e");
}

.form-range::-webkit-slider-thumb {
    background-color: #c2410c;
}

.form-range::-moz-range-thumb {
    background-color: #c2410c;
}

.bg-logo {
    display: inline-block;
    width: 32px;
    height: 32px;
    background-image: url("../images/wtfpl-logo-c20L-_h.png");
    background-size: contain;
    background-repeat: no-repeat;
}
.landing-icon {
    filter: drop-shadow(0 0 24px rgba(234, 88, 12, .45));
}

/* The title in the logo's Enlightened green and Resistance blue, as in the documentation */
.landing-title {
    width: fit-content;
    margin-inline: auto;
    background: linear-gradient(120deg, #2bb866 30%, #2f7df6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* The sign-in page: a card with an orange top edge; the space of the Google button is kept
   while its script loads */
.login-card {
    border-top: 4px solid var(--bs-primary);
}

.login-google {
    min-height: 44px;
}

/* Google's button is a light page, also the dark button: with the dark theme's color scheme
   the browser would paint a white box behind its frame */
.login-google iframe {
    color-scheme: light;
}

.login-dev {
    border-style: dashed;
}

/* The profile parts that are only shown with the agent part: hanging from it by a line */
.visibility-parts {
    margin-left: .5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--bs-primary);
}

.visibility-parts:disabled {
    border-left-style: dashed;
    border-left-color: var(--bs-border-color);
}

/* The orange accent; a darker orange on light backgrounds */
.landing-accent {
    color: #9a3412;
}

[data-bs-theme="dark"] .landing-accent {
    color: #f97316;
}

.landing-feature {
    transition: transform .15s ease-in-out, box-shadow .15s ease-in-out;
}

.landing-feature:hover {
    transform: translateY(-3px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}

/* Agent stats and medals, as in the app */
.medal-badge {
    width: 50px;
    height: 50px;
}

.medal-count {
    font-weight: bold;
    font-size: .875rem;
}

.medal-locked {
    opacity: .6;
}

/* The padlock is black: light in dark mode */
[data-bs-theme="dark"] .medal-locked {
    filter: invert(1);
}

.medal-button {
    padding: 0;
    border: 0;
    background: none;
}

.agent-nickname {
    font-family: var(--bs-font-monospace);
}

/* Faction colors, as 4e-website's; its RES blue is too dark on a dark background */
.faction-ENL {
    color: #1ab60d;
}

.faction-RES {
    color: #0000cc;
}

[data-bs-theme="dark"] .faction-RES {
    color: #7474ff;
}

.faction-logo {
    height: 32px;
}

.faction-logo-small {
    height: 20px;
}

/* The Google profile picture */
.avatar {
    border-radius: 50%;
    object-fit: cover;
}

/* Fixed slots in the list of agents, so the names line up */
.agent-slot-avatar,
.agent-slot-logo {
    display: inline-block;
    margin-right: .25rem;
    text-align: center;
    vertical-align: middle;
}

.agent-slot-avatar {
    width: 24px;
}

.agent-slot-logo {
    width: 16px;
}

.privacy-icons i {
    margin-right: .15rem;
}

/* The timeline's colors (validated for both themes): AP, events and events over several days (travels) */
:root,
[data-bs-theme=light] {
    --timeline-ap: #0d6efd;
    --timeline-event: #b07400;
    --timeline-travel: #0086b3;
}

[data-bs-theme=dark] {
    --timeline-ap: #4d8ef7;
    --timeline-event: #bd8500;
    --timeline-travel: #1aa3c2;
}

/* The calendar's colors per event type, in both themes (the app's ui/EventsScreen.kt) */
:root,
[data-bs-theme=light] {
    --event-anomaly: #c62828;
    --event-mission-day: #0d6efd;
    --event-first-saturday: #2e7d32;
    --event-second-sunday: #7b1fa2;
    --event-shard: #b07400;
    --event-global: #6c757d;
}

[data-bs-theme=dark] {
    --event-anomaly: #ef5350;
    --event-mission-day: #4d8ef7;
    --event-first-saturday: #66bb6a;
    --event-second-sunday: #ba68c8;
    --event-shard: #ffb300;
    --event-global: #adb5bd;
}

/* The calendar of Ingress events (events/index.html.twig): seven equal columns */
.event-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
}

.event-calendar-width {
    max-width: 42rem;
}

.event-calendar-weekday {
    padding-bottom: .25rem;
    color: var(--bs-secondary-color);
    font-size: .8rem;
    text-align: center;
}

.event-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 3.25rem;
    padding: .25rem 0;
    border: 1px solid transparent;
    border-radius: var(--bs-border-radius);
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    text-decoration: none;
}

a.event-day:hover {
    border-color: var(--bs-border-color);
}

.event-day-outside {
    background: none;
}

.event-day-today {
    border-color: var(--bs-primary);
    font-weight: 600;
}

.event-day-selected {
    background: var(--bs-primary-bg-subtle);
    border-color: var(--bs-primary);
}

.event-day-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
}

.event-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.event-day-ongoing,
.event-key-ongoing {
    display: block;
    height: 3px;
    border-radius: 2px;
    background: var(--event-global);
}

.event-day-ongoing {
    position: absolute;
    right: 4px;
    bottom: 3px;
    left: 4px;
}

.event-key-ongoing {
    display: inline-block;
    width: 14px;
    vertical-align: 2px;
}

.event-anomaly { background: var(--event-anomaly); }
.event-mission_day { background: var(--event-mission-day); }
.event-first_saturday { background: var(--event-first-saturday); }
.event-second_sunday { background: var(--event-second-sunday); }
.event-shard { background: var(--event-shard); }
.event-global { background: var(--event-global); }

/* The history documents (history/index.html.twig); the years' links stop below the fixed navbar */
.history [id^="year-"],
.history [id^="attend-"] {
    scroll-margin-top: 4.5rem;
}

.history-medal {
    object-fit: contain;
}

.history-series .history-medal {
    margin-right: .5rem;
}

.history-table td:first-child {
    white-space: nowrap;
}

/* The timeline of stats uploads and custom events (agent_stat/_timeline.html.twig) */
.timeline {
    border-left: 2px solid var(--bs-border-color);
    /* Room for the travel line beside it */
    margin-left: 1.25rem;
    padding-left: 1.25rem;
}

.timeline-entry {
    position: relative;
    padding-bottom: 1rem;
}

.timeline-entry::before {
    content: "";
    position: absolute;
    left: calc(-1.25rem - 7px);
    top: .3rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bs-secondary-bg);
    border: 2px solid var(--bs-secondary-color);
    z-index: 1;
}

.timeline-event::before {
    background: var(--timeline-event);
    border-color: var(--timeline-event);
}

.timeline-travel::before {
    background: var(--timeline-travel);
    border-color: var(--timeline-travel);
}

/*
 * A travel's line beside the timeline: from its end (newest first: above) to its start, through
 * the entries in it, with an elbow to the dot of the end and of the start. Travels cannot overlap.
 */
.timeline-travel::after,
.timeline-in-travel::after {
    content: "";
    position: absolute;
    left: calc(-1.25rem - 2px - 12px);
    width: 12px;
    border: 0 solid var(--timeline-travel);
    border-left-width: 3px;
}

.timeline-in-travel::after {
    top: 0;
    bottom: 0;
}

.timeline-travel-end::after {
    /* From the middle of the dot down */
    top: calc(.3rem + 7px);
    bottom: 0;
    border-top-width: 3px;
    border-top-left-radius: 6px;
}

.timeline-travel-start::after {
    top: 0;
    height: calc(.3rem + 7px);
    border-bottom-width: 3px;
    border-bottom-left-radius: 6px;
}

/* A year's label on the timeline, before its newest entry: on the line, as the app's */
.timeline-year {
    position: relative;
    padding-bottom: .75rem;
}

.timeline-year-label {
    position: relative;
    z-index: 2;
    display: inline-block;
    /* Centered on the line */
    left: calc(-1.25rem - 1px);
    transform: translateX(-50%);
    padding: .1rem .6rem;
    border: 2px solid var(--bs-secondary-color);
    border-radius: 1rem;
    background: var(--bs-secondary-bg);
    color: var(--bs-emphasis-color);
    font-weight: 700;
}

/* Without the travels, no line */
.timeline-no-travels .timeline-in-travel::after {
    display: none;
}

.timeline-upload::before {
    border-color: var(--timeline-ap);
}

.timeline-event-icon {
    color: var(--timeline-event);
}

.timeline-travel-icon {
    color: var(--timeline-travel);
}

.timeline-text {
    white-space: pre-line;
}

/* Bannergress banners done: neutral, the pictures carry the color */
.timeline-banner::before {
    background: var(--bs-secondary-color);
}

/* A banner done opens to its picture */
.timeline-medal::before {
    background: var(--timeline-event);
    border-color: var(--timeline-event);
}

.timeline-banner-details > summary {
    cursor: pointer;
}

.timeline-banner-icon {
    color: var(--bs-secondary-color);
}

/* The banners' world map: a dot per list, in the timeline's validated colors */
:root {
    --banner-published: var(--timeline-ap);
    --banner-done: var(--timeline-event);
    --banner-todo: var(--timeline-travel);
}

.banner-map {
    height: 360px;
}

.banner-map-key {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    vertical-align: -1px;
}

.banner-map-key-published {
    background: var(--banner-published);
}

.banner-map-key-done {
    background: var(--banner-done);
}

.banner-map-key-todo {
    background: var(--banner-todo);
}

/* Banner pictures: six missions wide, so keep them low */
.banner-picture {
    max-width: 100%;
    max-height: 96px;
}

/* Until the picture is loaded: the loading animation in its place. The picture stays in the
   layout (invisible): a lazy one would not load otherwise */
.banner-picture-frame {
    position: relative;
}

.banner-picture-frame:not(.banner-picture-loaded) {
    min-height: 2.5rem;
}

.banner-picture-frame:not(.banner-picture-loaded) .banner-picture {
    opacity: 0;
}

.banner-picture-spinner {
    position: absolute;
    top: .75rem;
    left: 0;
}

.banner-picture-loaded .banner-picture-spinner {
    display: none;
}

.timeline-badge {
    width: 32px;
    height: 32px;
}

/* The timeline chart (agent_stat/_timeline_chart.html.twig) */
.timeline-chart svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

.timeline-chart .chart-grid {
    stroke: var(--bs-border-color-translucent);
    stroke-width: 1;
}

.timeline-chart .chart-baseline {
    stroke: var(--bs-secondary-color);
    stroke-width: 1;
}

.timeline-chart .chart-axis,
.timeline-chart .chart-label {
    fill: var(--bs-secondary-color);
    font-size: 12px;
}

.timeline-chart .chart-label {
    fill: var(--bs-body-color);
}

.timeline-chart .chart-line {
    fill: none;
    stroke: var(--timeline-ap);
    stroke-width: 2;
    stroke-linejoin: round;
}

/* A ring of the surface around each dot, so dots on the line stay apart */
.timeline-chart .chart-dot {
    fill: var(--timeline-ap);
    stroke: var(--bs-body-bg);
    stroke-width: 2;
}

.timeline-chart .chart-flag-rule {
    stroke: var(--timeline-event);
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.timeline-chart .chart-flag-mark {
    fill: var(--timeline-event);
}

.timeline-chart .chart-band-fill {
    fill: var(--timeline-travel);
    opacity: .15;
}

.timeline-chart .chart-band-edge {
    fill: var(--timeline-travel);
}

.timeline-chart .chart-hit {
    fill: transparent;
}

.timeline-chart g:hover .chart-dot {
    r: 7;
}

/* Many uploads: the line alone, the dot on hover */
.timeline-chart.dense .chart-dot {
    r: 0;
}

.timeline-chart.dense g:hover .chart-dot {
    r: 6;
}

.timeline-chart g:hover .chart-band-fill {
    opacity: .25;
}

.chart-key {
    display: inline-block;
    width: 14px;
    height: 10px;
    border-radius: 2px;
    vertical-align: baseline;
}

.chart-key-ap {
    height: 2px;
    vertical-align: middle;
    background: var(--timeline-ap);
}

.chart-key-travel {
    background: var(--timeline-travel);
    opacity: .5;
}

/*
 * The timeline's date range calendar (flatpickr, timeline_filter_controller.js) in the site's colors and
 * theme: only the days with an upload can be picked, they are marked with a dot (another color for several). With html: flatpickr's
 * own stylesheet loads after this one.
 */
html .flatpickr-calendar {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    box-shadow: var(--bs-box-shadow);
    border-radius: var(--bs-border-radius-lg);
    font-family: inherit;
}

html .flatpickr-calendar.arrowTop::before,
html .flatpickr-calendar.arrowTop::after {
    border-bottom-color: var(--bs-border-color);
}

html .flatpickr-calendar.arrowBottom::before,
html .flatpickr-calendar.arrowBottom::after {
    border-top-color: var(--bs-border-color);
}

html .flatpickr-months .flatpickr-month,
html .flatpickr-current-month .flatpickr-monthDropdown-months,
html .flatpickr-current-month input.cur-year,
html .flatpickr-weekday,
html .flatpickr-months .flatpickr-prev-month,
html .flatpickr-months .flatpickr-next-month {
    color: var(--bs-body-color);
    fill: var(--bs-body-color);
    background: transparent;
}

html span.flatpickr-weekday {
    color: var(--bs-secondary-color);
}

/* The month list (a native select): its options in the theme's colors, flatpickr's are transparent */
html .flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

html .flatpickr-current-month .flatpickr-monthDropdown-months:hover,
html .flatpickr-current-month input.cur-year:hover,
html .flatpickr-current-month .numInputWrapper:hover {
    background: var(--bs-secondary-bg);
}

html .flatpickr-current-month .numInputWrapper span.arrowUp::after {
    border-bottom-color: var(--bs-body-color);
}

html .flatpickr-current-month .numInputWrapper span.arrowDown::after {
    border-top-color: var(--bs-body-color);
}

html .flatpickr-months .flatpickr-prev-month:hover svg,
html .flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--bs-primary);
}

html .flatpickr-day {
    color: var(--bs-body-color);
    border-radius: var(--bs-border-radius);
}

/* Days without an upload and of the months around: only their number dimmed, so a range's tint stays even */
html .flatpickr-day.flatpickr-disabled,
html .flatpickr-day.flatpickr-disabled:hover,
html [aria-disabled="true"].flatpickr-day,
html .flatpickr-day.prevMonthDay,
html .flatpickr-day.nextMonthDay {
    color: color-mix(in srgb, var(--bs-secondary-color) 55%, transparent);
}

html .flatpickr-day:not(.flatpickr-disabled):hover,
html .flatpickr-day.inRange,
html .flatpickr-day.prevMonthDay.inRange,
html .flatpickr-day.nextMonthDay.inRange {
    background: color-mix(in srgb, var(--bs-primary) 18%, transparent);
    border-color: transparent;
    box-shadow: none;
}

html .flatpickr-day.today {
    border-color: var(--bs-border-color);
}

html .flatpickr-day.selected,
html .flatpickr-day.startRange,
html .flatpickr-day.endRange,
html .flatpickr-day.selected:hover,
html .flatpickr-day.startRange:hover,
html .flatpickr-day.endRange:hover {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

/* Enabled for flatpickr (a range spans them), but not clickable */
html [aria-disabled="true"].flatpickr-day {
    pointer-events: none;
}

html .flatpickr-day.timeline-upload-day {
    font-weight: 600;
    position: relative;
}

/* A dot under the days with an upload */
html .flatpickr-day.timeline-upload-day::after {
    content: "";
    position: absolute;
    bottom: 3px;
    left: 50%;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    background: var(--timeline-ap);
}

/* A day with several uploads: a dot in the travel color, there are times to pick */
html .flatpickr-day.timeline-uploads-day::after {
    background: var(--timeline-travel);
}

html .flatpickr-day.timeline-upload-day.selected::after,
html .flatpickr-day.timeline-upload-day.startRange::after,
html .flatpickr-day.timeline-upload-day.endRange::after {
    background: #fff;
}

/* The times of a day with many uploads */
.timeline-time-select {
    width: auto;
}

/* The times of a day with several uploads: hidden overrides .d-flex */
.timeline-times[hidden] {
    display: none !important;
}

/* The timeline chart's tooltip (chart_tooltip_controller.js): a small card in the theme's colors */
.timeline-chart {
    position: relative;
}

.chart-tooltip {
    position: absolute;
    z-index: 10;
    max-width: min(18rem, 100%);
    padding: .375rem .625rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    box-shadow: var(--bs-box-shadow-sm);
    font-size: .875rem;
    line-height: 1.35;
    pointer-events: none;
}

.chart-tooltip-heading {
    display: flex;
    align-items: center;
    gap: .375rem;
    font-weight: 600;
}

.chart-tooltip-key {
    flex: none;
    width: .625rem;
    height: .625rem;
    border-radius: 50%;
}

.chart-tooltip-key-ap {
    background: var(--timeline-ap);
}

.chart-tooltip-key-event {
    background: var(--timeline-event);
    border-radius: 2px;
}

.chart-tooltip-key-travel {
    background: var(--timeline-travel);
    border-radius: 2px;
}

/* An event's text keeps its lines */
.chart-tooltip-body {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.chart-tooltip-extra {
    color: var(--bs-success-text-emphasis);
    font-weight: 600;
}

/* The mark with the keyboard's focus, as on hover */
.timeline-chart g:focus {
    outline: none;
}

.timeline-chart g:focus-visible .chart-dot {
    r: 7;
}

/* The site's tooltips (tooltip_controller.js) look like the chart's, over everything */
.app-tooltip {
    position: fixed;
    z-index: 1090;
}
